Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
spherisym.h File Reference

Go to the source code of this file.

Macros

#define SPHERISYM   1
 

Functions

static void refine_cm_spherisym (Point point, scalar cm)
 On trees we need refinement functions.
 
static void refine_face_x_spherisym (Point point, scalar fm)
 
void event_metric (void)
 Event: metric (i = 0)
 

Macro Definition Documentation

◆ SPHERISYM

#define SPHERISYM   1

Spherically-symmetric coordinates

This file defines the metric coefficients for a (one-dimensional) spherically-symmetric coordinate system.

The radial coordinate \(r\) is x. Note that x (and so X0) cannot be negative.

We first define a macro which will be used in some geometry-specific code (e.g. viscous stress tensor).

Definition at line 16 of file spherisym.h.

Function Documentation

◆ event_metric()

void event_metric ( void  )

Event: metric (i = 0)

By default cm is a constant scalar field. To make it variable, we need to allocate a new field. We also move it at the begining of the list of variables: this is important to ensure the metric is defined before other fields.

The volume/area of a cell is proportional to \(r^2\) (i.e. \(x^2\)). We need to set boundary conditions at the top and bottom so that cm is interpolated properly when refining/coarsening the mesh.

We do the same for the length scale factors. The "length" of faces on the center of spherical symmetry is zero ( \(x=r=0\) in the center). To avoid division by zero we set it to epsilon (note that mathematically the limit is well posed).

We set our refinement/prolongation functions on trees.

Definition at line 39 of file spherisym.h.

References _i, all, cm, fm, free(), l, list_concat(), list_copy(), max, refine_cm_spherisym(), refine_face_x_spherisym(), vector::x, and x.

Here is the call graph for this function:

◆ refine_cm_spherisym()

static void refine_cm_spherisym ( Point  point,
scalar  cm 
)
static

On trees we need refinement functions.

Definition at line 22 of file spherisym.h.

References cm, fine(), sq(), and x.

Referenced by event_metric().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refine_face_x_spherisym()

static void refine_face_x_spherisym ( Point  point,
scalar  fm 
)
static

Definition at line 28 of file spherisym.h.

References fine(), fm, is_refined, neighbor(), sq(), and x.

Referenced by event_metric().

Here is the call graph for this function:
Here is the caller graph for this function: