examples.levelSet.electroChem.adsorption

This example tests 1D adsorption onto an interface and subsequent depletion from the bulk. The governing equations are given by,

ct=DcxxDcx=Γkc(1θ)at x=0\intertextandc=cat x=L

and on the interface

Dcx=kc(1θ)at x=0

There is a dimensionless number M that governs whether the system is in an interface limited (M1) or diffusion limited (M1) regime. There are analytical solutions for both regimes. The dimensionless number is given by:

M=DL2kcinf.

The test solution provided here is for the case of interface limited kinetics. The analytical solutions are given by,

Dln(1θ)+kLΓ0θ=kDctΓ0

and

c(x)=c[kΓ0(1θ)x/D]1+kΓ0(1θ)L/D

Make sure the dimensionless parameter is large enough

>>> (diffusion / cinf / L / L / rateConstant) > 100
True

Start time stepping:

>>> currentTime = 0.
>>> from builtins import range
>>> for i in range(totalTimeSteps):
...     surfEqn.solve(surfactantVar, dt = dt)
...     bulkEqn.solve(bulkVar, dt = dt)
...     currentTime += dt

Compare the analytical and numerical results:

>>> theta = surfactantVar.interfaceVar[1]
>>> numerix.allclose(currentTimeFunc(theta), currentTime, rtol = 1e-4)()
1
>>> numerix.allclose(concentrationFunc(theta), bulkVar[1:], rtol = 1e-4)()
1
Last updated on Feb 14, 2025. Created using Sphinx 7.1.2.