Download data/src/openpnm/algorithms/_fickian_diffusion.py from introvoyz042/OpenPNM: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/datasets/introvoyz042/OpenPNM/resolve/main/data/src/openpnm/algorithms/_fickian_diffusion.py
- Command line
-
hf download hf://datasets/introvoyz042/OpenPNM/data/src/openpnm/algorithms/_fickian_diffusion.py
-
curl -L -o _fickian_diffusion.py https://huggingface.co/datasets/introvoyz042/OpenPNM/resolve/main/data/src/openpnm/algorithms/_fickian_diffusion.py
1.46 kB
| import logging | |
| from openpnm.algorithms import ReactiveTransport | |
| from openpnm.utils import Docorator | |
| docstr = Docorator() | |
| logger = logging.getLogger(__name__) | |
| __all__ = ['FickianDiffusion'] | |
| class FickianDiffusionSettings(): | |
| r""" | |
| Parameters | |
| ---------- | |
| %(ReactiveTransportSettings.parameters)s | |
| """ | |
| quantity = 'pore.concentration' | |
| conductance = 'throat.diffusive_conductance' | |
| class FickianDiffusion(ReactiveTransport): | |
| r""" | |
| A class to simulate binary diffusion with reactions | |
| Parameters | |
| ---------- | |
| %(ReactiveTransport.parameters)s | |
| Notes | |
| ----- | |
| Fickian diffusion in porous materials occurs in the void space, but | |
| becuase the diffusion is confined to pores it is impacted by the porosity | |
| and tortuosity of the network. Thus the total diffusive flux through the | |
| network is reduced. This class can be used to simualte diffusion-reaction | |
| in domains with specified boundary conditions, or it can be used | |
| to calculate the effective diffusivity of the network by applying | |
| controlled boundary conditions on opposing faces, calculating the | |
| diffusion rate, and inverting Fick's first law as follows: | |
| .. math:: | |
| D_{eff} = N_{A}*L/(A*\Delta C_{A}) | |
| """ | |
| def __init__(self, name='fick_?', **kwargs): | |
| super().__init__(name=name, **kwargs) | |
| self.settings._update(FickianDiffusionSettings()) | |
| self.name = name | |