Chombo + EB + MF  3.2
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
MOLPhysics Class Referenceabstract

#include <MOLPhysics.H>

Inheritance diagram for MOLPhysics:
Inheritance graph
[legend]

Public Member Functions

 MOLPhysics ()
 Constructor. More...
 
virtual ~MOLPhysics ()
 Destructor. 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 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 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...
 
virtual Real getMaxWaveSpeed (const FArrayBox &a_U, const Box &a_box)=0
 Compute the maximum wave speed. More...
 
virtual void soundSpeed (FArrayBox &a_speed, const FArrayBox &a_U, const Box &a_box)
 Compute the maximum wave speed. More...
 
virtual MOLPhysicsnew_molPhysics () const =0
 Object factory for this class. More...
 
virtual void copyTo (MOLPhysics *a_mol) const
 Copy our values into one of us. More...
 
virtual int numConserved () const =0
 Number of conserved variables. More...
 
virtual Vector< string > stateNames ()=0
 Names of the conserved variables. More...
 
virtual int numFluxes () const =0
 Number of flux variables. More...
 
virtual void getFlux (FArrayBox &a_flux, const FArrayBox &a_WHalf, const int &a_dir, const Box &a_box)
 Compute the fluxes from primitive variable values on a face. More...
 
virtual bool isDefined () const
 Is the object completely defined. More...
 
virtual int numPrimitives () const =0
 Number of primitive variables. More...
 
virtual void riemann (FArrayBox &a_WStar, const FArrayBox &a_WLeft, const FArrayBox &a_WRight, const FArrayBox &a_W, const Real &a_time, const int &a_dir, const Box &a_box)=0
 Compute the solution to the Riemann problem. More...
 
virtual void consToPrim (FArrayBox &a_W, const FArrayBox &a_U, const Box &a_box)=0
 Compute primitive variables from conserved variables. More...
 
virtual Interval velocityInterval () const =0
 Interval within the primitive variables corresponding to the velocities. More...
 
virtual Interval vectorFluxInterval () const
 Interval within the flux variables corresponding to vector flux. More...
 
virtual int pressureIndex ()=0
 Component index within the primitive variables of the pressure. More...
 
virtual Real smallPressure ()=0
 Used to limit the absolute value of a "pressure" difference. More...
 
virtual int bulkModulusIndex ()=0
 Component index within the primitive variables of the bulk modulus. More...
 
virtual int densityIndex ()
 Component index within the primitive variables of the density. 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
 

Protected Attributes

bool m_isDefined
 
ProblemDomain m_domain
 
Real m_dx
 
MOLUtilities m_util
 
bool m_useFourthOrderArtificialViscosity
 
Real m_M0sq
 
PhysIBCm_bc
 
bool m_isBCSet
 

Private Member Functions

MOLPhysicsoperator= (const MOLPhysics &a_input)
 
 MOLPhysics (const MOLPhysics &a_input)
 

Detailed Description

The base class MOLPhysics provides the physics-dependent components for a higher-order method for a single patch: Riemann solver and transformations between conserved, primitive, and flux variables. This class is essentially pure virtual, i.e. all of its member functions are virtual, and the ones that have default implementations are ones which are optionally defined, i.e. the default definition is to send an error message. Physics-dependent versions of this class that are required in real applications are derived from this class by inheritance.

Constructor & Destructor Documentation

◆ MOLPhysics() [1/2]

MOLPhysics::MOLPhysics ( )

Constructor.

◆ ~MOLPhysics()

virtual MOLPhysics::~MOLPhysics ( )
virtual

Destructor.

◆ MOLPhysics() [2/2]

MOLPhysics::MOLPhysics ( const MOLPhysics a_input)
private

Member Function Documentation

◆ getPhysIBC()

PhysIBC* MOLPhysics::getPhysIBC ( ) const

Get the initial and boundary condition object.

◆ setPhysIBC()

void MOLPhysics::setPhysIBC ( PhysIBC a_bc)

Set the initial and boundary condition object.

◆ define()

virtual void MOLPhysics::define ( const ProblemDomain a_domain,
const Real a_dx 
)
virtual

Define the object.

◆ setCurrentBox()

virtual void MOLPhysics::setCurrentBox ( const Box a_currentBox)
virtual

Set the current box (default implementation - do nothing)

◆ fourthOrderArtificialViscosityIsDefined()

virtual bool MOLPhysics::fourthOrderArtificialViscosityIsDefined ( ) const
virtual

Returns true if 4th-order artificial viscosity is defined.

◆ setFourthOrderArtificialViscosityParameter()

virtual void MOLPhysics::setFourthOrderArtificialViscosityParameter ( const Real M0sq)
virtual

Defines fourth-order artifical viscosity strong shock threshold.

◆ getFourthOrderArtificialViscosityParameter()

virtual Real MOLPhysics::getFourthOrderArtificialViscosityParameter ( ) const
virtual

Returns fourth-order artifical viscosity strong shock threshold.

◆ getMaxWaveSpeed()

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

Compute the maximum wave speed.

◆ soundSpeed()

virtual void MOLPhysics::soundSpeed ( FArrayBox a_speed,
const FArrayBox a_U,
const Box a_box 
)
virtual

Compute the maximum wave speed.

◆ new_molPhysics()

virtual MOLPhysics* MOLPhysics::new_molPhysics ( ) const
pure virtual

Object factory for this class.

◆ copyTo()

virtual void MOLPhysics::copyTo ( MOLPhysics a_mol) const
virtual

Copy our values into one of us.

◆ numConserved()

virtual int MOLPhysics::numConserved ( ) const
pure virtual

Number of conserved variables.

Return the number of conserved variables.

◆ stateNames()

virtual Vector<string> MOLPhysics::stateNames ( )
pure virtual

Names of the conserved variables.

Return the names of the conserved variables.

◆ numFluxes()

virtual int MOLPhysics::numFluxes ( ) const
pure virtual

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.

◆ getFlux()

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

Compute the fluxes from primitive variable values on a face.

This has a default implementation which throws an error. The method is here so that the default implementation of "computeUpdate" can use it and the user can supply it. It has an implementation so if the user redefines "computeUpdate" they aren't force to implement "getFlux" - which is only used by the default implementation of "computeUpdate".

◆ isDefined()

virtual bool MOLPhysics::isDefined ( ) const
virtual

Is the object completely defined.

Return true if the object is completely defined.

◆ numPrimitives()

virtual int MOLPhysics::numPrimitives ( ) const
pure virtual

Number of primitive 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.

◆ riemann()

virtual void MOLPhysics::riemann ( FArrayBox a_WStar,
const FArrayBox a_WLeft,
const FArrayBox a_WRight,
const FArrayBox a_W,
const Real a_time,
const int &  a_dir,
const Box a_box 
)
pure 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.

Parameters
a_WStarface-centered solution to Riemann problem
a_WLeftleft state, on cells to left of each face
a_WRightright state, on cells to right of each face
a_Wstate on cells, used to set boundary conditions
a_timecurrent time
a_dirdirection of faces
a_boxface-centered box on which to set a_WStar

◆ consToPrim()

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

Compute primitive variables from conserved variables.

◆ velocityInterval()

virtual Interval MOLPhysics::velocityInterval ( ) const
pure virtual

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).

◆ vectorFluxInterval()

virtual Interval MOLPhysics::vectorFluxInterval ( ) const
virtual

Interval within the flux variables corresponding to vector flux.

◆ pressureIndex()

virtual int MOLPhysics::pressureIndex ( )
pure virtual

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).

◆ smallPressure()

virtual Real MOLPhysics::smallPressure ( )
pure virtual

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).

◆ bulkModulusIndex()

virtual int MOLPhysics::bulkModulusIndex ( )
pure virtual

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.

◆ densityIndex()

virtual int MOLPhysics::densityIndex ( )
virtual

Component index within the primitive variables of the density.

Return the component index within the primitive variables for the density. Used for fourth-order accurate artificial viscosity.

◆ artVisc()

virtual void MOLPhysics::artVisc ( FArrayBox a_F,
const FArrayBox a_U,
const Real a_artificialViscosity,
const Real a_currentTime,
const int &  a_dir,
const Box a_box 
)
virtual

Compute the artificial viscosity contribution to the flux.

Compute the artificial viscosity contribution to the flux. This has a default implementation but this can be overridded as needed.

a_box is the valid cell-centered box.

Increment a_F on all a_dir-faces of a_box using a_U on all cells of bx1inDomain = grow(a_box, 1) & m_domain.

◆ expressions()

virtual void MOLPhysics::expressions ( HDF5HeaderData a_holder) const
inlinevirtual

◆ operator=()

MOLPhysics& MOLPhysics::operator= ( const MOLPhysics a_input)
private

Member Data Documentation

◆ m_isDefined

bool MOLPhysics::m_isDefined
protected

◆ m_domain

ProblemDomain MOLPhysics::m_domain
protected

◆ m_dx

Real MOLPhysics::m_dx
protected

◆ m_util

MOLUtilities MOLPhysics::m_util
protected

◆ m_useFourthOrderArtificialViscosity

bool MOLPhysics::m_useFourthOrderArtificialViscosity
protected

◆ m_M0sq

Real MOLPhysics::m_M0sq
protected

◆ m_bc

PhysIBC* MOLPhysics::m_bc
protected

◆ m_isBCSet

bool MOLPhysics::m_isBCSet
protected

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