Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
advection.h File Reference
#include "run.h"
#include "timestep.h"
#include "tracer.h"
Include dependency graph for advection.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define u   uf
 

Functions

void event_defaults (void)
 Event: defaults (i = 0)
 
event init (i=0)
 User initialisation happens here.
 
void event_velocity (void)
 The timestep is set using the velocity field and the CFL criterion.
 

Variables

vector uf []
 We allocate the (face) velocity field.
 
double(* gradient )(double, double, double) = NULL
 
scalartracers
 Here we set the gradient functions for each tracer (as defined in the user-provided tracers list).
 

Macro Definition Documentation

◆ u

#define u   uf

Definition at line 30 of file advection.h.

Function Documentation

◆ event_defaults()

void event_defaults ( void  )

Event: defaults (i = 0)

Boundary conditions for VOF-advected tracers usually depend on boundary conditions for the VOF field.

Event: defaults (i = 0)

Definition at line 40 of file advection.h.

References f, and gradient.

◆ event_velocity()

void event_velocity ( void  )

The timestep is set using the velocity field and the CFL criterion.

The integration itself is performed in the events of [tracer.h]().

Event: velocity (i++,last)

Definition at line 56 of file advection.h.

References dt, DT, dtnext(), timestep(), and u.

Here is the call graph for this function:

◆ init()

event init ( i  = 0)

User initialisation happens here.

Referenced by init_event().

Here is the caller graph for this function:

Variable Documentation

◆ gradient

double(* gradient) (double, double, double) ( double  ,
double  ,
double   
) = NULL

Definition at line 31 of file advection.h.

Referenced by event_defaults(), and refine_elevation().

◆ tracers

scalar* tracers
extern

Here we set the gradient functions for each tracer (as defined in the user-provided tracers list).

Here we set the gradient functions for each tracer (as defined in the user-provided tracers list).

\(\partial_xf_j = \partial_x(t_j/c)\) or \(\partial_xf_j = \partial_x(t_j/(1 - c))\) (for higher-order upwinding) and we need to store the computed fluxes. We first allocate the corresponding lists.

Definition at line 60 of file hydro.h.

Referenced by advection(), event_defaults(), event_half_advection(), event_remap(), event_vof(), and vertical_remapping().

◆ uf

vector uf

We allocate the (face) velocity field.

An advection solver

We wish to solve the advection equations

\[ \partial_tf_i+\mathbf{u}\cdot\nabla f_i=0 \]

where \(\mathbf{u}\) is the velocity field and \(f_i\) are a list of passive tracers. This can be done with a flux-based advection scheme such as the 2nd-order, unsplit, upwind scheme of Bell-Collela-Glaz, 1989.

The main time loop is defined in [run.h](). A stable timestep needs to respect the CFL condition. For compatibility with the other solvers, we allocate it as uf and define an alias. The gradient function is used to set the type of slope-limiting required. The default is to not use any limiting (i.e. a purely centered slope estimation).

Definition at line 29 of file advection.h.

Referenced by event_acceleration(), event_end_timestep(), event_face_fields(), event_init(), event_pressure(), event_tracer_advection(), project(), tracer_fluxes(), and update_tracer().