#include <PatchGodunov.H>
Collaboration diagram for PatchGodunov:
Public Methods | |
PatchGodunov () | |
Constructor. | |
virtual | ~PatchGodunov () |
Destructor. | |
virtual void | define (ProblemDomain &a_domain, const Real &a_dx) |
Define the object. | |
virtual void | setPhysIBC (PhysIBC *a_bc) |
Set the initial and boundary condition object. | |
virtual PhysIBC * | getPhysIBC () const |
Get the initial and boundary condition object. | |
virtual void | setSlopeParameters (bool a_fourthOrderSlopes, bool a_flattening, bool a_limitSlopes=true) |
Set parameters for slope computations. | |
virtual bool | useFourthOrderSlopes () |
Fourth-order slope query. | |
virtual bool | useFlattening () |
Slope flattening query. | |
virtual bool | limitSlopes () |
Slope limiter query. | |
virtual void | setArtificialViscosity (bool a_useArtificialViscosity, Real a_artificialViscosity) |
Set parameters for artificial viscosity. | |
virtual bool | useArtificialViscosity () |
Artificial viscosity query. | |
virtual Real | artificialViscosityCoefficient () |
Artificial viscosity coefficient. | |
virtual PatchGodunov * | new_patchGodunov () const=0 |
Factory method - this object is its own factory. | |
virtual void | setCurrentTime (const Real &a_currentTime) |
Set the current time before calling updateState(). | |
virtual void | setCurrentBox (const Box &a_currentBox) |
Set the current box before calling updateState(). | |
virtual void | updateState (FArrayBox &a_U, FArrayBox a_F[CH_SPACEDIM], Real &a_maxWaveSpeed, const FArrayBox &a_S, const Real &a_dt, const Box &a_box) |
Update the conserved variables and return the final fluxes used for this. | |
virtual Real | getMaxWaveSpeed (const FArrayBox &a_U, const Box &a_box)=0 |
Compute the maximum wave speed. | |
virtual int | numConserved ()=0 |
Number of conserved variables. | |
virtual Vector< string > | stateNames () |
Names of the conserved variables. | |
virtual int | numFluxes ()=0 |
Number of flux variables. | |
Protected Methods | |
virtual bool | isDefined () const |
Is the object completely defined. | |
virtual int | numPrimitives ()=0 |
Number of primitive variables. | |
virtual int | numSlopes ()=0 |
Number of primitive variables for which slopes are computed. | |
virtual void | consToPrim (FArrayBox &a_W, const FArrayBox &a_U, const Box &a_box)=0 |
Compute the primitive variables from the conserved variables within a_box. | |
virtual void | computeFlattening (FArrayBox &a_flattening, const FArrayBox &a_W, const Box &a_box) |
Compute the slope flattening coefficients. | |
virtual void | slope (FArrayBox &a_dW, const FArrayBox &a_W, const FArrayBox &a_flattening, const int &a_dir, const Box &a_box) |
Compute the 2nd or 4th order slopes of the primitive variables. | |
virtual void | normalPred (FArrayBox &a_WMinus, FArrayBox &a_WPlus, const FArrayBox &a_W, const FArrayBox &a_dW, const Real &a_scale, const int &a_dir, const Box &a_box)=0 |
Extrapolate the primitive variables to the cell faces. | |
virtual void | incrementWithSource (FArrayBox &a_W, const FArrayBox &a_S, const Real &a_scale, const Box &a_box) |
Increment the primitive variables by a source term. | |
virtual void | riemann (FArrayBox &a_F, const FArrayBox &a_WLeft, const FArrayBox &a_WRight, const int &a_dir, const Box &a_box)=0 |
Compute a Riemann problem and generate fluxes at the faces. | |
virtual void | updatePrim (FArrayBox &a_WMinus, FArrayBox &a_WPlus, const FArrayBox &a_F, const Real &a_scale, const int &a_dir, const Box &a_box)=0 |
Update the primitive variables using fluxes (of the conserved variables). | |
virtual void | artificialViscosity (FArrayBox &a_F, const FArrayBox &a_U, const FArrayBox &a_divVel, const int &a_dir, const Box &a_box) |
Apply artificial viscosity to the fluxes. | |
virtual void | updateCons (FArrayBox &a_U, const FArrayBox &a_F, const Real &a_scale, const int &a_dir, const Box &a_box)=0 |
Update the conserved variable using fluxes and a scaling factor. | |
virtual void | postUpdateCons (FArrayBox &a_U, const FArrayBox &a_Uold, const Real &a_dt, const Real &a_dx, const Box &a_box) |
virtual Interval | velocityInterval ()=0 |
Interval within the primitive variables corresponding to the velocities. | |
virtual int | pressureIndex ()=0 |
Component index within the primitive variables of the pressure. | |
virtual int | bulkModulusIndex ()=0 |
Component index within the primitive variables of the bulk modulus. | |
virtual void | applyLimiter (FArrayBox &a_dW, const FArrayBox &a_dWLeft, const FArrayBox &a_dWRight, const int &a_dir, const Box &a_box) |
Apply a slope limiter to computed slopes. | |
virtual void | divVel (FArrayBox &a_divVel, const FArrayBox &a_W, const int a_dir, const Box &a_box) |
Compute the face centered divergence of the velocity. | |
Protected Attributes | |
bool | m_isDefined |
ProblemDomain | m_domain |
Real | m_dx |
bool | m_useFourthOrderSlopes |
bool | m_useFlattening |
bool | m_limitSlopes |
bool | m_isSlopeSet |
bool | m_useArtificialViscosity |
Real | m_artificialViscosity |
bool | m_isArtViscSet |
PhysIBC * | m_bc |
bool | m_isBCSet |
Real | m_currentTime |
bool | m_isCurrentTimeSet |
Box | m_currentBox |
bool | m_isCurrentBoxSet |
There are three types of grid variables that appear in the unsplit Godunov method: conserved variables, primitive variables, and fluxes, denoted below by U, W, F, respectively. It is often convenient to have the number of primitive variables and fluxes exceed the number of conserved variables. In the case of primitive variables, redundant quantities are carried that parameterize the equation of state in order to avoid multiple calls to that the equation of state function. In the case of fluxes, it is often convenient to split the flux for some variables into multiple components, e.g., dividing the momentum flux into advective and pressure terms. The API given here provides the flexibility to support these various possibilities.
|
Constructor.
|
|
Destructor.
|
|
Apply a slope limiter to computed slopes. Given the center difference, a_dW, and the left and right differences, a_dWLeft and a_dWRight, in direction, a_dir, apply a slope limiter within a_box to generate final slopes, a_dW. This is called by slope(). A default implementation is provided which implements a van Leer limiter, see the documentation for details. |
|
Apply artificial viscosity to the fluxes. Return fluxes, a_F, updated using artificial viscosity based on the conserved variables, a_U, and the face centered divergence of the velocity, a_divVel, in a given direction, a_dir, within a_box. |
|
Artificial viscosity coefficient.
|
|
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. |
|
Compute the slope flattening coefficients. Compute the slope flattening coefficients, a_flattening, using the primitive variables, a_W, within a_box. |
|
Compute the primitive variables from the conserved variables within a_box.
|
|
Define the object.
|
|
Compute the face centered divergence of the velocity. Compute the face centered divergence of the velocity, a_divVel, from the primitive variables, a_W, in a direction, a_dir, within a_box. |
|
Compute the maximum wave speed.
|
|
Get the initial and boundary condition object.
|
|
Increment the primitive variables by a source term. The default implementation does nothing to the primitive variables. |
|
Is the object completely defined. Return true if the object is completely defined. |
|
Slope limiter query. Return true if the application is using slope limiting |
|
Factory method - this object is its own factory. Return a pointer to new PatchGodunov object with its initial and boundary condtions, slope parameters, and artificial viscosity information defined. |
|
Extrapolate the primitive variables to the cell faces. Extrapolate the primitive variables, a_W, in the minus and plus direction, a_dir, using the slopes a_dW within a_box. See document for details. |
|
Number of conserved variables. Return the number of conserved variables. |
|
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. |
|
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. |
|
Number of primitive variables for which slopes are computed. Return the number of primitive variables for which slopes are computed. Only slopes corresponding to primitive variables in the interval 0 to numSlopes() - 1 are computed and only primitive variables in that interval are updated using the slopes. |
|
|
|
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). |
|
Compute a Riemann problem and generate fluxes at the faces. Given input left and right states in a direction, a_dir, compute a Riemann problem and generate fluxes at the faces within a_box. |
|
Set parameters for artificial viscosity.
|
|
Set the current box before calling updateState().
|
|
Set the current time before calling updateState().
|
|
Set the initial and boundary condition object.
|
|
Set parameters for slope computations.
|
|
Compute the 2nd or 4th order slopes of the primitive variables. Compute the limited slope, a_dW, of the primitive variables, a_W, over the range of indices, 0 to numSlopes()-1. This only used a_flattening if 4th order slopes are being computed and slope flattening is turned on. This also calls applyLimiter() to do slope limiting. |
|
Names of the conserved variables. Return the names of the conserved variables. A default implementation is provided that puts in generic names (i.e., "variable#" which "#" ranges for 0 to numConserved()-1. |
|
Update the conserved variable using fluxes and a scaling factor. Given the fluxes, a_F, in a direction, a_dir, and a scaling factor, a_scale, update the conserved variables, a_U, within a_box: a_U = a_U - a_scale * (a_F(a_dir,HiSide) - a_F(a_dir,LoSide)) |
|
Update the primitive variables using fluxes (of the conserved variables). Given the fluxes, a_F, in a direction, a_dir, and a scaling factor, a_scale, update the primitive variables, a_WMinus and a_WPlus, within a_box. Note: The fluxes are fluxes of conserved variables. |
|
Update the conserved variables and return the final fluxes used for this. Update the conserved variables and return the final fluxes that were used for this. Compute the fluxes using a second-order, unsplit Godunov method based on the input conserved variables, a_U, and source terms, a_S. If there are no source terms then a_S should be null constructed. Also return the maximum wave speed. |
|
Artificial viscosity query. Return true if the application is using artificial viscosity. |
|
Slope flattening query. Return true if the application is using slope flattening. |
|
Fourth-order slope query. Return true if you are using fourth-order slopes and return false if you are using second-order slopes. |
|
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). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|