examples.levelSet.surfactant.squareΒΆ

This example advects a 2 by 2 initially square region outwards. The example checks for global conservation of surfactant.

Advect the interface and check the position.

>>> distanceVariable.calcDistanceFunction() 
>>> initialSurfactant = numerix.sum(surfactantVariable)
>>> from builtins import range
>>> for step in range(steps):
...     distanceVariable.updateOld()
...     surfactantEquation.solve(surfactantVariable, dt=1)
...     advectionEquation.solve(distanceVariable, dt = timeStepDuration) 
>>> print(numerix.allclose(initialSurfactant, numerix.sum(surfactantVariable))) 
1
Last updated on Jun 26, 2024. Created using Sphinx 7.1.2.