File div_ops.hxx#

Functions

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

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?

Field3D Div_n_bxGrad_f_B_XPPM(const Field3D &n, const Field3D &f, bool bndry_flux = true, bool poloidal = false, bool positive = false)
Field3D Div_n_g_bxGrad_f_B_XZ(const Field3D &n, const Field3D &g, const Field3D &f, bool bndry_flux = true)

This version has an extra coefficient ‘g’ that is linearly interpolated onto cell faces

Field3D Div_Perp_Lap_FV_Index(const Field3D &a, const Field3D &f)
Field3D Div_Z_FV_Index(const Field3D &a, const Field3D &f)

Z diffusion in index space.

Field3D D4DX4_FV_Index(const Field3D &f, bool bndry_flux = false)
Field3D D4DZ4_Index(const Field3D &f)
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

Field3D Div_a_Grad_perp_flows(const Field3D &a, const Field3D &f, Field3D &flux_xlow, Field3D &flux_ylow)

Perpendicular diffusion including X and Y directions Takes Div_a_Grad_perp from BOUT++ and adds flows

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

WARNING: Causes checkerboarding in neutral_mixed integrated test.

Same but with upwinding WARNING: Causes checkerboarding in neutral_mixed integrated test

Field3D Div_a_Grad_perp_upwind_flows(const Field3D &a, const Field3D &f, Field3D &flux_xlow, Field3D &flux_ylow)

Same but with upwinding and flows WARNING: Causes checkerboarding in neutral_mixed integrated test

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, k) is the flow into cell (i,j, k) from the left, and the flow out of cell (i-1,j, k) to the right

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

WARNING: Causes checkerboarding in neutral_mixed integrated test

Field3D Div_a_Grad_perp_nonorthog(const Field3D &a, const Field3D &x, Field3D &flux_xlow, Field3D &flux_ylow)

Div ( a Grad_perp(f) ) — ∇⊥ ( a ⋅ ∇⊥ f) — Vorticity

This version includes corrections for non-orthogonal meshes in which the g12 and g13 components can be non-zero i.e. X-Y, X-Z and Y-Z coordinates can all be non-orthogonal.