MAIA bb96820c
Multiphysics at AIA
|
#include <dgcartesianbcacousticperturbrbc.h>
Classes | |
struct | Timers |
Public Types | |
using | Base = DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > > |
Public Types inherited from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > > | |
using | SysEqn = DgSysEqnAcousticPerturb< nDim > |
using | SolverType = DgCartesianSolver< nDim, SysEqn > |
using | ElementCollector = maia::dg::collector::ElementCollector< nDim, SysEqn > |
using | HElementCollector = maia::dg::collector::HElementCollector< nDim, SysEqn > |
using | SurfaceCollector = maia::dg::collector::SurfaceCollector< nDim, SysEqn > |
Public Member Functions | |
DgBcAcousticPerturbRBC (SolverType &solver_, MInt bcId) | |
~DgBcAcousticPerturbRBC () | |
MString | name () const override |
Returns name of boundary condition. More... | |
void | init () override |
Initialize RBC. More... | |
void | initTimers () |
Initialize all timers and start the class timer. More... | |
void | apply (const MFloat time) override |
Apply RBC. More... | |
void | applyAtSurface (const MInt surfaceId, const MFloat NotUsed(time)) |
Calculate boundary surface flux. More... | |
void | calcFlux (const MFloat *nodeVars, const MFloat *q, const MInt noNodes1D, MFloat *flux_) const |
Calculates the physical fluxes in all directions for all integration points in an element. More... | |
void | calcRiemann (const MFloat *nodeVarsL, const MFloat *nodeVarsR, const MFloat *stateL, const MFloat *stateR, const MInt noNodes1D, const MInt dirId, MFloat *flux_) const |
Calculates the numerical flux at a surface given two states. More... | |
void | calcSource (const MFloat *nodeVars, const MFloat *u, const MInt noNodes1D, const MFloat t, const MFloat *x, MFloat *src) const |
Calculates the source terms of the RBC system. More... | |
MInt | noRestartVars () const override |
MInt | getLocalNoNodes () const override |
Return local number of nodes. More... | |
MString | restartVarName (const MInt id_) const override |
Return name of restart variable. More... | |
void | setRestartVariable (const MInt id_, const MFloat *const data) override |
Copy restart variable data to boundary conditon. More... | |
void | getRestartVariable (const MInt id_, MFloat *const data) const override |
Copy restart variable data to pointer. More... | |
MInt | noBcElements () const override |
MBool | hasBcElement (const MInt elementId) const override |
Check if there is a boundary condition element associated with the given element. More... | |
MInt | noCellDataDlb () const override |
Dynamic load balancing. More... | |
MInt | cellDataTypeDlb (const MInt NotUsed(dataId)) const override |
MInt | cellDataSizeDlb (const MInt dataId, const MInt cellId) const override |
Solution data size for given cell and data id. More... | |
void | getCellDataDlb (const MInt dataId, MFloat *const data) const override |
void | setCellDataDlb (const MInt dataId, const MFloat *const data) override |
Public Member Functions inherited from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > > | |
virtual | ~DgBoundaryCondition () |
Destructor must be virtual. More... | |
void | init (const MInt begin_, const MInt end_) |
Init method to initialize boundary condition for range of surfaces. More... | |
virtual void | apply (const MFloat time)=0 |
Apply method to apply boundary condition. More... | |
virtual MString | name () const=0 |
Returns name of boundary condition. More... | |
DgBoundaryCondition (SolverType &solver_, MInt bcId) | |
Constructor saves arguments to member variables. More... | |
MInt | id () const |
Return boundary condition if of this boundary condition. More... | |
MInt | begin () const |
Return index of first surface. More... | |
MInt | end () const |
Return index of one-past-last surface. More... | |
MInt | count () const |
Return number of boundary surfaces. More... | |
virtual MInt | noRestartVars () const |
virtual MInt | getLocalNoNodes () const |
Return local number of nodes. More... | |
virtual MString | restartVarName (const MInt NotUsed(id)) const |
Return name of restart variable. More... | |
virtual void | setRestartVariable (const MInt NotUsed(id), const MFloat *const NotUsed(data)) |
Copy restart variable data from pointer to boundary condition class. More... | |
virtual void | getRestartVariable (const MInt NotUsed(id), MFloat *const NotUsed(data)) const |
Copy restart variable data from boundary condition class to pointer. More... | |
virtual MInt | noBcElements () const |
virtual MBool | hasBcElement (const MInt NotUsed(elementId)) const |
virtual MInt | noCellDataDlb () const |
virtual MInt | cellDataTypeDlb (const MInt NotUsed(dataId)) const |
virtual MInt | cellDataSizeDlb (const MInt NotUsed(dataId), const MInt NotUsed(cellId)) const |
virtual void | getCellDataDlb (const MInt NotUsed(dataId), MFloat *const NotUsed(data)) const |
virtual void | getCellDataDlb (const MInt NotUsed(dataId), MInt *const NotUsed(data)) const |
virtual void | setCellDataDlb (const MInt NotUsed(dataId), const MFloat *const NotUsed(data)) |
virtual void | setCellDataDlb (const MInt NotUsed(dataId), const MInt *const NotUsed(data)) |
Private Types | |
using | ElementCollector = maia::dg::collector::ElementCollector< nDim, SysEqn > |
using | HElementCollector = maia::dg::collector::HElementCollector< nDim, SysEqn > |
using | SurfaceCollector = maia::dg::collector::SurfaceCollector< nDim, SysEqn > |
Private Member Functions | |
void | calcFlux1D (const MFloat *nodeVars, const MFloat *q, const MInt noNodes1D, const MInt dirId, MFloat *flux_) const |
Calculates the physical fluxes in direction 'dirId' on a surface. More... | |
void | calcElementNodeVars () |
Calculate node variables of rb-elements. More... | |
void | calcSurfaceNodeVars () |
Calculate node variables of rb-surfaces. More... | |
void | calcNodeVars (const MFloat *pos, const MFloat *nodeVarsAPE, MFloat *nodeVars) |
Calculate RBC node variables at a given position. More... | |
Private Attributes | |
ElementCollector | m_rbElements |
std::vector< MInt > | m_rbElementId |
std::vector< MInt > | m_rbSurfaceId |
std::vector< MInt > | m_elementId |
std::vector< MInt > | m_surfaceId |
SurfaceCollector | m_rbSurfaces |
std::vector< std::pair< MInt, MInt > > | m_addBndrySrfcIds |
HElementCollector | m_hRbElements |
MFloat ** | m_rbSolution = nullptr |
MInt | m_internalDataSize = -1 |
MInt | m_rkStage = -1 |
std::array< MFloat, MAX_SPACE_DIMENSIONS > | m_rbcReferencePos {} |
MBool | m_isInitialized = false |
std::array< MInt, Timers::_count > | m_timers |
Static Private Attributes | |
static const constexpr MInt | s_noNodeVars = nDim + 2 |
Additional Inherited Members | |
Protected Member Functions inherited from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > > | |
SolverType & | solver () |
Return reference to solver. More... | |
SysEqn & | sysEqn () |
Return reference to SysEqn object. More... | |
MFloat * | flux (const MInt i) |
Return pointer to surface flux. More... | |
ElementCollector & | elements () |
Return reference to elements. More... | |
MInt | getElementByCellId (const MInt cellId) const |
Return element id corresponding to given cell id. More... | |
HElementCollector & | helements () |
Return reference to h-elements. More... | |
SurfaceCollector & | surfaces () |
Return reference to surfaces. More... | |
MBool | isMpiSurface (const MInt id_) const |
Return true if surface is a MPI surface. More... | |
MBool | needHElementForCell (const MInt cellId) |
Return if h-element is needed for given cell. More... | |
MInt | getHElementId (const MInt elementId) |
Return h-element id for an element. More... | |
const DgInterpolation & | interpolation (const MInt polyDeg, const MInt noNodes1D) const |
Return interpolation. More... | |
MInt | integrationMethod () const |
Return integration method. More... | |
MInt | timeIntegrationScheme () const |
Return time integration scheme. More... | |
MInt | maxPolyDeg () const |
Return maximum polynomial degree. More... | |
MInt | maxNoNodes1D () const |
Return maximum number of nodes. More... | |
MFloat | dt () const |
Return current time step size. More... | |
MBool | isRestart () const |
Return if a restart is performed. More... | |
void | subTimeStepRk (const MFloat dt_, const MInt stage, const MInt totalSize, const MFloat *const rhs, MFloat *const variables, MFloat *const timeIntStorage) |
Access to time integration method. More... | |
void | calcVolumeIntegral (const MInt noElements, ElementCollector &elem, F &fluxFct) |
void | resetBuffer (const MInt totalSize, MFloat *const buffer) |
void | applyJacobian (const MInt noElements, ElementCollector &elem) |
void | calcSourceTerms (const MFloat t, const MInt noElements, ElementCollector &elem, F &sourceFct) |
void | calcSurfaceIntegral (const MInt begin_, const MInt end_, ElementCollector &elem, SurfaceCollector &surf, HElementCollector &helem, const MInt noHElements) |
void | calcRegularSurfaceFlux (const MInt begin_, const MInt end_, SurfaceCollector &surf, F &riemannFct) |
Definition at line 14 of file dgcartesianbcacousticperturbrbc.h.
using DgBcAcousticPerturbRBC< nDim >::Base = DgBoundaryCondition<nDim, DgSysEqnAcousticPerturb<nDim> > |
Definition at line 17 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 120 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 121 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 122 of file dgcartesianbcacousticperturbrbc.h.
|
inline |
Definition at line 49 of file dgcartesianbcacousticperturbrbc.h.
|
inline |
Definition at line 54 of file dgcartesianbcacousticperturbrbc.h.
|
overridevirtual |
0. Initialize:
Copy APE surface variables to rb-surfaces.
Implements DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.
Definition at line 480 of file dgcartesianbcacousticperturbrbc.h.
void DgBcAcousticPerturbRBC< nDim >::applyAtSurface | ( | const MInt | surfaceId, |
const MFloat | NotUsedtime | ||
) |
Definition at line 726 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Calculate all node variables on the rb-elements using the node variables on the 'normal' elements.
Definition at line 942 of file dgcartesianbcacousticperturbrbc.h.
void DgBcAcousticPerturbRBC< nDim >::calcFlux | ( | const MFloat * | nodeVars, |
const MFloat * | q, | ||
const MInt | noNodes1D, | ||
MFloat * | flux_ | ||
) | const |
Note: for argument description, see DgSysEqnAcousticPerturb::calcFlux.
Definition at line 751 of file dgcartesianbcacousticperturbrbc.h.
|
private |
The flux is obtained by the projection of the speed of wave propagation on the given direction multiplied with the variables. Note: for argument description, see DgSysEqnAcousticPerturb::calcFlux1D.
Definition at line 813 of file dgcartesianbcacousticperturbrbc.h.
|
private |
The 'nDim + 2' RBC node variables are computed at a given position with the corresponding mean velocities. The first nDim node variables contain the projection of the speed of wave propagation from the acoustic source region onto the Cartesian coordinate directions. These are the needed coefficients for the flux computations in the corresponding directions. At position 'nDim + 1' the speed of wave propagation is stored, which is needed for the Riemann solver. The last entry contains the source term coefficient which is given by the ratio of the speed of wave propagation and the distance to the reference position (2D: with factor of 1/2).
[in] | pos | position where to calculate the node variables. |
[in] | nodeVarsAPE | node variables of the APE-system at given position. |
[out] | nodeVars | computed RBC node variables. |
Definition at line 1011 of file dgcartesianbcacousticperturbrbc.h.
void DgBcAcousticPerturbRBC< nDim >::calcRiemann | ( | const MFloat * | nodeVarsL, |
const MFloat * | nodeVarsR, | ||
const MFloat * | stateL, | ||
const MFloat * | stateR, | ||
const MInt | noNodes1D, | ||
const MInt | dirId, | ||
MFloat * | flux_ | ||
) | const |
The numerical flux is calculated using the local Lax-Friedrichs flux scheme. Note: for argument description, see DgSysEqnAcousticPerturb::calcRiemann.
Definition at line 879 of file dgcartesianbcacousticperturbrbc.h.
void DgBcAcousticPerturbRBC< nDim >::calcSource | ( | const MFloat * | nodeVars, |
const MFloat * | u, | ||
const MInt | noNodes1D, | ||
const MFloat | t, | ||
const MFloat * | x, | ||
MFloat * | src | ||
) | const |
The RBC source terms are given by: 2D: S = vg/(2*r)*U 3D: S = vg/r*U Note: for argument description, see DgSysEqnAcousticPerturb::calcSource.
Definition at line 843 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Calculate all node variables on the rb-surfaces using the node variables on the 'normal' surfaces.
Definition at line 968 of file dgcartesianbcacousticperturbrbc.h.
|
override |
Definition at line 1221 of file dgcartesianbcacousticperturbrbc.h.
|
inlineoverridevirtual |
Reimplemented from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.
Definition at line 98 of file dgcartesianbcacousticperturbrbc.h.
|
inlineoverride |
Definition at line 106 of file dgcartesianbcacousticperturbrbc.h.
|
overridevirtual |
Reimplemented from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.
Definition at line 1130 of file dgcartesianbcacousticperturbrbc.h.
|
override |
[in] | id_ | Variable id. |
[in] | data | Pointer to store restart variable data. |
Definition at line 1197 of file dgcartesianbcacousticperturbrbc.h.
|
override |
Definition at line 1250 of file dgcartesianbcacousticperturbrbc.h.
|
overridevirtual |
Reimplemented from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.
Definition at line 209 of file dgcartesianbcacousticperturbrbc.h.
void DgBcAcousticPerturbRBC< nDim >::initTimers |
Definition at line 438 of file dgcartesianbcacousticperturbrbc.h.
|
inlineoverridevirtual |
Implements DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.
Definition at line 61 of file dgcartesianbcacousticperturbrbc.h.
|
inlineoverridevirtual |
Reimplemented from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.
Definition at line 90 of file dgcartesianbcacousticperturbrbc.h.
|
inlineoverridevirtual |
Reimplemented from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.
Definition at line 95 of file dgcartesianbcacousticperturbrbc.h.
|
inlineoverridevirtual |
Return number of restart variables that need to be stored/loaded. If a derived class does not need additional restart variables, it may omit an implementation.
Reimplemented from DgBoundaryCondition< nDim, DgSysEqnAcousticPerturb< nDim > >.
Definition at line 84 of file dgcartesianbcacousticperturbrbc.h.
|
override |
[in] | id_ | Requested variable id. |
Definition at line 1151 of file dgcartesianbcacousticperturbrbc.h.
|
inlineoverride |
Definition at line 109 of file dgcartesianbcacousticperturbrbc.h.
|
override |
[in] | id_ | Variable id. |
[in] | data | Pointer to restart variable data. |
Definition at line 1169 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 144 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 134 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 148 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 154 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 163 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 160 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 129 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 126 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 151 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 131 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 140 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 157 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 136 of file dgcartesianbcacousticperturbrbc.h.
|
private |
Definition at line 191 of file dgcartesianbcacousticperturbrbc.h.
|
staticconstexprprivate |
Definition at line 166 of file dgcartesianbcacousticperturbrbc.h.