src/tracer.h
Tracer advection event
This event integrates advection equations of the form \partial_tf_i+\mathbf{u_f}\cdot\nabla f_i=0 where \mathbf{u_f} is the velocity field and f_i are a list of passive tracers.
The tracers
list is defined elsewhere (typically by the
user), the face vector field uf
and the timestep
dt
are defined by a solver.
extern scalar * tracers;
extern face vector uf;
extern double dt;
On adaptive meshes, tracers need to use linear interpolation (rather than the default bilinear interpolation) to ensure conservation when refining cells.
#if TREE
event defaults (i = 0) {
for (scalar s in tracers) {
#if EMBED
.refine = s.prolongation = refine_embed_linear;
s#else
.refine = refine_linear;
s#endif
.restriction = restriction_volume_average;
s.dirty = true; // boundary conditions need to be updated
s}
}
#endif
The integration is performed using the Bell-Collela-Glaz scheme.
VOF advection happens here.
event vof (i++, last);
Diffusion can be added by overloading this hook.
event tracer_diffusion (i++,last);