Chombo + EB  3.0
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
GodunovUtilities Class Reference

#include <GodunovUtilities.H>

Public Member Functions

 GodunovUtilities ()
 Constructor. More...
 
 ~GodunovUtilities ()
 Destructor. More...
 
void define (const ProblemDomain &a_domain, const Real &a_dx)
 Define the object. More...
 
Slopes
void vanLeerSlopes (FArrayBox &a_dW, const FArrayBox &a_W, const int &a_numSlopes, const bool &a_useLimiting, const int &a_dir, const Box &a_box)
 Compute componentwise van Leer slopes. More...
 
void fourthOrderSlopes (FArrayBox &a_dW4, const FArrayBox &a_W, const FArrayBox &a_dWvL, const int &a_numSlopes, const int &a_dir, const Box &a_box)
 Compute fourth-order slopes. More...
 
void oneSidedDifferences (FArrayBox &a_dWMinus, FArrayBox &a_dWPlus, const FArrayBox &a_W, const int &a_dir, const Box &a_box)
 Compute slopes (dW- and dW+) using one sided differences. More...
 
void slopes (FArrayBox &a_dWCent, FArrayBox &a_dWMinus, FArrayBox &a_dWPlus, const FArrayBox &a_W, const int &a_numSlopes, const int &a_dir, const Box &a_loBox, const Box &a_hiBox, const Box &a_centerBox, const Box &a_entireBox, const int &a_hasLo, const int &a_hasHi)
 Compute slopes (dW (center), dW-, and dW+) More...
 
Parabolic interpolants
void PLMNormalPred (FArrayBox &a_dWCharMinus, FArrayBox &a_dWCharPlus, const FArrayBox &a_dWChar, const FArrayBox &a_Lambda, const Real &a_dtbydx, const Box &a_box)
 PLM normal predictor. More...
 
void PPMFaceValues (FArrayBox &a_WFace, const FArrayBox &a_W, const int &a_numSlopes, const bool &a_useLimiting, const int &a_dir, const Box &a_box, const Real &a_time, const GodunovPhysics *a_physPtr=NULL)
 PPM face-centered interpolant. More...
 
void PPMNormalPred (FArrayBox &a_dWMinus, FArrayBox &a_dWPlus, const FArrayBox &a_Lambda, const Real &a_dtbydx, const int &a_numSlopes, const Box &a_box)
 PPM normal predictor. More...
 
Limiters
void slopeLimiter (FArrayBox &a_dW, const FArrayBox &a_dWMinus, const FArrayBox &a_dWPlus, const int &a_numSlopes, const Box &a_box)
 van Leer slope limiter. More...
 
void slopeLimiterExtPreserving (FArrayBox &a_dW, const FArrayBox &a_dWMinus, const FArrayBox &a_dWPlus, const int &a_numSlopes, const Box &a_box, const int &a_dir)
 extremum-preserving van Leer slope limiter. More...
 
void PPMLimiter (FArrayBox &a_dWMinus, FArrayBox &a_dWPlus, const FArrayBox &a_W, const int &a_numSlopes, const int &a_dir, const Box &a_box)
 PPM Limiter. More...
 
void highOrderLimiter (bool a_highOrderLimiter)
 Set whether to use high-order limiter. More...
 
Dissipation mechanisms
void computeFlattening (FArrayBox &a_flattening, const FArrayBox &a_W, const Interval &a_velInt, const int &a_presInd, const Real &a_smallPres, const int &a_bulkModulusInd, const Box &a_box)
 Compute the slope flattening coefficients. More...
 
void applyFlattening (FArrayBox &a_dW, const FArrayBox &a_flat, const Box &a_box)
 Apply the flattening to slopes. More...
 
void artificialViscosity (FArrayBox &a_F, const FArrayBox &a_U, const FArrayBox &a_divVel, const Real &a_scale, const int &a_dir, const Box &a_box)
 Compute face-centered artificial viscosity flux. More...
 
Divergence
void divVel (FArrayBox &a_divVel, const FArrayBox &a_W, const Interval &a_velInt, const int &a_dir, const Box &a_box)
 Compute face-centered velocity divergence. More...
 
void divVelHO (FArrayBox &a_divVel, const FArrayBox &a_W, const int &a_dir, const Box &a_box, GodunovPhysics *a_physPtr)
 Compute high-order face-centered velocity divergence for artificial viscosity. More...
 
Deconvolution and convolution
void deconvolve (FArrayBox &a_avgFab, const FArrayBox &a_cellFab, int a_sign=1)
 Deconvolve from cell-centered to cell-averaged data (or vice versa) More...
 
void deconvolve (FArrayBox &a_avgFab, const FArrayBox &a_cellFab, const Box &a_box, int a_sign=1)
 Deconvolve from cell-centered to cell-averaged data (or vice versa) on a specified box. More...
 
void deconvolveFace (FluxBox &a_avgFlux, const FluxBox &a_cellFlux, int a_sign=1)
 Deconvolve from face-centered to face-averaged data (or vice versa) More...
 
void deconvolveFace (FluxBox &a_avgFlux, const FluxBox &a_cellFlux, const Box &a_box, int a_sign=1)
 Deconvolve from face-centered to face-averaged data (or vice versa) on a specified box. More...
 

Protected Attributes

ProblemDomain m_domain
 
Real m_dx
 
bool m_isDefined
 
bool m_highOrderLimiter
 

Private Member Functions

void operator= (const GodunovUtilities &)
 
 GodunovUtilities (const GodunovUtilities &)
 

Detailed Description

Utility class for higher-order Godunov methods: slopes, parabolic interpolants, limiters. Contains no physics-dependent methods, but one of the member functions (PPMFaceValues()) may require a pointer to a GodunovPhysics class in order to set boundary slopes.

Constructor & Destructor Documentation

◆ GodunovUtilities() [1/2]

GodunovUtilities::GodunovUtilities ( )

Constructor.

◆ ~GodunovUtilities()

GodunovUtilities::~GodunovUtilities ( )

Destructor.

◆ GodunovUtilities() [2/2]

GodunovUtilities::GodunovUtilities ( const GodunovUtilities )
private

Member Function Documentation

◆ define()

void GodunovUtilities::define ( const ProblemDomain a_domain,
const Real a_dx 
)

Define the object.

◆ vanLeerSlopes()

void GodunovUtilities::vanLeerSlopes ( FArrayBox a_dW,
const FArrayBox a_W,
const int &  a_numSlopes,
const bool &  a_useLimiting,
const int &  a_dir,
const Box a_box 
)

Compute componentwise van Leer slopes.

Given cell averages W, compute van Leer slopes dW on a component-by-component basis.

◆ fourthOrderSlopes()

void GodunovUtilities::fourthOrderSlopes ( FArrayBox a_dW4,
const FArrayBox a_W,
const FArrayBox a_dWvL,
const int &  a_numSlopes,
const int &  a_dir,
const Box a_box 
)

Compute fourth-order slopes.

Given cell averages W and van Leer slopes dWvL, compute fourth-order slopes dW4. Limiting is performed in a separate pass.

◆ oneSidedDifferences()

void GodunovUtilities::oneSidedDifferences ( FArrayBox a_dWMinus,
FArrayBox a_dWPlus,
const FArrayBox a_W,
const int &  a_dir,
const Box a_box 
)

Compute slopes (dW- and dW+) using one sided differences.

◆ slopes()

void GodunovUtilities::slopes ( FArrayBox a_dWCent,
FArrayBox a_dWMinus,
FArrayBox a_dWPlus,
const FArrayBox a_W,
const int &  a_numSlopes,
const int &  a_dir,
const Box a_loBox,
const Box a_hiBox,
const Box a_centerBox,
const Box a_entireBox,
const int &  a_hasLo,
const int &  a_hasHi 
)

Compute slopes (dW (center), dW-, and dW+)

a_dwCent, a_dwMinus, a_dWPlus, and a_dW all live on cell-centered a_entireBox.

For i in a_centerBox: a_dwCent[i] = (a_W[i+1] - a_W[i-1])/2; a_dWMinus[i] = a_W[i] - a_W[i-1]; a_dWPlus[i] = a_W[i+1] - a_W[i].

For i in a_loBox, set only a_dWPlus[i] = a_W[i+1] - a_W[i] and copy it to a_dWCent[i] and a_dWMinus[i].

For i in a_hiBox, set only a_dWMinus[i] = a_W[i] - a_W[i-1] and copy it to a_dWCent[i] and a_dWPlus[i].

◆ PLMNormalPred()

void GodunovUtilities::PLMNormalPred ( FArrayBox a_dWCharMinus,
FArrayBox a_dWCharPlus,
const FArrayBox a_dWChar,
const FArrayBox a_Lambda,
const Real a_dtbydx,
const Box a_box 
)

PLM normal predictor.

Compute the increments in the characteristic amplitudes.

◆ PPMFaceValues()

void GodunovUtilities::PPMFaceValues ( FArrayBox a_WFace,
const FArrayBox a_W,
const int &  a_numSlopes,
const bool &  a_useLimiting,
const int &  a_dir,
const Box a_box,
const Real a_time,
const GodunovPhysics a_physPtr = NULL 
)

PPM face-centered interpolant.

Given the cell average a_W, compute fourth-order accurate face-centered values WFace on a_box by differentiating the indefinite integral. Limiting is performed in a separate pass.

◆ PPMNormalPred()

void GodunovUtilities::PPMNormalPred ( FArrayBox a_dWMinus,
FArrayBox a_dWPlus,
const FArrayBox a_Lambda,
const Real a_dtbydx,
const int &  a_numSlopes,
const Box a_box 
)

PPM normal predictor.

On input, dW(Minus,Plus), contain the characteristic expansions of the differences between the (minus, plus) face values and the cell average. On output, dW(Minus,Plus) contain the characteristic amplitudes of the corrections required to compute the normal predictor.

◆ slopeLimiter()

void GodunovUtilities::slopeLimiter ( FArrayBox a_dW,
const FArrayBox a_dWMinus,
const FArrayBox a_dWPlus,
const int &  a_numSlopes,
const Box a_box 
)

van Leer slope limiter.

On input, dW contains the centered, unlimited slopes, and dW(Minus,Plus) contain the one-sided slopes from the minus, plus sides. On output, dW contains the limited slopes. slopes dW4. Limiting is performed in a separate pass.

◆ slopeLimiterExtPreserving()

void GodunovUtilities::slopeLimiterExtPreserving ( FArrayBox a_dW,
const FArrayBox a_dWMinus,
const FArrayBox a_dWPlus,
const int &  a_numSlopes,
const Box a_box,
const int &  a_dir 
)

extremum-preserving van Leer slope limiter.

On input, dW contains the centered, unlimited slopes, and dW(Minus,Plus) contain the one-sided slopes from the minus, plus sides. On output, dW contains the limited slopes. slopes dW4. Limiting is performed in a separate pass.

◆ PPMLimiter()

void GodunovUtilities::PPMLimiter ( FArrayBox a_dWMinus,
FArrayBox a_dWPlus,
const FArrayBox a_W,
const int &  a_numSlopes,
const int &  a_dir,
const Box a_box 
)

PPM Limiter.

a_dWMinus and a_dWPlus are the differences between the face values on the minus and plus sides of cells and the average in the cell. That is, a_dWMinus[i] = WFace[i - e/2] - a_W[i] a_dWPlus[i] = WFace[i + e/2] - a_W[i] where e is the unit vector in dimension a_dir. The PPM limiter is applied to these values to obtain a monotone interpolant in the cell. The function returns the limited a_dWMinus and a_dWPlus on a_box. petermc, 4 Sep 2008: included a_W in argument list

If m_highOrderLimiter, then need a_dWMinus and a_dWPlus on a_box, and need a_W on on a_box grown by 3 in dimension a_dir. Returns limited a_dWMinus and a_dWPlus on a_box.

◆ highOrderLimiter()

void GodunovUtilities::highOrderLimiter ( bool  a_highOrderLimiter)

Set whether to use high-order limiter.

◆ computeFlattening()

void GodunovUtilities::computeFlattening ( FArrayBox a_flattening,
const FArrayBox a_W,
const Interval a_velInt,
const int &  a_presInd,
const Real a_smallPres,
const int &  a_bulkModulusInd,
const Box a_box 
)

Compute the slope flattening coefficients.

Compute the slope flattening coefficients, a_flattening, using the primitive variables, a_W, within a_box.

Parameters
a_flatteningflattening coeffs, 1 component on a_box
a_Wprimitive variables, on a_box grown by 3 within m_domain
a_velIntinterval of a_W with velocity; length SpaceDim
a_presIndindex of a_W with pressure
a_smallPresminimum pressure to use in ratio
a_bulkModulusIndindex of a_W with bulk modulus
a_boxcell-centered box on which a_flattening lives

◆ applyFlattening()

void GodunovUtilities::applyFlattening ( FArrayBox a_dW,
const FArrayBox a_flat,
const Box a_box 
)

Apply the flattening to slopes.

Multiply every component of a_dW by a_flat, on a_box.

Parameters
a_dWslopes to be flattened, on at least a_box
a_flatcell-centered flattening coefficients, on at least a_box
a_boxcell-centered box on which to flatten

◆ artificialViscosity()

void GodunovUtilities::artificialViscosity ( FArrayBox a_F,
const FArrayBox a_U,
const FArrayBox a_divVel,
const Real a_scale,
const int &  a_dir,
const Box a_box 
)

Compute face-centered artificial viscosity flux.

Increments face-centered flux in the a_dir direction with quadratic artificial viscosity.

◆ divVel()

void GodunovUtilities::divVel ( FArrayBox a_divVel,
const FArrayBox a_W,
const Interval a_velInt,
const int &  a_dir,
const Box a_box 
)

Compute face-centered velocity divergence.

Returns face-centered velocity divergence on faces in the direction a_dir. The velocities are the components a_velInterval of a_W.

◆ divVelHO()

void GodunovUtilities::divVelHO ( FArrayBox a_divVel,
const FArrayBox a_W,
const int &  a_dir,
const Box a_box,
GodunovPhysics a_physPtr 
)

Compute high-order face-centered velocity divergence for artificial viscosity.

Computes a face-centered nonlinear function of the divergence suitable for use as an artificial viscosity coefficient for a fourth-order method.

F_visc = -dx*K*dU/dx K = max(-dx*div(u)*min(1,h^2*|div(u)/(c^2)/a_M0sq|),0)

◆ deconvolve() [1/2]

void GodunovUtilities::deconvolve ( FArrayBox a_avgFab,
const FArrayBox a_cellFab,
int  a_sign = 1 
)

Deconvolve from cell-centered to cell-averaged data (or vice versa)

Deconvolves (or convolves, if a_sign = -1) by the formula

a_avgFab += a_sign * laplacian(a_cellFab) * m_dx^2 / 24, on a_cellFab.box()

◆ deconvolve() [2/2]

void GodunovUtilities::deconvolve ( FArrayBox a_avgFab,
const FArrayBox a_cellFab,
const Box a_box,
int  a_sign = 1 
)

Deconvolve from cell-centered to cell-averaged data (or vice versa) on a specified box.

Deconvolves (or convolves, if a_sign = -1) by the formula

a_avgFab += a_sign * laplacian(a_cellFab) * m_dx^2 / 24, on a_box

◆ deconvolveFace() [1/2]

void GodunovUtilities::deconvolveFace ( FluxBox a_avgFlux,
const FluxBox a_cellFlux,
int  a_sign = 1 
)

Deconvolve from face-centered to face-averaged data (or vice versa)

Deconvolves (or convolves, if a_sign = -1) by the formula

a_avgFlux += a_sign * laplacian(a_cellFlux) * m_dx^2 / 24, on faces of a_cellFlux.box()

◆ deconvolveFace() [2/2]

void GodunovUtilities::deconvolveFace ( FluxBox a_avgFlux,
const FluxBox a_cellFlux,
const Box a_box,
int  a_sign = 1 
)

Deconvolve from face-centered to face-averaged data (or vice versa) on a specified box.

Deconvolves (or convolves, if a_sign = -1) by the formula

a_avgFlux += a_sign * laplacian(a_cellFlux) * m_dx^2 / 24, on faces of a_box

◆ operator=()

void GodunovUtilities::operator= ( const GodunovUtilities )
private

Member Data Documentation

◆ m_domain

ProblemDomain GodunovUtilities::m_domain
protected

◆ m_dx

Real GodunovUtilities::m_dx
protected

◆ m_isDefined

bool GodunovUtilities::m_isDefined
protected

◆ m_highOrderLimiter

bool GodunovUtilities::m_highOrderLimiter
protected

The documentation for this class was generated from the following file: