examples.diffusion.steadyState.otherMeshes package

Submodules

examples.diffusion.steadyState.otherMeshes.cubicalProblem module

Test case for the Grid3D. Diffusion problem with boundary conditions: 0 on front, 10 on back, and 5 on all other sides.

examples.diffusion.steadyState.otherMeshes.grid3Dinput module

Test case for the Grid3D.

>>> DiffusionTerm().solve(var)
>>> DiffusionTerm().solve(var2)
>>> a = numerix.array(var.globalValue)
>>> b = numerix.array(var2.globalValue)
>>> c = numerix.ravel(numerix.array((b, b, b)))
>>> print(numerix.allclose(a, c))
1

examples.diffusion.steadyState.otherMeshes.prism module

This input file again solves a 1D diffusion problem as in ./examples/diffusion/steadyState/mesh1D/input.py. The difference being that it uses a triangular mesh loaded in using the Gmsh.

The result is again tested in the same way:

>>> from fipy import CellVariable, GmshGrid3D, DiffusionTerm
>>> valueLeft = 0.
>>> valueRight = 1.
>>> mesh = GmshGrid3D(dx=1, dy=1, dz=1, nx=20, ny=1, nz=1) 
>>> var = CellVariable(name = "solution variable",
...                    mesh = mesh,
...                    value = valueLeft) 
>>> exteriorFaces = mesh.exteriorFaces 
>>> xFace = mesh.faceCenters[0] 
>>> var.constrain(valueLeft, exteriorFaces & (xFace ** 2 < 0.000000000000001)) 
>>> var.constrain(valueRight, exteriorFaces & ((xFace - 20) ** 2 < 0.000000000000001)) 
>>> DiffusionTerm().solve(var) 
>>> Lx = 20
>>> x = mesh.cellCenters[0] 
>>> analyticalArray = valueLeft + (valueRight - valueLeft) * x / Lx 
>>> print(var.allclose(analyticalArray, atol = 0.027)) 
1
Last updated on Jun 27, 2023. Created using Sphinx 6.2.1.