File div_ops.cxx

Functions

const Field3D Div_par_diffusion_index(const Field3D &f, bool bndry_flux)

Diffusion in index space

Similar to using Div_par_diffusion(SQ(mesh->dy)*mesh->g_22, f)

Parameters:
  • The[in] field to be differentiated

  • bndry_flux[in] Are fluxes through the boundary calculated?

BoutReal BOUTMIN(const BoutReal &a, const BoutReal &b, const BoutReal &c, const BoutReal &d)
void Upwind(Stencil1D &n, const BoutReal h)
void Fromm(Stencil1D &n, const BoutReal h)
BoutReal minmod(BoutReal a, BoutReal b)

The minmod function returns the value with the minimum magnitude If the inputs have different signs then returns zero

BoutReal minmod(BoutReal a, BoutReal b, BoutReal c)
void MinMod(Stencil1D &n, const BoutReal h)
void MC(Stencil1D &n, const BoutReal h)
void XPPM(Stencil1D &n, const BoutReal h)
const Field3D Div_n_bxGrad_f_B_XPPM(const Field3D &n, const Field3D &f, bool bndry_flux, bool poloidal, bool positive)
const Field3D Div_Perp_Lap_FV_Index(const Field3D &as, const Field3D &fs, bool xflux)

*** USED ***

const Field3D Div_Z_FV_Index(const Field3D &as, const Field3D &fs)

Z diffusion in index space.

const Field3D D4DX4_FV_Index(const Field3D &f, bool bndry_flux)
const Field3D D4DZ4_Index(const Field3D &f)
const Field2D Laplace_FV(const Field2D &k, const Field2D &f)

*** USED *** X-Y diffusion

NOTE: Assumes g^12 = 0, so X and Y are orthogonal. Otherwise we would need the corner cell values to take Y derivatives along X edges

const Field3D Div_a_Grad_perp_upwind(const Field3D &a, const Field3D &f)

Perpendicular diffusion including X and Y directions.

const Field3D Div_a_Grad_perp_upwind_flows(const Field3D &a, const Field3D &f, Field3D &flow_xlow, Field3D &flow_ylow)

Version of function that returns flows.

Div ( a Grad_perp(f) ) — diffusion

Returns the flows in the final arguments

Flows are always in the positive {x,y} direction i.e xlow(i,j) is the flow into cell (i,j) from the left, and the flow out of cell (i-1,j) to the right

ylow(i,j+1) ^ +—|—+ | | xlow(i,j) -> (i,j) -> xlow(i+1,j) | ^ | +—|—+ ylow(i,j)

struct Stencil1D

Public Members

BoutReal c
BoutReal m
BoutReal p
BoutReal mm
BoutReal pp
BoutReal L
BoutReal R