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

Go to the source code of this file.

Functions

macro VARIABLES (Point point=point, int _ig=ig, int _jg=jg, int _kg=kg)
 For convenience we add definitions for the radial and angular coordinates $(r, \theta)$.
 
void event_metric (void)
 Event: metric (i = 0)
 

Variables

double dtheta = pi/3.
 

Function Documentation

◆ event_metric()

void event_metric ( void  )

Event: metric (i = 0)

We initialise the scale factors, taking care to first allocate the fields if they are still constant.

The area (in 2D) of a mapped element is the area of an annulus defined by the two radii \(r-\Delta/2\) and \(r+\Delta/2\), divided by the total number of sectors \(N=2\pi L0/(d\theta\Delta)\), this gives

\[ \frac{\pi [(r + \Delta / 2)^2 - (r - \Delta / 2)^2]}{2 \pi L 0 / (d \theta \Delta)} = \frac{2 \pi r \Delta}{2 \pi L 0 / (d \theta \Delta)} = \frac{rd \theta}{L 0} \Delta^2 \]

By definition, the (area) metric factor cm is the mapped area divided by the unmapped area \(\Delta^2\).

It is important to set proper boundary conditions, in particular when refining the grid.

The (length) metric factor fm is the ratio of the mapped length of a face to its unmapped length \(\Delta\). In the present case, it is unity for all dimensions except for the \(x\) coordinates for which it is the ratio of the arclength by the unmapped length \(\Delta\). We also set a small minimal value to avoid division by zero, in the case of a vanishing inner radius.

Definition at line 29 of file radial.h.

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

Here is the call graph for this function:

◆ VARIABLES()

macro VARIABLES ( Point  point = point,
int  _ig = ig,
int  _jg = jg,
int  _kg = kg 
)

For convenience we add definitions for the radial and angular coordinates $(r, \theta)$.

Definition at line 21 of file radial.h.

References _ig, _jg, dtheta, L0, point, theta, VARIABLES(), x, and y.

Referenced by VARIABLES().

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

Variable Documentation

◆ dtheta

double dtheta = pi/3.

Radial/cylindrical coordinates

This implements the radial coordinate mapping illustrated below.

Radial coordinate mapping

It works in 1D, 2D and 3D. The 3D version corresponds to cylindrical coordinates since the \(z\)-coordinate is unchanged.

The only parameter is \(d\theta\), the total angle of the sector.

Definition at line 15 of file radial.h.

Referenced by event_metric(), okada(), and VARIABLES().