Chombo + EB + MF  3.2
Public Member Functions | Protected Attributes | List of all members
AdvectPhysics Class Reference

A class derived from GodunovPhysics for simple advection-diffusion problems. More...

#include <AdvectPhysics.H>

Inheritance diagram for AdvectPhysics:
Inheritance graph
[legend]

Public Member Functions

 AdvectPhysics ()
 Constructor. More...
 
 ~AdvectPhysics ()
 Destructor. More...
 
virtual GodunovPhysicsnew_godunovPhysics () const
 Factory method - this object is its own factory. More...
 
virtual Real getMaxWaveSpeed (const FArrayBox &a_U, const Box &a_box)
 Compute the maximum wave speed. More...
 
virtual void getFlux (FArrayBox &a_flux, const FArrayBox &a_WHalf, const int &a_dir, const Box &a_box)
 COMPUTE fluxes from primitive values on a face ( advVel*wHalf) More...
 
virtual void charAnalysis (FArrayBox &a_dW, const FArrayBox &a_W, const int &a_dir, const Box &a_box)
 Transform a_dW from primitive to characteristic variables. More...
 
virtual void charSynthesis (FArrayBox &a_dW, const FArrayBox &a_W, const int &a_dir, const Box &a_box)
 Transform a_dW from characteristic to primitive variables. More...
 
virtual void charValues (FArrayBox &a_lambda, const FArrayBox &a_W, const int &a_dir, const Box &a_box)
 Compute the characteristic values (eigenvalues) More...
 
virtual void incrementSource (FArrayBox &a_S, const FArrayBox &a_W, const Box &a_box)
 Add to (increment) the source terms given the current state. More...
 
virtual void riemann (FArrayBox &a_WGdnv, const FArrayBox &a_WLeft, const FArrayBox &a_WRight, const FArrayBox &a_W, const Real &a_time, const int &a_dir, const Box &a_box)
 Compute the solution to the Riemann problem. More...
 
virtual void postNormalPred (FArrayBox &a_dWMinus, FArrayBox &a_dWPlus, const FArrayBox &a_W, const Real &a_dt, const Real &a_dx, const int &a_dir, const Box &a_box)
 Post-normal predictor calculation. More...
 
virtual void quasilinearUpdate (FArrayBox &a_AdWdx, const FArrayBox &a_WHalf, const FArrayBox &a_W, const Real &a_scale, const int &a_dir, const Box &a_box)
 Compute the quasilinear update A*dW/dx. More...
 
virtual void consToPrim (FArrayBox &a_W, const FArrayBox &a_U, const Box &a_box)
 Compute primitive variables from conserved variables. More...
 
void setVelocities (FArrayBox *a_celVelPtr, FluxBox *a_advVelPtr)
 Set cell-centered and face centered advection velocity. More...
 
Access functions
virtual int numConserved ()
 Number of conserved variables. More...
 
virtual Vector< string > stateNames ()
 Names of the conserved variables. More...
 
virtual int numFluxes ()
 Number of flux variables. More...
 
virtual bool isDefined () const
 Is the object completely defined. More...
 
virtual int numPrimitives ()
 Number of primitve variables. More...
 
virtual Interval velocityInterval ()
 Interval within the primitive variables corresponding to the velocities. More...
 
virtual int pressureIndex ()
 Component index within the primitive variables of the pressure. More...
 
virtual Real smallPressure ()
 Used to limit the absolute value of a "pressure" difference. More...
 
virtual int bulkModulusIndex ()
 Component index within the primitive variables of the bulk modulus. More...
 
virtual int densityIndex ()
 Component index within the primitive variables of the density. More...
 
- Public Member Functions inherited from GodunovPhysics
 GodunovPhysics ()
 Constructor. More...
 
PhysIBCgetPhysIBC () const
 Get the initial and boundary condition object. More...
 
void setPhysIBC (PhysIBC *a_bc)
 Set the initial and boundary condition object. More...
 
virtual ~GodunovPhysics ()
 Destructor. More...
 
virtual void define (const ProblemDomain &a_domain, const Real &a_dx)
 Define the object. More...
 
virtual void setCurrentBox (const Box &a_currentBox)
 Set the current box (default implementation - do nothing) More...
 
virtual void soundSpeed (FArrayBox &a_speed, const FArrayBox &a_U, const Box &a_box)
 Compute the maximum wave speed. More...
 
virtual void computeUpdate (FArrayBox &a_dU, FluxBox &a_F, const FArrayBox &a_U, const FluxBox &a_WHalf, const bool &a_useArtificialViscosity, const Real &a_artificialViscosity, const Real &a_currentTime, const Real &a_dx, const Real &a_dt, const Box &a_box)
 Compute the increment in the conserved variables from face variables. More...
 
virtual void artVisc (FArrayBox &a_F, const FArrayBox &a_U, const Real &a_artificialViscosity, const Real &a_currentTime, const int &a_dir, const Box &a_box)
 Compute the artificial viscosity contribution to the flux. More...
 
virtual void expressions (HDF5HeaderData &a_holder) const
 
virtual bool fourthOrderArtificialViscosityIsDefined () const
 Returns true if 4th-order artificial viscosity is defined. More...
 
virtual void setFourthOrderArtificialViscosityParameter (const Real &M0sq)
 Defines fourth-order artifical viscosity strong shock threshold. More...
 
virtual Real getFourthOrderArtificialViscosityParameter () const
 Returns fourth-order artifical viscosity strong shock threshold. More...
 

Protected Attributes

bool m_isVelSet
 
FluxBoxm_advVelPtr
 face-centered advection velocity More...
 
FArrayBoxm_cellVelPtr
 cell-centered advection velocity (centered at old time) More...
 
- Protected Attributes inherited from GodunovPhysics
bool m_isDefined
 
ProblemDomain m_domain
 
Real m_dx
 
GodunovUtilities m_util
 
bool m_useFourthOrderArtificialViscosity
 
Real m_M0sq
 
PhysIBCm_bc
 
bool m_isBCSet
 

Detailed Description

A class derived from GodunovPhysics for simple advection-diffusion problems.

Constructor & Destructor Documentation

◆ AdvectPhysics()

AdvectPhysics::AdvectPhysics ( )

Constructor.

◆ ~AdvectPhysics()

AdvectPhysics::~AdvectPhysics ( )

Destructor.

Member Function Documentation

◆ new_godunovPhysics()

virtual GodunovPhysics* AdvectPhysics::new_godunovPhysics ( ) const
virtual

Factory method - this object is its own factory.

Return a pointer to new AdvectPhysics object with the same definition as this object.

Implements GodunovPhysics.

◆ getMaxWaveSpeed()

virtual Real AdvectPhysics::getMaxWaveSpeed ( const FArrayBox a_U,
const Box a_box 
)
virtual

Compute the maximum wave speed.

Implements GodunovPhysics.

◆ getFlux()

virtual void AdvectPhysics::getFlux ( FArrayBox a_flux,
const FArrayBox a_WHalf,
const int &  a_dir,
const Box a_box 
)
virtual

COMPUTE fluxes from primitive values on a face ( advVel*wHalf)

Fluxes are computed as advVel*wHalf

Reimplemented from GodunovPhysics.

◆ charAnalysis()

virtual void AdvectPhysics::charAnalysis ( FArrayBox a_dW,
const FArrayBox a_W,
const int &  a_dir,
const Box a_box 
)
inlinevirtual

Transform a_dW from primitive to characteristic variables.

On input, a_dW contains the increments of the primitive variables. On output, it contains the increments in the characteristic variables.

IMPORTANT NOTE: It is assumed that the characteristic analysis puts the smallest eigenvalue first, the largest eigenvalue last, and orders the characteristic variables accordingly.

Implements GodunovPhysics.

◆ charSynthesis()

virtual void AdvectPhysics::charSynthesis ( FArrayBox a_dW,
const FArrayBox a_W,
const int &  a_dir,
const Box a_box 
)
inlinevirtual

Transform a_dW from characteristic to primitive variables.

On input, a_dW contains the increments of the characteristic variables. On output, it contains the increments in the primitive variables.

IMPORTANT NOTE: It is assumed that the characteristic analysis puts the smallest eigenvalue first, the largest eigenvalue last, and orders the characteristic variables accordingly.

Implements GodunovPhysics.

References charValues().

◆ charValues()

virtual void AdvectPhysics::charValues ( FArrayBox a_lambda,
const FArrayBox a_W,
const int &  a_dir,
const Box a_box 
)
virtual

Compute the characteristic values (eigenvalues)

Compute the characteristic values (eigenvalues).

IMPORTANT NOTE: It is assumed that the characteristic analysis puts the smallest eigenvalue first, the largest eigenvalue last, and orders the characteristic variables accordingly.

Implements GodunovPhysics.

Referenced by charSynthesis().

◆ incrementSource()

virtual void AdvectPhysics::incrementSource ( FArrayBox a_S,
const FArrayBox a_W,
const Box a_box 
)
inlinevirtual

Add to (increment) the source terms given the current state.

On input, a_S contains the current source terms. On output, a_S has had any additional source terms (based on the current state, a_W) added to it. This should all be done on the region defined by a_box.

Implements GodunovPhysics.

References consToPrim(), postNormalPred(), quasilinearUpdate(), and riemann().

◆ riemann()

virtual void AdvectPhysics::riemann ( FArrayBox a_WGdnv,
const FArrayBox a_WLeft,
const FArrayBox a_WRight,
const FArrayBox a_W,
const Real a_time,
const int &  a_dir,
const Box a_box 
)
virtual

Compute the solution to the Riemann problem.

Given input left and right states in a direction, a_dir, compute a Riemann problem and generate fluxes at the faces within a_box.

Implements GodunovPhysics.

Referenced by incrementSource().

◆ postNormalPred()

virtual void AdvectPhysics::postNormalPred ( FArrayBox a_dWMinus,
FArrayBox a_dWPlus,
const FArrayBox a_W,
const Real a_dt,
const Real a_dx,
const int &  a_dir,
const Box a_box 
)
virtual

Post-normal predictor calculation.

Add increment to normal predictor, e.g. to account for source terms due to spatially-varying coefficients, to bound primitive variable ranges.

Implements GodunovPhysics.

Referenced by incrementSource().

◆ quasilinearUpdate()

virtual void AdvectPhysics::quasilinearUpdate ( FArrayBox a_AdWdx,
const FArrayBox a_WHalf,
const FArrayBox a_W,
const Real a_scale,
const int &  a_dir,
const Box a_box 
)
virtual

Compute the quasilinear update A*dW/dx.

Implements GodunovPhysics.

Referenced by incrementSource().

◆ consToPrim()

virtual void AdvectPhysics::consToPrim ( FArrayBox a_W,
const FArrayBox a_U,
const Box a_box 
)
virtual

Compute primitive variables from conserved variables.

Implements GodunovPhysics.

Referenced by incrementSource().

◆ setVelocities()

void AdvectPhysics::setVelocities ( FArrayBox a_celVelPtr,
FluxBox a_advVelPtr 
)
inline

Set cell-centered and face centered advection velocity.

References m_advVelPtr, m_cellVelPtr, and m_isVelSet.

◆ numConserved()

virtual int AdvectPhysics::numConserved ( )
inlinevirtual

Number of conserved variables.

Return the number of conserved variables.

Implements GodunovPhysics.

◆ stateNames()

virtual Vector<string> AdvectPhysics::stateNames ( )
inlinevirtual

Names of the conserved variables.

Return the names of the conserved variables.

Implements GodunovPhysics.

◆ numFluxes()

virtual int AdvectPhysics::numFluxes ( )
inlinevirtual

Number of flux variables.

Return the number of flux variables. This can be greater than the number of conserved variables if addition fluxes/face-centered quantities are computed.

Implements GodunovPhysics.

◆ isDefined()

virtual bool AdvectPhysics::isDefined ( ) const
inlinevirtual

Is the object completely defined.

Return true if the object is completely defined.

Reimplemented from GodunovPhysics.

References GodunovPhysics::m_isDefined.

◆ numPrimitives()

virtual int AdvectPhysics::numPrimitives ( )
inlinevirtual

Number of primitve variables.

Return the number of primitive variables. This may be greater than the number of conserved variables if derived/redundant quantities are also stored for convenience.

Implements GodunovPhysics.

◆ velocityInterval()

virtual Interval AdvectPhysics::velocityInterval ( )
inlinevirtual

Interval within the primitive variables corresponding to the velocities.

Return the interval of component indices within the primitive variable of the velocities. Used for slope flattening (slope computation) and computing the divergence of the velocity (artificial viscosity).

Implements GodunovPhysics.

References MayDay::Error().

◆ pressureIndex()

virtual int AdvectPhysics::pressureIndex ( )
inlinevirtual

Component index within the primitive variables of the pressure.

Return the component index withn the primitive variables for the pressure. Used for slope flattening (slope computation). Component index within the primitive variables of the pressure since this doesn't apply to this set of equations, return a bogus value

Implements GodunovPhysics.

References MayDay::Error().

◆ smallPressure()

virtual Real AdvectPhysics::smallPressure ( )
inlinevirtual

Used to limit the absolute value of a "pressure" difference.

Return a value that is used by slope flattening to limit (away from zero) the absolute value of a slope in the pressureIndex() component (slope computation). Used to limit the absolute value of a "pressure" difference since this doesn't apply to this set of equations, return a bogus value

Implements GodunovPhysics.

References MayDay::Error().

◆ bulkModulusIndex()

virtual int AdvectPhysics::bulkModulusIndex ( )
inlinevirtual

Component index within the primitive variables of the bulk modulus.

Return the component index withn the primitive variables for the bulk modulus. Used for slope flattening (slope computation) used as a normalization to measure shock strength.

Implements GodunovPhysics.

References MayDay::Error().

◆ densityIndex()

virtual int AdvectPhysics::densityIndex ( )
inlinevirtual

Component index within the primitive variables of the density.

Return the component index withn the primitive variables for the density. Not defined for AdvectPhysics.

Reimplemented from GodunovPhysics.

References MayDay::Error().

Member Data Documentation

◆ m_isVelSet

bool AdvectPhysics::m_isVelSet
protected

Referenced by setVelocities().

◆ m_advVelPtr

FluxBox* AdvectPhysics::m_advVelPtr
protected

face-centered advection velocity

Referenced by setVelocities().

◆ m_cellVelPtr

FArrayBox* AdvectPhysics::m_cellVelPtr
protected

cell-centered advection velocity (centered at old time)

Referenced by setVelocities().


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