|
Basilisk CFD
Adaptive Cartesian mesh PDE framework
|
Go to the source code of this file.
Functions | |
| trace void | tracer_fluxes (scalar f, vector uf, vector flux, double dt, const scalar src) |
| trace void | advection (scalar *tracers, vector u, double dt, scalar *src=NULL) |
| The function below uses the tracer_fluxes function to integrate the advection equation, using an explicit scheme with timestep dt, for each tracer in the list. | |
The function below uses the tracer_fluxes function to integrate the advection equation, using an explicit scheme with timestep dt, for each tracer in the list.
If src is not provided we set all the source terms to zero.
Definition at line 71 of file bcg.h.
References _i, assert, cm, dimension, dt, f, flux, free(), list_append(), list_len(), source, tracer_fluxes(), tracers, u, update_tracer(), and zero().
Referenced by event_advection_term(), and event_tracer_advection().
The function below implements the 2nd-order, unsplit, upwind scheme of Bell-Collela-Glaz, 1989. Given a centered scalar field f, a vector field uf (possibly weighted by a face metric), a timestep dt and a source term field src, it fills the vector field flux with the components of the advection fluxes of f.
We first compute the cell-centered gradient of f in a locally-allocated vector field.
For each face, the flux is composed of two parts...
A normal component... (Note that we cheat a bit here, un should strictly be dt*(uf.x[i] + uf.x[i+1])/((fm.x[] + fm.x[i+1])*Delta) but this causes trouble with boundary conditions (when using narrow '1 ghost cell' stencils)).
and tangential components...
Definition at line 14 of file bcg.h.
References _i, dt, f, flux, fm, g, gradients(), i, s, SEPS, sign(), uf, un, vector::x, and vector::y.
Referenced by advection().