# File fv_ops.hxx#

namespace FV

Functions

inline Field3D Div_a_Laplace_perp(const Field3D &a, const Field3D &x)#
template<typename CellEdges = MC>
const Field3D Div_par(const Field3D &f_in, const Field3D &v_in, const Field3D &wave_speed_in, bool fixflux = true)#

Finite volume parallel divergence

Preserves the sum of f*J*dx*dy*dz over the domain

NB: Uses to/from FieldAligned coordinates

Parameters:
• f_in[in] The field being advected. This will be reconstructed at cell faces using the given CellEdges method

• v_in[in] The advection velocity. This will be interpolated to cell boundaries using linear interpolation

• wave_speed_in[in] Local maximum speed of all waves in the system at each

• fixflux[in] Fix the flux at the boundary to be the value at the midpoint (for boundary conditions)

template<typename CellEdges = MC>
const Field3D Div_f_v(const Field3D &n_in, const Vector3D &v, bool bndry_flux)#

Div ( n * v ) &#8212; Magnetic drifts

This uses the expression

Div( A ) = 1/J * d/di ( J * A^i )

Hence the input vector should be contravariant

Note: Uses to/from FieldAligned

struct Stencil1D#
#include <fv_ops.hxx>

Stencil used for Finite Volume calculations which includes cell face values L and R

struct Upwind#
#include <fv_ops.hxx>

First order upwind for testing

Public Functions

inline void operator()(Stencil1D &n)#
struct Fromm#
#include <fv_ops.hxx>

Fromm method

Public Functions

inline void operator()(Stencil1D &n)#
struct MinMod#
#include <fv_ops.hxx>

Second order slope limiter method

Limits slope to minimum absolute value of left and right gradients. If at a maximum or minimum slope set to zero, i.e. reverts to first order upwinding

Public Functions

inline void operator()(Stencil1D &n)#

Private Functions

inline BoutReal _minmod(BoutReal a, BoutReal b)#

Internal helper function for minmod slope limiter

If the inputs have different signs then returns zero, otherwise chooses the value with the minimum magnitude.

struct MC#
#include <fv_ops.hxx>

Monotonised Central (MC) second order slope limiter (Van Leer)

Limits the slope based on taking the slope with the minimum absolute value from central, 2*left and 2*right. If any of these slopes have different signs then the slope reverts to zero (i.e. 1st-order upwinding).

Public Functions

inline void operator()(Stencil1D &n)#

Private Functions

inline BoutReal minmod(BoutReal a, BoutReal b, BoutReal c)#