Download data/tests/unit/models/phase/DiffusivityTest.py from introvoyz042/OpenPNM: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/datasets/introvoyz042/OpenPNM/resolve/main/data/tests/unit/models/phase/DiffusivityTest.py
- Command line
-
hf download hf://datasets/introvoyz042/OpenPNM/data/tests/unit/models/phase/DiffusivityTest.py
-
curl -L -o DiffusivityTest.py https://huggingface.co/datasets/introvoyz042/OpenPNM/resolve/main/data/tests/unit/models/phase/DiffusivityTest.py
1.02 kB
| from numpy.testing import assert_approx_equal | |
| import openpnm as op | |
| class DiffusivityTest: | |
| def setup_class(self): | |
| self.net = op.network.Cubic(shape=[3, 3, 3]) | |
| self.phase = op.phase.Phase(network=self.net) | |
| self.phase['pore.temperature'] = 298.0 # K | |
| self.phase['pore.pressure'] = 101325 # Pa | |
| self.phase['pore.viscosity'] = 1.75e-5 # Pa.s | |
| def test_fuller(self): | |
| f = op.models.phase.diffusivity.gas_mixture_fesg | |
| self.phase.add_model(propname='pore.diffusivity', | |
| model=f, | |
| MWs=[31.9988, 28.0134], | |
| Vdms=[16.6, 17.9],) | |
| self.phase.regenerate_models() | |
| assert_approx_equal(self.phase['pore.diffusivity'][0], 2.094693935e-05) | |
| if __name__ == '__main__': | |
| t = DiffusivityTest() | |
| self = t | |
| t.setup_class() | |
| for item in t.__dir__(): | |
| if item.startswith('test'): | |
| print(f"Running test: {item}") | |
| t.__getattribute__(item)() | |