Skip to main content

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.

Slab Solution

Slab

Thin Film Solution:

Thin Film

Sphere Solution

Assuming only radial diffusion,

With the limit as r -> 0 i.e. the concentration at the center of the sphere

Sphere

Cylinder Solution

Assuming only radial diffusion,

Cylinder

Diffusion Couple Solution

Diffusion Couple

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:

http://www-eng.lbl.gov/~shuman/NEXT/MATERIALS&COMPONENTS/Xe_damage/Crank-The-Mathematics-of-Diffusion.pdf

Project details


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.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fick1d-0.0.2-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file fick1d-0.0.2.tar.gz.

File metadata

  • Download URL: fick1d-0.0.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.6

File hashes

Hashes for fick1d-0.0.2.tar.gz
Algorithm Hash digest
SHA256 68bfd6afb627950fe649f8345a45f865e6b3fdc5fea30a32af52cc84a090cf91
MD5 7be5a0ff050c27f86bb2e8eef4fa4e27
BLAKE2b-256 6b2e63dd5c16b6d1c96ab33f2d85863470efddc690f25d9a9fcd6300dc58ce63

See more details on using hashes here.

File details

Details for the file fick1d-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: fick1d-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.6

File hashes

Hashes for fick1d-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f2b93718776d3cec4c9c43be2cb2f0e1c30a8f4eda9176f007122f6167d77bd5
MD5 10a6695a0653d4c2e463346e5b01f107
BLAKE2b-256 c1b6cf70eac34b4fe6798056e17f9baa2b23d67cd9d8434ebee5b63fb2cc1da7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page