A small package for solving Fick's Second law in 1-dimension for various geometries
Project description
fick1d
This package is for simulating non-steady state diffusion according to Fick's Second law of diffusion in 1 dimension.
Installation
pip install fick1d
Current 1-D models supported:
- Slab
- Cylinder
- Sphere
- Diffusion Couple
- Thin Film
Example Usage
import fick1d
import matplotlib.pyplot as plt
times = [100,200,300] # 100,200,300 seconds after diffusion starts
slab_thickness = .1 # .1 meters thick slab
diffusivity = 1.88e-5 # diffusivity of material to be simulated in m^2/s
interface_concentration = .5 # concenttration at interface for slab in m^2/s
initial_concentration = 0 # initial concenttration for slab in m^2/s
results = fick1d.slab.slab( times, slab_thickness, diffusivity, interface_concentration, initial_concentraton)
for i in range(len(times)):
plt.title(fun)
plt.plot(linspace(0,slab_thickness,1000),results[i],label = str(times[i]))
plt.legend()
plt.show()
Fick's second law
This is the general pde that governs diffusion in solids.
Thin Film Solution:
Slab Solution
Sphere Solution
Assuming only radial diffusion,
With the limit as r -> 0 i.e. the concentration at the center of the sphere
Cylinder Solution
Assuming only radial diffusion,
Diffusion Couple Solution
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Author
Kieran Nehil github
Source for Math:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fick1d-0.0.1.tar.gz
(5.7 kB
view hashes)