The representation of the term in the question is only an explicit representation. There are two ways to represent the term in an implicit way.
Single Equation for A
Assuming only A
is being solved for (a single equation for A
), then the term in question can be represented as a ConvectionTerm
.
ConvectionTerm(coeff=chi_A * B.getGrad() / \
numerix.sqrt(1 + lambda_ * B.grad.mag**2), var=A)
See this FAQ.
Multiple Equations for A
and B
If A
is being solved alongside B
(multiple equations), then it's possible to couple the equations so that the term in question can be a diffusion term with B
as the variable being solved for (the dependent variable for the term),
DiffusionTerm(coeff=chi_A * A / \
numerix.sqrt(1 + lambda_ * B.grad.mag**2), var=B)
The equations for A
and B
then need to be coupled,
coupled_eqn = eqn_A & eqn_B
See this example.
This choice (coupled) is better as the explicit time step restriction on B
is more stringent than the time step restriction on A
for the term in question.
Note
The syntax, (B.getGrad())^2
in the question is incorrect, it should be B.grad.mag**2
.