examples.diffusion.steadyState.mesh20x20.tri2DinputΒΆ

This input file again solves a 2D diffusion problem on a triangular mesh. We increase the solver tolerance from the default \(10^{-5}\) in order to achieve a good solution.

>>> eq = DiffusionTerm()
>>> solver = eq.getDefaultSolver(tolerance=1e-10)
>>> eq.solve(var, solver=solver)

The result is again tested in the same way:

>>> Lx = nx * dx
>>> x = mesh.cellCenters[0]
>>> analyticalArray = valueLeft + (valueRight - valueLeft) * x / Lx
>>> print(var.allclose(analyticalArray, rtol = 1e-8))
True
Last updated on Jun 26, 2024. Created using Sphinx 7.1.2.