dx(f)
is the partial derivative of f
with respect to x
; the result
is piecewise constant when precise
is set and interpolated with
mass lumping as a the piecewise linear function when precise is not set.
Note that dx()
is a non local operator so statements like f=dx(f)
would give the wrong answer because the new value for f
is place before
the end of the use of the old one.
The Finite Element Method does not handle convection terms properly when
they dominate the viscous terms: upwinding is necessary; convect
provides a tool for Lagrangian upwinding. By
g=convect(f,u,v,dt)
Gfem construct an approximation of
Recall that when
Thus to solve
in a much more stable way that if the operator dx(.)
and dy(.)
were use, the following scheme can be used:
iter(n) begin id(f)/dt - laplace(f)*mu =g + convect(oldf,u,v,dt)/dt; oldf = f end;
Remark: Note that convect
is
a nonlocal operator. The statement f = convect(f,u,v,dt) would give
an incorrect result because it modifies f
at some vertex where the
old value is still needed later. It is necessary to do
g=convect(f,u,v,dt); f=g;