MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
FvCartesianSolverXD< nDim_, SysEqn > Class Template Reference

#include <fvcartesiansolverxd.h>

Inheritance diagram for FvCartesianSolverXD< nDim_, SysEqn >:
[legend]
Collaboration diagram for FvCartesianSolverXD< nDim_, SysEqn >:
[legend]

Classes

class  FvGapCell
 
struct  MV
 

Public Types

using Cell = typename maia::grid::tree::Tree< nDim >::Cell
 
using FvSurfaceCollector = maia::fv::surface_collector::FvSurfaceCollector< nDim >
 
using SolverCell = FvCell
 
using CartesianSolver = typename maia::CartesianSolver< nDim, FvCartesianSolverXD >
 
using Grid = typename CartesianSolver::Grid
 
using GridProxy = typename CartesianSolver::GridProxy
 
using Geom = Geometry< nDim >
 
using PrimitiveVariables = typename SysEqn::PrimitiveVariables
 
- Public Types inherited from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >
using Grid = CartesianGrid< nDim >
 
using GridProxy = typename maia::grid::Proxy< nDim >
 
using Geom = Geometry< nDim >
 
using TreeProxy = maia::grid::tree::TreeProxy< nDim >
 
using Cell = maia::grid::tree::Cell
 

Public Member Functions

 FvCartesianSolverXD ()=delete
 
 FvCartesianSolverXD (MInt, MInt, const MBool *, maia::grid::Proxy< nDim_ > &gridProxy_, Geometry< nDim_ > &geometry_, const MPI_Comm comm)
 
 ~FvCartesianSolverXD ()
 
SysEqn sysEqn () const
 
SysEqn & sysEqn ()
 
MInt a_noCells () const
 Returns the number of cells. More...
 
MInt noInternalCells () const override
 Return the number of internal cells within this solver. More...
 
MBool a_isGapCell (const MInt cellId) const
 Returns isGapCell of the cell cellId. More...
 
maia::fv::cell::BitsetType::reference a_isGapCell (const MInt cellId)
 Returns isGapCell of the cell cellId. More...
 
maia::fv::cell::BitsetType::reference a_wasGapCell (const MInt cellId)
 Returns wasGapCell of the cell cellId. More...
 
MBool a_isHalo (const MInt cellId) const
 Returns IsHalo of the cell cellId. More...
 
maia::fv::cell::BitsetType::reference a_isHalo (const MInt cellId)
 Returns IsHalo of the cell cellId. More...
 
MBool a_isWindow (const MInt cellId) const
 Returns IsWindow of the cell cellId. More...
 
maia::fv::cell::BitsetType::reference a_isWindow (const MInt cellId)
 Returns IsWindow of the cell cellId. More...
 
MBool a_isPeriodic (const MInt cellId) const
 Returns IsPeriodic of the cell cellId. More...
 
maia::fv::cell::BitsetType::reference a_isPeriodic (const MInt cellId)
 Returns IsPeriodic of the cell cellId. More...
 
MBool a_isBndryCell (const MInt cellId) const override
 Returns isBndryCell of the cell cellId. More...
 
MBool a_isInterface (const MInt cellId) const
 Returns isInterface of the cell cellId. More...
 
maia::fv::cell::BitsetType::reference a_isInterface (const MInt cellId)
 Returns isInterface of the cell cellId. More...
 
MBool a_isBndryGhostCell (const MInt cellId) const
 Returns isBndryGhostCell of the cell cellId. More...
 
maia::fv::cell::BitsetType::reference a_isBndryGhostCell (const MInt cellId)
 Returns isBndryGhostCell of the cell cellId. More...
 
MBool a_isWMImgCell (const MInt cellId) const
 Returns isWMImgCell of the cell cellId. More...
 
maia::fv::cell::BitsetType::reference a_isWMImgCell (const MInt cellId)
 Returns isWMImgCell of the cell cellId. More...
 
MBool a_isSandpaperTripCell (const MInt cellId) const
 Returns isWMImgCell of the cell cellId. More...
 
maia::fv::cell::BitsetType::reference a_isSandpaperTripCell (const MInt cellId)
 Returns isWMImgCell of the cell cellId. More...
 
maia::fv::cell::BitsetTypea_properties (const MInt cellId)
 Returns properties of the cell cellId. More...
 
MFloata_spongeFactor (const MInt cellId)
 Returns the spongeFactor of the cell cellId. More...
 
MFloat a_spongeFactor (const MInt cellId) const
 Returns the spongeFactor of the cell cellId. More...
 
MFloata_coordinate (const MInt cellId, const MInt dir)
 Returns the coordinate of the cell from the fvcellcollector cellId for dimension dir. More...
 
MFloat a_coordinate (const MInt cellId, const MInt dir) const
 Returns the coordinate of the cell from the fvcellcollector cellId for dimension dir. More...
 
MInta_level (const MInt cellId)
 Returns the level of the cell from the fvcellcollector cellId. More...
 
MInt a_level (const MInt cellId) const
 Returns the level of the cell from the fvcellcollector cellId. More...
 
MFloata_cellVolume (const MInt cellId)
 Returns the cell volume of the cell from the fvcellcollector cellId. More...
 
MFloat a_cellVolume (const MInt cellId) const
 Returns the cell volume of the cell from the fvcellcollector cellId. More...
 
MFloata_FcellVolume (const MInt cellId) override
 Returns the inverse cell volume of the cell from the fvcellcollector cellId. More...
 
MFloat a_FcellVolume (const MInt cellId) const
 Returns the inverse cell volume of the cell from the fvcellcollector cellId. More...
 
MInt a_cutCellLevel (const MInt cellId) const
 Returns the level for cutCells, this can either be the maxRefinementLevel or the level of the current cellId. More...
 
MBool a_isInactive (const MInt cellId) const
 
MBool a_isActive (const MInt cellId) const
 
MBool a_isSplitCell (const MInt cellId) const
 
MInt a_noSplitCells () const
 
MInt a_noSplitChilds (const MInt sc) const
 
MInt a_splitChildId (const MInt sc, const MInt ssc)
 
MInt a_splitCellId (const MInt sc) const
 
void assertValidGridCellId (const MInt cellId) const
 Cecks wether the cell cellId is an actual grid-cell. More...
 
void assertValidGridCellId (const MInt NotUsed(cellId)) const
 
void assertDeleteNeighbor (const MInt cellId, const MInt dir) const
 Checks wether the cell cellId has a valid neighbor in direction dir. More...
 
MBool checkNeighborActive (const MInt cellId, const MInt dir) const
 Cecks wether the cell cellId has a valid neighbor in direction dir. More...
 
MFloat c_coordinate (const MInt cellId, const MInt dir) const
 Returns the coordinate of the cell from the grid().tree() cellId for dimension dir. More...
 
MBool c_isLeafCell (const MInt cellId) const
 
MInt c_level (const MInt cellId) const
 Returns the grid level of the cell cellId. More...
 
MInt c_noChildren (const MInt cellId) const
 Returns the number of children of the cell cellId. More...
 
MLong c_parentId (const MInt cellId) const
 Returns the grid parent id of the cell cellId. More...
 
MLong c_globalId (const MInt cellId) const
 Returns the global grid id of the grid cell cellId. More...
 
MFloat c_weight (const MInt cellId) const
 Returns the weight of the cell cellId. More...
 
MLong c_childId (const MInt cellId, const MInt pos) const
 Returns the grid child id of the grid cell cellId at position pos. More...
 
MLong c_neighborId (const MInt cellId, const MInt dir, const MBool assertNeighborState=true) const
 Returns the grid neighbor id of the grid cell cellId dir. More...
 
MFloat c_cellLengthAtCell (const MInt cellId) const
 Returns the length of the cell for level. More...
 
MFloat c_cellLengthAtLevel (const MInt level) const
 Returns the length of the cell for level. More...
 
MFloat c_cellVolumeAtLevel (const MInt level) const
 Returns the grid Volume of the cell for level. More...
 
MBool a_hasProperty (const MInt cellId, const Cell p) const
 Returns grid cell property p of the cell cellId. More...
 
MBool c_isToDelete (const MInt cellId) const
 Returns the delete of the cell cellId. More...
 
MInt a_hasNeighbor (const MInt cellId, const MInt dir, const MBool assertNeighborState=true) const
 Returns noNeighborIds of the cell CellId for direction dir. More...
 
MFloata_variable (const MInt cellId, const MInt varId)
 Returns conservative variable v of the cell cellId for variables varId. More...
 
MFloat a_variable (const MInt cellId, const MInt varId) const
 Returns conservative variable v of the cell cellId for variables varId. More...
 
MFloata_pvariable (const MInt cellId, const MInt varId)
 Returns primitive variable v of the cell cellId for variables varId. More...
 
MFloat a_pvariable (const MInt cellId, const MInt varId) const
 Returns primitive variable v of the cell cellId for variables varId. More...
 
MFloata_avariable (const MInt cellId, const MInt varId)
 Returns additional variable v of the cell cellId for variables varId. More...
 
MFloat a_avariable (const MInt cellId, const MInt varId) const
 Returns additional variable v of the cell cellId for variables varId. More...
 
maia::fv::cell::BitsetType::reference a_hasProperty (const MInt cellId, const SolverCell p)
 Returns solver cell property p of the cell cellId. More...
 
MBool a_hasProperty (const MInt cellId, const SolverCell p) const
 Returns solver cell property p of the cell cellId. More...
 
void a_resetPropertiesSolver (const MInt cellId)
 Returns property p of the cell cellId. More...
 
void a_copyPropertiesSolver (const MInt fromCellId, const MInt toCellId)
 Returns property p of the cell cellId. More...
 
MInta_reconstructionNeighborId (const MInt cellId, const MInt nghbrNo)
 Returns reconstruction neighbor n of the cell cellId. More...
 
MInt a_reconstructionNeighborId (const MInt cellId, const MInt nghbrNo) const
 Returns reconstruction neighbor n of the cell cellId. More...
 
MInta_reconstructionData (const MInt cellId)
 Returns reconstruction data offset i of the cell cellId. More...
 
MInt a_reconstructionNeighborId (const MInt cellId) const
 Returns reconstruction data offset i of the cell cellId. More...
 
MInta_spongeBndryId (const MInt cellId, const MInt dir)
 Returns the spongeBndryId of the cell cellId for direction dir. More...
 
MInt a_spongeBndryId (const MInt cellId, const MInt dir) const
 Returns the spongeBndryId of the cell cellId for direction dir. More...
 
MFloata_spongeFactorStart (const MInt cellId)
 Returns the spongeFactorStart of the cell cellId. More...
 
MFloat a_spongeFactorStart (const MInt cellId) const
 Returns the spongeFactorStart of the cell cellId. More...
 
MInta_bndryId (const MInt cellId)
 Returns the bndryId of the cell cellId. More...
 
MInt a_bndryId (const MInt cellId) const
 Returns the bndryId of the cell cellId. More...
 
MInta_noReconstructionNeighbors (const MInt cellId)
 Returns the noRcnstrctnNghbrIds of the cell cellId. More...
 
MInt a_noReconstructionNeighbors (const MInt cellId) const
 Returns the noRcnstrctnNghbrIds of the cell cellId. More...
 
MFloata_tau (const MInt cellId, const MInt varId)
 Returns the tau of the cell cellId for variable varId. More...
 
MFloat a_tau (const MInt cellId, const MInt varId) const
 Returns the tau of the cell cellId for variable varId. More...
 
MFloata_restrictedRHS (const MInt cellId, const MInt varId)
 Returns the restrictedRHS of the cell cellId for variable varId. More...
 
MFloat a_restrictedRHS (const MInt cellId, const MInt varId) const
 Returns the restrictedRHS of the cell cellId for variable varId. More...
 
MFloata_restrictedVar (const MInt cellId, const MInt varId)
 Returns restricted variables of cell cellId for variable varId on level level. More...
 
MFloat a_restrictedVar (const MInt cellId, const MInt varId) const
 Returns restricted variables of cell cellId for variable varId on level level. More...
 
MFloata_reactionRate (const MInt cellId, const MInt reactionId)
 Returns the reactionRate of the cell cellId for variables varId. More...
 
MFloat a_reactionRate (const MInt cellId, const MInt reactionId) const
 Returns the reactionRate of the cell cellId for variables varId. More...
 
MFloata_reactionRateBackup (const MInt cellId, const MInt reactionId)
 Returns the reactionRateBackup of the cell cellId for variables varId. More...
 
MFloat a_reactionRateBackup (const MInt cellId, const MInt reactionId) const
 Returns the reactionRateBackup of the cell cellId for variables varId. More...
 
MFloata_psi (const MInt cellId)
 Returns psi of the cell cellId for variables varId. More...
 
MFloat a_psi (const MInt cellId) const
 Returns psi of the cell cellId for variables varId. More...
 
MFloata_speciesReactionRate (const MInt cellId, const MInt speciesIndex)
 
MFloat a_speciesReactionRate (const MInt cellId, const MInt speciesIndex) const
 
MFloata_implicitCoefficient (const MInt cellId, const MInt coefId)
 Returns the implicitCoefficient of cell cellId for coefficient coefId. More...
 
MFloat a_implicitCoefficient (const MInt cellId, const MInt coefId) const
 Returns the implicitCoefficient of cell cellId for coefficient coefId. More...
 
MFloata_dt1Variable (const MInt cellId, const MInt varId)
 Returns dt1Variables of the cell CellId variables varId. More...
 
MFloat a_dt1Variable (const MInt cellId, const MInt varId) const
 Returns dt1Variables of the cell CellId variables varId. More...
 
MFloata_dt2Variable (const MInt cellId, const MInt varId)
 Returns dt2Variables of the cell CellId variables varId. More...
 
MFloat a_dt2Variable (const MInt cellId, const MInt varId) const
 Returns dt2Variables of the cell CellId variables varId. More...
 
MFloata_oldVariable (const MInt cellId, const MInt varId)
 Returns oldVariablesv of the cell cellId variables varId. More...
 
MFloat a_oldVariable (const MInt cellId, const MInt varId) const
 Returns oldVariables v of the cell cellId variables varId. More...
 
MFloata_slope (const MInt cellId, MInt const varId, const MInt dir) override
 Returns the slope of the cell cellId for the variable varId in direction dir. More...
 
MFloat a_slope (const MInt cellId, MInt const varId, const MInt dir) const
 Returns the slope of the cell cellId for the variable varId in direction dir. More...
 
MFloata_storedSlope (const MInt cellId, MInt const varId, const MInt dir)
 Returns the stored slope of the cell cellId for the variable varId in direction dir. More...
 
MFloat a_storedSlope (const MInt cellId, MInt const varId, const MInt dir) const
 Returns the stored slope of the cell cellId for the variable varId in direction dir. More...
 
MFloata_rightHandSide (const MInt cellId, MInt const varId)
 Returns the right hand side of the cell cellId for the variable varId. More...
 
MFloat a_rightHandSide (const MInt cellId, MInt const varId) const
 Returns the right hand side of the cell cellId for the variable varId. More...
 
MInt a_noSurfaces ()
 Returns the number of surfaces. More...
 
MInta_surfaceBndryCndId (const MInt srfcId)
 Returns the boundary condition of surface srfcId. More...
 
MInt a_surfaceBndryCndId (const MInt srfcId) const
 Returns the boundary condition of surface srfcId. More...
 
MInta_surfaceOrientation (const MInt srfcId)
 Returns the orientation of surface srfcId. More...
 
MInt a_surfaceOrientation (const MInt srfcId) const
 Returns the orientation of surface srfcId. More...
 
MFloata_surfaceArea (const MInt srfcId)
 Returns the area of surface srfcId. More...
 
MFloat a_surfaceArea (const MInt srfcId) const
 Returns the area of surface srfcId. More...
 
MFloata_surfaceFactor (const MInt srfcId, const MInt varId)
 Returns the factor of surface srfcId for variable varId. More...
 
MFloat a_surfaceFactor (const MInt srfcId, const MInt varId) const
 Returns the factor of surface srfcId for variable varId. More...
 
MFloata_surfaceCoordinate (const MInt srfcId, const MInt dir)
 Returns the coordinate of surface srfcId in direction dir. More...
 
MFloat a_surfaceCoordinate (const MInt srfcId, const MInt dir) const
 Returns the coordinate of surface srfcId in direction dir. More...
 
MFloata_surfaceDeltaX (const MInt srfcId, const MInt varId)
 Returns the delta X of surface srfcId for variable varId. More...
 
MFloat a_surfaceDeltaX (const MInt srfcId, const MInt varId) const
 Returns the delta X of surface srfcId for variable varId. More...
 
MInta_surfaceNghbrCellId (const MInt srfcId, const MInt dir)
 Returns the neighbor cell id of surface srfcId in direction dir. More...
 
MInt a_surfaceNghbrCellId (const MInt srfcId, const MInt dir) const
 Returns the neighbor cell id of surface srfcId in direction dir. More...
 
MFloata_surfaceVariable (const MInt srfcId, const MInt dir, const MInt varId)
 Returns the variable varId of surface srfcId in direction dir. More...
 
MFloat a_surfaceVariable (const MInt srfcId, const MInt dir, const MInt varId) const
 Returns the variable varId of surface srfcId in direction dir. More...
 
MFloata_surfaceUpwindCoefficient (const MInt srfcId)
 Returns the upwind coefficient of surface srfcId. More...
 
MFloat a_surfaceUpwindCoefficient (const MInt srfcId) const
 Returns the upwind coefficient of surface srfcId. More...
 
MFloata_surfaceCoefficient (const MInt srfcId, const MInt dimCoefficient)
 Returns the coefficient dimCoefficient of surface srfcId. More...
 
MFloat a_surfaceCoefficient (const MInt srfcId, const MInt dimCoefficient) const
 Returns the coefficient dimCoefficient of surface srfcId. More...
 
MFloata_surfaceFlux (const MInt srfcId, const MInt fVarId)
 Returns the flux fVarId for surface srfcId. More...
 
MFloat a_surfaceflux (const MInt srfcId, const MInt fVarId) const
 Returns the flux fVarId for surface srfcId. More...
 
MFloata_Ma ()
 Returns the Mach number of the solver. More...
 
const MFloata_Ma () const
 Returns the Mach number of the solver. More...
 
MFloata_cfl ()
 Returns the cfl number of the solver. More...
 
const MFloata_cfl () const
 
MInta_restartInterval ()
 Returns the restart interval of the solver. More...
 
const MInta_restartInterval () const
 Returns the restart interval of the solver. More...
 
MInta_bndryCndId (MInt bndryId)
 Return BndryCndId. More...
 
const MInta_bndryCndId (MInt bndryId) const
 Return BndryCndId. More...
 
MFloata_bndryNormal (MInt bndryId, MInt dir)
 Return normal direction of bndry srfc. More...
 
const MFloata_bndryNormal (MInt bndryId, MInt dir) const
 Return normal direction of bndry srfc. More...
 
MFloata_bndryCutCoord (MInt bndryId, MInt i, MInt j)
 Return cut coordinates of bndry srfc. More...
 
const MFloata_bndryCutCoord (MInt bndryId, MInt i, MInt j) const
 Return cut coordinates of bndry srfc. More...
 
const MInta_bndryGhostCellId (const MInt bndryId, const MInt srfc) const
 
MInta_identNghbrId (MInt nghbrId)
 Return ident nghbr Id. More...
 
const MInta_identNghbrId (MInt nghbrId) const
 Return ident nghbr Id. More...
 
MInta_storeNghbrId (MInt nghbrId)
 Return store nghbr Id. More...
 
const MInta_storeNghbrId (MInt nghbrId) const
 Return store nghbr Id. More...
 
MFloata_VVInfinity (MInt dir)
 Return mean flow velocity. More...
 
const MFloata_VVInfinity (MInt dir) const
 Return mean flow velocity. More...
 
MFloata_rhoInfinity ()
 Return rho infinity. More...
 
const MFloata_rhoInfinity () const
 Return rho infinity. More...
 
MFloata_PInfinity ()
 Return p infinity. More...
 
const MFloata_PInfinity () const
 Return p infinity. More...
 
MFloata_TInfinity ()
 Return T infinity. More...
 
const MFloata_TInfinity () const
 Return T infinity. More...
 
MFloata_timeRef ()
 Return time reference value. More...
 
const MFloata_timeRef () const
 Return time reference value. More...
 
MInta_noPart (MInt cellId)
 Return no particles. More...
 
MFloata_physicalTime ()
 Return physical time. More...
 
const MFloata_physicalTime () const
 Return physical time. More...
 
MFloata_time ()
 Return time. More...
 
const MFloata_time () const
 Return time. More...
 
const MInta_noPart (MInt cellId) const
 Return no particles. More...
 
MFloata_externalSource (MInt cellId, MInt var)
 Return external source. More...
 
const MFloata_externalSource (MInt cellId, MInt var) const
 Return external source. More...
 
MInta_maxLevelWindowCells (MInt domain, MInt id)
 Return max level window cells. More...
 
const MInta_maxLevelWindowCells (MInt domain, MInt id) const
 Return max level window cells. More...
 
MInta_maxLevelHaloCells (MInt domain, MInt id)
 Return max level halo cells. More...
 
const MInta_maxLevelHaloCells (MInt domain, MInt id) const
 Return max level halo cells. More...
 
MFloata_localTimeStep (const MInt cellId)
 Returns the local time-step of the cell cellId. More...
 
MFloat a_localTimeStep (const MInt cellId) const
 Returns the local time-step of the cell cellId. More...
 
MFloat a_dynViscosity (const MFloat T) const
 
MFloata_levelSetFunction (const MInt cellId, const MInt set)
 Returns the levelSet-value for fv-CellId cellId and set. More...
 
MFloat a_levelSetFunction (const MInt cellId, const MInt set) const
 Returns the levelSet-value for fv-CellId cellId and set. More...
 
MFloata_levelSetValuesMb (const MInt cellId, const MInt set)
 Returns the levelSetMb-value for fv-CellId cellId and set. More...
 
MFloat a_levelSetValuesMb (const MInt cellId, const MInt set) const
 Returns the levelSetMb-value for fv-CellId cellId and set. More...
 
MFloat a_alphaGas (const MInt cellId) const
 
MFloata_alphaGas (const MInt cellId)
 
MFloat a_uOtherPhase (const MInt cellId, const MInt dir) const
 
MFloata_uOtherPhase (const MInt cellId, const MInt dir)
 
MFloat a_uOtherPhaseOld (const MInt cellId, const MInt dir) const
 
MFloata_uOtherPhaseOld (const MInt cellId, const MInt dir)
 
MFloat a_gradUOtherPhase (const MInt cellId, const MInt uDir, const MInt gradDir) const
 
MFloata_gradUOtherPhase (const MInt cellId, const MInt uDir, const MInt gradDir)
 
MFloat a_vortOtherPhase (const MInt cellId, const MInt dir) const
 
MFloata_vortOtherPhase (const MInt cellId, const MInt dir)
 
MFloat a_nuTOtherPhase (const MInt cellId) const
 
MFloata_nuTOtherPhase (const MInt cellId)
 
MFloat a_nuEffOtherPhase (const MInt cellId) const
 
MFloata_nuEffOtherPhase (const MInt cellId)
 
MInta_associatedBodyIds (const MInt cellId, const MInt set)
 Returns the associatedBodyIds for fv-CellId cellId and set. More...
 
MInt a_associatedBodyIds (const MInt cellId, const MInt set) const
 Returns the associatedBodyIds for fv-CellId cellId and set. More...
 
MFloata_curvatureG (const MInt cellId, const MInt set)
 Returns the curvature-value for fv-CellId cellId and set. More...
 
MFloat a_curvatureG (const MInt cellId, const MInt set) const
 Returns the curvature-value for fv-CellId cellId and set. More...
 
MFloata_flameSpeed (const MInt cellId, const MInt set)
 Returns the flamespeed-value for fv-CellId cellId and set. More...
 
MFloat a_flameSpeed (const MInt cellId, const MInt set) const
 Returns the flamespeed-value for fv-CellId cellId and set. More...
 
MInta_noSets ()
 Returns the noSets for fv-CellId cellId and set. More...
 
MInt a_noSets () const
 Returns the noSets for fv-CellId cellId and set. More...
 
MInta_noLevelSetFieldData ()
 Returns the noSets for fv-CellId cellId and set. More...
 
MInt a_noLevelSetFieldData () const
 Returns the noSets for fv-CellId cellId and set. More...
 
const MIntgetAssociatedInternalCell (const MInt &cellId) const
 Returns the Id of the split cell, if cellId is a split child. More...
 
virtual void reIntAfterRestart (MBool)
 
virtual void resetRHS ()
 
virtual void resetRHSCutOffCells ()
 
virtual void initSolutionStep (MInt)
 Initializes the solver. More...
 
virtual void applyInitialCondition ()
 Initializes the entire flow field. More...
 
virtual void Ausm ()
 Dispatches the AUSM flux computation for different number of species. More...
 
virtual void Muscl (MInt=-1)
 Reconstructs the flux on the surfaces. More...
 
virtual void viscousFlux ()
 
virtual void copyVarsToSmallCells ()
 
virtual void computePV ()
 
virtual void computePrimitiveVariables ()
 Dispatches the computation of the primitive variables for different number of species. More...
 
virtual void filterConservativeVariablesAtFineToCoarseGridInterfaces ()
 
virtual void copyRHSIntoGhostCells ()
 
virtual void LSReconstructCellCenter_Boundary ()
 Computes the slopes at the cell centers of only the boundary cells. More...
 
virtual void LSReconstructCellCenter ()
 Dispatch the reconstruction computation to the appropiate loop. More...
 
virtual void applyBoundaryCondition ()
 handles the application of boundary conditions to the ghost cells More...
 
virtual void cutOffBoundaryCondition ()
 
virtual void computeConservativeVariables ()
 Dispatches the computation of the conservative variables for different number of species. More...
 
virtual void initNearBoundaryExchange (const MInt mode=0, const MInt offset=0)
 Setup the near-boundary communicator needed for the flux-redistribution method. More...
 
void initAzimuthalNearBoundaryExchange (MIntScratchSpace &activeFlag)
 
void azimuthalNearBoundaryExchange ()
 
void azimuthalNearBoundaryReverseExchange ()
 
void setActiveFlag (MIntScratchSpace &, const MInt mode, const MInt offset)
 Set the flag for the cells needed for near bndry exchange. More...
 
virtual void setAdditionalActiveFlag (MIntScratchSpace &)
 
void setInfinityState ()
 Computes/defines the infinity values/state once and for all Ideally the infinity variables should not be updated outside of this function! More...
 
void initAzimuthalCartesianHaloInterpolation ()
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void computeSurfaceCoefficients ()
 Dispatches the transport coefficients computation at each surfaces by calling the relevant function from the detChemSysEqn class. Distinction between "Multi" and "Mix" transport models! Author: Borja Pedro. More...
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void computeSpeciesReactionRates ()
 Dispatches the species reaction rate computation at each cell by calling the relevant method from the detChemSysEqn class. Author: Borja Pedro. More...
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void computeMeanMolarWeights_PV ()
 Dispatches the mean molar weight computation at the cell center from the primitive variables by calling the relevant function from the detChemSysEqn class. The mean molar weight is stored inside the additional variables array. Author: Borja Pedro. More...
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void computeMeanMolarWeights_CV ()
 Dispatches the mean molar weight computation at the cell center from the conservative variables by calling the relevant function from the detChemSysEqn class. The mean molar weight is stored inside the additional variables array. Author: Borja Pedro. More...
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void setMeanMolarWeight_CV (MInt cellId)
 Computes the mean molar weight at the given cell ID from the primitive variables. The mean molar weight is stored inside the additional variables array. Author: Borja Pedro. More...
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void setMeanMolarWeight_PV (MInt cellId)
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void computeGamma ()
 Dispatches the gamma computation at each cell by calling the relevant function from the detChemSysEqn class. It is stored inside the additional variables array, and used to compute the time step. Author: Borja Pedro. More...
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void computeDetailedChemistryVariables ()
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void setAndAllocateDetailedChemistryProperties ()
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void initCanteraObjects ()
 Allocates the Cantera objects that define a thermodynamic phase, reaction kinetics and transport properties for a given reaction mechanism. More...
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void correctMajorSpeciesMassFraction ()
 Corrects the mass fraction of the predominant species to ensure conservation due to numerical or approximation erros For combustion with air: N2 is the major species Author: Borja Pedro. More...
 
void compute1DFlameSolution ()
 
void addSpeciesReactionRatesAndHeatRelease ()
 
void initHeatReleaseDamp ()
 
void computeAcousticSourceTermQe (MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &)
 
void computeVolumeForces ()
 
void computeRotForces ()
 
virtual MInt getAdjacentLeafCells_d0 (const MInt, const MInt, MIntScratchSpace &, MIntScratchSpace &)
 
virtual MInt getAdjacentLeafCells_d1 (const MInt, const MInt, MIntScratchSpace &, MIntScratchSpace &)
 
virtual MInt getAdjacentLeafCells_d2 (const MInt, const MInt, MIntScratchSpace &, MIntScratchSpace &)
 
virtual MInt getAdjacentLeafCells_d0_c (const MInt, const MInt, MIntScratchSpace &, MIntScratchSpace &)
 
virtual MInt getAdjacentLeafCells_d1_c (const MInt, const MInt, MIntScratchSpace &, MIntScratchSpace &)
 
virtual MInt getAdjacentLeafCells_d2_c (const MInt, const MInt, MIntScratchSpace &, MIntScratchSpace &)
 
MFloat computeRecConstSVD (const MInt cellId, const MInt offset, MFloatScratchSpace &tmpA, MFloatScratchSpace &tmpC, MFloatScratchSpace &weights, const MInt recDim, const MInt, const MInt, const std::array< MBool, nDim > dirs={}, const MBool relocateCenter=false)
 compute the reconstruction constants of the given cell by a weighted least-squares approach via singular value decomposition More...
 
void extendStencil (const MInt)
 extend the reconstruction sencil towards all diagonal cells on the first layer More...
 
MInt samplingInterval ()
 
void checkGhostCellIntegrity ()
 Checks whether cells' isGhost and the boundary Id coincede. Cells' isGhost is is used to tell the grid about ghost cells. In the solver sometimes boundaryId == -2 is used to check for ghost cells. More...
 
virtual void initializeRungeKutta ()
 Reads the Runge-Kutta properties and initializes the variables required for Runge Kutta time stepping. More...
 
virtual void initializeMaxLevelExchange ()
 parallel: Store all necessary data in send buffer More...
 
virtual void computePrimitiveVariablesCoarseGrid ()
 Computes the primitive variables: velocity, density, and pressure from the conservative variables and stores the primitive variables in a_pvariable( i , v ) More...
 
void initAzimuthalMaxLevelExchange ()
 
void finalizeMpiExchange ()
 Finalize non-blocking MPI communication (cancel open requests, free all requests) More...
 
void setUpwindCoefficient ()
 
void cellSurfaceMapping ()
 
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void interpolateSurfaceDiffusionFluxOnCellCenter (MFloat *const, MFloat *const)
 
void setNghbrInterface ()
 
void calcLESAverage ()
 
void saveLESAverage ()
 
void loadLESAverage ()
 
void finalizeLESAverage ()
 
MFloat getAveragingFactor ()
 
void saveSpongeData ()
 
void loadSpongeData ()
 
void initSTGSpongeExchange ()
 
void setAndAllocateZonalProperties ()
 
void readPreliminarySTGSpongeData ()
 
void calcPeriodicSpongeAverage ()
 
void exchangeZonalAverageCells ()
 
virtual void initSTGSponge ()
 Initializes zonal exchange arrays. More...
 
virtual void resetZonalLESAverage ()
 Initializes zonal exchange arrays. More...
 
virtual void determineLESAverageCells ()
 
virtual void resetZonalSolverData ()
 
virtual void getBoundaryDistance (MFloatScratchSpace &)
 Get distance to boundary, currently bc 3003. Should be replaced by more precise distance using STL information. More...
 
virtual void nonReflectingBCAfterTreatmentCutOff ()
 
virtual void nonReflectingBCCutOff ()
 
virtual void dqdtau ()
 
virtual bool rungeKuttaStep ()
 Dispatches the RungeKutta method for different number of species. More...
 
virtual void applyExternalSource ()
 Add external sources to the RHS. More...
 
virtual void applyExternalOldSource ()
 
virtual void advanceExternalSource ()
 
void exchangeExternalSources ()
 Exchange external sources. More...
 
void resetExternalSources ()
 Reset external sources. More...
 
MInt setUpBndryInterpolationStencil (const MInt, MInt *, const MFloat *)
 
void deleteSrfcs ()
 Deletes all surfaces existing. More...
 
virtual void resetRHSNonInternalCells ()
 
virtual void correctMasterCells ()
 adds the right hand side of small cells to their corresponding master cells and sets the small cell RHS to zero More...
 
void writeCellData (MInt)
 
virtual void convertPrimitiveRestartVariables ()
 converts the primitive restart variables to a new Mach Number More...
 
void initializeFvCartesianSolver (const MBool *propertiesGroups)
 FV Constructor: reads and allocate properties/variables: More...
 
void copyGridProperties ()
 
void allocateCommunicationMemory ()
 Allocates and initializes send/receive buffers for multiSolver computations. More...
 
void setTestcaseProperties ()
 Reads and initializes properties associated with the physics of the simulation and allocates small arrays of these properties. More...
 
void setSamplingProperties ()
 Reads properties associated with variable sampling. More...
 
void setInputOutputProperties ()
 Reads properties and initializes variables associated with input/output. More...
 
void setNumericalProperties ()
 Reads and initializes properties associated with the numerical method. More...
 
void setAndAllocateCombustionTFProperties ()
 Reads and initializes properties associated with combustion simulations. More...
 
void setAndAllocateSpongeLayerProperties ()
 Reads and initializes properties associated with sponge boundary conditions. More...
 
void allocateAndInitSolverMemory ()
 Allocates the resources of the FV solver. Mostly arrays of size maxNoCells used in the main part of the FV code plus - if required - moving grid arrays. IMPORTANT: This method should be called at the end of the FvCartesianSolver-Constructor, since other properties might be used in here, or datastructures previosly allocated might be referenced! More...
 
void setRungeKuttaProperties ()
 This function reads the properties required for Runge Kutta time stepping. More...
 
void setAndAllocateAdaptationProperties ()
 This function reads the properties required for adaptive mesh refinement. More...
 
virtual void exchange ()
 
template<typename T >
void exchangeDataFV (T *data, const MInt blockSize=1, MBool cartesian=true, const std::vector< MInt > &rotIndex=std::vector< MInt >())
 
template<MBool exchangeAll_ = true>
void exchangeFloatDataAzimuthal (MFloat *data, MInt noVars, const std::vector< MInt > &rotIndices)
 
template<typename T >
void exchangeDataAzimuthal (T *data, const MInt dataBlockSize=1)
 
void exchangeAzimuthalRemappedHaloCells ()
 
virtual void exchangePeriodic ()
 
void exchangePipe ()
 
void startMpiExchange ()
 Begin non-blocking communication by posting new send requests. More...
 
void prepareMpiExchange ()
 
void finishMpiExchange ()
 Finish non-blocking communication by waiting for receive requests. More...
 
void cancelMpiRequests () override
 Cancel open MPI (receive) requests. More...
 
template<MBool exchangeAll_>
void gather ()
 Gather data of all window cells for all neighbors in the send buffers. More...
 
void receive (const MBool exchangeAll=false)
 Receive halo cell data from corresponding neighbors. More...
 
void send (const MBool exchangeAll=false)
 Send window cell data to corresponding neighbors. More...
 
template<MBool exchangeAll_>
void scatter ()
 Scatter received data of all neighbors to the corresponding halo cells. More...
 
void exchangeAll ()
 
virtual void computeReconstructionConstants ()
 
virtual void findNghbrIds ()
 
void getPrimitiveVariables (MInt, MFloat *, MFloat *, MInt)
 
void rhs ()
 
void rhsBnd ()
 
void initSolver () override
 Initializes the fv-solver. More...
 
void finalizeInitSolver () override
 Initializes the solver afer the initialRefinement! More...
 
void preSolutionStep (MInt) override
 
MBool solutionStep () override
 Performs one Runge-Kutta step of the FV solver, returns true if the time step is completed. More...
 
MBool postSolutionStep () override
 
MBool solverStep ()
 
void postTimeStep () override
 : Performs the post time step More...
 
void scalarLimiter ()
 
void cleanUp () override
 
void lhsBndFinish ()
 Finish the split MPI communication and perform the left out part from lhsBnd(). More...
 
void lhsBnd ()
 Apply lhsBnd. More...
 
virtual void smallCellCorrection (const MInt timerId=-1)
 Flux-redistribution method Apply a stable correction to small-cells and redistribute the defective flux to neighboring cells to re-establish conservation For details see Schneiders,Hartmann,Meinke,Schröder, J.Comput.Phys. 235 (2013) For more details see the dissertation of Lennart Schneiders, "Particle-Resolved Analysis of Turbulent Multiphase Flow by a Cut-Cell Method" Chapter 3.4. More...
 
virtual void smallCellRHSCorrection (const MInt timerId=-1)
 
virtual void updateSplitParentVariables ()
 
virtual void checkDiv ()
 
virtual void updateMaterialNo ()
 
template<class _ = void, std::enable_if_t< isEEGas< SysEqn >, _ * > = nullptr>
void initSourceCells ()
 
void revertTimestep ()
 
template<class _ = void, std::enable_if_t< isEEGas< SysEqn >, _ * > = nullptr>
void rhsEEGas ()
 
virtual void resetImplicitCoefficients ()
 
MFloat physicalTime ()
 
MFloat computeDomainLength (MInt direction)
 
const Geomgeometry () const
 the references to CartesianGrid data members end here More...
 
MPI_Comm globalMpiComm () const
 Return the global MPI communicator used by the grid. More...
 
void createGridSlice (const MString &direction, const MFloat intercept, const MString &fileName, MInt *const sliceCellIds)
 
MInt noVariables () const override
 Return the number of primitive variables. More...
 
void releaseMemory ()
 
constexpr MBool isMultilevel () const
 Return true if solver is part of a multilevel computation. More...
 
constexpr MBool isMultilevelPrimary () const
 Return true if solver is primary solver in multilevel computation. More...
 
constexpr MBool isMultilevelLowestSecondary () const
 
void setMultilevelPrimary (const MBool state=true)
 Designates solver as primary solver in multilevel computation. More...
 
void setMultilevelSecondary (const MBool state=true)
 
constexpr MBool isZonal () const
 
void loadSampleVariables (MInt timeStep)
 load variables for the specified timeStep More...
 
void getSampleVariables (MInt cellId, const MFloat *&vars)
 read only access to primitive variables of a single cell More...
 
void getSampleVariables (MInt const cellId, std::vector< MFloat > &vars)
 
void getSampleVariableNames (std::vector< MString > &varNames) override
 Return the sample variable names (primitive variables) More...
 
virtual void getSampleVarsDerivatives (const MInt cellId, const MFloat *&vars)
 Access derivatives of primitive variables of a given cell. More...
 
MBool getSampleVarsDerivatives (const MInt cellId, std::vector< MFloat > &vars)
 
void calculateHeatRelease ()
 calculates heatRelease, currently used for postprocessing (average_in) More...
 
void getHeatRelease (MFloat *&heatRelease)
 returns More...
 
virtual void getVorticity (MFloat *const vorticity)
 wrapper for vorticity computation More...
 
virtual void getVorticityT (MFloat *const vorticity)
 wrapper for vorticity computation (transposed version) More...
 
void oldPressure (MFloat *const p)
 This function computes the pressure from the oldVariables. More...
 
virtual MFloatvorticityAtCell (const MInt cellId, const MInt dir)
 
virtual MFloat getBoundaryHeatFlux (const MInt cellId) const
 calculates heat flux of boundary cells More...
 
MFloat time () const override
 returns the time More...
 
virtual void getDimensionalizationParams (std::vector< std::pair< MFloat, MString > > &dimParams) const
 get dimensionalization parameters More...
 
MInt getCellIdByIndex (const MInt index)
 Required for sampling, for FV the index is already the cell id. More...
 
MInt getIdAtPoint (const MFloat *point, MBool NotUsed(globalUnique=false))
 Return the leaf cell id containing the given point. More...
 
virtual void getSolverSamplingProperties (std::vector< MInt > &samplingVars, std::vector< MInt > &noSamplingVars, std::vector< std::vector< MString > > &samplingVarNames, const MString featureName="") override
 Read sampling related properties. More...
 
virtual void initSolverSamplingVariables (const std::vector< MInt > &varIds, const std::vector< MInt > &noSamplingVars) override
 Initialize sampling variables/allocate memory. More...
 
virtual void calcSamplingVariables (const std::vector< MInt > &varIds, const MBool exchange) override
 Calculate sampling variables. More...
 
virtual void initInterpolationForCell (const MInt cellId)
 Init the interpolation for points inside a given cell (based on interpolateVariables()) More...
 
virtual void calcSamplingVarAtPoint (const MFloat *point, const MInt id, const MInt sampleVarId, MFloat *state, const MBool interpolate=false) override
 Calculate the sampling variables at a given point in a cell. More...
 
MInt getCurrentTimeStep () const override
 Return the current time step. More...
 
MBool hasRestartTimeStep () const override
 
MInt determineRestartTimeStep () const override
 Determine the restart time step from the restart file (for useNonSpecifiedRestartFile = true) More...
 
virtual void finalizeInitEnthalpySolver ()
 
virtual void initMatDat ()
 
virtual void writeVtkXmlFiles (const MString, const MString, MBool, MBool)
 
MBool calcSlopesAfterStep ()
 Return if slopes should be calculated at after each step (not before) More...
 
void applyCoarseLevelCorrection ()
 Apply coarse-level correction to RHS. More...
 
void setAndAllocateCombustionGequPvProperties ()
 reads in the combustion properties More...
 
void setAndAllocateSpongeBoundaryProperties ()
 reads in the sponge properties for specific boundaries More...
 
MFloat setAndAllocateSpongeDomainProperties (MFloat)
 reads in the sponge properties for the domain boundaries More...
 
void setCombustionGequPvVariables ()
 reads in the combustion properties More...
 
MInt noSolverTimers (const MBool allTimings) override
 
void getSolverTimings (std::vector< std::pair< MString, MFloat > > &solverTimings, const MBool allTimings) override
 Get solver timings. More...
 
void limitWeights (MFloat *) override
 Limit Weight types to avoid large memory disbalance between ranks for DLB. More...
 
MInt noCellDataDlb () const override
 Methods to inquire solver data information. More...
 
MInt cellDataTypeDlb (const MInt dataId) const override
 
MInt cellDataSizeDlb (const MInt dataId, const MInt gridCellId) override
 Return data size to be communicated during DLB for a grid cell and given data id. More...
 
void getCellDataDlb (const MInt dataId, const MInt oldNoCells, const MInt *const bufferIdToCellId, MFloat *const data) override
 Return solver data for DLB. More...
 
void setCellDataDlb (const MInt dataId, const MFloat *const data) override
 Set solver data for DLB. More...
 
void getGlobalSolverVars (std::vector< MFloat > &globalFloatVars, std::vector< MInt > &globalIdVars) override
 Get/set global solver variables during DLB. More...
 
void setGlobalSolverVars (std::vector< MFloat > &globalFloatVars, std::vector< MInt > &globalIdVars) override
 Set global solver variables (see getGlobalSolverVars()) More...
 
MBool hasSplitBalancing () const override
 Return if load balancing for solver is split into multiple methods or implemented in balance() More...
 
virtual MBool adaptationTrigger ()
 
MBool forceAdaptation () override
 
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void interpolateSurfaceDiffusionFluxOnCellCenter (MFloat *const NotUsed(JA), MFloat *const dtdn)
 
- Public Member Functions inherited from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >
 CartesianSolver (const MInt solverId, GridProxy &gridProxy_, const MPI_Comm comm, const MBool checkActive=false)
 
MInt minLevel () const
 Read-only accessors for grid data. More...
 
MInt maxLevel () const
 
MInt maxNoGridCells () const
 
MInt maxRefinementLevel () const
 
MInt maxUniformRefinementLevel () const
 
MInt noNeighborDomains () const
 
MInt neighborDomain (const MInt id) const
 
MLong domainOffset (const MInt id) const
 
MInt noHaloLayers () const
 
MInt noHaloCells (const MInt domainId) const
 
MInt haloCellId (const MInt domainId, const MInt cellId) const
 
MInt noWindowCells (const MInt domainId) const
 
MInt windowCellId (const MInt domainId, const MInt cellId) const
 
MString gridInputFileName () const
 
MFloat reductionFactor () const
 
MFloat centerOfGravity (const MInt dir) const
 
MInt neighborList (const MInt cellId, const MInt dir) const
 
const MLonglocalPartitionCellGlobalIds (const MInt cellId) const
 
MLong localPartitionCellOffsets (const MInt index) const
 
MInt noMinCells () const
 
MInt minCell (const MInt id) const
 
const MInthaloCell (const MInt domainId, const MInt cellId) const
 
const MIntwindowCell (const MInt domainId, const MInt cellId) const
 
MBool isActive () const override
 
constexpr GridProxygrid () const
 
GridProxygrid ()
 
virtual void sensorDerivative (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 
virtual void sensorDivergence (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 
virtual void sensorTotalPressure (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 
virtual void sensorEntropyGrad (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 
virtual void sensorEntropyQuot (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 
virtual void sensorVorticity (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 
virtual void sensorInterface (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 
void sensorLimit (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt, std::function< MFloat(MInt)>, const MFloat, const MInt *, const MBool, const MBool allowCoarsening=true)
 simple sensor to apply a limit for a value More...
 
void sensorSmooth (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 sensor to smooth level jumps NOTE: only refines additional cells to ensure a smooth level transition this requires that all other sensors are frozen i.e. no refine/coarse sensors set! More...
 
void sensorBand (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 This sensor generates a max refinement band around the cells with max refinement level. In order for it to work, the property addedAdaptationSteps has to be equal to /maxRefinementLevel() - minLevel()/. This sensor also ensures a smooth transition between levels. Do not use together with sensorSmooth. More...
 
virtual void sensorMeanStress (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 
virtual void sensorParticle (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 
virtual void sensorSpecies (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 
virtual void sensorPatch (std::vector< std::vector< MFloat > > &sensor, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen)
 
virtual void sensorCutOff (std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 
void saveSensorData (const std::vector< std::vector< MFloat > > &sensors, const MInt &level, const MString &gridFileName, const MInt *const recalcIds) override
 Saves all sensor values for debug/tunig purposes. More...
 
void assertValidGridCellId (const MInt) const
 
MLong c_parentId (const MInt cellId) const
 Returns the grid parent id of the cell cellId. More...
 
MLong c_neighborId (const MInt cellId, const MInt dir) const
 Returns the grid neighbor id of the grid cell cellId dir. More...
 
MInt c_noCells () const
 
MInt c_level (const MInt cellId) const
 
MLong c_globalGridId (const MInt cellId)
 
void exchangeData (T *data, const MInt dataBlockSize=1)
 Exchange memory in 'data' assuming a solver size of 'dataBlockSize' per cell. More...
 
void exchangeLeafData (std::function< T &(MInt, MInt)> data, const MInt noDat=1)
 Blocking exchange memory in 'data' assuming a solver size of 'dataBlockSize' per cell NOTE: exchange is only performed on leaf-cells and leaf-NeighborDomains Assumes, that updateLeafCellExchange has been called in the proxy previously! More...
 
void exchangeSparseLeafValues (G getData, S setData, const MInt dataSize, M cellMapping)
 Exchange of sparse data structures on max Level. More...
 
void exchangeAzimuthalPer (T *data, MInt dataBlockSize=1, MInt firstBlock=0)
 Exchange of sparse data structures on max Level. More...
 
void collectVariables (T *variablesIn, ScratchSpace< T > &variablesOut, const std::vector< MString > &variablesNameIn, std::vector< MString > &variablesNameOut, const MInt noVars, const MInt noCells, const MBool reverseOrder=false)
 generalised helper function for writing restart files! This is necessary for example if the minLevel shall be raised at the new restart! More...
 
void collectVariables (T **variablesIn, ScratchSpace< T > &variablesOut, const std::vector< MString > &variablesNameIn, std::vector< MString > &variablesNameOut, const MInt noVars, const MInt noCells)
 generalised helper function for writing restart files! This is necessary for example if the minLevel shall be raised at the new restart! More...
 
void saveGridFlowVars (const MChar *fileName, const MChar *gridFileName, const MInt noTotalCells, const MInt noInternal, MFloatScratchSpace &dbVariables, std::vector< MString > &dbVariablesName, MInt noDbVars, MIntScratchSpace &idVariables, std::vector< MString > &idVariablesName, MInt noIdVars, MFloatScratchSpace &dbParameters, std::vector< MString > &dbParametersName, MIntScratchSpace &idParameters, std::vector< MString > &idParametersName, MInt *recalcIds, MFloat time)
 This function writes the parallel Netcdf cartesian grid cell based solution/restart file currently used in PostData, LPT and LS solvers! More...
 
void collectParameters (T, ScratchSpace< T > &, const MChar *, std::vector< MString > &)
 This function collects a single parameters for the massivley parallel IO functions. More...
 
void calcRecalcCellIdsSolver (const MInt *const recalcIdsTree, MInt &noCells, MInt &noInternalCellIds, std::vector< MInt > &recalcCellIdsSolver, std::vector< MInt > &reorderedCellIds)
 Derive recalc cell ids of the solver and reordered cell ids. More...
 
- Public Member Functions inherited from Solver
MString getIdentifier (const MBool useSolverId=false, const MString preString="", const MString postString="_")
 
virtual ~Solver ()=default
 
virtual MInt noInternalCells () const =0
 Return the number of internal cells within this solver. More...
 
virtual MFloat time () const =0
 Return the time. More...
 
virtual MInt noVariables () const
 Return the number of variables. More...
 
virtual void getDimensionalizationParams (std::vector< std::pair< MFloat, MString > > &) const
 Return the dimensionalization parameters of this solver. More...
 
void updateDomainInfo (const MInt domainId, const MInt noDomains, const MPI_Comm mpiComm, const MString &loc)
 Set new domain information. More...
 
virtual MFloata_slope (const MInt, MInt const, const MInt)
 
virtual MBool a_isBndryCell (const MInt) const
 
virtual MFloata_FcellVolume (MInt)
 
virtual MInt getCurrentTimeStep () const
 
virtual void accessSampleVariables (MInt, MFloat *&)
 
virtual void getSampleVariableNames (std::vector< MString > &NotUsed(varNames))
 
virtual MBool a_isBndryGhostCell (MInt) const
 
virtual void saveCoarseSolution ()
 
virtual void getSolverSamplingProperties (std::vector< MInt > &NotUsed(samplingVarIds), std::vector< MInt > &NotUsed(noSamplingVars), std::vector< std::vector< MString > > &NotUsed(samplingVarNames), const MString NotUsed(featureName)="")
 
virtual void initSolverSamplingVariables (const std::vector< MInt > &NotUsed(varIds), const std::vector< MInt > &NotUsed(noSamplingVars))
 
virtual void calcSamplingVariables (const std::vector< MInt > &NotUsed(varIds), const MBool NotUsed(exchange))
 
virtual void calcSamplingVarAtPoint (const MFloat *NotUsed(point), const MInt NotUsed(id), const MInt NotUsed(sampleVarId), MFloat *NotUsed(state), const MBool NotUsed(interpolate)=false)
 
virtual void balance (const MInt *const NotUsed(noCellsToReceiveByDomain), const MInt *const NotUsed(noCellsToSendByDomain), const MInt *const NotUsed(targetDomainsByCell), const MInt NotUsed(oldNoCells))
 Perform load balancing. More...
 
virtual MBool hasSplitBalancing () const
 Return if load balancing for solver is split into multiple methods or implemented in balance() More...
 
virtual void balancePre ()
 
virtual void balancePost ()
 
virtual void finalizeBalance ()
 
virtual void resetSolver ()
 Reset the solver/solver for load balancing. More...
 
virtual void cancelMpiRequests ()
 Cancel open mpi (receive) requests in the solver (e.g. due to interleaved execution) More...
 
virtual void setCellWeights (MFloat *)
 Set cell weights. More...
 
virtual MInt noLoadTypes () const
 
virtual void getDefaultWeights (MFloat *NotUsed(weights), std::vector< MString > &NotUsed(names)) const
 
virtual void getLoadQuantities (MInt *const NotUsed(loadQuantities)) const
 
virtual MFloat getCellLoad (const MInt NotUsed(cellId), const MFloat *const NotUsed(weights)) const
 
virtual void limitWeights (MFloat *NotUsed(weights))
 
virtual void localToGlobalIds ()
 
virtual void globalToLocalIds ()
 
virtual MInt noCellDataDlb () const
 Methods to inquire solver data information. More...
 
virtual MInt cellDataTypeDlb (const MInt NotUsed(dataId)) const
 
virtual MInt cellDataSizeDlb (const MInt NotUsed(dataId), const MInt NotUsed(cellId))
 
virtual void getCellDataDlb (const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MInt *const NotUsed(data))
 
virtual void getCellDataDlb (const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MLong *const NotUsed(data))
 
virtual void getCellDataDlb (const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MFloat *const NotUsed(data))
 
virtual void setCellDataDlb (const MInt NotUsed(dataId), const MInt *const NotUsed(data))
 
virtual void setCellDataDlb (const MInt NotUsed(dataId), const MLong *const NotUsed(data))
 
virtual void setCellDataDlb (const MInt NotUsed(dataId), const MFloat *const NotUsed(data))
 
virtual void getGlobalSolverVars (std::vector< MFloat > &NotUsed(globalFloatVars), std::vector< MInt > &NotUsed(globalIntVars))
 
virtual void setGlobalSolverVars (std::vector< MFloat > &NotUsed(globalFloatVars), std::vector< MInt > &NotUsed(globalIdVars))
 
void enableDlbTimers ()
 
void reEnableDlbTimers ()
 
void disableDlbTimers ()
 
MBool dlbTimersEnabled ()
 
void startLoadTimer (const MString name)
 
void stopLoadTimer (const MString &name)
 
void stopIdleTimer (const MString &name)
 
void startIdleTimer (const MString &name)
 
MBool isLoadTimerRunning ()
 
virtual MInt noSolverTimers (const MBool NotUsed(allTimings))
 
virtual void getSolverTimings (std::vector< std::pair< MString, MFloat > > &NotUsed(solverTimings), const MBool NotUsed(allTimings))
 
virtual void getDomainDecompositionInformation (std::vector< std::pair< MString, MInt > > &NotUsed(domainInfo))
 
void setDlbTimer (const MInt timerId)
 
virtual void prepareAdaptation (std::vector< std::vector< MFloat > > &, std::vector< MFloat > &, std::vector< std::bitset< 64 > > &, std::vector< MInt > &)
 
virtual void reinitAfterAdaptation ()
 
virtual void prepareAdaptation ()
 prepare adaptation for split adaptation before the adaptation loop More...
 
virtual void setSensors (std::vector< std::vector< MFloat > > &, std::vector< MFloat > &, std::vector< std::bitset< 64 > > &, std::vector< MInt > &)
 set solver sensors for split adaptation within the adaptation loop More...
 
virtual void saveSensorData (const std::vector< std::vector< MFloat > > &, const MInt &, const MString &, const MInt *const)
 
virtual void postAdaptation ()
 post adaptation for split adaptation within the adaptation loop More...
 
virtual void finalizeAdaptation ()
 finalize adaptation for split sadptation after the adaptation loop More...
 
virtual void refineCell (const MInt)
 Refine the given cell. More...
 
virtual void removeChilds (const MInt)
 Coarsen the given cell. More...
 
virtual void removeCell (const MInt)
 Remove the given cell. More...
 
virtual void swapCells (const MInt, const MInt)
 Swap the given cells. More...
 
virtual void swapProxy (const MInt, const MInt)
 Swap the given cells. More...
 
virtual MInt cellOutside (const MFloat *, const MInt, const MInt)
 Check whether cell is outside the fluid domain. More...
 
virtual void resizeGridMap ()
 Swap the given cells. More...
 
virtual MBool prepareRestart (MBool, MBool &)
 Prepare the solvers for a grid-restart. More...
 
virtual void reIntAfterRestart (MBool)
 
MPI_Comm mpiComm () const
 Return the MPI communicator used by this solver. More...
 
virtual MInt domainId () const
 Return the domainId (rank) More...
 
virtual MInt noDomains () const
 
virtual MBool isActive () const
 
void setSolverStatus (const MBool status)
 
MBool getSolverStatus ()
 Get the solver status indicating if the solver is currently active in the execution recipe. More...
 
MString testcaseDir () const
 Return the testcase directory. More...
 
MString outputDir () const
 Return the directory for output files. More...
 
MString restartDir () const
 Return the directory for restart files. More...
 
MString solverMethod () const
 Return the solverMethod of this solver. More...
 
MString solverType () const
 Return the solverType of this solver. More...
 
MInt restartInterval () const
 Return the restart interval of this solver. More...
 
MInt restartTimeStep () const
 Return the restart interval of this solver. More...
 
MInt solverId () const
 Return the solverId. More...
 
MBool restartFile ()
 
MInt readSolverSamplingVarNames (std::vector< MString > &varNames, const MString featureName="") const
 Read sampling variables names, store in vector and return the number of sampling variables. More...
 
virtual MBool hasRestartTimeStep () const
 
virtual MBool forceAdaptation ()
 
virtual void preTimeStep ()=0
 
virtual void postTimeStep ()=0
 
virtual void initSolver ()=0
 
virtual void finalizeInitSolver ()=0
 
virtual void saveSolverSolution (const MBool NotUsed(forceOutput)=false, const MBool NotUsed(finalTimeStep)=false)=0
 
virtual void cleanUp ()=0
 
virtual MBool solutionStep ()
 
virtual void preSolutionStep (MInt)
 
virtual MBool postSolutionStep ()
 
virtual MBool solverConverged ()
 
virtual void getInterpolatedVariables (MInt, const MFloat *, MFloat *)
 
virtual void loadRestartFile ()
 
virtual MInt determineRestartTimeStep () const
 
virtual void writeRestartFile (MBool)
 
virtual void writeRestartFile (const MBool, const MBool, const MString, MInt *)
 
virtual void setTimeStep ()
 
virtual void implicitTimeStep ()
 
virtual void prepareNextTimeStep ()
 

Public Attributes

Geometry< nDim > * m_geometry
 
MFloat m_eps
 
MInt m_noSpecies
 
SysEqn m_sysEqn
 
FvBndryCndXD< nDim_, SysEqn > * m_fvBndryCnd
 
std::shared_ptr< Cantera::Solution > m_canteraSolution
 
std::shared_ptr< Cantera::ThermoPhase > m_canteraThermo
 
std::shared_ptr< Cantera::Kinetics > m_canteraKinetics
 
std::shared_ptr< Cantera::Transport > m_canteraTransport
 
std::unique_ptr< OneDFlamem_oneDimFlame
 
std::vector< MStringm_speciesName
 
std::map< std::string, MIntspeciesMap
 
MFloatm_molarMass
 
MFloatm_fMolarMass
 
MFloatm_standardHeatFormation
 
MFloatm_YInfinity
 
MBool m_detChemExtendedOutput
 
MBool m_isInitSamplingVars = false
 Indicator if sampling variables are initialized. More...
 
std::array< MFloat **, s_maxNoSamplingVariablesm_samplingVariables {nullptr}
 Storage for solver specific sampling variables. More...
 
std::array< MInt, 2 *s_maxNoSamplingVariablesm_samplingVariablesStatus {}
 Status of sampling variables to check if variable is already computed and exchanged. More...
 
MBool m_localTS = false
 
List< MInt > * m_sortedPeriodicCells = nullptr
 
MInt m_totalnosplitchilds = 0
 
MInt m_totalnoghostcells = 0
 
MBool m_constructGField {}
 
MBool m_deleteNeighbour = false
 
MBool m_bndryLevelJumps = false
 
MInt m_lsCutCellBaseLevel
 
MInt m_noOuterBndryCells = 0
 
MBool m_refineDiagonals = true
 
MFloatm_sweptVolume = nullptr
 
MFloatm_sweptVolumeBal = nullptr
 
MBool m_engineSetup = false
 
Collector< PointBasedCell< nDim > > * m_extractedCells = nullptr
 
Collector< CartesianGridPoint< nDim > > * m_gridPoints = nullptr
 
SysEqn::PrimitiveVariables * PV {}
 
SysEqn::ConservativeVariables * CV {}
 
SysEqn::FluxVariables * FV {}
 
SysEqn::AdditionalVariables * AV {}
 
SysEqn::SurfaceCoefficients * SC {}
 
MInt ** m_setToBodiesTable = nullptr
 
MFloatm_bodyCenter = nullptr
 
MFloatm_bodyVelocity = nullptr
 
MFloatm_bodyVelocityDt1 = nullptr
 
MFloatm_bodyVelocityDt2 = nullptr
 
MFloatm_bodyAcceleration = nullptr
 
MFloatm_bodyAngularVelocity = nullptr
 
MFloatm_bodyAngularAcceleration = nullptr
 
MFloatm_bodyTemperature = nullptr
 
MFloatm_bodyTemperatureDt1 = nullptr
 
MFloatm_bodyHeatFlux = nullptr
 
MInt m_volumeForcingDir = -1
 
MFloat m_pipeRadius = -1
 
MInt m_noEmbeddedBodies
 
MInt m_noPeriodicGhostBodies
 
MIntm_internalBodyId = nullptr
 
MInt m_levelSetAdaptationScheme = 0
 
MBool m_closeGaps = false
 
MInt m_gapInitMethod = 2
 
MInt m_noGapRegions
 
std::vector< MIntm_gapCellId
 
std::vector< FvGapCellm_gapCells
 
MInt m_periodicCells
 
MFloat ** m_periodicDataToSend = nullptr
 
MFloat ** m_periodicDataToReceive = nullptr
 
MIntm_noPerCellsToSend = nullptr
 
MIntm_noPerCellsToReceive = nullptr
 
MIntm_noPeriodicCellsDom = nullptr
 
MFloat ** m_periodicCellDataDom = nullptr
 
MInt m_noPeriodicData
 
MInt m_noPeriodicCellData
 
MFloat m_oldPressure_Gradient
 
MFloat m_oldUbulk
 
MFloat m_target_Ubulk
 
MInt m_oldTimeStep
 
MFloat UbulkDiff
 
MFloat m_referenceTemperature
 
MFloat m_sutherlandConstant = NAN
 
MFloat m_sutherlandConstantThermal
 
MFloat m_sutherlandPlusOne = NAN
 
MFloat m_sutherlandPlusOneThermal
 
- Public Attributes inherited from Solver
std::set< MIntm_freeIndices
 
MBool m_singleAdaptation = false
 
MBool m_splitAdaptation = true
 
MBool m_saveSensorData = false
 

Static Public Attributes

static constexpr MInt nDim = nDim_
 
static constexpr const MInt m_noDirs = 2 * nDim
 
static constexpr const MInt m_noEdges = nDim == 3 ? 12 : 4
 
static constexpr const MInt m_noCorners = nDim == 3 ? 8 : 4
 
static constexpr MFloat m_volumeThreshold = nDim == 3 ? 1e-16 : 1e-14
 
static constexpr MInt s_maxNoSamplingVariables = 3
 
static constexpr MBool hasAV = SysEqn::hasAV
 
static constexpr MBool hasSC = SysEqn::hasSC
 

Protected Types

using Timers = maia::fv::Timers_
 
- Protected Types inherited from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >
using fun = void(CartesianSolver< nDim, FvCartesianSolverXD< nDim_, SysEqn > >::*)(std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt)
 

Protected Member Functions

Geomgeometry ()
 Access the solver's geometry (non-const version) More...
 
FvSurfaceCollectorm_surfaceCollector ()
 
void computeWallNormalPointCoords ()
 
void findWallNormalCellIds ()
 
MFloat interpolateWallNormalPointVars (MInt var, MFloat coords[], MInt localId, std::vector< MInt > neighborList)
 
std::vector< MIntfindWallNormalNeighbors (MInt pointId)
 
void getWallNormalPointVars ()
 
void initSpanAvgSrfcProbes ()
 
void writeSpanAvgSrfcProbes ()
 
MFloat computeWMViscositySpalding (MInt)
 
MFloat computeWMViscositySpalding3D (MInt)
 
void initWMSurfaceProbes ()
 
void writeWMSurfaceProbes ()
 
void writeWMTimersASCII ()
 
void initWMExchange ()
 
void exchangeWMVars ()
 
void gatherWMVars ()
 
void receiveWMVars ()
 
void sendWMVars ()
 
void scatterWMVars ()
 
void readWallModelProperties ()
 
void restartWMSurfaces ()
 
void initChannelForce ()
 
void applyChannelForce ()
 
virtual void viscousFlux_Gequ_Pv ()
 Computes the viscous flux using a central difference scheme. More...
 
virtual void viscousFlux_Gequ_Pv_Plenum ()
 Computes the viscous flux using a central difference scheme, modified version for flame plenum computations. More...
 
virtual void updateJet ()
 jet volume forcing jet volume forcing with vortex rings. Velocity profile and forcing ref: "Effects of Inflow Conditions and Forcing on Subsonic Jet Flows and Noise" Bogey and Bailly. More...
 
virtual void writeListOfActiveFlowCells ()
 
MFloat reduceData (const MInt cellId, MFloat *data, const MInt dataBlockSize=1, const MBool average=true)
 determines the value of 'data' in the given cell by recusively volumetric averaging among all its offsprings More...
 
void sensorEntropyGrad (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen) override
 
void sensorEntropyQuot (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen) override
 
void sensorVorticity (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen) override
 
void sensorDerivative (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen) override
 computes the sensor values for a derivative sensor More...
 
void sensorSpecies (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen) override
 
void sensorParticle (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen) override
 
virtual void setCellProperties ()
 
void initSpongeLayer ()
 
void determineStructuredCells ()
 
void tagCellsNeededForSurfaceFlux ()
 
void writeCutCellsToGridFile ()
 Writes cut cell information to an existing grid file in order to visualize it in ParaView. More...
 
virtual MBool gridPointIsInside (MInt, MInt)
 
void saveGridFlowVarsPar (const MChar *fileName, MInt noTotalCells, MLong noInternalCells, MFloatScratchSpace &variables, std::vector< MString > &dbVariablesName, MInt, MIntScratchSpace &idVariables, std::vector< MString > &idVariablesName, MInt, MFloatScratchSpace &dbParameters, std::vector< MString > &dbParametersName, MIntScratchSpace &idParameters, std::vector< MString > &idParametersName, const MInt *recalcIds)
 This function stores the massivley parallel flow information of the cells. More...
 
void computeVorticity3D (MFloat *const vorticity)
 
void computeVorticity2D (MFloat *const vorticity)
 
void computeVorticity3DT (MFloat *const vorticity)
 Compute vorticity and store in vorticity pointer (transposed version) More...
 
void computeQCriterion (MFloatScratchSpace &qCriterion)
 
void loadRestartTime (const MChar *fileName, MInt &globalTimeStepInput, MFloat &timeInput, MFloat &physicalTimeInput)
 This function loads the flow information of the cells such as variables and attributes like u_velocity,density,etc.,. More...
 
virtual void loadOldVariables (const MString &fileName)
 This function loads oldVariable data from a restartFile-type file. More...
 
virtual void loadGridFlowVarsPar (const MChar *fileName)
 This function loads the flow information of the cells such as variables and attributes like u_velocity,density,etc.,. More...
 
virtual void loadRestartMaterial ()
 
virtual void initCellMaterialNo ()
 
virtual MFloat entropy (MInt cellId)
 
void setAndAllocateJetProperties ()
 reads in the jet properties More...
 
void initializeTimers ()
 Initializes the communication timers. More...
 
- Protected Member Functions inherited from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >
void identifyBoundaryCells (MBool *const isInterface, const std::vector< MInt > &bndCndIds=std::vector< MInt >())
 
void identifyBoundaryCells ()
 
MBool cellIsOnGeometry (MInt cellId, Geometry< nDim > *geom)
 checks whether a cell lies on a certain geometry copied the essential part from identifyBoundaryCells More...
 
void setBoundaryDistance (const MBool *const interfaceCell, const MFloat *const outerBandWidth, MFloatScratchSpace &distance)
 transverses over all neighboring cells for a specified length More...
 
void markSurrndCells (MIntScratchSpace &inList, const MInt bandWidth, const MInt level, const MBool refineDiagonals=true)
 
void receiveWindowTriangles ()
 Receives triangles from neighbors contained in their window cells and inserts them locally. More...
 
void compactCells ()
 Removes all holes in the cell collector and moves halo cells to the back of the collector. More...
 
MInt createCellId (const MInt gridCellId)
 
void removeCellId (const MInt cellId)
 
MInt inCell (const MInt cellId, MFloat *point, MFloat fac=F1)
 
MInt setUpInterpolationStencil (const MInt cellId, MInt *, const MFloat *, std::function< MBool(MInt, MInt)>, MBool allowIncompleteStencil)
 
MFloat interpolateFieldData (MInt *, MFloat *, MInt varId, std::function< MFloat(MInt, MInt)> scalarField, std::function< MFloat(MInt, MInt)> coordinate)
 
MFloat leastSquaresInterpolation (MInt *, MFloat *, MInt varId, std::function< MFloat(MInt, MInt)> scalarField, std::function< MFloat(MInt, MInt)> coordinate)
 
void checkNoHaloLayers ()
 check that each solver has the required number of haloLayers for leaf cells!!! TODO labels:toenhance under production, needs to be cleaned up! More...
 
void mapInterpolationCells (std::map< MInt, MInt > &cellMap)
 
void setHaloCellsOnInactiveRanks ()
 
void patchRefinement (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen)
 
void reOrderCellIds (std::vector< MInt > &reOrderedCells)
 reOrder cellIds before writing the restart file! This is necessary for example if the minLevel shall be raised at the new restart! More...
 
void recomputeGlobalIds (std::vector< MInt > &, std::vector< MLong > &)
 reOrder cellIds before writing the restart file! This is necessary for example if the minLevel shall be raised at the new restart! More...
 
void extractPointIdsFromGrid (Collector< PointBasedCell< nDim > > *&, Collector< CartesianGridPoint< nDim > > *&, const MBool, const std::map< MInt, MInt > &, MInt levelThreshold=999999, MFloat *bBox=nullptr, MBool levelSetMb=false) const
 Creates a list of unique corner points for all cells using a hash map levelThreshold optionally specifies the maximum cell level to be extracted bBox optionally specifies a bounding to box to which the extracted domain shall be truncated. More...
 
- Protected Member Functions inherited from Solver
 Solver (const MInt solverId, const MPI_Comm comm, const MBool isActive=true)
 
MFloat returnLoadRecord () const
 
MFloat returnIdleRecord () const
 

Protected Attributes

FvSurfaceCollector m_surfaces
 
maia::fv::collector::FvCellCollector< nDimm_cells
 Collector for FV cells. More...
 
MFloat m_maRot = F0
 
MFloat m_MaHg
 
MFloat m_THg
 
MFloat m_UHg
 
MFloat m_VHg
 
MFloat m_WHg
 
MFloat m_PHg
 
MFloat m_rhoHg
 
MFloat m_MaCg
 
MFloat m_TCg
 
MFloat m_UCg
 
MFloat m_VCg
 
MFloat m_WCg
 
MFloat m_PCg
 
MFloat m_rhoCg
 
MIntm_bndryRfnJumpInformation = nullptr
 
MIntm_bndryRfnJumpInformation_ = nullptr
 
MInt m_sweepStartFirstCell
 
MIntm_activeCellIds = nullptr
 
MInt m_noActiveCells
 
MInt m_noActiveHaloCellOffset
 
MIntm_cellsInsideSpongeLayer = nullptr
 
MInt m_noCellsInsideSpongeLayer
 
MIntm_smallCellIds = nullptr
 
MIntm_masterCellIds = nullptr
 
MInt ** m_maxLevelWindowCells = nullptr
 
MIntm_noMaxLevelWindowCells = nullptr
 
MInt ** m_maxLevelHaloCells = nullptr
 
MIntm_noMaxLevelHaloCells = nullptr
 
MInt m_slopeMemory
 
MInt m_surfaceVarMemory
 
std::set< MIntm_splitSurfaces
 
std::vector< MIntm_splitCells
 
std::vector< std::vector< MInt > > m_splitChilds
 
std::set< MIntm_cutOffInterface
 
MFloat ** m_A = nullptr
 
MFloat ** m_ATA = nullptr
 
MFloat ** m_ATAi = nullptr
 
MIntm_reconstructionDataPeriodic = nullptr
 
MUint m_reconstructionDataSize
 
std::vector< MFloatm_reconstructionConstants
 
std::vector< MIntm_reconstructionCellIds
 
std::vector< MIntm_reconstructionNghbrIds
 
MFloatm_reconstructionConstantsPeriodic = nullptr
 
std::vector< std::vector< MInt > > m_azimuthalMaxLevelHaloCells
 
std::vector< std::vector< MInt > > m_azimuthalMaxLevelWindowCells
 
std::vector< std::vector< MInt > > m_azimuthalRemappedHaloCells
 
std::vector< std::vector< MInt > > m_azimuthalRemappedWindowCells
 
std::vector< MIntm_azimuthalRemappedNeighborDomains
 
std::vector< MIntm_azimuthalRemappedNeighborsDomainIndex
 
MBool m_azimuthalRecConstSet = false
 
MBool m_azimuthalNearBndryInit = false
 
const MInt m_maxNoAzimuthalRecConst = 250
 
MBool m_planeInterp = false
 
std::vector< MIntm_noAzimuthalReconstNghbrs
 
std::vector< MFloatm_azimuthalRecConsts
 
std::vector< MIntm_azimuthalReconstNghbrIds
 
std::vector< MIntm_azimuthalBndrySide
 
std::vector< MFloatm_azimuthalCutRecCoord
 
std::vector< std::vector< MInt > > m_azimuthalMaxLevelWindowMap
 
std::vector< MIntm_azimuthalHaloActive
 
const MInt m_azimuthalNearBoundaryBackupMaxCount
 
MFloat m_azimuthalAngle
 
std::vector< MIntm_rotIndVarsPV
 
std::vector< MIntm_rotIndVarsCV
 
MFloat m_angularBodyVelocity
 
MFloat m_surfaceTangentialVelocity
 
MIntm_secondBodyId = nullptr
 
MFloat ** m_rhs0 = nullptr
 
MFloatm_volumeAcceleration = nullptr
 
MFloatm_rotAxisCoord = nullptr
 
MFloatm_heatRelease = nullptr
 
MFloatm_limPhi = nullptr
 
std::vector< MFloatm_dampFactor
 
MString m_reactionScheme
 
MFloat m_hInfinity
 
MFloat m_gasConstant
 
MFloat m_thickeningFactor
 
MFloat m_referenceDensityTF
 
MFloat m_heatReleaseReductionFactor
 
MInt m_temperatureChange
 
MFloat m_burntUnburntTemperatureRatio
 
MFloat m_burntUnburntTemperatureRatioEnd
 
MFloat m_burntUnburntTemperatureRatioStart
 
MFloatm_molecularWeight = nullptr
 
MFloatm_FmolecularWeight = nullptr
 
MFloatm_molarFormationEnthalpy = nullptr
 
MFloatm_formationEnthalpy = nullptr
 
MFloatm_referenceComposition = nullptr
 
MFloatm_secondaryReferenceComposition = nullptr
 
MBool m_jet = false
 
MBool m_jetForcing = false
 
MFloat m_jetForcingPosition
 
MFloat m_jetRandomSeed
 
MFloat m_jetHalfWidth
 
MFloat m_jetCoflowOffset
 
MFloat m_jetCoflowEndOffset
 
MFloat m_jetHalfLength
 
MInt m_noJetConst
 
MFloatm_jetConst = nullptr
 
MFloat m_forceCoefficient = 0.0
 
MFloat m_densityRatio
 
MFloat m_shearLayerThickness
 
MFloat m_MaCoflow
 
MFloat m_jetTemperature = -1
 
MFloat m_jetDensity = -1
 
MFloat m_jetPressure = -1
 
MFloat m_jetHeight = 0.5
 
MFloat m_primaryJetRadius
 
MFloat m_secondaryJetRadius
 
MInt m_modeNumbers
 
MFloat m_targetVelocityFactor
 
MFloat m_momentumThickness = 0.0
 
MInt m_jetType
 
MBool m_chevron = false
 
MFloat m_inletRadius = -1.0
 
MFloat m_outletRadius = -1.0
 
MFloat m_normJetTemperature = -1.0
 
MFloat m_maNozzleExit = -1.0
 
MFloat m_nozzleExitMaJet = -1.0
 
MFloat m_nozzleExitTemp = -1.0
 
MFloat m_nozzleExitRho = -1.0
 
MFloat m_nozzleExitU = -1.0
 
MFloat m_maNozzleInlet = -1.0
 
MFloat m_nozzleInletTemp = -1.0
 
MFloat m_nozzleInletP = -1.0
 
MFloat m_nozzleInletRho = -1.0
 
MFloat m_nozzleInletU = -1.0
 
MFloat m_c0
 
MFloat m_laminarFlameThickness
 
MFloat m_subfilterVariance
 
MFloat m_maxReactionRate
 
MFloat m_MaFlameTube
 
MFloat m_temperatureFlameTube
 
MFloat m_velocityFlameTube
 
MFloat m_rhoFlameTube
 
MFloat m_rhoUnburnt
 
MFloat m_rhoBurnt
 
MFloat m_pressureFlameTube
 
MFloat m_pressureUnburnt
 
MFloat m_inletTubeAreaRatio
 
MFloat m_flameOutletAreaRatio
 
MFloat m_inletOutletAreaRatio
 
MBool m_twoFlames
 
MFloat m_dampingDistanceFlameBase
 
MFloat m_dampingDistanceFlameBaseExtVel
 
MFloat m_realRadiusFlameTube
 
MFloat m_radiusVelFlameTube
 
MFloat m_radiusInjector
 
MFloat m_yOffsetInjector
 
MFloat m_radiusFlameTube
 
MFloat m_radiusFlameTube2
 
MFloat m_initialFlameHeight
 
MFloat m_xOffsetFlameTube
 
MFloat m_xOffsetFlameTube2
 
MFloat m_yOffsetFlameTube
 
MFloat m_yOffsetFlameTube2
 
MFloat m_deltaXtemperatureProfile
 
MFloat m_deltaYtemperatureProfile
 
MFloat m_thermalProfileStartFactor
 
MFloat m_flameRadiusOffset
 
MFloat m_shearLayerStrength
 
MFloat m_ScT
 
MFloat m_NuT
 
MFloat m_integralAmplitude
 
MFloat m_integralLengthScale
 
MInt m_spongeLayerLayout
 
MFloatm_domainBoundaries = nullptr
 
MFloatm_spongeCoord = nullptr
 
MBool m_levelSet = false
 
MBool m_levelSetMb = false
 
MBool m_LsRotate = false
 
MBool m_levelSetRans = false
 
MBool m_combustion = false
 
MBool m_LSSolver
 
MBool m_acousticAnalysis
 
MBool m_thickenedFlame = false
 
std::vector< MFloat > * m_levelSetValues = nullptr
 
MFloatm_levelSetValuesMb = nullptr
 
MIntm_associatedBodyIds = nullptr
 
MInt m_noLevelSetsUsedForMb {}
 
MInt m_noLevelSetFieldData
 
std::vector< MFloat > * m_curvatureG = nullptr
 
std::vector< MFloat > * m_flameSpeedG = nullptr
 
MInt m_noSets = 0
 
MBool m_reComputedBndry = false
 
MString m_currentGridFileName
 
MBool m_adaptationSinceLastRestart
 
MBool m_adaptationSinceLastRestartBackup
 
MBool m_forceRestartGrid
 
MBool m_force1DFiltering
 
MBool m_gridConvergence
 
MBool m_gridInterfaceFilter
 
MBool m_totalDamp
 
MBool m_heatReleaseDamp
 
MBool m_useCorrectedBurningVelocity
 
MBool m_modelCheck
 
MBool m_recordBodyData
 
MBool m_recordLandA
 
MBool m_recordPressure
 
MBool m_vtkTest
 
MBool m_recordFlameFrontPosition
 
MBool m_recordWallVorticity
 
MBool m_structuredFlameOutput
 
MBool m_surfDistParallel
 
MBool m_surfDistCartesian
 
MInt m_writeOutData
 
MBool m_writeCutCellsToGridFile
 
MBool m_restartOldVariables = false
 
MBool m_restartOldVariablesReset = false
 
MBool m_bodyIdOutput
 
MBool m_levelSetOutput
 
MBool m_isActiveOutput
 
MBool m_domainIdOutput = false
 
MBool m_multipleFvSolver = false
 
const MChar ** m_variablesName
 
const MChar ** m_vorticityName
 
MBool m_saveVorticityToRestart = false
 
MBool m_vorticityOutput
 
MInt m_vorticitySize
 
MBool m_qCriterionOutput
 
MBool m_vtuWritePointData
 
MBool m_vtuWriteGeometryFile
 
MBool m_vtuWriteParticleFile
 
MBool m_vtuCutCellOutput
 
std::set< MIntm_vtuGeometryOutput
 
MBool m_vtuGlobalIdOutput
 
MBool m_vtuDomainIdOutput
 
MBool m_vtuDensityOutput
 
MBool m_vtuLevelSetOutput
 
MBool m_vtuQCriterionOutput
 
MBool m_vtuLambda2Output
 
MBool m_vtuVorticityOutput
 
MBool m_vtuVelocityGradientOutput
 
MBool m_vtuGeometryOutputExtended
 
MBool m_vtuSaveHeaderTesting
 
MInt m_vtuLevelThreshold
 
MFloatm_vtuCoordinatesThreshold = nullptr
 
MBool m_checkCellSurfaces
 
MBool m_considerVolumeForces
 
MBool m_considerRotForces = false
 
MString m_outputFormat
 
MBool m_allowInterfaceRefinement
 
MInt m_bndryCellSurfacesOffset
 
MInt m_bndrySurfacesOffset
 
MInt m_cellToRecordData
 
MInt m_counterCx
 
MInt m_dragOutputInterval
 
MBool m_integratedHeatReleaseOutput
 
MInt m_integratedHeatReleaseOutputInterval
 
MBool m_dualTimeStepping
 
MBool m_euler
 
MInt m_bndryGhostCellsOffset
 
MInt m_initialCondition
 
MInt m_limiter
 
MInt m_maxNoTimeSteps
 
MInt m_maxNoSurfaces
 
MInt m_noGNodes
 
MInt m_noRKSteps
 
MInt m_noSamples
 
MInt m_maxIterations
 
MInt m_orderOfReconstruction
 
MInt m_restartBackupInterval
 
MBool m_restartBc2800
 
MFloat m_restartTimeBc2800
 
MInt m_RKStep
 
MInt m_rungeKuttaOrder
 
MInt m_noTimeStepsBetweenSamples
 
MInt m_forceNoTimeSteps
 
MInt m_structuredFlameOutputLevel
 
MFloat m_adaptationDampingDistance
 
MFloatm_angle = nullptr
 
MFloatm_RKalpha = nullptr
 
MBool m_isEEGas = false
 
struct {
   MFloat   RKSemiImplicitFactor
 
   MFloat **   uOtherPhase = nullptr
 
   MFloat **   uOtherPhaseOld = nullptr
 
   MFloat **   gradUOtherPhase = nullptr
 
   MFloat **   vortOtherPhase = nullptr
 
   MFloat *   nuTOtherPhase = nullptr
 
   MFloat *   nuEffOtherPhase = nullptr
 
   MFloat   Eo0
 
   MFloat   bubbleDiameter
 
   MFloat   CD
 
   MFloat   CL
 
   MInt   dragModel
 
   MFloat   liquidDensity
 
   MFloat   eps
 
   MInt   gasSource
 
   MFloat   gasSourceMassFlow
 
   std::vector< MInt >   gasSourceCells
 
   MInt   noGasSourceBoxes
 
   std::vector< MFloat >   gasSourceBox
 
   MBool   bubblePathDispersion
 
   MFloat   massSource
 
   MFloat   initialAlpha
 
   MFloat   alphaInf
 
   MFloat   alphaIn
 
   MFloat   schmidtNumber
 
   MBool   uDLimiter
 
   MFloat   uDLim
 
   MBool   depthCorrection
 
   std::vector< MFloat >   gravity
 
   std::vector< MFloat >   gravityRefCoords
 
   std::vector< MFloat >   depthCorrectionCoefficients
 
   MFloat   interpolationFactor
 
m_EEGas
 
struct {
   MFloat   infTemperature
 
   MFloat   infPressure
 
   MFloat   infPhi
 
   MString *   infSpeciesName
 
   MFloat *   infSpeciesMassFraction
 
   MFloat   infVelocity
 
   MFloat   laminarFlameSpeedFactor
 
   MBool   hasChemicalReaction
 
   MString   reactionMechanism
 
   MString   phaseName
 
   MString   transportModel
 
   MBool   soretEffect
 
m_detChem
 
MIntm_storeNghbrIds = nullptr
 
MIntm_identNghbrIds = nullptr
 
MBool m_zonal = false
 
MInt m_zonalRestartInterpolationSolverId
 
MBool m_resetInitialCondition
 
MBool m_rans
 
MInt m_noRansEquations = 0
 
MFloat m_turbulenceDegree
 
MFloat m_ransTransPos
 
MInt m_zonalAveragingTimeStep = 0
 
MInt m_zonalTransferInterval = 1
 
MInt m_noRANSVariables = -1
 
MInt m_noLESVariables = -1
 
std::vector< MFloat > * m_RANSValues = nullptr
 
std::vector< MFloat > * m_LESValues = nullptr
 
std::vector< MFloat > * m_LESVarAverage = nullptr
 
std::vector< MFloat > * m_LESVarAverageBal = nullptr
 
std::vector< MIntm_LESAverageCells
 
MInt m_LESNoVarAverage = 0
 
std::vector< MFloatm_averagePos
 
std::vector< MIntm_averageDir
 
std::vector< MBoolm_averageReconstructNut
 
MBool m_calcLESAverage = false
 
MBool m_restartLESAverage = false
 
MInt m_averageStartTimeStep = 0
 
MInt m_rntStartTimeStep = 0
 
MString m_bc7909RANSSolverType
 
MInt m_stgStartTimeStep = 0
 
MBool m_stgIsActive
 
MFloat m_pressureRatioChannel
 
MInt m_pressureRatioStartTimeStep
 
MInt m_pressureRatioEndTimeStep
 
MInt m_spongeTimeVelocity
 
MFloat ** m_stgEddieCoverage = nullptr
 
MInt m_stgSpongeTimeStep = 0
 
MFloatm_stgSpongePositions
 
MInt m_noStgSpongePositions
 
MBool m_STGSponge = false
 
MBool m_preliminarySponge = false
 
MInt m_spongeRoot = -1
 
MFloat m_7901Position
 
MInt m_7901faceNormalDir
 
MInt m_7901wallDir
 
MInt m_7901periodicDir
 
std::vector< MFloat > * m_STGSpongeFactor = nullptr
 
MFloat ** m_LESPeriodicAverage = nullptr
 
MFloatm_uvErr = nullptr
 
MFloatm_uvRans = nullptr
 
MFloatm_uvInt = nullptr
 
MFloat m_spongeLimitFactor = 10000.0
 
MPI_Comm m_spongeComm
 
MInt m_spongeCommSize = -1
 
MInt m_spongeRank = -1
 
MInt m_noSpongeCells
 
MInt m_globalNoSpongeLocations = 0
 
MIntm_globalNoPeriodicExchangeCells = nullptr
 
std::vector< MInt > * m_spongeAverageCellId = nullptr
 
std::vector< MIntm_spongeCells
 
std::vector< MFloatm_spongeLocations
 
MFloatm_globalBcStgLocationsG = nullptr
 
std::vector< std::pair< MFloat, MFloat > > m_globalSpongeLocations
 
MFloat m_tkeFactor
 
MFloat m_kInfinityFactor
 
MFloat m_omegaInfinityFactor
 
std::vector< FvWMSurface< nDim > > m_wmSurfaces
 
MInt m_wmSurfaceProbeInterval = 0
 
MInt m_wmGlobalNoSrfcProbeIds
 
MInt m_wmDomainId
 
MInt m_wmNoDomains
 
MBool m_wmLES = false
 
MBool m_wmOutput = false
 
MBool m_wmTimeFilter = false
 
MBool m_wmUseInterpolation = true
 
MFloat m_wmDistance
 
MInt m_wmIterator = 0
 
MPI_Comm m_comm_wm
 
MIntm_wmLocalNoSrfcProbeIds = nullptr
 
MIntm_noWMImgPointsSend = nullptr
 
MIntm_noWMImgPointsRecv = nullptr
 
MIntm_wmImgRecvIdMap = nullptr
 
MFloatm_wmImgSendBuffer = nullptr
 
MFloatm_wmImgRecvBuffer = nullptr
 
MFloatm_wmSrfcProbeSendBuffer = nullptr
 
MFloatm_wmSrfcProbeRecvBuffer = nullptr
 
MPI_Request * m_mpi_wmRequest = nullptr
 
MPI_Request * m_mpi_wmSendReq = nullptr
 
MPI_Request * m_mpi_wmRecvReq = nullptr
 
std::vector< std::vector< MInt > > m_wmImgCellIds
 
std::vector< std::vector< MInt > > m_wmImgWMSrfcIds
 
std::vector< std::vector< MFloat > > m_wmImgCoords
 
std::vector< MIntm_wmSurfaceProbeIds
 
std::vector< MIntm_wmSurfaceProbeSrfcs
 
MFloat m_normalLength
 
MInt m_normalNoPoints
 
MInt m_normalOutputInterval
 
MInt m_normalOutputInitCounter = 0
 
MInt m_normalBcId
 
MBool m_wallNormalOutput
 
MBool m_useWallNormalInterpolation
 
std::vector< MFloatm_normalSamplingCoords
 
std::vector< MIntm_normalSamplingSide
 
MInt m_noWallNormals = 0
 
std::vector< MFloatm_wallNormalPointCoords
 
std::vector< MFloatm_wallNormalVectors
 
std::vector< MFloatm_wallSetupOrigin
 
std::vector< MIntm_wallSetupOriginSide
 
std::vector< MIntm_wallNormalPointDomains
 
std::vector< MIntm_wallNormalPointCellIDs
 
std::vector< std::vector< MInt > > m_neighborPointIds
 
std::vector< MFloatTensorm_interpolationMatrices
 
std::vector< MIntm_interpolationPosition
 
MInt m_saNoSrfcProbes
 
MInt m_saSrfcProbeInterval
 
MInt m_saSrfcProbeStart
 
MBool m_saSrfcProbes = false
 
MString m_saSrfcProbeDir
 
std::vector< std::vector< MInt > > m_saSrfcProbeIds
 
std::vector< std::vector< MInt > > m_saSrfcProbeSrfcs
 
MFloatm_saSrfcProbeBuffer = nullptr
 
MIntm_saSrfcProbeNoSamples = nullptr
 
MBool m_useSandpaperTrip
 
MBool m_useChannelForce
 
MFloat m_channelVolumeForce
 
MFloat m_chi
 
MInt m_upwindMethod
 
MInt m_reConstSVDWeightMode {}
 
MBool m_relocateCenter
 
MBool m_reExcludeBndryDiagonals
 
MBool m_2ndOrderWeights
 
MFloat m_cfl
 
MFloat m_cflViscous
 
MFloat m_convergenceCriterion
 
MFloat m_deltaP
 
MFloat m_deltaPL
 
MFloat m_gamma = NAN
 
MFloat m_globalUpwindCoefficient
 
MFloat m_inflowTemperatureRatio
 
MFloat ** m_kronecker = nullptr
 
MFloat m_massConsumption
 
MFloat m_maxTemp
 
MFloat m_meanPressure
 
MFloat m_meanY
 
MFloat m_physicalTime
 
MFloat m_physicalTimeStep
 
MFloat m_Pr
 
MFloat m_rPr
 
MFloat m_rRe0
 
MFloat m_referenceLength
 
MFloat m_previousMa
 
MBool m_changeMa
 
MBool m_useCreateCutFaceMGC
 
MFloat m_sampleRate
 
MFloat m_samplingTimeBegin
 
MFloat m_samplingTimeEnd
 
MInt m_spongeLayerType
 
MFloat m_sigmaSponge
 
MFloat m_sigmaSpongeInflow
 
MFloat m_spongeReductionFactor
 
MFloatm_spongeFactor = nullptr
 
MFloat m_spongeLayerThickness
 
MBool m_createSpongeBoundary
 
MInt m_noSpongeFactors
 
MInt m_noSpongeBndryCndIds
 number of sponge boundary IDs More...
 
MInt m_noMaxSpongeBndryCells
 
MFloatm_sigmaSpongeBndryId = nullptr
 
MFloatm_sigmaEndSpongeBndryId = nullptr
 
MIntm_spongeDirections = nullptr
 
MIntm_spongeBndryCndIds = nullptr
 
MFloatm_spongeStartIteration = nullptr
 
MFloatm_spongeEndIteration = nullptr
 
MIntm_spongeTimeDependent = nullptr
 
MBool m_spongeTimeDep
 
MBool m_velocitySponge
 
MFloat m_spongeWeight
 
MFloat m_spongeBeta
 
MFloat m_targetDensityFactor
 
MBool m_outputPhysicalTime = false
 
MFloat m_time
 
MFloat m_timeRef
 
MFloat m_totalHeatReleaseRate
 
MInt ** m_cellSurfaceMapping = nullptr
 
MUlong m_randomDeviceSeed
 
MBool m_useCentralDifferencingSlopes = false
 
MFloat m_oldMomentOfVorticity
 
MFloat m_oldNegativeMomentOfVorticity
 
MFloat m_oldPositiveMomentOfVorticity
 
MFloat ** m_vorticity = nullptr
 
MBool m_loadSampleVariables = false
 
MString m_testCaseName
 
MFloat m_timeStepConvergenceCriterion
 
MFloat ** m_externalSource = nullptr
 
MFloat ** m_externalSourceDt1 = nullptr
 
MIntm_noParts = nullptr
 
MBool m_hasExternalSource = false
 
std::map< MInt, std::vector< MFloat > > m_vapourData
 
MBool m_calcSlopesAfterStep = false
 
MBool m_multilevel = false
 Stores whether this solver is part of a multilevel computation. More...
 
MBool m_isMultilevelPrimary = false
 Stores whether this solver is the primary solver (i.e., it has the finshest mesh) of a multilevel computation. More...
 
MBool m_isLowestSecondary = false
 
MInt m_maxLevelBeforeAdaptation = -1
 
MBool m_statisticCombustionAnalysis {}
 
MBool m_averageVorticity = false
 
MInt m_movingAvgInterval = 0
 
MBool m_averageSpeedOfSound = false
 
MInt m_skewness {}
 
MInt m_kurtosis {}
 
std::set< MIntm_activeMeanVars {}
 
MFloat ** m_sendBuffers = nullptr
 
MFloat ** m_receiveBuffers = nullptr
 
MInt m_dataBlockSize = -1
 
MBool m_nonBlockingComm = false
 
MFloat ** m_sendBuffersNoBlocking = nullptr
 
MFloat ** m_receiveBuffersNoBlocking = nullptr
 
MPI_Request * m_mpi_request = nullptr
 
MPI_Request * m_mpi_sendRequest = nullptr
 
MPI_Request * m_mpi_receiveRequest = nullptr
 
MBool m_mpiRecvRequestsOpen = false
 
MBool m_mpiSendRequestsOpen = false
 
MBool m_splitMpiCommRecv = false
 
Collector< FvBndryCell< nDim, SysEqn > > * m_bndryCells = nullptr
 
std::vector< MIntm_associatedInternalCells
 
std::map< MInt, MIntm_splitChildToSplitCell
 
MString m_surfaceValueReconstruction
 
MString m_viscousFluxScheme
 
MString m_advectiveFluxScheme
 
MFloat m_enhanceThreePointViscFluxFactor = 0.1
 
MInt m_noLimitedSlopesVar
 
MIntm_limitedSlopesVar = nullptr
 
MInt m_computeExtVel {}
 
MBool m_massFlux
 
MBool m_plenumWall
 
MBool m_plenum
 
MBool m_confinedFlame
 
MBool m_filterFlameTubeEdges
 
MFloat m_filterFlameTubeEdgesDistance
 
MBool m_divergenceTreatment
 
MBool m_specialSpongeTreatment
 
MInt m_constantFlameSpeed
 
MFloat m_flameSpeed {}
 
MFloat m_turbFlameSpeed
 
MFloat m_Da
 
MFloat m_noReactionCells
 
MFloat m_velocityOutlet
 
MFloat m_analyticIntegralVelocity
 
MInt m_pressureLossFlameSpeed
 
MFloat m_pressureLossCorrection
 
MFloat m_meanVelocity
 
MFloat m_meanVelocityOutlet
 
MFloat m_tubeLength
 
MFloat m_outletLength
 
MFloat m_radiusOutlet
 
MFloat m_strouhal = -1.0
 
MFloat m_strouhalInit = -1.0
 
MFloat m_flameStrouhal
 
MFloat m_neutralFlameStrouhal
 
MInt m_samplingEndCycle
 
MInt m_samplingStartCycle
 
MInt m_samplingStartIteration
 
MInt m_noSamplingCycles
 
MFloat m_samplesPerCycle
 
MInt m_noForcingCycles
 
MBool m_forcing
 
MFloat m_forcingAmplitude
 
MFloat m_perturbationAmplitude
 
MFloat m_perturbationAmplitudeCorr
 
MFloat m_lambdaPerturbation
 
MInt m_outputOffset
 
MFloat m_marksteinLength
 
MFloat m_marksteinLengthPercentage
 
MBool m_zeroLineCorrection
 
MFloat m_marksteinLengthTh
 
MInt m_loadBalancingReinitStage = -1
 
MBool m_weightBndryCells = true
 
MBool m_weightCutOffCells = true
 
MBool m_weightBc1601 = true
 
MBool m_weightInactiveCell = true
 
MBool m_weightNearBndryCells = false
 
MBool m_limitWeights = false
 
MBool m_weightLvlJumps = false
 
MBool m_weightSmallCells = false
 
MFloat m_weightBaseCell = 0.0
 
MFloat m_weightLeafCell = 0.05
 
MFloat m_weightActiveCell = 0.1
 
MFloat m_weightBndryCell = 1.0
 
MFloat m_weightNearBndryCell = 0.0
 
MFloat m_weightMulitSolverFactor = 1.0
 
MInt m_timerGroup = -1
 
std::array< MInt, Timers::_countm_timers {}
 
MInt m_tgfv
 
MInt m_tcomm
 
MInt m_texchange
 
MInt m_tgatherAndSend
 
MInt m_tgatherAndSendWait
 
MInt m_tscatterWaitSome
 
MInt m_tgather
 
MInt m_tsend
 
MInt m_treceive
 
MInt m_tscatter
 
MInt m_treceiving
 
MInt m_treceiveWait
 
MInt m_texchangeDt
 
MFloat m_UInfinity
 
MFloat m_VInfinity
 
MFloat m_WInfinity
 
MFloat m_PInfinity
 
MFloat m_TInfinity = NAN
 
MFloat m_DthInfinity
 
MFloat m_nuTildeInfinity
 
MFloat m_kInfinity
 
MFloat m_omegaInfinity
 
MFloat m_DInfinity
 
MFloat m_SInfinity
 
MFloat m_VVInfinity [3]
 
MFloat m_rhoUInfinity
 
MFloat m_rhoVInfinity
 
MFloat m_rhoWInfinity
 
MFloat m_rhoEInfinity
 
MFloat m_rhoInfinity
 
MFloat m_rhoVVInfinity [3]
 
MFloatm_postShockPV = nullptr
 
MFloatm_postShockCV = nullptr
 
- Protected Attributes inherited from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >
MIntm_rfnBandWidth
 
MInt m_noSensors
 
MInt m_adaptationInterval
 
MInt m_adaptationStep
 
std::vector< MIntm_maxSensorRefinementLevel
 
std::vector< MFloatm_sensorWeight
 
std::vector< MFloatm_sensorDerivativeVariables
 
MBool m_adaptation
 
MBool m_adapts
 
MInt m_noInitialSensors
 
MBool m_resTriggeredAdapt
 
MInt m_noSmoothingLayers
 
MInt m_sensorBandAdditionalLayers
 
MBool m_sensorInterface
 
MBool m_sensorParticle
 
std::vector< MStringm_sensorType
 
MIntm_recalcIds
 
std::vector< funm_sensorFnPtr
 
MInt m_maxNoSets
 
std::vector< MFloatm_azimuthalCartRecCoord
 
const MInt m_revDir [6]
 
const MInt m_noDirs
 
- Protected Attributes inherited from Solver
MFloat m_Re {}
 the Reynolds number More...
 
MFloat m_Ma {}
 the Mach number More...
 
MInt m_solutionInterval
 The number of timesteps before writing the next solution file. More...
 
MInt m_solutionOffset {}
 
std::set< MIntm_solutionTimeSteps
 
MInt m_restartInterval
 The number of timesteps before writing the next restart file. More...
 
MInt m_restartTimeStep
 
MInt m_restartOffset
 
MString m_solutionOutput
 
MBool m_useNonSpecifiedRestartFile = false
 
MBool m_initFromRestartFile
 
MInt m_residualInterval
 The number of timesteps before writing the next residual. More...
 
const MInt m_solverId
 a unique solver identifier More...
 
MFloatm_outerBandWidth = nullptr
 
MFloatm_innerBandWidth = nullptr
 
MIntm_bandWidth = nullptr
 
MBool m_restart = false
 
MBool m_restartFile = false
 

Private Types

using Self = FvCartesianSolverXD< nDim, SysEqn >
 

Private Attributes

MBool m_timeStepConverged = false
 Convergence status of the current time step. More...
 
MBool m_trackMovingBndry {}
 
MInt m_trackMbStart {}
 
MInt m_trackMbEnd {}
 
MBool m_forceAdaptation = false
 
MInt m_lastAdapTS = 0
 

Friends

template<class SolverType >
class AccessorUnstructured
 
template<MInt nDim, SolverType SolverTypeR, SolverType SolverTypeL>
class MSTG
 
template<MInt nDim, class SysEqn_ >
class FvBndryCndXD
 
template<MInt nDim, class SysEqn_ >
class CouplerFvMultilevel
 
template<MInt nDim, class SysEqn_ >
class LsFvMb
 
template<MInt nDim, class SysEqn_ >
class CouplingLsFv
 
template<MInt nDim, class SysEqn_ >
class CouplingFvMb
 
template<MInt nDim, class SysEqn_ >
class LsFvCombustion
 
template<MInt nDim, MInt nDist, class SysEqnLb_ , class SysEqnFv_ >
class CouplerLbFv
 
template<MInt nDim, MInt nDist, class SysEqnLb_ , class SysEqnFv_ >
class CouplerLbFvEEMultiphase
 
template<MInt nDim, class SysEqn_ >
class CouplerFvParticle
 
template<MInt nDim, class ppType >
class PostProcessing
 
template<MInt nDim, class SysEqn_ >
class PostProcessingFv
 
class maia::CartesianSolver< nDim, FvCartesianSolverXD< nDim, SysEqn > >
 
class LsFvCombustion< nDim, SysEqn >
 
class CouplingLsFv< nDim, SysEqn >
 

Time-stepping

Method to compute the time-step in a cell.

static constexpr MInt s_maxNoSpongeZones = 10
 
static constexpr MInt s_maxNoEmbeddedBodies = 20
 
MBool m_sensorBandRefinement
 
MInt m_sensorBandRefinementAdditionalLayers
 
MFloatconst
 
void(FvCartesianSolverXD::* m_reconstructSurfaceData )(MInt)
 
void(FvCartesianSolverXD::* m_computeViscousFlux )()
 
void(FvCartesianSolverXD::* m_computeViscousFluxMultiSpecies )(MInt)
 
MFloat m_meanCoord [3] {}
 
MInt m_adaptationLevel
 
MBool m_wasAdapted = false
 
MBool m_wasBalancedZonal = false
 
MBool m_firstUseUpdateSpongeLayerCase51 = true
 
MPI_Comm comm_sponge {}
 
MInt m_noSpongeZonesIn {}
 
MInt m_noSpongeZonesOut {}
 
MInt m_spongeDirectionsIn [s_maxNoSpongeZones] {}
 
MInt m_spongeDirectionsOut [s_maxNoSpongeZones] {}
 
MInt m_secondSpongeDirectionsIn [s_maxNoSpongeZones] {}
 
MInt m_secondSpongeDirectionsOut [s_maxNoSpongeZones] {}
 
MInt m_spongeAveragingIn [s_maxNoSpongeZones] {}
 
MInt m_spongeAveragingOut [s_maxNoSpongeZones] {}
 
MBool m_hasCellsInSpongeLayer {}
 
MFloat m_timeOfMaxPdiff {}
 
MFloatm_coordSpongeIn {}
 
MFloatm_secondCoordSpongeIn {}
 
MFloatm_coordSpongeOut {}
 
MFloatm_secondCoordSpongeOut {}
 
MFloatm_uNormal_r {}
 
std::map< MInt, std::vector< MInt > > m_cellToNghbrHood
 
MFloat m_maxLsValue = -99
 
MBool m_linerLvlJump = false
 
MInt m_tripNoTrips
 
MInt m_tripNoModes
 
MInt m_tripTotalNoCells
 
MInt m_tripSeed
 
MBool m_tripUseRestart
 
MFloat m_tripDomainWidth
 
MBool m_tripAirfoil
 
MFloat m_tripAirfoilChordLength
 
MFloat m_tripAirfoilAOA
 
MFloatm_tripAirfoilNosePos = nullptr
 
MFloatm_tripAirfoilChordPos = nullptr
 
MFloatm_tripAirfoilForceDir = nullptr
 
MIntm_tripAirfoilOrientation = nullptr
 
MIntm_tripAirfoilBndryId = nullptr
 
MIntm_tripAirfoilSide = nullptr
 
std::vector< MIntm_tripCellIds
 
std::vector< MFloatm_tripCoords
 
MIntm_tripTimeStep = nullptr
 
MIntm_tripNoCells = nullptr
 
MIntm_tripCellOffset = nullptr
 
MFloatm_tripDelta1 = nullptr
 
MFloatm_tripXOrigin = nullptr
 
MFloatm_tripXLength = nullptr
 
MFloatm_tripYOrigin = nullptr
 
MFloatm_tripYHeight = nullptr
 
MFloatm_tripCutoffZ = nullptr
 
MFloatm_tripMaxAmpSteady = nullptr
 
MFloatm_tripMaxAmpFluc = nullptr
 
MFloatm_tripDeltaTime = nullptr
 
MFloatm_tripG = nullptr
 
MFloatm_tripH1 = nullptr
 
MFloatm_tripH2 = nullptr
 
MFloatm_tripModesG = nullptr
 
MFloatm_tripModesH1 = nullptr
 
MFloatm_tripModesH2 = nullptr
 
MBool m_useMpiStartall = true
 
MBool m_onlyMaxLvlMpiRequests = true
 
MInt m_noMaxLvlMpiSendNeighbors = -1
 
MInt m_noMaxLvlMpiRecvNeighbors = -1
 
std::vector< MIntm_maxLvlMpiSendNeighbor {}
 
std::vector< MIntm_maxLvlMpiRecvNeighbor {}
 
class LsFvCombustion< nDim_, SysEqn >
 
class CouplerFvMultilevel< nDim_, SysEqn >
 
class LsFvMb< nDim_, SysEqn >
 
class FvZonal< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >
 
class FvZonal< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_FS > > >
 
class FvZonalRTV< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >
 
class FvZonalRTV< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_FS > > >
 
class FvZonalSTG< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >
 
class FvZonalSTG< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_FS > > >
 
class FvCartesianInterpolation< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > >, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >
 
class FvCartesianInterpolation< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > >, FvSysEqnNS< nDim > >
 
class VtkIo< nDim_, SysEqn >
 
MBool m_firstUseWriteVtuOutputParallelQout = true
 
MBool m_firstUseWriteVtuOutputParallelGeom = true
 
MBool m_firstUseInitializeVtkXmlOutput = true
 
MFloat m_static_crankAngle_Strouhal = -99
 
MFloat m_static_crankAngle_initialCad = -99
 
MIntm_particleWidth = nullptr
 
MInt m_timeStepMethod = -1
 
MBool m_timeStepVolumeWeighted = false
 Should the time-step in the boundary cells be weighted by their volume? More...
 
MFloat m_timeStep = -1.0
 
MBool m_timeStepNonBlocking = false
 Reduce the timeStep using non-blocking communication;. More...
 
MPI_Request m_timeStepReq
 Request for reducing the time-step using non-blocking comm. More...
 
MBool m_timeStepAvailable = true
 Has the non-blocking reduction of the time-step finished? More...
 
MBool m_timeStepUpdated = true
 time-step has been updated More...
 
MFloat m_timeStepFixedValue = -1.0
 Forces the time-step to be set to a fixed value: More...
 
MInt m_timeStepComputationInterval = -1
 How often should the time-step be recomputed? More...
 
MFloat m_restartFileOutputTimeStep = -1.
 
MBool m_static_logCell_firstRun = true
 
MBool m_static_smallCellCorrection_first = true
 
MInt m_static_smallCellCorrection_slipDirection
 
MFloat m_static_smallCellCorrection_slipCoordinate
 
MBool m_static_computeSurfaceValuesLimitedSlopesMan_checkedBndryCndIds = false
 
MBool m_static_computeSurfaceValuesLimitedSlopesMan_correctWallBndryFluxes = false
 
MFloat m_static_getDistanceSplitSphere_h = 0
 
MBool m_static_getDistanceSplitSphere_first = true
 
MBool m_static_constructGFieldPredictor_firstRun = true
 
MBool m_static_constructGFieldPredictor_adaptiveGravity = false
 
MFloat m_static_advanceSolution_meanDragCoeff = F0
 
MFloat m_static_advanceSolution_meanDrag = F0
 
MFloat m_static_advanceSolution_dragCnt = F0
 
MBool m_static_advanceSolution_firstRun = true
 
MBool m_static_updateBodyProperties_c453_firstRun = true
 
MBool m_static_updateBodyProperties_c455_firstRun = true
 
MBool m_static_updateBodyProperties_firstTime = true
 
MBool m_static_redistributeMass_firstRun = true
 
MBool m_static_applyBoundaryCondition_firstRun = true
 
MFloat m_static_applyBoundaryCondition_ERhoL1 = F0
 
MFloat m_static_applyBoundaryCondition_ERhoL2 = F0
 
MFloat m_static_applyBoundaryCondition_ERhoLoo = F0
 
MFloat m_static_applyBoundaryCondition_EVelL1 = F0
 
MFloat m_static_applyBoundaryCondition_EVelL2 = F0
 
MFloat m_static_applyBoundaryCondition_EVelLoo = F0
 
MFloat m_static_applyBoundaryCondition_refMass
 
MFloat m_static_applyBoundaryCondition_oldMass
 
MFloat m_static_applyBoundaryCondition_oldVol2
 
MBool m_static_updateSpongeLayer_mbSpongeLayer = false
 
MBool m_static_updateSpongeLayer_first = true
 
MBool m_static_logData_firstRun4 = true
 
MBool m_static_logData_ic45299_first = true
 
MFloat m_static_logData_ic45299_amplitude [s_logData_ic45299_maxNoEmbeddedBodies]
 
MFloat m_static_logData_ic45299_freqFactor [s_logData_ic45299_maxNoEmbeddedBodies]
 
MFloat m_static_logData_ic45299_maxF
 
MFloat m_static_logData_ic45299_maxA
 
MFloat m_static_logData_ic45299_cutOffAngle
 
MFloat m_static_logData_ic45299_xCutOff
 
MBool m_static_logData_ic45301_first = true
 
MFloat m_static_logData_ic45301_Strouhal
 
MFloat m_static_logData_ic45301_freqFactor [s_logData_ic45301_maxNoEmbeddedBodies]
 
MFloat m_static_logData_ic45301_maxF
 
MFloat m_static_logData_ic45301_pressurePoints [s_logData_ic45301_maxNoPressurePoints *nDim]
 
MInt m_static_logData_ic45301_noPressurePoints = 0
 
MInt m_static_logData_ic45301_containingCellIds [s_logData_ic45301_maxNoPressurePoints]
 
MBool m_static_saveSolverSolutionxd_firstRun = true
 
MFloat m_static_computeFlowStatistics_thetaDensityAverage [s_computeFlowStatistics_noSamples *s_computeFlowStatistics_thetaSize *s_computeFlowStatistics_noDat]
 
MFloat m_static_computeFlowStatistics_thetaDensityAverage2 [s_computeFlowStatistics_noSamples *s_computeFlowStatistics_thetaSize *s_computeFlowStatistics_noDat]
 
MInt m_static_computeFlowStatistics_currentIndex = 0
 
MFloat m_static_computeFlowStatistics_pdfAverage [s_computeFlowStatistics_noSamples2 *s_computeFlowStatistics_noPdfs *s_computeFlowStatistics_noPdfPoints]
 
MFloat m_static_computeFlowStatistics_pdfAverage2 [s_computeFlowStatistics_noSamples2 *s_computeFlowStatistics_noPdfs *s_computeFlowStatistics_noPdfPoints]
 
MFloat m_static_computeFlowStatistics_jointPdfAverage [s_computeFlowStatistics_noSamples2 *s_computeFlowStatistics_noJointPdfs *s_computeFlowStatistics_noPdfPoints *s_computeFlowStatistics_noPdfPoints]
 
MInt m_static_computeFlowStatistics_currentIndex2 = 0
 
MFloat m_static_computeFlowStatistics_sdatAverage [s_computeFlowStatistics_noSamples *s_computeFlowStatistics_noAngles *s_computeFlowStatistics_noAngleDat]
 
MFloat m_static_computeFlowStatistics_sdatAverage2 [s_computeFlowStatistics_noSamples *s_computeFlowStatistics_noAngles *s_computeFlowStatistics_noAngleDat]
 
MFloat m_static_computeFlowStatistics_sdatSum [s_computeFlowStatistics_noSamples *s_computeFlowStatistics_noAngles]
 
MInt m_static_computeFlowStatistics_currentIndex3 = 0
 
MInt m_maxNearestBodies = 20
 
MInt m_static_computeFlowStatistics_currentIndex4 = 0
 
MInt m_static_computeFlowStatistics_currentCnt = 0
 
MFloat m_static_computeFlowStatistics_bodyCntAvg [s_computeFlowStatistics_noSamples *s_computeFlowStatistics_noReClasses]
 
MBool m_static_computeFlowStatistics_firstBD = true
 
MBool m_static_writeVtkXmlFiles_firstCall = true
 
MBool m_static_writeVtkXmlFiles_firstCall2 = true
 
MBool m_static_logCellxd_firstRun = true
 
std::vector< MIntm_cellInterpolationIndex {}
 
std::vector< std::vector< MFloat > > m_cellInterpolationMatrix {}
 
std::vector< std::vector< MInt > > m_cellInterpolationIds {}
 
static constexpr MInt s_logData_ic45299_maxNoEmbeddedBodies = 20
 
static constexpr MInt s_logData_ic45301_maxNoEmbeddedBodies = 20
 
static constexpr MInt s_logData_ic45301_maxNoPressurePoints = 20
 
static constexpr MInt s_computeFlowStatistics_noSamples = 1
 
static constexpr MInt s_computeFlowStatistics_thetaSize = 100
 
static constexpr MInt s_computeFlowStatistics_noDat = 76
 
static constexpr MInt s_computeFlowStatistics_noPdfPoints = 100
 
static constexpr MInt s_computeFlowStatistics_noPdfs = 42
 
static constexpr MInt s_computeFlowStatistics_noJointPdfs = 6
 
static constexpr MInt s_computeFlowStatistics_noSamples2 = 1
 
static constexpr MInt s_computeFlowStatistics_noSamples3 = 1
 
static constexpr MInt s_computeFlowStatistics_noAngles = 20
 
static constexpr MInt s_computeFlowStatistics_noAngleDat = 8
 
static constexpr MInt s_computeFlowStatistics_noReClasses = 6
 
static constexpr MInt s_computeFlowStatistics_noSamples4 = 1
 
void forceTimeStep (const MFloat dt)
 Force time step externally. More...
 
MInt a_timeStepComputationInterval ()
 
void preTimeStep () override
 
void computeVolumeForcesRANS ()
 
void exchangeGapInfo ()
 exchanges the Gap-Information with the solver-own communicators! More...
 
void resetCutOffCells ()
 resets all Cut-Off Information should only be called before the adaptation and balance! More...
 
void resetSponge ()
 reset sponge properties More...
 
void exchangeProperties ()
 exchanges isInactive and isOnCurrentMGLevel More...
 
void computeUTau (MFloat *data, MInt cellId)
 
void computeDomainAndSpongeDimensions ()
 Extracts the minimum and maximum coordinates of all cells in the grid. More...
 
virtual void updateSpongeLayer ()
 computes the additional rhs of all cells lying inside the sponge layer to dissipate outgoing waves. More...
 
std::array< MFloat, 6 > computeTargetValues ()
 
std::array< MFloat, nDim_+2 > computeSpongeDeltas (MInt cellId, std::array< MFloat, 6 >)
 
void updateSpongeLayerRhs (MInt, std::array< MFloat, nDim_+2 >)
 
void checkCells ()
 
void checkForSrfcsMGC ()
 Check all existing cells if surfaces have to be created member function with the task to check all existing cells for the creation of surfaces. If a surface has to be created, another member function is called. More...
 
void checkForSrfcsMGC_2 ()
 
void checkForSrfcsMGC_2_ ()
 Check all existing cells if surfaces have to be created member function with the task to check all existing cells for the creation of surfaces. If a surface has to be created, another member function is called. More...
 
void computeSrfcs (MInt, MInt, MInt, MInt)
 
virtual void correctBoundarySurfaces ()
 
virtual void correctBoundarySurfaces_ ()
 
void checkCellSurfaces ()
 checks if the surfaces for a cell are correct and balanced The accumulated cell surfaces in +x direction must be balanced by the accumulated cell surfaces in -x direction and so on. If the surfaces are not balanced, the cell is loggd to the debug output method is not yet extended to moving boundary computations More...
 
void computeCellSurfaceDistanceVectors ()
 
void computeReconstructionConstantsSVD ()
 Compute the reconstruction constants using a weighted least squares approached solved via singular value decomposition. More...
 
void setConservativeVarsOnAzimuthalRecCells ()
 
void initAzimuthalReconstruction ()
 
virtual void computeAzimuthalReconstructionConstants (MInt mode=0)
 
void rebuildAzimuthalReconstructionConstants (MInt cellId, MInt offset, MFloat *recCoord, MInt mode=0)
 
void interpolateAzimuthalData (MFloat *data, MInt offset, MInt noVars, const MFloat *vars)
 
void fillExcBufferAzimuthal (MInt cellId, MInt offset, MFloat *dataDest, MFloat *dataSrc, MInt noData, const std::vector< MInt > &rotIndex=std::vector< MInt >())
 
void rotateVectorAzimuthal (MInt side, MFloat *data, MInt noData, const std::vector< MInt > &indices)
 
void interpolateAzimuthalDataReverse (MFloat *data, MInt offset, MInt noVars, const MFloat *vars)
 
void checkAzimuthalRecNghbrConsistency (MInt cellId)
 
void buildLeastSquaresStencilSimple ()
 Determine the least squares stencil. More...
 
void initViscousFluxComputation ()
 
void computeRecConstPeriodic ()
 
void computeRecConstPeriodic_ ()
 
void identPeriodicCells ()
 
void identPeriodicCells_ ()
 
 ATTRIBUTES2 (ATTRIBUTE_ALWAYS_INLINE, ATTRIBUTE_HOT) inline void LSReconstructCellCenter_(const MUint noSpecies)
 
void LSReconstructCellCenterCons (const MUint noSpecies)
 
 ATTRIBUTES2 (ATTRIBUTE_HOT, ATTRIBUTE_FLATTEN) virtual void computeSurfaceValues(MInt timerId
 
 ATTRIBUTES2 (ATTRIBUTE_ALWAYS_INLINE, ATTRIBUTE_HOT) inline void computeSurfaceValues_(const MUint)
 
 ATTRIBUTES2 (ATTRIBUTE_HOT, ATTRIBUTE_FLATTEN) virtual void computeSurfaceValuesLimited(MInt timerId
 
virtual void computeSurfaceValuesLOCD (MInt timerId=-1)
 
virtual void computeLimitedSurfaceValues (MInt timerId=-1)
 
virtual void computeSurfaceValuesLimitedSlopes (MInt timerId=-1)
 
virtual void computeSurfaceValuesLimitedSlopesMan (MInt timerId=-1)
 aaplies the slope limiter to the slopes before calling computeSurfaceValues_ More...
 
virtual void initComputeSurfaceValuesLimitedSlopesMan1 ()
 initializes the limiter at cells, that are in the vicinity of a given stl-geometry More...
 
virtual void initComputeSurfaceValuesLimitedSlopesMan2 ()
 can be used to apply the slope limiter at certain positions such as refinement interfaces, cut off boundaries(sponge) etc. ... More...
 
void computeGridCellCoordinates (MFloat *)
 computes the coordinates of the grid cell centers and stores them into a one-dimensional array More...
 
void findNghbrIdsMGC ()
 
void findDirectNghbrs (MInt cellId, std::vector< MInt > &nghbrList)
 Obtain list of direct neighbors of given cell. More...
 
void findNeighborHood (MInt cellId, MInt layer, std::vector< MInt > &nghbrList)
 Obtain list of neighbors for the given extend. More...
 
void refineCell (const MInt) override
 
void removeChilds (const MInt) override
 
void removeCell (const MInt) override
 Remove the given cell. More...
 
void swapCells (const MInt, const MInt) override
 
void resizeGridMap () override
 Swap the given cells. More...
 
void swapProxy (const MInt, const MInt) override
 
MBool cellOutside (const MInt)
 
MInt cellOutside (const MFloat *, const MInt, const MInt) override
 
virtual void resetSurfaces ()
 
virtual void resetBoundaryCells (const MInt offset=0)
 
void reInitActiveCellIdsMemory ()
 Allocate memory to arrays according to the current number of cells. More...
 
void reInitSmallCellIdsMemory ()
 Reallocate memory to small and master cell id arrays according to the current number of cells. More...
 
void prepareAdaptation () override
 
void setSensors (std::vector< std::vector< MFloat > > &sensors, std::vector< MFloat > &sensorWeight, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MInt > &sensorSolverId) override
 set the sensors for the adaptation (i.e. which cell should be refined/removed?) More...
 
void postAdaptation () override
 
void finalizeAdaptation () override
 
void sensorInterface (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen) override
 
void sensorInterfaceDelta (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen)
 
void sensorInterfaceLsMb (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen)
 
void sensorInterfaceLs (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen)
 
void sensorCutOff (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen)
 
void sensorPatch (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen) override
 
void bandRefinementSensorDerivative (std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, MInt sensorOffset, MInt sen, const std::vector< MFloat > &tau, const MFloat sensorThreshold)
 
virtual void updateMultiSolverInformation (MBool fullReset=false)
 
void resetSolver () override
 Reset the solver prior to load balancing. More...
 
virtual void resetSolverFull ()
 
void setCellWeights (MFloat *) override
 
void balance (const MInt *const noCellsToReceiveByDomain, const MInt *const noCellsToSendByDomain, const MInt *const targetDomainsByCell, const MInt oldNoCells) override
 Balance the solver. More...
 
void balancePre () override
 Reinitialize solver for DLB prior to setting solution data. More...
 
void balancePost () override
 Reinitialize solver after setting solution data in DLB. More...
 
void finalizeBalance () override
 Reinitialize solver after all data structures have been recreated. More...
 
MInt noLoadTypes () const override
 
void getDefaultWeights (MFloat *weights, std::vector< MString > &names) const
 Return the default weights for all load quantities. More...
 
void getLoadQuantities (MInt *const loadQuantities) const override
 Return the cumulative load quantities on this domain. More...
 
MFloat getCellLoad (const MInt cellId, const MFloat *const weights) const override
 Return the load of a single cell (given computational weights). More...
 
void getDomainDecompositionInformation (std::vector< std::pair< MString, MInt > > &domainInfo) override
 Return decomposition information, i.e. number of local elements,... More...
 
void saveSolverSolution (const MBool forceOutput=false, const MBool finalTimeStep=false) override
 Manages solver-specific output. More...
 
void writeRestartFile (const MBool, const MBool, const MString, MInt *) override
 
void writeRestartFile (MBool) override
 
MBool prepareRestart (MBool, MBool &) override
 Prepare the solvers for a grid-restart. More...
 
void saveSampleFiles ()
 
virtual void saveRestartFile (const MBool)
 
void saveDebugRestartFile ()
 Saves the solver restart file and the grid restartFile NOTE: for debugging purposes only! for regular output use the saveRestartFile above! More...
 
void loadRestartFile () override
 
More...
 
void computeConservativeVariablesCoarseGrid ()
 Computes the primitive variables: velocity, density, and pressure from the conservative variables and stores the primitive variables in a_pvariable( i , v ) More...
 
void computePrimitiveVariablesCoarseGrid (MInt)
 Computes the primitive variables: velocity, density, and pressure from the conservative variables and stores the primitive variables in a_pvariable( i , v ) More...
 
void writeCenterLineVel ()
 
void computeForceCoefficients (MFloat *)
 
void checkInfinityVarsConsistency ()
 Check that all infinity (or other global) variables are equal on all ranks. More...
 
void computeInitialPressureLossForChannelFlow ()
 Computes pressure loss for the initial condition of channel flow testcases as \( \Delta_p = \frac{(\mathit{M} \mathit{Re}_{\tau} \sqrt{T_{\infty}})^{2}}{\mathit{Re}} \frac{\rho_{\infty}}{ L_{\infty} } \). Requires property ReTau to be set in the property file. More...
 
template<MInt stencil, class F >
void Ausm_ (F &fluxFct)
 
 ATTRIBUTES2 (ATTRIBUTE_HOT, ATTRIBUTE_ALWAYS_INLINE) inline void computePrimitiveVariables_()
 
template<class _ = void, std::enable_if_t< isEEGas< SysEqn >, _ * > = nullptr>
 ATTRIBUTES2 (ATTRIBUTE_HOT, ATTRIBUTE_ALWAYS_INLINE) inline MBool uDLimiter(const MFloat *const
 
 ATTRIBUTES2 (ATTRIBUTE_HOT, ATTRIBUTE_ALWAYS_INLINE) inline void computeConservativeVariables_()
 
template<class _ = void, std::enable_if_t< isEEGas< SysEqn >, _ * > = nullptr>
void bubblePathDispersion ()
 
template<MInt stencil, class F >
void viscousFlux_ (F &viscousFluxFct)
 Computes the viscous flux using a central difference scheme to approximate the slopes at the surface centroids (5-point stencil). More...
 
template<MInt stencil, class F >
void viscousFluxCompact_ (F &viscousFluxFct)
 Computes the viscous fluxes using a compact stencil with increased stability for flows with dominating viscous effects. Uses a 3-point centered-differences stencil for the normal derivative and distance-weighted averaging of the cell slopes for the tangential derivatives (i.e., a variant of the method described by Berger et al. in AIAA 2012-1301) More...
 
template<MInt noSpecies>
void viscousFluxMultiSpecies_ ()
 
void computeConservativeVariablesMultiSpecies_ (const MUint)
 
void computePrimitiveVariablesMultiSpecies_ (const MUint)
 
virtual void distributeFluxToCells ()
 Distributes the surface fluxes to the cell RHS. More...
 
void implicitTimeStep () override
 
virtual MBool maxResidual (MInt mode=0)
 Computes the global root-mean-square residual. The residual is defined as time derivative of conservative variables, RHS/cellVolume. This gives a residual independent of the time step. Similarly, the volume-weighting/volume-integrated RMS value results in a residual independent from the number of cells, thus smooth in time for dynamic mesh adaptation. mode 0 (default) : also write residual file mode 1 : pure debugging of the residual. More...
 
void computeCellVolumes ()
 
template<class _ = void, std::enable_if_t<!isEEGas< SysEqn >, _ * > = nullptr>
 ATTRIBUTES2 (ATTRIBUTE_HOT, ATTRIBUTE_ALWAYS_INLINE) inline MBool rungeKuttaStep_(const MUint)
 
template<class _ = void, std::enable_if_t< isEEGas< SysEqn >, _ * > = nullptr>
 ATTRIBUTES2 (ATTRIBUTE_HOT, ATTRIBUTE_ALWAYS_INLINE) inline MBool rungeKuttaStepEEGas()
 
void computeSamplingTimeStep ()
 
void computeSamplingTimeStep_ ()
 computes the time step according to the sample variables More...
 
void computeCoarseGridCorrection (MInt)
 
void linearInterpolation (MInt, MInt, MInt *)
 
void bilinearInterpolation (MInt, MInt, MInt *)
 
void bilinearInterpolationAtBnd (MInt, MInt, MInt *)
 
void initCutOffBoundaryCondition ()
 
virtual void setConservativeVariables (MInt cellId)
 computes conservative from primitive variables for given cell id More...
 
void setPrimitiveVariables (MInt cellId)
 computes primitive from primitive variables for given cell id. This is the version for all SysEqn. More...
 
template<class _ = void, std::enable_if_t< isEEGas< SysEqn >, _ * > = nullptr>
void initDepthCorrection ()
 
void divCheck (MInt)
 
template<MInt diag, MBool recorrectBndryCellCoords = false>
MInt getAdjacentLeafCells (const MInt, const MInt, MIntScratchSpace &, MIntScratchSpace &)
 retrieves the first 'noLayers' layers of direct and(or diagonal neighbors to the given cell More...
 
template<MBool recorrectBndryCellCoords = false>
MInt getNghbrLeafCells (const MInt cellId, MInt refCell, MInt layer, MInt *nghbrs, MInt dir, MInt dir1=-1, MInt dir2=-1) const
 returns the neighbor leaf cells in the specified direction 'dir' (dir1 and dir2 are used to identify only neighboring children beeing adjacent to the root cell) More...
 
void reduceVariables ()
 Check whether any of the extracted cells lie below the halo cell level and interpolate their variables in that case. More...
 
void computeSlopesByCentralDifferences ()
 
void generateBndryCells ()
 
void createBoundaryCells ()
 identifies bndry cells (Sets a_isInterface for the solver!) More...
 
void getInterpolatedVariables (const MInt cellId, const MFloat *position, MFloat *vars) override
 calculates interpolated variables for a given position in a given cell More...
 
template<MInt noSpecies>
void getInterpolatedVariables (const MInt cellId, const MFloat *position, MFloat *vars)
 
void getInterpolatedVariablesInCell (const MInt cellId, const MFloat *position, MFloat *vars)
 calculates interpolated variables for a given position in a given cell More...
 
template<MInt a, MInt b, MBool old = false>
void interpolateVariables (const MInt cellId, const MFloat *position, MFloat *result)
 calculates interpolated variables (in the range a, b) for a given position in a given cell More...
 
template<MInt a, MInt b>
void interpolateVariablesInCell (const MInt cellId, const MFloat *position, std::function< MFloat(MInt, MInt)> variables, MFloat *result)
 Interpolate the given variable field inside a cell at a given position (based on interpolateVariables() but uses the stored interpolation information for a cell). More...
 
MFloat crankAngle (const MFloat, const MInt)
 help-function for engine calculations which returns the crank-angle for a given time mode = 0: return CAD in range of (0-720) mode = 1: return accumulated crankAnge in radian More...
 
MFloat cv_p (MInt cellId) const noexcept
 Returns the pressure computed from the conservative variables of the cell cellId. More...
 
MFloat cv_T (MInt cellId) const noexcept
 Returns the temperature computed from the conservative variables of the cell cellId. More...
 
MFloat cv_a (MInt cellId) const noexcept
 Returns the speed-of-sound computed from the conservative variables of the cell cellId. More...
 
void setTimeStep ()
 
void initSandpaperTrip ()
 
void applySandpaperTrip ()
 
void saveSandpaperTripVars ()
 
void tripForceCoefficients (MFloat *, MFloat *, MFloat *, MInt, MInt)
 
void tripFourierCoefficients (MFloat *, MInt, MFloat, MFloat)
 
void dumpCellData (const MString name)
 Dump cell data of each rank to a separate file for debugging purposes. More...
 
MFloat timeStep (MBool canSolver=false) noexcept
 
MBool useTimeStepFromRestartFile () const
 Returns true if the time-step from a restart file should be reused. More...
 
MBool requiresTimeStepUpdate () const
 Returns true if the time-step should be updated on this step. More...
 
void setRestartFileOutputTimeStep ()
 
void computeSourceTerms ()
 
MFloat computeTimeStep (MInt cellId) const noexcept
 
MFloat computeTimeStepMethod (MInt cellId) const noexcept
 Computes the time-step of the cell cellId. More...
 
MFloat computeTimeStepEulerDirectional (MInt cellId) const noexcept
 
MFloat computeTimeStepApeDirectional (MInt cellId) const noexcept
 
MBool cellParticipatesInTimeStep (MInt cellId) const noexcept
 Does the cell cellId participate in the time-step computation? More...
 
MFloat computeTimeStepDiffusionNS (MFloat density, MFloat temperature, MFloat Re, MFloat C, MFloat dx) const noexcept
 
void computeAndSetTimeStep ()
 

Detailed Description

template<MInt nDim_, class SysEqn>
class FvCartesianSolverXD< nDim_, SysEqn >

Definition at line 197 of file fvcartesiansolverxd.h.

Member Typedef Documentation

◆ CartesianSolver

template<MInt nDim_, class SysEqn >
using FvCartesianSolverXD< nDim_, SysEqn >::CartesianSolver = typename maia::CartesianSolver<nDim, FvCartesianSolverXD>

Definition at line 253 of file fvcartesiansolverxd.h.

◆ Cell

template<MInt nDim_, class SysEqn >
using FvCartesianSolverXD< nDim_, SysEqn >::Cell = typename maia::grid::tree::Tree<nDim>::Cell

Definition at line 250 of file fvcartesiansolverxd.h.

◆ FvSurfaceCollector

Definition at line 251 of file fvcartesiansolverxd.h.

◆ Geom

template<MInt nDim_, class SysEqn >
using FvCartesianSolverXD< nDim_, SysEqn >::Geom = Geometry<nDim>

Definition at line 1379 of file fvcartesiansolverxd.h.

◆ Grid

template<MInt nDim_, class SysEqn >
using FvCartesianSolverXD< nDim_, SysEqn >::Grid = typename CartesianSolver::Grid

Definition at line 254 of file fvcartesiansolverxd.h.

◆ GridProxy

template<MInt nDim_, class SysEqn >
using FvCartesianSolverXD< nDim_, SysEqn >::GridProxy = typename CartesianSolver::GridProxy

Definition at line 255 of file fvcartesiansolverxd.h.

◆ PrimitiveVariables

template<MInt nDim_, class SysEqn >
using FvCartesianSolverXD< nDim_, SysEqn >::PrimitiveVariables = typename SysEqn::PrimitiveVariables

Definition at line 2076 of file fvcartesiansolverxd.h.

◆ Self

template<MInt nDim_, class SysEqn >
using FvCartesianSolverXD< nDim_, SysEqn >::Self = FvCartesianSolverXD<nDim, SysEqn>
private

Definition at line 243 of file fvcartesiansolverxd.h.

◆ SolverCell

template<MInt nDim_, class SysEqn >
using FvCartesianSolverXD< nDim_, SysEqn >::SolverCell = FvCell

Definition at line 252 of file fvcartesiansolverxd.h.

◆ Timers

template<MInt nDim_, class SysEqn >
using FvCartesianSolverXD< nDim_, SysEqn >::Timers = maia::fv::Timers_
protected

Definition at line 246 of file fvcartesiansolverxd.h.

Constructor & Destructor Documentation

◆ FvCartesianSolverXD() [1/2]

template<MInt nDim_, class SysEqn >
FvCartesianSolverXD< nDim_, SysEqn >::FvCartesianSolverXD ( )
delete

◆ FvCartesianSolverXD() [2/2]

template<MInt nDim_, class SysEqn >
FvCartesianSolverXD< nDim_, SysEqn >::FvCartesianSolverXD ( MInt  ,
MInt  ,
const MBool ,
maia::grid::Proxy< nDim_ > &  gridProxy_,
Geometry< nDim_ > &  geometry_,
const MPI_Comm  comm 
)

◆ ~FvCartesianSolverXD()

template<MInt nDim_, class SysEqn >
FvCartesianSolverXD< nDim_, SysEqn >::~FvCartesianSolverXD ( )
inline

Definition at line 320 of file fvcartesiansolverxd.h.

320 {
321 delete[] m_variablesName;
322 delete[] m_vorticityName;
323
324 delete m_fvBndryCnd;
325
327
328 RECORD_TIMER_STOP(m_timers[Timers::SolverType]);
329 }
const MChar ** m_variablesName
FvBndryCndXD< nDim_, SysEqn > * m_fvBndryCnd
const MChar ** m_vorticityName
std::array< MInt, Timers::_count > m_timers

Member Function Documentation

◆ a_alphaGas() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_alphaGas ( const MInt  cellId)
inline

Definition at line 1014 of file fvcartesiansolverxd.h.

1014{ return a_pvariable(cellId, PV->Y[0]); }
SysEqn::PrimitiveVariables * PV
MFloat & a_pvariable(const MInt cellId, const MInt varId)
Returns primitive variable v of the cell cellId for variables varId.

◆ a_alphaGas() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_alphaGas ( const MInt  cellId) const
inline

Definition at line 1012 of file fvcartesiansolverxd.h.

1012{ return a_pvariable(cellId, PV->Y[0]); }

◆ a_associatedBodyIds() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_associatedBodyIds ( const MInt  cellId,
const MInt  set 
)
inline

Definition at line 1045 of file fvcartesiansolverxd.h.

1045{ return m_associatedBodyIds[IDX_LSSETMB(cellId, set)]; }

◆ a_associatedBodyIds() [2/2]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_associatedBodyIds ( const MInt  cellId,
const MInt  set 
) const
inline

Definition at line 1048 of file fvcartesiansolverxd.h.

1048 {
1049 return m_associatedBodyIds[IDX_LSSETMB(cellId, set)];
1050 }

◆ a_avariable() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_avariable ( const MInt  cellId,
const MInt  varId 
)
inline

Definition at line 622 of file fvcartesiansolverxd.h.

622{ return m_cells.avariable(cellId, varId); }
maia::fv::collector::FvCellCollector< nDim > m_cells
Collector for FV cells.

◆ a_avariable() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_avariable ( const MInt  cellId,
const MInt  varId 
) const
inline

Definition at line 625 of file fvcartesiansolverxd.h.

625{ return m_cells.avariable(cellId, varId); }

◆ a_bndryCndId() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_bndryCndId ( MInt  bndryId)
inline

Definition at line 879 of file fvcartesiansolverxd.h.

879{ return m_bndryCells->a[bndryId].m_srfcs[0]->m_bndryCndId; }
Collector< FvBndryCell< nDim, SysEqn > > * m_bndryCells

◆ a_bndryCndId() [2/2]

template<MInt nDim_, class SysEqn >
const MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_bndryCndId ( MInt  bndryId) const
inline

Definition at line 882 of file fvcartesiansolverxd.h.

882{ return m_bndryCells->a[bndryId].m_srfcs[0]->m_bndryCndId; }

◆ a_bndryCutCoord() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_bndryCutCoord ( MInt  bndryId,
MInt  i,
MInt  j 
)
inline

Definition at line 893 of file fvcartesiansolverxd.h.

893 {
894 return m_bndryCells->a[bndryId].m_srfcs[0]->m_cutCoordinates[i][j];
895 }

◆ a_bndryCutCoord() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_bndryCutCoord ( MInt  bndryId,
MInt  i,
MInt  j 
) const
inline

Definition at line 898 of file fvcartesiansolverxd.h.

898 {
899 return m_bndryCells->a[bndryId].m_srfcs[0]->m_cutCoordinates[i][j];
900 }

◆ a_bndryGhostCellId()

template<MInt nDim_, class SysEqn >
const MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_bndryGhostCellId ( const MInt  bndryId,
const MInt  srfc 
) const
inline

Definition at line 903 of file fvcartesiansolverxd.h.

903 {
904 return m_bndryCells->a[bndryId].m_srfcVariables[srfc]->m_ghostCellId;
905 }

◆ a_bndryId() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_bndryId ( const MInt  cellId)
inline

Definition at line 672 of file fvcartesiansolverxd.h.

672{ return m_cells.bndryCellId(cellId); }

◆ a_bndryId() [2/2]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_bndryId ( const MInt  cellId) const
inline

Definition at line 675 of file fvcartesiansolverxd.h.

675{ return m_cells.bndryCellId(cellId); }

◆ a_bndryNormal() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_bndryNormal ( MInt  bndryId,
MInt  dir 
)
inline

Definition at line 885 of file fvcartesiansolverxd.h.

885{ return m_bndryCells->a[bndryId].m_srfcs[0]->m_normalVector[dir]; }

◆ a_bndryNormal() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_bndryNormal ( MInt  bndryId,
MInt  dir 
) const
inline

Definition at line 888 of file fvcartesiansolverxd.h.

888 {
889 return m_bndryCells->a[bndryId].m_srfcs[0]->m_normalVector[dir];
890 }

◆ a_cellVolume() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_cellVolume ( const MInt  cellId)
inline

Definition at line 437 of file fvcartesiansolverxd.h.

437{ return m_cells.cellVolume(cellId); }

◆ a_cellVolume() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_cellVolume ( const MInt  cellId) const
inline

Definition at line 440 of file fvcartesiansolverxd.h.

440{ return m_cells.cellVolume(cellId); }

◆ a_cfl() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_cfl ( )
inline

Definition at line 867 of file fvcartesiansolverxd.h.

867{ return m_cfl; }

◆ a_cfl() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_cfl ( ) const
inline

Definition at line 870 of file fvcartesiansolverxd.h.

870{ return m_cfl; }

◆ a_coordinate() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_coordinate ( const MInt  cellId,
const MInt  dir 
)
inline

Definition at line 425 of file fvcartesiansolverxd.h.

425{ return m_cells.coordinate(cellId, dir); }

◆ a_coordinate() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_coordinate ( const MInt  cellId,
const MInt  dir 
) const
inline

Definition at line 428 of file fvcartesiansolverxd.h.

428{ return m_cells.coordinate(cellId, dir); }

◆ a_copyPropertiesSolver()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::a_copyPropertiesSolver ( const MInt  fromCellId,
const MInt  toCellId 
)
inline

Definition at line 639 of file fvcartesiansolverxd.h.

639 {
640 m_cells.properties(toCellId) = m_cells.properties(fromCellId);
641 }

◆ a_curvatureG() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_curvatureG ( const MInt  cellId,
const MInt  set 
)
inline

Definition at line 1053 of file fvcartesiansolverxd.h.

1053{ return m_curvatureG[set][cellId]; }
std::vector< MFloat > * m_curvatureG
void const MInt cellId
Definition: collector.h:239

◆ a_curvatureG() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_curvatureG ( const MInt  cellId,
const MInt  set 
) const
inline

Definition at line 1056 of file fvcartesiansolverxd.h.

1056{ return m_curvatureG[set][cellId]; }

◆ a_cutCellLevel()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_cutCellLevel ( const MInt  cellId) const
inline

Definition at line 450 of file fvcartesiansolverxd.h.

450 {
451 if(!m_bndryLevelJumps) {
452 return maxRefinementLevel();
453 } else {
454 return a_level(cellId);
455 }
456 }
MInt & a_level(const MInt cellId)
Returns the level of the cell from the fvcellcollector cellId.

◆ a_dt1Variable() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_dt1Variable ( const MInt  cellId,
const MInt  varId 
)
inline

Definition at line 747 of file fvcartesiansolverxd.h.

747{ return m_cells.dt1Variable(cellId, varId); }

◆ a_dt1Variable() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_dt1Variable ( const MInt  cellId,
const MInt  varId 
) const
inline

Definition at line 750 of file fvcartesiansolverxd.h.

750{ return m_cells.dt1Variable(cellId, varId); }

◆ a_dt2Variable() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_dt2Variable ( const MInt  cellId,
const MInt  varId 
)
inline

Definition at line 753 of file fvcartesiansolverxd.h.

753{ return m_cells.dt2Variable(cellId, varId); }

◆ a_dt2Variable() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_dt2Variable ( const MInt  cellId,
const MInt  varId 
) const
inline

Definition at line 756 of file fvcartesiansolverxd.h.

756{ return m_cells.dt2Variable(cellId, varId); }

◆ a_dynViscosity()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_dynViscosity ( const MFloat  T) const
inline

Definition at line 995 of file fvcartesiansolverxd.h.

995{ return SUTHERLANDLAW(T); }

◆ a_externalSource() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_externalSource ( MInt  cellId,
MInt  var 
)
inline

Definition at line 968 of file fvcartesiansolverxd.h.

968{ return m_externalSource[cellId][var]; }

◆ a_externalSource() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_externalSource ( MInt  cellId,
MInt  var 
) const
inline

Definition at line 971 of file fvcartesiansolverxd.h.

971{ return m_externalSource[cellId][var]; }

◆ a_FcellVolume() [1/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_FcellVolume ( const MInt  cellId) const
inline

Definition at line 446 of file fvcartesiansolverxd.h.

446{ return m_cells.FcellVolume(cellId); }

◆ a_FcellVolume() [2/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_FcellVolume ( const MInt  cellId)
inlineoverridevirtual

Reimplemented from Solver.

Definition at line 443 of file fvcartesiansolverxd.h.

443{ return m_cells.FcellVolume(cellId); }

◆ a_flameSpeed() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_flameSpeed ( const MInt  cellId,
const MInt  set 
)
inline

Definition at line 1059 of file fvcartesiansolverxd.h.

1059{ return m_flameSpeedG[set][cellId]; }
std::vector< MFloat > * m_flameSpeedG

◆ a_flameSpeed() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_flameSpeed ( const MInt  cellId,
const MInt  set 
) const
inline

Definition at line 1062 of file fvcartesiansolverxd.h.

1062{ return m_flameSpeedG[set][cellId]; }

◆ a_gradUOtherPhase() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_gradUOtherPhase ( const MInt  cellId,
const MInt  uDir,
const MInt  gradDir 
)
inline

Definition at line 1028 of file fvcartesiansolverxd.h.

1028 {
1029 return m_EEGas.gradUOtherPhase[cellId][uDir + nDim * gradDir];
1030 }
struct FvCartesianSolverXD::@8 m_EEGas
static constexpr MInt nDim

◆ a_gradUOtherPhase() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_gradUOtherPhase ( const MInt  cellId,
const MInt  uDir,
const MInt  gradDir 
) const
inline

Definition at line 1024 of file fvcartesiansolverxd.h.

1024 {
1025 return m_EEGas.gradUOtherPhase[cellId][uDir + nDim * gradDir];
1026 }

◆ a_hasNeighbor()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_hasNeighbor ( const MInt  cellId,
const MInt  dir,
const MBool  assertNeighborState = true 
) const
inline

Definition at line 601 of file fvcartesiansolverxd.h.

601 {
602 assertValidGridCellId(cellId);
603 if(assertNeighborState) assertDeleteNeighbor(cellId, dir);
604 return grid().tree().hasNeighbor(cellId, dir);
605 }
void assertDeleteNeighbor(const MInt cellId, const MInt dir) const
Checks wether the cell cellId has a valid neighbor in direction dir.
void assertValidGridCellId(const MInt cellId) const
Cecks wether the cell cellId is an actual grid-cell.

◆ a_hasProperty() [1/3]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_hasProperty ( const MInt  cellId,
const Cell  p 
) const
inline

Definition at line 588 of file fvcartesiansolverxd.h.

588 {
589 assertValidGridCellId(cellId);
590 return grid().tree().hasProperty(cellId, p);
591 }

◆ a_hasProperty() [2/3]

template<MInt nDim_, class SysEqn >
maia::fv::cell::BitsetType::reference FvCartesianSolverXD< nDim_, SysEqn >::a_hasProperty ( const MInt  cellId,
const SolverCell  p 
)
inline

Definition at line 628 of file fvcartesiansolverxd.h.

628 {
629 return m_cells.hasProperty(cellId, p);
630 }

◆ a_hasProperty() [3/3]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_hasProperty ( const MInt  cellId,
const SolverCell  p 
) const
inline

Definition at line 633 of file fvcartesiansolverxd.h.

633{ return m_cells.hasProperty(cellId, p); }

◆ a_identNghbrId() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_identNghbrId ( MInt  nghbrId)
inline

Definition at line 908 of file fvcartesiansolverxd.h.

908{ return m_identNghbrIds[nghbrId]; }

◆ a_identNghbrId() [2/2]

template<MInt nDim_, class SysEqn >
const MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_identNghbrId ( MInt  nghbrId) const
inline

Definition at line 911 of file fvcartesiansolverxd.h.

911{ return m_identNghbrIds[nghbrId]; }

◆ a_implicitCoefficient() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_implicitCoefficient ( const MInt  cellId,
const MInt  coefId 
)
inline

Definition at line 735 of file fvcartesiansolverxd.h.

735 {
736 return m_cells.implicitCoefficient(cellId, coefId);
737 }

◆ a_implicitCoefficient() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_implicitCoefficient ( const MInt  cellId,
const MInt  coefId 
) const
inline

Definition at line 740 of file fvcartesiansolverxd.h.

740 {
741 return m_cells.implicitCoefficient(cellId, coefId);
742 }

◆ a_isActive()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isActive ( const MInt  cellId) const
inline

Definition at line 459 of file fvcartesiansolverxd.h.

459{ return a_hasProperty(cellId, SolverCell::IsActive); }
MBool a_hasProperty(const MInt cellId, const Cell p) const
Returns grid cell property p of the cell cellId.

◆ a_isBndryCell()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isBndryCell ( const MInt  cellId) const
inlineoverridevirtual

Reimplemented from Solver.

Definition at line 381 of file fvcartesiansolverxd.h.

381{ return (a_bndryId(cellId) >= 0); }
MInt & a_bndryId(const MInt cellId)
Returns the bndryId of the cell cellId.

◆ a_isBndryGhostCell() [1/2]

template<MInt nDim_, class SysEqn >
maia::fv::cell::BitsetType::reference FvCartesianSolverXD< nDim_, SysEqn >::a_isBndryGhostCell ( const MInt  cellId)
inline

Definition at line 395 of file fvcartesiansolverxd.h.

395 {
396 return m_cells.hasProperty(cellId, SolverCell::IsGhost);
397 }

◆ a_isBndryGhostCell() [2/2]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isBndryGhostCell ( const MInt  cellId) const
inlinevirtual

Reimplemented from Solver.

Definition at line 392 of file fvcartesiansolverxd.h.

392{ return m_cells.hasProperty(cellId, SolverCell::IsGhost); }

◆ a_isGapCell() [1/2]

template<MInt nDim_, class SysEqn >
maia::fv::cell::BitsetType::reference FvCartesianSolverXD< nDim_, SysEqn >::a_isGapCell ( const MInt  cellId)
inline

Definition at line 354 of file fvcartesiansolverxd.h.

354 {
355 return m_cells.hasProperty(cellId, SolverCell::IsGapCell);
356 }

◆ a_isGapCell() [2/2]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isGapCell ( const MInt  cellId) const
inline

Definition at line 352 of file fvcartesiansolverxd.h.

352{ return m_cells.hasProperty(cellId, SolverCell::IsGapCell); }

◆ a_isHalo() [1/2]

template<MInt nDim_, class SysEqn >
maia::fv::cell::BitsetType::reference FvCartesianSolverXD< nDim_, SysEqn >::a_isHalo ( const MInt  cellId)
inline

Definition at line 364 of file fvcartesiansolverxd.h.

364 {
365 return m_cells.hasProperty(cellId, SolverCell::IsHalo);
366 }

◆ a_isHalo() [2/2]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isHalo ( const MInt  cellId) const
inline

Definition at line 362 of file fvcartesiansolverxd.h.

362{ return m_cells.hasProperty(cellId, SolverCell::IsHalo); }

◆ a_isInactive()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isInactive ( const MInt  cellId) const
inline

Definition at line 458 of file fvcartesiansolverxd.h.

458{ return a_hasProperty(cellId, SolverCell::IsInactive); }

◆ a_isInterface() [1/2]

template<MInt nDim_, class SysEqn >
maia::fv::cell::BitsetType::reference FvCartesianSolverXD< nDim_, SysEqn >::a_isInterface ( const MInt  cellId)
inline

Definition at line 387 of file fvcartesiansolverxd.h.

387 {
388 return m_cells.hasProperty(cellId, SolverCell::IsInterface);
389 }

◆ a_isInterface() [2/2]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isInterface ( const MInt  cellId) const
inline

Definition at line 384 of file fvcartesiansolverxd.h.

384{ return m_cells.hasProperty(cellId, SolverCell::IsInterface); }

◆ a_isPeriodic() [1/2]

template<MInt nDim_, class SysEqn >
maia::fv::cell::BitsetType::reference FvCartesianSolverXD< nDim_, SysEqn >::a_isPeriodic ( const MInt  cellId)
inline

Definition at line 376 of file fvcartesiansolverxd.h.

376 {
377 return m_cells.hasProperty(cellId, SolverCell::IsPeriodic);
378 }

◆ a_isPeriodic() [2/2]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isPeriodic ( const MInt  cellId) const
inline

Definition at line 374 of file fvcartesiansolverxd.h.

374{ return m_cells.hasProperty(cellId, SolverCell::IsPeriodic); }

◆ a_isSandpaperTripCell() [1/2]

template<MInt nDim_, class SysEqn >
maia::fv::cell::BitsetType::reference FvCartesianSolverXD< nDim_, SysEqn >::a_isSandpaperTripCell ( const MInt  cellId)
inline

Definition at line 411 of file fvcartesiansolverxd.h.

411 {
412 return m_cells.hasProperty(cellId, SolverCell::IsSandpaperTripCell);
413 }

◆ a_isSandpaperTripCell() [2/2]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isSandpaperTripCell ( const MInt  cellId) const
inline

Definition at line 407 of file fvcartesiansolverxd.h.

407 {
408 return m_cells.hasProperty(cellId, SolverCell::IsSandpaperTripCell);
409 }

◆ a_isSplitCell()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isSplitCell ( const MInt  cellId) const
inline

Definition at line 460 of file fvcartesiansolverxd.h.

460{ return a_hasProperty(cellId, SolverCell::IsSplitCell); }

◆ a_isWindow() [1/2]

template<MInt nDim_, class SysEqn >
maia::fv::cell::BitsetType::reference FvCartesianSolverXD< nDim_, SysEqn >::a_isWindow ( const MInt  cellId)
inline

Definition at line 370 of file fvcartesiansolverxd.h.

370 {
371 return m_cells.hasProperty(cellId, SolverCell::IsWindow);
372 }

◆ a_isWindow() [2/2]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isWindow ( const MInt  cellId) const
inline

Definition at line 368 of file fvcartesiansolverxd.h.

368{ return m_cells.hasProperty(cellId, SolverCell::IsWindow); }

◆ a_isWMImgCell() [1/2]

template<MInt nDim_, class SysEqn >
maia::fv::cell::BitsetType::reference FvCartesianSolverXD< nDim_, SysEqn >::a_isWMImgCell ( const MInt  cellId)
inline

Definition at line 402 of file fvcartesiansolverxd.h.

402 {
403 return m_cells.hasProperty(cellId, SolverCell::IsWMImgCell);
404 }

◆ a_isWMImgCell() [2/2]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::a_isWMImgCell ( const MInt  cellId) const
inline

Definition at line 400 of file fvcartesiansolverxd.h.

400{ return m_cells.hasProperty(cellId, SolverCell::IsWMImgCell); }

◆ a_level() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_level ( const MInt  cellId)
inline

Definition at line 431 of file fvcartesiansolverxd.h.

431{ return m_cells.level(cellId); }

◆ a_level() [2/2]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_level ( const MInt  cellId) const
inline

Definition at line 434 of file fvcartesiansolverxd.h.

434{ return m_cells.level(cellId); }

◆ a_levelSetFunction() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_levelSetFunction ( const MInt  cellId,
const MInt  set 
)
inline

Definition at line 999 of file fvcartesiansolverxd.h.

999{ return m_levelSetValues[set][cellId]; }
std::vector< MFloat > * m_levelSetValues

◆ a_levelSetFunction() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_levelSetFunction ( const MInt  cellId,
const MInt  set 
) const
inline

Definition at line 1002 of file fvcartesiansolverxd.h.

1002{ return m_levelSetValues[set][cellId]; }

◆ a_levelSetValuesMb() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_levelSetValuesMb ( const MInt  cellId,
const MInt  set 
)
inline

Definition at line 1005 of file fvcartesiansolverxd.h.

1005{ return m_levelSetValuesMb[IDX_LSSETMB(cellId, set)]; }

◆ a_levelSetValuesMb() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_levelSetValuesMb ( const MInt  cellId,
const MInt  set 
) const
inline

Definition at line 1008 of file fvcartesiansolverxd.h.

1008 {
1009 return m_levelSetValuesMb[IDX_LSSETMB(cellId, set)];
1010 }

◆ a_localTimeStep() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_localTimeStep ( const MInt  cellId)
inline

Definition at line 986 of file fvcartesiansolverxd.h.

986 {
987 return m_cells.localTimeStep(cellId);
988 }

◆ a_localTimeStep() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_localTimeStep ( const MInt  cellId) const
inline

Definition at line 991 of file fvcartesiansolverxd.h.

991 {
992 return m_cells.localTimeStep(cellId);
993 }

◆ a_Ma() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_Ma ( )
inline

Definition at line 861 of file fvcartesiansolverxd.h.

861{ return m_Ma; }
MFloat m_Ma
the Mach number
Definition: solver.h:71

◆ a_Ma() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_Ma ( ) const
inline

Definition at line 864 of file fvcartesiansolverxd.h.

864{ return m_Ma; }

◆ a_maxLevelHaloCells() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_maxLevelHaloCells ( MInt  domain,
MInt  id 
)
inline

Definition at line 980 of file fvcartesiansolverxd.h.

980{ return m_maxLevelHaloCells[domain][id]; }
MInt id
Definition: maiatypes.h:71

◆ a_maxLevelHaloCells() [2/2]

template<MInt nDim_, class SysEqn >
const MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_maxLevelHaloCells ( MInt  domain,
MInt  id 
) const
inline

Definition at line 983 of file fvcartesiansolverxd.h.

983{ return m_maxLevelHaloCells[domain][id]; }

◆ a_maxLevelWindowCells() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_maxLevelWindowCells ( MInt  domain,
MInt  id 
)
inline

Definition at line 974 of file fvcartesiansolverxd.h.

974{ return m_maxLevelWindowCells[domain][id]; }

◆ a_maxLevelWindowCells() [2/2]

template<MInt nDim_, class SysEqn >
const MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_maxLevelWindowCells ( MInt  domain,
MInt  id 
) const
inline

Definition at line 977 of file fvcartesiansolverxd.h.

977{ return m_maxLevelWindowCells[domain][id]; }

◆ a_noCells()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_noCells ( ) const
inline

Definition at line 336 of file fvcartesiansolverxd.h.

336 {
337#ifndef NDEBUG
338 MInt noCells_solver = m_cells.size();
339 MInt noCells_grid = grid().tree().size() + m_totalnosplitchilds + m_totalnoghostcells;
340 ASSERT(noCells_solver == noCells_grid,
341 "Warning, noCells differ: grid " << noCells_grid << ", solver " << noCells_solver << "no-split-childs "
343 << "no-boundary-ghost-cells: " << m_totalnoghostcells << std::endl);
344 // ASSERT(c_noCells() == grid().m_noRegularCells, "ERROR in Cell-count");
345#endif
346 return m_cells.size();
347 }
int32_t MInt
Definition: maiatypes.h:62

◆ a_noLevelSetFieldData() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_noLevelSetFieldData ( )
inline

Definition at line 1071 of file fvcartesiansolverxd.h.

◆ a_noLevelSetFieldData() [2/2]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_noLevelSetFieldData ( ) const
inline

Definition at line 1074 of file fvcartesiansolverxd.h.

1074{ return m_noLevelSetFieldData; }

◆ a_noPart() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_noPart ( MInt  cellId)
inline

Definition at line 950 of file fvcartesiansolverxd.h.

950{ return m_noParts[cellId]; }

◆ a_noPart() [2/2]

template<MInt nDim_, class SysEqn >
const MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_noPart ( MInt  cellId) const
inline

Definition at line 965 of file fvcartesiansolverxd.h.

965{ return m_noParts[cellId]; }

◆ a_noReconstructionNeighbors() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_noReconstructionNeighbors ( const MInt  cellId)
inline

Definition at line 678 of file fvcartesiansolverxd.h.

678{ return m_cells.noRcnstrctnNghbrIds(cellId); }

◆ a_noReconstructionNeighbors() [2/2]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_noReconstructionNeighbors ( const MInt  cellId) const
inline

Definition at line 681 of file fvcartesiansolverxd.h.

681{ return m_cells.noRcnstrctnNghbrIds(cellId); }

◆ a_noSets() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_noSets ( )
inline

Definition at line 1065 of file fvcartesiansolverxd.h.

1065{ return m_noSets; }

◆ a_noSets() [2/2]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_noSets ( ) const
inline

Definition at line 1068 of file fvcartesiansolverxd.h.

1068{ return m_noSets; }

◆ a_noSplitCells()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_noSplitCells ( ) const
inline

Definition at line 462 of file fvcartesiansolverxd.h.

462{ return m_splitCells.size(); }
std::vector< MInt > m_splitCells

◆ a_noSplitChilds()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_noSplitChilds ( const MInt  sc) const
inline

Definition at line 463 of file fvcartesiansolverxd.h.

463{ return m_splitChilds[sc].size(); }
std::vector< std::vector< MInt > > m_splitChilds

◆ a_noSurfaces()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_noSurfaces ( )
inline

Definition at line 793 of file fvcartesiansolverxd.h.

793{ return m_surfaces.size(); }
FvSurfaceCollector m_surfaces
constexpr MInt size() const
Return size (i.e., currently used number of nodes)
Definition: container.h:89

◆ a_nuEffOtherPhase() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_nuEffOtherPhase ( const MInt  cellId)
inline

Definition at line 1042 of file fvcartesiansolverxd.h.

1042{ return m_EEGas.nuEffOtherPhase[cellId]; }

◆ a_nuEffOtherPhase() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_nuEffOtherPhase ( const MInt  cellId) const
inline

Definition at line 1040 of file fvcartesiansolverxd.h.

1040{ return m_EEGas.nuEffOtherPhase[cellId]; }

◆ a_nuTOtherPhase() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_nuTOtherPhase ( const MInt  cellId)
inline

Definition at line 1038 of file fvcartesiansolverxd.h.

1038{ return m_EEGas.nuTOtherPhase[cellId]; }

◆ a_nuTOtherPhase() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_nuTOtherPhase ( const MInt  cellId) const
inline

Definition at line 1036 of file fvcartesiansolverxd.h.

1036{ return m_EEGas.nuTOtherPhase[cellId]; }

◆ a_oldVariable() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_oldVariable ( const MInt  cellId,
const MInt  varId 
)
inline

Definition at line 759 of file fvcartesiansolverxd.h.

759{ return m_cells.oldVariable(cellId, varId); }

◆ a_oldVariable() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_oldVariable ( const MInt  cellId,
const MInt  varId 
) const
inline

Definition at line 762 of file fvcartesiansolverxd.h.

762{ return m_cells.oldVariable(cellId, varId); }

◆ a_physicalTime() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_physicalTime ( )
inline

Definition at line 953 of file fvcartesiansolverxd.h.

953{ return m_physicalTime; }

◆ a_physicalTime() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_physicalTime ( ) const
inline

Definition at line 956 of file fvcartesiansolverxd.h.

956{ return m_physicalTime; }

◆ a_PInfinity() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_PInfinity ( )
inline

Definition at line 932 of file fvcartesiansolverxd.h.

932{ return m_PInfinity; }

◆ a_PInfinity() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_PInfinity ( ) const
inline

Definition at line 935 of file fvcartesiansolverxd.h.

935{ return m_PInfinity; }

◆ a_properties()

template<MInt nDim_, class SysEqn >
maia::fv::cell::BitsetType & FvCartesianSolverXD< nDim_, SysEqn >::a_properties ( const MInt  cellId)
inline

Definition at line 416 of file fvcartesiansolverxd.h.

416{ return m_cells.properties(cellId); }

◆ a_psi() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_psi ( const MInt  cellId)
inline

Definition at line 720 of file fvcartesiansolverxd.h.

720{ return m_cells.psi(cellId); }

◆ a_psi() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_psi ( const MInt  cellId) const
inline

Definition at line 723 of file fvcartesiansolverxd.h.

723{ return m_cells.psi(cellId); }

◆ a_pvariable() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_pvariable ( const MInt  cellId,
const MInt  varId 
)
inline

Definition at line 616 of file fvcartesiansolverxd.h.

616{ return m_cells.pvariable(cellId, varId); }

◆ a_pvariable() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_pvariable ( const MInt  cellId,
const MInt  varId 
) const
inline

Definition at line 619 of file fvcartesiansolverxd.h.

619{ return m_cells.pvariable(cellId, varId); }

◆ a_reactionRate() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_reactionRate ( const MInt  cellId,
const MInt  reactionId 
)
inline

Definition at line 702 of file fvcartesiansolverxd.h.

702{ return m_cells.reactionRate(cellId, reactionId); }

◆ a_reactionRate() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_reactionRate ( const MInt  cellId,
const MInt  reactionId 
) const
inline

Definition at line 705 of file fvcartesiansolverxd.h.

705 {
706 return m_cells.reactionRate(cellId, reactionId);
707 }

◆ a_reactionRateBackup() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_reactionRateBackup ( const MInt  cellId,
const MInt  reactionId 
)
inline

Definition at line 710 of file fvcartesiansolverxd.h.

710 {
711 return m_cells.reactionRateBackup(cellId, reactionId);
712 }

◆ a_reactionRateBackup() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_reactionRateBackup ( const MInt  cellId,
const MInt  reactionId 
) const
inline

Definition at line 715 of file fvcartesiansolverxd.h.

715 {
716 return m_cells.reactionRateBackup(cellId, reactionId);
717 }

◆ a_reconstructionData()

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_reconstructionData ( const MInt  cellId)
inline

Definition at line 654 of file fvcartesiansolverxd.h.

654{ return m_cells.reconstructionData(cellId); }

◆ a_reconstructionNeighborId() [1/3]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_reconstructionNeighborId ( const MInt  cellId) const
inline

Definition at line 657 of file fvcartesiansolverxd.h.

657{ return m_cells.reconstructionData(cellId); }

◆ a_reconstructionNeighborId() [2/3]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_reconstructionNeighborId ( const MInt  cellId,
const MInt  nghbrNo 
)
inline

Definition at line 644 of file fvcartesiansolverxd.h.

644 {
645 return m_cells.rcnstrctnNghbrId(cellId, nghbrNo);
646 }

◆ a_reconstructionNeighborId() [3/3]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_reconstructionNeighborId ( const MInt  cellId,
const MInt  nghbrNo 
) const
inline

Definition at line 649 of file fvcartesiansolverxd.h.

649 {
650 return m_cells.rcnstrctnNghbrId(cellId, nghbrNo);
651 }

◆ a_resetPropertiesSolver()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::a_resetPropertiesSolver ( const MInt  cellId)
inline

Definition at line 636 of file fvcartesiansolverxd.h.

636{ m_cells.resetProperties(cellId); }

◆ a_restartInterval() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_restartInterval ( )
inline

Definition at line 873 of file fvcartesiansolverxd.h.

873{ return m_restartInterval; }
MInt m_restartInterval
The number of timesteps before writing the next restart file.
Definition: solver.h:79

◆ a_restartInterval() [2/2]

template<MInt nDim_, class SysEqn >
const MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_restartInterval ( ) const
inline

Definition at line 876 of file fvcartesiansolverxd.h.

876{ return m_restartInterval; }

◆ a_restrictedRHS() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_restrictedRHS ( const MInt  cellId,
const MInt  varId 
)
inline

Definition at line 690 of file fvcartesiansolverxd.h.

690{ return m_cells.restrictedRHS(cellId, varId); }

◆ a_restrictedRHS() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_restrictedRHS ( const MInt  cellId,
const MInt  varId 
) const
inline

Definition at line 693 of file fvcartesiansolverxd.h.

693{ return m_cells.restrictedRHS(cellId, varId); }

◆ a_restrictedVar() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_restrictedVar ( const MInt  cellId,
const MInt  varId 
)
inline

Definition at line 696 of file fvcartesiansolverxd.h.

696{ return m_cells.restrictedVar(cellId, varId); }

◆ a_restrictedVar() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_restrictedVar ( const MInt  cellId,
const MInt  varId 
) const
inline

Definition at line 699 of file fvcartesiansolverxd.h.

699{ return m_cells.restrictedVar(cellId, varId); }

◆ a_rhoInfinity() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_rhoInfinity ( )
inline

Definition at line 926 of file fvcartesiansolverxd.h.

926{ return m_rhoInfinity; }

◆ a_rhoInfinity() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_rhoInfinity ( ) const
inline

Definition at line 929 of file fvcartesiansolverxd.h.

929{ return m_rhoInfinity; }

◆ a_rightHandSide() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_rightHandSide ( const MInt  cellId,
MInt const  varId 
)
inline

Definition at line 785 of file fvcartesiansolverxd.h.

785{ return m_cells.rightHandSide(cellId, varId); }

◆ a_rightHandSide() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_rightHandSide ( const MInt  cellId,
MInt const  varId 
) const
inline

Definition at line 788 of file fvcartesiansolverxd.h.

788{ return m_cells.rightHandSide(cellId, varId); }

◆ a_slope() [1/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_slope ( const MInt  cellId,
MInt const  varId,
const MInt  dir 
) const
inline

Definition at line 770 of file fvcartesiansolverxd.h.

770 {
771 return m_cells.slope(cellId, varId, dir);
772 }

◆ a_slope() [2/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_slope ( const MInt  cellId,
MInt const  varId,
const MInt  dir 
)
inlineoverridevirtual

Reimplemented from Solver.

Definition at line 765 of file fvcartesiansolverxd.h.

765 {
766 return m_cells.slope(cellId, varId, dir);
767 }

◆ a_speciesReactionRate() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_speciesReactionRate ( const MInt  cellId,
const MInt  speciesIndex 
)
inline

Definition at line 726 of file fvcartesiansolverxd.h.

726 {
727 return m_cells.speciesReactionRate(cellId, speciesIndex);
728 }

◆ a_speciesReactionRate() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_speciesReactionRate ( const MInt  cellId,
const MInt  speciesIndex 
) const
inline

Definition at line 730 of file fvcartesiansolverxd.h.

730 {
731 return m_cells.speciesReactionRate(cellId, speciesIndex);
732 }

◆ a_splitCellId()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_splitCellId ( const MInt  sc) const
inline

Definition at line 465 of file fvcartesiansolverxd.h.

465{ return m_splitCells[sc]; }

◆ a_splitChildId()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_splitChildId ( const MInt  sc,
const MInt  ssc 
)
inline

Definition at line 464 of file fvcartesiansolverxd.h.

464{ return m_splitChilds[sc][ssc]; }

◆ a_spongeBndryId() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_spongeBndryId ( const MInt  cellId,
const MInt  dir 
)
inline

Definition at line 660 of file fvcartesiansolverxd.h.

660{ return m_cells.spongeBndryId(cellId, dir); }

◆ a_spongeBndryId() [2/2]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_spongeBndryId ( const MInt  cellId,
const MInt  dir 
) const
inline

Definition at line 663 of file fvcartesiansolverxd.h.

663{ return m_cells.spongeBndryId(cellId, dir); }

◆ a_spongeFactor() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_spongeFactor ( const MInt  cellId)
inline

Definition at line 419 of file fvcartesiansolverxd.h.

419{ return m_cells.spongeFactor(cellId); }

◆ a_spongeFactor() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_spongeFactor ( const MInt  cellId) const
inline

Definition at line 422 of file fvcartesiansolverxd.h.

422{ return m_cells.spongeFactor(cellId); }

◆ a_spongeFactorStart() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_spongeFactorStart ( const MInt  cellId)
inline

Definition at line 666 of file fvcartesiansolverxd.h.

666{ return m_cells.spongeFactorStart(cellId); }

◆ a_spongeFactorStart() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_spongeFactorStart ( const MInt  cellId) const
inline

Definition at line 669 of file fvcartesiansolverxd.h.

669{ return m_cells.spongeFactorStart(cellId); }

◆ a_storedSlope() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_storedSlope ( const MInt  cellId,
MInt const  varId,
const MInt  dir 
)
inline

Definition at line 775 of file fvcartesiansolverxd.h.

775 {
776 return m_cells.storedSlope(cellId, varId, dir);
777 }

◆ a_storedSlope() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_storedSlope ( const MInt  cellId,
MInt const  varId,
const MInt  dir 
) const
inline

Definition at line 780 of file fvcartesiansolverxd.h.

780 {
781 return m_cells.storedSlope(cellId, varId, dir);
782 }

◆ a_storeNghbrId() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_storeNghbrId ( MInt  nghbrId)
inline

Definition at line 914 of file fvcartesiansolverxd.h.

914{ return m_storeNghbrIds[nghbrId]; }

◆ a_storeNghbrId() [2/2]

template<MInt nDim_, class SysEqn >
const MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_storeNghbrId ( MInt  nghbrId) const
inline

Definition at line 917 of file fvcartesiansolverxd.h.

917{ return m_storeNghbrIds[nghbrId]; }

◆ a_surfaceArea() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceArea ( const MInt  srfcId)
inline

Definition at line 806 of file fvcartesiansolverxd.h.

806{ return m_surfaces.area(srfcId); }
MFloat & area(const MInt id)
Accessor for area.

◆ a_surfaceArea() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceArea ( const MInt  srfcId) const
inline

Definition at line 808 of file fvcartesiansolverxd.h.

808{ return m_surfaces.area(srfcId); }

◆ a_surfaceBndryCndId() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceBndryCndId ( const MInt  srfcId)
inline

Definition at line 796 of file fvcartesiansolverxd.h.

796{ return m_surfaces.bndryCndId(srfcId); }
MInt & bndryCndId(const MInt id)
Accessor for bndryCndId.

◆ a_surfaceBndryCndId() [2/2]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceBndryCndId ( const MInt  srfcId) const
inline

Definition at line 798 of file fvcartesiansolverxd.h.

798{ return m_surfaces.bndryCndId(srfcId); }

◆ a_surfaceCoefficient() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceCoefficient ( const MInt  srfcId,
const MInt  dimCoefficient 
)
inline

Definition at line 845 of file fvcartesiansolverxd.h.

845 {
846 return m_surfaces.surfaceCoefficient(srfcId, dimCoefficient);
847 }
MFloat & surfaceCoefficient(const MInt id, const MInt dimCoefficient)
Accessor for surfaceCoefficient.

◆ a_surfaceCoefficient() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceCoefficient ( const MInt  srfcId,
const MInt  dimCoefficient 
) const
inline

Definition at line 849 of file fvcartesiansolverxd.h.

849 {
850 return m_surfaces.surfaceCoefficient(srfcId, dimCoefficient);
851 }

◆ a_surfaceCoordinate() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceCoordinate ( const MInt  srfcId,
const MInt  dir 
)
inline

Definition at line 816 of file fvcartesiansolverxd.h.

816{ return m_surfaces.coordinate(srfcId, dir); }
MFloat & coordinate(const MInt id, const MInt dir)
Accessor for coordinate.

◆ a_surfaceCoordinate() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceCoordinate ( const MInt  srfcId,
const MInt  dir 
) const
inline

Definition at line 818 of file fvcartesiansolverxd.h.

818{ return m_surfaces.coordinate(srfcId, dir); }

◆ a_surfaceDeltaX() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceDeltaX ( const MInt  srfcId,
const MInt  varId 
)
inline

Definition at line 821 of file fvcartesiansolverxd.h.

821{ return m_surfaces.deltaX(srfcId, varId); }
MFloat & deltaX(const MInt id, const MInt varId)
Accessor for deltaX.

◆ a_surfaceDeltaX() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceDeltaX ( const MInt  srfcId,
const MInt  varId 
) const
inline

Definition at line 823 of file fvcartesiansolverxd.h.

823{ return m_surfaces.deltaX(srfcId, varId); }

◆ a_surfaceFactor() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceFactor ( const MInt  srfcId,
const MInt  varId 
)
inline

Definition at line 811 of file fvcartesiansolverxd.h.

811{ return m_surfaces.factor(srfcId, varId); }
MFloat & factor(const MInt id, const MInt varId)
Accessor for factor.

◆ a_surfaceFactor() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceFactor ( const MInt  srfcId,
const MInt  varId 
) const
inline

Definition at line 813 of file fvcartesiansolverxd.h.

813{ return m_surfaces.factor(srfcId, varId); }

◆ a_surfaceFlux()

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceFlux ( const MInt  srfcId,
const MInt  fVarId 
)
inline

Definition at line 854 of file fvcartesiansolverxd.h.

854{ return m_surfaces.flux(srfcId, fVarId); }
MFloat & flux(const MInt id, const MInt fVarId)
Accessor for flux.

◆ a_surfaceflux()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceflux ( const MInt  srfcId,
const MInt  fVarId 
) const
inline

Definition at line 856 of file fvcartesiansolverxd.h.

856{ return m_surfaces.flux(srfcId, fVarId); }

◆ a_surfaceNghbrCellId() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceNghbrCellId ( const MInt  srfcId,
const MInt  dir 
)
inline

Definition at line 826 of file fvcartesiansolverxd.h.

826{ return m_surfaces.nghbrCellId(srfcId, dir); }
MInt & nghbrCellId(const MInt id, const MInt dir)
Accessor for nghbrCellId.

◆ a_surfaceNghbrCellId() [2/2]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceNghbrCellId ( const MInt  srfcId,
const MInt  dir 
) const
inline

Definition at line 828 of file fvcartesiansolverxd.h.

828{ return m_surfaces.nghbrCellId(srfcId, dir); }

◆ a_surfaceOrientation() [1/2]

template<MInt nDim_, class SysEqn >
MInt & FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceOrientation ( const MInt  srfcId)
inline

Definition at line 801 of file fvcartesiansolverxd.h.

801{ return m_surfaces.orientation(srfcId); }
MInt & orientation(const MInt id)
Accessor for orientation.

◆ a_surfaceOrientation() [2/2]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceOrientation ( const MInt  srfcId) const
inline

Definition at line 803 of file fvcartesiansolverxd.h.

803{ return m_surfaces.orientation(srfcId); }

◆ a_surfaceUpwindCoefficient() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceUpwindCoefficient ( const MInt  srfcId)
inline

Definition at line 840 of file fvcartesiansolverxd.h.

840{ return m_surfaces.upwindCoefficient(srfcId); }
MFloat & upwindCoefficient(const MInt id)
Accessor for upwind coefficient.

◆ a_surfaceUpwindCoefficient() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceUpwindCoefficient ( const MInt  srfcId) const
inline

Definition at line 842 of file fvcartesiansolverxd.h.

842{ return m_surfaces.upwindCoefficient(srfcId); }

◆ a_surfaceVariable() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceVariable ( const MInt  srfcId,
const MInt  dir,
const MInt  varId 
)
inline

Definition at line 831 of file fvcartesiansolverxd.h.

831 {
832 return m_surfaces.variable(srfcId, dir, varId);
833 }
MFloat & variable(const MInt id, const MInt dir, const MInt varId)
Accessor for variable.

◆ a_surfaceVariable() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_surfaceVariable ( const MInt  srfcId,
const MInt  dir,
const MInt  varId 
) const
inline

Definition at line 835 of file fvcartesiansolverxd.h.

835 {
836 return m_surfaces.variable(srfcId, dir, varId);
837 }

◆ a_tau() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_tau ( const MInt  cellId,
const MInt  varId 
)
inline

Definition at line 684 of file fvcartesiansolverxd.h.

684{ return m_cells.tau(cellId, varId); }

◆ a_tau() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_tau ( const MInt  cellId,
const MInt  varId 
) const
inline

Definition at line 687 of file fvcartesiansolverxd.h.

687{ return m_cells.tau(cellId, varId); }

◆ a_time() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_time ( )
inline

Definition at line 959 of file fvcartesiansolverxd.h.

959{ return m_time; }

◆ a_time() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_time ( ) const
inline

Definition at line 962 of file fvcartesiansolverxd.h.

962{ return m_time; }

◆ a_timeRef() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_timeRef ( )
inline

Definition at line 944 of file fvcartesiansolverxd.h.

944{ return m_timeRef; }

◆ a_timeRef() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_timeRef ( ) const
inline

Definition at line 947 of file fvcartesiansolverxd.h.

947{ return m_timeRef; }

◆ a_timeStepComputationInterval()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::a_timeStepComputationInterval ( )
inline

Definition at line 2549 of file fvcartesiansolverxd.h.

MInt m_timeStepComputationInterval
How often should the time-step be recomputed?

◆ a_TInfinity() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_TInfinity ( )
inline

Definition at line 938 of file fvcartesiansolverxd.h.

938{ return m_TInfinity; }

◆ a_TInfinity() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_TInfinity ( ) const
inline

Definition at line 941 of file fvcartesiansolverxd.h.

941{ return m_TInfinity; }

◆ a_uOtherPhase() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_uOtherPhase ( const MInt  cellId,
const MInt  dir 
)
inline

Definition at line 1018 of file fvcartesiansolverxd.h.

1018{ return m_EEGas.uOtherPhase[cellId][dir]; }

◆ a_uOtherPhase() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_uOtherPhase ( const MInt  cellId,
const MInt  dir 
) const
inline

Definition at line 1016 of file fvcartesiansolverxd.h.

1016{ return m_EEGas.uOtherPhase[cellId][dir]; }

◆ a_uOtherPhaseOld() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_uOtherPhaseOld ( const MInt  cellId,
const MInt  dir 
)
inline

Definition at line 1022 of file fvcartesiansolverxd.h.

1022{ return m_EEGas.uOtherPhaseOld[cellId][dir]; }

◆ a_uOtherPhaseOld() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_uOtherPhaseOld ( const MInt  cellId,
const MInt  dir 
) const
inline

Definition at line 1020 of file fvcartesiansolverxd.h.

1020{ return m_EEGas.uOtherPhaseOld[cellId][dir]; }

◆ a_variable() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_variable ( const MInt  cellId,
const MInt  varId 
)
inline

Definition at line 610 of file fvcartesiansolverxd.h.

610{ return m_cells.variable(cellId, varId); }

◆ a_variable() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_variable ( const MInt  cellId,
const MInt  varId 
) const
inline

Definition at line 613 of file fvcartesiansolverxd.h.

613{ return m_cells.variable(cellId, varId); }

◆ a_vortOtherPhase() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_vortOtherPhase ( const MInt  cellId,
const MInt  dir 
)
inline

Definition at line 1034 of file fvcartesiansolverxd.h.

1034{ return m_EEGas.vortOtherPhase[cellId][dir]; }

◆ a_vortOtherPhase() [2/2]

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::a_vortOtherPhase ( const MInt  cellId,
const MInt  dir 
) const
inline

Definition at line 1032 of file fvcartesiansolverxd.h.

1032{ return m_EEGas.vortOtherPhase[cellId][dir]; }

◆ a_VVInfinity() [1/2]

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_VVInfinity ( MInt  dir)
inline

Definition at line 920 of file fvcartesiansolverxd.h.

920{ return m_VVInfinity[dir]; }

◆ a_VVInfinity() [2/2]

template<MInt nDim_, class SysEqn >
const MFloat & FvCartesianSolverXD< nDim_, SysEqn >::a_VVInfinity ( MInt  dir) const
inline

Definition at line 923 of file fvcartesiansolverxd.h.

923{ return m_VVInfinity[dir]; }

◆ a_wasGapCell()

template<MInt nDim_, class SysEqn >
maia::fv::cell::BitsetType::reference FvCartesianSolverXD< nDim_, SysEqn >::a_wasGapCell ( const MInt  cellId)
inline

Definition at line 358 of file fvcartesiansolverxd.h.

358 {
359 return m_cells.hasProperty(cellId, SolverCell::WasGapCell);
360 }

◆ adaptationTrigger()

template<MInt nDim_, class SysEqn >
virtual MBool FvCartesianSolverXD< nDim_, SysEqn >::adaptationTrigger ( )
inlinevirtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 2406 of file fvcartesiansolverxd.h.

2406{ return false; }

◆ addSpeciesReactionRatesAndHeatRelease()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::addSpeciesReactionRatesAndHeatRelease

Definition at line 477 of file fvcartesiansolverxd.cpp.

477 {
478 const MUint noSpecies = m_noSpecies;
479
481
482 for(MInt cellId = 0; cellId < a_noCells(); ++cellId) {
483 if(a_isBndryGhostCell(cellId)) continue;
484 if(a_isHalo(cellId)) continue;
485
486 const MFloat dampeningFactor = m_heatReleaseDamp ? m_dampFactor[cellId] : F1;
487
488 // Add species reaction rates to species transport equation
489 for(MUint s = 0; s < noSpecies; ++s) {
490 a_rightHandSide(cellId, CV->RHO_Y[s]) -=
491 dampeningFactor * a_cellVolume(cellId) * a_speciesReactionRate(cellId, s);
492 }
493
494 a_rightHandSide(cellId, CV->RHO_E) -= a_cellVolume(cellId) * m_heatRelease[cellId];
495 }
496}
std::vector< MFloat > m_dampFactor
MFloat & a_rightHandSide(const MInt cellId, MInt const varId)
Returns the right hand side of the cell cellId for the variable varId.
MFloat & a_speciesReactionRate(const MInt cellId, const MInt speciesIndex)
MBool a_isHalo(const MInt cellId) const
Returns IsHalo of the cell cellId.
void calculateHeatRelease()
calculates heatRelease, currently used for postprocessing (average_in)
SysEqn::ConservativeVariables * CV
MInt a_noCells() const
Returns the number of cells.
MBool a_isBndryGhostCell(const MInt cellId) const
Returns isBndryGhostCell of the cell cellId.
MFloat & a_cellVolume(const MInt cellId)
Returns the cell volume of the cell from the fvcellcollector cellId.
uint32_t MUint
Definition: maiatypes.h:63
double MFloat
Definition: maiatypes.h:52

◆ advanceExternalSource()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::advanceExternalSource ( )
inlinevirtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 1254 of file fvcartesiansolverxd.h.

1254{};

◆ allocateAndInitSolverMemory()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::allocateAndInitSolverMemory ( )

◆ allocateCommunicationMemory()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::allocateCommunicationMemory

Definition at line 914 of file fvcartesiansolverxd.cpp.

914 {
915 TRACE();
916
917 // Deallocate all previous communication buffers
929
930 // Init all communication properties to false
931 m_nonBlockingComm = false;
932
933 // Allocate memory and really initialize communication properties
934 if(noNeighborDomains() > 0 && isActive()) {
935 ScratchSpace<MInt> haloCellsCnt(noNeighborDomains(), AT_, "noHaloCells");
936 ScratchSpace<MInt> windowCellsCnt(noNeighborDomains(), AT_, "noWindowCells");
937 MInt totalNoWindowCells = 0;
938 MInt totalNoHaloCells = 0;
939 for(MInt d = 0; d < noNeighborDomains(); d++) {
940 haloCellsCnt[d] = noHaloCells(d);
941 totalNoHaloCells += noHaloCells(d);
942 windowCellsCnt[d] = noWindowCells(d);
943 totalNoWindowCells += noWindowCells(d);
944 }
945
946 MPI_Allreduce(MPI_IN_PLACE, &totalNoWindowCells, 1, type_traits<MInt>::mpiType(), MPI_MAX, mpiComm(), AT_,
947 "MPI_IN_PLACE", "totalNoWindowCells");
948 MPI_Allreduce(MPI_IN_PLACE, &totalNoHaloCells, 1, type_traits<MInt>::mpiType(), MPI_MAX, mpiComm(), AT_,
949 "MPI_IN_PLACE", "totalNoHaloCells");
950
951 stringstream message;
952 message << "Solver #" << solverId() << " - maximum number of window cells among ranks: " << totalNoWindowCells
953 << std::endl;
954 message << "Solver #" << solverId() << " - maximum number of halo cells among ranks: " << totalNoHaloCells
955 << std::endl;
956 m_log << message.str();
957 cerr0 << message.str();
958
959 mAlloc(m_maxLevelHaloCells, noNeighborDomains(), &haloCellsCnt[0], "m_maxLevelHaloCells", AT_);
960 mAlloc(m_maxLevelWindowCells, noNeighborDomains(), &windowCellsCnt[0], "m_maxLevelWindowCells", AT_);
961 mAlloc(m_noMaxLevelHaloCells, noNeighborDomains(), "m_noMaxLevelHaloCells", 0, AT_);
962 mAlloc(m_noMaxLevelWindowCells, noNeighborDomains(), "m_noMaxLevelWindowCells", 0, AT_);
963
964 mAlloc(m_sendBuffers, noNeighborDomains(), &windowCellsCnt[0], m_dataBlockSize, "m_sendBuffers", AT_);
965 mAlloc(m_receiveBuffers, noNeighborDomains(), &haloCellsCnt[0], m_dataBlockSize, "m_receiveBuffers", AT_);
966 mAlloc(m_mpi_request, noNeighborDomains(), "m_mpi_request", AT_);
967
968 m_nonBlockingComm = Context::getSolverProperty<MBool>("nonBlockingComm", m_solverId, AT_, &m_nonBlockingComm);
969
971 mTerm(1, "Activate nonBlockingComm to make split MPI communication work (splitMpiComm).");
972 }
973
974 // Allocate space for non-blocking send and receive buffers:
977 "m_sendBuffersNoBlocking", AT_);
979 "m_receiveBuffersNoBlocking", AT_);
980 mAlloc(m_mpi_receiveRequest, noNeighborDomains(), "m_mpi_receiveRequest ", AT_);
981 mAlloc(m_mpi_sendRequest, noNeighborDomains(), "m_mpi_sendRequest", AT_);
982 for(MInt i = 0; i < noNeighborDomains(); i++) {
983 m_mpi_receiveRequest[i] = MPI_REQUEST_NULL;
984 m_mpi_sendRequest[i] = MPI_REQUEST_NULL;
985 }
986 }
987 }
988}
void mAlloc(T *&a, const MLong N, const MString &objectName, MString function)
allocates memory for one-dimensional array 'a' of size N
Definition: alloc.h:173
MBool mDeallocate(T *&a)
deallocates the memory previously allocated for element 'a'
Definition: alloc.h:544
MPI_Request * m_mpi_receiveRequest
MPI_Request * m_mpi_sendRequest
This class is a ScratchSpace.
Definition: scratch.h:758
MPI_Comm mpiComm() const
Return the MPI communicator used by this solver.
Definition: solver.h:380
MInt solverId() const
Return the solverId.
Definition: solver.h:425
const MInt m_solverId
a unique solver identifier
Definition: solver.h:90
void mTerm(const MInt errorCode, const MString &location, const MString &message)
Definition: functions.cpp:29
const MString const MString & message
Definition: functions.h:37
MBool g_splitMpiComm
InfoOutFile m_log
std::ostream cerr0
int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Allreduce

◆ applyBoundaryCondition()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::applyBoundaryCondition
virtual

If multiple ghost cells are used with ghost cells located normal to the boundary surfaces from the surface centroids, image point variables are set. If the image point variables should be set coupled to the flow field, they are updated iteratively.

Author
changed by Claudia Guenther, Mai 2010

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 13984 of file fvcartesiansolverxd.cpp.

13984 {
13985 TRACE();
13986
13987 // Note: flamespeed is abused here to detect if Stephans flame stuff is running
13988 if(m_levelSet && m_combustion && abs(m_flameSpeed) <= 0) {
13989 m_log << "WARNING: applyBoundaryCondition() " << endl;
13990 return;
13991 }
13992
13993 // MFloat ipChange = 10000000.0;
13994 // MFloat eps = 1e-5; // just a guess for a suitable value - should be changed to some sophisticated value
13995 MInt iter = 0;
13996
13998 // compute Interpolated Variables - initial guess
14000 }
14001
14003 // while(ipChange > eps && iter < m_fvBndryCnd->m_noImagePointIterations){
14004 while(iter < m_fvBndryCnd->m_noImagePointIterations) {
14005 // apply Dirichlet boundary conditions
14007 // apply von Neumann boundary conditions
14009 // compute cell center gradients
14011 // compute Interpolated Variables
14012 /* ipChange = */ m_fvBndryCnd->updateImagePointVariables(1);
14013 // cerr << "[ " << domainId() << " ]: " << " iteration: " << iter << " max. rel. change in image point
14014 // variables: " << ipChange << endl;
14015 iter++;
14016 }
14017 }
14018 // apply Dirichlet boundary conditions
14020
14021 // apply von Neumann boundary conditions
14023}
MFloat updateImagePointVariables(MInt)
Updates the image point variables used with multiple ghost cell formulation.
virtual void LSReconstructCellCenter_Boundary()
Computes the slopes at the cell centers of only the boundary cells.

◆ applyChannelForce()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::applyChannelForce
protected

Definition at line 34210 of file fvcartesiansolverxd.cpp.

34210 {
34211 TRACE();
34212 for(MInt cellId = 0; cellId < c_noCells(); cellId++) {
34213 a_rightHandSide(cellId, CV->RHO_U) -= m_channelVolumeForce * a_pvariable(cellId, PV->RHO) * a_cellVolume(cellId);
34214 a_rightHandSide(cellId, CV->RHO_E) -=
34215 m_channelVolumeForce * a_pvariable(cellId, PV->RHO) * a_pvariable(cellId, PV->U) * a_cellVolume(cellId);
34216 }
34217}

◆ applyCoarseLevelCorrection()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::applyCoarseLevelCorrection

Definition at line 10528 of file fvcartesiansolverxd.cpp.

10528 {
10529 TRACE();
10530
10531 const MInt _noInternalCells = grid().noInternalCells();
10532 const MInt noCVars = CV->noVariables;
10533 for(MInt cellId = 0; cellId < _noInternalCells; cellId++) {
10534 for(MInt varId = 0; varId < noCVars; varId++) {
10535 a_rightHandSide(cellId, varId) -= a_tau(cellId, varId);
10536 }
10537 }
10538}
MFloat & a_tau(const MInt cellId, const MInt varId)
Returns the tau of the cell cellId for variable varId.

◆ applyExternalOldSource()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::applyExternalOldSource ( )
inlinevirtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 1253 of file fvcartesiansolverxd.h.

1253{};

◆ applyExternalSource()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::applyExternalSource
virtual
Author
Tim Wegmann
Date
January 2021

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 9686 of file fvcartesiansolverxd.cpp.

9686 {
9687 TRACE();
9688
9689 for(MInt ac = 0; ac < m_noActiveCells; ac++) {
9690 const MInt cellId = m_activeCellIds[ac];
9691 for(MInt var = 0; var < CV->noVariables; var++) {
9692 a_rightHandSide(cellId, var) += a_externalSource(cellId, var);
9693 }
9694 }
9695}
MFloat & a_externalSource(MInt cellId, MInt var)
Return external source.

◆ applyInitialCondition()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::applyInitialCondition ( )
virtual
Author
Daniel Hartmann

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

◆ applySandpaperTrip()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::applySandpaperTrip

Definition at line 34044 of file fvcartesiansolverxd.cpp.

34044 {
34045 TRACE();
34046
34047 for(MInt ii = 0; ii < m_tripNoTrips; ii++) {
34048 const MFloat t = m_time + m_timeStep * m_RKalpha[m_RKStep];
34049 const MInt tripTime = (MInt)(t / m_tripDeltaTime[ii]);
34050 const MFloat p = t / m_tripDeltaTime[ii] - tripTime;
34051 const MFloat b = 3 * pow(p, 2) - 2 * pow(p, 3);
34052 const MInt offset = m_tripCellOffset[ii];
34053 const MInt offsetModes = ii * 2 * m_tripNoModes;
34054
34055 if(tripTime > m_tripTimeStep[ii]) {
34056 m_tripTimeStep[ii] = tripTime;
34057
34058 // copy old values from H1 to H2
34059 for(MInt k = 0; k < m_tripNoCells[ii]; k++) {
34060 if(m_tripNoCells[ii] > 0) m_tripH1[offset + k] = m_tripH2[offset + k];
34061 }
34062 // copy old mode coefficients
34063 for(MInt n = 0; n < m_tripNoModes; n++) {
34064 m_tripModesH1[offsetModes + n] = m_tripModesH2[offsetModes + n];
34065 }
34066
34067 // compute new fourier coefficients
34069 // if(m_tripNoCells[ii] > 0) {
34070 tripForceCoefficients(&m_tripModesH2[offsetModes], &m_tripH2[offset], &m_tripCoords[0], m_tripNoCells[ii],
34072 //}
34073 }
34074
34075 for(MInt cell = 0; cell < m_tripNoCells[ii]; cell++) {
34076 //
34077 const MFloat forceStrength =
34078 (m_tripMaxAmpSteady[ii] * m_tripG[offset + cell]
34079 + m_tripMaxAmpFluc[ii] * ((1.0 - b) * m_tripH1[offset + cell] + b * m_tripH2[offset + cell]));
34080 const MInt cellId = m_tripCellIds[cell];
34081 const MFloat x = a_coordinate(cellId, 0);
34082 const MFloat y = a_coordinate(cellId, 1);
34083
34084 MInt force =
34085 exp(-POW2((x - m_tripXOrigin[ii]) / m_tripXLength[ii]) - POW2((y - m_tripYOrigin[ii]) / m_tripYHeight[ii]))
34086 * forceStrength;
34087 if(!m_tripAirfoil) {
34088 // assuming the surface is +y-normal
34089 a_rightHandSide(cellId, CV->RHO_V) -= force * a_pvariable(cellId, PV->RHO) * a_cellVolume(cellId);
34090 // should this be an absolute?
34091 IF_CONSTEXPR(hasE<SysEqn>)
34092 a_rightHandSide(cellId, CV->RHO_E) -=
34093 force * a_pvariable(cellId, PV->RHO) * a_pvariable(cellId, PV->V) * a_cellVolume(cellId);
34094 } else {
34095 const MFloat nx = m_tripAirfoilForceDir[ii * nDim + 0];
34096 const MFloat ny = m_tripAirfoilForceDir[ii * nDim + 1];
34097 a_rightHandSide(cellId, CV->RHO_U) -= force * a_pvariable(cellId, PV->RHO) * a_cellVolume(cellId) * nx;
34098 a_rightHandSide(cellId, CV->RHO_V) -= force * a_pvariable(cellId, PV->RHO) * a_cellVolume(cellId) * ny;
34099 // should i get a total velocity aligned with the force here
34100 IF_CONSTEXPR(hasE<SysEqn>)
34101 a_rightHandSide(cellId, CV->RHO_E) -= force * a_pvariable(cellId, PV->RHO)
34102 * (a_pvariable(cellId, PV->U) * nx + a_pvariable(cellId, PV->V) * ny)
34103 * a_cellVolume(cellId);
34104 }
34105 }
34106 }
34107}
void tripForceCoefficients(MFloat *, MFloat *, MFloat *, MInt, MInt)
std::vector< MFloat > m_tripCoords
MFloat & a_coordinate(const MInt cellId, const MInt dir)
Returns the coordinate of the cell from the fvcellcollector cellId for dimension dir.
void tripFourierCoefficients(MFloat *, MInt, MFloat, MFloat)
std::vector< MInt > m_tripCellIds
constexpr Real POW2(const Real x)
Definition: functions.h:119
constexpr std::underlying_type< FcCell >::type p(const FcCell property)
Converts property name to underlying integer value.
define array structures

◆ assertDeleteNeighbor()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::assertDeleteNeighbor ( const MInt  cellId,
const MInt  dir 
) const
inline

Definition at line 496 of file fvcartesiansolverxd.h.

496 {
497#ifndef NDEBUG
498 if(m_deleteNeighbour && a_hasProperty(cellId, SolverCell::IsBndryActive) && grid().tree().hasNeighbor(cellId, dir)
499 && a_hasProperty(grid().tree().neighbor(cellId, dir), SolverCell::IsInactive)) {
500 ASSERT(false, "ERROR: calling inactive-neighbor!");
501 }
502#else
503 std::ignore = cellId;
504 std::ignore = dir;
505#endif
506 }

◆ assertValidGridCellId() [1/2]

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::assertValidGridCellId ( const MInt  cellId) const
inline

Definition at line 472 of file fvcartesiansolverxd.h.

472 {
473 if(a_isBndryGhostCell(cellId)
474 || cellId < 0
475 // || m_cells.hasProperty(cellId, SolverCell::IsSplitCell)
476 || m_cells.hasProperty(cellId, SolverCell::IsSplitClone)
477 || m_cells.hasProperty(cellId, SolverCell::IsSplitChild)) {
478 TERMM(-1, "ERROR: Invalid cell " + std::to_string(cellId) + "/" + std::to_string(grid().tree().size())
479 + " isSplitClone:"
480 + std::to_string(m_cells.hasProperty(cellId, SolverCell::IsSplitClone))
481 // + " isSplitCell:" + std::to_string(m_cells.hasProperty(cellId,
482 // SolverCell::IsSplitCell))
483 + " IsSplitChild:" + std::to_string(m_cells.hasProperty(cellId, SolverCell::IsSplitChild))
484 + " isBndryGhost:" + std::to_string(a_isBndryGhostCell(cellId)));
485 }
486 }

◆ assertValidGridCellId() [2/2]

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::assertValidGridCellId ( const MInt   NotUsedcellId) const
inline

Definition at line 488 of file fvcartesiansolverxd.h.

488{}

◆ ATTRIBUTES2() [1/9]

template<MInt nDim_, class SysEqn >
FvCartesianSolverXD< nDim_, SysEqn >::ATTRIBUTES2 ( ATTRIBUTE_ALWAYS_INLINE  ,
ATTRIBUTE_HOT   
) const

◆ ATTRIBUTES2() [2/9]

template<MInt nDim_, class SysEqn >
FvCartesianSolverXD< nDim_, SysEqn >::ATTRIBUTES2 ( ATTRIBUTE_ALWAYS_INLINE  ,
ATTRIBUTE_HOT   
) const

◆ ATTRIBUTES2() [3/9]

template<MInt nDim_, class SysEqn >
template<class _ = void, std::enable_if_t<!isEEGas< SysEqn >, _ * > = nullptr>
FvCartesianSolverXD< nDim_, SysEqn >::ATTRIBUTES2 ( ATTRIBUTE_HOT  ,
ATTRIBUTE_ALWAYS_INLINE   
) const

◆ ATTRIBUTES2() [4/9]

template<MInt nDim_, class SysEqn >
template<class _ = void, std::enable_if_t< isEEGas< SysEqn >, _ * > = nullptr>
FvCartesianSolverXD< nDim_, SysEqn >::ATTRIBUTES2 ( ATTRIBUTE_HOT  ,
ATTRIBUTE_ALWAYS_INLINE   
)

◆ ATTRIBUTES2() [5/9]

template<MInt nDim_, class SysEqn >
template<class _ = void, std::enable_if_t< isEEGas< SysEqn >, _ * > = nullptr>
FvCartesianSolverXD< nDim_, SysEqn >::ATTRIBUTES2 ( ATTRIBUTE_HOT  ,
ATTRIBUTE_ALWAYS_INLINE   
) const

◆ ATTRIBUTES2() [6/9]

template<MInt nDim_, class SysEqn >
FvCartesianSolverXD< nDim_, SysEqn >::ATTRIBUTES2 ( ATTRIBUTE_HOT  ,
ATTRIBUTE_ALWAYS_INLINE   
)

◆ ATTRIBUTES2() [7/9]

template<MInt nDim_, class SysEqn >
FvCartesianSolverXD< nDim_, SysEqn >::ATTRIBUTES2 ( ATTRIBUTE_HOT  ,
ATTRIBUTE_ALWAYS_INLINE   
)

◆ ATTRIBUTES2() [8/9]

template<MInt nDim_, class SysEqn >
FvCartesianSolverXD< nDim_, SysEqn >::ATTRIBUTES2 ( ATTRIBUTE_HOT  ,
ATTRIBUTE_FLATTEN   
)

◆ ATTRIBUTES2() [9/9]

template<MInt nDim_, class SysEqn >
FvCartesianSolverXD< nDim_, SysEqn >::ATTRIBUTES2 ( ATTRIBUTE_HOT  ,
ATTRIBUTE_FLATTEN   
)

◆ Ausm()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::Ausm
virtual

The objective is to encourage the compiler to generate different optimized version depending on the value of m_noSpecies.

Reimplemented in FvApeSolver2D.

Definition at line 19244 of file fvcartesiansolverxd.cpp.

19244 {
19245 TRACE();
19246
19248 Ausm_<AUSM>(sysEqn());
19250 Ausm_<AUSMPLUS>(sysEqn());
19251 } else if(string2enum(m_advectiveFluxScheme) == SLAU) {
19252 Ausm_<SLAU>(sysEqn());
19253 }
19254}
MInt string2enum(MString theString)
This global function translates strings in their corresponding enum values (integer values)....
Definition: enums.cpp:20
@ SLAU
Definition: enums.h:182
@ AUSM
Definition: enums.h:182
@ AUSMPLUS
Definition: enums.h:182

◆ Ausm_()

template<MInt nDim_, class SysEqn >
template<MInt stencil, class F >
void FvCartesianSolverXD< nDim_, SysEqn >::Ausm_ ( F &  fluxFct)
inline

Definition at line 19258 of file fvcartesiansolverxd.cpp.

19258 {
19259 const MUint noPVars = PV->noVariables;
19260 const MUint noFluxVars = FV->noVariables;
19261 const MUint noSurfaceCoefficients = hasSC ? SC->m_noSurfaceCoefficients : 0;
19262 const MUint surfaceVarMemory = 2 * noPVars;
19263 const MUint noSurfaces = a_noSurfaces();
19264 const MUint noInternalSurfaces = m_bndrySurfacesOffset;
19265
19266 MFloat* const RESTRICT fluxes = ALIGNED_MF(&a_surfaceFlux(0, 0));
19267 const MFloat* const RESTRICT surfaceVars = ALIGNED_F(&a_surfaceVariable(0, 0, 0));
19268 const MFloat* const RESTRICT surfaceCoefficients = hasSC ? ALIGNED_F(&a_surfaceCoefficient(0, 0)) : nullptr;
19269 const MFloat* const RESTRICT upwindCoefficients = ALIGNED_F(&a_surfaceUpwindCoefficient(0));
19270 const MFloat* const RESTRICT area = ALIGNED_F(&a_surfaceArea(0));
19271 const MInt* const RESTRICT orientations = ALIGNED_I(&a_surfaceOrientation(0));
19272 const MInt* const RESTRICT bndryCndIds = ALIGNED_I(&a_surfaceBndryCndId(0));
19273
19274// loop over all surfaces
19275#ifdef _OPENMP
19276#pragma omp parallel for
19277#endif
19278 for(MUint srfcId = 0; srfcId < noSurfaces; ++srfcId) {
19279 const MUint orientation = orientations[srfcId];
19280
19281 const MUint offset = srfcId * surfaceVarMemory;
19282 const MFloat* const RESTRICT leftVars = ALIGNED_F(surfaceVars + offset);
19283 const MFloat* const RESTRICT rightVars = ALIGNED_F(leftVars + noPVars);
19284
19285 const MUint coefficientOffset = srfcId * noSurfaceCoefficients;
19286 const MFloat* const RESTRICT srfcCoeff = hasSC ? ALIGNED_F(surfaceCoefficients + coefficientOffset) : nullptr;
19287
19288 const MFloat A = area[srfcId];
19289
19290 const MUint fluxOffset = srfcId * noFluxVars;
19291 MFloat* const RESTRICT flux = ALIGNED_MF(fluxes + fluxOffset);
19292
19293 const MFloat upwindCoefficient = upwindCoefficients[srfcId];
19294
19295 fluxFct.template Ausm<stencil>(orientation, upwindCoefficient, A, leftVars, rightVars, srfcCoeff, flux);
19296 }
19297
19298 // find if there is a boundary condition that needs flux correction
19299 // (assumes no moving boundaries between domains)
19302 if(!checkedBndryCndIds) {
19303 for(MUint srfcId = noInternalSurfaces; srfcId < noSurfaces; ++srfcId) {
19304 if((bndryCndIds[srfcId] > 1999 && bndryCndIds[srfcId] < 4000)) {
19305 correctWallBndryFluxes = true;
19306 }
19307 }
19308 checkedBndryCndIds = true;
19309 }
19310
19311 if(correctWallBndryFluxes) {
19312 // correct all wall boundary surfaces
19313 for(MUint srfcId = noInternalSurfaces; srfcId < noSurfaces; ++srfcId) {
19314 if(!(bndryCndIds[srfcId] > 1999 && bndryCndIds[srfcId] < 4000)) {
19315 continue;
19316 }
19317
19318 const MUint orientation = orientations[srfcId];
19319
19320 const MUint offset = srfcId * surfaceVarMemory;
19321 const MFloat* leftVars = surfaceVars + offset;
19322 const MFloat* rightVars = leftVars + noPVars;
19323
19324 const MFloat A = area[srfcId];
19325 const MUint fluxOffset = srfcId * noFluxVars;
19326 MFloat* const RESTRICT flux = fluxes + fluxOffset;
19327
19328 fluxFct.AusmBndryCorrection(orientation, A, leftVars, rightVars, flux);
19329 }
19330 }
19331}
MInt a_noSurfaces()
Returns the number of surfaces.
MFloat & a_surfaceVariable(const MInt srfcId, const MInt dir, const MInt varId)
Returns the variable varId of surface srfcId in direction dir.
MInt & a_surfaceOrientation(const MInt srfcId)
Returns the orientation of surface srfcId.
MFloat & a_surfaceCoefficient(const MInt srfcId, const MInt dimCoefficient)
Returns the coefficient dimCoefficient of surface srfcId.
MFloat & a_surfaceArea(const MInt srfcId)
Returns the area of surface srfcId.
SysEqn::FluxVariables * FV
static constexpr MBool hasSC
MFloat & a_surfaceUpwindCoefficient(const MInt srfcId)
Returns the upwind coefficient of surface srfcId.
MFloat & a_surfaceFlux(const MInt srfcId, const MInt fVarId)
Returns the flux fVarId for surface srfcId.
SysEqn::SurfaceCoefficients * SC
MBool m_static_computeSurfaceValuesLimitedSlopesMan_correctWallBndryFluxes
MBool m_static_computeSurfaceValuesLimitedSlopesMan_checkedBndryCndIds
MInt & a_surfaceBndryCndId(const MInt srfcId)
Returns the boundary condition of surface srfcId.
bool MBool
Definition: maiatypes.h:58

◆ azimuthalNearBoundaryExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::azimuthalNearBoundaryExchange ( )

◆ azimuthalNearBoundaryReverseExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::azimuthalNearBoundaryReverseExchange ( )

◆ balance()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::balance ( const MInt *const  noCellsToReceiveByDomain,
const MInt *const  noCellsToSendByDomain,
const MInt *const  sortedCellId,
const MInt  oldNoCells 
)
override
Author
Jerry Grimmen, Lennart Schneiders, Ansgar Niemoeller, multi-solver-update: Tim Wegmann

Definition at line 24412 of file fvcartesiansolverxd.cpp.

24414 {
24415 // TODO labels:FV,DLB balance is still needed for FV-MB DLB!
24416 /* mTerm(1, "balance() is deprecated, use split balancing balancePre/Post instead!"); */
24417 TRACE();
24418 NEW_TIMER_GROUP(t_initTimer, "balance solver");
24419 NEW_TIMER(t_timertotal, "balance solver", t_initTimer);
24420 NEW_SUB_TIMER(t_variables, "variables", t_timertotal);
24421 NEW_SUB_TIMER(t_communicator, "communicator", t_timertotal);
24422 NEW_SUB_TIMER(t_reinit, "reinit", t_timertotal);
24423
24424 RECORD_TIMER_START(t_timertotal);
24425 RECORD_TIMER_START(t_variables);
24426
24427 // write solver-data into grid-structure arrays for the load-balancing
24428 MFloatScratchSpace variablesBalance(oldNoCells, CV->noVariables, FUN_, "variablesBalance");
24429 MFloatScratchSpace volumeBalance(oldNoCells, FUN_, "volumeBalance");
24430
24431 variablesBalance.fill(-1);
24432 volumeBalance.fill(-1);
24433
24434
24435 for(MInt cellId = 0; cellId < c_noCells(); cellId++) {
24436 MInt gridCellId = grid().tree().solver2grid(cellId);
24437 for(MInt variable = 0; variable < CV->noVariables; variable++) {
24438 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
24439 ASSERT(!std::isnan(a_variable(cellId, variable)), "");
24440 }
24441 variablesBalance(gridCellId, variable) = a_variable(cellId, variable);
24442 }
24443 volumeBalance(gridCellId) = a_cellVolume(cellId);
24444 }
24445
24446
24447 // update of the proxy
24448 grid().update();
24449
24450 // Just reset parallelization information if solver is not active
24451 // NOTE: inactive ranks not supported here since the data sizes etc are not determined for the
24452 // solver but for the whole grid -> use balancePre/Post instead!
24453 if(!grid().isActive()) {
24454 updateDomainInfo(-1, -1, MPI_COMM_NULL, AT_);
24455 mTerm(1, "fixme: inactive ranks not supported in balance(); use balancePre/Post instead!");
24456 return;
24457 }
24458
24459 // Set new domain info for solver
24461
24462 // This is only working of the same domains as in the grid are used!
24463 ASSERT(domainId() == grid().raw().domainId(), "");
24464 ASSERT(noDomains() == grid().raw().noDomains(), "");
24465
24466 // data-to be saved during the balancing:
24467 //-a_variables
24468 // a_cellVolume
24469
24470 MFloatScratchSpace variables(noCellsToReceiveByDomain[noDomains()], CV->noVariables, FUN_, "variables");
24471 MFloatScratchSpace cellVolumes(noCellsToReceiveByDomain[noDomains()], FUN_, "cellVolumes");
24472
24473 variables.fill(-1.0);
24474 cellVolumes.fill(-1.0);
24475
24476 maia::mpi::communicateData(&variablesBalance[0], oldNoCells, sortedCellId, noDomains(), domainId(), mpiComm(),
24477 noCellsToSendByDomain, noCellsToReceiveByDomain, CV->noVariables, &variables[0]);
24478 maia::mpi::communicateData(&volumeBalance[0], oldNoCells, sortedCellId, noDomains(), domainId(), mpiComm(),
24479 noCellsToSendByDomain, noCellsToReceiveByDomain, 1, &cellVolumes[0]);
24480
24481 // Reset cell, surface, boundary cell data and deallocate halo/window cell arrays, and reset cell
24482 // collector
24484
24485 // Reallocate communication data structures
24487
24488 ASSERT(m_cells.size() == 0, "");
24489
24490 // Iterate over all received grid cells
24491 for(MInt gridCellId = 0; gridCellId < noCellsToReceiveByDomain[noDomains()]; gridCellId++) {
24492 const MInt cellId = m_cells.size();
24493
24494 if(!grid().raw().treeb().solver(gridCellId, m_solverId)) continue;
24495
24496 // this needs to be appended before performing any checks
24497 m_cells.append();
24498
24499 if(!grid().raw().bitOffset()) {
24500 ASSERT(grid().tree().solver2grid(cellId) == gridCellId, to_string(cellId) + " " + to_string(gridCellId));
24501 }
24502
24503 if(grid().domainOffset(domainId()) + (MLong)cellId != c_globalId(cellId)) {
24504 mTerm(1, "Global id mismatch: o" + std::to_string(grid().domainOffset(domainId())) + " + c"
24505 + std::to_string(cellId) + " != g" + std::to_string(c_globalId(cellId)));
24506 }
24507
24509
24510 // Set solver data
24511 for(MInt v = 0; v < CV->noVariables; v++) {
24512 a_variable(cellId, v) = variables(gridCellId, v);
24513 a_oldVariable(cellId, v) = a_variable(cellId, v);
24514 }
24515 setPrimitiveVariables(cellId);
24516 a_cellVolume(cellId) = cellVolumes(gridCellId);
24517 a_FcellVolume(cellId) = F1 / mMax(m_volumeThreshold, a_cellVolume(cellId));
24518 }
24519
24520
24521 // append the halo-cells;
24522 m_cells.append(c_noCells() - m_cells.size());
24523
24526
24527 ASSERT(m_cells.size() == c_noCells() && c_noCells() == a_noCells(), "");
24528
24530 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
24531 a_bndryId(cellId) = -1;
24532 a_isBndryGhostCell(cellId) = false;
24533 a_hasProperty(cellId, SolverCell::IsSplitChild) = false;
24534 }
24535
24537
24538 // this can only be done, after the halo-cells have been added above!
24539 this->checkNoHaloLayers();
24540
24541 RECORD_TIMER_STOP(t_variables);
24542 RECORD_TIMER_START(t_communicator);
24543
24551 if(m_nonBlockingComm) {
24556 }
24557
24559
24563 mAlloc(m_fvBndryCnd->m_nearBoundaryWindowCells, noNeighborDomains(), "m_nearBoundaryWindowCells", AT_);
24564 mAlloc(m_fvBndryCnd->m_nearBoundaryHaloCells, noNeighborDomains(), "m_nearBoundaryHaloCells", AT_);
24565 }
24566
24567 std::vector<MInt>().swap(m_splitCells);
24568 std::vector<std::vector<MInt>>().swap(m_splitChilds);
24569 std::map<MInt, MInt>().swap(m_splitChildToSplitCell);
24571
24572 if(this->m_adaptation) {
24573 for(MInt i = 0; i < maxNoGridCells(); i++)
24574 m_recalcIds[i] = i;
24575 }
24576
24577 // set variables for halo cells:
24578 exchangeData(&a_variable(0, 0), CV->noVariables);
24579 exchangeData(&a_cellVolume(0), 1);
24580 if(grid().azimuthalPeriodicity()) {
24581 mTerm(1, AT_, "Add azimuthal periodicity, c.f. fvMb!");
24582 }
24583
24584 for(MInt cellId = noInternalCells(); cellId < a_noCells(); cellId++) {
24585 setPrimitiveVariables(cellId);
24586 for(MInt v = 0; v < CV->noVariables; v++) {
24587 a_oldVariable(cellId, v) = a_variable(cellId, v);
24588 }
24589 a_FcellVolume(cellId) = F1 / mMax(m_volumeThreshold, a_cellVolume(cellId));
24590 }
24591
24593
24594 IF_CONSTEXPR(isDetChem<SysEqn>) if(m_heatReleaseDamp) initHeatReleaseDamp();
24595
24596 RECORD_TIMER_STOP(t_communicator);
24597 RECORD_TIMER_START(t_reinit);
24598
24599 // If grid adaptation is used make sure that a grid file is written with the next restart file
24600 // since the cells will be sorted during balacing, while the old grid after adaptation will
24601 // contain the unsorted grid cells
24602 if(this->m_adaptation) {
24605 }
24606
24607 RECORD_TIMER_STOP(t_reinit);
24608 RECORD_TIMER_STOP(t_timertotal);
24609 DISPLAY_TIMER(t_timertotal);
24610}
std::vector< MInt > * m_nearBoundaryHaloCells
std::vector< MInt > * m_nearBoundaryWindowCells
MFloat & a_oldVariable(const MInt cellId, const MInt varId)
Returns oldVariablesv of the cell cellId variables varId.
std::map< MInt, MInt > m_splitChildToSplitCell
virtual void resetSolverFull()
MFloat & a_variable(const MInt cellId, const MInt varId)
Returns conservative variable v of the cell cellId for variables varId.
void a_resetPropertiesSolver(const MInt cellId)
Returns property p of the cell cellId.
MInt noInternalCells() const override
Return the number of internal cells within this solver.
static constexpr MFloat m_volumeThreshold
MLong c_globalId(const MInt cellId) const
Returns the global grid id of the grid cell cellId.
void setPrimitiveVariables(MInt cellId)
computes primitive from primitive variables for given cell id. This is the version for all SysEqn.
void allocateCommunicationMemory()
Allocates and initializes send/receive buffers for multiSolver computations.
virtual void updateMultiSolverInformation(MBool fullReset=false)
MFloat & a_FcellVolume(const MInt cellId) override
Returns the inverse cell volume of the cell from the fvcellcollector cellId.
virtual MInt domainId() const
Return the domainId (rank)
Definition: solver.h:383
virtual MInt noDomains() const
Definition: solver.h:387
void updateDomainInfo(const MInt domainId, const MInt noDomains, const MPI_Comm mpiComm, const MString &loc)
Set new domain information.
Definition: solver.h:135
void checkNoHaloLayers()
check that each solver has the required number of haloLayers for leaf cells!!! TODO labels:toenhance ...
void exchangeData(T *data, const MInt dataBlockSize=1)
Exchange memory in 'data' assuming a solver size of 'dataBlockSize' per cell.
constexpr T mMax(const T &x, const T &y)
Definition: functions.h:94
int64_t MLong
Definition: maiatypes.h:64
void communicateData(const DataType *const data, const MInt noCells, const MInt *const sortedCellId, const MInt noDomains, const MInt domainId, const MPI_Comm mpiComm, const MInt *const noCellsToSendByDomain, const MInt *const noCellsToReceiveByDomain, const MInt dataBlockSize, DataType *const buffer)
Assemble given data in send buffer and communicate.
Definition: mpiexchange.h:858
void swap(Tensor< TT > &a, Tensor< TT > &b)
Non-member swap exchanges the contents of two Tensors.
Definition: tensor.h:752

◆ balancePost()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::balancePost
overridevirtual
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de

Reimplemented from Solver.

Definition at line 24686 of file fvcartesiansolverxd.cpp.

24686 {
24687 TRACE();
24688
24689 if(grid().azimuthalPeriodicity()) {
24690 mTerm(1, AT_,
24691 "This type of balance is not supported for azimuthal periodicity. Add periodic exchange of conservative "
24692 "variables");
24693 }
24694
24696
24697 // append the halo-cells
24698 m_cells.append(c_noCells() - m_cells.size());
24699
24701
24704 ASSERT(m_cells.size() == c_noCells() && c_noCells() == a_noCells(), "");
24705
24706 // Nothing to do if solver is not active
24707 if(!grid().isActive()) {
24708 return;
24709 }
24710
24712 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
24713 a_bndryId(cellId) = -1;
24714 a_isBndryGhostCell(cellId) = false;
24715 a_hasProperty(cellId, SolverCell::IsSplitChild) = false;
24716 }
24717
24718 // this can only be done, after the halo property has been set above
24719 this->checkNoHaloLayers();
24720
24721 // ### from c'tor ###
24722 // compute min and max coordinates in the grid
24724 // ###
24725
24727
24731 mAlloc(m_fvBndryCnd->m_nearBoundaryWindowCells, noNeighborDomains(), "m_nearBoundaryWindowCells", AT_);
24732 mAlloc(m_fvBndryCnd->m_nearBoundaryHaloCells, noNeighborDomains(), "m_nearBoundaryHaloCells", AT_);
24733 }
24734
24735 m_splitCells.clear();
24736 m_splitChilds.clear();
24739
24740 // during the balance cells are sorted again
24741 if(this->m_adaptation) {
24742 for(MInt i = 0; i < maxNoGridCells(); i++)
24743 m_recalcIds[i] = i;
24744 }
24745
24746 exchangeData(&a_variable(0, 0), CV->noVariables);
24747 if constexpr(hasAV) exchangeData(&a_avariable(0, 0), AV->noVariables);
24748 exchangeData(&a_cellVolume(0), 1);
24749 if(grid().azimuthalPeriodicity()) {
24750 mTerm(1, AT_, "Add azimuthal periodicity, c.f. fvMb!");
24751 }
24752
24753 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
24754 setPrimitiveVariables(cellId);
24755 for(MInt v = 0; v < CV->noVariables; v++) {
24756 a_oldVariable(cellId, v) = a_variable(cellId, v);
24757 }
24758 a_FcellVolume(cellId) = F1 / mMax(m_volumeThreshold, a_cellVolume(cellId));
24759 }
24760
24762
24763 if(m_zonal) {
24767 }
24768
24769 // If grid adaptation is used make sure that a grid file is written with the next restart file
24770 // since the cells will be sorted during balacing, while the old grid after adaptation will
24771 // contain the unsorted grid cells
24772 if(this->m_adaptation) {
24775 }
24776
24778
24779 // check finalizeBalance for any of this cases!
24780 if(m_combustion && !m_LSSolver) {
24781 mTerm(1, "balancePost untested case with combustion");
24782 }
24783 if constexpr(isEEGas<SysEqn>) {
24784 if(m_EEGas.gasSource != 0) {
24785 m_EEGas.gasSourceCells.clear();
24787 }
24788 }
24789}
static constexpr MBool hasAV
virtual void determineLESAverageCells()
MFloat & a_avariable(const MInt cellId, const MInt varId)
Returns additional variable v of the cell cellId for variables varId.
void computeDomainAndSpongeDimensions()
Extracts the minimum and maximum coordinates of all cells in the grid.
SysEqn::AdditionalVariables * AV
virtual void resetZonalLESAverage()
Initializes zonal exchange arrays.
virtual void resetZonalSolverData()

◆ balancePre()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::balancePre
overridevirtual
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de

Reimplemented from Solver.

Definition at line 24619 of file fvcartesiansolverxd.cpp.

24619 {
24620 TRACE();
24621
24622 // Note: every function that allocates persistent memory should first deallocate that memory, for
24623 // this to work initialize all pointers with nullptr in the class definition
24624
24625 // Set reinitialization stage
24627
24628 // Store currently used memory
24629 /* const MLong previouslyAllocated = allocatedBytes(); */
24630
24631 // Update the grid proxy for this solver
24632 grid().update();
24633
24634 if(!grid().isActive()) {
24635 // Reset parallelization information if solver is not active
24636 updateDomainInfo(-1, -1, MPI_COMM_NULL, AT_);
24637 } else {
24638 // Set new domain info for solver
24640 }
24641
24642 if(m_zonal) {
24643 m_wasBalancedZonal = true;
24644 }
24645
24646 // Reset cell, surface, boundary cell data and deallocate halo/window cell arrays
24648
24649 // Reallocate communication data structures
24650 // only requires noNeighborDomains information, which is set in the proxy
24652
24653 // Return if solver is not active
24654 if(!grid().isActive()) {
24655 return;
24656 }
24657
24658 // check for empty cell collector
24659 ASSERT(m_cells.size() == 0, "");
24660
24661 // Resize cell collector to internal cells
24662 m_cells.append(grid().noInternalCells());
24663
24664 // Check that global ids are sorted
24665 for(MInt cellId = 0; cellId < grid().noInternalCells(); cellId++) {
24666 if(grid().domainOffset(domainId()) + (MLong)cellId != c_globalId(cellId)) {
24667 mTerm(1, "Global id mismatch.");
24668 }
24669 // TODO labels:FV,DLB communicate cell volumes necessary? (see balance())
24670 /* a_cellVolume(cellId) = cellVolumes(gridCellId); */
24671 /* a_FcellVolume(cellId) = F1 / mMax(m_volumeThreshold, a_cellVolume(gridCellId)); */
24672 }
24673
24674 // TODO labels:FV,DLB reinit postprocessing?
24675
24676 // allocate general FvCartesianSolver memory
24677 // TODO labels:FV,DLB most memory sizes are constant, but some are dependent on m_noCells/m_noInternalCells
24678 // allocateAndInitSolverMemory();
24679}

◆ bandRefinementSensorDerivative()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::bandRefinementSensorDerivative ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
MInt  sensorOffset,
MInt  sen,
const std::vector< MFloat > &  tau,
const MFloat  sensorThreshold 
)

◆ bilinearInterpolation()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::bilinearInterpolation ( MInt  child,
MInt  cellId,
MInt stencilCellIds 
)

interpolates all variables to child using the stencil support of four cells: cellId, stencilCellIds[ 0 ], stencilCellIds[ 1 ], stencilCellIds[ 2 ]

Author
Daniel Hartmann

Definition at line 22202 of file fvcartesiansolverxd.cpp.

22202 {
22203 TRACE();
22204
22205 MBool a0Computed, a1Computed;
22206 MInt noCVars = CV->noVariables;
22207 MFloat rightHandSide1, rightHandSide2;
22208 MFloat xy, xy0, xy1, xy2, y2y1, xy1xy0, xy2xy0;
22209 MFloat r0, r1, r2;
22210 MFloat rhs1, rhs2, lhs2;
22211 MFloat x1term, x2term, y1term, y2term;
22212 MFloat ratio;
22213 MFloat coordinates[4 * nDim];
22214 MFloat epsilon = c_cellLengthAtLevel(maxRefinementLevel()) / 100.0;
22215 MFloat parameter[4] = {0, 0, 0, 0};
22216 //---
22217
22218
22219 // solve: phi(x,y) = a0*x + a1*y + a2*xy + a3
22220 a0Computed = false;
22221 a1Computed = false;
22222
22223 // shift coordinates such that the coordinates of cellId are (0,0)
22224 for(MInt spaceId = 0; spaceId < nDim; spaceId++) {
22225 coordinates[spaceId] = a_coordinate(child, spaceId) - a_coordinate(cellId, spaceId);
22226 coordinates[nDim + spaceId] = a_coordinate(stencilCellIds[0], spaceId) - a_coordinate(cellId, spaceId);
22227 coordinates[2 * nDim + spaceId] = a_coordinate(stencilCellIds[1], spaceId) - a_coordinate(cellId, spaceId);
22228 coordinates[3 * nDim + spaceId] = a_coordinate(stencilCellIds[2], spaceId) - a_coordinate(cellId, spaceId);
22229 }
22230
22231 // compute constants
22232 xy = coordinates[0] * coordinates[1];
22233 xy0 = coordinates[nDim] * coordinates[nDim + 1];
22234 xy1 = coordinates[2 * nDim] * coordinates[2 * nDim + 1];
22235 xy2 = coordinates[3 * nDim] * coordinates[3 * nDim + 1];
22236
22237 for(MInt varId = 0; varId < noCVars; varId++) {
22238 // 1.: check if a0 can be easily computed (check 1-coordinate)
22239 if(fabs(coordinates[nDim + 1]) < epsilon) {
22240 parameter[0] = (a_variable(stencilCellIds[0], varId) - a_variable(cellId, varId)) / coordinates[nDim];
22241 a0Computed = true;
22242 } else {
22243 if(fabs(coordinates[2 * nDim + 1] - coordinates[3 * nDim + 1]) < epsilon) {
22244 parameter[0] = (a_variable(stencilCellIds[2], varId) - a_variable(stencilCellIds[1], varId))
22245 / (coordinates[3 * nDim] - coordinates[2 * nDim]);
22246 a0Computed = true;
22247 }
22248 }
22249
22250 // 2.: check if a1 can be easily computed (check 0-coordinate)
22251 if(fabs(coordinates[2 * nDim]) < epsilon) {
22252 parameter[1] = (a_variable(stencilCellIds[1], varId) - a_variable(cellId, varId)) / coordinates[2 * nDim + 1];
22253 a1Computed = true;
22254 } else {
22255 if(fabs(coordinates[nDim] - coordinates[3 * nDim]) < epsilon) {
22256 parameter[1] = (a_variable(stencilCellIds[2], varId) - a_variable(stencilCellIds[0], varId))
22257 / (coordinates[3 * nDim + 1] - coordinates[nDim + 1]);
22258 a1Computed = true;
22259 }
22260 }
22261
22262 // 3. compute a3
22263 parameter[3] = a_variable(cellId, varId);
22264
22265 // 4. compute remaining parameters
22266 if(a0Computed && a1Computed) {
22267 parameter[2] = (a_variable(stencilCellIds[2], varId) - parameter[3] - parameter[0] * coordinates[3 * nDim]
22268 - parameter[1] * coordinates[3 * nDim + 1])
22269 / xy2;
22270
22271 } else {
22272 if(a0Computed) {
22273 rightHandSide1 = a_variable(stencilCellIds[1], varId) - parameter[3] - parameter[0] * coordinates[2 * nDim];
22274 rightHandSide2 = a_variable(stencilCellIds[2], varId) - parameter[3] - parameter[0] * coordinates[3 * nDim];
22275 ratio = coordinates[3 * nDim + 1] / coordinates[2 * nDim + 1];
22276
22277 parameter[2] = (rightHandSide2 - ratio * rightHandSide1) / (xy2 - ratio * xy1);
22278 parameter[1] = (rightHandSide1 - xy1 * parameter[2]) / coordinates[2 * nDim + 1];
22279
22280 } else {
22281 if(a1Computed) {
22282 rightHandSide1 = a_variable(stencilCellIds[0], varId) - parameter[3] - parameter[1] * coordinates[nDim + 1];
22283 rightHandSide2 =
22284 a_variable(stencilCellIds[2], varId) - parameter[3] - parameter[1] * coordinates[3 * nDim + 1];
22285 ratio = coordinates[3 * nDim] / coordinates[nDim];
22286
22287 parameter[2] = (rightHandSide2 - ratio * rightHandSide1) / (xy2 - ratio * xy0);
22288 parameter[0] = (rightHandSide1 - xy0 * parameter[2]) / coordinates[nDim];
22289
22290 } else {
22291 // Interpolation with skewed stencil
22292 // The system of equations is solved with parameters in reversed order!!!
22293
22294 // compute constants
22295 xy1xy0 = xy1 / xy0;
22296 xy2xy0 = xy2 / xy0;
22297 x1term = coordinates[2 * nDim] - xy1xy0 * coordinates[nDim];
22298 x2term = coordinates[3 * nDim] - xy2xy0 * coordinates[nDim];
22299 y1term = coordinates[2 * nDim + 1] - xy1xy0 * coordinates[nDim + 1];
22300 y2term = coordinates[3 * nDim + 1] - xy2xy0 * coordinates[nDim + 1];
22301 y2y1 = y2term / y1term;
22302
22303 parameter[3] = a_variable(cellId, varId);
22304 r0 = a_variable(stencilCellIds[0], varId) - parameter[3];
22305 r1 = a_variable(stencilCellIds[1], varId) - parameter[3];
22306 r2 = a_variable(stencilCellIds[2], varId) - parameter[3];
22307
22308 // compute right and left hand sides
22309 rhs2 = r2 - xy2xy0 * r0 - y2y1 * (r1 - xy1xy0 * r0);
22310 rhs1 = r1 - xy1xy0 * r0;
22311 lhs2 = x2term - y2y1 * (x1term);
22312
22313 // compute parameters
22314 parameter[0] = rhs2 / lhs2;
22315 parameter[1] = (rhs1 - x1term * parameter[0]) / y1term;
22316 parameter[2] = (r0 - coordinates[nDim] * parameter[0] - coordinates[nDim + 1] * parameter[1]) / xy0;
22317 }
22318 }
22319 }
22320
22321
22322 // 5. Interpolate
22323 a_variable(child, varId) =
22324 parameter[0] * coordinates[0] + parameter[1] * coordinates[1] + parameter[2] * xy + parameter[3];
22325 }
22326}
MFloat c_cellLengthAtLevel(const MInt level) const
Returns the length of the cell for level.

◆ bilinearInterpolationAtBnd()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::bilinearInterpolationAtBnd ( MInt  child,
MInt  cellId,
MInt stencilCellIds 
)

interpolates all variables to child using the stencil support of four cells: cellId, stencilCellIds[ 0 ], stencilCellIds[ 1 ], stencilCellIds[ 2 ]

Author
Daniel Hartmann

Definition at line 21989 of file fvcartesiansolverxd.cpp.

21989 {
21990 TRACE();
21991
21992 MInt noCVars = CV->noVariables;
21993 MFloat delta;
21994 MFloat childDistance, cellDistance, nghbrDistance;
21995 MFloat factor, cellFactor, nghbrFactor;
21996
21997 // compute distances
21998
21999 // compute the distance of the child cell normal to the boundary
22000 childDistance = 0;
22001 for(MInt spaceId = 0; spaceId < nDim; spaceId++) {
22002 childDistance += (a_coordinate(child, spaceId)
22003 - m_fvBndryCnd->m_bndryCells->a[a_bndryId(child)].m_srfcs[0]->m_coordinates[spaceId])
22004 * m_fvBndryCnd->m_bndryCells->a[a_bndryId(child)].m_srfcs[0]->m_normalVector[spaceId];
22005 }
22006 childDistance = fabs(childDistance);
22007 // compute the distance of cellId normal to the boundary
22008 cellDistance = 0;
22009 for(MInt spaceId = 0; spaceId < nDim; spaceId++) {
22010 cellDistance += (a_coordinate(cellId, spaceId)
22011 - m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_srfcs[0]->m_coordinates[spaceId])
22012 * m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_srfcs[0]->m_normalVector[spaceId];
22013 }
22014 cellDistance = fabs(cellDistance);
22015 // compute the distance of stencilCellIds[ 1 ] normal to the boundary
22016 nghbrDistance = 0;
22017 for(MInt spaceId = 0; spaceId < nDim; spaceId++) {
22018 nghbrDistance += (a_coordinate(stencilCellIds[1], spaceId)
22019 - m_fvBndryCnd->m_bndryCells->a[a_bndryId(stencilCellIds[1])].m_srfcs[0]->m_coordinates[spaceId])
22020 * m_fvBndryCnd->m_bndryCells->a[a_bndryId(stencilCellIds[1])].m_srfcs[0]->m_normalVector[spaceId];
22021 }
22022 nghbrDistance = fabs(nghbrDistance);
22023
22024 // compute interpolation factors...
22025 // ...for cellId
22026 cellFactor = (cellDistance - childDistance) / (2.0 * cellDistance);
22027 // ...for nghbr
22028 nghbrFactor = (nghbrDistance - childDistance) / (2.0 * nghbrDistance);
22029
22030 // compute the distance between child and ...
22031 // ...cellId
22032 cellDistance = 0;
22033 for(MInt spaceId = 0; spaceId < nDim; spaceId++) {
22034 delta = a_coordinate(cellId, spaceId) - a_coordinate(child, spaceId);
22035 cellDistance += delta * delta;
22036 }
22037 // ...nghbrId
22038 nghbrDistance = 0;
22039 for(MInt spaceId = 0; spaceId < nDim; spaceId++) {
22040 delta = a_coordinate(stencilCellIds[1], spaceId) - a_coordinate(child, spaceId);
22041 nghbrDistance += delta * delta;
22042 }
22043
22044 // another interpolation factor
22045 factor = nghbrDistance / (nghbrDistance + cellDistance);
22046
22047 // interpolation of the variables:
22048 // factor * interpolated cell value + ( 1 - factor ) * interpolated neighbor value
22049 for(MInt varId = 0; varId < noCVars; varId++) {
22050 a_variable(child, varId) =
22051 factor * (cellFactor * a_variable(stencilCellIds[0], varId) + (1.0 - cellFactor) * a_variable(cellId, varId))
22052 + (1.0 - factor)
22053 * (nghbrFactor * a_variable(stencilCellIds[2], varId)
22054 + (1.0 - cellFactor) * a_variable(stencilCellIds[1], varId));
22055 }
22056}
Collector< FvBndryCell< nDim, SysEqn > > * m_bndryCells

◆ bubblePathDispersion()

template<MInt nDim_, class SysEqn >
template<class _ = void, std::enable_if_t< isEEGas< SysEqn >, _ * > = nullptr>
void FvCartesianSolverXD< nDim_, SysEqn >::bubblePathDispersion ( )

◆ buildLeastSquaresStencilSimple()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::buildLeastSquaresStencilSimple
Author
Lennart Schneiders

Definition at line 14033 of file fvcartesiansolverxd.cpp.

14033 {
14034 TRACE();
14035
14036 const MBool diagonalCellAddition = m_fvBndryCnd->m_cellMerging && (nDim == 3);
14037 const MInt maxNoNghbrs = 100;
14038 MIntScratchSpace nghbrList(maxNoNghbrs, AT_, "nghbrList");
14039 MIntScratchSpace layerId(maxNoNghbrs, AT_, "layerId");
14040
14042
14043 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
14044 const MInt bndryId = a_bndryId(cellId);
14045 MInt gridcell = cellId;
14046 if(a_hasProperty(cellId, SolverCell::IsSplitClone)) {
14047 gridcell = m_splitChildToSplitCell.find(cellId)->second;
14048 }
14049
14050 a_noReconstructionNeighbors(cellId) = 0;
14051
14052 if(a_isBndryGhostCell(cellId)) continue;
14053 if(c_noChildren(gridcell) > 0) continue;
14054 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) continue;
14055 // if( a_hasProperty( cellId , SolverCell::IsCutOff) ) continue;
14056 if(a_hasProperty(cellId, SolverCell::IsNotGradient)) continue;
14057 if(a_hasProperty(cellId, SolverCell::IsInvalid)) continue;
14058
14059 // const MInt counter = ( bndryId > -1 || m_orderOfReconstruction == 2 ) ? getAdjacentLeafCells<1>( cellId, 1,
14060 // nghbrList, layerId ) : getAdjacentLeafCells<0>( cellId, 1, nghbrList, layerId ); MBool ext = false; if ( bndryId
14061 // > -1 ) if ( m_fvBndryCnd->m_bndryCells->a[ bndryId ].m_volume / pow(c_cellLengthAtCell(cellId),(MFloat)nDim) <
14062 // F1B2 ) ext = true; const MInt counter = ( ext || m_orderOfReconstruction == 2 ) ? getAdjacentLeafCells<1>(
14063 // cellId, 1, nghbrList, layerId ) : getAdjacentLeafCells<0>( cellId, 1, nghbrList, layerId );
14064 const MInt counter = getAdjacentLeafCells<0>(cellId, 1, nghbrList, layerId);
14065 if(counter > maxNoNghbrs) mTerm(1, AT_, "too many nghbrs " + to_string(counter));
14066 if(bndryId > -1) {
14067 for(MInt srfc = 0; srfc < m_bndryCells->a[bndryId].m_noSrfcs; srfc++) {
14069 m_fvBndryCnd->m_bndryCells->a[bndryId].m_srfcVariables[srfc]->m_ghostCellId;
14071 }
14072 }
14073 MBool atInterface = false;
14074 for(MInt k = 0; k < counter; k++) {
14075 MInt nghbrId = nghbrList[k];
14076 if(nghbrId < 0) continue;
14077 if(a_hasProperty(nghbrId, SolverCell::IsInvalid)) continue;
14078 // if ( a_noReconstructionNeighbors( cellId ) >= m_cells.noRecNghbrs()) continue;
14081 if(a_noReconstructionNeighbors(cellId) > m_cells.noRecNghbrs()) {
14082 mTerm(1, AT_, "too many rec nghbrs " + to_string(cellId) + " " + to_string(counter));
14083 }
14084 if(a_level(nghbrId) < a_level(cellId)) atInterface = true;
14085 }
14086 if(diagonalCellAddition && atInterface) {
14087 const MInt counter2 = getAdjacentLeafCells<2>(cellId, 1, nghbrList, layerId);
14088 for(MInt k = 0; k < counter2; k++) {
14089 MInt nghbrId = nghbrList[k];
14090 if(nghbrId < 0) continue;
14091 if(a_hasProperty(nghbrId, SolverCell::IsInvalid)) continue;
14092 if(a_level(nghbrId) >= a_level(cellId)) continue;
14093 MBool exist = false;
14094 for(MInt i = 0; i < a_noReconstructionNeighbors(cellId); i++) {
14095 if(a_reconstructionNeighborId(cellId, i) == nghbrId) {
14096 exist = true;
14097 break;
14098 }
14099 }
14100 if(!exist) {
14103 }
14104 if(a_noReconstructionNeighbors(cellId) > m_cells.noRecNghbrs()) {
14105 mTerm(1, AT_, "too many rec nghbrs " + to_string(cellId) + " " + to_string(counter));
14106 }
14107 }
14108 }
14109 }
14110
14112 // internal master cells
14113 // add the slave ghost cells and neighbor boundary cells
14114 MInt noSmallCells = m_fvBndryCnd->m_smallBndryCells->size();
14115 for(MInt smallId = 0; smallId < noSmallCells; smallId++) {
14116 MInt smallCell = m_fvBndryCnd->m_smallBndryCells->a[smallId];
14117 MInt smallCellId = m_fvBndryCnd->m_bndryCells->a[smallCell].m_cellId;
14118 MInt masterCellId = m_fvBndryCnd->m_bndryCells->a[smallCell].m_linkedCellId;
14119 if(a_bndryId(masterCellId) == -1) {
14120 for(MInt i = 0; i < a_noReconstructionNeighbors(smallCellId); i++) {
14121 MInt nghbrId = a_reconstructionNeighborId(smallCellId, i);
14122 if(a_bndryId(nghbrId) > -1)
14123 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId > -1)
14124 nghbrId = m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId;
14125 MBool found = false;
14126 for(MInt j = 0; j < a_noReconstructionNeighbors(masterCellId); j++) {
14127 if(nghbrId == a_reconstructionNeighborId(masterCellId, j)) {
14128 found = true;
14129 break;
14130 }
14131 }
14132 if(!found && nghbrId != masterCellId) {
14133 a_reconstructionNeighborId(masterCellId, a_noReconstructionNeighbors(masterCellId)) = nghbrId;
14134 a_noReconstructionNeighbors(masterCellId)++;
14135 }
14136 }
14137 }
14138 }
14139 }
14140
14142}
List< MInt > * m_smallBndryCells
MInt c_noChildren(const MInt cellId) const
Returns the number of children of the cell cellId.
MInt & a_reconstructionNeighborId(const MInt cellId, const MInt nghbrNo)
Returns reconstruction neighbor n of the cell cellId.
MInt & a_noReconstructionNeighbors(const MInt cellId)
Returns the noRcnstrctnNghbrIds of the cell cellId.
T * a
Definition: list.h:28
MInt size()
Definition: list.h:20

◆ c_cellLengthAtCell()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::c_cellLengthAtCell ( const MInt  cellId) const
inline

Definition at line 577 of file fvcartesiansolverxd.h.

577 {
578 ASSERT(a_level(cellId) > 0, "Level-error");
579 return grid().cellLengthAtLevel(a_level(cellId));
580 }

◆ c_cellLengthAtLevel()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::c_cellLengthAtLevel ( const MInt  level) const
inline

Definition at line 582 of file fvcartesiansolverxd.h.

582{ return grid().cellLengthAtLevel(level); }

◆ c_cellVolumeAtLevel()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::c_cellVolumeAtLevel ( const MInt  level) const
inline

Definition at line 585 of file fvcartesiansolverxd.h.

585{ return grid().cellVolumeAtLevel(level); }

◆ c_childId()

template<MInt nDim_, class SysEqn >
MLong FvCartesianSolverXD< nDim_, SysEqn >::c_childId ( const MInt  cellId,
const MInt  pos 
) const
inline

Definition at line 564 of file fvcartesiansolverxd.h.

564 {
565 assertValidGridCellId(cellId);
566 return grid().tree().child(cellId, pos);
567 }

◆ c_coordinate()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::c_coordinate ( const MInt  cellId,
const MInt  dir 
) const
inline

Definition at line 520 of file fvcartesiansolverxd.h.

520 {
521 assertValidGridCellId(cellId);
522 return grid().tree().coordinate(cellId, dir);
523 }

◆ c_globalId()

template<MInt nDim_, class SysEqn >
MLong FvCartesianSolverXD< nDim_, SysEqn >::c_globalId ( const MInt  cellId) const
inline

Definition at line 552 of file fvcartesiansolverxd.h.

552 {
553 assertValidGridCellId(cellId);
554 return grid().tree().globalId(cellId);
555 }

◆ c_isLeafCell()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::c_isLeafCell ( const MInt  cellId) const
inline

Definition at line 525 of file fvcartesiansolverxd.h.

525{ return grid().tree().isLeafCell(cellId); }

◆ c_isToDelete()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::c_isToDelete ( const MInt  cellId) const
inline

Definition at line 595 of file fvcartesiansolverxd.h.

595 {
596 assertValidGridCellId(cellId);
597 return grid().tree().hasProperty(cellId, Cell::IsToDelete);
598 }

◆ c_level()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::c_level ( const MInt  cellId) const
inline

Definition at line 528 of file fvcartesiansolverxd.h.

528 {
529 assertValidGridCellId(cellId);
530 /* if ( a_isBndryGhostCell(cellId) || a_hasProperty( cellId, SolverCell::IsSplitChild ) ) {
531 const MInt aCellId = getAssociatedInternalCell(cellId);
532 assertValidGridCellId(aCellId);
533 return grid().tree().level(aCellId);
534 }
535 */
536 return grid().tree().level(cellId);
537 }

◆ c_neighborId()

template<MInt nDim_, class SysEqn >
MLong FvCartesianSolverXD< nDim_, SysEqn >::c_neighborId ( const MInt  cellId,
const MInt  dir,
const MBool  assertNeighborState = true 
) const
inline

Definition at line 570 of file fvcartesiansolverxd.h.

570 {
571 assertValidGridCellId(cellId);
572 if(assertNeighborState) assertDeleteNeighbor(cellId, dir);
573 return grid().tree().neighbor(cellId, dir);
574 }

◆ c_noChildren()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::c_noChildren ( const MInt  cellId) const
inline

Definition at line 540 of file fvcartesiansolverxd.h.

540 {
541 assertValidGridCellId(cellId);
542 return grid().tree().noChildren(cellId);
543 }

◆ c_parentId()

template<MInt nDim_, class SysEqn >
MLong FvCartesianSolverXD< nDim_, SysEqn >::c_parentId ( const MInt  cellId) const
inline

Definition at line 546 of file fvcartesiansolverxd.h.

546 {
547 assertValidGridCellId(cellId);
548 return grid().tree().parent(cellId);
549 }

◆ c_weight()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::c_weight ( const MInt  cellId) const
inline

Definition at line 558 of file fvcartesiansolverxd.h.

558 {
559 assertValidGridCellId(cellId);
560 return grid().tree().weight(cellId);
561 }

◆ calcLESAverage()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::calcLESAverage

Definition at line 37654 of file fvcartesiansolverxd.cpp.

37654 {
37655 TRACE();
37656
37657 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
37658
37659 MFloat avgFactor = getAveragingFactor();
37660
37661 for(MInt var = 0; var < noVariables(); var++) {
37662 for(MInt c = 0; c < (MInt)m_LESAverageCells.size(); c++) {
37664
37665 ASSERT(c < (MInt)m_LESVarAverage[var].size(),
37666 "Trying to access data [" + to_string(var) + "][" + to_string(c) + "] in m_LESVarAverage with length "
37667 + to_string(m_LESVarAverage[var].size()) + ", domainId: " + to_string(domainId()));
37668
37669 m_LESVarAverage[var][c] = avgFactor * a_pvariable(cellId, var) + (1 - avgFactor) * m_LESVarAverage[var][c];
37670 }
37671 }
37672
37673 MInt count = 0;
37674 MInt index = 0;
37675 for(MInt i = 0; i < nDim; i++) {
37676 for(MInt j = count; j < nDim; j++) {
37677 MInt indexAvg = index + noVariables() + m_averageReconstructNut[0];
37678 for(MInt c = 0; c < (MInt)m_LESAverageCells.size(); c++) {
37680
37681 ASSERT(c < (MInt)m_LESVarAverage[indexAvg].size(),
37682 "Trying to access data [" + to_string(indexAvg) + "][" + to_string(c)
37683 + "] in m_LESVarAverage with length " + to_string(m_LESVarAverage[indexAvg].size()));
37684
37685 m_LESVarAverage[indexAvg][c] = avgFactor * a_pvariable(cellId, i) * a_pvariable(cellId, j)
37686 + (1 - avgFactor) * m_LESVarAverage[indexAvg][c];
37687 }
37688 index++;
37689 }
37690 count++;
37691 }
37692}
std::vector< MInt > m_LESAverageCells
std::vector< MFloat > * m_LESVarAverage
MInt noVariables() const override
Return the number of primitive variables.
std::vector< MBool > m_averageReconstructNut
IdType index(const FloatType *const x, const IdType level)
Return Hilbert index for given location and level in 2D or 3D.
Definition: hilbert.h:165

◆ calcPeriodicSpongeAverage()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::calcPeriodicSpongeAverage

Definition at line 38163 of file fvcartesiansolverxd.cpp.

38163 {
38164 TRACE();
38165
38166 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
38167
38168 for(MInt i = 0; i < m_globalNoSpongeLocations; i++) {
38169 if(m_zonal) m_uvRans[i] = F0;
38170 for(MInt var = 0; var < m_LESNoVarAverage; var++) {
38171 m_LESPeriodicAverage[var][i] = F0;
38172 }
38173 }
38174
38175 if(m_spongeRank > -1) {
38176 for(MInt i = 0; i < m_globalNoSpongeLocations; i++) {
38177 for(MInt p = 0; p < (MInt)m_spongeAverageCellId[i].size(); p++) {
38179 // find index of cellId
38180 vector<MInt>::iterator findAvgId = find(m_LESAverageCells.begin(), m_LESAverageCells.end(), cellId);
38181 if(findAvgId != m_LESAverageCells.end()) {
38182 MInt avgId = distance(m_LESAverageCells.begin(), findAvgId);
38183 for(MInt var = 0; var < m_LESNoVarAverage; var++) {
38185 }
38186 if(m_zonal) {
38188 }
38189 }
38190 }
38191 }
38192
38193 for(MInt var = 0; var < m_LESNoVarAverage; var++) {
38194 MPI_Allreduce(MPI_IN_PLACE, m_LESPeriodicAverage[var], m_globalNoSpongeLocations, MPI_DOUBLE, MPI_SUM,
38195 m_spongeComm, AT_, "MPI_IN_PLACE", "m_LESPeriodicAverage[var]");
38196 }
38197
38198 if(m_zonal) {
38199 MPI_Allreduce(MPI_IN_PLACE, &m_uvRans[0], m_globalNoSpongeLocations, MPI_DOUBLE, MPI_SUM, m_spongeComm, AT_,
38200 "MPI_IN_PLACE", "m_uvRans");
38201 }
38202
38203 // calculate m_uvInt and m_uvErr
38204 for(MInt i = 0; i < m_globalNoSpongeLocations; i++) {
38205 MFloat uv_LES =
38207 m_uvErr[i] = m_uvRans[i] - uv_LES;
38208 if(abs(m_uvInt[i]) < m_spongeLimitFactor * abs(m_uvRans[i]) ||
38209 // if the sign is differnt, allow the integral to get smaller
38210 m_uvErr[i] * m_uvInt[i] < 1e-16) {
38211 m_uvInt[i] += timeStep() * m_uvErr[i];
38212 }
38213 }
38214 }
38215
38216 // broadcast to all
38217 for(MInt var = 0; var < m_LESNoVarAverage; var++) {
38219 "m_LESPeriodicAverage");
38220 }
38221 MPI_Bcast(&m_uvInt[0], m_globalNoSpongeLocations, MPI_DOUBLE, m_spongeRoot, mpiComm(), AT_, "m_uvInt");
38222 MPI_Bcast(&m_uvErr[0], m_globalNoSpongeLocations, MPI_DOUBLE, m_spongeRoot, mpiComm(), AT_, "m_uvErr");
38223
38224 if(m_STGSponge) {
38225 MFloat alpha = 10.0;
38226 MFloat beta = 2.0;
38227 // fill m_STGSpongeFactor
38228 for(MInt cellId = 0; cellId < c_noCells(); cellId++) {
38229 for(MInt i = 0; i < m_globalNoSpongeLocations; i++) {
38230 MFloat uv_LES =
38232 MFloat pos = m_globalSpongeLocations[i].first;
38233 if(approx(pos, a_coordinate(cellId, m_7901wallDir), 1e-16)) {
38234 for(MInt d = 0; d < nDim; d++) {
38235 // u - <u>_{z,t}
38237 }
38239 // e(y,t)
38241 // r(y,t)
38242 m_STGSpongeFactor[nDim + 1][cellId] = alpha * m_uvErr[i] + beta * m_uvInt[i];
38243 // debug: <u'v'>_{z,t}
38244 m_STGSpongeFactor[nDim + 2][cellId] = uv_LES;
38245 }
38246 }
38247 }
38248 }
38249}
std::vector< MFloat > * m_STGSpongeFactor
std::vector< MFloat > * m_RANSValues
std::vector< std::pair< MFloat, MFloat > > m_globalSpongeLocations
std::vector< MInt > * m_spongeAverageCellId
MFloat timeStep(MBool canSolver=false) noexcept
MBool approx(const T &, const U &, const T)
Definition: functions.h:272
int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, const MString &name, const MString &varname)
same as MPI_Bcast
MFloat distance(const MFloat *a, const MFloat *b)
Definition: maiamath.h:249

◆ calcSamplingVarAtPoint()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::calcSamplingVarAtPoint ( const MFloat point,
const MInt  id,
const MInt  sampleVarId,
MFloat state,
const MBool  interpolate = false 
)
overridevirtual

Definition at line 21269 of file fvcartesiansolverxd.cpp.

21271 {
21272 // Note: interpolateVariablesInCell() requires variables for all cells
21273 switch(sampleVarId) {
21274 case FV_PV: {
21275 if(interpolate) {
21276 const MInt noSpecies = PV->m_noSpecies;
21277 constexpr MInt noVarsNoSpecies = (nDim == 2) ? 4 : 5;
21278 // Function pointer to a_pvariable
21279 std::function<MFloat(const MInt, const MInt)> varPtr = [&](const MInt cellId_, const MInt varId_) {
21280 return static_cast<MFloat>(a_pvariable(cellId_, varId_));
21281 };
21282 if(noSpecies == 0) {
21283 ASSERT(noVarsNoSpecies == PV->noVariables, "wrong number of variables");
21284 interpolateVariablesInCell<0, noVarsNoSpecies>(id, point, varPtr, state);
21285 } else if(noSpecies == 1) {
21286 interpolateVariablesInCell<0, noVarsNoSpecies + 1>(id, point, varPtr, state);
21287 } else {
21288 mTerm(1, "Fixme: noSpecies > 1");
21289 }
21290 } else {
21291 const MInt noVars = PV->noVariables;
21292 std::copy_n(&a_pvariable(id, 0), noVars, state);
21293 }
21294 break;
21295 }
21296 case FV_VORT: {
21297 const MInt noVort = (nDim == 2) ? 1 : 3;
21298 if(interpolate) {
21299 std::function<MFloat(const MInt, const MInt)> vortPointer = [&](const MInt cellId_, const MInt varId_) {
21300 return m_samplingVariables[sampleVarId][cellId_][varId_];
21301 };
21302 interpolateVariablesInCell<0, noVort>(id, point, vortPointer, state);
21303 } else {
21304 const MFloat** vortPointer = const_cast<const MFloat**>(m_samplingVariables[sampleVarId]);
21305 std::copy_n(vortPointer[id], noVort, state);
21306 }
21307 break;
21308 }
21309 case FV_HEAT_RELEASE: {
21310 if(interpolate) {
21311 mTerm(1, "Fixme: interpolation of heat release");
21312 }
21313 state[0] = m_heatRelease[id];
21314 break;
21315 }
21316 default: {
21317 mTerm(1, "Invalid variable id");
21318 break;
21319 }
21320 }
21321}
std::array< MFloat **, s_maxNoSamplingVariables > m_samplingVariables
Storage for solver specific sampling variables.
@ FV_HEAT_RELEASE
Definition: enums.h:384
@ FV_VORT
Definition: enums.h:384
@ FV_PV
Definition: enums.h:384

◆ calcSamplingVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::calcSamplingVariables ( const std::vector< MInt > &  varIds,
const MBool  exchange 
)
overridevirtual

Calculate all additional sampling variables that can be evaluated by the sampling data features via calcSamplingVarAtPoint().

Definition at line 10670 of file fvcartesiansolverxd.cpp.

10670 {
10671 for(MUint i = 0; i < varIds.size(); i++) {
10672 const MInt varId = varIds[i];
10673 // Note: calcSamplingVariables() can be called from multiple features, check if sampling variable is already
10674 // computed and exchanged for this time step
10675 const MInt statusCurr = globalTimeStep;
10676 const MInt statusCalc = m_samplingVariablesStatus[2 * varId];
10677 const MInt statusExchange = m_samplingVariablesStatus[2 * varId + 1];
10678 TERMM_IF_COND(statusExchange == statusCurr && statusCalc != statusCurr,
10679 "Error: invalid compute/exchange order " + std::to_string(statusCurr) + " "
10680 + std::to_string(statusCalc) + " " + std::to_string(statusExchange));
10681
10682 switch(varId) {
10683 case FV_PV: {
10684 // Nothing to do
10685 break;
10686 }
10687 case FV_VORT: {
10688 MFloat* vortPointer = m_samplingVariables[varId][0];
10689 if(statusCurr != statusCalc) { // Check if already computed for the current time step
10690 m_log << "DEBUG calcSamplingVariables calc FV_VORT " << statusCurr << " " << statusCalc << std::endl;
10691 IF_CONSTEXPR(nDim == 3) { computeVorticity3DT(vortPointer); }
10692 else {
10693 computeVorticity2D(vortPointer);
10694 }
10695 m_samplingVariablesStatus[2 * varId] = statusCurr; // update computed status
10696 }
10697 // Exchange data on window/halo cells if requested (e.g. for least squares interpolation)
10698 if(exchange && statusCurr != statusExchange) { // check if already exchanged for the current time step
10699 constexpr MInt noVort = (nDim == 2) ? 1 : 3;
10700 exchangeDataFV(vortPointer, noVort);
10701 m_samplingVariablesStatus[2 * varId + 1] = statusCurr; // update exchanged status
10702 }
10703 break;
10704 }
10705 case FV_HEAT_RELEASE: {
10706 // heat release should already be computed
10707 break;
10708 }
10709 default: {
10710 mTerm(1, "Invalid variable id");
10711 break;
10712 }
10713 }
10714 }
10715}
std::array< MInt, 2 *s_maxNoSamplingVariables > m_samplingVariablesStatus
Status of sampling variables to check if variable is already computed and exchanged.
void computeVorticity2D(MFloat *const vorticity)
void computeVorticity3DT(MFloat *const vorticity)
Compute vorticity and store in vorticity pointer (transposed version)
void exchangeDataFV(T *data, const MInt blockSize=1, MBool cartesian=true, const std::vector< MInt > &rotIndex=std::vector< MInt >())
MInt globalTimeStep

◆ calcSlopesAfterStep()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::calcSlopesAfterStep ( )
inline

Definition at line 2161 of file fvcartesiansolverxd.h.

◆ calculateHeatRelease()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::calculateHeatRelease
Author
D.Zilles
Date
29.5.2017

param[out] heatRelease

Definition at line 8826 of file fvcartesiansolverxd.cpp.

8826 {
8827 IF_CONSTEXPR(isDetChem<SysEqn>) {
8828 for(MInt cellId = 0; cellId < a_noCells(); ++cellId) {
8829 const MFloat dampeningFactor = m_heatReleaseDamp ? m_dampFactor[cellId] : F1;
8830 m_heatRelease[cellId] = F0;
8831 for(MInt s = 0; s < m_noSpecies; ++s) {
8832 m_heatRelease[cellId] -= dampeningFactor * a_speciesReactionRate(cellId, s) * m_standardHeatFormation[s];
8833 }
8834 }
8835 }
8836 else {
8837 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
8839 * (F1 / (m_gamma - F1));
8840 }
8841 }
8842}
MFloat & a_reactionRate(const MInt cellId, const MInt reactionId)
Returns the reactionRate of the cell cellId for variables varId.

◆ cancelMpiRequests()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::cancelMpiRequests
overridevirtual

Cancel opened receive request that do not have a matching send initiated yet. Note: canceling send requests might cause MPI errors depending on the MPI implementation.

Reimplemented from Solver.

Definition at line 6540 of file fvcartesiansolverxd.cpp.

6540 {
6541 TRACE();
6542
6543 // Make sure all send requests are completed
6545 MPI_Waitall((MInt)m_maxLvlMpiSendNeighbor.size(), m_mpi_sendRequest, MPI_STATUSES_IGNORE, AT_);
6546 m_mpiSendRequestsOpen = false;
6547 }
6548
6549 // Cancel opened receive requests
6551 std::vector<MBool> waitForCancel(noNeighborDomains(), false);
6552 for(MInt i = 0; i < noNeighborDomains(); i++) {
6553 if(m_mpi_receiveRequest[i] != MPI_REQUEST_NULL) {
6555 waitForCancel[i] = true;
6556 }
6557 }
6558 // Wait for all requests until they are canceled
6559 for(MInt i = 0; i < noNeighborDomains(); i++) {
6560 if(waitForCancel[i]) {
6561 MPI_Wait(&m_mpi_receiveRequest[i], MPI_STATUS_IGNORE, AT_);
6562 }
6563 }
6564 m_mpiRecvRequestsOpen = false;
6565 }
6566}
std::vector< MInt > m_maxLvlMpiSendNeighbor
int MPI_Cancel(MPI_Request *request, const MString &name)
same as MPI_cancel
int MPI_Wait(MPI_Request *request, MPI_Status *status, const MString &name)
same as MPI_Wait
int MPI_Waitall(int count, MPI_Request *request, MPI_Status *status, const MString &name)
same as MPI_Waitall

◆ cellDataSizeDlb()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::cellDataSizeDlb ( const MInt  dataId,
const MInt  gridCellId 
)
override

Definition at line 10495 of file fvcartesiansolverxd.cpp.

10495 {
10496 // Inactive ranks do not have any data to communicate
10497 if(!isActive()) {
10498 return 0;
10499 }
10500
10501 // Convert to solver cell id and check
10502 const MInt cellId = grid().tree().grid2solver(gridCellId);
10503 if(cellId < 0 || cellId >= noInternalCells()) {
10504 return 0;
10505 }
10506
10507 MInt dataSize = 0;
10508
10509 switch(dataId) {
10510 case 0: // variables
10511 dataSize = CV->noVariables;
10512 break;
10513 /* case 1: // cell properties */
10514 /* dataSize = 1; */
10515 /* break; */
10516 default:
10517 mTerm(1, "Unknown data id.");
10518 break;
10519 }
10520
10521 return dataSize;
10522}

◆ cellDataTypeDlb()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::cellDataTypeDlb ( const MInt  dataId) const
inlineoverride

Definition at line 2386 of file fvcartesiansolverxd.h.

2386 {
2387 if(dataId != 0) {
2388 TERMM(1, "solverCelldataType: invalid data id");
2389 }
2390 return MFLOAT;
2391 };
@ MFLOAT
Definition: enums.h:269

◆ cellOutside() [1/2]

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::cellOutside ( const MFloat coords,
const MInt  level,
const MInt  gridCellId 
)
overridevirtual
Author
Lennart Schneiders

Reimplemented from Solver.

Definition at line 22981 of file fvcartesiansolverxd.cpp.

22981 {
22982 if(m_engineSetup) {
22983 return -1;
22984 }
22985
22986 MInt solverCellId = grid().tree().grid2solver(gridCellId);
22987 if(!grid().raw().m_allowInterfaceRefinement) return 0;
22988 if(!a_isInterface(solverCellId)) return 0;
22989 return m_fvBndryCnd->checkOutside(coords, level);
22990}
MBool a_isInterface(const MInt cellId) const
Returns isInterface of the cell cellId.

◆ cellOutside() [2/2]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::cellOutside ( const MInt  cellId)
Author
Lennart Schneiders

Definition at line 22969 of file fvcartesiansolverxd.cpp.

22969 {
22970 return m_fvBndryCnd->checkOutside(cellId);
22971}

◆ cellParticipatesInTimeStep()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::cellParticipatesInTimeStep ( MInt  cellId) const
protectednoexcept

Definition at line 21524 of file fvcartesiansolverxd.cpp.

21524 {
21525 // Skip cells in other MG levels:
21526 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
21527 return false;
21528 }
21529 // Skip ghost-cells? (TODO labels:FV,totest is this the proper check for that?)
21530 if(a_bndryId(cellId) < -1) {
21531 return false;
21532 }
21533 // TODO labels:FV,totest check how many testcases this breaks:
21534 // if (a_hasProperty(cellId, Cell:IsGhost)) { return false; }
21535
21536 // Skip small cells
21537 //
21538 // TODO labels:FV doesn't work with noMerging which has no master/slave cells, all
21539 // small cells have m_linkedCellId == -1, so right now they always participate
21540 // in the time-step computation. This will probably explode if one enables
21541 // volume weighting of boundary cells in combination with noMerging.
21542 if(a_bndryId(cellId) > -1 && m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_linkedCellId != -1) {
21543 return false;
21544 }
21545
21546 // Skip halo cells
21547 if(a_isHalo(cellId)) {
21548 return false;
21549 }
21550
21551 // skip cells which are inactive (negative ls-value)
21552 if(a_hasProperty(cellId, SolverCell::IsInactive)) {
21553 return false;
21554 }
21555
21556 // Skip cells which are stabilized by other means (smallCellCorrection, linking)
21557 if(a_hasProperty(cellId, SolverCell::IsTempLinked)) {
21558 return false;
21559 }
21560 if(a_hasProperty(cellId, SolverCell::IsSplitChild)) {
21561 return false;
21562 }
21564 && a_cellVolume(cellId) / grid().cellVolumeAtLevel(maxLevel()) <= m_fvBndryCnd->m_volumeLimitWall) {
21565 // maxLevelChange use maxLevel() instead of maxRefinementLevel!
21566 return false;
21567 }
21568
21569
21570 return true;
21571}
MBool a_isBndryCell(const MInt cellId) const override
Returns isBndryCell of the cell cellId.

◆ cellSurfaceMapping()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::cellSurfaceMapping

Definition at line 7187 of file fvcartesiansolverxd.cpp.

7187 {
7188 if(m_levelSetMb) return; // m_cellSurfaceMapping is filled in a different way inside the FvMb Solver
7189
7190 const MUint noSurfaces = a_noSurfaces();
7191
7192 for(MUint srfcId = 0; srfcId < noSurfaces; srfcId++) {
7193 const MInt orientation = a_surfaceOrientation(srfcId);
7194 const MInt nghbrId0 = a_surfaceNghbrCellId(srfcId, 0);
7195 const MInt nghbrId1 = a_surfaceNghbrCellId(srfcId, 1);
7196
7197 if(a_level(nghbrId1) > a_level(nghbrId0)) {
7198 m_cellSurfaceMapping[nghbrId0][2 * orientation + 1] = -1;
7199 m_cellSurfaceMapping[nghbrId1][2 * orientation] = srfcId;
7200 } else {
7201 m_cellSurfaceMapping[nghbrId0][2 * orientation + 1] = srfcId;
7202 m_cellSurfaceMapping[nghbrId1][2 * orientation] = -1;
7203 }
7204
7205 if(a_level(nghbrId0) == a_level(nghbrId1)) {
7206 m_cellSurfaceMapping[nghbrId0][2 * orientation + 1] = srfcId;
7207 m_cellSurfaceMapping[nghbrId1][2 * orientation] = srfcId;
7208 }
7209 }
7210}
MInt & a_surfaceNghbrCellId(const MInt srfcId, const MInt dir)
Returns the neighbor cell id of surface srfcId in direction dir.

◆ checkAzimuthalRecNghbrConsistency()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::checkAzimuthalRecNghbrConsistency ( MInt  cellId)

◆ checkCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::checkCells

Definition at line 32367 of file fvcartesiansolverxd.cpp.

32367 {
32368 TRACE();
32369
32370 IF_CONSTEXPR(nDim == 2)
32371 mTerm(1, "By now only used in 3D. If you want to use it in 2D,"
32372 " just remove this warning.");
32373
32374 MBool bndNghbr;
32375 // MBool invalidCells = false;
32376 MBool noNghbr;
32377 MInt nghbrId;
32378 MInt noCells = noInternalCells();
32379 //---
32380
32381 for(MInt id = 0; id < noCells; id++) {
32382 // edit claudia: do not reset property 8 (cell is valid) here!
32383 // invalid cells may also be detected during boundary cell preprocessing - this information
32384 // should not be lost!
32385 bndNghbr = false;
32386 noNghbr = false;
32387 if(a_bndryId(id) == -1) {
32388 for(MInt dir = 0; dir < m_noDirs; dir++) {
32389 if(a_hasNeighbor(id, dir) > 0) {
32390 nghbrId = c_neighborId(id, dir);
32391 if(a_bndryId(nghbrId) > -1) {
32392 bndNghbr = true;
32393 }
32394 } else {
32395 if(c_parentId(id) == -1) {
32396 noNghbr = true;
32397 } else if(a_hasNeighbor(c_parentId(id), dir) == 0) {
32398 noNghbr = true;
32399 }
32400 }
32401 }
32402 if(noNghbr && bndNghbr && !a_isPeriodic(id) && !a_hasProperty(id, SolverCell::IsCutOff)
32403 && !a_hasProperty(id, SolverCell::IsNotGradient) && c_noChildren(id) == 0) {
32404 a_hasProperty(id, SolverCell::IsInvalid) = true;
32405 // invalidCells = true;
32406 m_log << id << " is invalid";
32407 for(MInt spaceId = 0; spaceId < nDim; spaceId++)
32408 m_log << " " << a_coordinate(id, spaceId);
32409 m_log << endl;
32410 m_log << a_isInterface(id) << " " << a_isPeriodic(id) << " " << a_hasProperty(id, SolverCell::IsCutOff) << endl;
32411 for(MInt dir = 0; dir < m_noDirs; dir++) {
32412 if(a_hasNeighbor(id, dir) > 0) {
32413 m_log << "direction " << dir << " " << c_neighborId(id, dir) << " " << a_bndryId(c_neighborId(id, dir))
32414 << endl;
32415 }
32416 }
32417 a_variable(id, CV->RHO) = 2.0;
32418 }
32419 }
32420 }
32421 // if( invalidCells ) {
32422 // saveSolverSolution(1);
32423 // mTerm(1,AT_, "Invalid cells found, see log file for details - writing
32424 // output file");
32425 //
32426 // }
32427}
MLong c_neighborId(const MInt cellId, const MInt dir, const MBool assertNeighborState=true) const
Returns the grid neighbor id of the grid cell cellId dir.
MBool a_isPeriodic(const MInt cellId) const
Returns IsPeriodic of the cell cellId.
MLong c_parentId(const MInt cellId) const
Returns the grid parent id of the cell cellId.
static constexpr const MInt m_noDirs
MInt a_hasNeighbor(const MInt cellId, const MInt dir, const MBool assertNeighborState=true) const
Returns noNeighborIds of the cell CellId for direction dir.

◆ checkCellSurfaces()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::checkCellSurfaces
Author
Claudia Guenther, December 2008

Definition at line 12577 of file fvcartesiansolverxd.cpp.

12577 {
12578 const MInt noCells = a_noCells();
12579 const MInt noBndryCells = m_fvBndryCnd->m_bndryCells->size();
12580 const MInt noSrfcs = a_noSurfaces();
12581 MFloat* area = &a_surfaceArea(0);
12582 MFloatScratchSpace cellSurfaceAreas(noCells, nDim, AT_, "cellSurfaceAreas");
12583 MInt cellId0, cellId1;
12584 MFloat eps = 1e-20; // allow for a small difference which can be due to roundoff errors
12585 stringstream filename;
12586
12587 //---
12588
12589 // reset
12590 for(MInt cellId = 0; cellId < noCells; cellId++) {
12591 for(MInt i = 0; i < nDim; i++) {
12592 cellSurfaceAreas(cellId, i) = F0;
12593 }
12594 }
12595
12596 // compute the total area
12597 for(MInt s = 0; s < noSrfcs; s++) {
12598 cellId0 = a_surfaceNghbrCellId(s, 0);
12599 cellId1 = a_surfaceNghbrCellId(s, 1);
12600 if(cellId0 > noCells) continue;
12601 if(cellId1 > noCells) continue;
12602 cellSurfaceAreas(cellId0, a_surfaceOrientation(s)) += area[s];
12603 cellSurfaceAreas(cellId1, a_surfaceOrientation(s)) -= area[s];
12604 }
12605
12606 // correct surfaces which are connected to small cells
12607 for(MInt bndryId = 0; bndryId < noBndryCells; bndryId++) {
12608 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId == -1) continue;
12609 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId > noCells) continue;
12610 for(MInt dir = 0; dir < nDim; dir++) {
12611 cellSurfaceAreas(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId, dir) +=
12612 cellSurfaceAreas(m_fvBndryCnd->m_bndryCells->a[bndryId].m_cellId, dir);
12613 cellSurfaceAreas(m_fvBndryCnd->m_bndryCells->a[bndryId].m_cellId, dir) = F0;
12614 }
12615 }
12616
12617 for(MInt cellId = 0; cellId < noCells; cellId++) {
12618 for(MInt dir = 0; dir < nDim; dir++) {
12619 // only check cells which are regular computing cells (no ghost cells, multisolver halo cells etc...) -> can be
12620 // extended to moving boundary active cells
12621 if(abs(cellSurfaceAreas(cellId, dir)) > eps && a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)
12622 && !a_hasProperty(cellId, SolverCell::IsPeriodicWithRot) && (!a_isBndryGhostCell(cellId))
12623 && (!a_hasProperty(cellId, SolverCell::IsNotGradient)) && (!a_isHalo(cellId))) {
12624 // m_log << "[" << domainId() << "]: Cell Surfaces are not balanced! " <<
12625 // endl; m_log << "[" << domainId() << "]: CellId: " << cellId << ", Area: "
12626 // << cellSurfaceAreas(cellId, dir) << ", direction:" << dir << endl; m_log <<
12627 // "["
12628 // << domainId() << "]: ... is a boundary cell:" << (a_bndryId(cellId) >
12629 // -1) << endl;
12630 }
12631 }
12632 }
12633}
MInt size()
Definition: collector.h:29

◆ checkDiv()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::checkDiv ( )
inlinevirtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 1337 of file fvcartesiansolverxd.h.

1337{};

◆ checkForSrfcsMGC()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::checkForSrfcsMGC

corrected some inconsistencies which occur for complex geometries could also be used with the original method without multiple ghost cells

Author
changed by Claudia Guenther, December 2009

Definition at line 30782 of file fvcartesiansolverxd.cpp.

30782 {
30783 TRACE();
30784
30785 const MInt noCells = a_noCells();
30786 const MInt noBndryCells = m_fvBndryCnd->m_bndryCells->size();
30787 MBoolScratchSpace surfaceDenied(noBndryCells, m_noDirs, AT_, "surfaceDenied");
30788 MBoolScratchSpace surfaceCreated(noBndryCells, m_noDirs, AT_, "surfaceCreated");
30789 for(MInt i = 0; i < noBndryCells; i++) {
30790 for(MInt j = 0; j < m_noDirs; j++) {
30791 surfaceDenied(i, j) = false;
30792 surfaceCreated(i, j) = false;
30793 }
30794 }
30795
30796 MInt otherDir[2 * nDim];
30797 for(MInt dim = 0; dim < nDim; dim++) {
30798 otherDir[2 * dim] = 2 * dim + 1;
30799 otherDir[2 * dim + 1] = 2 * dim;
30800 }
30801
30803
30804 // store the surfaces of all boundary cells
30805 // here equal level neighbors are assumed!!!
30806 MInt counter = 0;
30807 for(MInt bndryId = 0; bndryId < noBndryCells; bndryId++) {
30808 const MInt cellId = m_fvBndryCnd->m_bndryCells->a[bndryId].m_cellId;
30809
30810 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
30811 continue;
30812 }
30813 for(MInt dirId = 0; dirId < m_noDirs; dirId++) {
30814 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_externalFaces[dirId]) {
30815 surfaceDenied(bndryId, dirId) = true;
30816 }
30817 MInt nghbrId;
30818 if(m_identNghbrIds[cellId * m_noDirs + dirId] < m_identNghbrIds[cellId * m_noDirs + dirId + 1]) {
30819 nghbrId = m_storeNghbrIds[m_identNghbrIds[cellId * m_noDirs + dirId]];
30820 if(a_level(cellId) < a_level(nghbrId)) {
30821 continue;
30822 }
30823 } else {
30824 continue;
30825 }
30826
30827 if(a_bndryId(nghbrId) < 0) {
30828 continue;
30829 }
30830
30831 MBool createSrfc = true;
30832
30833 MInt oldSrfcId = m_fvBndryCnd->m_bndryCells->a[bndryId].m_associatedSrfc[dirId];
30834 if(oldSrfcId >= 0) {
30835 ASSERT(a_surfaceNghbrCellId(oldSrfcId, 0) > -1 && a_surfaceNghbrCellId(oldSrfcId, 1) > -1, "");
30836 // check conditions for surface generation
30837 // (1) no master-slave interface
30838 // (2) no slave-slave interface if both slave cells have the same master
30839 // (3) no periodic-periodic interface
30840 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId > -1) {
30841 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId == nghbrId
30842 || m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId
30843 == m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId) {
30844 createSrfc = false;
30845 surfaceDenied(bndryId, dirId) = true;
30846 }
30847 }
30848 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId > -1) {
30849 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == (MInt)cellId
30850 || m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId
30851 == m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId) {
30852 createSrfc = false;
30853 surfaceDenied(bndryId, dirId) = true;
30854 }
30855 }
30856 if(a_isPeriodic(cellId) && a_isPeriodic(nghbrId)) {
30857 createSrfc = false;
30858 surfaceDenied(bndryId, dirId) = true;
30859 }
30860
30861 // do not create a surface between two halo cells
30862 // create a surface if slave-neighbor are both halo cells but the master is not
30863 if(a_isHalo(cellId) && a_isHalo(nghbrId)) {
30864 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId == -1
30865 && m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == -1) {
30866 createSrfc = false;
30867 surfaceDenied(bndryId, dirId) = true;
30868 }
30869 }
30870
30871 // this is valid for isotropical refinement only!!
30872 if(!createSrfc) {
30873 continue;
30874 }
30875
30876 if((a_level(cellId) > a_level(nghbrId)) || ((a_level(cellId) == a_level(nghbrId)) && dirId % 2 == 0)) {
30877 surfaceCreated(bndryId, dirId) = true;
30878
30879 if(oldSrfcId != counter) {
30880 m_surfaces.copy(oldSrfcId, counter);
30881 m_surfaces.erase(oldSrfcId);
30882 m_fvBndryCnd->m_bndryCells->a[bndryId].m_associatedSrfc[dirId] = counter;
30883 if(a_level(cellId) == a_level(nghbrId)) {
30884 m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_associatedSrfc[otherDir[dirId]] = counter;
30885 }
30886 }
30887 counter++;
30888 }
30889 }
30890 }
30891 }
30892
30893 // delete all other surfaces created in createCutFace
30894 while(a_noSurfaces() > counter) {
30895 MInt size = a_noSurfaces();
30896 m_surfaces.erase(size - 1);
30897 m_surfaces.size(size - 1);
30898 }
30899
30900 // set the offset of all boundary interfaces (important for mesh adaptation!)
30902
30903 // set srfcId
30904 MInt srfcId = a_noSurfaces();
30905 MLong sumSrfc = srfcId;
30906 MPI_Allreduce(MPI_IN_PLACE, &sumSrfc, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "sumSrfc");
30907 m_log << "DEBUG: " << sumSrfc << " number of surfaces after first loop" << endl;
30908
30909 MLong nmbr1 = 0;
30910 MLong nmbr2 = 0;
30911
30912 for(MInt cellId = 0; cellId < noCells; cellId++) {
30913 if(a_isBndryGhostCell(cellId)) {
30914 nmbr1++;
30915 continue;
30916 }
30917 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
30918 nmbr2++;
30919 continue;
30920 }
30921
30922 for(MInt dirId = 0; dirId < m_noDirs; dirId++) {
30923 for(MInt nghbr = m_identNghbrIds[cellId * m_noDirs + dirId];
30924 nghbr < m_identNghbrIds[cellId * m_noDirs + dirId + 1];
30925 nghbr++) {
30926 MBool createSrfc = false;
30927 const MInt nghbrId = m_storeNghbrIds[nghbr];
30928 ASSERT(nghbrId > -1, "");
30929 if(a_bndryId(cellId) > -1 && a_bndryId(nghbrId) > -1) {
30930 if((surfaceDenied(a_bndryId(cellId), dirId) == false
30931 || surfaceDenied(a_bndryId(nghbrId), otherDir[dirId]) == false)
30932 && (surfaceCreated(a_bndryId(cellId), dirId) == false
30933 && surfaceCreated(a_bndryId(nghbrId), otherDir[dirId]) == false)) {
30934 createSrfc = true;
30935 }
30936 }
30937
30938 if(a_bndryId(cellId) == -1 || a_bndryId(nghbrId) == -1) {
30939 createSrfc = true;
30940 }
30941
30942 if(createSrfc) {
30943 // create one surface if the desicive level of the current cell is
30944 // less than the one from its neighbor
30945
30946 // do not create a surface between the master and the linked cell
30947 if(a_bndryId(cellId) > -1) {
30948 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_linkedCellId == nghbrId) {
30949 createSrfc = false;
30950 }
30951 }
30952
30953 if(a_bndryId(nghbrId) > -1) {
30954 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == cellId) {
30955 createSrfc = false;
30956 }
30957 }
30958
30959 // do not create a surface between periodic cells
30960 if(a_isPeriodic(cellId) && a_isPeriodic(nghbrId)) {
30961 createSrfc = false;
30962 }
30963
30964 // do not create a surface between two halo cells
30965 if(a_isHalo(cellId) && a_isHalo(nghbrId)) {
30966 createSrfc = false;
30967 }
30968
30969 // this is valid for isotropical refinement only!!
30970 if(createSrfc) {
30971 if((a_level(cellId) > a_level(nghbrId)) || ((a_level(cellId) == a_level(nghbrId)) && dirId % 2 == 0)) {
30972 computeSrfcs(cellId, nghbrId, dirId, srfcId);
30973 srfcId++;
30974 }
30975 }
30976 }
30977 }
30978 }
30979 }
30980
30981 for(MInt srfc = 0; srfc < a_noSurfaces(); srfc++) {
30982 MInt nghbr0 = a_surfaceNghbrCellId(srfc, 0);
30983 MInt nghbr1 = a_surfaceNghbrCellId(srfc, 1);
30984 MInt dir = a_surfaceOrientation(srfc);
30985 MInt dir0 = 2 * dir + 1;
30986 MInt dir1 = 2 * dir;
30987 if(a_bndryId(nghbr0) > -1) {
30988 m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbr0)].m_associatedSrfc[dir0] = srfc;
30989 }
30990 if(a_bndryId(nghbr1) > -1) {
30991 m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbr1)].m_associatedSrfc[dir1] = srfc;
30992 }
30993 }
30994 sumSrfc = a_noSurfaces();
30995 MPI_Allreduce(MPI_IN_PLACE, &sumSrfc, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "sumSrfc");
30996 MPI_Allreduce(MPI_IN_PLACE, &nmbr1, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "nmbr1");
30997 MPI_Allreduce(MPI_IN_PLACE, &nmbr2, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "nmbr2");
30998 m_log << "DEBUG: " << nmbr1 << " number of cells skipped: boundaryId ==-2" << endl;
30999 m_log << "DEBUG: " << nmbr2 << " number of cells skipped: IsOnCurrentMGLevel" << endl;
31000 m_log << "DEBUG: " << sumSrfc << " number of surfaces after second loop" << endl;
31001 return;
31002}
void computeSrfcs(MInt, MInt, MInt, MInt)
void erase(const MInt begin, const MInt end)
Erase nodes in range [begin, end) and update parent/child/neighbor information.
Definition: container.h:335
void copy(const T &source, const MInt begin, const MInt end, const MInt to)
Copy nodes to another location without changing any parent/child/neighbor information.
Definition: container.h:253

◆ checkForSrfcsMGC_2()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::checkForSrfcsMGC_2

Definition at line 31008 of file fvcartesiansolverxd.cpp.

31008 {
31009 IF_CONSTEXPR(nDim == 2) { mTerm(1, "Only available in 3D. MGC not yet implemented in 2D."); }
31010 else {
31012 }
31013}
void checkForSrfcsMGC_2_()
Check all existing cells if surfaces have to be created member function with the task to check all ex...

◆ checkForSrfcsMGC_2_()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::checkForSrfcsMGC_2_
inline

corrected some inconsistencies which occur for complex geometries could also be used with the original method without multiple ghost cells adapted to split cells

Author
changed by Claudia Guenther, December 2009
Todo:
labels:FV change allocation of memory for surfaceDenied and surfaceCreated (avoid new())

Definition at line 31029 of file fvcartesiansolverxd.cpp.

31029 {
31030 TRACE();
31031 MBool createSrfc = true;
31032 MInt cell, counter;
31033 MInt srfcId, bndryId2, cell2;
31034 MInt nghbrId = 0, oldSrfcId, size;
31035 MInt noCells = a_noCells();
31036 MInt noBndryCells = m_fvBndryCnd->m_bndryCells->size();
31037 MBool** surfaceDenied = new MBool*[noBndryCells];
31038 MBoolScratchSpace surfaceDenied_scratch(noBndryCells * m_noDirs, AT_, "surfaceDenied_scratch");
31039 for(MInt i = 0; i < noBndryCells; i++) {
31040 surfaceDenied[i] = &surfaceDenied_scratch.p[m_noDirs * i];
31041 for(MInt j = 0; j < m_noDirs; j++) {
31042 surfaceDenied[i][j] = false;
31043 }
31044 }
31045 MBool** surfaceCreated = new MBool*[noBndryCells];
31046 MBoolScratchSpace surfaceCreated_scratch(noBndryCells * m_noDirs, AT_, "surfaceCreated_scratch");
31047 for(MInt i = 0; i < noBndryCells; i++) {
31048 surfaceCreated[i] = &surfaceCreated_scratch.p[m_noDirs * i];
31049 for(MInt j = 0; j < m_noDirs; j++) {
31050 surfaceCreated[i][j] = false;
31051 }
31052 }
31053 constexpr MInt otherDir[] = {1, 0, 3, 2, 5, 4};
31054 MInt nghbr0, nghbr1;
31055 //---
31056
31058
31059 // store the surfaces of all boundary cells
31060 // here equal level neighbors are assumed!!!
31061 counter = 0;
31062 for(MInt bndryId = 0; bndryId < noBndryCells; bndryId++) {
31063 cell = m_fvBndryCnd->m_bndryCells->a[bndryId].m_cellId;
31064
31065 if(m_fvBndryCnd->m_splitParents[bndryId] >= 0) {
31066 continue;
31067 }
31068 if(!a_hasProperty(cell, SolverCell::IsInvalid)) {
31069 if(a_hasProperty(cell, SolverCell::IsOnCurrentMGLevel)) {
31070 for(MInt dirId = 0; dirId < m_noDirs; dirId++) {
31071 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_externalFaces[dirId]) {
31072 surfaceDenied[bndryId][dirId] = true;
31073 }
31074 if(m_identNghbrIds[cell * m_noDirs + dirId] < m_identNghbrIds[cell * m_noDirs + dirId + 1]) {
31075 nghbrId = m_storeNghbrIds[m_identNghbrIds[cell * m_noDirs + dirId]];
31076 if(a_level(cell) < a_level(nghbrId)) {
31077 continue;
31078 }
31079 } else {
31080 continue;
31081 }
31082
31083 if(a_bndryId(nghbrId) < 0) {
31084 continue;
31085 }
31086
31087 if(a_hasProperty(nghbrId, SolverCell::IsInvalid)) {
31088 continue;
31089 }
31090 createSrfc = true;
31091
31092 // check if surface is a split surface - if yes, take care of the other neighbor, too;
31093 oldSrfcId = m_fvBndryCnd->m_bndryCells->a[bndryId].m_associatedSrfc[dirId];
31094 if(oldSrfcId >= 0) {
31095 // check conditions for surface generation
31096 // (1) no master-slave interface
31097 // (2) no slave-slave interface if both slave cells have the same master
31098 // (3) no periodic-periodic interface
31099 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId > -1) {
31100 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId == nghbrId
31101 || m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId
31102 == m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId) {
31103 createSrfc = false;
31104 surfaceDenied[bndryId][dirId] = true;
31105 }
31106 }
31107 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId > -1) {
31108 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == (MInt)cell
31109 || m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId
31110 == m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId) {
31111 createSrfc = false;
31112 surfaceDenied[bndryId][dirId] = true;
31113 }
31114 }
31115 if(a_isPeriodic(cell) && a_isPeriodic(nghbrId)) {
31116 createSrfc = false;
31117 surfaceDenied[bndryId][dirId] = true;
31118 }
31119
31120 // do not create a surface between two halo cells
31121 // create a surface if slave-neighbor are both halo cells but the master is not
31122 if(a_isHalo(cell) && a_isHalo(nghbrId)) {
31123 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId == -1
31124 && m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == -1) {
31125 createSrfc = false;
31126 surfaceDenied[bndryId][dirId] = true;
31127 }
31128 }
31129
31130 // this is valid for isotropical refinement only!!
31131 if(!createSrfc) {
31132 continue;
31133 }
31134
31135 oldSrfcId = m_fvBndryCnd->m_bndryCells->a[bndryId].m_associatedSrfc[dirId];
31136
31137 if((a_level(cell) > a_level(nghbrId)) || ((a_level(cell) == a_level(nghbrId)) && dirId % 2 == 0)) {
31138 surfaceCreated[bndryId][dirId] = true;
31139
31140 if(oldSrfcId != counter) {
31141 m_surfaces.copy(oldSrfcId, counter);
31142 m_surfaces.erase(oldSrfcId);
31143 m_fvBndryCnd->m_bndryCells->a[bndryId].m_associatedSrfc[dirId] = counter;
31144 if(a_level(cell) == a_level(nghbrId)) {
31145 m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_associatedSrfc[otherDir[dirId]] = counter;
31146 }
31147 }
31148 counter++;
31149 }
31150 } else if(oldSrfcId < -1) { // split surface, check both neighbors
31151
31152 // first surface:
31153 srfcId = m_fvBndryCnd->m_splitSurfaces[-oldSrfcId * 6];
31154 nghbr0 = a_surfaceNghbrCellId(srfcId, 0);
31155 nghbr1 = a_surfaceNghbrCellId(srfcId, 1);
31156 if(nghbr0 == cell) {
31157 nghbrId = nghbr1;
31158 } else {
31159 nghbrId = nghbr0;
31160 }
31161
31162 // check conditions for surface generation
31163 // (1) no master-slave interface
31164 // (2) no slave-slave interface if both slave cells have the same master
31165 // (3) no periodic-periodic interface
31166 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId > -1) {
31167 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId == nghbrId
31168 || m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId
31169 == m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId) {
31170 createSrfc = false;
31171 surfaceDenied[bndryId][dirId] = true;
31172 }
31173 }
31174 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId > -1) {
31175 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == (MInt)cell
31176 || m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId
31177 == m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId) {
31178 createSrfc = false;
31179 surfaceDenied[bndryId][dirId] = true;
31180 }
31181 }
31182 if(a_isPeriodic(cell) && a_isPeriodic(nghbrId)) {
31183 createSrfc = false;
31184 surfaceDenied[bndryId][dirId] = true;
31185 }
31186
31187 // do not create a surface between two halo cells
31188 // create a surface if slave-neighbor are both halo cells but the master is not
31189 if(a_isHalo(cell) && a_isHalo(nghbrId)) {
31190 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId == -1
31191 && m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == -1) {
31192 createSrfc = false;
31193 surfaceDenied[bndryId][dirId] = true;
31194 }
31195 }
31196
31197 // this is valid for isotropical refinement only!!
31198 if(!createSrfc) {
31199 continue;
31200 }
31201
31202 // check validity of first surface:
31203 if((a_level(cell) > a_level(nghbrId)) || ((a_level(cell) == a_level(nghbrId)) && dirId % 2 == 0)) {
31204 surfaceCreated[bndryId][dirId] = true;
31205
31206 if(srfcId != counter) {
31207 m_surfaces.copy(srfcId, counter);
31208 m_surfaces.erase(srfcId);
31209 m_fvBndryCnd->m_splitSurfaces[-oldSrfcId * 6] = counter;
31210 }
31211 counter++;
31212 }
31213
31214 // second surface:
31215 srfcId = m_fvBndryCnd->m_splitSurfaces[-oldSrfcId * 6 + 3];
31216 nghbr0 = a_surfaceNghbrCellId(srfcId, 0);
31217 nghbr1 = a_surfaceNghbrCellId(srfcId, 1);
31218 if(nghbr0 == cell) {
31219 nghbrId = nghbr1;
31220 } else {
31221 nghbrId = nghbr0;
31222 }
31223
31224 // check conditions for surface generation
31225 // (1) no master-slave interface
31226 // (2) no slave-slave interface if both slave cells have the same master
31227 // (3) no periodic-periodic interface
31228 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId > -1) {
31229 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId == nghbrId
31230 || m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId
31231 == m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId) {
31232 createSrfc = false;
31233 surfaceDenied[bndryId][dirId] = true;
31234 }
31235 }
31236 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId > -1) {
31237 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == (MInt)cell
31238 || m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId
31239 == m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId) {
31240 createSrfc = false;
31241 surfaceDenied[bndryId][dirId] = true;
31242 }
31243 }
31244 if(a_isPeriodic(cell) && a_isPeriodic(nghbrId)) {
31245 createSrfc = false;
31246 surfaceDenied[bndryId][dirId] = true;
31247 }
31248
31249 // do not create a surface between two halo cells
31250 // create a surface if slave-neighbor are both halo cells but the master is not
31251 if(a_isHalo(cell) && a_isHalo(nghbrId)) {
31252 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId == -1
31253 && m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == -1) {
31254 createSrfc = false;
31255 surfaceDenied[bndryId][dirId] = true;
31256 }
31257 }
31258
31259 // this is valid for isotropical refinement only!!
31260 if(!createSrfc) {
31261 continue;
31262 }
31263
31264 // check validity of second surface:
31265 if((a_level(cell) > a_level(nghbrId)) || ((a_level(cell) == a_level(nghbrId)) && dirId % 2 == 0)) {
31266 surfaceCreated[bndryId][dirId] = true;
31267
31268 if(srfcId != counter) {
31269 m_surfaces.copy(srfcId, counter);
31270 m_surfaces.erase(srfcId);
31271 m_fvBndryCnd->m_splitSurfaces[-oldSrfcId * 6 + 3] = counter;
31272 }
31273 counter++;
31274 }
31275 }
31276 }
31277 }
31278 }
31279 for(MInt child = 0; child < 3; child++) {
31280 bndryId2 = m_fvBndryCnd->m_splitChildren[bndryId * 3 + child];
31281 if(bndryId2 == -1) {
31282 break;
31283 }
31284 cell2 = m_fvBndryCnd->m_bndryCells->a[bndryId2].m_cellId;
31285 if(!a_hasProperty(cell2, SolverCell::IsInvalid)) {
31286 for(MInt dirId = 0; dirId < m_noDirs; dirId++) {
31287 if(m_fvBndryCnd->m_bndryCells->a[bndryId2].m_externalFaces[dirId]) {
31288 surfaceDenied[bndryId2][dirId] = true;
31289 }
31290 if(m_identNghbrIds[cell2 * m_noDirs + dirId] < m_identNghbrIds[cell2 * m_noDirs + dirId + 1]) {
31291 nghbrId = m_storeNghbrIds[m_identNghbrIds[cell2 * m_noDirs + dirId]];
31292 if(a_level(cell2) < a_level(nghbrId)) {
31293 continue;
31294 }
31295 } else {
31296 continue;
31297 }
31298
31299 if(a_bndryId(nghbrId) < 0) {
31300 continue;
31301 }
31302 createSrfc = true;
31303
31304 // check conditions for surface generation
31305 // (1) no master-slave interface
31306 // (2) no slave-slave interface if both slave cells have the same master
31307 // (3) no periodic-periodic interface
31308 if(m_fvBndryCnd->m_bndryCells->a[bndryId2].m_linkedCellId > -1) {
31309 if(m_fvBndryCnd->m_bndryCells->a[bndryId2].m_linkedCellId == nghbrId
31310 || m_fvBndryCnd->m_bndryCells->a[bndryId2].m_linkedCellId
31311 == m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId) {
31312 createSrfc = false;
31313 surfaceDenied[bndryId2][dirId] = true;
31314 }
31315 }
31316 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId > -1) {
31317 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == (MInt)cell2
31318 || m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId
31319 == m_fvBndryCnd->m_bndryCells->a[bndryId2].m_linkedCellId) {
31320 createSrfc = false;
31321 surfaceDenied[bndryId2][dirId] = true;
31322 }
31323 }
31324 if(a_isPeriodic(cell2) && a_isPeriodic(nghbrId)) {
31325 createSrfc = false;
31326 surfaceDenied[bndryId2][dirId] = true;
31327 }
31328
31329 // do not create a surface between two halo cells
31330 // create a surface if slave-neighbor are both halo cells but the master is not
31331 if(a_isHalo(cell2) && a_isHalo(nghbrId)) {
31332 if(m_fvBndryCnd->m_bndryCells->a[bndryId2].m_linkedCellId == -1
31333 && m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == -1) {
31334 createSrfc = false;
31335 surfaceDenied[bndryId2][dirId] = true;
31336 }
31337 }
31338
31339 // this is valid for isotropical refinement only!!
31340 if(!createSrfc) {
31341 continue;
31342 }
31343
31344
31345 oldSrfcId = m_fvBndryCnd->m_bndryCells->a[bndryId2].m_associatedSrfc[dirId];
31346
31347 if(oldSrfcId == -1) {
31348 continue;
31349 }
31350
31351 if(oldSrfcId >= 0) {
31352 // create surface if its is no split surface:
31353
31354 if((a_level(cell2) > a_level(nghbrId)) || ((a_level(cell2) == a_level(nghbrId)) && dirId % 2 == 0)) {
31355 surfaceCreated[bndryId2][dirId] = true;
31356
31357 if(oldSrfcId != counter) {
31358 m_surfaces.copy(oldSrfcId, counter);
31359 m_surfaces.erase(oldSrfcId);
31360 m_fvBndryCnd->m_bndryCells->a[bndryId2].m_associatedSrfc[dirId] = counter;
31361 if(a_level(cell2) == a_level(nghbrId)) {
31362 m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_associatedSrfc[otherDir[dirId]] = counter;
31363 }
31364 }
31365 counter++;
31366 }
31367 }
31368 }
31369 }
31370 }
31371 }
31372
31373 createSrfc = false;
31374
31375 // delete all other surfaces created in createCutFace
31376 while(a_noSurfaces() > counter) {
31377 size = a_noSurfaces();
31378 m_surfaces.erase(size - 1);
31379 m_surfaces.size(size - 1);
31380 }
31381
31382 // set the offset of all boundary interfaces (important for mesh adaptation!)
31384
31385 // set srfcId
31386 srfcId = a_noSurfaces();
31387
31388 for(MInt cellId = 0; cellId < noCells; cellId++) {
31389 if(a_isBndryGhostCell(cellId)) {
31390 continue;
31391 }
31392 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
31393 continue;
31394 }
31395
31396 for(MInt dirId = 0; dirId < m_noDirs; dirId++) {
31397 for(MInt nghbr = m_identNghbrIds[cellId * m_noDirs + dirId];
31398 nghbr < m_identNghbrIds[cellId * m_noDirs + dirId + 1];
31399 nghbr++) {
31400 createSrfc = false;
31401 nghbrId = m_storeNghbrIds[nghbr];
31402
31403 if(a_bndryId(cellId) > -1 && a_bndryId(nghbrId) > -1) {
31404 if((surfaceDenied[a_bndryId(cellId)][dirId] == false
31405 || surfaceDenied[a_bndryId(nghbrId)][otherDir[dirId]] == false)
31406 && (surfaceCreated[a_bndryId(cellId)][dirId] == false
31407 && surfaceCreated[a_bndryId(nghbrId)][otherDir[dirId]] == false)) {
31408 createSrfc = true;
31409 }
31410 }
31411
31412 if(a_bndryId(cellId) == -1 || a_bndryId(nghbrId) == -1) {
31413 createSrfc = true;
31414 }
31415
31416 if(createSrfc) {
31417 // create one surface if the desicive level of the current cell is
31418 // less than the one from its neighbor
31419
31420 // do not create a surface between the master and the linked cell
31421 if(a_bndryId(cellId) > -1) {
31422 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_linkedCellId == nghbrId) {
31423 createSrfc = false;
31424 }
31425 }
31426
31427 if(a_bndryId(nghbrId) > -1) {
31428 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrId)].m_linkedCellId == cellId) {
31429 createSrfc = false;
31430 }
31431 }
31432
31433 // do not create a surface between periodic cells
31434 if(a_isPeriodic(cellId) && a_isPeriodic(nghbrId)) {
31435 createSrfc = false;
31436 }
31437
31438 // do not create a surface between two halo cells
31439 if(a_isHalo(cellId) && a_isHalo(nghbrId)) {
31440 createSrfc = false;
31441 }
31442
31443 // this is valid for isotropical refinement only!!
31444 if(createSrfc) {
31445 if((a_level(cellId) > a_level(nghbrId)) || ((a_level(cellId) == a_level(nghbrId)) && dirId % 2 == 0)) {
31446 computeSrfcs(cellId, nghbrId, dirId, srfcId);
31447
31448 srfcId++;
31449 }
31450 }
31451 }
31452 }
31453 }
31454 }
31455 delete[] surfaceDenied;
31456 surfaceDenied = 0;
31457 delete[] surfaceCreated;
31458 surfaceCreated = 0;
31459
31460 for(MInt srfc = 0; srfc < a_noSurfaces(); srfc++) {
31461 nghbr0 = a_surfaceNghbrCellId(srfc, 0);
31462 nghbr1 = a_surfaceNghbrCellId(srfc, 1);
31463 MInt dir = a_surfaceOrientation(srfc);
31464 MInt dir0 = 2 * dir + 1;
31465 MInt dir1 = 2 * dir;
31466 if(a_bndryId(nghbr0) > -1) {
31467 m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbr0)].m_associatedSrfc[dir0] = srfc;
31468 }
31469 if(a_bndryId(nghbr1) > -1) {
31470 m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbr1)].m_associatedSrfc[dir1] = srfc;
31471 }
31472 }
31473 return;
31474}

◆ checkGhostCellIntegrity()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::checkGhostCellIntegrity
Author
Thomas Schilden, 5.9.17

Definition at line 8144 of file fvcartesiansolverxd.cpp.

8144 {
8145 TRACE();
8146 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
8147 const MBool isGhost = a_isBndryGhostCell(cellId);
8148 const MInt boundaryId = a_bndryId(cellId);
8149 if((isGhost && boundaryId != -2) || (!isGhost && boundaryId == -2)) {
8150 cout << "ERROR: globalId: " << c_globalId(cellId) << " " << isGhost << " " << boundaryId << endl;
8151 mTerm(1, AT_, "ERROR in checkGhostCellIntegrity");
8152 }
8153 }
8154}

◆ checkInfinityVarsConsistency()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::checkInfinityVarsConsistency

Definition at line 30235 of file fvcartesiansolverxd.cpp.

30235 {
30236 TRACE();
30237
30238 std::vector<MFloat> infVars{};
30239 std::vector<MString> infVarNames{};
30240
30241 infVars.push_back(m_UInfinity);
30242 infVarNames.push_back("m_UInfinity");
30243 infVars.push_back(m_VInfinity);
30244 infVarNames.push_back("m_VInfinity");
30245 IF_CONSTEXPR(nDim == 3) {
30246 infVars.push_back(m_WInfinity);
30247 infVarNames.push_back("m_WInfinity");
30248 }
30249 infVars.push_back(m_PInfinity);
30250 infVarNames.push_back("m_PInfinity");
30251 infVars.push_back(m_TInfinity);
30252 infVarNames.push_back("m_TInfinity");
30253 infVars.push_back(m_DthInfinity);
30254 infVarNames.push_back("m_DthInfinity");
30255 infVars.push_back(sysEqn().m_muInfinity);
30256 infVarNames.push_back("m_muInfinity");
30257 infVars.push_back(m_DInfinity);
30258 infVarNames.push_back("m_DInfinity");
30259 infVars.push_back(m_SInfinity);
30260 infVarNames.push_back("m_SInfinity");
30261 infVars.push_back(m_hInfinity);
30262 infVarNames.push_back("m_hInfinity");
30263
30264 infVars.push_back(m_VVInfinity[0]);
30265 infVarNames.push_back("m_VVInfinity[0]");
30266 infVars.push_back(m_VVInfinity[1]);
30267 infVarNames.push_back("m_VVInfinity[1]");
30268 IF_CONSTEXPR(nDim == 3) {
30269 infVars.push_back(m_VVInfinity[2]);
30270 infVarNames.push_back("m_VVInfinity[2]");
30271 }
30272
30273 infVars.push_back(m_rhoUInfinity);
30274 infVarNames.push_back("m_rhoUInfinity");
30275 infVars.push_back(m_rhoVInfinity);
30276 infVarNames.push_back("m_rhoVInfinity");
30277 IF_CONSTEXPR(nDim == 3) {
30278 infVars.push_back(m_rhoWInfinity);
30279 infVarNames.push_back("m_rhoWInfinity");
30280 }
30281 infVars.push_back(m_rhoEInfinity);
30282 infVarNames.push_back("m_rhoEInfinity");
30283 infVars.push_back(m_rhoInfinity);
30284 infVarNames.push_back("m_rhoInfinity");
30285
30286 infVars.push_back(m_rhoVVInfinity[0]);
30287 infVarNames.push_back("m_rhoVVInfinity[0]");
30288 infVars.push_back(m_rhoVVInfinity[1]);
30289 infVarNames.push_back("m_rhoVVInfinity[1]");
30290 IF_CONSTEXPR(nDim == 3) {
30291 infVars.push_back(m_rhoVVInfinity[2]);
30292 infVarNames.push_back("m_rhoVVInfinity[2]");
30293 }
30294
30295 infVars.push_back(m_Ma);
30296 infVarNames.push_back("m_Ma");
30297 infVars.push_back(sysEqn().m_Re0);
30298 infVarNames.push_back("m_Re0");
30299 infVars.push_back(m_rRe0);
30300 infVarNames.push_back("m_rRe0");
30301 infVars.push_back(m_timeRef);
30302 infVarNames.push_back("m_timeRef");
30303 infVars.push_back(m_deltaP);
30304 infVarNames.push_back("m_deltaP");
30305 infVars.push_back(m_strouhal);
30306 infVarNames.push_back("m_strouhal");
30307 infVars.push_back(m_timeStep);
30308 infVarNames.push_back("m_timeStep");
30309
30310 // TODO labels:FV,COMM add missing variables!
30311
30312 const MInt noInfVars = infVars.size();
30313 std::vector<MFloat> recvInfVars(noInfVars);
30314
30315 if(infVars.size() != infVarNames.size()) {
30316 mTerm(1, "number of infinity variables mismatch");
30317 }
30318
30319 if(domainId() == 0) {
30320 std::copy(infVars.begin(), infVars.end(), recvInfVars.begin());
30321 } else {
30322 std::fill(recvInfVars.begin(), recvInfVars.end(), -1.0);
30323 }
30324
30325 MPI_Bcast(&recvInfVars[0], noInfVars, maia::type_traits<MFloat>::mpiType(), 0, mpiComm(), AT_, "recvInfVars[0]");
30326
30327 for(MInt i = 0; i < noInfVars; i++) {
30328 // Catch NaNs, might be used to invalidate some variables and prevent/detect their usage
30329 if(std::isnan(recvInfVars[i]) && std::isnan(infVars[i])) {
30330 const MString msg =
30331 "Infinity variable '" + infVarNames[i] + "' is NaN on multiple ranks, check if this is correct!";
30332 m_log << msg << std::endl;
30333 if(domainId() == 0) {
30334 std::cerr << msg << std::endl;
30335 }
30336 continue;
30337 }
30338 if(!approx(recvInfVars[i], infVars[i], MFloatEps)) {
30339 mTerm(1, "Infinity variable '" + infVarNames[i]
30340 + "' is inconsistent among ranks, domainId=" + std::to_string(domainId())
30341 + ", value=" + std::to_string(infVars[i]) + ", recvValue=" + std::to_string(recvInfVars[i]));
30342 }
30343 }
30344}
std::basic_string< char > MString
Definition: maiatypes.h:55

◆ checkNeighborActive()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::checkNeighborActive ( const MInt  cellId,
const MInt  dir 
) const
inline

Definition at line 509 of file fvcartesiansolverxd.h.

509 {
510 if(m_deleteNeighbour && a_hasProperty(cellId, SolverCell::IsBndryActive) && grid().tree().hasNeighbor(cellId, dir)
511 && a_hasProperty(grid().tree().neighbor(cellId, dir), SolverCell::IsInactive)) {
512 return false;
513 }
514
515 assertDeleteNeighbor(cellId, dir);
516 return true;
517 }

◆ cleanUp()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::cleanUp ( )
inlineoverridevirtual

Implements Solver.

Definition at line 1326 of file fvcartesiansolverxd.h.

1326 {
1327 // Finalize communication
1329 };
void finalizeMpiExchange()
Finalize non-blocking MPI communication (cancel open requests, free all requests)

◆ compute1DFlameSolution()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::compute1DFlameSolution ( )

◆ computeAcousticSourceTermQe()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeAcousticSourceTermQe ( MFloatScratchSpace QeI,
MFloatScratchSpace QeIII,
MFloatScratchSpace cSquared,
MFloatScratchSpace drhodt 
)

Definition at line 420 of file fvcartesiansolverxd.cpp.

422 {
423 for(MInt cellId = 0; cellId < a_noCells(); ++cellId) {
424 QeI[cellId] = F0;
425 QeIII[cellId] = F0;
426 cSquared[cellId] = F0;
427 drhodt[cellId] = F0;
428
429 IF_CONSTEXPR(isDetChem<SysEqn>) {
430 const MFloat dt = m_timeStep;
431
432 MFloat oldVelPow2 = F0;
433 for(MInt dim = 0; dim < nDim; dim++)
434 oldVelPow2 += POW2(a_oldVariable(cellId, CV->RHO_VV[dim]) / a_oldVariable(cellId, CV->RHO));
435
436 MFloat oldT = F0;
437#if defined(WITH_CANTERA)
438 sysEqn().iterateTemperature(oldT, &a_oldVariable(cellId, 0), &a_pvariable(cellId, 0), &a_avariable(cellId, 0),
439 oldVelPow2);
440#endif
441
442 const MFloat oldP = a_oldVariable(cellId, CV->RHO) * oldT * m_gasConstant / a_avariable(cellId, AV->W_MEAN);
443 const MFloat curP = a_pvariable(cellId, PV->P);
444 const MFloat dpdt = (curP - oldP) / dt;
445
446 MFloat divU = 0.0;
447 for(MInt dim = 0; dim < nDim; dim++) {
448 divU += a_slope(cellId, PV->VV[dim], dim);
449 }
450
451 MFloat DrhoDt = a_pvariable(cellId, PV->RHO) * divU;
452 MFloat UgradRho = 0.0;
453 MFloat UgradP = 0.0;
454 for(MInt dim = 0; dim < nDim; dim++) {
455 UgradRho = a_pvariable(cellId, PV->VV[dim]) * a_slope(cellId, PV->RHO, dim);
456 UgradP = a_pvariable(cellId, PV->VV[dim]) * a_slope(cellId, PV->P, dim);
457 }
458
459 const MFloat DpDt = dpdt + UgradP;
460
461 drhodt[cellId] = DrhoDt + UgradRho;
462 cSquared[cellId] = a_avariable(cellId, AV->GAMMA) * curP / a_variable(cellId, CV->RHO);
463 QeI[cellId] = DpDt - cSquared[cellId] * DrhoDt;
464 QeIII[cellId] = cSquared[cellId] * UgradRho - UgradP;
465 }
466 }
467}
MFloat & a_slope(const MInt cellId, MInt const varId, const MInt dir) override
Returns the slope of the cell cellId for the variable varId in direction dir.

◆ computeAndSetTimeStep()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeAndSetTimeStep
protected

Computes and sets the time-step:

  • computes the time-step in the local domains
  • sets the localTimeStep when dualTimeStepping is enabled
  • reduces the time-step across domains

Definition at line 21578 of file fvcartesiansolverxd.cpp.

21578 {
21579 TRACE();
21580
21581 const MFloat invalidTimeStep = std::numeric_limits<MFloat>::max();
21582 // Compute the global time step:
21583 MFloat newTimeStep = invalidTimeStep;
21584 const MInt noCells = a_noCells();
21585
21586 // Initialize dualTimeStepping:
21588 for(MInt cellId = 0; cellId < noCells; cellId++) {
21589 a_localTimeStep(cellId) = invalidTimeStep;
21590 }
21591 }
21592
21593 // Compute the time-step for every non-small-cell and non-ghost-cell
21594 MInt noCellsOnWhichTheTimeStepIsComputed = 0;
21595 for(MInt cellId = 0; cellId < noCells; ++cellId) {
21596 if(!cellParticipatesInTimeStep(cellId)) {
21597 if(m_dualTimeStepping) {
21598 a_localTimeStep(cellId) = F0;
21599 }
21600 continue;
21601 }
21602
21603 MFloat dtCell = computeTimeStep(cellId);
21604 newTimeStep = mMin(newTimeStep, dtCell);
21605 if(m_dualTimeStepping) {
21606 a_localTimeStep(cellId) = dtCell;
21607 }
21608
21609 ++noCellsOnWhichTheTimeStepIsComputed;
21610 }
21611
21612
21613 // some domains have only cells that do not participate in the time-step
21614 // computation
21615 if(noCellsOnWhichTheTimeStepIsComputed != 0 && approx(newTimeStep, invalidTimeStep, m_eps)) {
21616 mTerm(1, AT_, "failed to compute the time-step " + std::to_string(m_solverId));
21617 }
21618
21619 // Use a fixed user-provided time-step:
21620 if(m_timeStepFixedValue > 0.) {
21621 MPI_Allreduce(MPI_IN_PLACE, &newTimeStep, 1, MPI_DOUBLE, MPI_MIN, mpiComm(), AT_, "MPI_IN_PLACE", "m_timeStep");
21622 if(m_timeStepFixedValue > newTimeStep && domainId() == 0) { // Still check the CFL condition
21623 std::cerr << endl
21624 << endl
21625 << "WARNING: timeStepFixedvalue = " << m_timeStepFixedValue
21626 << " > computedGlobalTimeStep = " << newTimeStep << endl
21627 << endl
21628 << endl;
21629 }
21630 const MString msg = "FV-Solver globalTimeStep " + std::to_string(globalTimeStep)
21631 + ", using fixed time step: " + std::to_string(m_timeStepFixedValue)
21632 + " (computeGlobalTimeStep = " + std::to_string(newTimeStep) + ")";
21633 m_log << msg << std::endl;
21634 if(domainId() == 0) {
21635 std::cerr << msg << std::endl;
21636 }
21637
21638 newTimeStep = m_timeStepFixedValue;
21639
21640 if(m_dualTimeStepping) { // also check the CFL condition for local time stepping
21641 for(MInt cellId = 0; cellId < noCells; ++cellId) {
21643 m_log << "Warning: cell " << cellId << "timeStepFixedvalue = " << m_timeStepFixedValue
21644 << " < computedLocalTimeStep = " << a_localTimeStep(cellId) << endl;
21645 }
21647 }
21648 }
21649 forceTimeStep(newTimeStep);
21650 } else {
21651 // If the time-step is not fixed to a single constant value, exchange:
21652 RECORD_TIMER_START(m_tcomm);
21653 RECORD_TIMER_START(m_texchangeDt);
21654
21655 forceTimeStep(newTimeStep);
21656 ASSERT(m_timeStepAvailable, "overlapping time-step computations?!");
21657#ifndef MAIA_MS_COMPILER
21658 MPI_Iallreduce(MPI_IN_PLACE, &m_timeStep, 1, MPI_DOUBLE, MPI_MIN, mpiComm(), &m_timeStepReq, AT_, "MPI_IN_PLACE",
21659 "m_timeStep");
21660#else
21661 MPI_Allreduce(MPI_IN_PLACE, &m_timeStep, 1, MPI_DOUBLE, MPI_MIN, mpiComm(), AT_, "MPI_IN_PLACE", "m_timeStep");
21662#endif
21663
21664 m_timeStepAvailable = false;
21666 timeStep(true);
21667 }
21668 RECORD_TIMER_STOP(m_texchangeDt);
21669 RECORD_TIMER_STOP(m_tcomm);
21670
21671 }
21672}
MPI_Request m_timeStepReq
Request for reducing the time-step using non-blocking comm.
MFloat computeTimeStep(MInt cellId) const noexcept
MFloat & a_localTimeStep(const MInt cellId)
Returns the local time-step of the cell cellId.
MBool m_timeStepNonBlocking
Reduce the timeStep using non-blocking communication;.
void forceTimeStep(const MFloat dt)
Force time step externally.
MFloat m_timeStepFixedValue
Forces the time-step to be set to a fixed value:
MBool m_timeStepAvailable
Has the non-blocking reduction of the time-step finished?
MBool cellParticipatesInTimeStep(MInt cellId) const noexcept
Does the cell cellId participate in the time-step computation?
constexpr T mMin(const T &x, const T &y)
Definition: functions.h:90
int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Iallreduce

◆ computeAzimuthalReconstructionConstants()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::computeAzimuthalReconstructionConstants ( MInt  mode = 0)
virtual

◆ computeCellSurfaceDistanceVectors()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeCellSurfaceDistanceVectors

Definition at line 14301 of file fvcartesiansolverxd.cpp.

14301 {
14302 TRACE();
14303
14304 const MInt noSrfcs = a_noSurfaces();
14305 //---
14306
14307 for(MInt s = 0; s < noSrfcs; s++) {
14308 for(MInt i = 0; i < nDim; i++) {
14311 }
14312 }
14313}
MFloat & a_surfaceCoordinate(const MInt srfcId, const MInt dir)
Returns the coordinate of surface srfcId in direction dir.
MFloat & a_surfaceDeltaX(const MInt srfcId, const MInt varId)
Returns the delta X of surface srfcId for variable varId.

◆ computeCellVolumes()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeCellVolumes

Definition at line 14386 of file fvcartesiansolverxd.cpp.

14386 {
14387 TRACE();
14388
14389 MInt smallCell;
14390 MInt masterId;
14391 const MInt noCells = a_noCells();
14392 const MInt noBndryCells = m_fvBndryCnd->m_bndryCells->size();
14393 //---
14394
14395 for(MInt cellId = 0; cellId < noCells; cellId++) {
14396 a_cellVolume(cellId) = c_cellLengthAtCell(cellId);
14397 for(MInt spaceId = 1; spaceId < nDim; spaceId++) {
14398 a_cellVolume(cellId) *= c_cellLengthAtCell(cellId);
14399 }
14400 }
14401 // correct the volume of boundary cells
14402 for(MInt bndryId = 0; bndryId < noBndryCells; bndryId++) {
14403 MInt cellId = m_fvBndryCnd->m_bndryCells->a[bndryId].m_cellId;
14404 a_cellVolume(cellId) = m_fvBndryCnd->m_bndryCells->a[bndryId].m_volume;
14405 }
14406
14407 // correct the volume of fluid master cells
14408 for(MInt smallId = 0; smallId < m_fvBndryCnd->m_smallBndryCells->size(); smallId++) {
14409 smallCell = m_fvBndryCnd->m_smallBndryCells->a[smallId];
14410 masterId = m_fvBndryCnd->m_bndryCells->a[smallCell].m_linkedCellId;
14411 if(a_bndryId(masterId) == -1) {
14412 a_cellVolume(masterId) += m_fvBndryCnd->m_bndryCells->a[smallCell].m_volume;
14413 }
14414 }
14415
14416 // check the volume of all cells that are
14417 // taken into account
14418 for(MInt cellId = 0; cellId < noCells; cellId++) {
14419 if(a_cellVolume(cellId) < 0.0
14420 // || a_cellVolume( cellId ) < pow( 10.0, -12.0 )
14421 ) {
14422 cerr << "!!!Volume is " << a_cellVolume(cellId) << endl;
14423 cerr << "cell Id " << c_globalId(cellId) << " level " << a_level(cellId) << endl;
14424 if(a_bndryId(cellId) > -1) {
14425 cerr << "... is a boundary cell" << endl << endl;
14426 }
14427 cerr << "Coordinates: " << a_coordinate(cellId, 0) << " " << a_coordinate(cellId, 1);
14428 IF_CONSTEXPR(nDim == 3) cerr << " " << a_coordinate(cellId, 2);
14429 cerr << endl;
14430 }
14431 }
14432
14433 // compute the inverse volume
14434 for(MInt cellId = 0; cellId < noCells; cellId++) {
14435 a_FcellVolume(cellId) = F1 / a_cellVolume(cellId);
14436 }
14437}
MFloat c_cellLengthAtCell(const MInt cellId) const
Returns the length of the cell for level.

◆ computeCoarseGridCorrection()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeCoarseGridCorrection ( MInt   )

performs the correction of an existing solution on the fine grid

computes the difference between the new coarse grid solution and the stored restricted fine grid solution interpolates this difference to children of the fine grid level increase maximum level of refinement by 1

Author
Daniel Hartmann

Definition at line 22387 of file fvcartesiansolverxd.cpp.

22387 {
22388 TRACE();
22389
22390 const MInt noCellIds = a_noCells();
22391 const MInt noCVars = CV->noVariables;
22392 mTerm(1, "code does not work, see comment below");
22393
22394 for(MInt cellId = 0; cellId < noCellIds; cellId++) {
22395 for(MInt varId = 0; varId < noCVars; varId++) {
22396 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
22397 a_variable(cellId, varId) -=
22398 a_restrictedVar(cellId, varId); // This code does not work since the level information is ignored!
22399 }
22400 a_tau(cellId, varId) = 0;
22401 }
22402 }
22403}
MFloat & a_restrictedVar(const MInt cellId, const MInt varId)
Returns restricted variables of cell cellId for variable varId on level level.

◆ computeConservativeVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeConservativeVariables
virtual

The objective is to encourage the compiler to generate different optimized version depending on the value of m_noSpecies.

Definition at line 20232 of file fvcartesiansolverxd.cpp.

20232 {
20233 TRACE();
20234
20235 IF_CONSTEXPR(isDetChem<SysEqn>) { computeMeanMolarWeights_PV(); }
20236
20237 computeConservativeVariables_();
20238 computeConservativeVariablesCoarseGrid(); // return command for non-combustion computations
20239}
void computeConservativeVariablesCoarseGrid()
Computes the primitive variables: velocity, density, and pressure from the conservative variables and...
void computeMeanMolarWeights_PV()
Dispatches the mean molar weight computation at the cell center from the primitive variables by calli...

◆ computeConservativeVariablesCoarseGrid()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeConservativeVariablesCoarseGrid

NOTE: this is an inner-most loop of MAIA Don't modify it unless you REALLY know what you are doing.

Definition at line 20180 of file fvcartesiansolverxd.cpp.

20180 {
20181 TRACE();
20182 if(!m_combustion) // since the function is called in the methods there is a return at this position for the other maia
20183 // users
20184 return;
20185
20186 const MUint noCells = a_noCells();
20187
20188
20189 for(MInt level_ = maxLevel() - 1; level_ >= minLevel(); --level_) {
20190 for(MUint cellId = 0; cellId < noCells; cellId++) {
20191 if(a_isBndryGhostCell(cellId)) continue;
20192 if(level_ != a_level(cellId)) continue;
20193
20194 if(c_isLeafCell(cellId)) continue;
20195
20196 MInt noChildren = 0;
20197 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
20198 if(c_childId(cellId, childId) > -1) {
20199 noChildren++;
20200 }
20201 }
20202
20203 if(noChildren == 0) continue;
20204
20205 MFloat FnoChildren = 1.0 / noChildren;
20206
20207 for(MInt i = 0; i < CV->noVariables; i++) {
20208 a_variable(cellId, i) = F0;
20209 }
20210
20211 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
20212 if(c_childId(cellId, childId) < 0) continue;
20213
20214 for(MInt i = 0; i < CV->noVariables; i++) {
20215 a_variable(cellId, i) +=
20216 FnoChildren
20217 * a_variable(c_childId(cellId, childId), i); // a_FcellVolume( c_childId( cellId , childId ) ) *
20218 // a_variable(c_childId( cellId , childId ), i );
20219 }
20220 }
20221 }
20222 }
20223 ASSERT(m_combustion, "someone changed the code -> this code is only needed for combustion computations");
20224}
MLong c_childId(const MInt cellId, const MInt pos) const
Returns the grid child id of the grid cell cellId at position pos.
MBool c_isLeafCell(const MInt cellId) const
MInt minLevel() const
Read-only accessors for grid data.
constexpr MLong IPOW2(MInt x)

◆ computeConservativeVariablesMultiSpecies_()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeConservativeVariablesMultiSpecies_ ( const  MUint)

◆ computeDetailedChemistryVariables()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::computeDetailedChemistryVariables

Definition at line 783 of file fvcartesiansolverxd.cpp.

783 {
784#if defined(WITH_CANTERA)
786#endif
787}
void computeSurfaceCoefficients()
Dispatches the transport coefficients computation at each surfaces by calling the relevant function f...

◆ computeDomainAndSpongeDimensions()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeDomainAndSpongeDimensions

Definition at line 16194 of file fvcartesiansolverxd.cpp.

16194 {
16195 TRACE();
16196
16197 MInt noDirs = 2 * nDim;
16198 MFloat halfCellWidth;
16199 MFloat epsilon = c_cellLengthAtLevel(maxRefinementLevel()) / 1000.0;
16200 MFloatScratchSpace tmp(nDim, AT_, "tmp");
16201 MFloatScratchSpace tmp2(nDim, AT_, "tmp2");
16202 //---
16203
16204 // compute domain dimensions
16205 halfCellWidth = F1B2 * c_cellLengthAtCell(0);
16206 for(MInt i = 0; i < nDim; i++) {
16207 m_domainBoundaries[2 * i] = a_coordinate(0, i) - halfCellWidth;
16208 m_domainBoundaries[2 * i + 1] = a_coordinate(0, i) + halfCellWidth;
16209 }
16210 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
16211 if(c_noChildren(cellId) > 0) continue;
16212 halfCellWidth = F1B2 * c_cellLengthAtCell(cellId);
16213 for(MInt i = 0; i < nDim; i++) {
16214 m_domainBoundaries[2 * i] = mMin(m_domainBoundaries[2 * i], a_coordinate(cellId, i) - halfCellWidth);
16215 m_domainBoundaries[2 * i + 1] = mMax(m_domainBoundaries[2 * i + 1], a_coordinate(cellId, i) + halfCellWidth);
16216 }
16217 }
16218 // exchange domain boundaries
16219 // maximum dimensions
16220 for(MInt i = 0; i < nDim; i++)
16221 tmp.p[i] = m_domainBoundaries[2 * i + 1];
16222 MPI_Reduce(tmp.getPointer(), tmp2.getPointer(), nDim, MPI_DOUBLE, MPI_MAX, 0, mpiComm(), AT_, "tmp.getPointer()",
16223 "tmp2.getPointer()");
16224 MPI_Bcast(tmp2.getPointer(), nDim, MPI_DOUBLE, 0, mpiComm(), AT_, "tmp2.getPointer()");
16225 for(MInt i = 0; i < nDim; i++)
16226 m_domainBoundaries[2 * i + 1] = tmp2.p[i];
16227 // minimum dimensions
16228 for(MInt i = 0; i < nDim; i++)
16229 tmp.p[i] = m_domainBoundaries[2 * i];
16230 MPI_Reduce(tmp.getPointer(), tmp2.getPointer(), nDim, MPI_DOUBLE, MPI_MIN, 0, mpiComm(), AT_, "tmp.getPointer()",
16231 "tmp2.getPointer()");
16232 MPI_Bcast(tmp2.getPointer(), nDim, MPI_DOUBLE, 0, mpiComm(), AT_, "tmp2.getPointer()");
16233 for(MInt i = 0; i < nDim; i++)
16234 m_domainBoundaries[2 * i] = tmp2.p[i];
16235
16236 // compute the mean coordinate ([2] is set for the 2D-version)
16237 m_meanCoord[2] = F0;
16239 for(MInt i = 0; i < nDim; i++) {
16240 m_meanCoord[i] = F1B2 * (m_domainBoundaries[2 * i] + m_domainBoundaries[2 * i + 1]);
16242 }
16243
16244 if(m_spongeLayerThickness > F0) {
16246 // compute sponge zone dimensions
16247 for(MInt i = 0; i < nDim; i++) {
16249 m_spongeCoord[noDirs + 2 * i] = F1 / mMax(epsilon, m_spongeLayerThickness * m_spongeFactor[2 * i]);
16250 m_spongeCoord[2 * i + 1] = m_domainBoundaries[2 * i + 1] - m_spongeLayerThickness * m_spongeFactor[2 * i + 1];
16251 m_spongeCoord[noDirs + 2 * i + 1] = F1 / (mMax(epsilon, m_spongeLayerThickness * m_spongeFactor[2 * i + 1]));
16252 }
16253 }
16254 }
16255
16256 m_log << "*** boundaries of the computational domain " << endl;
16257 m_log << " direction " << endl;
16258 for(MInt i = 0; i < nDim; i++) {
16259 m_log << "min " << i << " " << m_domainBoundaries[2 * i] << endl;
16260 m_log << "max " << i << " " << m_domainBoundaries[2 * i + 1] << endl;
16261 m_log << "mean " << i << " " << m_meanCoord[i] << endl;
16262 }
16263}
int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Reduce

◆ computeDomainLength()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::computeDomainLength ( MInt  direction)

◆ computeForceCoefficients()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeForceCoefficients ( MFloat forceCoefficients)

Definition at line 17213 of file fvcartesiansolverxd.cpp.

17213 {
17214 TRACE();
17215 // const MInt maxNoEmbeddedBodies = 10;
17216 // ofstream ofl2[maxNoEmbeddedBodies];
17217 MInt noBndryCells = m_fvBndryCnd->m_bndryCells->size();
17218 MInt cellId, ghostCellId;
17219 MFloat rhoSurface, pSurface;
17220 MFloat T, mue, dAoverRe, rhoU2;
17221 MFloat dist;
17223 MFloat angle, cp, ma;
17224 MFloat pressure[nDim];
17225 MFloat tau[nDim];
17226 MFloat shear[nDim];
17227 MFloat globalForceCoefficients[nDim];
17228 MInt localNoSurfacePoints = 0;
17229 MFloat ypmin = 999999.99;
17230 MFloat ypmax = F0;
17231 MFloat ypavg = F0;
17232 MFloat yprms = F0;
17233 MFloat ypcnt = F0;
17234
17235 for(MInt i = 0; i < nDim; i++) {
17236 tau[i] = numeric_limits<MFloat>::max(); // gcc 4.8.2 maybe uninitialized
17237 }
17238
17239 // prepare parallel writing
17240 if(m_surfDistParallel) {
17241 for(MInt bndryCellId = 0; bndryCellId < noBndryCells; bndryCellId++) {
17242 cellId = m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_cellId;
17243 // if( cellId >= noInternalCells() )
17244 // continue;
17245 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) continue;
17246 if(a_isHalo(cellId)) continue;
17247 if(a_isPeriodic(cellId)) continue;
17248 for(MInt srfc = 0; srfc < m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_noSrfcs; srfc++) {
17249 if(m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_bndryCndId < 3000
17250 || m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_bndryCndId >= 4000)
17251 continue;
17252 localNoSurfacePoints++;
17253 }
17254 }
17255 }
17256 const MInt surfaceValuesSize = 4 + nDim;
17257 MFloatScratchSpace surfaceValues(localNoSurfacePoints * surfaceValuesSize, AT_, "surfaceValues");
17258 //---
17259
17260
17261 // reset
17262 for(MInt i = 0; i < nDim; i++) {
17263 shear[i] = F0;
17264 pressure[i] = F0;
17265 }
17266
17267 rhoU2 = F0;
17268 for(MInt i = 0; i < nDim; i++) {
17269 rhoU2 += POW2(m_VVInfinity[i]);
17270 }
17271 rhoU2 *= m_rhoInfinity;
17272
17273 MBool found_ = false;
17274 MFloat localRetau[1];
17275 MFloat globalRetau[1];
17276 localRetau[0] = 0.0;
17277 globalRetau[0] = 0.0;
17278 MFloat Re_tau_ = 0.0;
17279 MFloat localArea1[1];
17280 MFloat globalArea1[1];
17281 localArea1[0] = 0.0;
17282 globalArea1[0] = 0.0;
17283
17284
17285 MInt counter = 0;
17286 for(MInt bndryCellId = 0; bndryCellId < noBndryCells; bndryCellId++) {
17287 // only take (non-ghost) non-slave cells with solid-wall bc into account
17288 cellId = m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_cellId;
17289 if(cellId >= noInternalCells() && (!m_surfDistParallel)) continue;
17290 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) continue;
17291 if(a_isHalo(cellId)) continue;
17292 if(a_isPeriodic(cellId)) continue;
17293
17294 MFloatScratchSpace dummyPvariables(m_bndryCells->a[bndryCellId].m_noSrfcs, PV->noVariables, AT_, "dummyPvariables");
17295
17297 if(m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_linkedCellId > -1)
17298 if(a_bndryId(m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_linkedCellId) > -1) continue;
17300 for(MInt s = 0; s < mMin((signed)m_fvBndryCnd->m_bndryCell[bndryCellId].m_recNghbrIds.size(),
17301 m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_noSrfcs);
17302 s++) {
17303 dummyPvariables(s, PV->P) = m_fvBndryCnd->m_bndryCell[bndryCellId].m_srfcVariables[s]->m_primVars[PV->P];
17304 dummyPvariables(s, PV->RHO) = m_fvBndryCnd->m_bndryCell[bndryCellId].m_srfcVariables[s]->m_primVars[PV->RHO];
17305 }
17306 }
17307 for(MInt srfc = 0; srfc < m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_noSrfcs; srfc++) {
17308 if(m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_bndryCndId < 3000
17309 || m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_bndryCndId >= 4000)
17310 continue;
17311 // find corresponding ghostId
17312 ghostCellId = m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcVariables[srfc]->m_ghostCellId;
17313
17314 // density and pressure on surface
17315 rhoSurface = F1B2 * (a_pvariable(cellId, PV->RHO) + a_pvariable(ghostCellId, PV->RHO));
17316 pSurface = F1B2 * (a_pvariable(cellId, PV->P) + a_pvariable(ghostCellId, PV->P));
17317
17318 // temperature
17319 T = sysEqn().temperature_ES(rhoSurface, pSurface);
17320
17321 // calculate the viscosity with the sutherland law mue = T^3/2 * (1+S/T_0)(T + S/T_0)
17322 mue = SUTHERLANDLAW(T);
17323
17324 // A_s / Re
17325 dAoverRe =
17326 m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_area / (m_referenceLength * sysEqn().m_Re0);
17327
17328 // distanceVector: connection vector of boundary surface center and cell center
17329 dist = F0;
17330 for(MInt i = 0; i < nDim; i++) {
17331 dist +=
17332 fabs((a_coordinate(cellId, i) - m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_coordinates[i])
17333 * m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_normalVector[i]);
17334 }
17335
17336 // determine tau (all dimensions)
17338 for(MInt orientation = 0; orientation < nDim; orientation++) {
17339 if(fabs(dist) > eps)
17340 tau[orientation] =
17341 mue * F1B2 * (a_pvariable(cellId, PV->VV[orientation]) - a_pvariable(ghostCellId, PV->VV[orientation]))
17342 / dist;
17343 else
17344 tau[orientation] = F0;
17345 }
17346 } else {
17347 rhoSurface = F0;
17348 pSurface = F0;
17349 for(MInt n = 0; n < (signed)m_fvBndryCnd->m_bndryCell[bndryCellId].m_recNghbrIds.size(); n++) {
17350 const MInt nghbrId = m_fvBndryCnd->m_bndryCell[bndryCellId].m_recNghbrIds[n];
17351 const MFloat nghbrPvariableP = (n < m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_noSrfcs)
17352 ? dummyPvariables(n, PV->P)
17353 : a_pvariable(nghbrId, PV->P);
17354 const MFloat nghbrPvariableRho = (n < m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_noSrfcs)
17355 ? dummyPvariables(n, PV->RHO)
17356 : a_pvariable(nghbrId, PV->RHO);
17357 rhoSurface +=
17358 m_fvBndryCnd->m_bndryCell[bndryCellId].m_srfcVariables[srfc]->m_imagePointRecConst[n] * nghbrPvariableRho;
17359 pSurface +=
17360 m_fvBndryCnd->m_bndryCell[bndryCellId].m_srfcVariables[srfc]->m_imagePointRecConst[n] * nghbrPvariableP;
17361 }
17362 T = sysEqn().temperature_ES(rhoSurface, pSurface);
17363 mue = SUTHERLANDLAW(T);
17364 for(MInt k = 0; k < nDim; k++) {
17365 tau[k] = mue * m_fvBndryCnd->m_bndryCell[bndryCellId].m_srfcVariables[srfc]->m_normalDeriv[PV->VV[k]];
17366 }
17367 }
17368
17369 // shear-stress and pressure
17370 for(MInt orientation = 0; orientation < nDim; orientation++) {
17371 pressure[orientation] +=
17372 (-F1) * pSurface * m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_area
17373 * m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_normalVector[orientation];
17374 shear[orientation] += tau[orientation] * dAoverRe;
17375 }
17376
17377
17378 if(m_periodicCells == 3) { // azimuthal periodicity concept
17379
17380
17381 MFloat Length_2 = c_cellLengthAtCell(cellId);
17382 if(a_coordinate(cellId, 2) < 200.0 && a_coordinate(cellId, 1) > 200.0
17383 && a_coordinate(cellId, 1) < (200.0 + Length_2) && a_coordinate(cellId, 0) >= 2.5
17384 && a_coordinate(cellId, 0) < 2.5 + Length_2) {
17385 found_ = true;
17386 Re_tau_ = sqrt(tau[0] / sysEqn().m_Re0 / rhoSurface / (m_Ma * sqrt(m_TInfinity)) / (m_Ma * sqrt(m_TInfinity)))
17387 * m_Re;
17388 }
17389
17390 if(a_coordinate(cellId, 0) >= 2.5 && a_coordinate(cellId, 0) < 2.5 + Length_2) {
17391 // MFloat re_test= sqrt(fabs(tau[ 0 ])/m_Re0/rhoSurface/(m_Ma * sqrt( m_TInfinity ))/(m_Ma * sqrt(
17392 // m_TInfinity )))*m_Re;
17393 localArea1[0] += m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[0]->m_area;
17394 localRetau[0] +=
17395 sqrt(fabs(tau[0]) / sysEqn().m_Re0 / rhoSurface / (m_Ma * sqrt(m_TInfinity)) / (m_Ma * sqrt(m_TInfinity)))
17396 * m_Re * m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[0]->m_area;
17397 }
17398 }
17399
17400
17401 MFloat yplus;
17402 MFloat magTau = F0;
17403 for(MInt dim = 0; dim < nDim; dim++) {
17404 magTau += POW2(tau[dim]);
17405 }
17406 yplus = sqrt(sysEqn().m_Re0 * sqrt(magTau) * rhoSurface) * c_cellLengthAtCell(cellId) / mue;
17407
17408 ypmin = mMin(ypmin, yplus);
17409 ypmax = mMax(ypmax, yplus);
17410 ypavg += yplus;
17411 yprms += POW2(yplus);
17412 ypcnt += F1;
17413
17414 // save surface values to scratch space:
17415 if(m_surfDistParallel) {
17416 MFloat radToDeg = 360.0 / (2.0 * PI);
17417 MFloat xOffset = 0.0;
17418 MFloat yOffset = 0.0;
17419 if(m_levelSetMb) {
17420 MInt body = m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_bodyId[0];
17421 ASSERT(body > -1, "wrong body Id for boundary surface...");
17422 xOffset = m_bodyCenter[body * nDim + 0];
17423 yOffset = m_bodyCenter[body * nDim + 1];
17424 }
17425 MFloat dx = m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_coordinates[0] - xOffset;
17426 MFloat dy = m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_coordinates[1] - yOffset;
17427 angle = 180.0 - (radToDeg * atan2(dy, dx));
17428 ma = F0;
17429 for(MInt i = 0; i < nDim; i++)
17430 ma += POW2(m_fvBndryCnd->m_bndryCell[bndryCellId].m_srfcVariables[srfc]->m_primVars[PV->VV[i]]);
17431 ma = sqrt(ma);
17432 ma /= sysEqn().speedOfSound(rhoSurface, pSurface);
17433 cp = (pSurface - m_PInfinity) / (F1B2 * rhoU2);
17434 MFloat cf = (m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_normalVector[1] * tau[0]
17435 - m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_normalVector[0] * tau[1])
17436 / (F1B2 * rhoU2 * sysEqn().m_Re0);
17437 MInt idcnt = counter * surfaceValuesSize;
17438 surfaceValues(idcnt++) = angle;
17439 for(MInt i = 0; i < nDim; i++) {
17440 surfaceValues(idcnt++) = m_fvBndryCnd->m_bndryCells->a[bndryCellId].m_srfcs[srfc]->m_coordinates[i];
17441 }
17442 surfaceValues(idcnt++) = cp;
17443 surfaceValues(idcnt++) = cf;
17444 surfaceValues(idcnt) = ma;
17445 counter++;
17446 }
17447 }
17448 }
17449
17450
17451 // parallel surface-value output using MPI I/O
17452 if(m_surfDistParallel) {
17453 const MString fileName = "surfaceDistribution";
17454 const MInt dataSolver = surfaceValuesSize;
17455 const MInt floatWidth = 9;
17456 const MInt noChars = floatWidth + 2;
17457 MInt dataSize = dataSolver * noChars * counter;
17458 ScratchSpace<char> data(dataSize, AT_, "data");
17459 MInt cnt = 0;
17460 for(MInt c = 0; c < counter; c++) {
17461 for(MInt i = 0; i < dataSolver; i++) {
17462 stringstream s;
17463 s.clear();
17464 s << fixed << setprecision(floatWidth) << surfaceValues[c * dataSolver + i];
17465 s.str().copy(&data[cnt], floatWidth);
17466 cnt += floatWidth;
17467 if(i < (dataSolver - 1))
17468 sprintf(&data[cnt], ", ");
17469 else
17470 sprintf(&data[cnt], " \n");
17471 cnt += 2;
17472 }
17473 }
17474 ASSERT(dataSize == cnt, "");
17475 ScratchSpace<MInt> dataPerDomain(noDomains(), AT_, "dataPerDomain");
17476 MPI_Allgather(&dataSize, 1, MPI_INT, &dataPerDomain[0], 1, MPI_INT, mpiComm(), AT_, "dataSize", "dataPerDomain[0]");
17477 MInt globalDataOffset = 0;
17478 for(MInt d = 0; d < domainId(); d++)
17479 globalDataOffset += dataPerDomain[d];
17480 MPI_File file = nullptr;
17481 MInt rcode = MPI_File_open(mpiComm(), const_cast<MChar*>(fileName.c_str()), MPI_MODE_CREATE | MPI_MODE_WRONLY,
17482 MPI_INFO_NULL, &file, AT_);
17483 if(rcode != MPI_SUCCESS) mTerm(1, AT_, "Error opening file " + fileName);
17484 MPI_Status status;
17485 // MPI_File_seek(file, globalDataOffset, MPI_SEEK_SET, AT_ );
17486 MPI_File_seek(file, globalDataOffset, MPI_SEEK_CUR, AT_);
17487 rcode = (counter > 0) ? MPI_File_write(file, &data[0], dataSize, MPI_CHAR, &status) : MPI_SUCCESS;
17488 if(rcode != MPI_SUCCESS) mTerm(1, AT_, "Error (1) writing to file " + fileName);
17489 MPI_File_close(&file, AT_);
17490 }
17491
17492 if(m_euler) {
17493 for(MInt i = 0; i < nDim; i++)
17494 forceCoefficients[i] = (pressure[i]) / (F1B2 * rhoU2);
17495 } else {
17496 for(MInt i = 0; i < nDim; i++) {
17497 forceCoefficients[i] = (shear[i] + pressure[i]) / (F1B2 * rhoU2);
17498 }
17499 if(m_periodicCells == 3) { // azimuthal periodicity concept
17500 for(MInt i = 0; i < nDim; i++)
17501 forceCoefficients[i] = (shear[i]) / (F1B2 * rhoU2) / (5.0) / (2.0 * PI * 0.5);
17502 }
17503 }
17504
17505 // exchange and sum up the local force coefficients
17506 if(m_periodicCells == 3) {
17507 MPI_Allreduce(localRetau, globalRetau, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localRetau", "globalRetau");
17508 MPI_Allreduce(localArea1, globalArea1, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localArea1", "globalArea1");
17509
17510 globalRetau[0] =
17511 globalRetau[0] / globalArea1[0]; //( m_domainBoundaries[ 1 ]- m_domainBoundaries[ 0 ])/(2.0*PI*0.5);
17512 }
17513
17514 MPI_Reduce(forceCoefficients, globalForceCoefficients, nDim, MPI_DOUBLE, MPI_SUM, 0, mpiComm(), AT_,
17515 "forceCoefficients", "globalForceCoefficients");
17516 MPI_Bcast(globalForceCoefficients, nDim, MPI_DOUBLE, 0, mpiComm(), AT_, "globalForceCoefficients");
17517
17518 for(MInt i = 0; i < nDim; i++) {
17519 forceCoefficients[i] = globalForceCoefficients[i];
17520 }
17521
17522 MPI_Allreduce(MPI_IN_PLACE, &ypmin, 1, MPI_DOUBLE, MPI_MIN, mpiComm(), AT_, "MPI_IN_PLACE", "ypmin");
17523 MPI_Allreduce(MPI_IN_PLACE, &ypmax, 1, MPI_DOUBLE, MPI_MAX, mpiComm(), AT_, "MPI_IN_PLACE", "ypmax");
17524 MPI_Allreduce(MPI_IN_PLACE, &ypavg, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "ypavg");
17525 MPI_Allreduce(MPI_IN_PLACE, &yprms, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "yprms");
17526 MPI_Allreduce(MPI_IN_PLACE, &ypcnt, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "ypcnt");
17527
17528
17529 if(found_ && m_periodicCells == 3) // azimuthal periodicity concept
17530 {
17531 FILE* datei;
17532 datei = fopen("reTau_loc", "a+");
17533 fprintf(datei, "%d", globalTimeStep);
17534 fprintf(datei, " %f", Re_tau_);
17535 fprintf(datei, "\n");
17536 fclose(datei);
17537 }
17538
17539 if(domainId() == 0 && m_periodicCells == 3) { // azimuthal periodicity concept
17540 FILE* datei;
17541 datei = fopen("reTau", "a+");
17542 fprintf(datei, "%d", globalTimeStep);
17543 fprintf(datei, " %f", globalRetau[0]);
17544 fprintf(datei, "\n");
17545 fclose(datei);
17546 }
17547 // if ( domainId() == 0 && globalTimeStep%10 == 0 ) cerr << "yplus: min=" << ypmin << ", avg=" << ypavg/ypcnt << ",
17548 // rms=" << sqrt(yprms/ypcnt) << ", max=" << ypmax << "." << endl; if ( globalTimeStep % m_restartInterval == 0 )
17549 m_log << "yplus: min=" << ypmin << ", avg=" << ypavg / ypcnt << ", rms=" << sqrt(yprms / ypcnt) << ", max=" << ypmax
17550 << "." << endl;
17551}
FvBndryCell< nDim, SysEqn > * m_bndryCell
MFloat m_Re
the Reynolds number
Definition: solver.h:68
char MChar
Definition: maiatypes.h:56
int MPI_File_seek(MPI_File mpi_fh, MPI_Offset offset, int whence, const MString &name)
same as MPI_File_seek
int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info, MPI_File *mpi_fh, const MString &name)
same as MPI_File_open
int MPI_File_close(MPI_File *mpi_fh, const MString &name)
same as MPI_File_close
int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Allgather
MFloat dist(const Point< DIM > &p, const Point< DIM > &q)
Definition: pointbox.h:54

◆ computeGamma()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::computeGamma

Definition at line 797 of file fvcartesiansolverxd.cpp.

797 {
798 const MUint noCells = a_noCells();
799 const MUint noPVars = PV->noVariables;
800 const MUint noAVars = hasAV ? AV->noVariables : 0;
801
802 const MFloat* const RESTRICT pvars = &a_pvariable(0, 0);
803 MFloat* const RESTRICT avars = hasAV ? &a_avariable(0, 0) : nullptr;
804
805 for(MUint cellId = 0; cellId < noCells; ++cellId) {
806 const MUint cellPVarOffset = cellId * noPVars;
807 const MUint cellAVarOffset = hasAV ? cellId * noAVars : 0;
808
809 const MFloat* const RESTRICT pvarsCell = pvars + cellPVarOffset;
810 MFloat* const RESTRICT avarsCell = hasAV ? avars + cellAVarOffset : nullptr;
811
812 sysEqn().computeGamma(pvarsCell, avarsCell, m_canteraThermo);
813 }
814}
std::shared_ptr< Cantera::ThermoPhase > m_canteraThermo

◆ computeGridCellCoordinates()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeGridCellCoordinates ( MFloat gccCoordinates)
Author
Daniel Hartmann

Definition at line 14341 of file fvcartesiansolverxd.cpp.

14341 {
14342 TRACE();
14343
14344 MInt noCellIds = a_noCells();
14345 MInt bndryId;
14346 MInt smallCell;
14347
14348 // ---------- end of initialization ----------------
14349
14350 // copy fluid cell cogs and correct those of boundary cells
14351 for(MInt cellId = 0; cellId < noCellIds; cellId++) {
14352 if(!a_isBndryGhostCell(cellId)) {
14353 for(MInt spaceId = 0; spaceId < nDim; spaceId++) {
14354 // copy coordinates of cog
14355 gccCoordinates[cellId * nDim + spaceId] = a_coordinate(cellId, spaceId);
14356
14357 // correct cog of boundary cells
14358 if(a_bndryId(cellId) > -1) {
14359 bndryId = a_bndryId(cellId);
14360
14361 gccCoordinates[cellId * nDim + spaceId] -= m_fvBndryCnd->m_bndryCells->a[bndryId].m_coordinates[spaceId];
14362 }
14363 }
14364 }
14365 }
14366
14367 // correct coordinates of fluid cells which are masters of a small cell
14368 for(MInt smallId = 0; smallId < m_fvBndryCnd->m_smallBndryCells->size(); smallId++) {
14369 smallCell = m_fvBndryCnd->m_smallBndryCells->a[smallId];
14370 if(m_fvBndryCnd->m_bndryCells->a[smallCell].m_linkedCellId > -1) {
14371 if(a_bndryId(m_fvBndryCnd->m_bndryCells->a[smallCell].m_linkedCellId) == -1) {
14372 for(MInt spaceId = 0; spaceId < nDim; spaceId++) {
14373 gccCoordinates[(m_fvBndryCnd->m_bndryCells->a[smallCell].m_linkedCellId) * nDim + spaceId] =
14374 m_fvBndryCnd->m_bndryCells->a[smallCell].m_masterCoordinates[spaceId];
14375 }
14376 }
14377 }
14378 }
14379}

◆ computeInitialPressureLossForChannelFlow()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeInitialPressureLossForChannelFlow ( )

WARNING: m_deltaP is set only when m_restart == false! (see initial conditions)

◆ computeLimitedSurfaceValues()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeLimitedSurfaceValues ( MInt  timerId = -1)
virtual

Definition at line 25077 of file fvcartesiansolverxd.cpp.

25077 {
25078 TRACE();
25079
25080 MInt nghbr0, nghbr1;
25081 const MInt noPVarIds = PV->noVariables;
25082 const MInt noSrfcs = a_noSurfaces();
25083 MInt va0, va1, sl0, sl1, i;
25084 const MInt surfaceVarMemory = m_surfaceVarMemory;
25085 const MInt slopeMemory = m_slopeMemory;
25086 MFloat* surfaceVar = (MFloat*)(&(a_surfaceVariable(0, 0, 0)));
25087 MFloat* cellSlopes = (MFloat*)(&(a_slope(0, 0, 0)));
25088 MFloat* dx = (MFloat*)(&(a_surfaceDeltaX(0, 0)));
25089 //---end of initialization
25090
25091 va0 = 0;
25092 va1 = noPVarIds;
25093 i = 0;
25094
25095 for(MInt srfcId = 0; srfcId < noSrfcs; srfcId++) {
25096 // interpolate the primitive variables onto the surface from both sides
25097 nghbr0 = a_surfaceNghbrCellId(srfcId, 0);
25098 nghbr1 = a_surfaceNghbrCellId(srfcId, 1);
25099
25100 sl0 = nghbr0 * slopeMemory;
25101 sl1 = nghbr1 * slopeMemory;
25102
25103 // limiting: bounds are MAX(v0,v1) and MIN(v0,v1)
25104 for(MInt varId = 0; varId < noPVarIds; varId++) {
25105 surfaceVar[va0 + varId] = a_pvariable(nghbr0, varId) + cellSlopes[sl0] * dx[i] + cellSlopes[sl0 + 1] * dx[i + 1];
25106 IF_CONSTEXPR(nDim == 3) surfaceVar[va0 + varId] += cellSlopes[sl0 + 2] * dx[i + 2];
25107
25108 surfaceVar[va0 + varId] =
25109 mMin(surfaceVar[va0 + varId], mMax(a_pvariable(nghbr0, varId), a_pvariable(nghbr1, varId)));
25110 surfaceVar[va0 + varId] =
25111 mMax(surfaceVar[va0 + varId], mMin(a_pvariable(nghbr0, varId), a_pvariable(nghbr1, varId)));
25112
25113 surfaceVar[va1 + varId] =
25114 a_pvariable(nghbr1, varId) + cellSlopes[sl1] * dx[i + nDim] + cellSlopes[sl1 + 1] * dx[i + nDim + 1];
25115 IF_CONSTEXPR(nDim == 3) surfaceVar[va1 + varId] += cellSlopes[sl1 + 2] * dx[i + nDim + 2];
25116
25117 surfaceVar[va1 + varId] =
25118 mMin(surfaceVar[va1 + varId], mMax(a_pvariable(nghbr0, varId), a_pvariable(nghbr1, varId)));
25119 surfaceVar[va1 + varId] =
25120 mMax(surfaceVar[va1 + varId], mMin(a_pvariable(nghbr0, varId), a_pvariable(nghbr1, varId)));
25121 sl0 += nDim;
25122 sl1 += nDim;
25123 }
25124 va0 += surfaceVarMemory;
25125 va1 += surfaceVarMemory;
25126 i += 2 * nDim;
25127 }
25128
25129 // correct the boundary surface values
25130 m_fvBndryCnd->correctBoundarySurfaceVariables();
25131
25132 // update the ghost cell slopes for the viscous flux computation
25133 m_fvBndryCnd->updateGhostCellSlopesViscous();
25134 m_fvBndryCnd->updateCutOffSlopesViscous();
25135}

◆ computeMeanMolarWeights_CV()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::computeMeanMolarWeights_CV

Definition at line 824 of file fvcartesiansolverxd.cpp.

824 {
825 const MUint noCells = a_noCells();
826 const MUint noCVars = CV->noVariables;
827 const MUint noAVars = hasAV ? AV->noVariables : 0;
828
829 MFloat* const RESTRICT cvars = &a_variable(0, 0);
830 MFloat* const RESTRICT avars = hasAV ? &a_avariable(0, 0) : nullptr;
831
832 for(MUint cellId = 0; cellId < noCells; ++cellId) {
833 const MUint cellCVarOffset = cellId * noCVars;
834 const MUint cellAVarOffset = hasAV ? cellId * noAVars : 0;
835
836 const MFloat* const RESTRICT cvarsCell = cvars + cellCVarOffset;
837 MFloat* const RESTRICT avarsCell = hasAV ? avars + cellAVarOffset : nullptr;
838
839 sysEqn().computeMeanMolarWeight_CV(cvarsCell, avarsCell);
840 }
841}

◆ computeMeanMolarWeights_PV()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::computeMeanMolarWeights_PV

Definition at line 850 of file fvcartesiansolverxd.cpp.

850 {
851 const MUint noCells = a_noCells();
852 const MUint noPVars = PV->noVariables;
853 const MUint noAVars = hasAV ? AV->noVariables : 0;
854
855 MFloat* const RESTRICT pvars = &a_pvariable(0, 0);
856 MFloat* const RESTRICT avars = hasAV ? &a_avariable(0, 0) : nullptr;
857
858 for(MUint cellId = 0; cellId < noCells; ++cellId) {
859 const MUint cellPVarOffset = cellId * noPVars;
860 const MUint cellAVarOffset = hasAV ? cellId * noAVars : 0;
861
862 const MFloat* const RESTRICT pvarsCell = pvars + cellPVarOffset;
863 MFloat* const RESTRICT avarsCell = hasAV ? avars + cellAVarOffset : nullptr;
864
865 sysEqn().computeMeanMolarWeight_PV(pvarsCell, avarsCell);
866 }
867}

◆ computePrimitiveVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computePrimitiveVariables
virtual

The objective is to encourage the compiler to generate different optimized version depending on the value of m_noSpecies.

Definition at line 19976 of file fvcartesiansolverxd.cpp.

19976 {
19977 TRACE();
19978
19979 IF_CONSTEXPR(isDetChem<SysEqn>) { computeMeanMolarWeights_CV(); }
19980
19981 computePrimitiveVariables_();
19982
19983 computePrimitiveVariablesCoarseGrid(noInternalCells()); // return command for non-combustion computations
19984}
virtual void computePrimitiveVariablesCoarseGrid()
Computes the primitive variables: velocity, density, and pressure from the conservative variables and...
void computeMeanMolarWeights_CV()
Dispatches the mean molar weight computation at the cell center from the conservative variables by ca...

◆ computePrimitiveVariablesCoarseGrid() [1/2]

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computePrimitiveVariablesCoarseGrid
virtual

NOTE: this is an inner-most loop of MAIA Don't modify it unless you REALLY know what you are doing.

Definition at line 20162 of file fvcartesiansolverxd.cpp.

20162 {
20163 TRACE();
20164 if(!m_combustion) // just to be sure
20165 return;
20166
20167 MInt noCells = a_noCells();
20168
20170 ASSERT(m_combustion, "someone changed the code -> this code is only needed for combustion computations");
20171}

◆ computePrimitiveVariablesCoarseGrid() [2/2]

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computePrimitiveVariablesCoarseGrid ( MInt  noCells)

NOTE: this is an inner-most loop of MAIA Don't modify it unless you REALLY know what you are doing.

Definition at line 20100 of file fvcartesiansolverxd.cpp.

20100 {
20101 TRACE();
20102
20103 if(!m_combustion) { // since the function is called in the methods there is a return at this position for the other
20104 // maia users
20105 return;
20106 }
20107
20108 for(MInt level_ = maxLevel() - 1; level_ >= minLevel(); --level_) {
20109#ifdef _OPENMP
20110#pragma omp parallel for
20111#endif
20112 for(MInt cellId = 0; cellId < noCells; cellId++) {
20113 if(a_isBndryGhostCell(cellId)) continue;
20114
20115 if(level_ != a_level(cellId)) {
20116 continue;
20117 }
20118
20119 if(c_isLeafCell(cellId)) {
20120 continue;
20121 }
20122
20123 MInt noChildren = 0;
20124 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
20125 if(c_childId(cellId, childId) > -1) {
20126 noChildren++;
20127 }
20128 }
20129 if(noChildren == 0) {
20130 continue;
20131 }
20132
20133 const MFloat FnoChildren = F1 / (MFloat)noChildren;
20134
20135 for(MInt i = 0; i < PV->noVariables; i++) {
20136 a_pvariable(cellId, i) = F0;
20137 }
20138
20139 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
20140 if(c_childId(cellId, childId) < 0) {
20141 continue;
20142 }
20143
20144 for(MInt i = 0; i < PV->noVariables; i++) {
20145 a_pvariable(cellId, i) += FnoChildren * a_pvariable(c_childId(cellId, childId), i);
20146 // a_FcellVolume( c_childId( cellId , childId ) ) *a_pvariable( c_childId( cellId , childId ) , i );
20147 }
20148 }
20149 }
20150 }
20151 ASSERT(m_combustion, "someone changed the code -> this code is only needed for combustion computations");
20152}

◆ computePrimitiveVariablesMultiSpecies_()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computePrimitiveVariablesMultiSpecies_ ( const  MUint)

◆ computePV()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computePV
virtual

Definition at line 6141 of file fvcartesiansolverxd.cpp.

6141 {
6142 TRACE();
6143
6145
6148 }
6149
6151}
virtual void filterConservativeVariablesAtFineToCoarseGridInterfaces()
virtual void computePrimitiveVariables()
Dispatches the computation of the primitive variables for different number of species.
virtual void copyVarsToSmallCells()

◆ computeQCriterion()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeQCriterion ( MFloatScratchSpace qCriterion)
protected

Definition at line 8353 of file fvcartesiansolverxd.cpp.

8353 {
8354 TRACE();
8355 // Q - criterion
8356 MFloat normS, normO;
8357 MInt offsetS = nDim * nDim;
8358 MInt tmpSize = offsetS + offsetS;
8359 MFloatScratchSpace grad(offsetS, AT_, "grad");
8360 MFloatScratchSpace q(tmpSize, AT_, "q");
8361
8362 for(MInt c = 0; c < noInternalCells(); c++) {
8363 // compute the velocity vector gradient
8364 for(MInt i = 0; i < nDim; i++) {
8365 for(MInt j = 0; j < nDim; j++) {
8366 grad.p[i * nDim + j] = a_slope(c, PV->VV[i], j);
8367 }
8368 }
8369 // compute the strain rate and vorticity tensor
8370 for(MInt i = 0; i < nDim; i++) {
8371 for(MInt j = 0; j < nDim; j++) {
8372 q.p[j + i * nDim] = F1B2 * (grad.p[i * nDim + j] + grad.p[j * nDim + i]);
8373 q.p[j + i * nDim + offsetS] = F1B2 * (grad.p[i * nDim + j] - grad.p[j * nDim + i]);
8374 }
8375 }
8376 // compute the value of Q
8377 normS = F0;
8378 normO = F0;
8379 for(MInt i = 0; i < nDim; i++) {
8380 for(MInt j = 0; j < nDim; j++) {
8381 normS += POW2(q.p[i * nDim + j]);
8382 normO += POW2(q.p[i * nDim + offsetS + j]);
8383 }
8384 }
8385 qCriterion.p[c] = F1B2 * (normO - normS);
8386 }
8387}
pointer p
Deprecated: use [] instead!
Definition: scratch.h:315

◆ computeRecConstPeriodic()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeRecConstPeriodic

Definition at line 31571 of file fvcartesiansolverxd.cpp.

31571 {
31572 IF_CONSTEXPR(nDim == 2) { mTerm(1, "Azimuthal periodicity concept meaningful only in 3D."); }
31573 else {
31575 }
31576}

◆ computeRecConstPeriodic_()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeRecConstPeriodic_
inline

\computes reconstruction constants for LS recinstruction (azimuthal periodicity concept)

Author
Alexej Pogorelov

Definition at line 31583 of file fvcartesiansolverxd.cpp.

31583 {
31584 TRACE();
31585
31586
31587 MBool nonlinear = true; // false;
31588 MInt maxNoNghbrs = 200;
31589 MInt matrix_dim = nDim + 1;
31590 if(nonlinear) {
31591 matrix_dim = 3 * nDim + 1;
31592 }
31593
31594 MFloatScratchSpace mat(maxNoNghbrs, matrix_dim, AT_, "mat");
31595 MFloatScratchSpace matInv(matrix_dim, maxNoNghbrs, AT_, "matInv");
31596 MFloatScratchSpace weights(maxNoNghbrs, AT_, "weights");
31597 MIntScratchSpace nghbrList_(maxNoNghbrs, AT_, "nghbrList");
31598 MIntScratchSpace layerId_(maxNoNghbrs, AT_, "layerList");
31599
31600
31601 mat.fill(F0);
31602 weights.fill(F0);
31603
31604 // rec const for non bndry cells
31605 MInt n_Id = -1;
31606 MInt cell_Id = -1;
31607 MInt sortedId = -1;
31608 MInt k_ = 0;
31609 MInt offset_cell = 0;
31610 MInt off_ = 0;
31611 MInt noSendingCells = 0;
31612 MInt counter_ = 0;
31613
31614 for(MInt d = 0; d < noDomains(); d++) {
31615 noSendingCells += m_noPerCellsToSend[d];
31616 }
31617
31618
31619 mAlloc(m_reconstructionDataPeriodic, noSendingCells + 1, "m_reconstructionDataPeriodic", -1, AT_);
31620 mAlloc(m_reconstructionConstantsPeriodic, (noSendingCells * maxNoNghbrs * 2), "m_reconstructionConstantsPeriodic", F0,
31621 AT_);
31622
31624
31625 for(MInt d = 0; d < noDomains(); d++) {
31626 for(MInt c = 0; c < m_noPerCellsToSend[d]; c++) {
31627 cell_Id = static_cast<MInt>(m_periodicDataToSend[d][6 + c * m_noPeriodicData]);
31628 sortedId = static_cast<MInt>(m_periodicDataToSend[d][5 + c * m_noPeriodicData]);
31629
31630
31631 MFloat normalizationFactor = FPOW2(a_level(cell_Id)) / c_cellLengthAtLevel(0);
31632
31633 counter_ = 0;
31634
31635 counter_ = getAdjacentLeafCells<2, true>(cell_Id, 2, nghbrList_, layerId_);
31636 k_ = 0;
31637
31638 if(counter_ > maxNoNghbrs) {
31639 mTerm(1, AT_, "raise noMaxNghbrs");
31640 }
31641
31642 /* MBool correct = false;
31643 if(a_bndryId(cell_Id)>-1 && correct)
31644 {
31645 MInt srfc=0;
31646 MFloat dn=0.0;//c_cellLengthAtCell(cell_Id)/100.0;//0.0;
31647 MInt bndryId=a_bndryId(cell_Id);
31648
31649 for( MInt i=0; i<nDim; i++ ) { dn += m_bndryCells->a[ bndryId
31650 ].m_srfcs[srfc]->m_normalVector[ i ] * ( m_periodicCellDataDom[d][i+sortedId*5] -
31651 m_bndryCells->a[ bndryId ].m_srfcs[srfc]->m_coordinates[ i ] );
31652 }
31653
31654
31655
31656 if(dn<0.0){
31657 cerr << "rotated point is outside / will be corrected" <<
31658 m_periodicCellDataDom[d][0+sortedId*5] << " " << m_periodicCellDataDom[d][1+sortedId*5] << "
31659 " << m_periodicCellDataDom[d][2+sortedId*5]<< " dn " << dn <<endl;
31660
31661 dn=fabs(dn);
31662 for ( MInt i = 0; i < nDim; i++ ) {
31663 m_periodicCellDataDom[d][i+sortedId*5] = m_periodicCellDataDom[d][i+sortedId*5]
31664 + 2.0*dn*m_bndryCells->a[ bndryId ].m_srfcs[srfc]->m_normalVector[ i ];
31665 }
31666
31667
31668 dn=0.0;
31669
31670
31671
31672 for( MInt i=0; i<nDim; i++ ) { dn += m_bndryCells->a[ bndryId
31673 ].m_srfcs[srfc]->m_normalVector[ i ] * ( m_periodicCellDataDom[d][i+sortedId*5] -
31674 m_bndryCells->a[ bndryId ].m_srfcs[srfc]->m_coordinates[ i ] );
31675 }
31676
31677 if(dn<0.0){
31678
31679 cerr << "rotated point is still outside " << m_periodicCellDataDom[d][0+sortedId*5] << "
31680 " << m_periodicCellDataDom[d][1+sortedId*5] << " " << m_periodicCellDataDom[d][2+sortedId*5]<<
31681 " dn " << dn<<endl; mTerm(1,AT_, "point still outside domain");
31682 }
31683 }
31684
31685 }
31686
31687
31688*/
31689
31690 for(MInt n = 0; n < counter_; n++) {
31691 n_Id = nghbrList_[n];
31692 if(n_Id < 0) {
31693 continue;
31694 }
31695 if(a_hasProperty(n_Id, SolverCell::IsPeriodicWithRot)) {
31696 continue;
31697 }
31698 if(!a_hasProperty(n_Id, SolverCell::IsOnCurrentMGLevel)) {
31699 continue;
31700 }
31701 if(c_noChildren(n_Id) > 0) {
31702 continue;
31703 }
31704 if(n_Id == cell_Id) {
31705 continue;
31706 }
31707
31708 m_reconstructionConstantsPeriodic[offset_cell + k_] = nghbrList_[n];
31709
31710 MInt cnt = 0;
31711
31712 mat(k_, cnt) = F1;
31713 cnt++;
31714
31715 MFloat dx = F0;
31716 for(MInt i = 0; i < nDim; i++) {
31717 mat(k_, cnt) = (a_coordinate(n_Id, i) - m_periodicCellDataDom[d][i + sortedId * m_noPeriodicCellData])
31718 * normalizationFactor;
31719 dx += POW2(a_coordinate(n_Id, i) - m_periodicCellDataDom[d][i + sortedId * m_noPeriodicCellData]);
31720 cnt++;
31721 }
31722
31723 weights(k_) = maia::math::RBF(dx, POW2(c_cellLengthAtCell(cell_Id)));
31724
31725
31726 if(nonlinear) {
31727 for(MInt i = 0; i < nDim; i++) {
31728 mat(k_, cnt) =
31729 0.5
31730 * POW2((a_coordinate(n_Id, i) - m_periodicCellDataDom[d][i + sortedId * m_noPeriodicCellData])
31731 * normalizationFactor);
31732 cnt++;
31733 }
31734
31735 for(MInt i = 0; i < nDim; i++) {
31736 for(MInt j = i + 1; j < nDim; j++) {
31737 mat(k_, cnt) = (a_coordinate(n_Id, j) - m_periodicCellDataDom[d][j + sortedId * m_noPeriodicCellData])
31738 * (a_coordinate(n_Id, i) - m_periodicCellDataDom[d][i + sortedId * m_noPeriodicCellData])
31739 * POW2(normalizationFactor);
31740 cnt++;
31741 }
31742 }
31743 }
31744 k_++;
31745 }
31746
31747
31748 if(!a_hasProperty(cell_Id, SolverCell::IsPeriodicWithRot)) // add cell for rec
31749 {
31750 m_reconstructionConstantsPeriodic[offset_cell + k_] = cell_Id;
31751 MInt cnt = 0;
31752
31753 mat(k_, cnt) = F1;
31754 cnt++;
31755
31756 MFloat dx = F0;
31757 for(MInt i = 0; i < nDim; i++) {
31758 mat(k_, cnt) = (a_coordinate(cell_Id, i) - m_periodicCellDataDom[d][i + sortedId * m_noPeriodicCellData])
31759 * normalizationFactor;
31760 dx += POW2(a_coordinate(cell_Id, i) - m_periodicCellDataDom[d][i + sortedId * m_noPeriodicCellData]);
31761 cnt++;
31762 }
31763
31764 weights(k_) = maia::math::RBF(dx, POW2(c_cellLengthAtCell(cell_Id)));
31765
31766
31767 if(nonlinear) {
31768 for(MInt i = 0; i < nDim; i++) {
31769 mat(k_, cnt) =
31770 0.5
31771 * POW2((a_coordinate(cell_Id, i) - m_periodicCellDataDom[d][i + sortedId * m_noPeriodicCellData])
31772 * normalizationFactor);
31773 cnt++;
31774 }
31775
31776
31777 for(MInt i = 0; i < nDim; i++) {
31778 for(MInt j = i + 1; j < nDim; j++) {
31779 mat(k_, cnt) =
31780 (a_coordinate(cell_Id, j) - m_periodicCellDataDom[d][j + sortedId * m_noPeriodicCellData])
31781 * (a_coordinate(cell_Id, i) - m_periodicCellDataDom[d][i + sortedId * m_noPeriodicCellData])
31782 * POW2(normalizationFactor);
31783 cnt++;
31784 }
31785 }
31786 }
31787
31788 k_++;
31789 }
31790
31791
31792 maia::math::invert(mat, weights, matInv, k_, matrix_dim);
31793
31794
31795 for(MInt l = 0; l < k_; l++) {
31796 for(MInt i = 0; i < matrix_dim - 1; i++) {
31797 matInv(1 + i, l) *= normalizationFactor;
31798 }
31799 }
31800
31801
31802 for(MInt l = 0; l < k_; l++) {
31803 m_reconstructionConstantsPeriodic[offset_cell + k_ + l] = matInv(0, l);
31804 if((offset_cell + k_ + l) > (noSendingCells * maxNoNghbrs * 2)) {
31805 mTerm(1, AT_, "raise noSendingCells");
31806 }
31807 }
31808
31809
31810 offset_cell += 2 * k_;
31811
31812 m_reconstructionDataPeriodic[off_ + c + 1] = offset_cell;
31813 }
31814
31815 off_ += m_noPerCellsToSend[d];
31816 }
31817}
MFloat * m_reconstructionConstantsPeriodic
constexpr MFloat FPOW2(MInt x)
MFloat RBF(const MFloat R, const MFloat R0)
radial base function
Definition: maiamath.h:873
void invert(MFloat *A, const MInt m, const MInt n)
Definition: maiamath.cpp:171

◆ computeRecConstSVD()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::computeRecConstSVD ( const MInt  cellId,
const MInt  offset,
MFloatScratchSpace tmpA,
MFloatScratchSpace tmpC,
MFloatScratchSpace weights,
const MInt  recDim,
const MInt  weightMode,
const MInt  fallBackMode,
const std::array< MBool, nDim dirs = {},
const MBool  relocateCenter = false 
)

weightMode 0 : only use distance weights weightMode 1 : only use distance weights and set weight = 0 for diagonal neighbors weightMode 2 : use distance and cellFraction weights for all neighbors weightMode 3 : special treatment at rfn-interface weightMode 4 : special treatment at rfn-interface, away from bndries weights are such that stencil is 2nd order accurate; m_relocateCenter==true: slopes of bndry cells are determined by a simultanous least-square in all directions; if stencil of non-bndry cell has a bndry cell in its stencil, the cell center of that cell is relocated by means of the temporarily determined least-square slopes

fallBackMode -1 : no fall-back, print error message if the computation fails fallBackMode 1 : stencilCheck, based on direct neighbor distance and stencil extension if the computation fails

Author
Lennart Schneiders, Update Tim Wegmann

Definition at line 9018 of file fvcartesiansolverxd.cpp.

9023 {
9024 const MBool allDirs = std::all_of(dirs.begin(), dirs.end(), [](const MBool _) { return _ == false; });
9025 const MInt noDirs = std::accumulate(dirs.begin(), dirs.end(), 0);
9026 MInt currentSlopeDir = -1;
9027 if(noDirs == 1) {
9028 for(MInt d = 0; d < nDim; ++d) {
9029 if(dirs[d]) {
9030 currentSlopeDir = d;
9031 break;
9032 }
9033 }
9034 }
9035 ASSERT(a_hasProperty(cellId, SolverCell::IsSplitChild) || a_hasProperty(cellId, SolverCell::IsSplitClone)
9036 || c_isLeafCell(cellId),
9037 "");
9038 ASSERT(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel), "");
9039 ASSERT(a_hasProperty(cellId, SolverCell::IsFlux), "");
9040 ASSERT(!a_hasProperty(cellId, SolverCell::IsNotGradient), "");
9041 ASSERT(!a_isBndryGhostCell(cellId), "");
9042 const MInt noNghbrIds = a_noReconstructionNeighbors(cellId);
9043 if(noNghbrIds == 0) {
9044 return F0;
9045 }
9046 ASSERT(tmpA.size0() >= noNghbrIds && tmpA.size1() >= recDim, "");
9047 ASSERT(tmpC.size0() >= recDim && tmpC.size1() >= noNghbrIds, "");
9048 ASSERT(weights.size0() >= noNghbrIds, "");
9049 ASSERT(noNghbrIds <= m_cells.noRecNghbrs(), "");
9050
9051 const MInt rootCell = (a_hasProperty(cellId, SolverCell::IsSplitChild)) ? getAssociatedInternalCell(cellId) : cellId;
9052 const MFloat cellLength = c_cellLengthAtCell(cellId);
9053
9054 ASSERT(rootCell > -1 && rootCell < a_noCells(), "");
9055
9056 //
9057 if((weightMode == 3 || weightMode == 4) && allDirs) {
9058 std::array<MBool, nDim> dirsJmp = {};
9059 for(MInt d = 0; d < nDim; ++d) {
9060 const MBool coarseNghbr =
9061 m_cells.nghbrInterface(cellId, 2 * d) == 3 || m_cells.nghbrInterface(cellId, 2 * d + 1) == 3;
9062 const MBool fineNghbr =
9063 m_cells.nghbrInterface(cellId, 2 * d) == 2 || m_cells.nghbrInterface(cellId, 2 * d + 1) == 2;
9064 if(coarseNghbr || fineNghbr) {
9065 dirsJmp[d] = true;
9066 } else {
9067 dirsJmp[d] = false;
9068 }
9069 }
9070
9071 //
9072 MBool hasBndryInStencil = false;
9073 for(MInt n = 0; n < noNghbrIds; n++) {
9075 hasBndryInStencil = true;
9076 break;
9077 }
9078 }
9079
9080 // Bndry cells are by now treated as before, so one LS-system is solved for slopes in all directions
9081 if(a_isBndryCell(cellId) || a_isBndryGhostCell(cellId) || hasBndryInStencil) {
9082 std::fill_n(&dirsJmp[0], nDim, false);
9083 }
9084
9085 // Determine provisional slopes to correct cell center of bndry cells
9086 if(weightMode == 4 && m_relocateCenter) {
9087 if(hasBndryInStencil && !a_isBndryCell(cellId)) {
9088 std::array<MBool, nDim> dir;
9089 std::fill_n(&dir[0], nDim, true);
9090 computeRecConstSVD(cellId, offset, tmpA, tmpC, weights, recDim, weightMode, fallBackMode, dir);
9091 }
9092 }
9093
9094 MFloat condNumMax = std::numeric_limits<MFloat>::lowest();
9095 std::array<MBool, nDim> dir = dirsJmp;
9096 for(auto& d : dir) {
9097 d = !d;
9098 }
9099 if(std::any_of(dir.begin(), dir.end(), [](MBool _) { return _ == true; })) {
9100 auto condNum = computeRecConstSVD(cellId, offset, tmpA, tmpC, weights, recDim, weightMode, fallBackMode, dir,
9101 !a_isBndryCell(cellId) && m_relocateCenter);
9102 condNumMax = mMax(condNum, condNumMax);
9103 }
9104
9105 if(weightMode == 3) {
9106 if(std::any_of(dirsJmp.begin(), dirsJmp.end(), [](MBool _) { return _ == true; })) {
9107 auto condNum =
9108 computeRecConstSVD(cellId, offset, tmpA, tmpC, weights, recDim, weightMode, fallBackMode, dirsJmp);
9109 condNumMax = mMax(condNum, condNumMax);
9110 }
9111 }
9112 if(weightMode == 4) { // all jmp-directions are treated seperately according to method-of-lines principle
9113 for(MInt d = 0; d < nDim; ++d) {
9114 if(dirsJmp[d]) {
9115 std::array<MBool, nDim> dirsJmp_ = {};
9116 dirsJmp_[d] = true;
9117 auto condNum = computeRecConstSVD(cellId, offset, tmpA, tmpC, weights, recDim, weightMode, fallBackMode,
9118 dirsJmp_, !a_isBndryCell(cellId) && m_relocateCenter);
9119 condNumMax = mMax(condNum, condNumMax);
9120 }
9121 }
9122 }
9123
9124 return condNumMax;
9125 }
9126
9127 // Lambda fnct for weightMode == 3 & 4
9128 constexpr MFloat EPS = 1e-10;
9129 // Returns the direction of the nghbr, if nghbrId is a direct nghbr; returns -1 if nghbrId is the
9130 // ghost cell of cellId; return -2 if nghbrId does not share a common surface.
9131 auto isDirectNghbr = [=](const MInt nghbrId) {
9132 if(a_isBndryCell(cellId) && a_isBndryGhostCell(nghbrId)) {
9133 return -1;
9134 }
9135 for(MInt d = 0; d < nDim; ++d) {
9136 if(!dirs[d]) {
9137 continue;
9138 }
9139 for(MInt side = 0; side < 2; ++side) {
9140 const MInt orientation = 2 * d + side;
9141 if(a_level(nghbrId) == a_level(cellId)) {
9142 if(checkNeighborActive(cellId, orientation) && a_hasNeighbor(cellId, orientation)
9143 && c_neighborId(cellId, orientation) == nghbrId) {
9144 return orientation;
9145 }
9146 } else if(a_level(nghbrId) < a_level(cellId)) {
9147 if(c_neighborId(c_parentId(cellId), orientation) == nghbrId) {
9148 return orientation;
9149 }
9150 } else if(a_level(nghbrId) > a_level(cellId)) {
9151 if(checkNeighborActive(cellId, orientation) && a_hasNeighbor(cellId, orientation)) {
9152 const MInt nghbrParentId = c_neighborId(cellId, orientation);
9153 for(MInt child = 0; child < IPOW2(nDim); child++) {
9154 if(c_childId(nghbrParentId, child) == nghbrId) {
9155 if(childCodePro[orientation] & 1 << child) {
9156 return orientation;
9157 }
9158 }
9159 }
9160 }
9161 }
9162 }
9163 }
9164 return -2;
9165 };
9166
9167 // initialise weights
9168 weights.fill(F0);
9169
9170 // a) set direct neighbors for weightMode 1
9171 set<MInt> nextNghbrs;
9172 nextNghbrs.clear();
9173 if(weightMode == 1) {
9174 for(MInt dir = 0; dir < m_noDirs; dir++) {
9175 if(checkNeighborActive(rootCell, dir) && a_hasNeighbor(rootCell, dir) > 0) {
9176 const MInt nghbrId = c_neighborId(rootCell, dir);
9177 if(a_hasProperty(nghbrId, SolverCell::IsOnCurrentMGLevel)) {
9178 nextNghbrs.insert(nghbrId);
9179 }
9180 }
9181 }
9182 }
9183
9184 // b) set weights based on weightMode
9185 array<MInt, 2 * nDim> noFineNghbrs{};
9186 MBool hasBndryInStencil = false;
9187 for(MInt n = 0; n < noNghbrIds; n++) {
9188 const MInt nghbrId = a_reconstructionNeighborId(cellId, n);
9189 const MInt nghbrRootId =
9190 (a_hasProperty(nghbrId, SolverCell::IsSplitChild)) ? getAssociatedInternalCell(nghbrId) : nghbrId;
9191
9192 hasBndryInStencil = hasBndryInStencil || a_isBndryCell(nghbrId);
9193
9194 // compute distance weight
9195 MFloat dxdx = F0;
9196 for(MInt i = 0; i < nDim; i++) {
9197 dxdx += POW2(a_coordinate(nghbrId, i) - a_coordinate(cellId, i));
9198 }
9199
9200 MFloat fac = F1;
9201 // compute volume weight factor for weightMode 2
9202 // based on cell distances and volume ratios
9203 // to account for small cells falling out of the stencil!
9204 if(weightMode == 2 && !a_isBndryGhostCell(nghbrId) && a_isBndryCell(nghbrId)) {
9205 const MFloat vf = a_cellVolume(nghbrId) / c_cellVolumeAtLevel(a_level(nghbrId));
9206 fac = maia::math::deltaFun(vf, 1e-6, 0.1);
9207 // don't kompletly fade out small cells, but reduce them to the same value as uncut neighbors
9208 // which have a larger distance!
9209 if(m_engineSetup) {
9210 fac = fac * 0.5 + 0.5;
9211 }
9212 // if (a_bndryId( nghbrId )== -2 ) {
9213 // fac = F1 - maia::math::deltaFun( m_fvBndryCnd->m_bndryCells->a[a_bndryId( cellId )].m_volume/m_gridCellVolume[
9214 // a_level(cellId) ], 0.9, F1 );
9215 //}
9216 }
9217
9218 // set weight to zero for all non-direct neighbors for weightMode 1
9219 if(weightMode == 1 && !a_isBndryGhostCell(nghbrId)) {
9220 fac = (nextNghbrs.count(nghbrRootId) == 0) ? F0 : fac;
9221 // TODO labels:FV possibly change: do not to compute the diagonal neighbors as
9222 // their weight is currently set to zero and their reconstruction Constant
9223 // is thus very low!
9224 }
9225
9226 if(weightMode == 3 || weightMode == 4) {
9227 // By now bndry cells are excluded
9228 const MInt orientation = isDirectNghbr(nghbrId);
9229 if(((!a_isBndryCell(cellId) && !a_isBndryGhostCell(nghbrId)) || m_reExcludeBndryDiagonals) && orientation == -2) {
9230 fac = 0.0;
9232 && a_level(nghbrId) > a_level(cellId)) {
9233 TERMM_IF_NOT_COND(orientation >= 0 && orientation < 2 * nDim, "");
9234 ++noFineNghbrs[orientation];
9235 }
9236 }
9237
9238 weights[n] = fac * maia::math::RBF(dxdx, POW2(cellLength));
9239 // weights[n] = POW2(c_cellLengthAtCell(cellId) )/dxdx;
9240 }
9241
9242 // Update weights such that slope computation is 2nd order over rfn-jmp for 3-point stencil for locally 1D flow.
9243 // Since currently the stencils of bndry cells include diagonal cells, a weighting is needed
9244 // for the solutoin to be smooth, and weighting is kept as before.
9245 if((weightMode == 3 || weightMode == 4) && m_2ndOrderWeights
9246 && (!a_isBndryCell(cellId) || m_reExcludeBndryDiagonals)) {
9247 for(MInt n = 0; n < noNghbrIds; n++) {
9248 const MInt nghbrId = a_reconstructionNeighborId(cellId, n);
9249 if(approx(weights[n], 0.0, EPS)) {
9250 continue; // if weight was set to zero previously continue
9251 }
9252
9253 MFloat dxdx = F0;
9254 if(relocateCenter) {
9255 const MInt d = (MInt)isDirectNghbr(nghbrId) / 2;
9256 TERMM_IF_NOT_COND(d >= 0 && d < nDim, "Try setting reExcludeBndryDiagonals==true and retry!");
9257 dxdx = POW2(a_coordinate(nghbrId, d) - a_coordinate(cellId, d));
9258 } else {
9259 for(MInt i = 0; i < nDim; i++) {
9260 if(dirs[i]) {
9261 dxdx += POW2(a_coordinate(nghbrId, i) - a_coordinate(cellId, i));
9262 }
9263 }
9264 }
9265
9266 // If a bndry cell is contained in stencil, reduce power of weighting from w^2~1/dx^3 (2nd order)
9267 const MFloat exp = hasBndryInStencil ? 0.0 : 0.75;
9268 weights[n] = 1.0 / pow(fabs(dxdx), exp);
9269 if(a_level(nghbrId) > a_level(cellId)) {
9270 const MInt orientation = isDirectNghbr(nghbrId);
9271 TERMM_IF_NOT_COND(orientation >= 0 && orientation < 2 * nDim, "");
9272 weights[n] *= 1.0 / sqrt(noFineNghbrs[orientation]);
9273 }
9274 }
9275 }
9276
9277 // compute Stencil check
9278 if(fallBackMode == 1) {
9279 // compute stencil check and dirTest
9280 MFloat dirTest[3] = {F0, F0, F0};
9281 for(MInt n = 0; n < a_noReconstructionNeighbors(cellId); n++) {
9282 const MInt nghbrId = a_reconstructionNeighborId(cellId, n);
9283 ASSERT(!a_hasProperty(nghbrId, SolverCell::IsSplitCell), "");
9284 for(MInt i = 0; i < nDim; i++) {
9285 dirTest[i] =
9286 mMax(dirTest[i], weights(n) * fabs(a_coordinate(nghbrId, i) - a_coordinate(cellId, i)) / cellLength);
9287 }
9288 }
9289 MFloat stencilCheck = F1;
9290 for(MInt i = 0; i < nDim; i++) {
9291 stencilCheck = mMin(stencilCheck, dirTest[i]);
9292 }
9293 // if the cells are to close to each other, the stencil is extended
9294 if(stencilCheck < 0.1) {
9295 extendStencil(cellId);
9296 }
9297 // compute reconstruction constants and return
9298 return computeRecConstSVD(cellId, offset, tmpA, tmpC, weights, recDim, weightMode, 2);
9299 }
9300
9301
9302 const MFloat normalizationFactor = FPOW2(a_level(cellId)) / c_cellLengthAtLevel(0);
9303 // reduces the condition number of the eq system
9304
9305 std::vector<MBool> zeroColumns(recDim, true);
9306 std::array<MInt, nDim> recNghbrsRfn;
9307 std::fill_n(&recNghbrsRfn[0], nDim, -1);
9308 std::array<MFloat, nDim - 1> recConstantsRfn = {};
9309 MBool foundCoarseNghbr = false;
9310 for(MInt n = 0; n < noNghbrIds; n++) {
9311 const MInt nghbrId = a_reconstructionNeighborId(cellId, n);
9312 std::array<MFloat, nDim> dx;
9313 dx.fill(0.0);
9314 if(weightMode == 4) {
9315 if(!a_isBndryCell(cellId) && weights[n] > EPS && a_level(nghbrId) < a_level(cellId)
9316 && currentSlopeDir != -1) { //(relocateCenter == m_relocateCenter)) {
9317 TERMM_IF_NOT_COND(currentSlopeDir != -1, "Only one direction at a time should be considered");
9318 TERMM_IF_NOT_COND(!foundCoarseNghbr, "Only one coarse nghbr per direction is allowed!");
9319 recNghbrsRfn[0] = n;
9320 MInt dimN = currentSlopeDir; // direction of coarse nghbr
9321 array<MInt, nDim - 1> dimT{}; // tangential directions
9322 MFloatScratchSpace dxT(nDim - 1, nDim - 1, AT_, "dxT"); // dx in tangential directions
9323 MInt noTDims = 0;
9324 for(MInt i = 0; i < nDim; ++i) {
9325 if(i != dimN) {
9326 const MInt dir = a_coordinate(cellId, i) > a_coordinate(nghbrId, i) ? 0 : 1;
9327 if(checkNeighborActive(cellId, 2 * i + dir) && a_hasNeighbor(cellId, 2 * i + dir), "") {
9328 const MInt nghbrId_ = c_neighborId(cellId, 2 * i + dir);
9329 for(MInt nn = 0; nn < noNghbrIds; nn++) {
9330 if(a_reconstructionNeighborId(cellId, nn) == nghbrId_) {
9331 recNghbrsRfn[noTDims + 1] = nn;
9332 }
9333 }
9334 TERMM_IF_NOT_COND(recNghbrsRfn[noTDims + 1] != -1, "This nghbr must exist in rec-stencil!");
9335 TERMM_IF_NOT_COND(a_hasProperty(nghbrId_, SolverCell::IsOnCurrentMGLevel), "");
9336 dimT[noTDims] = i;
9337 for(MInt d = 0, dd = 0; d < nDim; ++d) {
9338 if(d != dimN) {
9339 dxT(dd++, noTDims) = a_coordinate(nghbrId_, d) - a_coordinate(cellId, d);
9340 }
9341 }
9342 ++noTDims;
9343 }
9344 }
9345 }
9346
9347 dx[dimN] = a_coordinate(nghbrId, dimN) - a_coordinate(cellId, dimN);
9348 if(noTDims == nDim - 1) {
9349 MFloatScratchSpace dxT_inv(nDim - 1, nDim - 1, AT_, "dxT_inv");
9350 maia::math::invert(dxT, dxT_inv, nDim - 1, nDim - 1);
9351 for(MInt i = 0; i < nDim - 1; ++i) {
9352 recConstantsRfn[i] = 0;
9353 for(MInt d = 0; d < nDim - 1; ++d) {
9354 recConstantsRfn[i] += dxT_inv(i, d) * (a_coordinate(nghbrId, dimT[d]) - a_coordinate(cellId, dimT[d]));
9355 }
9356 if(!a_isBndryCell(nghbrId) && !a_isBndryCell(a_reconstructionNeighborId(cellId, recNghbrsRfn[1]))
9357 && !a_isBndryCell(a_reconstructionNeighborId(cellId, recNghbrsRfn[nDim - 1]))) {
9358 TERMM_IF_NOT_COND(approx(recConstantsRfn[i], 0.5, EPS), "");
9359 }
9360 }
9361 for(MInt i = 0; i < nDim - 1; ++i) {
9362 const MInt nghbrId_ = a_reconstructionNeighborId(cellId, recNghbrsRfn[i + 1]);
9363 dx[dimN] += (a_coordinate(cellId, dimN) - a_coordinate(nghbrId_, dimN)) * recConstantsRfn[i];
9364 }
9365 }
9366 if(nDim == 3 && noTDims == 1) {
9367 for(MInt d = 0, dd = 0; d < nDim; ++d) {
9368 if(d != dimN) {
9369 dxT(dd, noTDims) = dxT(1 - dd, 0);
9370 ++dd;
9371 }
9372 }
9373 dxT(0, noTDims) *= -1;
9374 MFloatScratchSpace dxT_inv(nDim - 1, nDim - 1, AT_, "dxT_inv");
9375 maia::math::invert(dxT, dxT_inv, nDim - 1, nDim - 1);
9376 recConstantsRfn[0] = 0;
9377 for(MInt d = 0; d < nDim - 1; ++d) {
9378 recConstantsRfn[0] += dxT_inv(0, d) * (a_coordinate(nghbrId, dimT[d]) - a_coordinate(cellId, dimT[d]));
9379 }
9380 dx[dimN] +=
9381 (a_coordinate(cellId, dimN) - a_coordinate(a_reconstructionNeighborId(cellId, recNghbrsRfn[1]), dimN))
9382 * recConstantsRfn[0];
9383 }
9384 dx[dimN] *= normalizationFactor;
9385 foundCoarseNghbr = true;
9386 //} //else if(!a_isBndryCell(cellId) && weights[n] > EPS && a_level(nghbrId) > a_level(cellId)) {
9387 // for(MInt i = 0; i < nDim; i++) {
9388 // dx[i] = (a_coordinate(nghbrId, i) - a_coordinate(cellId, i)) * normalizationFactor;
9389 //}
9390 } else {
9391 if(relocateCenter) {
9392 const MInt d = (MInt)isDirectNghbr(nghbrId) / 2;
9393 if(d > -1) {
9394 dx[d] = (a_coordinate(nghbrId, d) - a_coordinate(cellId, d)) * normalizationFactor;
9395 }
9396 } else {
9397 for(MInt i = 0; i < nDim; i++) {
9398 if(dirs[i]) {
9399 dx[i] = (a_coordinate(nghbrId, i) - a_coordinate(cellId, i)) * normalizationFactor;
9400 }
9401 }
9402 }
9403 }
9404 } else if(weightMode == 3) {
9405 for(MInt i = 0; i < nDim; i++) {
9406 if(dirs[i]) {
9407 dx[i] = (a_coordinate(nghbrId, i) - a_coordinate(cellId, i)) * normalizationFactor;
9408 }
9409 }
9410 } else {
9411 for(MInt i = 0; i < nDim; i++) {
9412 dx[i] = (a_coordinate(nghbrId, i) - a_coordinate(cellId, i)) * normalizationFactor;
9413 }
9414 }
9415 MInt cnt = 0;
9416 for(MInt i = 0; i < nDim; i++) {
9417 tmpA(n, i) = dx[i];
9418 if(fabs(tmpA(n, i)) > EPS && fabs(weights[n]) > EPS) {
9419 zeroColumns[i] = false;
9420 }
9421 cnt++;
9422 }
9423 for(MInt i = 0; i < nDim; i++) {
9424 if(cnt < recDim) {
9425 tmpA(n, cnt) = F1B2 * POW2(dx[i]);
9426 if(fabs(tmpA(n, cnt)) > EPS && fabs(weights[n]) > EPS) {
9427 zeroColumns[cnt] = false;
9428 }
9429 cnt++;
9430 }
9431 }
9432 for(MInt i = 0; i < nDim; i++) {
9433 for(MInt j = i + 1; j < nDim; j++) {
9434 if(cnt < recDim) {
9435 tmpA(n, cnt) = dx[i] * dx[j];
9436 if(fabs(tmpA(n, cnt)) > EPS && fabs(weights[n]) > EPS) {
9437 zeroColumns[cnt] = false;
9438 }
9439 cnt++;
9440 }
9441 }
9442 }
9443 }
9444
9445 // Remove zero columns
9446 for(MInt n = 0; n < noNghbrIds; n++) {
9447 for(MInt i = 0, ii = 0; i < recDim; ++i) {
9448 if(!allDirs && !dirs[i]) { // TODO check if this would improve solution quality
9449 zeroColumns[i] = true;
9450 }
9451 if(!zeroColumns[i]) {
9452 tmpA(n, ii) = tmpA(n, i);
9453 ++ii;
9454 }
9455 }
9456 }
9457
9458 const MInt recDimSignificant = std::count(zeroColumns.begin(), zeroColumns.end(), false);
9459 TERMM_IF_COND(recDimSignificant == 0,
9460 std::to_string(dirs[0]) + " " + std::to_string(dirs[1]) + " " + std::to_string(allDirs));
9461
9462 const MInt rank = maia::math::invertR(tmpA, weights, tmpC, noNghbrIds, recDimSignificant);
9463 if(rank < min(noNghbrIds, recDimSignificant)) {
9464#ifndef NDEBUG
9465 cerr << domainId() << ": QRD failed for cell " << cellId << " " << c_globalId(cellId) << " " << a_level(cellId)
9466 << " " << a_isHalo(cellId) << " " << a_hasProperty(cellId, SolverCell::IsNotGradient) << " /split "
9467 << a_hasProperty(cellId, SolverCell::IsSplitCell) << " " << a_hasProperty(cellId, SolverCell::IsSplitChild)
9468 << " " << a_hasProperty(cellId, SolverCell::HasSplitFace) << endl;
9469 for(MInt n = 0; n < noNghbrIds; n++) {
9470 cerr << weights[n] << " ";
9471 }
9472 cerr << endl;
9473 for(MInt dir = 0; dir < 2 * nDim; dir++) {
9474 if(checkNeighborActive(cellId, dir)) {
9475 cerr << a_hasNeighbor(cellId, dir) << "/" << c_neighborId(cellId, dir) << " ";
9476 }
9477 }
9478 cerr << endl;
9479#endif
9480 // todo labels:FV this is not correct tmpA and tmpC needs to be reset
9481 maia::math::invert(tmpA, weights, tmpC, noNghbrIds, recDimSignificant - 1);
9482 }
9483
9484 a_reconstructionData(cellId) = offset;
9485 if((signed)m_reconstructionConstants.size() < nDim * (offset + noNghbrIds)) {
9486 m_reconstructionConstants.resize(nDim * (offset + noNghbrIds));
9487 m_reconstructionCellIds.resize(offset + noNghbrIds);
9488 m_reconstructionNghbrIds.resize(offset + noNghbrIds);
9489 }
9490 std::vector<MFloat> reConstants;
9491 if(weightMode == 4 && relocateCenter && hasBndryInStencil) {
9492 reConstants.resize(nDim * noNghbrIds);
9493 std::copy_n(&m_reconstructionConstants[nDim * offset], nDim * noNghbrIds, &reConstants[0]);
9494 }
9495 for(MInt nghbr = 0; nghbr < noNghbrIds; nghbr++) {
9496 const MInt nghbrId = a_reconstructionNeighborId(cellId, nghbr);
9497 m_reconstructionCellIds[offset + nghbr] = cellId;
9498 m_reconstructionNghbrIds[offset + nghbr] = nghbrId;
9499 for(MInt i = 0, ii = -1; i < nDim; i++) {
9500 if(zeroColumns[i]) {
9501 continue;
9502 }
9503 ++ii;
9504 if(!allDirs && !dirs[i]) {
9505 continue;
9506 }
9507 m_reconstructionConstants[nDim * (offset + nghbr) + i] = tmpC(ii, nghbr) * normalizationFactor;
9508 }
9509 }
9510
9511 if(weightMode == 4 && relocateCenter && hasBndryInStencil) {
9512 for(MInt nghbr = 0; nghbr < noNghbrIds; nghbr++) {
9513 const MInt nghbrId = a_reconstructionNeighborId(cellId, nghbr);
9514
9515 const MInt d = (MInt)isDirectNghbr(nghbrId) / 2;
9516 if(a_isBndryCell(nghbrId) && a_level(nghbrId) >= a_level(cellId) && d > -1) {
9517 array<MFloat, nDim> dx{};
9518 for(MInt dd = 0; dd < nDim; ++dd) {
9519 if(dd != d) {
9520 dx[dd] = a_coordinate(nghbrId, dd) - a_coordinate(cellId, dd);
9521 }
9522 }
9523 for(MInt nghbr2 = 0; nghbr2 < noNghbrIds; nghbr2++) {
9524 for(MInt i = 0; i < nDim; ++i) {
9525 if(zeroColumns[i]) {
9526 continue;
9527 }
9528 if(!allDirs && !dirs[i]) {
9529 continue;
9530 }
9531 for(MInt dd = 0; dd < nDim; ++dd) {
9532 m_reconstructionConstants[nDim * (offset + nghbr2) + i] -=
9533 m_reconstructionConstants[nDim * (offset + nghbr) + i] * (reConstants[nDim * nghbr2 + dd] * dx[dd]);
9534 }
9535 }
9536 }
9537 }
9538 }
9539 }
9540
9541 if(foundCoarseNghbr) { // weightMode == 4
9542 const MInt nghbr = recNghbrsRfn[0];
9543 for(MInt i = 0; i < nDim; i++) {
9544 if(zeroColumns[i]) {
9545 continue;
9546 }
9547 if(!allDirs && !dirs[i]) {
9548 continue;
9549 }
9550 for(MInt n = 0; n < nDim - 1; ++n) {
9551 if(recNghbrsRfn[n + 1] != -1) {
9552 const MInt nghbr_ = recNghbrsRfn[n + 1];
9553 TERMM_IF_NOT_COND(approx(m_reconstructionConstants[nDim * (offset + nghbr_) + i], 0.0, MFloatEps), "");
9554 m_reconstructionConstants[nDim * (offset + nghbr_) + i] =
9555 -recConstantsRfn[n] * m_reconstructionConstants[nDim * (offset + nghbr) + i];
9556 }
9557 }
9558 }
9559 }
9560
9561 const MInt condNum = maia::math::frobeniusMatrixNormSquared(tmpA, noNghbrIds, recDimSignificant);
9562 if(condNum < F0 || condNum > 1e6 || std::isnan(condNum)) {
9563 // fall-back solution:
9564 if(fallBackMode > 0) {
9565 extendStencil(cellId);
9566 return computeRecConstSVD(cellId, offset, tmpA, tmpC, weights, recDim, weightMode, -1);
9567 }
9568
9569 // debug output
9570 cerr << domainId() << " " << globalTimeStep << " SVD decomposition for cell " << cellId << "/" << c_globalId(cellId)
9571 << " level " << a_level(cellId) << " with large condition number: " << condNum << " " << noNghbrIds << "x"
9572 << recDim << " " << a_cellVolume(cellId) / pow(cellLength, (MFloat)nDim) << " coords "
9573 << a_coordinate(cellId, 0) << ", " << a_coordinate(cellId, 1) << ", " << a_coordinate(cellId, 2) << " bndryId "
9574 << a_bndryId(cellId) << endl;
9575 for(MInt n = 0; n < noNghbrIds; n++) {
9576 cerr << c_globalId(a_reconstructionNeighborId(cellId, n)) << "(" << weights[n] << ") ";
9577 }
9578 ASSERT(false, "");
9579 }
9580
9581 return condNum;
9582}
std::vector< MInt > m_reconstructionCellIds
std::vector< MInt > m_reconstructionNghbrIds
void extendStencil(const MInt)
extend the reconstruction sencil towards all diagonal cells on the first layer
MInt & a_reconstructionData(const MInt cellId)
Returns reconstruction data offset i of the cell cellId.
std::vector< MFloat > m_reconstructionConstants
MFloat c_cellVolumeAtLevel(const MInt level) const
Returns the grid Volume of the cell for level.
MFloat computeRecConstSVD(const MInt cellId, const MInt offset, MFloatScratchSpace &tmpA, MFloatScratchSpace &tmpC, MFloatScratchSpace &weights, const MInt recDim, const MInt, const MInt, const std::array< MBool, nDim > dirs={}, const MBool relocateCenter=false)
compute the reconstruction constants of the given cell by a weighted least-squares approach via singu...
MBool checkNeighborActive(const MInt cellId, const MInt dir) const
Cecks wether the cell cellId has a valid neighbor in direction dir.
const MInt & getAssociatedInternalCell(const MInt &cellId) const
Returns the Id of the split cell, if cellId is a split child.
MInt size1() const
Definition: scratch.h:299
void fill(T val)
fill the scratch with a given value
Definition: scratch.h:311
MInt size0() const
Definition: scratch.h:298
MFloat frobeniusMatrixNormSquared(MFloatScratchSpace &m, MInt dim1, MInt dim2)
Definition: maiamath.h:328
MFloat deltaFun(const MFloat r, const MFloat r0, const MFloat r1)
Definition: maiamath.h:885
MInt invertR(T &A, T &weights, T &AInv, const MInt m, const MInt n)
Definition: maiamath.cpp:280

◆ computeReconstructionConstants()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeReconstructionConstants
virtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 25303 of file fvcartesiansolverxd.cpp.

25303 {
25304 TRACE();
25305
25306 MInt counter;
25307 const MInt noCells = a_noCells();
25308 MInt noNghbrIds, nghbrId;
25309 MInt noUnknowns = 0;
25310 if(m_orderOfReconstruction == 1) {
25311 noUnknowns = nDim;
25312 }
25313 if(m_orderOfReconstruction == 2) {
25314 noUnknowns = (nDim == 2) ? 5 : 9;
25315 }
25316 MFloat norm, tmp, normi, avg;
25317 //---
25318
25319 // (p)reset the reconstruction constants
25320 for(MInt n = 0; n < nDim * (maxNoGridCells() * m_cells.noRecNghbrs()); n++) {
25321 // m_reconstructionConstants[n] = -999;
25322 }
25323
25324 // cell-center reconstruction
25325 counter = 0;
25327 avg = F0;
25328 for(MInt cellId = 0; cellId < noCells; cellId++) {
25330 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
25331 continue;
25332 }
25333 if(!a_hasProperty(cellId, SolverCell::IsFlux)) {
25334 continue;
25335 }
25336 if(a_isBndryGhostCell(cellId)) {
25337 continue;
25338 }
25339 // if( a_hasProperty( cellId , SolverCell::IsCutOff) )
25340 // continue;
25341 if(a_hasProperty(cellId, SolverCell::IsNotGradient)) {
25342 continue;
25343 }
25344 if(a_hasProperty(cellId, SolverCell::IsInvalid)) {
25345 continue;
25346 }
25347
25348 if(a_bndryId(cellId) > -1) {
25349 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_linkedCellId > -1) {
25350 continue;
25351 }
25352 }
25353
25354 // loop over least-squares cell cluster
25355 noNghbrIds = a_noReconstructionNeighbors(cellId);
25356
25357 for(MInt nghbr = 0; nghbr < noNghbrIds; nghbr++) {
25358 nghbrId = a_reconstructionNeighborId(cellId, nghbr);
25359 for(MInt i = 0; i < nDim; i++) {
25360 m_A[nghbr][i] = a_coordinate(nghbrId, i) - a_coordinate(cellId, i);
25361 }
25362 // additional terms for a higher-order reconstruction
25363 if(m_orderOfReconstruction == 2) {
25364 for(MInt i = 0; i < nDim; i++) {
25365 m_A[nghbr][nDim + i] = POW2(a_coordinate(nghbrId, i) - a_coordinate(cellId, i));
25366 }
25367 m_A[nghbr][2 * nDim] =
25368 (a_coordinate(nghbrId, 0) - a_coordinate(cellId, 0)) * (a_coordinate(nghbrId, 1) - a_coordinate(cellId, 1));
25369 IF_CONSTEXPR(nDim == 3) {
25370 m_A[nghbr][2 * nDim + 1] = (a_coordinate(nghbrId, 0) - a_coordinate(cellId, 0))
25371 * (a_coordinate(nghbrId, 2) - a_coordinate(cellId, 2));
25372 m_A[nghbr][2 * nDim + 2] = (a_coordinate(nghbrId, 1) - a_coordinate(cellId, 1))
25373 * (a_coordinate(nghbrId, 2) - a_coordinate(cellId, 2));
25374 }
25375 }
25376 }
25377
25378 // compute ATA
25379 for(MInt i = 0; i < noUnknowns; i++) {
25380 for(MInt j = 0; j < noUnknowns; j++) {
25381 m_ATA[i][j] = F0;
25382 for(MInt k = 0; k < noNghbrIds; k++) {
25383 m_ATA[i][j] += m_A[k][i] * m_A[k][j];
25384 }
25385 }
25386 }
25387
25388 // invert ATA
25389 const MFloat epsilon = POW3(c_cellLengthAtLevel(maxRefinementLevel()) / (1000.0));
25390 if(maia::math::inverse(m_ATA, m_ATAi, noUnknowns, epsilon) == 0) {
25391 // cerr << domainId() << ": " << cellId << " " << noNghbrIds << endl;
25392 mTerm(1, AT_, "error recon");
25393 }
25394
25395 // compute the 1-norms of ATA and ATAi
25396 norm = F0;
25397 normi = F0;
25398 for(MInt j = 0; j < noUnknowns; j++) {
25399 tmp = F0;
25400 for(MInt i = 0; i < noUnknowns; i++) {
25401 tmp += ABS(m_ATA[i][j]);
25402 }
25403 norm = mMax(norm, tmp);
25404 normi = mMax(normi, tmp);
25405 }
25406
25407 // compute the condition number of ATA
25408 avg += norm * normi;
25409 counter++;
25410
25411 // compute (m_ATA)^(-1) * AT
25412 for(MInt i = 0; i < noUnknowns; i++) {
25413 for(MInt j = 0; j < noNghbrIds; j++) {
25414 m_ATA[i][j] = F0;
25415 for(MInt k = 0; k < noUnknowns; k++) {
25416 m_ATA[i][j] += m_ATAi[i][k] * m_A[j][k];
25417 }
25418 }
25419 }
25420
25424
25425 // loop over least-squares cell cluster
25426 for(MInt nghbr = 0; nghbr < noNghbrIds; nghbr++) {
25427 nghbrId = a_reconstructionNeighborId(cellId, nghbr);
25428
25429 // set cell Ids
25432
25433 // compute the constants
25434 for(MInt d = 0; d < nDim; d++) {
25436 }
25437
25439 }
25440 }
25442 m_log << " -> Least-squares: average condition number of A^T A: " << avg / (MFloat)counter << endl;
25443}
constexpr Real POW3(const Real x)
Definition: functions.h:123
Real ABS(const Real x)
Definition: functions.h:85
MFloat norm(const std::array< T, N > &u)
Definition: maiamath.h:148
MInt inverse(MFloat **a, MFloat **ainv, MInt n, const MFloat epsilon)
Definition: maiamath.h:587

◆ computeReconstructionConstantsSVD()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeReconstructionConstantsSVD
Author
Lennart Schneiders

Definition at line 14152 of file fvcartesiansolverxd.cpp.

14152 {
14153 TRACE();
14154
14155 if(m_orderOfReconstruction > 1) mTerm(1, AT_, "Check code here.");
14156
14157 const MInt noBndryCells = m_fvBndryCnd->m_bndryCells->size();
14158 const MInt recDim = (m_orderOfReconstruction == 2) ? (IPOW2(nDim) + 1) : nDim;
14159 MFloatScratchSpace tmpA(m_cells.noRecNghbrs(), recDim, AT_, "tmpA");
14160 MFloatScratchSpace tmpC(recDim, m_cells.noRecNghbrs(), AT_, "tmpC");
14161 MFloatScratchSpace weights(m_cells.noRecNghbrs(), AT_, "weights");
14162
14163#ifndef NDEBUG
14164 MFloat counter = F0;
14165 MFloat avg = F0;
14166 MFloat maxc = F0;
14167#endif
14168
14172
14173 // clear cell-center reconstruction
14175
14176 // reset isFlux
14177 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
14178 a_hasProperty(cellId, SolverCell::IsFlux) = false;
14179 }
14180
14181 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
14183
14184 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) continue;
14185 // if( !a_hasProperty( cellId , SolverCell::IsFlux) ) continue;
14186 if(a_isBndryGhostCell(cellId)) continue;
14187 if(a_hasProperty(cellId, SolverCell::IsNotGradient)) continue;
14188 /*IF_CONSTEXPR(nDim == 3) {
14189 if(a_hasProperty(cellId , SolverCell::IsInvalid)) continue;
14190 }*/
14191 if(a_bndryId(cellId) > -1) {
14192 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_linkedCellId > -1) {
14193 continue;
14194 }
14195 }
14196
14197 a_hasProperty(cellId, SolverCell::IsFlux) = true;
14198
14199 // loop over least-squares cell cluster
14200 const MInt noNghbrIds = a_noReconstructionNeighbors(cellId);
14201 if(noNghbrIds == 0) continue;
14202
14203 for(MInt n = 0; n < noNghbrIds; n++) {
14204 const MInt nghbrId = a_reconstructionNeighborId(cellId, n);
14205 a_hasProperty(nghbrId, SolverCell::IsFlux) = true;
14206 }
14207
14208 MFloat condNum =
14209 computeRecConstSVD(cellId, m_reconstructionDataSize, tmpA, tmpC, weights, recDim, m_reConstSVDWeightMode, -1);
14210
14211 m_reconstructionDataSize += noNghbrIds;
14212
14213#ifndef NDEBUG
14214 avg += condNum;
14215 maxc = mMax(maxc, condNum);
14216 counter += F1;
14217#else
14218 std::ignore = condNum;
14219
14220#endif
14221 }
14222
14224
14225 // copy reconstruction Constants into bndry reconstruction Constants for all bndryCells
14226 for(MInt bndryId = 0; bndryId < noBndryCells; bndryId++) {
14227 const MInt cellId = m_fvBndryCnd->m_bndryCells->a[bndryId].m_cellId;
14228 if(a_hasProperty(cellId, SolverCell::IsNotGradient)) continue;
14229 for(MInt nghbr = 0; nghbr < a_noReconstructionNeighbors(cellId); nghbr++) {
14230 for(MInt i = 0; i < nDim; i++) {
14231 m_fvBndryCnd->m_reconstructionConstants[bndryId][nghbr * nDim + i] =
14232 m_reconstructionConstants[nDim * (a_reconstructionData(cellId) + nghbr) + i];
14233 }
14234 }
14235 const MUint noRecNghbrs = m_fvBndryCnd->m_bndryCell[bndryId].m_recNghbrIds.size();
14236 const MInt noSrfcs = m_fvBndryCnd->m_bndryCells->a[bndryId].m_noSrfcs;
14237 // Note: skip the first noSrfcs neighbor ids since they contain dummyIds
14238 for(MUint n = noSrfcs; n < noRecNghbrs; n++) {
14239 a_hasProperty(m_fvBndryCnd->m_bndryCell[bndryId].m_recNghbrIds[n], SolverCell::IsFlux) = true;
14240 }
14241 }
14242
14243 m_log << "ok" << endl;
14244
14245#ifndef NDEBUG
14246
14247 MPI_Allreduce(MPI_IN_PLACE, &maxc, 1, MPI_DOUBLE, MPI_MAX, mpiComm(), AT_, "MPI_IN_PLACE", "maxc");
14248 MPI_Allreduce(MPI_IN_PLACE, &avg, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "avg");
14249 MPI_Allreduce(MPI_IN_PLACE, &counter, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "counter");
14250
14251 m_log << " -> Singular value decomposition: maximum/average condition number: " << maxc << "/" << avg / counter
14252 << endl;
14253
14254#endif
14255}
MFloat ** m_reconstructionConstants

◆ computeRotForces()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeRotForces

\compute centrifugal and coriolis forces (for computations in a rotating frame of reference)

Author
Alexej Pogorelov

Definition at line 6161 of file fvcartesiansolverxd.cpp.

6161 {
6162 MFloat radius = NAN;
6163 MFloat v_t = NAN;
6164 MInt cellId = 0;
6165
6166 for(MInt ac = 0; ac < m_noActiveCells; ac++) {
6167 cellId = m_activeCellIds[ac];
6168 radius = 0.0;
6169
6170 for(MInt i = 0; i < 2; i++) {
6171 radius += pow(a_coordinate(cellId, i + 1) - m_rotAxisCoord[i], 2.0);
6172 }
6173 radius = sqrt(radius);
6174
6175
6176 MFloat phi_mid = 74.9355804414;
6177 MFloat v_t_mid = m_UInfinity * sin(phi_mid / 180.0 * PI);
6178 v_t = v_t_mid / ((150.0 + 67.5) / 2.0) * radius;
6179
6180 // momentum equation
6181 a_rightHandSide(m_activeCellIds[ac], CV->RHO_VV[1]) -=
6183 * (F2 * v_t * a_pvariable(cellId, PV->RHO) * a_pvariable(cellId, PV->W) / radius
6184 + a_pvariable(cellId, PV->RHO) * pow(v_t / radius, 2.0) * (a_coordinate(cellId, 1) - m_rotAxisCoord[0]));
6185
6186 a_rightHandSide(m_activeCellIds[ac], CV->RHO_VV[2]) -=
6188 * (-F2 * v_t * a_pvariable(cellId, PV->RHO) * a_pvariable(cellId, PV->V) / radius
6189 + a_pvariable(cellId, PV->RHO) * pow(v_t / radius, 2.0) * (a_coordinate(cellId, 2) - m_rotAxisCoord[1]));
6190
6191 // energy equation
6192 IF_CONSTEXPR(hasE<SysEqn>)
6193 a_rightHandSide(m_activeCellIds[ac], CV->RHO_E) -=
6194 a_cellVolume(m_activeCellIds[ac]) * a_pvariable(cellId, PV->RHO) * pow(v_t / radius, 2.0)
6195 * ((a_coordinate(cellId, 1) - m_rotAxisCoord[0]) * a_pvariable(cellId, PV->V)
6196 + (a_coordinate(cellId, 2) - m_rotAxisCoord[1]) * a_pvariable(cellId, PV->W));
6197 }
6198}

◆ computeSamplingTimeStep()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeSamplingTimeStep

Definition at line 32458 of file fvcartesiansolverxd.cpp.

32458 {
32459 IF_CONSTEXPR(nDim == 3) { mTerm(1, "Only available in 2D."); }
32460 else {
32462 }
32463}
void computeSamplingTimeStep_()
computes the time step according to the sample variables

◆ computeSamplingTimeStep_()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeSamplingTimeStep_
inline
Author
Stephan Schlimpert
Date
April, 2014

< Re = D / (Pr * lf *(s_u/Ma)) : Reynolds number based on the flame properties, should be the same as chosen for Re in your property

Definition at line 32472 of file fvcartesiansolverxd.cpp.

32472 {
32473 TRACE();
32474
32475 if(m_timeStepMethod != 17511 && !m_combustion) {
32476 mTerm(1, AT_,
32477 "this function should only be called with timeStepMethod 17511 "
32478 "and combustion enabled");
32479 }
32480
32481 if(!m_combustion) {
32482 stringstream errorMessage;
32483 errorMessage << "ERROR: combustion is turned off, this time step method is especially written "
32484 "for combustion cases ... exiting";
32485 mTerm(1, AT_, errorMessage.str());
32486 }
32487
32488 MInt bcSpId;
32489 MFloat cycleTime, sampleTime; //,sample;
32490 // MFloat inletTubeAreaRatio = 2.002/0.412;
32491 const MFloat slOverU = m_flameSpeed / m_MaFlameTube;
32492 const MFloat Lf = m_realRadiusFlameTube * tan(acos(slOverU)); // nominal flame length
32493 MFloat Af = F2 * sqrt(POW2(Lf) + POW2(m_realRadiusFlameTube));
32494 const MFloat slantLength = Af * F1B2; // slant flame length (2D)
32495 const MFloat rLaminarFlameThickness = 1. / m_laminarFlameThickness;
32496 MFloat rFlameSpeed = 1. / m_flameSpeed;
32497 MFloat DInfinityFlameTube = SUTHERLANDLAW(m_temperatureFlameTube);
32498 MFloat ReFl = m_rPr * rLaminarFlameThickness * DInfinityFlameTube * m_MaFlameTube
32499 * rFlameSpeed;
32502 MFloat flameStr = -1.0;
32503 // MFloat calcMarksteinLength = 1./ReFl*m_rPr*1./m_flameSpeed* DInfinityFlameTube; ///<
32504 // calculated Markstein length referred to the flame properties MFloat calcMarksteinLengthTR
32505 // = 1./ReFl*1./(F2*m_realRadiusFlameTube)*m_rPr*1./m_flameSpeed*DInfinityFlameTube; ///<
32506 // calculated Markstein length referred to the flame properties and the flame tube radius
32507 //---
32508
32509 // compute the cycle time and the cycle
32510 cycleTime = (F2 * PI) / m_flameStrouhal;
32511 sampleTime = cycleTime / m_samplesPerCycle;
32512
32513 m_log << endl;
32514 m_log << "*****************************" << endl;
32515 m_log << "2D Flame test case properties" << endl;
32516 m_log << "*****************************" << endl << endl;
32517 m_log << "flame tube radius (used for levelSet BC): " << m_radiusFlameTube << endl;
32518 m_log << "flame tube real radius: " << m_realRadiusFlameTube << endl;
32519 m_log << "nominal flame length L_f: " << Lf << endl;
32520 m_log << "nominal slant flame length: " << slantLength << endl;
32521 m_log << "nominal flame surface area: " << Af << endl;
32522 m_log << "uncurved flame tip angle in Grad: " << atan(m_realRadiusFlameTube / Lf) * 180. / PI << endl;
32523 m_log << "laminar flame speed: " << m_flameSpeed << endl;
32524 m_log << "laminar flame thickness: " << m_laminarFlameThickness << endl;
32525 m_log << "subfilter variance sigma: " << sigma << endl;
32526 m_log << "******************************" << endl;
32527 m_log << "Corrugated Flamelet regime:" << endl;
32528 m_log << "lf < l_kolmogorov -> Ka_F < 1" << endl;
32529 m_log << "******************************" << endl;
32530 if(domainId() == 0) {
32531 cerr << "*****************************" << endl;
32532 cerr << "2D Flame test case properties" << endl;
32533 cerr << "*****************************" << endl << endl;
32534 cerr << "flame tube radius (used for levelSet BC): " << m_radiusFlameTube << endl;
32535 cerr << "flame tube real radius: " << m_realRadiusFlameTube << endl;
32536 cerr << "nominal flame length L_f: " << Lf << endl;
32537 cerr << "nominal slant flame length: " << slantLength << endl;
32538 cerr << "nominal flame surface area: " << Af << endl;
32539 cerr << "uncurved flame tip angle in Grad: " << atan(m_realRadiusFlameTube / Lf) * 180. / PI << endl;
32540 cerr << "laminar flame speed: " << m_flameSpeed << endl;
32541 cerr << "laminar flame thickness: " << m_laminarFlameThickness << endl;
32542 cerr << "subfilter variance sigma: " << sigma << endl;
32543 }
32544
32546 m_log << "+Case 1: sigma (=filter size) < laminar flame thickness" << endl;
32547 m_log << " *Conclusion: flame is resolved -> filtered flame thickness = laminar flame thickness" << endl;
32548 m_log << " *Conclusion: no turbulent contribution" << endl;
32549 m_log << " *Info: filtered flame speed s_F = s_l laminar flame speed" << endl;
32550 m_log << " *Info: Dth_turb,F (subfilter eddy diffusivity) = Dth_lam (laminar diffusivity) " << endl;
32551 } else {
32552 m_log << "+Case 2: sigma (=filter size) > laminar flame thickness" << endl;
32553 m_log << " *Conclusion: sub-filter flame front wrinkling increases the resolved burning velocity" << endl;
32554 m_log << " *Conclusion: filtered flame speed s_F > s_l (laminar flame speed)" << endl;
32555 m_log << " *Info: if the flame front is not altered by turbulence," << endl;
32556 m_log << " the chemical time scale of the turbulent flame time_c_F" << endl;
32557 m_log << " remains the same as the laminar one time_c" << endl;
32558 }
32559 m_log << endl;
32560 m_log << "mach number inlet: " << m_Ma << endl;
32561 m_log << "mach number in flame tube: " << m_MaFlameTube << endl;
32562 m_log << "Re (ref. to stagnation point): " << sysEqn().m_Re0 << endl;
32563 m_log << "Re (ref. to infinity values): " << m_Re << endl;
32564 m_log << "Re (ref. to the flame properties): " << ReFl << endl;
32565 if((ReFl < (m_Re - 10.0)) || (ReFl > (m_Re + 10.0))) {
32566 if(domainId() == 0) {
32567 cerr << "Warning: Your Reynolds number should be Re= " << ReFl << " , but it is chosen to Re= " << m_Re << endl;
32568 }
32569 m_log << "Warning: Your Reynolds number should be Re= " << ReFl << " , but it is chosen to Re= " << m_Re << endl;
32570 }
32571 m_log << "Re (ref. to the flame properties and to the flame tube diameter): " << ReFl * F2 * m_realRadiusFlameTube
32572 << endl;
32573 m_log << "markstein length (controls the flame curvature): " << m_marksteinLength << endl;
32574 /*
32575if((calcMarksteinLength < (m_marksteinLength - 0.002)) || (calcMarksteinLength >
32576(calcMarksteinLength + 0.002)) ) { cerr << "Instability Warning: Markstein number should be
32577marksteinLength= " << calcMarksteinLength << " , but it is chosen to marksteinLength= " <<
32578m_marksteinLength << endl; m_log << "Instability Warning: Markstein number should be
32579marksteinLength= " << calcMarksteinLength << " , but it is chosen to marksteinLength= " <<
32580m_marksteinLength << endl;
32581}
32582 */
32583 m_log << "CFL number: " << m_cfl << endl;
32584 m_log << "smallest Cell distance according to max refinement Level: " << c_cellLengthAtLevel(maxRefinementLevel())
32585 << endl;
32586 m_log.precision(16);
32587 m_log << "reference time (=u_0): " << m_timeRef << endl;
32588 m_log << "time step according to the CFL condition: " << timeStep(true) * m_timeRef << endl;
32589 m_log.precision(9);
32590
32591 m_log << "cycleTime (nondim): " << cycleTime << endl;
32592 m_log << "sampleTime (nondim): " << sampleTime << endl;
32595 for(MInt n = 1; n < 10000000; n++) {
32596 if(sampleTime / (MFloat)(n) < timeStep(true)) {
32597 forceTimeStep(sampleTime / (MFloat)(n));
32599 break;
32600 }
32601 }
32602 sampleTime = m_noTimeStepsBetweenSamples * timeStep(true);
32603 cycleTime = sampleTime * m_samplesPerCycle;
32604
32606 mTerm(1, AT_, "Time step calculation error");
32607 }
32608
32609 if(m_neutralFlameStrouhal > 0) {
32610 flameStr = m_neutralFlameStrouhal * Lf / (F2 * PI);
32611 if(domainId() == 0) {
32612 cerr << "Be careful, strouhal number is based on length one, not on flame length (for "
32613 "neutral markstein length computation) "
32614 << endl;
32615 cerr << "time step due to sampling (depends on the Strouhal number) (phys): " << timeStep(true) * m_timeRef
32616 << endl;
32617 cerr << "Excitation frequency f = " << m_neutralFlameStrouhal / (F2 * PI) << endl;
32618 cerr << "Excitation frequency f (phys) = " << m_neutralFlameStrouhal / (F2 * PI * m_timeRef) << endl;
32619 cerr << "flame Strouhal number Stf (based on Lf) = " << flameStr << endl;
32620 cerr << "flame Strouhal number Stf (based on Lf phys) = " << flameStr / m_timeRef << endl;
32621 cerr << "check flame Strouhal number Stf = 1/t * Lf / u_mean = " << 1. / cycleTime * Lf << endl;
32622 }
32623 m_log << "time step due to sampling (depends on the Strouhal number) (phys): " << timeStep(true) * m_timeRef
32624 << endl;
32625 m_log << "Excitation frequency f = " << m_neutralFlameStrouhal / (F2 * PI) << endl;
32626 m_log << "Excitation frequency f (phys) = " << m_neutralFlameStrouhal / (F2 * PI * m_timeRef) << endl;
32627 m_log << "flame Strouhal number Stf (based on Lf) = " << flameStr << endl;
32628 m_log << "flame Strouhal number Stf (based on Lf phys) = " << flameStr / m_timeRef << endl;
32629 m_log << "check flame Strouhal number Stf = 1/t * Lf / u_mean= " << 1. / cycleTime * Lf << endl;
32630 if(((flameStr < (1. / cycleTime * Lf - 0.05)) || (flameStr > (1. / cycleTime * Lf + 0.05))) && domainId() == 0) {
32631 cerr << "Warning: Your flame strouhal is = " << flameStr << " , but it is checked to = " << 1. / cycleTime * Lf
32632 << endl;
32633 }
32634 m_log << "wave number (based on length one!!) omega=St/1.0: " << m_flameStrouhal
32635 << endl; // equals neutralFlameStrouhal
32636 m_log << "wave number (based on length one!!) omega=St/1.0 (phys): " << m_flameStrouhal / m_timeRef
32637 << endl; // equals neutralFlameStrouhal
32638 if(domainId() == 0) {
32639 cerr << "wave number (based on length one!!) omega=St/1.0: " << m_flameStrouhal
32640 << endl; // equals neutralFlameStrouhal
32641 cerr << "wave number (based on length one!!) omega=St/1.0 (phys): " << m_flameStrouhal / m_timeRef
32642 << endl; // equals neutralFlameStrouhal
32643 }
32644 } else {
32645 flameStr = m_flameStrouhal / (F2 * PI);
32646 m_log << "time step due to sampling (depends on the Strouhal number) (phys): " << timeStep(true) * m_timeRef
32647 << endl;
32648 m_log << "Excitation frequency f = " << m_strouhal / (F2 * PI) << endl;
32649 m_log << "flame Strouhal number Stf (based on Lf) = " << flameStr << endl;
32650 m_log << "check flame Strouhal number Stf = 1/t * Lf / u_mean = " << 1. / cycleTime * Lf << endl;
32651 m_log << "wave number (based on flame length!!) omega=St/L_f: " << m_flameStrouhal << endl;
32652
32653 if(domainId() == 0) {
32654 cerr << "time step due to sampling (depends on the Strouhal number) (phys): " << timeStep(true) * m_timeRef
32655 << endl;
32656 cerr << "Excitation frequency f = " << m_strouhal / (F2 * PI) << endl;
32657 cerr << "flame Strouhal number Stf (based on Lf) = " << flameStr << endl;
32658 cerr << "check flame Strouhal number Stf = 1/t * Lf / u_mean = " << 1. / cycleTime * Lf << endl;
32659 cerr << "wave number (based on flame length!!) omega=St/L_f: " << m_flameStrouhal << endl;
32660 }
32661 }
32662 }
32663
32664 m_log << "excitation amplitude at the inlet: " << m_forcingAmplitude * m_VInfinity << endl;
32665 m_log << "excitation amplitude in the flame tube: " << m_forcingAmplitude * m_VInfinity * m_inletTubeAreaRatio
32666 << endl;
32667 m_log << "excitation amplitude in the flame tube in % (ref. to the laminar flame speed): "
32668 << m_forcingAmplitude * m_VInfinity * m_inletTubeAreaRatio / m_flameSpeed * 100.0 << " %" << endl;
32669 m_log << "excitation amplitude in the flame tube in % (ref. to inflow velocity): "
32670 << m_forcingAmplitude * m_VInfinity * m_inletTubeAreaRatio * 100.0 << " %" << endl;
32671
32672 if(domainId() == 0) {
32673 cerr << "excitation amplitude at the inlet: " << m_forcingAmplitude * m_VInfinity << endl;
32674 cerr << "excitation amplitude in the flame tube: " << m_forcingAmplitude * m_VInfinity * m_inletTubeAreaRatio
32675 << endl;
32676 cerr << "excitation amplitude in the flame tube in % (ref. to the laminar flame speed): "
32677 << m_forcingAmplitude * m_VInfinity * m_inletTubeAreaRatio / m_flameSpeed * 100.0 << " %" << endl;
32678 cerr << "excitation amplitude in the flame tube in % (ref. to inflow velocity): "
32679 << m_forcingAmplitude * m_inletTubeAreaRatio * 100.0 << " %" << endl;
32680
32681 if(m_samplingStartIteration < 0) {
32682 cerr << "ERROR: set samplingStartIteration to some value" << endl;
32683 }
32684 }
32686
32687 // if(m_samplesPerCycle *
32688 // m_noTimeStepsBetweenSamples*m_samplingStartCycle<m_samplingStartIteration)
32689 // m_samplingStartCycle += 1;
32690
32692
32695 default:
32696 m_log << "Warning: structured Output on finest level because unknown "
32697 "structuredFlameOutputLevel"
32698 << endl;
32699 if(domainId() == 0) {
32700 cerr << "Warning: structured Output on finest level because unknown "
32701 "structuredFlameOutputLevel"
32702 << endl;
32703 }
32704 break;
32705 case 0:
32706 if(domainId() == 0) {
32707 cerr << "Warning: structuredFlameOutput is on, but structuredOuputLevel is set to "
32709 cerr << "Warning: no structured Output" << endl;
32710 }
32711 m_log << "Warning: structuredFlameOutput is on, but structuredOuputLevel is set to "
32713 m_log << "Warning: no structured Output" << endl;
32714 break;
32715 case 1:
32716 m_log << "structured Output for single flame (old version): " << endl;
32717 break;
32718 case 2:
32719 m_log << "structured Output for single flame (optimized version): " << endl;
32720 break;
32721 case 3:
32722 m_log << "structured Output for single flame with plenum (optimized version): " << endl;
32723 break;
32724 case 4:
32725 m_log << "structured Output for single flame with plenum, ascii output of whole domain "
32726 "(optimized version): "
32727 << endl;
32728 break;
32729 case 40:
32730 m_log << "structured Output for single flame with plenum, ascii output of whole domain + "
32731 "dPdT source tem (optimized version): "
32732 << endl;
32733 break;
32734 case 5:
32735 m_log << "unstructured Output for single flame, netcdf output of whole domain: " << endl;
32736 break;
32737 }
32738 m_log << "cycleTime (nondim, adapted): " << cycleTime << endl;
32739 m_log << "sampleTime (nondim, adapted): " << sampleTime << endl;
32740 m_log << "number of timesteps between samples: " << m_noTimeStepsBetweenSamples << endl;
32741 m_log << "sampling Start cycle: " << m_samplingStartCycle << endl;
32742 m_log << " start flameSurfaceArea - Output at Iteration: "
32744 m_log << " end flameSurfaceArea - Output at Iteration: "
32746
32747 if(domainId() == 0) {
32748 cerr << "cycleTime (nondim): " << cycleTime << endl;
32749 cerr << "sampleTime (nondim): " << sampleTime << endl;
32750 cerr << "number of timesteps between samples: " << m_noTimeStepsBetweenSamples << endl;
32751 cerr << "sampling Start cycle: " << m_samplingStartCycle << endl;
32752 cerr << " start flameSurfaceArea - Output at Iteration: "
32754 cerr << " end flameSurfaceArea - Output at Iteration: "
32756 }
32757
32759 if(!m_forceNoTimeSteps) {
32760 m_log << "WARNING: timeSteps changed from : " << g_timeSteps;
32761 if(domainId() == 0) {
32762 cerr << "WARNING: timeSteps changed from : " << g_timeSteps;
32763 }
32765 if(domainId() == 0) {
32766 cerr << " to " << g_timeSteps << endl;
32767 }
32768 m_log << " to " << g_timeSteps << endl;
32769 }
32770 } else {
32771 m_log << "WARNING: timeSteps are NOT adapted to the required number of time steps (used "
32772 "for reference testcases)";
32773 if(domainId() == 0) {
32774 cerr << "WARNING: timeSteps are NOT adapted to the required number of time steps (used for "
32775 "reference testcases)";
32776 }
32777 }
32778
32779 } else {
32781 if(domainId() == 0) {
32782 cerr << "Warning: Forcing ist turned off, but structuredFlameOutput is on" << endl;
32783 }
32784 m_log << "Warning: Forcing ist turned off, but structuredFlameOutput is on" << endl;
32786 default:
32787 m_log << "Warning: structured Output on finest level because unknown "
32788 "structuredFlameOutputLevel"
32789 << endl;
32790 if(domainId() == 0) {
32791 cerr << "Warning: structured Output on finest level because unknown "
32792 "structuredFlameOutputLevel"
32793 << endl;
32794 }
32795 break;
32796 case 0:
32797 if(domainId() == 0) {
32798 cerr << "Warning: structuredFlameOutput is on, but structuredOuputLevel is set to "
32800 cerr << "Warning: no structured Output" << endl;
32801 }
32802 m_log << "Warning: structuredFlameOutput is on, but structuredOuputLevel is set to "
32804 m_log << "Warning: no structured Output" << endl;
32805 break;
32806 case 1:
32807 m_log << "structured Output for single flame (old version): " << endl;
32808 break;
32809 case 2:
32810 m_log << "structured Output for single flame (optimized version): " << endl;
32811 break;
32812 case 3:
32813 m_log << "structured Output for single flame with plenum (optimized version): " << endl;
32814 break;
32815 case 4:
32816 m_log << "structured Output for single flame, ascii output of whole domain (optimized "
32817 "version): "
32818 << endl;
32819 break;
32820 case 40:
32821 m_log << "structured Output for single flame with plenum, ascii output of whole domain "
32822 "+ dPdT source tem (optimized version): "
32823 << endl;
32824 break;
32825 case 5:
32826 m_log << "unstructured Output for single flame, netcdf output of whole domain: " << endl;
32827 break;
32828 }
32829 m_log << "cycleTime: " << cycleTime << endl;
32830 m_log << "sampleTime: " << sampleTime << endl;
32831 m_log << "number of timesteps between samples: " << m_noTimeStepsBetweenSamples << endl;
32832 m_log << "sampling Start cycle: " << m_samplingStartCycle << endl;
32833 m_log << " start flameSurfaceArea - Output at Iteration: "
32835
32836 if(m_noTimeStepsBetweenSamples == -1) {
32837 mTerm(1, AT_,
32838 "Error no time steps between samples is not calculated, prbably wron "
32839 "structuredFlameOutput");
32840 }
32841 if(domainId() == 0) {
32842 cerr << "cycleTime: " << cycleTime << endl;
32843 cerr << "sampleTime: " << sampleTime << endl;
32844 cerr << "number of timesteps between samples: " << m_noTimeStepsBetweenSamples << endl;
32845 cerr << "sampling Start cycle: " << m_samplingStartCycle << endl;
32846 cerr << " start flameSurfaceArea - Output at Iteration: "
32848 }
32849 } else {
32851 if(domainId() == 0) {
32852 cerr << "Warning: Forcing ist turned on, but structuredFlameOutput is off" << endl;
32853 cerr << "Warning: There will be no structured Output and no flameSurfaceArea - Output" << endl;
32854 }
32855 m_log << "Warning: Forcing ist turned on, but structuredFlameOutput is off" << endl;
32856 m_log << "Warning: There will be no structured Output and no flameSurfaceArea - Output" << endl;
32857
32858 } else {
32859 m_log << "no structured Output, structuredFlameOutput= " << m_structuredFlameOutput << endl;
32860 }
32861 }
32862 }
32863 for(MInt bcId = 0; bcId < m_noSpongeBndryCndIds; bcId++) {
32864 bcSpId = m_spongeBndryCndIds[bcId];
32865 // calculate time dependent sigma sponge
32866 if(m_spongeTimeDependent[bcId]) {
32867 m_log << endl;
32868 m_log << "*************************************************************" << endl;
32869 m_log << "Additional Information for time dependent sponge boundary Id: " << bcSpId << endl;
32870 m_log << "*************************************************************" << endl;
32871 m_log << "sponge end iteration= " << m_spongeEndIteration[bcId] << endl;
32872 m_log << "sigma_max(t=" << m_spongeEndIteration[bcId] << ") = "
32873 << m_sigmaSpongeBndryId[bcId] / tanh(F1)
32874 * (tanh(F1
32877 << endl;
32878 m_log << "sponge end time = " << m_spongeEndIteration[bcId] * (timeStep(true) * m_timeRef) << endl << endl;
32879 // m_sigmaSpongeBndryId[bcId] = m_sigmaSpongeBndryId[bcId]*(F1-tanh(
32880 // F4*m_time/m_spongeEndTime[bcId]));
32881 }
32882 }
32883 if(m_forcing && approx(flameStr, -1.0, MFloatEps)) {
32884 mTerm(1, AT_, "Error flame strouhal number based on Lf not determined");
32885 }
32886 if(domainId() == 0) {
32887 FILE* datei;
32888 datei = fopen("flameLog", "a+");
32889 fprintf(datei, " %-10.10f", sampleTime);
32890 fprintf(datei, " %-10.10f", m_realRadiusFlameTube);
32891 fprintf(datei, " %-10.10f", m_flameSpeed);
32892 fprintf(datei, " %-10.10f", m_MaFlameTube);
32893 fprintf(datei, " %-10.10f", m_timeRef);
32894 fprintf(datei, " %-10.10f", flameStr);
32895 fprintf(datei, " %-10.10f", m_forcingAmplitude);
32896 fprintf(datei, " %-10.10f", m_rhoFlameTube);
32897 fprintf(datei, " %-10.10f", m_Ma);
32898 fprintf(datei, " %d", m_samplingStartCycle);
32899 fprintf(datei, " %d", m_samplingEndCycle);
32900 fprintf(datei, " %d", (MInt)m_samplesPerCycle);
32901 fprintf(datei, " %-10.10f", m_marksteinLength);
32902 fprintf(datei, " %-10.10f", m_laminarFlameThickness);
32903 fprintf(datei, " %-10.10f", ReFl);
32904 fprintf(datei, " %-10.10f", m_burntUnburntTemperatureRatio);
32905 fprintf(datei, " %-10.10f", m_flameStrouhal);
32906 fprintf(datei, "\n");
32907 fclose(datei);
32908 }
32909}
MInt m_noSpongeBndryCndIds
number of sponge boundary IDs
MInt m_restartTimeStep
Definition: solver.h:80
MInt g_timeSteps

◆ computeSlopesByCentralDifferences()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeSlopesByCentralDifferences
Author
Lennart Schneiders

Definition at line 17562 of file fvcartesiansolverxd.cpp.

17562 {
17563 const MInt noPVars = PV->noVariables;
17564 if(m_extractedCells == nullptr) {
17565 cerr << "Extracted cells not allocated." << endl;
17566 return;
17567 }
17568 for(MInt c = 0; c < m_extractedCells->size(); c++) {
17569 MInt cellId = m_extractedCells->a[c].m_cellId;
17570 for(MInt dir = 0; dir < nDim; dir++) {
17571 MInt n0 = (a_hasNeighbor(cellId, 2 * dir) > 0) ? c_neighborId(cellId, 2 * dir) : cellId;
17572 MInt n1 = (a_hasNeighbor(cellId, 2 * dir + 1) > 0) ? c_neighborId(cellId, 2 * dir + 1) : cellId;
17573 for(MInt var = 0; var < noPVars; var++) {
17574 a_slope(cellId, var, dir) =
17575 (a_pvariable(n1, var) - a_pvariable(n0, var)) / mMax(1e-10, a_coordinate(n1, dir) - a_coordinate(n0, dir));
17576 }
17577 }
17578 }
17579}
Collector< PointBasedCell< nDim > > * m_extractedCells

◆ computeSourceTerms()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeSourceTerms
protected

brief important correction of jump condition (implemented like presented in Dissertation D. Hartmann)

Author
Stephan Schlimpert
Date
November 2011

Definition at line 11440 of file fvcartesiansolverxd.cpp.

11440 {
11441 TRACE();
11442 // #define debugOutput
11443 const MInt noCells = a_noCells();
11444 MInt gc;
11445 MFloat factor, Psi, xi = F0, cbar, a = F0, a1 = F0, a2 = F0, b = F0, b2 = F0, b1 = F0, c1 = F0, FD, Rr,
11446 sigma; //,d,omega
11447 MFloat reactionEnthalpy;
11448 const MFloat gammaMinusOne = m_gamma - F1;
11449 const MFloat FgammaMinusOne = F1 / gammaMinusOne;
11450 // MFloat denominator;
11451 MFloat FlaminarFlameThickness = F1 / m_laminarFlameThickness;
11452 // MFloat rhoU, Dth;
11454 // MFloat rhoBurnt = m_rhoInfinity / m_burntUnburntTemperatureRatio;
11455 MFloat rhoJump = F1 / m_burntUnburntTemperatureRatio - F1;
11456 // MFloat FrhoBurnt = m_burntUnburntTemperatureRatio;
11457 MFloat factor1 = m_c0 / (F1 - m_c0);
11458 MFloat echekkiFerzigerPrefactor = F1 / (F1 - m_c0) * (F1 / (F1 - m_c0) - F1);
11459 const MFloat sq1F2 = sqrt(F1B2);
11460 const MFloat eps = c_cellLengthAtLevel(maxRefinementLevel()) * 0.00000000001;
11461 // MFloat levelSetNegative = F0, levelSetPlus = F0;
11462
11463 //---
11464 // reset
11465 m_maxReactionRate = F0;
11467 // compute the heat release
11468 reactionEnthalpy = (m_burntUnburntTemperatureRatio - F1) * FgammaMinusOne;
11469 // save old reaction rate
11470 if(m_RKStep == 0) {
11471 // if(hasReactionRates() && hasReactionRatesBackup())
11472 memcpy(&a_reactionRateBackup(0, 0), &a_reactionRate(0, 0), sizeof(MFloat) * noInternalCells());
11473 }
11474 // reset
11475 for(MInt c = 0; c < noCells; c++) {
11476 a_reactionRate(c, 0) = F0;
11477 }
11478 // compute the subfilter variance
11480 factor = F1 / (sqrt(F2) * sigma);
11481 // return for no-heat release combustion
11482 if(reactionEnthalpy < m_rhoEInfinity * 0.00001) {
11483 return;
11484 }
11485 switch(m_initialCondition) {
11486 case 17516: {
11492 MInt diverged = 0;
11493 MFloat diffTimeStep = 50000;
11494 if(m_temperatureChange && (globalTimeStep - m_restartTimeStep) <= diffTimeStep) {
11498 }
11499 // rhoBurnt = m_rhoFlameTube / m_burntUnburntTemperatureRatio;
11500 // FrhoBurnt = m_burntUnburntTemperatureRatio * F1 / m_rhoFlameTube;
11501 rhoJump = F1 - m_burntUnburntTemperatureRatio;
11502 for(MInt c = 0; c < m_bndryGhostCellsOffset; c++) {
11503 if(grid().tree().hasProperty(c, Cell::IsHalo)) {
11504 continue;
11505 }
11506 if(!a_hasProperty(c, SolverCell::IsOnCurrentMGLevel)) {
11507 continue;
11508 }
11509 MInt cLs = c;
11510 if(cLs < 0) {
11511 continue;
11512 }
11513 gc = cLs;
11514 // continue if the g cell is out of the band
11515 // the source term is in this case zero
11516 if(a_levelSetFunction(c, 0) < -999998) { // TODO labels:FV,toenhance!
11517 continue;
11518 }
11519 // compute the Echekki-Ferziger constant
11520 // - compute the inverse eddy viscosity (s/m^2)
11521 // - - density of the unburnt gas rho^u = m_rhoInfinity
11522 // - - assuming m_TInfinity is the temperature of the unburnt gas -> muInf=SUTHERLANDLAW(m_TInfinity)
11523 // - - DthInf = muInf^u / ( rho^u *Pr )
11524 FD = F1 / m_DthInfinity;
11525 // - compute Rr
11526 // levelSetNegative = a_levelSetFunction(gc, 0) - m_noReactionCells;
11527 // levelSetPlus = a_levelSetFunction(gc, 0) + m_noReactionCells;
11528
11529
11530 Rr = echekkiFerzigerPrefactor * POW2(a_flameSpeed(gc, 0) * (F1 - a_curvatureG(gc, 0) * m_marksteinLength)) * FD;
11531
11532 // damp out the reaction rate to the wall w(y=0.0341) = 0 by damping the model constant Rr(y=0.0341)=0
11533 if(m_heatReleaseDamp) {
11534 if(c_coordinate(gc, 1) < (0.0234 + m_dampingDistanceFlameBase)) {
11535 if(c_coordinate(gc, 1) > 0.0234) {
11536 Rr *= 1. / m_dampingDistanceFlameBase * (c_coordinate(gc, 1) - 0.0234);
11537 }
11538 }
11539 if(c_coordinate(gc, 1) < 0.0234) {
11540 Rr = F0;
11541 }
11542 }
11543 // compute Psi
11544 // - compute xi
11545 xi = a_levelSetFunction(gc, 0) * factor; //< xi = G(x,t)/(sigma*sqrt(2))
11546
11547 // - compute c bar
11548 a = xi - sq1F2 * factor1 * sigma * FlaminarFlameThickness;
11549 a1 = F1B2 * (POW2(sigma * factor1 * FlaminarFlameThickness))
11550 - SQRT2 * xi * sigma * factor1 * FlaminarFlameThickness;
11551 if(a > F3) {
11552 a2 = (F1 - m_c0) * exp(a1) * F1B2 * (-erfc(a) + F2); // erfc computes 1-erf and is more accurate for large a
11553 } else {
11554 a2 = (F1 - m_c0) * exp(a1) * F1B2 * (erf(a) + F1);
11555 }
11556 b = xi + sq1F2 * sigma * FlaminarFlameThickness;
11557 b1 = F1B2 * POW2(sigma * FlaminarFlameThickness) + SQRT2 * xi * sigma * FlaminarFlameThickness;
11558 if(b > F3) {
11559 b2 = m_c0 * exp(b1) * F1B2 * (-erfc(b)); // erfc computes 1-erf and is more accurate for large b
11560 } else {
11561 b2 = m_c0 * exp(b1) * F1B2 * (erf(b) - F1);
11562 }
11563 c1 = F1B2 * (erf(xi) - F1);
11564 cbar = F1 - (a2 + b2 - c1);
11565
11566 // - compute Psi
11567 if(ABS(F1 - cbar) < eps) {
11568 Psi = F1;
11569 } else {
11570 Psi = a2 / ((F1 - cbar) * POW2((rhoUFrhoB + cbar * rhoJump)));
11571 }
11572
11573 a_psi(c) = Psi;
11574
11575 IF_CONSTEXPR(hasPV_C<SysEqn>::value) {
11576 // compute rhoBar
11577 const MFloat rhoBar = m_rhoUnburnt / (1 - a_pvariable(c, PV->C) * rhoJump);
11578
11579 // compute the source term
11580 a_reactionRate(c, 0) = sysEqn().m_Re0 * rhoBar * rhoUFrhoB * Rr * (F1 - a_pvariable(c, PV->C)) * Psi;
11581 }
11582
11583 // catch nan reaction rate
11584 if(!(a_reactionRate(c, 0) >= F0) && !(a_reactionRate(c, 0) <= F0)) {
11585 diverged = 1;
11586 cerr << "reaction rate is nan!!!" << endl;
11587 }
11588
11589 // compute the source terms
11590 IF_CONSTEXPR(hasPV_C<SysEqn>::value)
11591 a_rightHandSide(c, CV->RHO_C) -= a_reactionRate(c, 0) * a_cellVolume(c);
11592 a_rightHandSide(c, CV->RHO_E) -= a_reactionRate(c, 0) * a_cellVolume(c) * reactionEnthalpy;
11593
11594 // compute the maximum reaction rate and the total heat release
11595 if(!a_hasProperty(c, Cell::IsHalo)) {
11597 m_totalHeatReleaseRate += a_reactionRate(c, 0) * a_cellVolume(c) * reactionEnthalpy;
11598 }
11599 }
11600 MPI_Allreduce(MPI_IN_PLACE, &diverged, 1, MPI_INT, MPI_MAX, mpiComm(), AT_, "MPI_IN_PLACE", "diverged");
11601 if(diverged == 1) {
11602 cerr << "Solution diverged (computeSourceTerms)" << endl;
11603 MString errorMessage = "reaction rate is nan";
11604 mTerm(1, AT_, errorMessage);
11605 }
11606
11607 break;
11608 }
11609 case 1751600: {
11610 MInt diverged = 0;
11611 MFloat diffTimeStep = 50000;
11612 if(m_temperatureChange && (globalTimeStep - m_restartTimeStep) <= diffTimeStep) {
11616 }
11617 // rhoBurnt = m_rhoFlameTube / m_burntUnburntTemperatureRatio;
11618 // FrhoBurnt = m_burntUnburntTemperatureRatio * F1 / m_rhoFlameTube;
11619 rhoJump = F1 - m_burntUnburntTemperatureRatio;
11620 for(MInt c = 0; c < m_bndryGhostCellsOffset; c++) {
11621 if(grid().tree().hasProperty(c, Cell::IsHalo)) {
11622 continue;
11623 }
11624 if(!a_hasProperty(c, SolverCell::IsOnCurrentMGLevel)) {
11625 continue;
11626 }
11627 MInt cLs = c;
11628 if(cLs < 0) {
11629 continue;
11630 }
11631 gc = cLs;
11632 if(gc == -1) {
11633 continue;
11634 }
11635 // continue if the g cell is out of the band
11636 // the source term is in this case zero
11637 if(a_levelSetFunction(gc, 0) < -99998) {
11638 continue;
11639 }
11640 // compute the Echekki-Ferziger constant
11641 // - compute the inverse eddy viscosity (s/m^2)
11642 // - - density of the unburnt gas rho^u = m_rhoInfinity
11643 // - - assuming m_TInfinity is the temperature of the unburnt gas -> muInf=SUTHERLANDLAW(m_TInfinity)
11644 // - - DthInf = muInf^u / ( rho^u *Pr )
11645 FD = F1 / m_DthInfinity;
11646 // - compute Rr
11647 // levelSetNegative = lsSolver().a_levelSetFunctionG(gc, 0) - m_noReactionCells;
11648 // levelSetPlus = lsSolver().a_levelSetFunctionG(gc, 0) + m_noReactionCells;
11649
11650 Rr = echekkiFerzigerPrefactor * POW2(a_flameSpeed(gc, 0) * (F1 - a_curvatureG(gc, 0) * m_marksteinLength)) * FD;
11651
11652 // damp out the reaction rate to the wall w(y=0.0341) = 0 by damping the model constant Rr(y=0.0341)=0
11653 if(m_heatReleaseDamp) {
11655 if(c_coordinate(gc, 1) > m_yOffsetFlameTube) {
11657 }
11658 }
11659 if(c_coordinate(gc, 1) < m_yOffsetFlameTube) {
11660 Rr = F0;
11661 }
11662 }
11663
11664 xi = a_levelSetFunction(gc, 0) * factor; //< xi = G(x,t)/(sigma*sqrt(2))
11665
11666 // - compute c bar
11667 a = xi - sq1F2 * factor1 * sigma * FlaminarFlameThickness;
11668 a1 = F1B2 * (POW2(sigma * factor1 * FlaminarFlameThickness))
11669 - SQRT2 * xi * sigma * factor1 * FlaminarFlameThickness;
11670 if(a > F3) {
11671 a2 = (F1 - m_c0) * exp(a1) * F1B2 * (-erfc(a) + F2); // erfc computes 1-erf and is more accurate for large a
11672 } else {
11673 a2 = (F1 - m_c0) * exp(a1) * F1B2 * (erf(a) + F1);
11674 }
11675 b = xi + sq1F2 * sigma * FlaminarFlameThickness;
11676 b1 = F1B2 * POW2(sigma * FlaminarFlameThickness) + SQRT2 * xi * sigma * FlaminarFlameThickness;
11677 if(b > F3) {
11678 b2 = m_c0 * exp(b1) * F1B2 * (-erfc(b)); // erfc computes 1-erf and is more accurate for large b
11679 } else {
11680 b2 = m_c0 * exp(b1) * F1B2 * (erf(b) - F1);
11681 }
11682 c1 = F1B2 * (erf(xi) - F1);
11683 cbar = F1 - (a2 + b2 - c1);
11684
11685 // - compute Psi
11686 if(ABS(F1 - cbar) < eps) {
11687 Psi = F1;
11688 } else {
11689 Psi = a2 / ((F1 - cbar) * POW2((rhoUFrhoB + cbar * rhoJump)));
11690 }
11691
11692 a_psi(c) = Psi;
11693
11694 IF_CONSTEXPR(hasPV_C<SysEqn>::value) {
11695 // compute rhoBar
11696 const MFloat rhoBar = m_rhoUnburnt / (1 - a_pvariable(c, PV->C) * rhoJump);
11697
11698 // compute the source term
11699 a_reactionRate(c, 0) = sysEqn().m_Re0 * rhoBar * rhoUFrhoB * Rr * (F1 - a_pvariable(c, PV->C)) * Psi;
11700 }
11701
11702 // catch nan reaction rate
11703 if(!(a_reactionRate(c, 0) >= F0) && !(a_reactionRate(c, 0) <= F0)) {
11704 diverged = 1;
11705 }
11706
11707 // compute the source terms
11708 IF_CONSTEXPR(hasPV_C<SysEqn>::value)
11709 a_rightHandSide(c, CV->RHO_C) -= a_reactionRate(c, 0) * a_cellVolume(c);
11710 a_rightHandSide(c, CV->RHO_E) -= a_reactionRate(c, 0) * a_cellVolume(c) * reactionEnthalpy;
11711
11712 // compute the maximum reaction rate and the total heat release
11713 if(!a_hasProperty(c, Cell::IsHalo)) {
11715 m_totalHeatReleaseRate += a_reactionRate(c, 0) * a_cellVolume(c) * reactionEnthalpy;
11716 }
11717 }
11718 MPI_Allreduce(MPI_IN_PLACE, &diverged, 1, MPI_INT, MPI_MAX, mpiComm(), AT_, "MPI_IN_PLACE", "diverged");
11719 if(diverged == 1) {
11720 // m_log << "Solution diverged, writing NETCDF file for debugging" << endl;
11721 MString errorMessage = "reaction rate is nan";
11722 mTerm(1, AT_, errorMessage);
11723 }
11724
11725 break;
11726 }
11727
11728
11729 default: {
11730 cerr << "dont use the default in computeSourceTerms (FV) !!!" << endl;
11731 break;
11732 }
11733 }
11734 if(noDomains() > 1) {
11735 MPI_Allreduce(MPI_IN_PLACE, &m_totalHeatReleaseRate, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE",
11736 "m_totalHeatReleaseRate");
11737 MPI_Allreduce(MPI_IN_PLACE, &m_maxReactionRate, 1, MPI_DOUBLE, MPI_MAX, mpiComm(), AT_, "MPI_IN_PLACE",
11738 "m_maxReactionRate");
11739 }
11740}
MFloat & a_psi(const MInt cellId)
Returns psi of the cell cellId for variables varId.
MFloat & a_levelSetFunction(const MInt cellId, const MInt set)
Returns the levelSet-value for fv-CellId cellId and set.
MFloat & a_curvatureG(const MInt cellId, const MInt set)
Returns the curvature-value for fv-CellId cellId and set.
MFloat c_coordinate(const MInt cellId, const MInt dir) const
Returns the coordinate of the cell from the grid().tree() cellId for dimension dir.
MFloat & a_flameSpeed(const MInt cellId, const MInt set)
Returns the flamespeed-value for fv-CellId cellId and set.
MFloat & a_reactionRateBackup(const MInt cellId, const MInt reactionId)
Returns the reactionRateBackup of the cell cellId for variables varId.
Checks if the primitive variable C exists.
Definition: contexttypes.h:19

◆ computeSpeciesReactionRates()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::computeSpeciesReactionRates

Definition at line 737 of file fvcartesiansolverxd.cpp.

737 {
738 Cantera::IdealGasReactor zeroD_reactor;
739 zeroD_reactor.insert(m_canteraSolution);
740
741 Cantera::ReactorNet zeroD_reactorNet;
742 zeroD_reactorNet.setVerbose(false);
743 zeroD_reactorNet.addReactor(zeroD_reactor);
744 zeroD_reactorNet.setTolerances(1e-9, 1e-9);
745
746 const MUint noCells = a_noCells();
747 const MUint noPVars = PV->noVariables;
748 const MUint noAVars = hasAV ? AV->noVariables : 0;
749
750 MFloat* const RESTRICT pvars = &a_pvariable(0, 0);
751 MFloat* const RESTRICT reactionRates = &a_speciesReactionRate(0, 0);
752 MFloat* const RESTRICT avars = hasAV ? &a_avariable(0, 0) : nullptr;
753
754 for(MUint cellId = 0; cellId < noCells; ++cellId) {
755 // Skip halo cells
756 if(a_isHalo(cellId)) {
757 for(MUint s = 0; s < PV->m_noSpecies; ++s) {
758 a_speciesReactionRate(cellId, s) = F0;
759 }
760 continue;
761 }
762
763 const MUint cellPVarOffset = cellId * noPVars;
764 const MUint cellAVarOffset = hasAV ? cellId * noAVars : 0;
765 const MUint reactionRateOffset = cellId * PV->m_noSpecies;
766
767 const MFloat* const RESTRICT pvarsCell = pvars + cellPVarOffset;
768 const MFloat* const RESTRICT avarsCell = hasAV ? avars + cellAVarOffset : nullptr;
769 MFloat* const RESTRICT reactionRatesCell = reactionRates + reactionRateOffset;
770
771 sysEqn().computeSpeciesReactionRates(m_timeStep, a_cellVolume(cellId), pvarsCell, avarsCell, reactionRatesCell,
772 &zeroD_reactor, &zeroD_reactorNet, m_canteraSolution, m_canteraThermo);
773 }
774}
std::shared_ptr< Cantera::Solution > m_canteraSolution

◆ computeSpongeDeltas()

template<MInt nDim_, class SysEqn >
std::array< MFloat, nDim_+2 > FvCartesianSolverXD< nDim_, SysEqn >::computeSpongeDeltas ( MInt  cellId,
std::array< MFloat, 6 >  value 
)

Definition at line 15476 of file fvcartesiansolverxd.cpp.

◆ computeSrfcs()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeSrfcs ( MInt  ,
MInt  ,
MInt  ,
MInt   
)

◆ computeSurfaceCoefficients()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::computeSurfaceCoefficients

Definition at line 706 of file fvcartesiansolverxd.cpp.

706 {
707 const MInt noSurfaces = a_noSurfaces();
708
709 const MFloat* const RESTRICT surfaceVars = ALIGNED_F(&a_surfaceVariable(0, 0, 0));
710 MFloat* const RESTRICT surfaceCoefficients = hasSC ? ALIGNED_F(&a_surfaceCoefficient(0, 0)) : nullptr;
711
712 const MInt noPVars = PV->noVariables;
713 const MUint noSurfaceCoefficients = hasSC ? SC->m_noSurfaceCoefficients : 0;
714 const MInt surfaceVarMemory = 2 * PV->noVariables;
715
716 for(MInt srfcId = 0; srfcId < noSurfaces; ++srfcId) {
717 const MInt offset = srfcId * surfaceVarMemory;
718 const MFloat* const RESTRICT vars0 = ALIGNED_F(surfaceVars + offset);
719 const MFloat* const RESTRICT vars1 = ALIGNED_F(vars0 + noPVars);
720
721 const MInt coefficientOffset = srfcId * noSurfaceCoefficients;
722 MFloat* const RESTRICT srfcCoeff = hasSC ? ALIGNED_F(surfaceCoefficients + coefficientOffset) : nullptr;
723 // MFloat* const RESTRICT srfcCoeff = hasSC ? ALIGNED_F(&a_srfcCoeffs(srfcId, 0)) : nullptr;
724
725 sysEqn().computeSurfaceCoefficients(m_RKStep, vars0, vars1, srfcCoeff, m_canteraThermo, m_canteraTransport);
726 }
727}
std::shared_ptr< Cantera::Transport > m_canteraTransport

◆ computeSurfaceValuesLimitedSlopes()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeSurfaceValuesLimitedSlopes ( MInt  timerId = -1)
virtual

limits the pressure slopes according to Venkatakrishnan, AIAA paper 93-0880 before calling computeSurfaceValues_(noSpecies), modified for cartesian cells by

Definition at line 18948 of file fvcartesiansolverxd.cpp.

18948 {
18949#define VENKATAKRISHNAN
18950 // VENKATAKRISHNAN VENKATAKRISHNAN_MOD
18951 TRACE();
18952 const MInt noCells = a_noCells();
18953 MFloat* const RESTRICT cellSlopes = ALIGNED_MF(&a_slope(0, 0, 0));
18954 const MInt slopeMemory = m_slopeMemory;
18955
18956 for(MInt cellId = 0; cellId < noCells; cellId++) {
18957 if(a_isBndryGhostCell(cellId)) continue;
18958 if(a_hasProperty(cellId, SolverCell::IsCutOff)) continue;
18959 for(MInt it = 0; it < m_noLimitedSlopesVar; it++) {
18960 MInt varId = m_limitedSlopesVar[it];
18961
18962 MFloat minNghbrDelta = F0;
18963 MFloat maxNghbrDelta = F0;
18964 MFloat effNghbrDelta = F0;
18965 const MFloat cellValue = a_pvariable(cellId, varId);
18966 // 1. get the abs min value of the max and min value from the reconstruction neighbours
18967 for(MInt rcnstructnNghbr = 0; rcnstructnNghbr < a_noReconstructionNeighbors(cellId); rcnstructnNghbr++) {
18968 const MInt rcnstrctnNghbrId = a_reconstructionNeighborId(cellId, rcnstructnNghbr);
18969 const MFloat rcnstrctnNghbrValue = a_pvariable(rcnstrctnNghbrId, varId);
18970 const MFloat tmpDelta = rcnstrctnNghbrValue - cellValue;
18971 if(tmpDelta > maxNghbrDelta) {
18972 maxNghbrDelta = tmpDelta;
18973 } else if(tmpDelta < minNghbrDelta) {
18974 minNghbrDelta = tmpDelta;
18975 }
18976 }
18977 effNghbrDelta = mMin(maxNghbrDelta, abs(minNghbrDelta));
18978 // 2. get srfcDelta and compute the minimum phi
18979 const MFloat dx = F1B2 * c_cellLengthAtCell(cellId);
18980 MFloat srfcDelta = F0;
18981 for(MInt dim = 0; dim < nDim; dim++)
18982 srfcDelta += abs(cellSlopes[cellId * slopeMemory + varId * nDim + dim]) * dx;
18983#ifdef BART_AND_JESPERSON
18984 const MFloat eps = 1e-12;
18985 const MFloat phi_max = effNghbrDelta / (srfcDelta + eps);
18986 const MFloat minPhi = mMin(phi_max, F1);
18987#endif
18988#ifdef VENKATAKRISHNAN
18989 const MFloat eps = 1e-12;
18990 const MFloat y = effNghbrDelta / (srfcDelta + eps);
18991 const MFloat minPhi = mMin((y * y + F2 * y) / (y * y + y + F2), F1);
18992#endif
18993#ifdef VENKATAKRISHNAN_MOD
18994 const MFloat K = F2;
18995 const MFloat epsSqr = pow(K * dx, F3);
18996 const MFloat minPhi = (pow(effNghbrDelta, F2) + epsSqr + F2 * effNghbrDelta * srfcDelta)
18997 / (pow(effNghbrDelta, F2) + F2 * pow(srfcDelta, F2) + effNghbrDelta * srfcDelta + epsSqr);
18998#endif
18999 // 3. limit slopes with the minimum phi
19000 for(MInt dim = 0; dim < nDim; dim++)
19001 cellSlopes[cellId * slopeMemory + varId * nDim + dim] *= minPhi;
19002 }
19003 }
19004
19005 // compute the surface values:
19006 if(m_noSpecies == 0) {
19007 computeSurfaceValues_(0);
19008 } else if(m_noSpecies == 1) {
19009 computeSurfaceValues_(1);
19010 } else {
19011 computeSurfaceValues_(m_noSpecies);
19012 }
19013
19014 // correct the boundary surface values
19015 IF_CONSTEXPR(nDim == 2) m_fvBndryCnd->correctBoundarySurfaceVariables();
19016 IF_CONSTEXPR(nDim == 3) {
19017 if(m_fvBndryCnd->m_multipleGhostCells) { // Multiple-Ghost-Cell
19020 } else {
19022 }
19023 } else {
19024 m_fvBndryCnd->correctBoundarySurfaceVariables();
19025 }
19026 }
19027
19028 // update the ghost cell slopes for viscous flux balance
19031}
void correctBoundarySurfaceVariablesMGC()
corrects the left and right variables values on the boundary surface
void correctBoundarySurfaceVariablesMGCSurface()
corrects the left and right variables values on the boundary surface

◆ computeSurfaceValuesLimitedSlopesMan()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeSurfaceValuesLimitedSlopesMan ( MInt  timerId = -1)
virtual
Author
Thomas Schilden, December 2017

Definition at line 19194 of file fvcartesiansolverxd.cpp.

19194 {
19195 TRACE();
19196
19197 const MInt noCells = a_noCells();
19198 MFloat* const RESTRICT cellSlopes = ALIGNED_MF(&a_slope(0, 0, 0));
19199 const MInt slopeMemory = m_slopeMemory;
19200
19201 for(MInt cellId = 0; cellId < noCells; cellId++) {
19202 // if(a_hasProperty(cellId, SolverCell::IsCutOff))
19203 // continue;
19204 for(MInt it = 0; it < m_noLimitedSlopesVar; it++) {
19205 MInt varId = m_limitedSlopesVar[it];
19206
19207 // limit slopes with the minimum phi
19208 for(MInt dim = 0; dim < nDim; dim++)
19209 cellSlopes[cellId * slopeMemory + varId * nDim + dim] *= m_limPhi[cellId];
19210 }
19211 }
19212
19213 // compute the surface values:
19214 if(m_noSpecies == 0) {
19215 computeSurfaceValues_(0);
19216 } else if(m_noSpecies == 1) {
19217 computeSurfaceValues_(1);
19218 } else {
19219 computeSurfaceValues_(m_noSpecies);
19220 }
19221
19222 // correct the boundary surface values
19223 if(m_fvBndryCnd->m_multipleGhostCells) { // Multiple-Ghost-Cell
19226 } else {
19228 }
19229 } else {
19230 m_fvBndryCnd->correctBoundarySurfaceVariables();
19231 }
19232
19233 // update the ghost cell slopes for viscous flux balance
19236}

◆ computeSurfaceValuesLOCD()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeSurfaceValuesLOCD ( MInt  timerId = -1)
virtual

Definition at line 25219 of file fvcartesiansolverxd.cpp.

25219 {
25220 TRACE();
25221
25222 MInt nghbr0, nghbr1;
25223 const MInt noPVarIds = PV->noVariables;
25224 const MInt noSrfcs = a_noSurfaces();
25225 // MInt va0, va1;//, sl0, sl1, i;
25226 const MInt surfaceVarMemory = m_surfaceVarMemory;
25227 MFloat* surfaceVar = (MFloat*)(&(a_surfaceVariable(0, 0, 0)));
25228 //---end of initialization
25229
25230 MInt va0 = 0;
25231 MInt va1 = noPVarIds;
25232 // i = 0;
25233
25234 for(MInt srfcId = 0; srfcId < noSrfcs; srfcId++) {
25235 // interpolate the primitive variables onto the surface from both sides
25236 nghbr0 = a_surfaceNghbrCellId(srfcId, 0);
25237 nghbr1 = a_surfaceNghbrCellId(srfcId, 1);
25238
25239 // sl0 = nghbr0 * slopeMemory;
25240 // sl1 = nghbr1 * slopeMemory;
25241
25242 for(MInt varId = 0; varId < PV->P; varId++) {
25243 surfaceVar[va0 + varId] = a_pvariable(nghbr0, varId); //
25244 // + cellSlopes[sl0] * dx[i]
25245 // + cellSlopes[sl0 + 1] * dx[i + 1]
25246 // IF_CONSTEXPR(nDim == 2) {
25247 // ;
25248 //} else {
25249 // + cellSlopes[sl0 + 2] * dx[i + 2];
25250 //}
25251 surfaceVar[va1 + varId] = a_pvariable(nghbr1, varId); //
25252 // + cellSlopes[sl1] * dx[i + nDim]
25253 // + cellSlopes[sl1 + 1] * dx[i + nDim + 1]
25254 // IF_CONSTEXPR(nDim == 2) {
25255 // ;
25256 //} else {
25257 // + cellSlopes[sl1 + 2] * dx[i + nDim + 2];
25258 //}
25259 // sl0 += nDim;
25260 // sl1 += nDim;
25261 }
25262 surfaceVar[va0 + PV->P] = a_pvariable(nghbr0, PV->P);
25263 surfaceVar[va1 + PV->P] = a_pvariable(nghbr1, PV->P);
25264 // sl0 += nDim;
25265 // sl1 += nDim;
25266 for(MInt varId = PV->P + 1; varId < noPVarIds; varId++) {
25267 surfaceVar[va0 + varId] = a_pvariable(nghbr0, varId); //
25268 // + cellSlopes[sl0] * dx[i]
25269 // + cellSlopes[sl0 + 1] * dx[i + 1]
25270 // IF_CONSTEXPR(nDim == 2) {
25271 // ;
25272 //} else {
25273 // + cellSlopes[sl0 + 2] * dx[i + 2];
25274 //}
25275 surfaceVar[va1 + varId] = a_pvariable(nghbr1, varId); //
25276 // + cellSlopes[sl1] * dx[i + nDim]
25277 // + cellSlopes[sl1 + 1] * dx[i + nDim + 1]
25278 // IF_CONSTEXPR(nDim == 2) {
25279 // ;
25280 //} else {
25281 // + cellSlopes[sl1 + 2] * dx[i + nDim + 2]
25282 //}
25283 // sl0 += nDim;
25284 // sl1 += nDim;
25285 }
25286
25287 va0 += surfaceVarMemory;
25288 va1 += surfaceVarMemory;
25289 // i += 2 * nDim;
25290 }
25291
25292 // correct the boundary surface values
25293 m_fvBndryCnd->correctBoundarySurfaceVariables();
25294
25295 // update the ghost cell slopes for the viscous flux computation
25298}

◆ computeTargetValues()

template<MInt nDim_, class SysEqn >
std::array< MFloat, 6 > FvCartesianSolverXD< nDim_, SysEqn >::computeTargetValues ( )

◆ computeTimeStep()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::computeTimeStep ( MInt  cellId) const
protectednoexcept

Definition at line 21512 of file fvcartesiansolverxd.cpp.

21512 {
21513 MFloat dtCell = computeTimeStepMethod(cellId);
21514
21515 // Applies volume weighting to boundary cells
21516 if(m_timeStepVolumeWeighted && a_bndryId(cellId) != -1) {
21517 dtCell *= a_cellVolume(cellId) / grid().cellVolumeAtLevel(a_level(cellId));
21518 }
21519 return dtCell;
21520}
MBool m_timeStepVolumeWeighted
Should the time-step in the boundary cells be weighted by their volume?
MFloat computeTimeStepMethod(MInt cellId) const noexcept
Computes the time-step of the cell cellId.

◆ computeTimeStepApeDirectional()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::computeTimeStepApeDirectional ( MInt  cellId) const
protectednoexcept

Computes the time-step from the CFL condition for the APEs and the LAE testcase

Taken from scheme no. 1 in "Report: maximum_CFLs" by Rodrigo/Michael

Definition at line 21441 of file fvcartesiansolverxd.cpp.

21441 {
21442 ASSERT(((SolverType)string2enum(Context::getSolverProperty<MString>("solvertype", m_solverId, AT_))) == MAIA_FV_APE,
21443 "FV_APE solver not selected");
21444
21445 const MFloat dx = c_cellLengthAtCell(cellId);
21446
21447 MFloat lambdaMaxSum = (m_initialCondition == 1184) ? 0.0 : nDim; // 0 for LAE(IC1184), nDim for APE
21448 MFloat advectionVelocity[nDim];
21449 for(MInt d = 0; d < nDim; ++d) {
21450 advectionVelocity[d] =
21451 Context::getSolverProperty<MFloat>("advectionVelocity", m_solverId, AT_, &advectionVelocity[d], d);
21452 lambdaMaxSum += fabs(advectionVelocity[d]);
21453 }
21454 return m_cfl * dx / (lambdaMaxSum);
21455}
SolverType
Definition: enums.h:22
@ MAIA_FV_APE
Definition: enums.h:24

◆ computeTimeStepDiffusionNS()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::computeTimeStepDiffusionNS ( MFloat  density,
MFloat  temperature,
MFloat  Re,
MFloat  C,
MFloat  dx 
) const
protectednoexcept

Computes the time-step from the stability condition for the Diffusion Eqt.

dt = C * dx^2 / diffusion_coefficient where C = (0, 1/4]

Definition at line 21461 of file fvcartesiansolverxd.cpp.

21462 {
21463 return sysEqn().computeTimeStepDiffusion(SUTHERLANDLAW(temperature) / (density * Re), C, dx);
21464}

◆ computeTimeStepEulerDirectional()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::computeTimeStepEulerDirectional ( MInt  cellId) const
protectednoexcept

Computes the time-step from the CFL condition for the Euler-eqts as follows:

dt = min C * dx / (|u_i| + a) i = 0..d

Definition at line 21411 of file fvcartesiansolverxd.cpp.

21411 {
21412 MFloat a;
21413 IF_CONSTEXPR(!hasE<SysEqn>)
21414 mTerm(1, AT_, "Not compatible with SysEqn without RHO_E!");
21415
21416 IF_CONSTEXPR(isDetChem<SysEqn>) {
21417 MFloat gamma = a_avariable(cellId, AV->GAMMA);
21418 MFloat p = a_pvariable(cellId, PV->P);
21419 MFloat rho = a_pvariable(cellId, PV->RHO);
21420 a = sqrt(gamma * mMax(MFloatEps, p / mMax(MFloatEps, rho)));
21421 }
21422 else {
21423 a = cv_a(cellId);
21424 }
21425
21426 MFloat dt = std::numeric_limits<MFloat>::max();
21427 const MFloat Frho = 1. / a_variable(cellId, CV->RHO);
21428 const MFloat dx = c_cellLengthAtCell(cellId);
21429 for(MInt d = 0; d < nDim; ++d) {
21430 MFloat abs_u_d = fabs(a_variable(cellId, CV->RHO_VV[d]) * Frho);
21431 MFloat dt_dir = m_cfl * dx / (abs_u_d + a);
21432 dt = mMin(dt, dt_dir);
21433 }
21434
21435 return dt;
21436}
MFloat cv_a(MInt cellId) const noexcept
Returns the speed-of-sound computed from the conservative variables of the cell cellId.

◆ computeTimeStepMethod()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::computeTimeStepMethod ( MInt  cellId) const
protectednoexcept

Computes the time-step from the stability condition for the Diffusion Eqt.

dt = C * dx^2 / diffusion_coefficient where C = (0, 1/4]

Definition at line 21477 of file fvcartesiansolverxd.cpp.

21477 {
21478 switch(m_timeStepMethod) {
21479 default: {
21480 if(m_timeStepFixedValue > 0.) {
21481 return m_timeStepFixedValue;
21482 }
21483 mTerm(1, AT_, "unknown time-step method: " + to_string(m_timeStepMethod));
21484 }
21485 case 17511: // this uses a different time-step during the simulation but writes
21486 // the one that was read from a restart file to the next file
21487 case 1: {
21488 return computeTimeStepEulerDirectional(cellId);
21489 }
21490 case 2: {
21491 return computeTimeStepApeDirectional(cellId);
21492 }
21493 case 6: {
21495 // prior version used m_maxGCellLevel from the levelSet-Solver!
21496 }
21497 // Infinity values:
21498 case 100: {
21500 std::array<MFloat, nDim> u = {};
21501 u[0] = m_UInfinity;
21502 u[1] = m_VInfinity;
21503 IF_CONSTEXPR(nDim == 3) u[2] = m_WInfinity;
21504 const MFloat dt_inv = sysEqn().computeTimeStepEulerMagnitude(m_rhoInfinity, u, m_PInfinity, m_cfl, dx);
21506 return mMin(dt_inv, dt_visc);
21507 }
21508 }
21509}
MFloat computeTimeStepApeDirectional(MInt cellId) const noexcept
MFloat computeTimeStepEulerDirectional(MInt cellId) const noexcept
MFloat computeTimeStepDiffusionNS(MFloat density, MFloat temperature, MFloat Re, MFloat C, MFloat dx) const noexcept

◆ computeUTau()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeUTau ( MFloat data,
MInt  cellId 
)

◆ computeVolumeForces()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeVolumeForces

Definition at line 6205 of file fvcartesiansolverxd.cpp.

6205 {
6206 TRACE();
6207 // Volume forces are added in rhsEEGas() if m_isEEGas
6208 if(m_isEEGas) return;
6209
6210#ifdef _OPENMP
6211#pragma omp parallel for collapse(2)
6212#endif
6213 for(MInt ac = 0; ac < m_noActiveCells; ac++) {
6214 for(MInt i = 0; i < nDim; i++) {
6215 a_rightHandSide(m_activeCellIds[ac], CV->RHO_VV[i]) -=
6217 IF_CONSTEXPR(hasE<SysEqn>)
6218 a_rightHandSide(m_activeCellIds[ac], CV->RHO_E) -= a_pvariable(m_activeCellIds[ac], PV->VV[i])
6219 * a_pvariable(m_activeCellIds[ac], PV->RHO)
6221 }
6222 }
6223}

◆ computeVolumeForcesRANS()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeVolumeForcesRANS

Definition at line 19593 of file fvcartesiansolverxd.cpp.

19593 {
19594 TRACE();
19595
19596#ifdef _OPENMP
19597#pragma omp parallel for
19598#endif
19599 for(MInt ac = 0; ac < m_noActiveCells; ac++) {
19600 const MInt cellId = m_activeCellIds[ac];
19601
19602 if(a_isBndryGhostCell(cellId)) continue;
19603 if(a_isInactive(cellId)) continue;
19604
19605 MFloat* vars = &a_pvariable(0, 0);
19606 MFloat* rhs = &a_rightHandSide(cellId, 0);
19607 const MFloat cellVol = a_cellVolume(cellId);
19608 const MFloat* const slopes = &a_slope(0, 0, 0);
19609 const MInt* const recNghbr = &a_reconstructionNeighborId(cellId, 0);
19610 const MInt noRecNghbr = a_noReconstructionNeighbors(cellId);
19611 const MInt recData = a_reconstructionData(cellId);
19612 const MFloat* const recConst = &m_reconstructionConstants[0];
19613
19614 MFloat dist = F1;
19615 if(m_levelSetRans) {
19616 dist = a_levelSetFunction(cellId, 0);
19617 } else {
19618 // You can define an analytical wall distance here
19619 dist = a_coordinate(cellId, 1);
19620 }
19621
19622 sysEqn().computeVolumeForces(cellId, vars, rhs, cellVol, slopes, recData, recNghbr, recConst, noRecNghbr, dist);
19623 }
19624}
MBool a_isInactive(const MInt cellId) const

◆ computeVorticity2D()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeVorticity2D ( MFloat *const  vorticity)
protected

Definition at line 8322 of file fvcartesiansolverxd.cpp.

8322 {
8323 TRACE();
8324
8325 for(MInt c = 0; c < noInternalCells(); c++) {
8326 vorticity[c] = F1B2 * (a_slope(c, PV->V, 0) - a_slope(c, PV->U, 1));
8327 }
8328}

◆ computeVorticity3D()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeVorticity3D ( MFloat *const  vorticity)
protected

Definition at line 8310 of file fvcartesiansolverxd.cpp.

8310 {
8311 TRACE();
8312
8313 MInt offset = a_noCells();
8314 for(MInt c = 0; c < noInternalCells(); c++) {
8315 vorticity[c] = F1B2 * (a_slope(c, PV->W, 1) - a_slope(c, PV->V, 2));
8316 vorticity[offset + c] = F1B2 * (a_slope(c, PV->U, 2) - a_slope(c, PV->W, 0));
8317 vorticity[offset * 2 + c] = F1B2 * (a_slope(c, PV->V, 0) - a_slope(c, PV->U, 1));
8318 }
8319}

◆ computeVorticity3DT()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeVorticity3DT ( MFloat *const  vorticity)
protected
Author
Michael Schlottke-Lakemper (mic) mic@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2015-11-24
Parameters
[out]vorticityPointer to enough storage for vorticity

Vorticity w for cells 0, 1, 2 is stored as follows: wx_0, wy_0, wz_0, wx_1, wy_1, wz_1, wx_2, wy_2, wz_2

Definition at line 8341 of file fvcartesiansolverxd.cpp.

8341 {
8342 TRACE();
8343
8344 for(MInt c = 0; c < noInternalCells(); c++) {
8345 vorticity[3 * c + 0] = F1B2 * (a_slope(c, PV->W, 1) - a_slope(c, PV->V, 2));
8346 vorticity[3 * c + 1] = F1B2 * (a_slope(c, PV->U, 2) - a_slope(c, PV->W, 0));
8347 vorticity[3 * c + 2] = F1B2 * (a_slope(c, PV->V, 0) - a_slope(c, PV->U, 1));
8348 }
8349}

◆ computeWallNormalPointCoords()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::computeWallNormalPointCoords
protected

Definition at line 34442 of file fvcartesiansolverxd.cpp.

34442 {
34443 TRACE();
34444
34445 m_log << "Computing Wall Normal Point Coordinates ... " << endl;
34446
34447 MInt noSegments = m_normalNoPoints - 1;
34448 MFloat segmentLength = m_normalLength / noSegments;
34449
34450 MInt size = m_bndryCells->size();
34451 MInt k = m_normalSamplingSide.size();
34452
34453 ScratchSpace<MInt> sampleUsage(k, AT_, "sampleUsage");
34454 sampleUsage.fill(0);
34455
34456 for(MInt i = 0; i < size; i++) {
34457 MInt cellId = m_bndryCells->a[i].m_cellId;
34458 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
34459 if(!a_hasProperty(cellId, SolverCell::IsHalo)) {
34460 for(MInt srfc = 0; srfc < m_bndryCells->a[i].m_noSrfcs; srfc++) {
34461 MInt cellCnd = m_bndryCells->a[i].m_srfcs[srfc]->m_bndryCndId;
34462 if(cellCnd == m_normalBcId) {
34463 MFloat dist = c_cellLengthAtCell(cellId) / 2;
34464 MFloat x = (a_coordinate(cellId, 0) - m_bndryCells->a[i].m_coordinates[0]);
34465 MFloat xUpper = x + dist;
34466 MFloat xLower = x - dist;
34467 MFloat z = 0;
34468 MFloat zUpper = 0;
34469 MFloat zLower = 0;
34470
34471 if(nDim == 3) {
34472 z = (a_coordinate(cellId, 2) - m_bndryCells->a[i].m_coordinates[2]);
34473 zUpper = z + dist;
34474 zLower = z - dist;
34475 }
34476
34477 for(MInt o = 0; o < k; o++) {
34478 if(sampleUsage[o] == 0) {
34479 MFloat xCompare = m_normalSamplingCoords[o * 2];
34480 MFloat zCompare = 0;
34481 if(nDim == 3) {
34482 zCompare = m_normalSamplingCoords[o * 2 + 1];
34483 }
34484
34485 if((xCompare <= xUpper) && (xCompare >= xLower) && (zCompare <= zUpper) && (zCompare >= zLower)) {
34486 MInt side = m_normalSamplingSide[o];
34487 MFloat ny = m_bndryCells->a[i].m_srfcs[srfc]->m_normalVector[1];
34488
34489 if(((side < 0) && (ny < 0)) || ((side > 0) && (ny > 0))) {
34490 sampleUsage[o] = 1;
34491 m_wallSetupOrigin.push_back(xCompare);
34492 m_wallSetupOrigin.push_back(zCompare);
34493 m_wallSetupOriginSide.push_back(side);
34494
34495 MFloat initCoordx = m_bndryCells->a[i].m_srfcs[srfc]->m_coordinates[0];
34496 MFloat initCoordy = m_bndryCells->a[i].m_srfcs[srfc]->m_coordinates[1];
34497 MFloat initCoordz = 0;
34498
34499 MFloat nx = m_bndryCells->a[i].m_srfcs[srfc]->m_normalVector[0];
34500 MFloat nz = 0;
34501
34502 m_wallNormalVectors.push_back(nx);
34503 m_wallNormalVectors.push_back(ny);
34504
34505 if(nDim == 3) {
34506 initCoordz = m_bndryCells->a[i].m_srfcs[srfc]->m_coordinates[2];
34507 nz = m_bndryCells->a[i].m_srfcs[srfc]->m_normalVector[2];
34508 }
34509
34510 MFloat r = sqrt(nx * nx + ny * ny + nz * nz);
34511 MFloat scalingFactor = segmentLength / r;
34512
34513 MFloat stepX = nx * scalingFactor;
34514 MFloat stepY = ny * scalingFactor;
34515 MFloat stepZ = nz * scalingFactor;
34516
34517 for(MInt step = 0; step <= noSegments; step++) {
34518 MFloat coordX = initCoordx + (step * stepX);
34519 MFloat coordY = initCoordy + (step * stepY);
34520
34521 m_wallNormalPointCoords.push_back(coordX);
34522 m_wallNormalPointCoords.push_back(coordY);
34523
34524 if(nDim == 3) {
34525 MFloat coordZ = initCoordz + (step * stepZ);
34526 m_wallNormalPointCoords.push_back(coordZ);
34527 }
34528 }
34530 }
34531 }
34532 }
34533 }
34534 }
34535 }
34536 }
34537 }
34538 }
34539 m_log << "done." << endl;
34540}
std::vector< MFloat > m_normalSamplingCoords
std::vector< MFloat > m_wallSetupOrigin
std::vector< MFloat > m_wallNormalVectors
std::vector< MInt > m_wallSetupOriginSide
std::vector< MInt > m_normalSamplingSide
std::vector< MFloat > m_wallNormalPointCoords

◆ computeWMViscositySpalding()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::computeWMViscositySpalding ( MInt  wmSrfcId)
protected

Definition at line 11743 of file fvcartesiansolverxd.cpp.

11743 {
11744 TRACE();
11745
11746 const MFloat kappa = 0.4;
11747 const MFloat B = 5.5;
11748
11749 const MInt bndryCellId = m_wmSurfaces[wmSrfcId].m_bndryCellId;
11750 const MInt bndrySrfcId = m_wmSurfaces[wmSrfcId].m_bndrySrfcId;
11751 const MInt cellId = m_bndryCells->a[bndryCellId].m_cellId;
11752
11753 if(!m_wmSurfaces[wmSrfcId].m_wmHasImgCell) {
11754 return F0;
11755 }
11756
11757 MFloat tau_wm = F0;
11758 MFloat mue_wm = F0;
11759
11760 MFloat nx = m_bndryCells->a[bndryCellId].m_srfcs[bndrySrfcId]->m_normalVector[0];
11761 MFloat ny = m_bndryCells->a[bndryCellId].m_srfcs[bndrySrfcId]->m_normalVector[1];
11762 MFloat u_img = 0.0;
11763 MFloat v_img = 0.0;
11764 MFloat u_II = 0.0;
11765 MFloat u_II_bndry = 0.0;
11766 MFloat dn_img = m_wmDistance;
11767
11768 u_img = m_wmSurfaces[wmSrfcId].m_wmImgVars[PV->VV[0]];
11769 v_img = m_wmSurfaces[wmSrfcId].m_wmImgVars[PV->VV[1]];
11770
11771 // compute wall parallel velocities, depending on surface orientation
11772 if(abs(ny) < m_eps) return F0; // close to vertical wall, can't decide proper flow direction here
11773
11774 u_II = maia::math::sgn(ny) * (u_img * ny - v_img * nx);
11775 u_II_bndry = maia::math::sgn(ny) * (a_pvariable(cellId, PV->U) * ny - a_pvariable(cellId, PV->V) * nx);
11776
11777 if(u_II > 0.0 && u_II_bndry > 0.0) {
11778 const MInt ghostCellId = m_bndryCells->a[bndryCellId].m_srfcVariables[bndrySrfcId]->m_ghostCellId;
11779 const MFloat rho_surf = F1B2 * (a_pvariable(cellId, PV->RHO) + a_pvariable(ghostCellId, PV->RHO));
11780 const MFloat p_surf = F1B2 * (a_pvariable(cellId, PV->P) + a_pvariable(ghostCellId, PV->P));
11781 const MFloat T_surf = sysEqn().temperature_ES(rho_surf, p_surf);
11782 const MFloat mue = SUTHERLANDLAW(T_surf);
11783
11784 const MFloat Re0 = sysEqn().m_Re0;
11785
11786 // Time filter to reduce fluctuations in the wall shear stress which are normally dampened by the viscous sublayer
11787 MFloat u_tau = m_wmSurfaces[wmSrfcId].m_wmUTAU;
11788
11789 if(m_wmTimeFilter) {
11790 // see "Integral wall model for large large eddy simulations of wall-bounded turbulent flows" (Yang et al. 2015)
11791 const MFloat theta = 1.0;
11792 const MFloat twall = theta * m_wmDistance / (kappa * u_tau);
11793 const MFloat E = m_timeStep / twall; // constant for exponential moving average
11794 const MFloat u_II_last = m_wmSurfaces[wmSrfcId].m_wmUII;
11795
11796 // floating average with time constant based on shear velocity
11797 u_II = E * u_II + (F1 - E) * u_II_last;
11798 }
11799
11800 // save u_II for restart purposes (before van Driest Transformation!)
11801 m_wmSurfaces[wmSrfcId].m_wmUII = u_II;
11802
11803 if(m_Ma > 1.3) {
11804 // van Driest transform for compressible flows
11805 const MFloat b = sysEqn().vanDriest(m_Ma);
11806 u_II = m_UInfinity / b * asin(b * u_II / m_UInfinity);
11807 }
11808
11809 // iteration of spalding wall function
11810 MFloat res = 9999.0;
11811 while(res > 1e-6) {
11812 MFloat eKB = exp(-kappa * B);
11813 MFloat spalding = u_II / u_tau
11814 + eKB
11815 * (exp(kappa * u_II / u_tau) - 1 - (kappa * u_II / u_tau)
11816 - 1.0 / 2.0 * pow(kappa * u_II / u_tau, 2) - 1.0 / 6.0 * pow(kappa * u_II / u_tau, 3))
11817 - abs(dn_img) * u_tau * (rho_surf / mue) * Re0;
11818 MFloat d_spalding =
11819 -u_II / pow(u_tau, 2)
11820 + eKB
11821 * ((-kappa * u_II / pow(u_tau, 2)) * exp(kappa * u_II / u_tau) + (kappa * u_II / u_tau) / u_tau
11822 + pow(kappa * u_II / u_tau, 2) / u_tau + 1.0 / 2.0 * pow(kappa * u_II / u_tau, 3) / u_tau)
11823 - abs(dn_img) * (rho_surf / mue) * Re0;
11824
11825 MFloat delta = -spalding / d_spalding;
11826
11827 u_tau += delta;
11828 res = abs(delta / u_tau);
11829 m_wmIterator++;
11830 }
11831
11832 // save u_tau for restart purposes
11833 m_wmSurfaces[wmSrfcId].m_wmUTAU = u_tau;
11834
11835 if(std::isnan(u_tau)) {
11836 cout << "WARNING: Wall model u_tau is NaN!" << endl;
11837 return F0;
11838 }
11839
11840 tau_wm = rho_surf * pow(u_tau, 2);
11841
11842 MFloat dudn = m_bndryCells->a[bndryCellId].m_srfcVariables[bndrySrfcId]->m_normalDeriv[PV->VV[0]];
11843 MFloat dvdn = m_bndryCells->a[bndryCellId].m_srfcVariables[bndrySrfcId]->m_normalDeriv[PV->VV[1]];
11844 MFloat grad = maia::math::sgn(ny) * (dudn * ny - dvdn * nx);
11845 MFloat tau_w = mue * grad / Re0;
11846
11847 if(tau_w / tau_wm > m_eps) mue_wm = ((tau_wm / tau_w) - 1.0) * mue;
11848 if(mue_wm > 50.0 * mue) mue_wm = 50.0 * mue;
11849 }
11850
11851 m_wmSurfaces[wmSrfcId].m_wmTauW = tau_wm;
11852 m_wmSurfaces[wmSrfcId].m_wmMUEWM = mue_wm;
11853
11854 return mue_wm;
11855}
std::vector< FvWMSurface< nDim > > m_wmSurfaces
MInt sgn(T val)
Definition: maiamath.h:495

◆ computeWMViscositySpalding3D()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::computeWMViscositySpalding3D ( MInt  cellId)
protected

Definition at line 11859 of file fvcartesiansolverxd.cpp.

11859 {
11860 TRACE();
11861
11862 const MFloat kappa = 0.4;
11863 const MFloat B = 5.5;
11864
11865 MInt bndryCellId = a_bndryId(cellId);
11866 if(!m_bndryCells->a[bndryCellId].m_wmBCVars->m_wmHasImgCell) return F0;
11867
11868 MFloat tau_wm = F0;
11869 MFloat mue_wm = F0;
11870
11871 MFloat* normalVec = m_bndryCells->a[bndryCellId].m_srfcs[0]->m_normalVector;
11872 MFloat* imgVar = m_bndryCells->a[bndryCellId].m_wmBCVars->m_wmImgVars;
11873 MFloat* normalDeriv = m_bndryCells->a[bndryCellId].m_srfcVariables[0]->m_normalDeriv;
11874
11875 MFloat vvII[3] = {0.0, 0.0, 0.0};
11876 MFloat vvn[3] = {0.0, 0.0, 0.0};
11877 MFloat dvvII_dn[3] = {0.0, 0.0, 0.0};
11878 MFloat dvvn_dn[3] = {0.0, 0.0, 0.0};
11879
11880 MFloat Vn = 0.0;
11881 MFloat VII = 0.0;
11882 MFloat dVn_dn = 0.0;
11883 MFloat dVII_dn = 0.0;
11884
11885 MFloat dn_img = m_wmDistance;
11886
11887 // decompose 3D velocity and gradients into wall-parallel and orthogonal components
11888 for(MInt d = 0; d < nDim; d++) {
11889 Vn += imgVar[PV->VV[d]] * normalVec[d];
11890 dVn_dn += normalDeriv[PV->VV[d]] * normalVec[d];
11891 }
11892
11893 for(MInt d = 0; d < nDim; d++) {
11894 vvn[d] = Vn * normalVec[d];
11895 vvII[d] = imgVar[PV->VV[d]] - vvn[d];
11896
11897 dvvn_dn[d] = dVn_dn * normalVec[d];
11898 dvvII_dn[d] = normalDeriv[PV->VV[d]] - dvvn_dn[d];
11899 }
11900
11901 for(MInt d = 0; d < nDim; d++) {
11902 VII += POW2(vvII[d]);
11903 dVII_dn += POW2(dvvII_dn[d]);
11904 }
11905
11906 VII = sqrt(VII);
11907 dVII_dn = sqrt(dVII_dn);
11908
11909 // close to vertical wall, can't decide proper flow direction here, probably stagnation point
11910 if(F1 - abs(normalVec[0]) < m_eps) return F0;
11911
11912 // check for attached flow with respect to mean flow in x direction)
11913 if(vvII[0] > 0.0 && dvvII_dn[0] > 0.0) {
11914 const MInt ghostCellId = m_bndryCells->a[bndryCellId].m_srfcVariables[0]->m_ghostCellId;
11915 const MFloat rho_surf = F1B2 * (a_pvariable(cellId, PV->RHO) + a_pvariable(ghostCellId, PV->RHO));
11916 const MFloat p_surf = F1B2 * (a_pvariable(cellId, PV->P) + a_pvariable(ghostCellId, PV->P));
11917 const MFloat T_surf = sysEqn().temperature_ES(rho_surf, p_surf);
11918 const MFloat mue = SUTHERLANDLAW(T_surf);
11919
11920 const MFloat Re0 = sysEqn().m_Re0;
11921
11922 if(m_Ma > 1.3) {
11923 // van Driest transform for compressible flows
11924 const MFloat b = sysEqn().vanDriest(m_Ma);
11925 VII = m_UInfinity / b * asin(b * VII / m_UInfinity);
11926 }
11927
11928 // iteration of spalding wall function
11929 MFloat u_tau = m_bndryCells->a[bndryCellId].m_wmBCVars->m_wmUTAU;
11930 MFloat res = 9999.0;
11931
11932 while(res > 1e-6) {
11933 MFloat eKB = exp(-kappa * B);
11934 MFloat spalding = VII / u_tau
11935 + eKB
11936 * (exp(kappa * VII / u_tau) - 1 - (kappa * VII / u_tau)
11937 - 1.0 / 2.0 * pow(kappa * VII / u_tau, 2) - 1.0 / 6.0 * pow(kappa * VII / u_tau, 3))
11938 - abs(dn_img) * u_tau * (rho_surf / mue) * Re0;
11939 MFloat d_spalding =
11940 -VII / pow(u_tau, 2)
11941 + eKB
11942 * ((-kappa * VII / pow(u_tau, 2)) * exp(kappa * VII / u_tau) + (kappa * VII / u_tau) / u_tau
11943 + pow(kappa * VII / u_tau, 2) / u_tau + 1.0 / 2.0 * pow(kappa * VII / u_tau, 3) / u_tau)
11944 - abs(dn_img) * (rho_surf / mue) * Re0;
11945 MFloat delta = -spalding / d_spalding;
11946 u_tau += delta;
11947 res = abs(delta / u_tau);
11948 m_wmIterator++;
11949 }
11950
11951 tau_wm = rho_surf * pow(u_tau, 2);
11952
11953 m_bndryCells->a[bndryCellId].m_wmBCVars->m_wmUTAU = u_tau;
11954
11955 MFloat tau_w = mue * dVII_dn / Re0;
11956
11957 if(tau_w / tau_wm > m_eps) mue_wm = ((tau_wm / tau_w) - 1.0) * mue;
11958 if(mue_wm > 50.0 * mue) mue_wm = 50.0 * mue; // USE MAX FUNCTION MAYBE?
11959 }
11960
11961 if(m_wmOutput) {
11962 m_bndryCells->a[bndryCellId].m_wmBCVars->m_wmUII = VII;
11963 m_bndryCells->a[bndryCellId].m_wmBCVars->m_wmTauW = tau_wm;
11964 m_bndryCells->a[bndryCellId].m_wmBCVars->m_wmMUEWM = mue_wm;
11965 }
11966
11967 return mue_wm;
11968}

◆ convertPrimitiveRestartVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::convertPrimitiveRestartVariables
virtual
Author
Thomas Schilden

Definition at line 9623 of file fvcartesiansolverxd.cpp.

9623 {
9624 TRACE();
9625
9626 // compute the infinity values for the restart file Mach number (m_previousMa)
9627 const MFloat tInfRestart = sysEqn().temperature_IR(m_previousMa);
9628 const MFloat pInfRestart = sysEqn().pressure_IR(tInfRestart);
9629 const MFloat uInfRestart = m_previousMa * sqrt(tInfRestart);
9630 const MFloat rhoInfRestart = sysEqn().density_IR(tInfRestart);
9631
9632 // compute the infinity values for the Mach number
9633 const MFloat tInf = sysEqn().temperature_IR(m_Ma);
9634 const MFloat pInf = sysEqn().pressure_IR(tInf);
9635 const MFloat uInf = m_Ma * sqrt(tInf);
9636 const MFloat rhoInf = sysEqn().density_IR(tInf);
9637
9638 // set the ratio
9639 const MFloat velRatio = uInf / uInfRestart;
9640 const MFloat densityRatio = rhoInf / rhoInfRestart;
9641 const MFloat pressureRatio = pInf / pInfRestart;
9642
9643 // conversion
9644 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
9645 // compute the velocities
9646 for(MInt i = 0; i < nDim; i++) {
9647 a_pvariable(cellId, PV->VV[i]) *= velRatio;
9648 }
9649
9650 // compute the density
9651 a_pvariable(cellId, PV->RHO) *= densityRatio;
9652
9653 // compute the pressure
9654 a_pvariable(cellId, PV->P) *= pressureRatio;
9655 }
9656}

◆ copyGridProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::copyGridProperties

Definition at line 994 of file fvcartesiansolverxd.cpp.

994 {
995 // a) Copy coordinates from grid-tree to fvcellcollector
996 for(MInt id = 0; id < a_noCells(); ++id) {
998 for(MInt dir = 0; dir < nDim; ++dir) {
999 a_coordinate(id, dir) = c_coordinate(id, dir);
1000 }
1001 }
1002
1003 // b) Copy level from grid-tree to fvcellcollector
1004 for(MInt id = 0; id < a_noCells(); ++id) {
1005 a_level(id) = c_level(id);
1006 }
1007
1008 // c) Initialize Properties
1009 for(MInt c = 0; c < a_noCells(); c++) {
1010 a_isHalo(c) = false;
1011 a_isWindow(c) = false;
1012 a_isPeriodic(c) = false;
1013 }
1014
1015 // d) Set Properties for valid-grid-cells
1016 for(MInt i = 0; i < noNeighborDomains(); i++) {
1017 for(MInt c = 0; c < noHaloCells(i); c++) {
1018 a_isHalo(haloCellId(i, c)) = true;
1019 }
1020 }
1021 // Azimuthal periodicity exchange halos
1022 for(MInt i = 0; i < grid().noAzimuthalNeighborDomains(); i++) {
1023 for(MInt c = 0; c < grid().noAzimuthalHaloCells(i); c++) {
1024 a_isHalo(grid().azimuthalHaloCell(i, c)) = true;
1025 }
1026 }
1027 for(MInt c = 0; c < grid().noAzimuthalUnmappedHaloCells(); c++) {
1028 a_isHalo(grid().azimuthalUnmappedHaloCell(c)) = true;
1029 }
1030
1031 // e) Set Properties for valid-grid-cells
1032 for(MInt i = 0; i < noNeighborDomains(); i++) {
1033 for(MInt c = 0; c < noWindowCells(i); c++) {
1034 a_isWindow(windowCellId(i, c)) = true;
1035 }
1036 }
1037 // Azimuthal periodicity exchange windows
1038 for(MInt i = 0; i < grid().noAzimuthalNeighborDomains(); i++) {
1039 for(MInt c = 0; c < grid().noAzimuthalWindowCells(i); c++) {
1040 a_isWindow(grid().azimuthalWindowCell(i, c)) = true;
1041 }
1042 }
1043
1044 // Inactive can only have halo cells, however noNeighborDomains=-1
1045 if(!isActive()) {
1046 for(MInt c = 0; c < a_noCells(); c++) {
1047 a_isHalo(c) = true;
1048 }
1049 }
1050
1051 for(MInt id = 0; id < a_noCells(); ++id) {
1052 // if (a_hasProperty( id , SolverCell::IsSplitChild )) continue;
1054 a_isPeriodic(id) = grid().isPeriodic(id);
1055 }
1056}
MInt c_level(const MInt cellId) const
Returns the grid level of the cell cellId.
MBool a_isWindow(const MInt cellId) const
Returns IsWindow of the cell cellId.
MInt windowCellId(const MInt domainId, const MInt cellId) const
MInt haloCellId(const MInt domainId, const MInt cellId) const

◆ copyRHSIntoGhostCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::copyRHSIntoGhostCells
virtual

Definition at line 22406 of file fvcartesiansolverxd.cpp.

22406 {
22407 TRACE();
22408
22410}

◆ copyVarsToSmallCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::copyVarsToSmallCells
virtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 12637 of file fvcartesiansolverxd.cpp.

12637 {
12638 TRACE();
12639
12640 m_fvBndryCnd->copyVarsToSmallCells();
12641}

◆ correctBoundarySurfaces()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::correctBoundarySurfaces
virtual

Definition at line 31479 of file fvcartesiansolverxd.cpp.

31479 {
31480 IF_CONSTEXPR(nDim == 2) { mTerm(1, "Only meaningful in 3D."); }
31481 else {
31483 }
31484}
virtual void correctBoundarySurfaces_()

◆ correctBoundarySurfaces_()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::correctBoundarySurfaces_
inlinevirtual

Definition at line 31487 of file fvcartesiansolverxd.cpp.

31487 {
31488 TRACE();
31489
31490 const MInt noCells = a_noCells();
31491 const MInt noBCCells = m_fvBndryCnd->m_bndryCells->size();
31492 const MInt noSurfaces = a_noSurfaces();
31493 const MFloat eps = c_cellLengthAtLevel(maxRefinementLevel()) * 0.00001;
31494 ScratchSpace<MFloat> area(3 * maxNoGridCells(), AT_, "area");
31495 //---
31496
31498
31499 for(MInt bc = 0; bc < noBCCells; bc++) {
31500 const MInt cellId = m_fvBndryCnd->m_bndryCells->a[bc].m_cellId;
31501 for(MInt d = 0; d < nDim; d++) {
31502 area[d * noCells + cellId] = F0;
31503 }
31504 }
31505
31506 for(MInt s = 0; s < noSurfaces; s++) {
31508 area[i * noCells + a_surfaceNghbrCellId(s, 0)] -= a_surfaceArea(s);
31509 area[i * noCells + a_surfaceNghbrCellId(s, 1)] += a_surfaceArea(s);
31510 }
31511
31512 for(MInt bc = 0; bc < noBCCells; bc++) {
31513 if(m_fvBndryCnd->m_bndryCells->a[bc].m_linkedCellId == -1) {
31514 const MInt cellId = m_fvBndryCnd->m_bndryCells->a[bc].m_cellId;
31515
31516 if(a_isHalo(cellId)) continue;
31517
31518 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) continue;
31519
31520 if(c_noChildren(cellId) > 0) continue;
31521
31522 // check whether a refined cell is present
31523 MBool check = false;
31524 for(MInt d = 0; d < m_noDirs; d++) {
31525 if(a_hasNeighbor(cellId, d) > 0) {
31526 if(c_noChildren(c_neighborId(cellId, d)) > 0) {
31527 check = true;
31528 }
31529 }
31530 }
31531 if(check) {
31532 for(MInt d = 0; d < nDim; d++) {
31533 if(ABS(area[d * noCells + cellId]) > eps) {
31534 // correct
31535 MFloat totalArea = F0;
31536 for(MInt dd = 0; dd < nDim; dd++) {
31537 if(m_fvBndryCnd->m_bndryCells->a[bc].m_srfcs[0]->m_normalVector[dd] > F0) {
31538 totalArea += POW2(ABS(m_fvBndryCnd->m_bndryCells->a[bc].m_srfcs[0]->m_normalVector[dd])
31539 * m_fvBndryCnd->m_bndryCells->a[bc].m_srfcs[0]->m_area
31540 + area[dd * noCells + cellId]);
31541 area[dd * noCells + cellId] = ABS(m_fvBndryCnd->m_bndryCells->a[bc].m_srfcs[0]->m_normalVector[dd])
31542 * m_fvBndryCnd->m_bndryCells->a[bc].m_srfcs[0]->m_area
31543 + area[dd * noCells + cellId];
31544 } else {
31545 totalArea += POW2(ABS(m_fvBndryCnd->m_bndryCells->a[bc].m_srfcs[0]->m_normalVector[dd])
31546 * m_fvBndryCnd->m_bndryCells->a[bc].m_srfcs[0]->m_area
31547 - area[dd * noCells + cellId]);
31548 area[dd * noCells + cellId] = -ABS(m_fvBndryCnd->m_bndryCells->a[bc].m_srfcs[0]->m_normalVector[dd])
31549 * m_fvBndryCnd->m_bndryCells->a[bc].m_srfcs[0]->m_area
31550 - area[dd * noCells + cellId];
31551 }
31552 }
31553 // update the surface area and the normal vector
31554 m_fvBndryCnd->m_bndryCells->a[bc].m_srfcs[0]->m_area = sqrt(totalArea);
31555 for(MInt dd = 0; dd < nDim; dd++) {
31556 m_fvBndryCnd->m_bndryCells->a[bc].m_srfcs[0]->m_normalVector[dd] =
31557 area[dd * noCells + cellId] / sqrt(totalArea);
31558 }
31559 break;
31560 }
31561 }
31562 }
31563 }
31564 }
31565}

◆ correctMajorSpeciesMassFraction()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::correctMajorSpeciesMassFraction

Definition at line 896 of file fvcartesiansolverxd.cpp.

896 {
897 const MInt majorSpeciesIndex = sysEqn().m_species->majorSpeciesIndex;
898
899 for(MInt cellId = 0; cellId < a_noCells(); ++cellId) {
900 MFloat massFractionSum = F0;
901 for(MInt s = 0; s < m_noSpecies; ++s) {
902 if(s == majorSpeciesIndex) {
903 continue;
904 }
905 massFractionSum += a_variable(cellId, CV->RHO_Y[s]);
906 }
907 a_variable(cellId, CV->RHO_Y[majorSpeciesIndex]) = a_variable(cellId, CV->RHO) - massFractionSum;
908 }
909}

◆ correctMasterCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::correctMasterCells
virtual
Author
Daniel Hartmann
Date
April 12, 2006

Definition at line 16281 of file fvcartesiansolverxd.cpp.

16281 {
16282 TRACE();
16283
16284 const MInt noSmallCells = m_fvBndryCnd->m_smallBndryCells->size();
16285 const MInt noVarIds = FV->noVariables;
16286 //---
16287
16288#ifdef _OPENMP
16289#pragma omp parallel for collapse(2)
16290#endif
16291 for(MInt s = 0; s < noSmallCells; s++) {
16292 for(MInt varId = 0; varId < noVarIds; varId++) {
16294 a_rightHandSide(m_smallCellIds[s], varId) = F0;
16295 }
16296 }
16297}

◆ crankAngle()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::crankAngle ( const MFloat  elapsedTime,
const MInt  mode 
)
Author
Tim Wegmann

Definition at line 32440 of file fvcartesiansolverxd.cpp.

32440 {
32441 TRACE();
32442
32445
32446 if(initialCad < 0) {
32447 Strouhal = Context::getSolverProperty<MFloat>("Strouhal", m_solverId, AT_, &Strouhal);
32448 initialCad = 0;
32449 initialCad = Context::getSolverProperty<MFloat>("initialCrankAngle", m_solverId, AT_, &initialCad);
32450 }
32451
32452 return maia::math::crankAngle(elapsedTime, Strouhal, initialCad, mode);
32453}
MFloat crankAngle(const MFloat time, const MFloat Strouhal, const MFloat offset, const MInt mode)
help-function for engine calculations which returns the crank-angle for a given time,...
Definition: maiamath.h:506

◆ createBoundaryCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::createBoundaryCells

hull method for cartesiangrid createBoundaryCells(),

Author
Claudia Guenther
Date
05/2012

Definition at line 22423 of file fvcartesiansolverxd.cpp.

22423 {
22424 TRACE();
22425
22426 this->identifyBoundaryCells();
22427
22428 ASSERT(c_noCells() == a_noCells() && a_noCells() == grid().tree().size(),
22429 to_string(c_noCells()) + " " + to_string(a_noCells()) + " " + to_string(grid().tree().size()) + " "
22430 + to_string(m_cells.size()));
22431
22432 // reset a_isInterface if the cell IsInactive (negative Ls-value and no active Corners!)
22433 // and also for nonLeaf-Cells!
22434 // TODO labels:FV why not always reset isInterface for non-leaf cells
22436 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
22437 assertValidGridCellId(cellId);
22438 if(a_isInterface(cellId)) {
22439 if(c_isLeafCell(cellId) && a_hasProperty(cellId, SolverCell::IsInactive)) {
22440 a_isInterface(cellId) = false;
22441 } else if(!c_isLeafCell(cellId)) {
22442 a_isInterface(cellId) = false;
22443 }
22444 }
22445 }
22446 }
22447}

◆ createGridSlice()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::createGridSlice ( const MString direction,
const MFloat  intercept,
const MString fileName,
MInt *const  sliceCellIds 
)
inline

Definition at line 1406 of file fvcartesiansolverxd.h.

1407 {
1408 grid().raw().createGridSlice(direction, intercept, fileName, -1, nullptr, sliceCellIds, nullptr, nullptr);
1409 }

◆ cutOffBoundaryCondition()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::cutOffBoundaryCondition
virtual

Definition at line 14262 of file fvcartesiansolverxd.cpp.

14262 {
14263 TRACE();
14264
14266}

◆ cv_a()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::cv_a ( MInt  cellId) const
noexcept

Computes the speed of sound in the cell cellId from the conservative variables.

Definition at line 21400 of file fvcartesiansolverxd.cpp.

21400 {
21401 return sysEqn().speedOfSound(a_variable(cellId, CV->RHO), cv_p(cellId));
21402}
MFloat cv_p(MInt cellId) const noexcept
Returns the pressure computed from the conservative variables of the cell cellId.

◆ cv_p()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::cv_p ( MInt  cellId) const
noexcept

Computes pressure in the cell cellId from the conservative variables.

Definition at line 21382 of file fvcartesiansolverxd.cpp.

21382 {
21383 IF_CONSTEXPR(!hasE<SysEqn>)
21384 mTerm(1, AT_, "Not compatible with SysEqn without RHO_E!");
21385 MFloat momentumDensitySquare = F0;
21386 for(MInt d = 0; d < nDim; ++d) {
21387 momentumDensitySquare += POW2((a_variable(cellId, CV->RHO_VV[d])));
21388 }
21389 return sysEqn().pressure(a_variable(cellId, CV->RHO), momentumDensitySquare, a_variable(cellId, CV->RHO_E));
21390}

◆ cv_T()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::cv_T ( MInt  cellId) const
noexcept

Computes temperature in the cell cellId from the conservative variables.

Definition at line 21394 of file fvcartesiansolverxd.cpp.

21394 {
21395 return sysEqn().temperature_ES(a_variable(cellId, CV->RHO), cv_p(cellId));
21396}

◆ deleteSrfcs()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::deleteSrfcs

Definition at line 7646 of file fvcartesiansolverxd.cpp.

7646 {
7647 TRACE();
7648
7649 m_surfaces.clear(); // invalidate all elements and set size to 0
7650}
void clear()
Clear tree by invalidating all nodes and setting size to zero.
Definition: container.h:395

◆ determineLESAverageCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::determineLESAverageCells
virtual

Definition at line 38271 of file fvcartesiansolverxd.cpp.

38271 {
38272 TRACE();
38273
38274 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
38275 // find LES cells to be averaged
38276 m_LESAverageCells.clear();
38277
38278 if(!grid().isActive()) return;
38279
38280 if(!m_zonal) {
38281 m_LESNoVarAverage = noVariables() + (nDim - 1) * 3;
38282
38283 MFloat averagePos = m_7901Position;
38284 MInt averageDir = abs(m_7901wallDir + m_7901periodicDir - nDim);
38285 // MInt averageFaceDir = m_7901faceNormalDir;
38286
38287 if(!std::isinf(m_7901Position)) {
38288 // positions to find cells for LES average
38289 m_averagePos.push_back(averagePos);
38290 m_averageDir.push_back(averageDir);
38291 m_averageReconstructNut.push_back(false);
38292 }
38293 }
38294
38295 IF_CONSTEXPR(SysEqn::m_noRansEquations == 0) {
38296 for(MInt p = 0; p < (MInt)m_averagePos.size(); p++) {
38297 MInt noLESAverageCells = 0;
38298 for(MInt cellId = 0; cellId < c_noCells(); cellId++) {
38299 MFloat halfCellLength = grid().halfCellLength(cellId);
38300 MFloat pos = a_coordinate(cellId, m_averageDir[p]);
38301 if(approx(m_averagePos[p], pos, halfCellLength)) {
38302 m_LESAverageCells.push_back(cellId);
38303 noLESAverageCells++;
38304 }
38305 }
38306
38307 // add neignbor for nu_t reconstruction
38309 for(MInt l = 0; l < noLESAverageCells; l++) {
38311 for(MInt nghbr = 0; nghbr < a_noReconstructionNeighbors(cellId); nghbr++) {
38312 const MInt recNghbrId = a_reconstructionNeighborId(cellId, nghbr);
38313
38314 vector<MInt>::iterator findRecNghbrId =
38315 find(m_LESAverageCells.begin(), m_LESAverageCells.end(), recNghbrId);
38316
38317 if(findRecNghbrId == m_LESAverageCells.end()) {
38318 m_LESAverageCells.push_back(recNghbrId);
38319 }
38320 }
38321 }
38322 }
38323
38324 MInt noAvgCellsGlobal = 0;
38325 MInt size = (MInt)m_LESAverageCells.size();
38326 MPI_Allreduce(&size, &noAvgCellsGlobal, 1, MPI_INT, MPI_SUM, mpiComm(), AT_, "size", "noAvgCellsGlobal");
38327
38328 if(domainId() == 0) {
38329 cerr << "m_noLESAverageCells: " << noAvgCellsGlobal << endl;
38330 }
38331 }
38332 }
38333}
std::vector< MInt > m_averageDir
std::vector< MFloat > m_averagePos

◆ determineRestartTimeStep()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::determineRestartTimeStep
overridevirtual

Load the restart time step from the restart file (useNonSpecifiedRestartFile enabled)

Reimplemented from Solver.

Definition at line 8538 of file fvcartesiansolverxd.cpp.

8538 {
8539 TRACE();
8540 using namespace maia::parallel_io;
8541
8543 mTerm(1, "determineRestartTimeStep should only be used with useNonSpecifiedRestartFile enabled!");
8544 }
8545
8546 std::stringstream varFileName;
8547 if(!m_multipleFvSolver) {
8548 varFileName << restartDir() << "restartVariables" << ParallelIo::fileExt();
8549 } else {
8550 varFileName << restartDir() << "restartVariables" << m_solverId << "_" << ParallelIo::fileExt();
8551 }
8552 ParallelIo parallelIo(varFileName.str(), PIO_READ, MPI_COMM_SELF);
8553 MInt timeStep = -1;
8554 parallelIo.getAttribute(&timeStep, "globalTimeStep");
8555 return timeStep;
8556}
MBool m_useNonSpecifiedRestartFile
Definition: solver.h:83
MString restartDir() const
Return the directory for restart files.
Definition: solver.h:410
PARALLELIO_DEFAULT_BACKEND ParallelIo
Definition: parallelio.h:292

◆ determineStructuredCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::determineStructuredCells
protected

Definition at line 7993 of file fvcartesiansolverxd.cpp.

7993 {
7994 TRACE();
7995 const MInt noCells = a_noCells();
7996 MBoolScratchSpace atBnd(noCells, AT_, "atBnd");
7997 MBoolScratchSpace nearBnd(noCells, AT_, "nearBnd");
7998 atBnd.fill(false);
7999 nearBnd.fill(false);
8000 // std::vector< std::vector<MInt> > structuredCells( maxLevel()-minLevel()+1 );
8001 // std::vector<MInt> nearBoundaryCells;
8002
8003 for(MInt level = minLevel(); level <= maxLevel(); level++) {
8004 // structuredCells[level-minLevel()].clear();
8005 }
8006 for(MInt level = minLevel(); level < maxRefinementLevel(); level++) {
8007 // centralDiffConst[level] = F1 / ( F2*c_cellLengthAtLevel(level) );
8008 }
8009 for(MInt cellId = 0; cellId < noCells; cellId++) {
8010 a_hasProperty(cellId, SolverCell::AtStructuredRegion) = false;
8011 }
8012 for(MInt bndryId = 0; bndryId < m_bndryCells->size(); bndryId++) {
8013 MInt cellId = m_bndryCells->a[bndryId].m_cellId;
8014 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) continue;
8015 atBnd(cellId) = true;
8016 MInt parentId = a_hasProperty(cellId, SolverCell::IsSplitChild) ? c_parentId(getAssociatedInternalCell(cellId))
8017 : c_parentId(cellId);
8018 while(parentId > -1) {
8019 atBnd(parentId) = true;
8020 parentId = c_parentId(parentId);
8021 }
8022 }
8023 for(MInt cellId = 0; cellId < noCells; cellId++) {
8024 if(a_bndryId(cellId) < -1) continue;
8025 if(a_hasProperty(cellId, SolverCell::IsCutOff)) continue;
8026 if(a_hasProperty(cellId, SolverCell::IsNotGradient)) continue;
8027 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) continue;
8028 //---
8029 if(atBnd(cellId)) {
8030 // nearBoundaryCells.push_back( cellId );
8031 nearBnd(cellId) = true;
8032 continue;
8033 }
8034 MBool nearb = false;
8035 a_hasProperty(cellId, SolverCell::AtStructuredRegion) = true;
8036 for(MInt dir = 0; dir < m_noDirs; dir++) {
8037 if(!a_hasNeighbor(cellId, dir)) {
8038 a_hasProperty(cellId, SolverCell::AtStructuredRegion) = false;
8039 MInt parentId = c_parentId(cellId);
8040 while(parentId > -1) {
8041 if(a_hasNeighbor(parentId, dir)) {
8042 if(atBnd(c_neighborId(parentId, dir))) {
8043 nearb = true;
8044 }
8045 break;
8046 }
8047 parentId = c_parentId(parentId);
8048 }
8049 } else if(atBnd(c_neighborId(cellId, dir))) {
8050 a_hasProperty(cellId, SolverCell::AtStructuredRegion) = false;
8051 nearb = true;
8052 break;
8053 }
8054 }
8055 if(nearb) {
8056 // nearBoundaryCells.push_back( cellId );
8057 nearBnd(cellId) = true;
8058 continue;
8059 }
8060 if(a_hasProperty(cellId, SolverCell::AtStructuredRegion)) {
8061 // structuredCells[ a_level(cellId) - minLevel() ].push_back( cellId );
8062 } else {
8063 MInt parentId = c_parentId(cellId);
8064 if(parentId > -1) {
8065 if(!a_hasProperty(parentId, SolverCell::AtStructuredRegion)) {
8066 a_hasProperty(parentId, SolverCell::AtStructuredRegion) = true;
8067 for(MInt dir = 0; dir < m_noDirs; dir++) {
8068 if(!a_hasNeighbor(parentId, dir)) {
8069 a_hasProperty(parentId, SolverCell::AtStructuredRegion) = false;
8070 break;
8071 }
8072 }
8073 if(a_hasProperty(parentId, SolverCell::AtStructuredRegion)) {
8074 // structuredCells[ a_level(parentId) - minLevel() ].push_back( parentId );
8075 } else {
8076 mTerm(1, "strange grid configuration (1).");
8077 }
8078 }
8079 } else {
8080 cerr << c_globalId(cellId) << " " << a_hasProperty(cellId, Cell::IsHalo) << endl;
8081 mTerm(1, "strange grid configuration (2).");
8082 }
8083 }
8084 }
8085}

◆ distributeFluxToCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::distributeFluxToCells
virtual

NOTE: this is an inner-most loop of MAIA Don't modify it unless you REALLY know what you are doing.

Definition at line 19938 of file fvcartesiansolverxd.cpp.

19938 {
19939 const MUint noFVars = FV->noVariables;
19940 const MInt* const RESTRICT nghbrCellIds = ALIGNED_I(&a_surfaceNghbrCellId(0, 0));
19941 const MFloat* const RESTRICT fluxes = ALIGNED_F(&a_surfaceFlux(0, 0));
19942 MFloat* const RESTRICT rhs = ALIGNED_MF(&a_rightHandSide(0, 0));
19943
19944 // Loop is not OpenMP parallelizable!
19945 for(MUint srfcId = 0; srfcId < static_cast<MUint>(a_noSurfaces()); ++srfcId) {
19946 const MUint offset0 = nghbrCellIds[srfcId * 2] * noFVars;
19947 const MUint offset1 = nghbrCellIds[srfcId * 2 + 1] * noFVars;
19948 const MUint fluxOffset = srfcId * noFVars;
19949 const MFloat* const RESTRICT flux = ALIGNED_F(fluxes + fluxOffset);
19950 for(MUint var = 0; var < noFVars; ++var) {
19951 rhs[offset0 + var] += flux[var];
19952 rhs[offset1 + var] -= flux[var];
19953 }
19954 }
19955 // for E-E multiphase, the pressure term was collected seperately and has to be applied now
19956 IF_CONSTEXPR(isEEGas<SysEqn>) {
19957 const MUint noCells = a_noCells();
19958#ifdef _OPENMP
19959#pragma omp parallel for
19960#endif
19961 for(MUint cellId = 0; cellId < noCells; ++cellId) {
19962 const MFloat alpha = a_alphaGas(cellId);
19963 for(MUint i = 0; i < nDim; i++) {
19964 rhs[cellId * noFVars + CV->A_RHO_VV[i]] += rhs[cellId * noFVars + FV->P_RHO_VV[i]] * alpha;
19965 }
19966 }
19967 }
19968}
MFloat a_alphaGas(const MInt cellId) const

◆ divCheck()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::divCheck ( MInt  x)

Definition at line 12890 of file fvcartesiansolverxd.cpp.

12890 {
12891 MBool solutionDiverged = false;
12892 const MInt noCVars = CV->noVariables;
12893
12894 for(MInt i = 0; i < noNeighborDomains(); i++) {
12895 if(m_fvBndryCnd->m_nearBoundaryHaloCells[i].empty()) {
12896 continue;
12897 }
12898 for(MUint j = 0; j < m_fvBndryCnd->m_nearBoundaryHaloCells[i].size(); j++) {
12900 const MInt rootId =
12901 (a_hasProperty(cellId, SolverCell::IsSplitChild)) ? getAssociatedInternalCell(cellId) : cellId;
12902 IF_CONSTEXPR(!isEEGas<SysEqn>) {
12903 for(MInt v = 0; v < noCVars; v++) {
12904 if(!(a_variable(cellId, v) >= F0 || a_variable(cellId, v) < F0) || std::isnan(a_variable(cellId, v))) {
12905 cerr << domainId() << ": EXC1 " << i << " " << j << " " << c_globalId(cellId) << " " << a_bndryId(cellId)
12906 << " " << a_level(cellId) << " /v " << a_cellVolume(cellId) / grid().gridCellVolume(a_level(rootId))
12907 << " "
12908 << (a_bndryId(cellId) > -1 ? m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_volume
12909 / grid().gridCellVolume(a_level(rootId))
12910 : 99999)
12911 << " " << v << " " << a_variable(cellId, v) << " " << a_coordinate(cellId, 0) << " "
12912 << a_coordinate(cellId, 1) << " " << a_coordinate(cellId, nDim - 1) << " "
12913 << a_hasProperty(cellId, SolverCell::IsSplitChild) << " "
12914 << a_hasProperty(cellId, SolverCell::IsSplitCell) << endl;
12915 solutionDiverged = true;
12916 }
12917 }
12918 }
12919 if(a_cellVolume(cellId) / grid().gridCellVolume(a_level(cellId)) > m_fvBndryCnd->m_volumeLimitWall) {
12920 setPrimitiveVariables(cellId);
12921 if(a_pvariable(cellId, PV->RHO) < F0 || a_pvariable(cellId, PV->P) < F0) {
12922 cerr << domainId() << ": EXC1 " << i << " " << j << " " << c_globalId(cellId) << " " << a_bndryId(cellId)
12923 << " " << a_level(cellId) << " /r " << a_pvariable(cellId, PV->RHO) << " /p "
12924 << a_pvariable(cellId, PV->P) << " /v " << a_cellVolume(cellId) / grid().gridCellVolume(a_level(rootId))
12925 << " "
12926 << (a_bndryId(cellId) > -1 ? m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_volume
12927 / grid().gridCellVolume(a_level(rootId))
12928 : 99999)
12929 << " " << a_coordinate(cellId, 0) << " " << a_coordinate(cellId, 1) << " "
12930 << a_coordinate(cellId, nDim - 1) << " " << a_hasProperty(cellId, SolverCell::IsSplitChild) << " "
12931 << a_hasProperty(cellId, SolverCell::IsSplitCell) << endl;
12932 cerr << " vel " << a_pvariable(cellId, PV->VV[0]) << " " << a_pvariable(cellId, PV->VV[1]) << " "
12933 << a_pvariable(cellId, PV->VV[nDim - 1]) << endl;
12934 solutionDiverged = true;
12935 }
12936 }
12937 }
12938 }
12939
12940 if(grid().azimuthalPeriodicity()) {
12941 for(MInt i = 0; i < grid().noAzimuthalNeighborDomains(); i++) {
12943 continue;
12944 }
12945 for(MUint j = 0; j < m_fvBndryCnd->m_azimuthalNearBoundaryHaloCells[i].size(); j++) {
12947 const MInt rootId =
12948 (a_hasProperty(cellId, SolverCell::IsSplitChild)) ? getAssociatedInternalCell(cellId) : cellId;
12949 for(MInt v = 0; v < noCVars; v++) {
12950 if(!(a_variable(cellId, v) >= F0 || a_variable(cellId, v) < F0) || std::isnan(a_variable(cellId, v))) {
12951 cerr << domainId() << ": EXC1 Azi " << i << " " << j << " " << c_globalId(cellId) << " "
12952 << a_bndryId(cellId) << " " << a_level(cellId) << " /v "
12953 << a_cellVolume(cellId) / grid().gridCellVolume(a_level(rootId)) << " "
12954 << (a_bndryId(cellId) > -1 ? m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_volume
12955 / grid().gridCellVolume(a_level(rootId))
12956 : 99999)
12957 << " " << v << " " << a_variable(cellId, v) << " " << a_coordinate(cellId, 0) << " "
12958 << a_coordinate(cellId, 1) << " " << a_coordinate(cellId, nDim - 1) << " "
12959 << a_hasProperty(cellId, SolverCell::IsSplitChild) << " "
12960 << a_hasProperty(cellId, SolverCell::IsSplitCell) << endl;
12961 solutionDiverged = true;
12962 }
12963 }
12964 if(a_cellVolume(cellId) / grid().gridCellVolume(a_level(cellId)) > m_fvBndryCnd->m_volumeLimitWall) {
12965 setPrimitiveVariables(cellId);
12966 if(a_pvariable(cellId, m_sysEqn.PV->RHO) < F0 || a_pvariable(cellId, m_sysEqn.PV->P) < F0) {
12967 cerr << domainId() << ": EXC1 Azi " << i << " " << j << " " << c_globalId(cellId) << " "
12968 << a_bndryId(cellId) << " " << a_level(cellId) << " /r " << a_pvariable(cellId, m_sysEqn.PV->RHO)
12969 << " /p " << a_pvariable(cellId, m_sysEqn.PV->P) << " /v "
12970 << a_cellVolume(cellId) / grid().gridCellVolume(a_level(rootId)) << " "
12971 << (a_bndryId(cellId) > -1 ? m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_volume
12972 / grid().gridCellVolume(a_level(rootId))
12973 : 99999)
12974 << " " << a_coordinate(cellId, 0) << " " << a_coordinate(cellId, 1) << " "
12975 << a_coordinate(cellId, nDim - 1) << " " << a_hasProperty(cellId, SolverCell::IsSplitChild) << " "
12976 << a_hasProperty(cellId, SolverCell::IsSplitCell) << endl;
12977 cerr << " vel " << a_pvariable(cellId, m_sysEqn.PV->VV[0]) << " " << a_pvariable(cellId, m_sysEqn.PV->VV[1])
12978 << " " << a_pvariable(cellId, m_sysEqn.PV->VV[nDim - 1]) << endl;
12979 solutionDiverged = true;
12980 }
12981 }
12982 }
12983 }
12984 }
12985 if(solutionDiverged) {
12986 cerr << "Solution diverged (BEXC" << x << ") at solver " << domainId() << " " << globalTimeStep << " " << m_RKStep
12987 << endl;
12988 }
12989 if(noDomains() > 1) {
12990 // Convert data to MInt before MPI call and copy back afterwards
12991 MInt tmp = solutionDiverged;
12992 MPI_Allreduce(MPI_IN_PLACE, &tmp, 1, MPI_INT, MPI_MAX, mpiComm(), AT_, "MPI_IN_PLACE", "tmp");
12993 solutionDiverged = tmp;
12994 }
12995 if(solutionDiverged) {
12997 MPI_Barrier(mpiComm(), AT_);
12998 mTerm(1, AT_, "Solution diverged after near boundary exchange.");
12999 }
13000}
std::vector< std::vector< MInt > > m_azimuthalNearBoundaryHaloCells
void saveSolverSolution(const MBool forceOutput=false, const MBool finalTimeStep=false) override
Manages solver-specific output.
int MPI_Barrier(MPI_Comm comm, const MString &name)
same as MPI_Barrier

◆ dqdtau()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::dqdtau
virtual

Computes additional RHS from the physical time derivative (dual time stepping)

Author
Daniel Hartmann, 23.08.2006

Definition at line 21348 of file fvcartesiansolverxd.cpp.

21348 {
21349 TRACE();
21350
21351 MBool cellOk;
21352 MFloat dt;
21353 const MFloat F4B2 = 2.0;
21354
21355
21356 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
21357 // multilevel
21358 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
21359 if(!a_isBndryGhostCell(cellId)) {
21360 cellOk = true;
21361 if(a_bndryId(cellId) > -1) {
21362 if(m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_linkedCellId != -1) {
21363 cellOk = false;
21364 }
21365 }
21366 if(cellOk) {
21367 dt = a_cellVolume(cellId) / m_physicalTimeStep;
21368
21369 for(MInt varId = 0; varId < CV->noVariables; varId++) {
21370 a_rightHandSide(cellId, varId) += (F3B2 * a_variable(cellId, varId) - F4B2 * a_dt1Variable(cellId, varId)
21371 + F1B2 * a_dt2Variable(cellId, varId))
21372 * dt;
21373 }
21374 }
21375 }
21376 }
21377 }
21378}
MFloat & a_dt1Variable(const MInt cellId, const MInt varId)
Returns dt1Variables of the cell CellId variables varId.
MFloat & a_dt2Variable(const MInt cellId, const MInt varId)
Returns dt2Variables of the cell CellId variables varId.

◆ dumpCellData()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::dumpCellData ( const MString  name)

Definition at line 35560 of file fvcartesiansolverxd.cpp.

35560 {
35561 std::ofstream logfile;
35562 logfile.open(name + "_" + std::to_string(domainId()));
35563
35564 // All cells
35565 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
35566 logfile << cellId << " g" << c_globalId(cellId);
35567 logfile << " " << a_properties(cellId);
35568 logfile << " bnd" << a_bndryId(cellId) << std::endl;
35569 }
35570 logfile << std::endl;
35571
35572 // Bndry cells
35573 const MInt noBndryCells = m_bndryCells->size();
35574 for(MInt bndryId = 0; bndryId < noBndryCells; bndryId++) {
35575 MInt cellId = m_bndryCells->a[bndryId].m_cellId;
35576
35577 logfile << "b" << bndryId << " g" << c_globalId(cellId) << " " << cellId << " " << a_bndryId(cellId) << " leaf"
35578 << c_isLeafCell(cellId) << " halo" << a_isHalo(cellId) << " " << a_properties(cellId) << std::endl;
35579 }
35580}
maia::fv::cell::BitsetType & a_properties(const MInt cellId)
Returns properties of the cell cellId.

◆ entropy()

template<MInt nDim_, class SysEqn >
virtual MFloat FvCartesianSolverXD< nDim_, SysEqn >::entropy ( MInt  cellId)
inlineprotectedvirtual

Definition at line 2214 of file fvcartesiansolverxd.h.

2214 {
2215 return sysEqn().entropy(a_pvariable(cellId, PV->P), a_pvariable(cellId, PV->RHO));
2216 }

◆ exchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::exchange
virtual

Definition at line 6368 of file fvcartesiansolverxd.cpp.

6368 {
6369 TRACE();
6370
6371 RECORD_TIMER_START(m_tcomm);
6372 RECORD_TIMER_START(m_texchange);
6373
6374 // periodic exchange is included in normal window and halo cell exchange, quasi periodic exchange is not yet applied
6375 if(!m_nonBlockingComm) {
6376 gather<false>();
6377 send();
6378 receive();
6379 scatter<false>();
6380
6381 } else {
6382 if(grid().azimuthalPeriodicity()) {
6383 mTerm(1, AT_, "non blocking comm is not implemented for azimuthal periodicity");
6384 }
6387 }
6388
6389 if(grid().azimuthalPeriodicity()) {
6390 exchangeFloatDataAzimuthal<false>(&a_pvariable(0, 0), PV->noVariables, m_rotIndVarsPV);
6391 }
6392 RECORD_TIMER_STOP(m_texchange);
6393 RECORD_TIMER_STOP(m_tcomm);
6394
6395 if(m_wmLES && m_RKStep == m_noRKSteps - 1) {
6396 RECORD_TIMER_START(m_timers[Timers::WMExchange]);
6398 RECORD_TIMER_STOP(m_timers[Timers::WMExchange]);
6399 }
6400
6401 // DISPLAY_TIMER_OFFSET(m_tcomm, m_restartInterval);
6402}
void send(const MBool exchangeAll=false)
Send window cell data to corresponding neighbors.
void startMpiExchange()
Begin non-blocking communication by posting new send requests.
void finishMpiExchange()
Finish non-blocking communication by waiting for receive requests.
std::vector< MInt > m_rotIndVarsPV
void receive(const MBool exchangeAll=false)
Receive halo cell data from corresponding neighbors.

◆ exchangeAll()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::exchangeAll

Definition at line 6344 of file fvcartesiansolverxd.cpp.

6344 {
6345 TRACE();
6346
6347 RECORD_TIMER_START(m_tcomm);
6348 RECORD_TIMER_START(m_texchange);
6349
6350 gather<true>();
6351 send(true);
6352 receive(true);
6353 scatter<true>();
6354
6355 if(grid().azimuthalPeriodicity()) {
6357 }
6358
6359
6360 RECORD_TIMER_STOP(m_texchange);
6361 RECORD_TIMER_STOP(m_tcomm);
6362}
void exchangeFloatDataAzimuthal(MFloat *data, MInt noVars, const std::vector< MInt > &rotIndices)

◆ exchangeAzimuthalRemappedHaloCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::exchangeAzimuthalRemappedHaloCells ( )

◆ exchangeDataAzimuthal()

template<MInt nDim_, class SysEqn >
template<typename T >
void FvCartesianSolverXD< nDim_, SysEqn >::exchangeDataAzimuthal ( T *  data,
const MInt  dataBlockSize = 1 
)

◆ exchangeDataFV()

template<MInt nDim_, class SysEqn >
template<typename T >
void FvCartesianSolverXD< nDim_, SysEqn >::exchangeDataFV ( T *  data,
const MInt  blockSize = 1,
MBool  cartesian = true,
const std::vector< MInt > &  rotIndex = std::vector< MInt >() 
)

◆ exchangeExternalSources()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::exchangeExternalSources
Author
Sven Berger
Date
April 2018

Definition at line 9663 of file fvcartesiansolverxd.cpp.

9663 {
9664 TRACE();
9665
9666 ASSERT(m_hasExternalSource, "");
9667
9668 // exchange all external sources
9669 if(noDomains() > 1) {
9670 maia::mpi::reverseExchangeAddData(grid().neighborDomains(), grid().haloCells(), grid().windowCells(), mpiComm(),
9671 m_externalSource, CV->noVariables);
9672 }
9673
9674
9675 MBool filter = false;
9676 // TODO labels:FV,totest check filter function!
9677 if(filter) {
9678 grid().smoothFilter(maxRefinementLevel() - 1, m_externalSource);
9679 }
9680}
void reverseExchangeAddData(const std::vector< MInt > &nghbrDomains, const std::vector< std::vector< MInt > > &haloCellVec, const std::vector< std::vector< MInt > > &windowCellVec, const MPI_Comm comm, U **const data, const MInt noDat=1)
Generic exchange from halo to window cells, however in this case the value in the halo-cell is added ...
Definition: mpiexchange.h:1205

◆ exchangeFloatDataAzimuthal()

template<MInt nDim_, class SysEqn >
template<MBool exchangeAll_ = true>
void FvCartesianSolverXD< nDim_, SysEqn >::exchangeFloatDataAzimuthal ( MFloat data,
MInt  noVars,
const std::vector< MInt > &  rotIndices 
)

◆ exchangeGapInfo()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::exchangeGapInfo
Author
Tim Wegmann

Definition at line 25010 of file fvcartesiansolverxd.cpp.

25010 {
25011 TRACE();
25012
25013 MIntScratchSpace Gap(a_noCells(), 2, AT_, "Gap");
25014
25015 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
25016 Gap(cellId, 0) = (MInt)a_isGapCell(cellId);
25017 Gap(cellId, 1) = (MInt)a_wasGapCell(cellId);
25018 }
25019
25020 exchangeDataFV(&Gap(0, 0), 2);
25021
25022 for(MInt cellId = noInternalCells(); cellId < a_noCells(); cellId++) {
25023 a_isGapCell(cellId) = (MBool)Gap(cellId, 0);
25024 a_wasGapCell(cellId) = (MBool)Gap(cellId, 1);
25025 }
25026}
MBool a_isGapCell(const MInt cellId) const
Returns isGapCell of the cell cellId.
maia::fv::cell::BitsetType::reference a_wasGapCell(const MInt cellId)
Returns wasGapCell of the cell cellId.

◆ exchangePeriodic()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::exchangePeriodic
virtual

\exchanges PV at periodic bc (azimuthal periodicity concept)

Author
Alexej Pogorelov, Sven Berger TODO labels:FV move the periodicCells into the cartesain grid and treat just as halo-cells

Definition at line 6612 of file fvcartesiansolverxd.cpp.

6612 {
6613 if(m_periodicCells > 0 && m_periodicCells != 3) {
6614 // init
6615 MFloat v_comp = 0;
6616 MFloat w_comp = 0;
6617 MFloat rot_times = 0;
6618 MInt n_Id = -1;
6619 MInt off_ = 0;
6620
6621 if(m_periodicCells == 1) {
6622 for(MInt d = 0; d < noDomains(); d++) {
6623 // No OMP possible here because off_ needs to be sequentially increased...
6624 for(MInt c = 0; c < m_noPerCellsToSend[d]; c++) {
6625 const auto sortedId = static_cast<MInt>(m_periodicDataToSend[d][5 + c * m_noPeriodicData]);
6626
6627 v_comp = F0;
6628 w_comp = F0;
6629 m_periodicDataToSend[d][0 + c * m_noPeriodicData] = F0;
6630 m_periodicDataToSend[d][1 + c * m_noPeriodicData] = F0;
6631 m_periodicDataToSend[d][2 + c * m_noPeriodicData] = F0;
6632 m_periodicDataToSend[d][3 + c * m_noPeriodicData] = F0;
6633 m_periodicDataToSend[d][4 + c * m_noPeriodicData] = F0;
6634
6635 // LS interpolation
6636 MInt noNeighboursRec =
6637 (m_reconstructionDataPeriodic[off_ + c + 1] - m_reconstructionDataPeriodic[off_ + c]) / 2;
6638 for(MInt n = (m_reconstructionDataPeriodic[off_ + c] + noNeighboursRec);
6639 n < m_reconstructionDataPeriodic[off_ + c + 1];
6640 n++) {
6641 n_Id = static_cast<MInt>(m_reconstructionConstantsPeriodic[n - noNeighboursRec]);
6642
6643 v_comp += m_reconstructionConstantsPeriodic[n] * a_pvariable(n_Id, PV->VV[1]);
6644 w_comp += m_reconstructionConstantsPeriodic[n] * a_pvariable(n_Id, PV->VV[2]);
6645
6652 }
6653
6654
6655 if(m_periodicCellDataDom[d][4 + sortedId * m_noPeriodicCellData] < 0.0) // left Cells ..rotate anticlockwise
6656 {
6657 rot_times = -m_periodicCellDataDom[d][4 + sortedId * m_noPeriodicCellData];
6659 cos(72.0 / 180.0 * PI * rot_times) * v_comp + sin(72.0 / 180.0 * PI * rot_times) * w_comp;
6661 -sin(72.0 / 180.0 * PI * rot_times) * v_comp + cos(72.0 / 180.0 * PI * rot_times) * w_comp;
6662 } else { // right cells ..rotate clockwise
6663 rot_times = m_periodicCellDataDom[d][4 + sortedId * m_noPeriodicCellData];
6665 cos(72.0 / 180.0 * PI * rot_times) * v_comp - sin(72.0 / 180.0 * PI * rot_times) * w_comp;
6667 sin(72.0 / 180.0 * PI * rot_times) * v_comp + cos(72.0 / 180.0 * PI * rot_times) * w_comp;
6668 }
6669 }
6670 off_ += m_noPerCellsToSend[d];
6671 }
6672 } else if(m_periodicCells == 2) {
6673 for(MInt d = 0; d < noDomains(); d++) {
6674 for(MInt c = 0; c < m_noPerCellsToSend[d]; c++) {
6675 const auto cell_Id = static_cast<MInt>(m_periodicDataToSend[d][6 + c * m_noPeriodicData]);
6676
6677 m_periodicDataToSend[d][0 + c * m_noPeriodicData] = a_pvariable(cell_Id, PV->RHO);
6678 m_periodicDataToSend[d][1 + c * m_noPeriodicData] = a_pvariable(cell_Id, PV->U);
6679 m_periodicDataToSend[d][2 + c * m_noPeriodicData] = a_pvariable(cell_Id, PV->V);
6680 m_periodicDataToSend[d][3 + c * m_noPeriodicData] = a_pvariable(cell_Id, PV->W);
6681 m_periodicDataToSend[d][4 + c * m_noPeriodicData] = a_pvariable(cell_Id, PV->P);
6682 }
6683 }
6684 }
6685
6686 // set Data for current domain
6687 for(MInt c = 0; c < m_noPerCellsToSend[domainId()]; c++) {
6688 for(MInt v = 0; v < 7; v++) {
6691 }
6692 }
6693
6694
6695 // exchange interpolated PV Variables
6696 ScratchSpace<MPI_Request> send_Req(noDomains(), AT_, "sendReq");
6697 ScratchSpace<MPI_Request> recv_Req(noDomains(), AT_, "recvReq");
6698 send_Req.fill(MPI_REQUEST_NULL);
6699 recv_Req.fill(MPI_REQUEST_NULL);
6700
6701
6702 for(MInt snd = 0; snd < domainId(); snd++) {
6703 if(m_noPerCellsToReceive[snd] > 0) {
6705 MPI_Irecv(m_periodicDataToReceive[snd], bufSize, MPI_DOUBLE, snd, 0, mpiComm(), &recv_Req[snd], AT_,
6706 "m_periodicDataToReceive[snd]");
6707 }
6708 }
6709
6710 for(MInt rcv = 0; rcv < noDomains(); rcv++) {
6711 if(m_noPerCellsToSend[rcv] > 0 && rcv != domainId()) {
6712 MInt bufSize = m_noPerCellsToSend[rcv] * m_noPeriodicData;
6713 MPI_Isend(m_periodicDataToSend[rcv], bufSize, MPI_DOUBLE, rcv, 0, mpiComm(), &send_Req[rcv], AT_,
6714 "m_periodicDataToSend[rcv]");
6715 }
6716 }
6717
6718 if(domainId() < noDomains() - 1) {
6719 for(MInt snd = domainId() + 1; snd < noDomains(); snd++) {
6720 if(m_noPerCellsToReceive[snd] > 0) {
6722 MPI_Irecv(m_periodicDataToReceive[snd], bufSize, MPI_DOUBLE, snd, 0, mpiComm(), &recv_Req[snd], AT_,
6723 "m_periodicDataToReceive[snd]");
6724 }
6725 }
6726 }
6727
6728
6729 MPI_Waitall(noDomains(), &recv_Req[0], MPI_STATUSES_IGNORE, AT_);
6730 MPI_Waitall(noDomains(), &send_Req[0], MPI_STATUSES_IGNORE, AT_);
6731
6732
6733 for(MInt d = 0; d < noDomains(); d++) {
6734 for(MInt c = 0; c < m_noPerCellsToReceive[d]; c++) {
6735 const auto sortedId = static_cast<MInt>(m_periodicDataToReceive[d][5 + c * m_noPeriodicData]);
6736 const MInt cell_Id = m_sortedPeriodicCells->a[sortedId];
6737
6738 a_pvariable(cell_Id, PV->RHO) = m_periodicDataToReceive[d][0 + c * m_noPeriodicData];
6739 a_pvariable(cell_Id, PV->U) = m_periodicDataToReceive[d][1 + c * m_noPeriodicData];
6740 a_pvariable(cell_Id, PV->V) = m_periodicDataToReceive[d][2 + c * m_noPeriodicData];
6741 a_pvariable(cell_Id, PV->W) = m_periodicDataToReceive[d][3 + c * m_noPeriodicData];
6742 a_pvariable(cell_Id, PV->P) = m_periodicDataToReceive[d][4 + c * m_noPeriodicData];
6743 }
6744 }
6746 }
6747
6748 if(m_periodicCells == 3) {
6749 exchangePipe(); // volume forcing for periodic pipe
6750 }
6751}
virtual void computeConservativeVariables()
Dispatches the computation of the conservative variables for different number of species.
List< MInt > * m_sortedPeriodicCells
int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request, const MString &name, const MString &varname)
same as MPI_Isend
int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request, const MString &name, const MString &varname)
same as MPI_Irecv
T cos(const T a, const T b, const T x)
Cosine slope filter.
Definition: filter.h:125

◆ exchangePipe()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::exchangePipe

\exchanges PV for periodic pipe with volume forcing

Author
Alexej Pogorelov, Sven Berger TODO labels:FV move the periodicCells into the cartesain grid and treat just as halo-cells!

Definition at line 6760 of file fvcartesiansolverxd.cpp.

6760 {
6761 for(MInt d = 0; d < noDomains(); d++) {
6762 for(MInt c = 0; c < m_noPerCellsToSend[d]; c++) {
6763 const auto cell_Id = static_cast<MInt>(m_periodicDataToSend[d][6 + c * m_noPeriodicData]);
6764
6765 m_periodicDataToSend[d][0 + c * m_noPeriodicData] = a_pvariable(cell_Id, PV->RHO);
6766 m_periodicDataToSend[d][1 + c * m_noPeriodicData] = a_pvariable(cell_Id, PV->U);
6767 m_periodicDataToSend[d][2 + c * m_noPeriodicData] = a_pvariable(cell_Id, PV->V);
6768 m_periodicDataToSend[d][3 + c * m_noPeriodicData] = a_pvariable(cell_Id, PV->W);
6769 m_periodicDataToSend[d][4 + c * m_noPeriodicData] = a_pvariable(cell_Id, PV->P);
6770 }
6771 }
6772
6773 // set Data for current domain
6774 for(MInt c = 0; c < m_noPerCellsToSend[domainId()]; c++) {
6775 for(MInt v = 0; v < 7; v++) {
6777 }
6778 }
6779
6780 // exchange interpolated PV Variables
6781 ScratchSpace<MPI_Request> send_Req(noDomains(), AT_, "sendReq");
6782 ScratchSpace<MPI_Request> recv_Req(noDomains(), AT_, "recvReq");
6783 send_Req.fill(MPI_REQUEST_NULL);
6784 recv_Req.fill(MPI_REQUEST_NULL);
6785
6786
6787 // MPI_Status status;
6788
6789 for(MInt snd = 0; snd < domainId(); snd++) {
6790 if(m_noPerCellsToReceive[snd] > 0) {
6792 MPI_Irecv(m_periodicDataToReceive[snd], bufSize, MPI_DOUBLE, snd, 0, mpiComm(), &recv_Req[snd], AT_,
6793 "m_periodicDataToReceive[snd]");
6794 }
6795 }
6796
6797 for(MInt rcv = 0; rcv < noDomains(); rcv++) {
6798 if(m_noPerCellsToSend[rcv] > 0 && rcv != domainId()) {
6799 MInt bufSize = m_noPerCellsToSend[rcv] * m_noPeriodicData;
6800 MPI_Isend(m_periodicDataToSend[rcv], bufSize, MPI_DOUBLE, rcv, 0, mpiComm(), &send_Req[rcv], AT_,
6801 "m_periodicDataToSend[rcv]");
6802 }
6803 }
6804
6805 if(domainId() < noDomains() - 1) {
6806 for(MInt snd = domainId() + 1; snd < noDomains(); snd++) {
6807 if(m_noPerCellsToReceive[snd] > 0) {
6809 MPI_Irecv(m_periodicDataToReceive[snd], bufSize, MPI_DOUBLE, snd, 0, mpiComm(), &recv_Req[snd], AT_,
6810 "m_periodicDataToReceive[snd]");
6811 }
6812 }
6813 }
6814
6815 MPI_Waitall(noDomains(), &recv_Req[0], MPI_STATUSES_IGNORE, AT_);
6816 MPI_Waitall(noDomains(), &send_Req[0], MPI_STATUSES_IGNORE, AT_);
6817
6818 // inlet
6819 MFloat area = 0;
6820 MFloat localArea = 0;
6821 MFloat globalArea = 0;
6822 MFloat localPressure_1 = 0;
6823 MFloat globalPressure_1 = 0;
6824 MFloat localPressure_2 = 0;
6825 MFloat globalPressure_2 = 0;
6826 MFloat localMass = 0;
6827 MFloat globalMass = 0;
6828 MFloat localUbulk = 0;
6829 MFloat globalUbulk = 0;
6830 MFloat localDensity_2 = 0;
6831 MFloat globalDensity_2 = 0;
6832 MFloat localMeanMach_2 = 0;
6833 MFloat globalMeanMach_2 = 0;
6834
6835 for(MInt d = 0; d < noDomains(); d++) {
6836 for(MInt c = 0; c < m_noPerCellsToReceive[d]; c++) {
6837 const auto sortedId = static_cast<MInt>(m_periodicDataToReceive[d][5 + c * m_noPeriodicData]);
6838 const MInt cell_Id = m_sortedPeriodicCells->a[sortedId];
6839
6840 // inlet
6841 if(a_hasNeighbor(cell_Id, 0) == 0 && a_isHalo(cell_Id) == false) {
6842 MInt nghbrId = c_neighborId(cell_Id, 1);
6843 MInt bndryId = a_bndryId(nghbrId);
6844
6845
6846 if(bndryId > -1) {
6847 MFloat vfrac = m_bndryCells->a[bndryId].m_volume / POW3(c_cellLengthAtCell(nghbrId));
6848 MInt srfcId = m_bndryCells->a[bndryId].m_associatedSrfc[1];
6849 if(srfcId > -1) {
6850 area = POW2(c_cellLengthAtCell(cell_Id)) * vfrac;
6851 } else {
6852 mTerm(1, AT_, "something went wrong!");
6853 }
6854 } else {
6855 area = POW2(c_cellLengthAtCell(cell_Id)); // m_lengthLevel0 / FPOW2( a_level( cell_Id )));
6856 }
6857
6858 localPressure_1 += area * a_pvariable(cell_Id, PV->P);
6859 localMeanMach_2 += area
6860 * sqrt(m_periodicDataToReceive[d][1 + c * m_noPeriodicData]
6866 / sqrt(1.4 * m_periodicDataToReceive[d][4 + c * m_noPeriodicData]
6868 localPressure_2 += area * m_periodicDataToReceive[d][4 + c * m_noPeriodicData];
6869 localDensity_2 += area * m_periodicDataToReceive[d][0 + c * m_noPeriodicData];
6870 localMass += area * m_periodicDataToReceive[d][1 + c * m_noPeriodicData]
6872 localUbulk += area * m_periodicDataToReceive[d][1 + c * m_noPeriodicData];
6873 localArea += area;
6874 }
6875 }
6876 }
6877
6878 MPI_Allreduce(&localMass, &globalMass, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localMass", "globalMass");
6879 MPI_Allreduce(&localPressure_1, &globalPressure_1, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localPressure_1",
6880 "globalPressure_1");
6881 MPI_Allreduce(&localPressure_2, &globalPressure_2, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localPressure_2",
6882 "globalPressure_2");
6883 MPI_Allreduce(&localDensity_2, &globalDensity_2, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localDensity_2",
6884 "globalDensity_2");
6885 MPI_Allreduce(&localArea, &globalArea, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localArea", "globalArea");
6886 MPI_Allreduce(&localUbulk, &globalUbulk, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localUbulk", "globalUbulk");
6887 MPI_Allreduce(&localMeanMach_2, &globalMeanMach_2, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localMeanMach_2",
6888 "globalMeanMach_2");
6889
6890 globalPressure_1 = globalPressure_1 / globalArea;
6891 globalPressure_2 = globalPressure_2 / globalArea;
6892 globalMass = globalMass / globalArea;
6893 globalUbulk = globalUbulk / globalArea;
6894 globalDensity_2 = globalDensity_2 / globalArea;
6895 globalMeanMach_2 = globalMeanMach_2 / globalArea;
6896
6897
6898 // inlet2
6899 localArea = 0;
6900 globalArea = 0;
6901 area = 0;
6902 MFloat localPressure_3 = 0;
6903 MFloat globalPressure_3 = 0;
6904 MFloat localPressure_4 = 0;
6905 MFloat globalPressure_4 = 0;
6906
6907 for(MInt d = 0; d < noDomains(); d++) {
6908 for(MInt c = 0; c < m_noPerCellsToReceive[d]; c++) {
6909 const auto sortedId = static_cast<MInt>(m_periodicDataToReceive[d][5 + c * m_noPeriodicData]);
6910 const MInt cell_Id = m_sortedPeriodicCells->a[sortedId];
6911
6912 // inlet
6913 if(a_hasNeighbor(cell_Id, 0) > 0 && a_isHalo(cell_Id) == false && a_coordinate(cell_Id, 0) < 1.5) {
6914 MInt nghbrId = c_neighborId(cell_Id, 0);
6915 MInt bndryId = a_bndryId(nghbrId);
6916
6917 if(bndryId > -1) {
6918 MFloat vfrac = m_bndryCells->a[bndryId].m_volume / POW3(c_cellLengthAtCell(nghbrId));
6919 MInt srfcId = m_bndryCells->a[bndryId].m_associatedSrfc[1];
6920 if(srfcId > -1) {
6921 area = POW2(c_cellLengthAtCell(cell_Id)) * vfrac;
6922 } else {
6923 mTerm(1, AT_, "something went wrong!");
6924 }
6925 } else {
6926 area = POW2(c_cellLengthAtCell(cell_Id)); // m_lengthLevel0 / FPOW2( a_level( cell_Id )));
6927 }
6928
6929 localPressure_3 += area * a_pvariable(cell_Id, PV->P);
6930 localPressure_4 += area * m_periodicDataToReceive[d][4 + c * m_noPeriodicData];
6931 localArea += area;
6932 }
6933 }
6934 }
6935
6936 MPI_Allreduce(&localPressure_3, &globalPressure_3, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localPressure_3",
6937 "globalPressure_3");
6938 MPI_Allreduce(&localPressure_4, &globalPressure_4, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localPressure_4",
6939 "globalPressure_4");
6940 MPI_Allreduce(&localArea, &globalArea, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localArea", "globalArea");
6941
6942 globalPressure_3 = globalPressure_3 / globalArea;
6943 globalPressure_4 = globalPressure_4 / globalArea;
6944
6945 // outlet
6946 area = 0;
6947 MFloat localPressure_5 = 0;
6948 MFloat globalPressure_5 = 0;
6949 MFloat localPressure_6 = 0;
6950 MFloat globalPressure_6 = 0;
6951 globalArea = 0;
6952 localArea = 0;
6953
6954
6955 for(MInt d = 0; d < noDomains(); d++) {
6956 for(MInt c = 0; c < m_noPerCellsToReceive[d]; c++) {
6957 const MInt sortedId = static_cast<MInt>(m_periodicDataToReceive[d][5 + c * m_noPeriodicData]);
6958 const MInt cell_Id = m_sortedPeriodicCells->a[sortedId];
6959
6960 // outlet
6961 if(a_hasNeighbor(cell_Id, 1) > 0 && a_isHalo(cell_Id) == false && a_coordinate(cell_Id, 0) > 1.5) {
6962 MInt nghbrId = c_neighborId(cell_Id, 1);
6963 MInt bndryId = a_bndryId(nghbrId);
6964
6965 if(bndryId > -1) {
6966 MFloat vfrac = m_bndryCells->a[bndryId].m_volume / POW3(c_cellLengthAtCell(nghbrId));
6967 MInt srfcId = m_bndryCells->a[bndryId].m_associatedSrfc[0];
6968 if(srfcId > -1) {
6969 area = POW2(c_cellLengthAtCell(cell_Id)) * vfrac;
6970 } else {
6971 mTerm(1, AT_, "something went wrong!");
6972 }
6973 } else {
6974 area = POW2(c_cellLengthAtCell(cell_Id)); // m_lengthLevel0 / FPOW2( a_level( cell_Id )));
6975 }
6976
6977 localPressure_5 += area * a_pvariable(cell_Id, PV->P);
6978 localPressure_6 += area * m_periodicDataToReceive[d][4 + c * m_noPeriodicData];
6979 localArea += area;
6980 }
6981 }
6982 }
6983
6984 MPI_Allreduce(&localPressure_5, &globalPressure_5, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localPressure_5",
6985 "globalPressure_5");
6986 MPI_Allreduce(&localPressure_6, &globalPressure_6, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localPressure_6",
6987 "globalPressure_6");
6988 MPI_Allreduce(&localArea, &globalArea, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localArea", "globalArea");
6989
6990 globalPressure_5 = globalPressure_5 / globalArea;
6991 globalPressure_6 = globalPressure_6 / globalArea;
6992
6993 // outlet2
6994 area = 0;
6995 MFloat localPressure_7 = 0;
6996 MFloat globalPressure_7 = 0;
6997 MFloat localPressure_8 = 0;
6998 MFloat globalPressure_8 = 0;
6999 globalArea = 0;
7000 localArea = 0;
7001
7002
7003 for(MInt d = 0; d < noDomains(); d++) {
7004 for(MInt c = 0; c < m_noPerCellsToReceive[d]; c++) {
7005 const MInt sortedId = static_cast<MInt>(m_periodicDataToReceive[d][5 + c * m_noPeriodicData]);
7006 const MInt cell_Id = m_sortedPeriodicCells->a[sortedId];
7007
7008 // outlet
7009 if(a_hasNeighbor(cell_Id, 1) == 0 && a_isHalo(cell_Id) == false) {
7010 MInt nghbrId = c_neighborId(cell_Id, 0);
7011 MInt bndryId = a_bndryId(nghbrId);
7012
7013 if(bndryId > -1) {
7014 MFloat vfrac = m_bndryCells->a[bndryId].m_volume / POW3(c_cellLengthAtCell(nghbrId));
7015 MInt srfcId = m_bndryCells->a[bndryId].m_associatedSrfc[0];
7016 if(srfcId > -1) {
7017 area = POW2(c_cellLengthAtCell(cell_Id)) * vfrac;
7018 } else {
7019 mTerm(1, AT_, "something went wrong!");
7020 }
7021 } else {
7022 area = POW2(c_cellLengthAtCell(cell_Id)); // m_lengthLevel0 / FPOW2( a_level( cell_Id )));
7023 }
7024
7025 localPressure_7 += area * a_pvariable(cell_Id, PV->P);
7026 localPressure_8 += area * m_periodicDataToReceive[d][4 + c * m_noPeriodicData];
7027 localArea += area;
7028 }
7029 }
7030 }
7031
7032 MPI_Allreduce(&localPressure_7, &globalPressure_7, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localPressure_7",
7033 "globalPressure_7");
7034 MPI_Allreduce(&localPressure_8, &globalPressure_8, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localPressure_8",
7035 "globalPressure_8");
7036 MPI_Allreduce(&localArea, &globalArea, 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "localArea", "globalArea");
7037
7038 globalPressure_7 = globalPressure_7 / globalArea;
7039 globalPressure_8 = globalPressure_8 / globalArea;
7040
7041 m_TInfinity = 1.0 / (1.0 + F1B2 * 0.4 * POW2(m_Ma));
7042 // MFloat UT = m_Ma * sqrt(m_TInfinity);
7043 // MFloat m_delta_P = 0.3164 / sqrt(sqrt(sysEqn().m_Re0)) * m_referenceLength * F1B2 * m_rhoInfinity *
7044 // POW2(UT);//*4.94140625;
7045
7046 for(MInt d = 0; d < noDomains(); d++) {
7047 for(MInt c = 0; c < m_noPerCellsToReceive[d]; c++) {
7048 const MInt sortedId = static_cast<MInt>(m_periodicDataToReceive[d][5 + c * m_noPeriodicData]);
7049 const MInt cell_Id = m_sortedPeriodicCells->a[sortedId];
7050
7051 a_pvariable(cell_Id, PV->RHO) = m_periodicDataToReceive[d][0 + c * m_noPeriodicData];
7052 a_pvariable(cell_Id, PV->U) = m_periodicDataToReceive[d][1 + c * m_noPeriodicData];
7053 a_pvariable(cell_Id, PV->V) = m_periodicDataToReceive[d][2 + c * m_noPeriodicData];
7054 a_pvariable(cell_Id, PV->W) = m_periodicDataToReceive[d][3 + c * m_noPeriodicData];
7055 a_pvariable(cell_Id, PV->P) = m_periodicDataToReceive[d][4 + c * m_noPeriodicData];
7056 }
7057 }
7058
7059 m_target_Ubulk = m_Ma * sqrt(m_TInfinity); // m_rhoUInfinity;
7060
7062 m_oldUbulk = globalUbulk;
7064 }
7065
7067 UbulkDiff = (1 / timeStep()) * ((m_target_Ubulk - 2 * globalUbulk + m_oldUbulk));
7068
7070
7071 m_volumeAcceleration[0] = m_delta_P;
7072
7073 if(domainId() == 0) {
7074 cout << " step " << globalTimeStep << " deltaT " << timeStep() << " newPresGrad " << m_delta_P << " oldPresGrad "
7075 << m_oldPressure_Gradient << " Pinf " << m_PInfinity << " meanPres " << globalPressure_2 << " meanDens "
7076 << globalDensity_2 << " Mass_mean " << globalMass << " Umean " << globalUbulk << " UTarget "
7077 << m_Ma * sqrt(m_TInfinity) << " UmeanDiff" << globalUbulk - m_Ma * sqrt(m_TInfinity) << " meanMach "
7078 << globalMeanMach_2 << " machDiff" << m_Ma - globalMeanMach_2 << endl;
7079 }
7080
7081 m_oldPressure_Gradient = m_delta_P;
7082 m_oldUbulk = globalUbulk;
7083 }
7084
7087}

◆ exchangeProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::exchangeProperties
Author
Tim Wegmann

Definition at line 25033 of file fvcartesiansolverxd.cpp.

25033 {
25034 TRACE();
25035
25036 if(noNeighborDomains() == 0) return;
25037
25038 ScratchSpace<maia::fv::cell::BitsetType> propsBak(a_noCells(), FUN_, "propsBak");
25039
25040 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
25041 propsBak[0] = a_properties(cellId);
25042 }
25043
25044 maia::mpi::exchangeBitset(grid().neighborDomains(), grid().haloCells(), grid().windowCells(), mpiComm(), &propsBak[0],
25045 m_cells.size());
25046
25047 for(MInt cellId = noInternalCells(); cellId < a_noCells(); cellId++) {
25048 a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel) =
25049 propsBak[cellId][maia::fv::cell::p(SolverCell::IsOnCurrentMGLevel)];
25050 a_hasProperty(cellId, SolverCell::IsInactive) = propsBak[cellId][maia::fv::cell::p(SolverCell::IsInactive)];
25051 }
25052}
constexpr std::underlying_type< FvCell >::type p(const FvCell property)
Converts property name to underlying integer value.
void exchangeBitset(const std::vector< MInt > &nghbrDomains, const std::vector< std::vector< MInt > > &haloCellVec, const std::vector< std::vector< MInt > > &windowCellVec, const MPI_Comm comm, std::bitset< N > *const data, const MInt noCells, const MInt noDat=1)
Generic exchange of data.
Definition: mpiexchange.h:516

◆ exchangeWMVars()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::exchangeWMVars
protected

Definition at line 12020 of file fvcartesiansolverxd.cpp.

12020 {
12021 TRACE();
12022
12023 const MInt noPVars = PV->noVariables;
12024
12025 // gather
12026 gatherWMVars();
12027
12028 // send
12029 MInt sendBufSize = 0;
12030 MInt sendOffset = 0;
12031
12032 for(MInt dom = 0; dom < m_wmNoDomains; dom++) {
12033 sendBufSize = m_noWMImgPointsSend[dom] * noPVars;
12034 MPI_Issend(&m_wmImgSendBuffer[sendOffset], sendBufSize, MPI_DOUBLE, dom, 0, m_comm_wm, &m_mpi_wmSendReq[dom], AT_,
12035 "m_wmImgSendBuffer[sendOffset]");
12036 sendOffset += sendBufSize;
12037 }
12038
12039 // receive
12040 MInt recvOffset = 0;
12041 MInt recvBufSize = 0;
12042
12043 for(MInt dom = 0; dom < m_wmNoDomains; dom++) {
12044 recvBufSize = m_noWMImgPointsRecv[dom] * noPVars;
12045 MPI_Irecv(&m_wmImgRecvBuffer[recvOffset], recvBufSize, MPI_DOUBLE, dom, 0, m_comm_wm, &m_mpi_wmRecvReq[dom], AT_,
12046 "m_wmImgRecvBuffer[recvOffset]");
12047 recvOffset += recvBufSize;
12048 }
12049 MPI_Waitall(m_wmNoDomains, &m_mpi_wmSendReq[0], MPI_STATUSES_IGNORE, AT_);
12050 MPI_Waitall(m_wmNoDomains, &m_mpi_wmRecvReq[0], MPI_STATUSES_IGNORE, AT_);
12051
12052 scatterWMVars();
12053}
int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request, const MString &name, const MString &varname)
same as MPI_Issend

◆ exchangeZonalAverageCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::exchangeZonalAverageCells

Definition at line 38467 of file fvcartesiansolverxd.cpp.

38467 {
38468 TRACE();
38469
38470 // exchange LESVarAverage
38471 IF_CONSTEXPR(SysEqn::m_noRansEquations == 0) {
38472 // add halo cells
38473 //----------------------------------
38474 for(MInt p = 0; p < (MInt)m_averagePos.size(); p++) {
38475 for(MInt cellId = 0; cellId < c_noCells(); cellId++) {
38476 MFloat halfCellLength = grid().halfCellLength(cellId);
38477 MFloat pos = a_coordinate(cellId, m_averageDir[p]);
38478 if(approx(m_averagePos[p], pos, halfCellLength) && a_isHalo(cellId)) {
38479 m_LESAverageCells.push_back(cellId);
38480 for(MInt v = 0; v < m_LESNoVarAverage; v++) {
38481 m_LESVarAverage[v].push_back(F0);
38482 }
38483 }
38484 }
38485
38486 // add neignbor for nu_t reconstruction
38488 for(auto it = std::begin(m_LESAverageCells); it != std::end(m_LESAverageCells); ++it) {
38489 // for(MInt c = 0; c < m_noLESAverageCells ; c++){
38490 MInt cellId = *it; // m_LESAverageCells[c];
38491 if(a_isHalo(cellId)) {
38492 for(MInt nghbr = 0; nghbr < a_noReconstructionNeighbors(cellId); nghbr++) {
38493 const MInt recNghbrId = a_reconstructionNeighborId(cellId, nghbr);
38494
38495 if(a_hasProperty(recNghbrId, FvCell::IsSplitChild)) continue;
38496 if(a_hasProperty(recNghbrId, FvCell::IsSplitClone)) continue;
38497
38498 vector<MInt>::iterator findRecNghbrId =
38499 find(m_LESAverageCells.begin(), m_LESAverageCells.end(), recNghbrId);
38500
38501 if(findRecNghbrId == m_LESAverageCells.end()) {
38502 m_LESAverageCells.push_back(recNghbrId);
38503 for(MInt v = 0; v < m_LESNoVarAverage; v++) {
38504 m_LESVarAverage[v].push_back(F0);
38505 }
38506 }
38507 }
38508 }
38509 }
38510 }
38511 }
38512 //----------------------------------
38513
38514 // exchange halo cells
38515 for(MInt v = 0; v < m_LESNoVarAverage; v++) {
38516 ScratchSpace<MFloat> exchangeLESVarAverage(c_noCells(), "exchangeLESVarAverage", FUN_);
38517 exchangeLESVarAverage.fill(F0);
38518 for(MInt cellId = 0; cellId < c_noCells(); cellId++) {
38519 vector<MInt>::iterator findAverageId = find(m_LESAverageCells.begin(), m_LESAverageCells.end(), cellId);
38520 if(findAverageId != m_LESAverageCells.end()) {
38521 MInt LESAvgId = distance(m_LESAverageCells.begin(), findAverageId);
38522 if(!a_isHalo(cellId)) {
38523 // if(LESAvgId < m_LESAverageCellsHaloOffset){
38524 exchangeLESVarAverage[cellId] = m_LESVarAverage[v][LESAvgId];
38525 }
38526 }
38527 }
38528
38529 exchangeData(&exchangeLESVarAverage[0], 1);
38530
38531 for(MInt LESAvgId = 0; LESAvgId < (MInt)m_LESAverageCells.size(); LESAvgId++) {
38532 MInt cellId = m_LESAverageCells[LESAvgId];
38533 if(a_isHalo(cellId)) {
38534 m_LESVarAverage[v][LESAvgId] = exchangeLESVarAverage[cellId];
38535 }
38536 }
38537 }
38538 }
38539}

◆ extendStencil()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::extendStencil ( const MInt  cellId)
Author
Tim Wegmann

Definition at line 9591 of file fvcartesiansolverxd.cpp.

9591 {
9592 TRACE();
9593
9594 MIntScratchSpace nghbrList(100, AT_, "nghbrList");
9595 MIntScratchSpace layerId(100, AT_, "layerList");
9596
9597 const MInt rootCell = (a_hasProperty(cellId, SolverCell::IsSplitChild)) ? getAssociatedInternalCell(cellId) : cellId;
9598
9599 // reset reconstruction neighbors and only keep ghostCells
9600 a_noReconstructionNeighbors(cellId) = (a_isBndryCell(cellId)) ? m_bndryCells->a[a_bndryId(cellId)].m_noSrfcs : 0;
9601
9602 const MInt counter2 = getAdjacentLeafCells_d2_c(rootCell, 1, nghbrList, layerId);
9603
9604 for(MInt n = 0; n < counter2; n++) {
9605 if(nghbrList[n] < 0) continue;
9606 if(a_hasProperty(nghbrList[n], SolverCell::IsInactive)) continue;
9607 if(a_noReconstructionNeighbors(cellId) < m_cells.noRecNghbrs()) {
9608 a_reconstructionNeighborId(cellId, a_noReconstructionNeighbors(cellId)) = nghbrList[n];
9610 } else {
9611 cerr << "Warning: too many reconstruction neighbors for cell " << cellId << endl;
9612 }
9613 }
9614}
virtual MInt getAdjacentLeafCells_d2_c(const MInt, const MInt, MIntScratchSpace &, MIntScratchSpace &)

◆ fillExcBufferAzimuthal()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::fillExcBufferAzimuthal ( MInt  cellId,
MInt  offset,
MFloat dataDest,
MFloat dataSrc,
MInt  noData,
const std::vector< MInt > &  rotIndex = std::vector< MInt >() 
)

◆ filterConservativeVariablesAtFineToCoarseGridInterfaces()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::filterConservativeVariablesAtFineToCoarseGridInterfaces
virtual

Definition at line 33182 of file fvcartesiansolverxd.cpp.

33182 {
33183 TRACE();
33184
33185 IF_CONSTEXPR(nDim == 3) mTerm(-1, "Info: untested in 3D. By now only used in 2D.");
33186
33187 // filter the conservative variables
33188 // MBool coarseInterface0,coarseInterface1,coarseInterface2,coarseInterface3;
33189 // MBool fineOrNoInterface0,fineOrNoInterface1,fineOrNoInterface2,fineOrNoInterface3;
33190 // MBool filter0,filter1;
33191 //---
33192
33193 // remove the u component
33194 if(m_force1DFiltering) {
33195 for(MInt id = 0; id < m_noActiveCells; id++) {
33196 const MInt cellId = m_activeCellIds[id];
33197 a_variable(cellId, 0) = F0;
33198 }
33199 }
33200
33201 // new
33202 for(MInt id = 0; id < m_noActiveCells; id++) {
33203 const MInt cellId = m_activeCellIds[id];
33204 // select parents
33205 if(c_noChildren(cellId) == 0) {
33206 continue;
33207 }
33208 MBool grandparent = false;
33209 for(MInt ch = 0; ch < IPOW2(nDim); ch++) {
33210 if(c_childId(cellId, ch) == -1) {
33211 continue;
33212 }
33213 if(c_noChildren(c_childId(cellId, ch)) > 0) {
33214 grandparent = true;
33215 break;
33216 }
33217 }
33218 if(grandparent) {
33219 continue;
33220 }
33221 // filter
33222 for(MInt varId = 0; varId < CV->noVariables; varId++) {
33223 a_variable(cellId, varId) = F0;
33224 }
33225 for(MInt ch = 0; ch < IPOW2(nDim); ch++) {
33226 if(c_childId(cellId, ch) == -1) {
33227 continue;
33228 }
33229 for(MInt varId = 0; varId < CV->noVariables; varId++) {
33230 a_variable(cellId, varId) += a_variable(c_childId(cellId, ch), varId);
33231 }
33232 }
33233 for(MInt varId = 0; varId < CV->noVariables; varId++) {
33234 a_variable(cellId, varId) /= (MFloat)c_noChildren(cellId);
33235 }
33236 // copy the filtered variables to the child cells
33237 for(MInt ch = 0; ch < IPOW2(nDim); ch++) {
33238 if(c_childId(cellId, ch) == -1) {
33239 continue;
33240 }
33241 for(MInt varId = 0; varId < CV->noVariables; varId++) {
33242 a_variable(c_childId(cellId, ch), varId) =
33243 F1B2 * (a_variable(c_childId(cellId, ch), varId) + a_variable(cellId, varId));
33244 }
33245 }
33246 }
33247
33248 /*
33249
33250 // copy all CV to &a_pvariable(0,0)for( MInt id = 0; id < m_noActiveCells; id++ ) {
33251 cellId = m_activeCellIds[ id ];
33252 for( MInt var=0; var<CV->noVariables; var++ ) {
33253 a_pvariable( cellId , var ) = a_variable( cellId , var );
33254 }
33255 }
33256
33257 for( MInt id = 0; id < m_noActiveCells; id++ ) {
33258 cellId = m_activeCellIds[ id ];
33259 filter0 = false;
33260 filter1 = false;
33261 // check if coarser or finer grid in the -x-direction
33262 coarseInterface0 = false;
33263 fineOrNoInterface0 = false;
33264 if( a_hasNeighbor( cellId , 0 ) == 0 ) {
33265 if( c_parentId( cellId ) > -1 ) {
33266 if( a_hasNeighbor( c_parentId( cellId ) , 0 ) > 0 )
33267 coarseInterface0 = true;
33268 else
33269 fineOrNoInterface0 = true;
33270 } else
33271 fineOrNoInterface0 = true;
33272 } else {
33273 if( c_noChildren( c_neighborId( cellId , 0 ) ) > 0 )
33274 fineOrNoInterface0 = true;
33275 }
33276 // check if coarser or finer grid in the +x-direction
33277 coarseInterface1 = false;
33278 fineOrNoInterface1 = false;
33279 if( a_hasNeighbor( cellId , 1 ) == 0 ) {
33280 if( c_parentId( cellId ) > -1 ) {
33281 if( a_hasNeighbor( c_parentId( cellId ) , 1 ) > 0 )
33282 coarseInterface1 = true;
33283 else
33284 fineOrNoInterface1 = true;
33285 } else
33286 fineOrNoInterface1 = true;
33287 } else {
33288 if( c_noChildren( c_neighborId( cellId , 1 ) ) > 0 )
33289 fineOrNoInterface1 = true;
33290 }
33291 // check if coarser or finer grid in the -y-direction
33292 coarseInterface2 = false;
33293 fineOrNoInterface2 = false;
33294 if( a_hasNeighbor( cellId , 2 ) == 0 ) {
33295 if( c_parentId( cellId ) > -1 ) {
33296 if( a_hasNeighbor( c_parentId( cellId ) , 2 ) > 0 )
33297 coarseInterface2 = true;
33298 else
33299 fineOrNoInterface2 = true;
33300 } else
33301 fineOrNoInterface2 = true;
33302 } else {
33303 if( c_noChildren( c_neighborId( cellId , 2 ) ) > 0 )
33304 fineOrNoInterface2 = true;
33305 }
33306 // check if coarser or finer grid in the +y-direction
33307 coarseInterface3 = false;
33308 fineOrNoInterface3 = false;
33309 if( a_hasNeighbor( cellId , 3 ) == 0 ) {
33310 if( c_parentId( cellId ) > -1 ) {
33311 if( a_hasNeighbor( c_parentId( cellId ) , 3 ) > 0 )
33312 coarseInterface3 = true;
33313 else
33314 fineOrNoInterface3 = true;
33315 } else
33316 fineOrNoInterface3 = true;
33317 } else {
33318 if( c_noChildren( c_neighborId( cellId , 3 ) ) > 0 )
33319 fineOrNoInterface3 = true;
33320 }
33321
33322 if( !fineOrNoInterface0 && !fineOrNoInterface1 && !fineOrNoInterface2 && !fineOrNoInterface3 ) {
33323 if( ( coarseInterface0 || coarseInterface1 ) &&
33324 !( coarseInterface2 || coarseInterface3 ) )
33325 filter1 = true;
33326 if( !( coarseInterface0 || coarseInterface1 ) &&
33327 ( coarseInterface2 || coarseInterface3 ) )
33328 filter0 = true;
33329 }
33330
33331 if( filter0 ) {
33332 for( MInt var=0; var<CV->noVariables; var++ ) {
33333 a_variable( cellId , var ) *= F1B2;
33334 a_variable( cellId , var ) += F1B4 *
33335 (a_pvariable( c_neighborId( cellId , 0 ) , var ) +
33336 a_pvariable( c_neighborId( cellId , 1 ) , var ) );
33337 }
33338 } else {
33339 if( filter1 ) {
33340 for( MInt var=0; var<CV->noVariables; var++ ) {
33341 a_variable( cellId , var ) *= F1B2;
33342 a_variable( cellId , var ) += F1B4 *
33343 (a_pvariable( c_neighborId( cellId , 2 ) , var ) +
33344 a_pvariable( c_neighborId( cellId , 3 ) , var ) );
33345 }
33346 }
33347 }
33348 }
33349*/
33350}

◆ finalizeAdaptation()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::finalizeAdaptation
overridevirtual
Author
Tim Wegmann

Reimplemented from Solver.

Definition at line 23820 of file fvcartesiansolverxd.cpp.

23820 {
23821 TRACE();
23822
23823 m_forceAdaptation = false;
23826
23827 // // Nothing further to be done if inactive
23828 if(!isActive()) return;
23829
23830 // Reallocate memory to small and master cell id arrays
23832
23833 if(globalTimeStep > 0) {
23835
23836 // set isInactive based on levelSet value!
23838
23839 // Reallocate solver memory to arrays depending on a_noCells()
23841
23843
23845
23847
23848 IF_CONSTEXPR(isDetChem<SysEqn>) {
23853 scalarLimiter();
23854 }
23855
23856 computePV();
23857
23858 if(grid().azimuthalPeriodicity()) {
23859 cutOffBoundaryCondition(); // Cut-off cells are used for azimuthal reconstruction
23861 }
23862
23863 exchange();
23864
23866
23868
23870
23871 IF_CONSTEXPR(isDetChem<SysEqn>) { computeConservativeVariables(); }
23872
23873 scalarLimiter();
23874
23875 exchange();
23876
23879 }
23880
23881 IF_CONSTEXPR(isDetChem<SysEqn>) { computeMeanMolarWeights_PV(); }
23882
23883#if defined(WITH_CANTERA)
23884 IF_CONSTEXPR(isDetChem<SysEqn>) {
23885 computeGamma();
23886 setTimeStep();
23887 }
23888#endif
23889 }
23890
23891 m_wasAdapted = false;
23892
23893#if defined _MB_DEBUG_ || !defined NDEBUG
23894 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
23895 for(MInt v = 0; v < PV->noVariables; v++) {
23896 if(std::isnan(a_pvariable(cellId, v)) && a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
23897 cerr << "Cell with invalid value 2 " << cellId << " " << a_isHalo(cellId) << " "
23898 << a_hasProperty(cellId, SolverCell::IsInactive) << endl;
23899 }
23900 }
23901 }
23902#endif
23903}
void reInitActiveCellIdsMemory()
Allocate memory to arrays according to the current number of cells.
virtual void writeListOfActiveFlowCells()
virtual void updateMaterialNo()
void resetExternalSources()
Reset external sources.
virtual void cutOffBoundaryCondition()
void computeGamma()
Dispatches the gamma computation at each cell by calling the relevant function from the detChemSysEqn...
void reInitSmallCellIdsMemory()
Reallocate memory to small and master cell id arrays according to the current number of cells.
virtual void initSolutionStep(MInt)
Initializes the solver.
void setConservativeVarsOnAzimuthalRecCells()
virtual void initializeMaxLevelExchange()
parallel: Store all necessary data in send buffer
virtual void applyBoundaryCondition()
handles the application of boundary conditions to the ghost cells

◆ finalizeBalance()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::finalizeBalance
overridevirtual
Author
Tim Wegmann

Reimplemented from Solver.

Definition at line 24795 of file fvcartesiansolverxd.cpp.

24795 {
24796 TRACE();
24797
24798 ASSERT(m_cells.size() == c_noCells(), "");
24799
24800 // Nothing to do if solver is not active
24801 if(!grid().isActive()) {
24802 return;
24803 }
24804
24805 if(m_closeGaps) {
24807 }
24808
24809 // nothing to be done in the initial adaptation
24810 if(globalTimeStep < 0) return;
24811
24812 // Reallocate memory to small and master cell id arrays
24814
24815 // TODO labels:FV,DLB move the following into a separate function to be called at initialization and after DLB
24817 // Reallocate solver memory to arrays depending on a_noCells()
24820
24822
24823 // TODO labels:DLB already performed in initSolutionStep() TEST!
24825
24826 // To reset communicators in BndryCnd
24828
24829 IF_CONSTEXPR(isDetChem<SysEqn>) {
24835 }
24836
24837 computePV();
24838
24839 // initialize the runge kutta integration scheme
24840 // TODO labels:FV,DLB fix this for levelSetMb, initializeRungeKutta is overloaded
24841 // and some incorrect stuff is done there!
24842 if(!m_levelSetMb) {
24844 }
24845
24846 // Note: time step is communicated to previously inactive ranks
24847
24848 // periodic exchange (azimuthal periodicity concept)
24849 if(m_periodicCells == 3) {
24850 mTerm(1, "balancePost untested case with azimuthal periodicity");
24851 exchange();
24853 }
24854
24855 // exchange(); // Not required since already done via exchangeData() above?
24856 /*
24857 IF_CONSTEXPR(!isDetChem<SysEqn>) {
24858 cutOffBoundaryCondition();
24859 applyBoundaryCondition();
24860 }*/
24861
24862 if(m_zonal) {
24863 m_wasBalancedZonal = false;
24864 }
24865
24866 if(grid().azimuthalPeriodicity()) {
24867 exchange();
24868 }
24869
24872
24873 // After balance set conservative variables of the cells used for azimuthal (Relevant at cut-off)
24874 if(grid().azimuthalPeriodicity()) {
24876 }
24877
24878 // computeConservativeVariables();
24879
24880 scalarLimiter();
24881
24882 if(calcSlopesAfterStep()) {
24884 m_fvBndryCnd->copySlopesToSmallCells();
24887 }
24888
24889 // Note: from initSolver()
24890 if(m_combustion && !m_LSSolver) {
24894 }
24895
24896 // Note: from initSolver()
24897 if(m_levelSet && !m_combustion && !m_LSSolver) {
24899 }
24900
24902}
virtual void LSReconstructCellCenter()
Dispatch the reconstruction computation to the appropiate loop.
virtual void initializeRungeKutta()
Reads the Runge-Kutta properties and initializes the variables required for Runge Kutta time stepping...
MBool calcSlopesAfterStep()
Return if slopes should be calculated at after each step (not before)
void exchangeGapInfo()
exchanges the Gap-Information with the solver-own communicators!
virtual void setCellProperties()

◆ finalizeInitEnthalpySolver()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::finalizeInitEnthalpySolver ( )
inlinevirtual

Definition at line 2156 of file fvcartesiansolverxd.h.

2156{};

◆ finalizeInitSolver()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::finalizeInitSolver
overridevirtual
Author
unknown
Date
Template Parameters
nDim

Implements Solver.

Definition at line 10001 of file fvcartesiansolverxd.cpp.

10001 {
10002 TRACE();
10003
10004 // Nothing to be done if solver is not active
10005 if(!isActive()) return;
10006
10007 // Load restart
10008 if(m_restart && !(m_zonal || grid().azimuthalPeriodicity())) {
10010 }
10011
10012 // Reallocate memory to small and master cell id arrays
10014
10015 // initialize the solver
10016 initSolutionStep(-1);
10017
10018 // Reallocate solver memory to arrays depending on a_noCells()
10021
10023
10024 {
10026 MPI_Allreduce(MPI_IN_PLACE, &maxNoCells, 1, type_traits<MLong>::mpiType(), MPI_MAX, mpiComm(), AT_, "MPI_IN_PLACE",
10027 "maxNoCells");
10028 MLong maxNoTotalCells = a_noCells();
10029 MPI_Allreduce(MPI_IN_PLACE, &maxNoTotalCells, 1, type_traits<MLong>::mpiType(), MPI_MAX, mpiComm(), AT_,
10030 "MPI_IN_PLACE", "maxNoTotalCells");
10031 stringstream message;
10032 message << "Solver #" << solverId() << " - maximum number of internal cells among ranks: " << maxNoCells
10033 << std::endl;
10034 message << "Solver #" << solverId() << " - maximum number of cells among ranks: " << maxNoTotalCells << std::endl;
10035 m_log << message.str();
10036 cerr0 << message.str();
10037 }
10038
10039 IF_CONSTEXPR(isEEGas<SysEqn>)
10040 if(m_EEGas.depthCorrection) initDepthCorrection();
10041
10042 // initialize the flow field (again)
10044
10045 // IF_CONSTEXPR(isDetChem<SysEqn>) { computeMeanMolarWeights_CV(); }
10046
10047 // Calculate primitive variables
10048 computePV();
10049
10050#if defined(WITH_CANTERA)
10051 IF_CONSTEXPR(isDetChem<SysEqn>) { computeGamma(); }
10052#endif
10053
10054 // initialize the runge kutta integration scheme
10056
10057 setTimeStep();
10058
10059 // periodic exchange (azimuthal periodicity concept)
10060 if(m_periodicCells == 3) {
10061 exchange();
10063 }
10064
10065 // Exchange halo/window cell information if multiSolver is enabled
10066 exchange();
10067
10068 if(m_calcLESAverage) {
10070 // resetZonalLESAverage();
10072 }
10073
10074 if(m_STGSponge) {
10078 }
10079 }
10080
10083 }
10084
10085 // Set cut-off boundary conditions
10087
10088 // Apply boundary conditions
10090
10092
10093 // Calls the scalar limiter if species are calculated
10094 scalarLimiter();
10095
10096 // Compute the cell center slopes here if changed slope calculation activated
10097 if(calcSlopesAfterStep()) {
10099 m_fvBndryCnd->copySlopesToSmallCells();
10102 }
10103
10104 if(m_combustion && !m_LSSolver) {
10108 }
10109
10112 }
10113
10114 IF_CONSTEXPR(isEEGas<SysEqn>) {
10115 if(m_EEGas.gasSource != 0) initSourceCells();
10116 grid().findEqualLevelNeighborsParDiagonal(false);
10117 }
10118}
virtual void applyInitialCondition()
Initializes the entire flow field.
MBool m_restart
Definition: solver.h:97
void const MInt const MInt const MInt const MInt maxNoCells
Definition: collector.h:240

◆ finalizeLESAverage()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::finalizeLESAverage

Definition at line 37601 of file fvcartesiansolverxd.cpp.

37601 {
37602 TRACE();
37603
37604 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
37605
37606 // sort array
37607 sort(m_LESAverageCells.begin(), m_LESAverageCells.end());
37608
37610
37611 for(MInt var = 0; var < m_LESNoVarAverage; var++) {
37612 for(MInt c = 0; c < (MInt)m_LESAverageCells.size(); c++) {
37613 m_LESVarAverage[var].push_back(F0);
37614 }
37615 }
37616
37620 } else {
37621 for(MInt var = 0; var < noVariables(); var++) {
37622 for(MInt c = 0; c < (MInt)m_LESAverageCells.size(); c++) {
37624 ASSERT(c < (MInt)m_LESVarAverage[var].size(),
37625 "Trying to access data [" + to_string(var) + "][" + to_string(c) + "] in m_LESVarAverage with length "
37626 + to_string(m_LESVarAverage[var].size()));
37627
37628 m_LESVarAverage[var][c] = a_pvariable(cellId, var);
37629 }
37630 }
37631
37632 MInt count = 0;
37633 MInt index = 0;
37634 for(MInt i = 0; i < nDim; i++) {
37635 for(MInt j = count; j < nDim; j++) {
37636 MInt indexAvg = index + noVariables();
37637 for(MInt c = 0; c < (MInt)m_LESAverageCells.size(); c++) {
37639
37640 ASSERT(c < (MInt)m_LESVarAverage[indexAvg].size(),
37641 "Trying to access data [" + to_string(indexAvg) + "][" + to_string(c)
37642 + "] in m_LESVarAverage with length " + to_string(m_LESVarAverage[indexAvg].size()));
37643
37644 m_LESVarAverage[indexAvg][c] = a_pvariable(cellId, i) * a_pvariable(cellId, j);
37645 }
37646 index++;
37647 }
37648 count++;
37649 }
37650 }
37651}

◆ finalizeMpiExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::finalizeMpiExchange

Definition at line 6571 of file fvcartesiansolverxd.cpp.

6571 {
6572 // Cancel and free MPI requests
6574 // Wait for open send requests to finish
6576 MPI_Waitall((MInt)m_maxLvlMpiSendNeighbor.size(), m_mpi_sendRequest, MPI_STATUSES_IGNORE, AT_);
6577 }
6578
6579 for(MInt i = 0; i < noNeighborDomains(); i++) {
6580 if(m_mpi_receiveRequest != nullptr) {
6581 if(m_mpi_receiveRequest[i] != MPI_REQUEST_NULL) {
6582 // Cancel opened receive request that do not have a matching send initiated yet
6585 }
6587 }
6588 }
6589 if(m_mpi_sendRequest != nullptr) {
6590 if(m_mpi_sendRequest[i] != MPI_REQUEST_NULL) {
6591 // Free send request (cannot be canceled)
6593 }
6594 }
6595 }
6596
6597 m_mpiSendRequestsOpen = false;
6598 m_mpiRecvRequestsOpen = false;
6599 }
6600}
int MPI_Request_free(MPI_Request *request, const MString &name)
same as MPI_Request_free

◆ findDirectNghbrs()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::findDirectNghbrs ( MInt  cellId,
std::vector< MInt > &  nghbrList 
)
Author
Sven Berger
Date
May 2016
Parameters
[in]cellIdid of the cell for which all neighbors should be obtained
[out]nghbrListlist of neighboring cells

Gather all neighbouring cells and Diagonal neighbor(s) in the xy-plane (in total 10 additional cells (3D)):

In the 3D case look for additional diagonal and tridiagonal neighbors in the z-directions (in total 16 additional cells (3D)):

Definition at line 26143 of file fvcartesiansolverxd.cpp.

26143 {
26144 // TODO labels:FV replace with cartesiangridproxy version!
26145
26146 ASSERT(cellId >= 0, "ERROR: Invalid cellId!");
26147
26148 nghbrList.push_back(cellId);
26149
26150 // this prevents neighbors to be identified multiple times
26151 auto uniqueAdd = [&](MInt newElement) {
26152 auto it = find(nghbrList.begin(), nghbrList.end(), newElement);
26153 if(it == nghbrList.end() && newElement >= 0) {
26154 nghbrList.push_back(newElement);
26155 return true;
26156 }
26157 return false;
26158 };
26159
26163 static constexpr MInt diagDirs[4]{3, 2, 0, 1};
26164 for(MInt dir = 0; dir < 2 * nDim; dir++) {
26165 // iterate overall direct neighbors
26166 for(MInt j = m_identNghbrIds[2 * cellId * nDim + dir]; j < m_identNghbrIds[2 * cellId * nDim + dir + 1]; j++) {
26167 const MInt nghbrId = m_storeNghbrIds[j];
26168 uniqueAdd(nghbrId);
26169 if(dir < 4) {
26170 // add diagonal neighbors in x-y plane
26171 for(MInt t = m_identNghbrIds[2 * nghbrId * nDim + diagDirs[dir]];
26172 t < m_identNghbrIds[2 * nghbrId * nDim + diagDirs[dir] + 1];
26173 t++) {
26174 const MInt diagNghbr = m_storeNghbrIds[t];
26175 uniqueAdd(diagNghbr);
26176 }
26177 }
26178 }
26179 }
26180
26185 IF_CONSTEXPR(nDim == 3) {
26186 for(MInt dirZ = 4; dirZ < 6; dirZ++) {
26187 for(MInt j = m_identNghbrIds[2 * cellId * nDim + dirZ]; j < m_identNghbrIds[2 * cellId * nDim + dirZ + 1]; j++) {
26188 const MInt nghbrIdZ = m_storeNghbrIds[j];
26189 for(MInt dir = 0; dir < 4; dir++) {
26190 for(MInt t = m_identNghbrIds[2 * nghbrIdZ * nDim + dir]; t < m_identNghbrIds[2 * nghbrIdZ * nDim + dir + 1];
26191 t++) {
26192 const MInt nghbrId = m_storeNghbrIds[t];
26193 uniqueAdd(nghbrId);
26194 // tridiagonal neighbors
26195 for(MInt v = m_identNghbrIds[2 * nghbrId * nDim + diagDirs[dir]];
26196 v < m_identNghbrIds[2 * nghbrId * nDim + diagDirs[dir] + 1];
26197 v++) {
26198 const MInt triDiagNghbrId = m_storeNghbrIds[v];
26199 uniqueAdd(triDiagNghbrId);
26200 }
26201 }
26202 }
26203 }
26204 }
26205 }
26206}

◆ findNeighborHood()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::findNeighborHood ( MInt  cellId,
MInt  layer,
std::vector< MInt > &  nghbrList 
)
Author
Sven Berger
Date
May 2016
Parameters
[in]cellIdid of the cell for which all neighbors should be obtained
[in]layermaximum extend of neighborhood in number of cells
[out]nghbrListlist of neighboring cells
  1. direct neighbors of cell
  2. increase neighborhood to given size

Definition at line 26219 of file fvcartesiansolverxd.cpp.

26220 {
26221 ASSERT(layer > 0, "ERROR: Invalid layer!");
26222 ASSERT(cellId >= 0, "ERROR: Invalid cellId!");
26223
26224 // TODO labels:FV replace with cartesiangridproxy version!
26225
26226 // this prevents neighbors to be identified multiple times
26227 auto uniqueAdd = [&](MInt newElement) {
26228 auto it = find(nghbrList.begin(), nghbrList.end(), newElement);
26229 if(it == nghbrList.end() && newElement >= 0) {
26230 nghbrList.push_back(newElement);
26231 return true;
26232 }
26233 return false;
26234 };
26235
26236 vector<MInt> tempNghbrCollection{};
26237
26241 findDirectNghbrs(cellId, nghbrList);
26242
26246 for(MInt currEx = 1; currEx < layer; currEx++) {
26247 // for each newly found neighbor find all neighbors
26248 for(auto& nghbr : nghbrList) {
26249 findDirectNghbrs(nghbr, tempNghbrCollection);
26250 }
26251 nghbrList.clear();
26252 // add all new unique neighbor ids to vector
26253 for(auto& nghbr : tempNghbrCollection) {
26254 if(uniqueAdd(nghbr) && currEx + 1 < layer) {
26255 // optimisation
26256 nghbrList.push_back(nghbr);
26257 }
26258 }
26259 }
26260}
void findDirectNghbrs(MInt cellId, std::vector< MInt > &nghbrList)
Obtain list of direct neighbors of given cell.

◆ findNghbrIds()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::findNghbrIds
virtual

identify and store all direct neighbors function sweeps over all cells except for ghost cells and cells with children and determines all of their direct neighbors neighbor data is stored into two scratch arrays that are allocated by the calling method and transferred

Author
Daniel Hartmann

Definition at line 25536 of file fvcartesiansolverxd.cpp.

25536 {
25537 TRACE();
25538
25539 // TODO labels:FV replace with cartesiangridproxy version!
25540
25541 MBool nghbrsFound = false;
25542 MBool nghbrExist = false;
25543 const MInt noCellIds = a_noCells();
25544 const MInt maxNoCells = maxNoGridCells();
25545 MInt nghbrChildId;
25546 MInt currentCellId;
25547 MInt sideId, nghbrSideId;
25548 MInt bndryId = 0;
25549 MInt nghbrId = 0;
25550 MInt smallCell;
25551 MInt k = 0;
25552 MInt maxIndex = 0;
25553 MInt pos = 0;
25554 MInt tempNghbrs[16];
25555 MInt tempNghbrs1[16];
25556 ScratchSpace<MFloat> coordinates(noCellIds * nDim, AT_, "coordinates");
25557 //---
25558
25559 if(!m_storeNghbrIds) {
25560 mAlloc(m_storeNghbrIds, m_noDirs * IPOW2(nDim) * maxNoCells, "m_storeNghbrIds", -1, AT_);
25561 }
25562 if(!m_identNghbrIds) {
25563 mAlloc(m_identNghbrIds, m_noDirs * maxNoCells + 1, "m_identNghbrIds", -1, AT_);
25564 }
25565
25566
25567 // ------------------------------------------------------------------------
25568 // ------------- determine coordinates of grid cell cogs ------------------
25569 // ------------------------------------------------------------------------
25570
25571 // for the determination of neighbor relations, the coordinates of the cog
25572 // of the GRID CELLS must be known
25573 // the cog of boundary cells is moved to the cog of the fluid part of the
25574 // respective cells and therefore differs from the cog of the corresponding
25575 // grid cell
25576
25577 // loop over all cartesian cells including ghost cells
25578
25579 // check bndryCellIds...
25580
25581
25582 for(MInt cellId = 0; cellId < noCellIds; cellId++) {
25583 // proceed if cell is not a ghost cell
25584 if(!a_isBndryGhostCell(cellId)) {
25585 // loop over space dimensions
25586 for(MInt d = 0; d < nDim; d++) {
25587 // copy coordinates of cog
25588 coordinates[cellId * nDim + d] = a_coordinate(cellId, d);
25589
25590 // correct cog of boundary cells
25591 if(a_bndryId(cellId) > -1) {
25592 bndryId = a_bndryId(cellId);
25593
25594 // correct coordinates in the scratch array
25595 coordinates[cellId * nDim + d] -= m_fvBndryCnd->m_bndryCells->a[bndryId].m_coordinates[d];
25596 }
25597 }
25598 }
25599 }
25600
25601 // correct coordinates of internal cells which are masters of a small cell
25602 for(MInt smallId = 0; smallId < m_fvBndryCnd->m_smallBndryCells->size(); smallId++) {
25603 smallCell = m_fvBndryCnd->m_smallBndryCells->a[smallId];
25604 if(m_fvBndryCnd->m_bndryCells->a[smallCell].m_linkedCellId != -1) {
25605 if(a_bndryId(m_fvBndryCnd->m_bndryCells->a[smallCell].m_linkedCellId) == -1) {
25606 for(MInt d = 0; d < nDim; d++) {
25607 coordinates[(m_fvBndryCnd->m_bndryCells->a[smallCell].m_linkedCellId) * nDim + d] =
25608 m_fvBndryCnd->m_bndryCells->a[smallCell].m_masterCoordinates[d];
25609 }
25610 }
25611 }
25612 }
25613
25614 // ------------------------------------------------------------------------
25615 // ------------- coordinates of grid cell cogs determined -----------------
25616 // ------------------------------------------------------------------------
25617
25618 // ------------------------------------------------------------------------
25619 // ------------- determine neighbor cell IDs of all cells -----------------
25620 // ------------------------------------------------------------------------
25621
25622 // --------- loop over all cartesian cells including ghost cells ----------
25623 for(MInt cellId = 0; cellId < noCellIds; cellId++) {
25624 for(MInt dirId = 0; dirId < m_noDirs; dirId++) {
25625 m_identNghbrIds[cellId * m_noDirs + dirId] = pos;
25626 }
25627
25628 // proceed if cell is not a ghost cell
25629 if(!a_isBndryGhostCell(cellId)) {
25630 // multilevel
25631 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
25632 // --------------- loop over directions -----------------------------
25633 for(MInt dirId = 0; dirId < m_noDirs; dirId++) {
25634 MInt spaceId = dirId / 2;
25635 sideId = dirId % 2;
25636 nghbrSideId = (sideId + 1) % 2;
25637
25638 nghbrExist = false;
25639
25640 // set the location in m_storeNghbrIds, where neighbors of cellId are
25641 // stored
25642 m_identNghbrIds[cellId * m_noDirs + dirId] = pos;
25643
25644 // ----------------------------------------------------------------
25645 // --- identify neighbor in considered direction ------------------
25646 // *-> this can be a neighbor of the cell itself or a neighbor of *
25647 // * its parent, grandparent, and so forth *
25648 // ----------------------------------------------------------------
25649
25650 // check if cell has a neighbor in the investigated
25651 // direction
25652 if(a_hasNeighbor(cellId, dirId) > 0) {
25653 if(a_level(c_neighborId(cellId, dirId)) <= maxRefinementLevel()) {
25654 // -> cell has a neighbor
25655 // this neighbor:
25656 nghbrId = c_neighborId(cellId, dirId);
25657
25658 // --------------------------------------------------------------
25659 // --- investigate neighbor -------------------------------------
25660 // *-> check if neighbor has children, grandchildren, and so *
25661 // * forth, which are direct neighbors of the considered cell *
25662 // --------------------------------------------------------------
25663 // multilevel
25664 if(a_hasProperty(nghbrId, SolverCell::IsOnCurrentMGLevel)) {
25665 // neighbor is not a parent and can be stored as neighbor of
25666 // the cell cellId
25667 m_storeNghbrIds[pos] = nghbrId;
25668 pos++;
25669
25670 } else {
25671 // neighbor is a parent
25672 // investigate all children and grandchildren
25673
25674 // temporary array that holds all parent cells to be
25675 // investigated
25676 tempNghbrs[0] = nghbrId;
25677 nghbrsFound = false;
25678
25679 // ----------------------------------------------------------
25680 // --- investigate all neighbors that are parents -----------
25681 // ----------------------------------------------------------
25682
25683 maxIndex = 1;
25684 while(nghbrsFound == false) {
25685 // initialize counter for the number of investigated
25686 // neighboring children that are parents themselves and
25687 // thus added to a temporary array
25688 k = 0;
25689
25690 // ------ loop over all neighbor parents ------------------
25691 for(MInt index = 0; index < maxIndex; index++) {
25692 // investigated neighbor parent cell
25693 ASSERT(index > -1 && index < 16, "");
25694 nghbrId = tempNghbrs[index];
25695
25696 // check the location of the children within the parent cell
25697 // by means of comparison of the grid cell cogs of the
25698 // parent cell and the children in considered space direction
25699
25700 // in case none of the children is identified
25701 // as a direct neighbor, do nothing, since then
25702 // the considered cell side is a non-fluid side
25703
25704 // --------- loop over neighbor children ----------------
25705 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
25706 if(c_childId(nghbrId, childId) == -1) {
25707 continue;
25708 }
25709
25710 if((coordinates[c_childId(nghbrId, childId) * nDim + spaceId]
25711 - coordinates[nghbrId * nDim + spaceId])
25712 * ((float)nghbrSideId - 0.5)
25713 > 0) {
25714 nghbrChildId = c_childId(nghbrId, childId);
25715 // multilevel
25716 if((c_noChildren(nghbrChildId) == 0 && a_level(nghbrChildId) <= maxRefinementLevel())
25717 || (c_noChildren(nghbrChildId) > 0 && a_level(nghbrChildId) == maxRefinementLevel())) {
25718 // child cell is not a parent and stored
25719 // as a neighbor
25720 m_storeNghbrIds[pos] = nghbrChildId;
25721 pos++;
25722
25723 } else {
25724 // add child cell to temporary array for
25725 // further investigation
25726 ASSERT(k > -1 && k < 16,
25727 "Too many local child neighbors. Something might be wrong with "
25728 "your mesh!");
25729 tempNghbrs1[k] = nghbrChildId;
25730 k++;
25731 }
25732 }
25733 }
25734 }
25735
25736 maxIndex = k;
25737 if(k == 0) {
25738 nghbrsFound = true;
25739 } else {
25740 // transfer the cells collected in tempNghbrs1 to
25741 // tempNghbrs
25742 for(MInt l = 0; l < k; l++) {
25743 ASSERT(l > -1 && l < 16, "");
25744 tempNghbrs[l] = tempNghbrs1[l];
25745 }
25746 }
25747 }
25748 }
25749 }
25750 } else {
25751 // -> cell does not have a neighbor of equivalent level
25752 currentCellId = cellId;
25753
25754 // loop until a parent is found that has a neighbor in considered
25755 // direction
25756 // break when the parent ID becomes -1 (boundary in direction)
25757 while(nghbrExist == false) {
25758 // if parent does not exist, break
25759 if(c_parentId(currentCellId) == -1) {
25760 break;
25761 }
25762
25763 // break if currentCell does not lie at the parent cell face
25764 // whose normal points to considered direction
25765 if((coordinates[currentCellId * nDim + spaceId] - coordinates[c_parentId(currentCellId) * nDim + spaceId])
25766 * ((float)sideId - 0.5)
25767 < 0) {
25768 break;
25769 }
25770
25771 // identify parentId of current cell and store it
25772 // as current cell
25773 currentCellId = c_parentId(currentCellId);
25774
25775 // check if current cell has a neighbor in regarded direction
25776 if(a_hasNeighbor(currentCellId, dirId) > 0) {
25777 nghbrExist = true;
25778 nghbrId = c_neighborId(currentCellId, dirId);
25779 // store this neighbor if it is regarded - multilevel
25780 if(a_hasProperty(nghbrId, SolverCell::IsOnCurrentMGLevel)) {
25781 m_storeNghbrIds[pos] = nghbrId;
25782 pos++;
25783 }
25784 }
25785 }
25786 }
25787 }
25788 }
25789 }
25790 }
25791 m_identNghbrIds[noCellIds * m_noDirs] = pos;
25792}

◆ findNghbrIdsMGC()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::findNghbrIdsMGC
inline

identify and store all direct neighbors which are connected in the fluid function sweeps over all cells except for ghost cells and cells with children and determines all of their direct neighbors neighbor data is stored into two scratch arrays that are allocated by the calling method and transferred

requires -1 children! split faces and split cells can only be treated if the neighboring cells are on the same refinement level!

Author
Daniel Hartmann, modified by Claudia Guenther, Update by Tim Wegmann

Definition at line 25812 of file fvcartesiansolverxd.cpp.

25812 {
25813 IF_CONSTEXPR(nDim == 2) mTerm(1, "Only available in 3D. MGC not yet implemented in 2D");
25814 TRACE();
25815
25816 MBool nghbrsFound = false;
25817 MBool nghbrExist = false;
25818 const MInt noCellIds = a_noCells();
25819 const MInt maxNoCells = maxNoGridCells();
25820 MInt nghbrChildId;
25821 MInt currentCellId;
25822 MInt bndryId = 0;
25823 MInt nghbrBndryId;
25824 MInt nghbrId = 0;
25825 MInt k = 0;
25826 MInt maxIndex = 0;
25827 MInt pos = 0;
25828 MIntScratchSpace tempNghbrs_scratch(16, AT_, "tempNghbrs_scratch");
25829 MIntScratchSpace tempNghbrs1_scratch(16, AT_, "tempNghbrs1_scratch");
25830 MInt* tempNghbrs = tempNghbrs_scratch.getPointer();
25831 MInt* tempNghbrs1 = tempNghbrs1_scratch.getPointer();
25832
25833 const MInt sideToChildren[6][4] = {{0, 2, 4, 6}, {1, 3, 5, 7}, {0, 1, 4, 5},
25834 {2, 3, 6, 7}, {0, 1, 2, 3}, {4, 5, 6, 7}};
25835 const MInt otherDir[6] = {1, 0, 3, 2, 5, 4};
25836 const MInt noChildrenPerSide = IPOW2(nDim - 1);
25837 MBool isNonFluidSide[m_noDirs];
25838 MBool nonFluidSide = false;
25839
25840 if(!m_storeNghbrIds) {
25841 mAlloc(m_storeNghbrIds, m_noDirs * IPOW2(nDim) * maxNoCells, "m_storeNghbrIds", -1, AT_);
25842 }
25843 if(!m_identNghbrIds) {
25844 mAlloc(m_identNghbrIds, m_noDirs * maxNoCells + 1, "m_identNghbrIds", -1, AT_);
25845 }
25846
25847 //---
25848
25849 // ------------------------------------------------------------------------
25850 // ------------- determine coordinates of grid cell cogs ------------------
25851 // ------------------------------------------------------------------------
25852
25853 // for the determination of neighbor relations, the coordinates of the cog
25854 // of the GRID CELLS is required -> new version has to be called before the
25855 // cell centroids are moved, or they have to be shifted back before this
25856 // function is called.
25857
25858 // loop over all cartesian cells including ghost cells
25859
25860 // ------------------------------------------------------------------------
25861 // ------------- determine neighbor cell IDs of all cells -----------------
25862 // ------------------------------------------------------------------------
25863
25864 for(MInt cellId = 0; cellId < noCellIds; cellId++) {
25865 for(MInt dirId = 0; dirId < m_noDirs; dirId++) {
25866 m_identNghbrIds[cellId * m_noDirs + dirId] = pos;
25867 isNonFluidSide[dirId] = false;
25868 }
25869
25870 bndryId = a_bndryId(cellId);
25871
25872 if(a_hasProperty(cellId, SolverCell::IsInvalid)) {
25873 continue;
25874 }
25875
25876 if(bndryId > -2) {
25877 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
25878 // initialize nonFluidSide array to delete wrong connections
25879 if(bndryId > -1) {
25880 for(MInt face = 0; face < m_noDirs; face++) {
25881 isNonFluidSide[face] = m_fvBndryCnd->m_bndryCells->a[bndryId].m_externalFaces[face];
25882 }
25883 }
25884
25885
25886 // 1st step: identify potential neighbors -> OK
25887 // 2nd step: delete neighbor if non fluid side in between -> OK
25888 // 3rd step: correct split cells
25889 for(MInt dirId = 0; dirId < m_noDirs; dirId++) {
25890 nghbrExist = false;
25891
25892 // set the location in storeNghbrIds, where neighbors of cellId are
25893 // stored
25894 m_identNghbrIds[cellId * m_noDirs + dirId] = pos;
25895
25896 if(isNonFluidSide[dirId]) {
25897 continue;
25898 }
25899
25900 // ----------------------------------------------------------------
25901 // --- identify neighbor in considered direction ------------------
25902 // *-> this can be a neighbor of the cell itself or a neighbor of *
25903 // * its parent, grandparent, and so forth *
25904 // ----------------------------------------------------------------
25905
25906 // Timw: use Spliparent for neighbor-search for SplitClones
25907 MInt gridcellId = cellId;
25908 if(a_hasProperty(cellId, SolverCell::IsSplitClone)) {
25909 gridcellId = m_splitChildToSplitCell.find(cellId)->second;
25910 }
25911 // check if cell has a neighbor in the investigated
25912 // direction -> nghbr on the same level (stored in m_nghbrIds)
25913 if(a_hasNeighbor(gridcellId, dirId) > 0
25914 && (a_level(c_neighborId(gridcellId, dirId)) <= maxRefinementLevel())) {
25915 // -> cell has a neighbor
25916 // this neighbor:
25917 nghbrId = c_neighborId(gridcellId, dirId);
25918
25919 // --------------------------------------------------------------
25920 // --- investigate neighbor -------------------------------------
25921 // *-> check if neighbor has children, grandchildren, and so *
25922 // * forth, which are direct neighbors of the considered cell *
25923 // --------------------------------------------------------------
25924 // multilevel
25925 if(a_hasProperty(nghbrId, SolverCell::IsOnCurrentMGLevel)) {
25926 // neighbor is not a parent and can be stored as neighbor of
25927 // the cell cellId
25928
25929 // here, special situations for bndry cells can occur! -> nghbr is on same level, so
25930 // no special treatment concerning levels needed
25931 if(bndryId > -1) {
25932 if(m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2 + 1] > -1) {
25933 // split surface with different neighbors. special treatment.
25934 // check if first neighbor is also valid
25935 if(m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2] > -1) {
25936 m_storeNghbrIds[pos] = m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2];
25937 pos++;
25938 if(m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2]
25939 != m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2 + 1]) {
25940 m_storeNghbrIds[pos] = m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2];
25941 pos++;
25942 } else {
25943 cerr << " warning in findNghbrIdsMGC - assumed split face with two different "
25944 "neighbors. But neighbors are identical... "
25945 << endl;
25946 cerr << " cell: " << cellId << " bndryId: " << bndryId << " dir: " << dirId
25947 << " nghbrId: " << nghbrId << " nghbr1 in m_bndryNghbrs: "
25948 << m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2]
25949 << " nghbr2 in m_bndryNghbrs: "
25950 << m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2 + 1] << endl;
25951 }
25952 } else {
25953 cerr << " cell: " << cellId << " bndryId: " << bndryId << " dir: " << dirId
25954 << " nghbrId: " << nghbrId << " nghbr1 in m_bndryNghbrs: "
25955 << m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2]
25956 << " nghbr2 in m_bndryNghbrs: "
25957 << m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2 + 1] << endl;
25958
25959 stringstream errorMessage;
25960 errorMessage << " error in findNghbrIdsMGC - assumed fluid side to split "
25961 "relative, but -1 neighbor stored in m_bndryNghbrs... ";
25962 mTerm(1, AT_, errorMessage.str());
25963 }
25964 } else if(nghbrId != m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2]) {
25965 // split neighbor. special treatment
25966 // both on same level, not a non fuid side, so neighbor should be ok!
25967 // double check nevertheless...
25968 if(m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2] > -1) {
25969 m_storeNghbrIds[pos] = m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2];
25970 pos++;
25971 } else {
25972 stringstream errorMessage;
25973 errorMessage << " error in findNghbrIdsMGC - assumed fluid side to split "
25974 "relative, but -1 neighbor stored in m_bndryNghbrs... "
25975 << endl
25976 << " cell: " << cellId << " bndryId: " << bndryId << " dir: " << dirId
25977 << " nghbrId: " << nghbrId << " nghbr in m_bndryNghbrs: "
25978 << m_fvBndryCnd->m_bndryNghbrs[bndryId * 2 * m_noDirs + dirId * 2];
25979 mTerm(1, AT_, errorMessage.str());
25980 }
25981 } else {
25982 // regular boundary cell
25983 // both on the same level, not a non fluid side, so neighbor is ok!
25984 m_storeNghbrIds[pos] = nghbrId;
25985 pos++;
25986 }
25987 } else {
25988 m_storeNghbrIds[pos] = nghbrId;
25989 pos++;
25990 }
25991
25992 } else { // here, bndry cell treatment not included, so be careful with level changes on
25993 // bndry cells!
25994
25995 // neighbor is a parent
25996 // investigate all children and grandchildren
25997
25998 // temporary array that holds all parent cells to be
25999 // investigated
26000 tempNghbrs[0] = nghbrId;
26001 nghbrsFound = false;
26002
26003 // ----------------------------------------------------------
26004 // --- investigate all neighbors that are parents -----------
26005 // ----------------------------------------------------------
26006
26007 maxIndex = 1;
26008 while(nghbrsFound == false) {
26009 // initialize counter for the number of investigated
26010 // neighboring children that are parents themselves and
26011 // thus added to a temporary array
26012 k = 0;
26013
26014 // ------ loop over all neighbor parents ------------------
26015 for(MInt index = 0; index < maxIndex; index++) {
26016 // investigated neighbor parent cell
26017 nghbrId = tempNghbrs[index];
26018
26019 if(c_noChildren(nghbrId)) {
26020 // in case none of the children is identified
26021 // as a direct neighbor, do nothing, since then
26022 // the considered cell side is a non-fluid side
26023
26024 for(MInt c = 0; c < noChildrenPerSide; c++) {
26025 nghbrChildId = c_childId(nghbrId, sideToChildren[otherDir[dirId]][c]);
26026
26027 if(nghbrChildId > -1) {
26028 // multilevel
26029 if((c_noChildren(nghbrChildId) == 0 && a_level(nghbrChildId) <= maxRefinementLevel())
26030 || (c_noChildren(nghbrChildId) > 0 && a_level(nghbrChildId) == maxRefinementLevel())) {
26031 // child cell is not a parent and stored
26032 // as a neighbor
26033
26034 // check if a fluid connection exists
26035 nghbrBndryId = a_bndryId(nghbrChildId);
26036 nonFluidSide = false;
26037 if(nghbrBndryId > -1) {
26038 if(m_fvBndryCnd->m_bndryCells->a[nghbrBndryId].m_externalFaces[dirId]) {
26039 nonFluidSide = true;
26040 break;
26041 }
26042 }
26043 if(!nonFluidSide) {
26044 m_storeNghbrIds[pos] = nghbrChildId;
26045 pos++;
26046 }
26047 } else {
26048 // add child cell to temporary array for
26049 // further investigation
26050 tempNghbrs1[k] = nghbrChildId;
26051 k++;
26052 }
26053 }
26054 }
26055 }
26056 }
26057
26058 maxIndex = k;
26059 if(k == 0) {
26060 nghbrsFound = true;
26061 } else {
26062 // transfer the cells collected in tempNghbrs1 to
26063 // tempNghbrs
26064 for(MInt l = 0; l < k; l++) {
26065 tempNghbrs[l] = tempNghbrs1[l];
26066 }
26067 }
26068 }
26069 }
26070
26071 } else { // no nghbr on equal level -> nghbr has lower level!
26072
26073 // -> cell does not have a neighbor of equivalent level
26074 currentCellId = cellId;
26075 // Timw: use Spliparent for neighbor-search for SplitClones
26076 if(a_hasProperty(currentCellId, SolverCell::IsSplitClone)) {
26077 currentCellId = m_splitChildToSplitCell.find(currentCellId)->second;
26078 }
26079
26080 // loop until a parent is found that has a neighbor in considered
26081 // direction
26082 // break when the parent ID becomes -1 (boundary in direction)
26083 while(nghbrExist == false) {
26084 // if parent does not exist, break
26085 if(c_parentId(currentCellId) == -1) {
26086 break;
26087 }
26088
26089 // break if currentCell does not lie at the parent cell face
26090 // whose normal points to considered direction
26091 for(MInt c = 0; c < noChildrenPerSide; c++) {
26092 if(currentCellId == c_childId(c_parentId(currentCellId), sideToChildren[dirId][c])) {
26093 // identify parentId of current cell and store it
26094 // as current cell
26095 currentCellId = c_parentId(currentCellId);
26096
26097 // check if current cell has a neighbor in regarded direction
26098 if(a_hasNeighbor(currentCellId, dirId) > 0) {
26099 nghbrExist = true;
26100 nghbrId = c_neighborId(currentCellId, dirId);
26101 // store this neighbor if it is regarded - multilevel
26102 if(a_hasProperty(nghbrId, SolverCell::IsOnCurrentMGLevel)) {
26103 // check if a fluid connection exists
26104 nghbrBndryId = a_bndryId(nghbrId);
26105 nonFluidSide = false;
26106 if(nghbrBndryId > -1) {
26107 if(m_fvBndryCnd->m_bndryCells->a[nghbrBndryId].m_externalFaces[dirId]) {
26108 nonFluidSide = true;
26109 break;
26110 }
26111 }
26112 if(!nonFluidSide) {
26113 m_storeNghbrIds[pos] = nghbrId;
26114 pos++;
26115 }
26116 }
26117 }
26118 break;
26119 }
26120 }
26121 break;
26122 }
26123 }
26124 }
26125 }
26126 }
26127 }
26128 m_identNghbrIds[noCellIds * m_noDirs] = pos;
26129}

◆ findWallNormalCellIds()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::findWallNormalCellIds
protected

Definition at line 34544 of file fvcartesiansolverxd.cpp.

34544 {
34545 TRACE();
34546
34547 MPI_Barrier(mpiComm(), AT_);
34548
34549 m_log << "Finding Wall Normal Cell Ids ... " << endl;
34550
34551 ScratchSpace<MInt> localNoWallNormalPointCoords(noDomains(), AT_, "localNoWallNormalPointCoords");
34552 localNoWallNormalPointCoords.fill(0);
34553
34554 ScratchSpace<MInt> localNoWallNormalPoints(noDomains(), AT_, "localNoWallNormalPoints");
34555 localNoWallNormalPoints.fill(0);
34556
34557 localNoWallNormalPointCoords[domainId()] = m_wallNormalPointCoords.size();
34558
34559 localNoWallNormalPoints[domainId()] = (m_wallNormalPointCoords.size() / nDim);
34560
34561 MPI_Allgather(&localNoWallNormalPointCoords[domainId()], 1, MPI_INT, &localNoWallNormalPointCoords[0], 1, MPI_INT,
34562 mpiComm(), AT_, "localNoWallNormalPointCoords", "localNoWallNormalPointCoords");
34563 MPI_Allgather(&localNoWallNormalPoints[domainId()], 1, MPI_INT, &localNoWallNormalPoints[0], 1, MPI_INT, mpiComm(),
34564 AT_, "localNoWallNormalPoints", "localNoWallNormalPoints");
34565
34566 // Output vector for domainId to which point belongs to
34567 m_wallNormalPointDomains.resize(localNoWallNormalPoints[domainId()]);
34568 std::fill(m_wallNormalPointDomains.begin(), m_wallNormalPointDomains.end(), -1);
34569
34570 // Output vector for cellId in which point lies
34571 m_wallNormalPointCellIDs.resize(localNoWallNormalPoints[domainId()]);
34572 std::fill(m_wallNormalPointCellIDs.begin(), m_wallNormalPointCellIDs.end(), -1);
34573 // temporary vector containing the neighbors cell Ids
34574 std::vector<MInt> tempNeghbrIds;
34575 tempNeghbrIds.clear();
34576
34577 // Output vector for neghbrIds of cellId in which point lies
34578 m_neighborPointIds.resize(localNoWallNormalPoints[domainId()]);
34579 std::fill(m_neighborPointIds.begin(), m_neighborPointIds.end(), tempNeghbrIds);
34580
34581 for(MInt dom = 0; dom < noDomains(); dom++) {
34582 MInt noCoords = localNoWallNormalPointCoords[dom];
34583 MInt noPoints = localNoWallNormalPoints[dom];
34584
34585 if(noPoints > 0) {
34586 // temporary vector containing found cell's domainId
34587 std::vector<MInt> domainContainingCell;
34588 domainContainingCell.clear();
34589 // temporary vector containing found cellId
34590 std::vector<MInt> normalPointCellId;
34591 normalPointCellId.clear();
34592 // temporary vector containing the index of point (order, e.g first point, etc)
34593 std::vector<MInt> placement;
34594 placement.clear();
34595
34596 // temporary vector containing the neighbors cell Ids
34597 std::vector<MInt> neghbrIds;
34598 neghbrIds.clear();
34599
34600 // vector collecting the vectors containing the neighbors cellIds
34601 std::vector<std::vector<MInt>> neghbrIdsofId;
34602 neghbrIdsofId.clear();
34603
34604 // neighbor ids as one dimensional array for communication
34605 std::vector<MInt> oneDimNeghbrs;
34606 oneDimNeghbrs.clear();
34607
34608 std::vector<MInt> noOfNeghbrs;
34609 noOfNeghbrs.clear();
34610 // temporary coord array for croodinate distribution to other domains
34611 ScratchSpace<MFloat> sendCoordsBuffer(noCoords, AT_, "sendCoordsBuffer");
34612 sendCoordsBuffer.fill(0.0);
34613
34614 // array for all domainIds for gathering
34615 ScratchSpace<MInt> allDomainsContainingCell(noPoints, AT_, "allDomainsContainingCell");
34616 allDomainsContainingCell.fill(-1);
34617 // array for all point cellIds for gathering
34618 ScratchSpace<MInt> allNormalPointCellIds(noPoints, AT_, "allNormalPointCellIds");
34619 allNormalPointCellIds.fill(-1);
34620
34621 ScratchSpace<MInt> noNeighbors(noPoints, AT_, "noNeighbors");
34622 noNeighbors.fill(-1);
34623
34624 ScratchSpace<MInt> allNeighbors(noPoints * ((pow(3, nDim) - 1) * pow(2, nDim) + 1), AT_, "allNeighbors");
34625 allNeighbors.fill(-1);
34626
34627 // array fpr all neighbrIds for gathering
34628 std::vector<std::vector<MInt>> allNeghbrIdsofId;
34629 allNeghbrIdsofId.clear();
34630
34631 // array for determining, which point index from distributed coords array responds to which calculated cellId
34632 ScratchSpace<MInt> allPlacements(noPoints, AT_, "allPlacements");
34633 allPlacements.fill(-1);
34634
34635 // number of points for the send/recv buffer count
34636 ScratchSpace<MInt> bufferNoWallNormalPoints(noDomains(), AT_, "bufferNoWallNormalPoints");
34637 bufferNoWallNormalPoints.fill(0);
34638
34639 ScratchSpace<MInt> bufferNoNeighbor(noDomains(), AT_, "bufferNoNeighborOffsets");
34640 bufferNoNeighbor.fill(0);
34641
34642 // point offsets for displacement in the recombined list
34643 ScratchSpace<MInt> bufferPointOffsets(noDomains(), AT_, "bufferPointOffsets");
34644 bufferPointOffsets.fill(0);
34645
34646 ScratchSpace<MInt> bufferNeighborOffsets(noDomains(), AT_, "bufferNeighborOffsets");
34647 bufferNeighborOffsets.fill(0);
34648
34649 // copy localNormalPointCoords to coordBuffer for broadcasting
34650 if(domainId() == dom) {
34651 for(MInt c = 0; c < noCoords; c++) {
34652 sendCoordsBuffer[c] = m_wallNormalPointCoords[c];
34653 }
34654 }
34655
34656 // boradcast point coords from one working domain to all domains
34657 MPI_Bcast(&sendCoordsBuffer[0], noCoords, MPI_DOUBLE, dom, mpiComm(), AT_, "sendCoordsBuffer");
34658
34659 // take coords from the localWallPointCoords list to run findContainingLeafCell
34660 for(MInt p = 0; p < noPoints; p++) {
34661 MInt tmpId = -1;
34662 MFloat pointCoords[nDim];
34663
34664 pointCoords[0] = sendCoordsBuffer[nDim * p];
34665 pointCoords[1] = sendCoordsBuffer[nDim * p + 1];
34666
34667 if(nDim == 3) {
34668 pointCoords[2] = sendCoordsBuffer[nDim * p + 2];
34669 }
34670
34671 // checking coordinates with findContainingLeafCell
34672 tmpId = grid().raw().findContainingLeafCell(pointCoords);
34673
34674 // checking wether the cell is a part of the domain and wether it is not halo
34675 if(tmpId != -1 && !a_hasProperty(tmpId, SolverCell::IsHalo)) {
34676 // make a list of all neighbors
34677 neghbrIds = findWallNormalNeighbors(tmpId);
34678 // distance criteria: make sure only direct neighbors are included:
34679 std::vector<MInt> deleteElements;
34680 deleteElements.clear();
34681
34682 for(MInt i = 0; i < MInt(neghbrIds.size()); i++) {
34683 MFloat distance = 0.0;
34684 // initialize cut off factor to biggest value
34685 MFloat dist_factor = 2.4;
34686 MFloat dist_x = a_coordinate(neghbrIds[i], 0) - a_coordinate(tmpId, 0);
34687 MFloat dist_y = a_coordinate(neghbrIds[i], 1) - a_coordinate(tmpId, 1);
34688 MFloat dist_z = 0.0;
34689 // reference distance
34690 MFloat dist_ref = grid().cellLengthAtLevel(a_level(tmpId));
34691
34692 if(nDim == 3) {
34693 dist_z = a_coordinate(neghbrIds[i], 2) - a_coordinate(tmpId, 2);
34694 }
34695
34696 if(abs(dist_x) < 0.05 * dist_ref || abs(dist_y) < 0.05 * dist_ref || abs(dist_z) < 0.05 * dist_ref) {
34697 dist_factor = 1.9;
34698 }
34699
34700 if((abs(dist_x) < 0.05 * dist_ref && abs(dist_y) < 0.05 * dist_ref)
34701 || (abs(dist_x) < 0.05 * dist_ref && abs(dist_z) < 0.05 * dist_ref)
34702 || (abs(dist_y) < 0.05 * dist_ref && abs(dist_z) < 0.05 * dist_ref)) {
34703 dist_factor = 1.33;
34704 }
34705
34706 distance = sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z);
34707 if(distance > dist_factor * grid().cellLengthAtLevel(a_level(tmpId))) {
34708 deleteElements.push_back(i);
34709 }
34710 }
34711
34712 for(MInt i = 0; i < MInt(deleteElements.size()); i++) {
34713 MInt eraseElement = deleteElements.end()[-1 - i];
34714 neghbrIds.erase(neghbrIds.begin() + eraseElement);
34715 }
34716
34717
34718 MInt d = domainId();
34719 // add domain to the list
34720 domainContainingCell.push_back(d);
34721 // add cellId if to the list
34722 normalPointCellId.push_back(tmpId);
34723 // add placement of the point
34724 placement.push_back(p);
34725 // collect neighbrIds for every Id
34726 neghbrIdsofId.push_back(neghbrIds);
34727
34728 // clear temporary vectors
34729 neghbrIds.clear();
34730 }
34731 }
34732
34733 // transform 2D neighbor id array into one dimensional array for communication
34734 oneDimNeghbrs.clear();
34735 for(MInt i = 0; i < MInt(neghbrIdsofId.size()); i++) {
34736 noOfNeghbrs.push_back(MInt(neghbrIdsofId[i].size()));
34737 for(MInt j = 0; j < MInt(neghbrIdsofId[i].size()); j++) {
34738 oneDimNeghbrs.push_back(neghbrIdsofId[i][j]);
34739 }
34740 }
34741
34742 bufferNoWallNormalPoints[domainId()] = normalPointCellId.size();
34743
34744 for(MInt i = 0; i < MInt(neghbrIdsofId.size()); i++) {
34745 bufferNoNeighbor[domainId()] += neghbrIdsofId[i].size();
34746 }
34747
34748 MPI_Allgather(&bufferNoNeighbor[domainId()], 1, MPI_INT, &bufferNoNeighbor[0], 1, MPI_INT, mpiComm(), AT_,
34749 "bufferNoNeighbor", "bufferNoNeighbor");
34750
34751 MPI_Allgather(&bufferNoWallNormalPoints[domainId()], 1, MPI_INT, &bufferNoWallNormalPoints[0], 1, MPI_INT,
34752 mpiComm(), AT_, "bufferNoWallNormalPoints", "bufferNoWallNormalPoints");
34753
34754
34755 for(MInt d = 0; d < noDomains(); d++) {
34756 if(d > 0) {
34757 bufferPointOffsets[d] = bufferPointOffsets[d - 1] + bufferNoWallNormalPoints[d - 1];
34758 bufferNeighborOffsets[d] = bufferNeighborOffsets[d - 1] + bufferNoNeighbor[d - 1];
34759 }
34760 }
34761
34762 // gather domainIds
34763 MPI_Gatherv(&domainContainingCell[0], bufferNoWallNormalPoints[domainId()], MPI_INT, &allDomainsContainingCell[0],
34764 &bufferNoWallNormalPoints[0], &bufferPointOffsets[0], MPI_INT, dom, mpiComm(), AT_,
34765 "domainContainingCell", "allDomainsContainingCell");
34766
34767 // gather cellIds
34768 MPI_Gatherv(&normalPointCellId[0], bufferNoWallNormalPoints[domainId()], MPI_INT, &allNormalPointCellIds[0],
34769 &bufferNoWallNormalPoints[0], &bufferPointOffsets[0], MPI_INT, dom, mpiComm(), AT_,
34770 "normalPointCellId", "allNormalPointCellIds");
34771
34772 // gather placements
34773 MPI_Gatherv(&placement[0], bufferNoWallNormalPoints[domainId()], MPI_INT, &allPlacements[0],
34774 &bufferNoWallNormalPoints[0], &bufferPointOffsets[0], MPI_INT, dom, mpiComm(), AT_, "placement",
34775 "allPlacements");
34776
34777 // gather neighbors
34778 MPI_Gatherv(&oneDimNeghbrs[0], bufferNoNeighbor[domainId()], MPI_INT, &allNeighbors[0], &bufferNoNeighbor[0],
34779 &bufferNeighborOffsets[0], MPI_INT, dom, mpiComm(), AT_, "oneDimNeghbrs", "allNeighbors");
34780
34781 // gather number of neighbors per point
34782 MPI_Gatherv(&noOfNeghbrs[0], bufferNoWallNormalPoints[domainId()], MPI_INT, &noNeighbors[0],
34783 &bufferNoWallNormalPoints[0], &bufferPointOffsets[0], MPI_INT, dom, mpiComm(), AT_, "noOfNeghbrs",
34784 "noNeighbors");
34785
34786 if(domainId() == dom) {
34787 MInt count = 0;
34788 MInt count_next = 0;
34789 std::vector<MInt> tempVec;
34790 tempVec.clear();
34791 for(MInt k = 0; k < noPoints; k++) {
34792 count_next = count_next + noNeighbors[k];
34793 for(MInt j = count; j < count_next; j++) {
34794 tempVec.push_back(allNeighbors[j]);
34795 }
34796
34797 allNeghbrIdsofId.push_back(tempVec);
34798 count = count_next;
34799 tempVec.clear();
34800 }
34801
34802 for(MInt c = 0; c < noPoints; c++) {
34803 MInt p = allPlacements[c];
34804 if(p != -1) {
34805 m_wallNormalPointDomains[p] = allDomainsContainingCell[c];
34806 m_wallNormalPointCellIDs[p] = allNormalPointCellIds[c];
34807 m_neighborPointIds[p] = allNeghbrIdsofId[c];
34808 }
34809 }
34810 }
34811 }
34812 }
34813}
std::vector< MInt > findWallNormalNeighbors(MInt pointId)
std::vector< std::vector< MInt > > m_neighborPointIds
std::vector< MInt > m_wallNormalPointDomains
std::vector< MInt > m_wallNormalPointCellIDs
int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Gatherv

◆ findWallNormalNeighbors()

template<MInt nDim_, class SysEqn >
std::vector< MInt > FvCartesianSolverXD< nDim_, SysEqn >::findWallNormalNeighbors ( MInt  pointId)
protected

Definition at line 34816 of file fvcartesiansolverxd.cpp.

34816 {
34817 TRACE();
34818
34819 m_log << "Find Neighbor Points of Wall Normal Point" << endl;
34820
34821 const MInt tmpId = pointId;
34822 MInt tempNeghbrId = 0;
34823
34824 // temporary vector containing the neighbors cell Ids
34825 std::vector<MInt> neghbrIds;
34826 neghbrIds.clear();
34827 // temporary vector containing the directions in which neighbors were found
34828 std::vector<MInt> dirOfNeghbrIds;
34829 dirOfNeghbrIds.clear();
34830 // temporary vector containing the diagonal neighbor cellIds
34831 std::vector<MInt> diagNeghbrIds;
34832 diagNeghbrIds.clear();
34833 // temporary vector containing the directions in which diaganol neighbors were found
34834 std::vector<std::vector<MInt>> dirOfDiagNeghbrIds;
34835 dirOfDiagNeghbrIds.clear();
34836
34837 // checking wether the cell is a part of the domain and wether it is not halo
34838 if(tmpId != -1 && !a_hasProperty(tmpId, SolverCell::IsHalo)) {
34839 // make a list of all neighbors
34840 if(!a_isBndryGhostCell(tmpId)) {
34841 if(a_hasProperty(tmpId, SolverCell::IsOnCurrentMGLevel)) {
34842 for(MInt dir = 0; dir < m_noDirs; dir++) {
34843 if(a_hasNeighbor(tmpId, dir) > 0 && checkNeighborActive(tmpId, dir)) {
34844 tempNeghbrId = c_neighborId(tmpId, dir);
34845 if(a_hasProperty(tempNeghbrId, SolverCell::IsOnCurrentMGLevel)) {
34846 neghbrIds.push_back(tempNeghbrId);
34847 dirOfNeghbrIds.push_back(dir);
34848 } else {
34849 // investigate neighbor children
34850 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
34851 if(c_childId(tempNeghbrId, childId) == -1) {
34852 continue;
34853 }
34854 neghbrIds.push_back(c_childId(tempNeghbrId, childId));
34855 dirOfNeghbrIds.push_back(dir);
34856 }
34857 }
34858 }
34859 }
34860
34861 // 2D case find all neighbors in xy plane
34862 for(MInt dir = 0; dir < 2; dir++) {
34863 if(a_hasNeighbor(neghbrIds[dir], 2) > 0 && checkNeighborActive(neghbrIds[dir], 2)) {
34864 tempNeghbrId = c_neighborId(neghbrIds[dir], 2);
34865 if(a_hasProperty(tempNeghbrId, SolverCell::IsOnCurrentMGLevel)) {
34866 diagNeghbrIds.push_back(tempNeghbrId);
34867 dirOfDiagNeghbrIds.push_back({dir, 2});
34868 } else {
34869 // investigate neighbor children
34870 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
34871 if(c_childId(tempNeghbrId, childId) == -1) {
34872 continue;
34873 }
34874 neghbrIds.push_back(c_childId(tempNeghbrId, childId));
34875 dirOfDiagNeghbrIds.push_back({dir, 2});
34876 }
34877 }
34878 }
34879
34880 if(a_hasNeighbor(neghbrIds[dir], 3) > 0 && checkNeighborActive(neghbrIds[dir], 3)) {
34881 tempNeghbrId = c_neighborId(neghbrIds[dir], 3);
34882 if(a_hasProperty(tempNeghbrId, SolverCell::IsOnCurrentMGLevel)) {
34883 diagNeghbrIds.push_back(tempNeghbrId);
34884 dirOfDiagNeghbrIds.push_back({dir, 3});
34885 } else {
34886 // investigate neighbor children
34887 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
34888 if(c_childId(tempNeghbrId, childId) == -1) {
34889 continue;
34890 }
34891 neghbrIds.push_back(c_childId(tempNeghbrId, childId));
34892 dirOfDiagNeghbrIds.push_back({dir, 3});
34893 }
34894 }
34895 }
34896 }
34897
34898 // search in all orthogonal directions of the neighbor you just found
34899 if(nDim == 3) {
34900 for(MInt i = 0; i < MInt(neghbrIds.size()); i++) {
34901 MInt tempDir[4];
34902 if(dirOfNeghbrIds[i] == 0 || dirOfNeghbrIds[i] == 1) {
34903 tempDir[0] = 2;
34904 tempDir[1] = 3;
34905 tempDir[2] = 4;
34906 tempDir[3] = 5;
34907 }
34908 if(dirOfNeghbrIds[i] == 2 || dirOfNeghbrIds[i] == 3) {
34909 tempDir[0] = 0;
34910 tempDir[1] = 1;
34911 tempDir[2] = 4;
34912 tempDir[3] = 5;
34913 }
34914 if(dirOfNeghbrIds[i] == 4 || dirOfNeghbrIds[i] == 5) {
34915 tempDir[0] = 0;
34916 tempDir[1] = 1;
34917 tempDir[2] = 2;
34918 tempDir[3] = 3;
34919 }
34920
34921 for(MInt j = 0; j < 4; j++) {
34922 if(a_hasNeighbor(neghbrIds[i], tempDir[j]) > 0 && checkNeighborActive(neghbrIds[i], tempDir[j])) {
34923 tempNeghbrId = c_neighborId(neghbrIds[i], tempDir[j]);
34924 if(a_hasProperty(tempNeghbrId, SolverCell::IsOnCurrentMGLevel)) {
34925 diagNeghbrIds.push_back(tempNeghbrId);
34926 dirOfDiagNeghbrIds.push_back({dirOfNeghbrIds[i], tempDir[j]});
34927 } else {
34928 // investigate neighbor children
34929 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
34930 if(c_childId(tempNeghbrId, childId) == -1) {
34931 continue;
34932 }
34933 diagNeghbrIds.push_back(c_childId(tempNeghbrId, childId));
34934 dirOfDiagNeghbrIds.push_back({dirOfNeghbrIds[i], tempDir[j]});
34935 }
34936 }
34937 }
34938 }
34939 }
34940 }
34941
34942 if(nDim == 3) {
34943 if(neghbrIds.size() > 5) {
34944 for(MInt dir = 1; dir < nDim; dir++) {
34945 MInt dirOfNeghbr = 2 * dir + 2;
34946 if(dirOfNeghbr == 6) {
34947 dirOfNeghbr -= 6;
34948 }
34949 if(a_hasNeighbor(neghbrIds[2 * dir], dirOfNeghbr) > 0
34950 && checkNeighborActive(neghbrIds[2 * dir], dirOfNeghbr)) {
34951 tempNeghbrId = c_neighborId(neghbrIds[2 * dir], dirOfNeghbr);
34952 if(a_hasProperty(tempNeghbrId, SolverCell::IsOnCurrentMGLevel)) {
34953 diagNeghbrIds.push_back(tempNeghbrId);
34954 } else {
34955 // investigate neighbor children
34956 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
34957 if(c_childId(tempNeghbrId, childId) == -1) {
34958 continue;
34959 }
34960 neghbrIds.push_back(c_childId(tempNeghbrId, childId));
34961 }
34962 }
34963 }
34964
34965 if(a_hasNeighbor(neghbrIds[2 * dir], dirOfNeghbr + 1) > 0
34966 && checkNeighborActive(neghbrIds[2 * dir], dirOfNeghbr + 1)) {
34967 tempNeghbrId = c_neighborId(neghbrIds[2 * dir], dirOfNeghbr + 1);
34968 if(a_hasProperty(tempNeghbrId, SolverCell::IsOnCurrentMGLevel)) {
34969 diagNeghbrIds.push_back(tempNeghbrId);
34970 } else {
34971 // investigate neighbor children
34972 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
34973 if(c_childId(tempNeghbrId, childId) == -1) {
34974 continue;
34975 }
34976 neghbrIds.push_back(c_childId(tempNeghbrId, childId));
34977 }
34978 }
34979 }
34980
34981 if(a_hasNeighbor(neghbrIds[2 * dir + 1], dirOfNeghbr) > 0
34982 && checkNeighborActive(neghbrIds[2 * dir + 1], dirOfNeghbr)) {
34983 tempNeghbrId = c_neighborId(neghbrIds[2 * dir + 1], dirOfNeghbr);
34984 if(a_hasProperty(tempNeghbrId, SolverCell::IsOnCurrentMGLevel)) {
34985 diagNeghbrIds.push_back(tempNeghbrId);
34986 // cout << "found diag neighbr three"<<endl;
34987 } else {
34988 // investigate neighbor children
34989 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
34990 if(c_childId(tempNeghbrId, childId) == -1) {
34991 continue;
34992 }
34993 neghbrIds.push_back(c_childId(tempNeghbrId, childId));
34994 }
34995 }
34996 }
34997
34998 if(a_hasNeighbor(neghbrIds[2 * dir + 1], dirOfNeghbr + 1) > 0
34999 && checkNeighborActive(neghbrIds[2 * dir + 1], dirOfNeghbr + 1)) {
35000 tempNeghbrId = c_neighborId(neghbrIds[2 * dir + 1], dirOfNeghbr + 1);
35001 if(a_hasProperty(tempNeghbrId, SolverCell::IsOnCurrentMGLevel)) {
35002 diagNeghbrIds.push_back(tempNeghbrId);
35003 } else {
35004 // investigate neighbor children
35005 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
35006 if(c_childId(tempNeghbrId, childId) == -1) {
35007 continue;
35008 }
35009 neghbrIds.push_back(c_childId(tempNeghbrId, childId));
35010 }
35011 }
35012 }
35013 }
35014 }
35015
35016 // find all tridiagonal neighbors
35017 if(diagNeghbrIds.size() > 3) {
35018 for(MInt dir = 0; dir < 4; dir++) {
35019 if(a_hasNeighbor(diagNeghbrIds[dir], 4) > 0 && checkNeighborActive(diagNeghbrIds[dir], 4)) {
35020 tempNeghbrId = c_neighborId(diagNeghbrIds[dir], 4);
35021 if(a_hasProperty(tempNeghbrId, SolverCell::IsOnCurrentMGLevel)) {
35022 diagNeghbrIds.push_back(tempNeghbrId);
35023 } else {
35024 // investigate neighbor children
35025 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
35026 if(c_childId(tempNeghbrId, childId) == -1) {
35027 continue;
35028 }
35029 neghbrIds.push_back(c_childId(tempNeghbrId, childId));
35030 }
35031 }
35032 }
35033
35034 if(a_hasNeighbor(diagNeghbrIds[dir], 5) > 0 && checkNeighborActive(diagNeghbrIds[dir], 5)) {
35035 tempNeghbrId = c_neighborId(diagNeghbrIds[dir], 5);
35036 if(a_hasProperty(tempNeghbrId, SolverCell::IsOnCurrentMGLevel)) {
35037 diagNeghbrIds.push_back(tempNeghbrId);
35038 } else {
35039 // investigate neighbor children
35040 for(MInt childId = 0; childId < IPOW2(nDim); childId++) {
35041 if(c_childId(tempNeghbrId, childId) == -1) {
35042 continue;
35043 }
35044 neghbrIds.push_back(c_childId(tempNeghbrId, childId));
35045 }
35046 }
35047 }
35048 }
35049 }
35050 }
35051 }
35052 }
35053 }
35054
35055 // combine the two neighbor vectors and erase elements that were found multiple times
35056 neghbrIds.insert(neghbrIds.end(), diagNeghbrIds.begin(), diagNeghbrIds.end());
35057 sort(neghbrIds.begin(), neghbrIds.end());
35058 neghbrIds.erase(unique(neghbrIds.begin(), neghbrIds.end()), neghbrIds.end());
35059 // include the actual cell after sorting to have it in the last place of the vector
35060 neghbrIds.push_back(tmpId);
35061 m_log << "done" << endl;
35062 return neghbrIds;
35063}

◆ finishMpiExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::finishMpiExchange
Author
Michael Schlottke-Lakemper (mic) mic@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2016-11-16

Afterwards, new receive requests are posted.

Definition at line 6455 of file fvcartesiansolverxd.cpp.

6455 {
6456 TRACE();
6457
6459 mTerm(1, "MPI receive requests are not open.");
6460 }
6461
6462 MBool useWaitsome = false; // true;
6463 RECORD_TIMER_START(m_tscatter);
6464
6465 if(useWaitsome) {
6466 const MBool loadWasRunning = this->isLoadTimerRunning();
6467 if(loadWasRunning) {
6468 this->stopLoadTimer(AT_);
6469 this->startIdleTimer(AT_);
6470 this->disableDlbTimers();
6471 }
6472
6473 // RECV: Wait for old receive requests to finish (blocking) and unpack buffers
6474 MIntScratchSpace completedIds(noNeighborDomains(), AT_, "completedIds");
6475 while(true) {
6476 // Wait for old receive requests (blocking)
6477 MInt noCompleted = 0;
6478 RECORD_TIMER_START(m_tscatterWaitSome);
6479 MPI_Waitsome((MInt)m_maxLvlMpiRecvNeighbor.size(), m_mpi_receiveRequest, &noCompleted, &completedIds[0],
6480 MPI_STATUSES_IGNORE, AT_);
6481 RECORD_TIMER_STOP(m_tscatterWaitSome);
6482
6483 // Exit loop if no more unfinished requests are found
6484 if(noCompleted == MPI_UNDEFINED) {
6485 break;
6486 }
6487
6488 // Unpack buffers
6489 for(MInt i = 0; i < noCompleted; i++) {
6490 const MInt completedId = completedIds[i];
6491 MInt bufferCounter = 0;
6492 for(MInt j = 0; j < m_noMaxLevelHaloCells[completedId]; j++) {
6493 copy_n(&m_receiveBuffersNoBlocking[completedId][bufferCounter],
6495 &a_pvariable(m_maxLevelHaloCells[completedId][j], 0));
6496 bufferCounter += m_dataBlockSize;
6497 }
6498 }
6499 }
6500
6501 if(loadWasRunning) {
6502 this->reEnableDlbTimers();
6503 this->stopIdleTimer(AT_);
6504 this->startLoadTimer(AT_);
6505 }
6506 } else {
6507 RECORD_TIMER_START(m_tscatterWaitSome);
6508 MPI_Waitall((MInt)m_maxLvlMpiRecvNeighbor.size(), m_mpi_receiveRequest, MPI_STATUSES_IGNORE, AT_);
6509 RECORD_TIMER_STOP(m_tscatterWaitSome);
6510
6511 // Unpack all buffers
6512 // for(MInt i = 0; i < noNeighborDomains(); i++) {
6513 for(MInt n = 0; n < (MInt)m_maxLvlMpiRecvNeighbor.size(); n++) {
6514 const MInt i = m_maxLvlMpiRecvNeighbor[n];
6515 MInt bufferCounter = 0;
6516 for(MInt j = 0; j < m_noMaxLevelHaloCells[i]; j++) {
6517 std::copy_n(&m_receiveBuffersNoBlocking[i][bufferCounter], m_dataBlockSize,
6518 &a_pvariable(m_maxLevelHaloCells[i][j], 0));
6519 bufferCounter += m_dataBlockSize;
6520 }
6521 }
6522 }
6523
6524 RECORD_TIMER_STOP(m_tscatter);
6525
6526 // RECV: Start receiving (non-blocking)
6527 // open new receive
6528 RECORD_TIMER_START(m_treceive);
6530 m_mpiRecvRequestsOpen = true;
6531 RECORD_TIMER_STOP(m_treceive);
6532}
std::vector< MInt > m_maxLvlMpiRecvNeighbor
MBool isLoadTimerRunning()
Definition: solver.h:303
void stopIdleTimer(const MString &name)
Definition: solver.h:297
void startIdleTimer(const MString &name)
Definition: solver.h:299
void startLoadTimer(const MString name)
Definition: solver.h:293
void reEnableDlbTimers()
Definition: solver.h:286
void stopLoadTimer(const MString &name)
Definition: solver.h:295
void disableDlbTimers()
Definition: solver.h:289
int MPI_Waitsome(int incount, MPI_Request array_of_requests[], int *outcount, int array_of_indices[], MPI_Status array_of_statuses[], const MString &name)
same as MPI_Waitsome
int MPI_Startall(int count, MPI_Request array_of_requests[], const MString &name)
same as MPI_Startall

◆ forceAdaptation()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::forceAdaptation ( )
inlineoverridevirtual

Reimplemented from Solver.

Definition at line 2408 of file fvcartesiansolverxd.h.

2408 {
2409 if(grid().hasInactiveRanks()) {
2410 this->startLoadTimer(AT_);
2411 MPI_Allreduce(MPI_IN_PLACE, &m_forceAdaptation, 1, MPI_C_BOOL, MPI_LOR, grid().raw().mpiComm(), AT_,
2412 "MPI_IN_PLACE", "m_forceAdaptation");
2413 this->stopLoadTimer(AT_);
2414 }
2415 return m_forceAdaptation;
2416 }

◆ forceTimeStep()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::forceTimeStep ( const MFloat  dt)
inline

Definition at line 2547 of file fvcartesiansolverxd.h.

2547{ m_timeStep = dt; }

◆ gather()

template<MInt nDim_, class SysEqn >
template<MBool exchangeAll_>
void FvCartesianSolverXD< nDim_, SysEqn >::gather
Template Parameters
exchangeAll_gather all window cell data and not just the data of the max-level window cells

Definition at line 7095 of file fvcartesiansolverxd.cpp.

7095 {
7096 TRACE();
7097 RECORD_TIMER_START(m_tgatherAndSend);
7098 RECORD_TIMER_START(m_tgather);
7099 for(MInt i = 0; i < noNeighborDomains(); i++) {
7100 MInt sendBufferCounter = 0;
7101 const MInt noWindows = (exchangeAll_) ? noWindowCells(i) : m_noMaxLevelWindowCells[i];
7102 for(MInt j = 0; j < noWindows; j++) {
7103 const MInt windowCell = (exchangeAll_) ? windowCellId(i, j) : m_maxLevelWindowCells[i][j];
7104 std::copy_n(&a_pvariable(windowCell, 0), m_dataBlockSize, &m_sendBuffers[i][sendBufferCounter]);
7105 sendBufferCounter += m_dataBlockSize;
7106 }
7107 }
7108 RECORD_TIMER_STOP(m_tgather);
7109 RECORD_TIMER_STOP(m_tgatherAndSend);
7110}
const MInt & windowCell(const MInt domainId, const MInt cellId) const

◆ gatherWMVars()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::gatherWMVars
protected

Definition at line 12058 of file fvcartesiansolverxd.cpp.

12058 {
12059 TRACE();
12060 const MInt noPVars = PV->noVariables;
12061 MInt sendBufferCounter = 0;
12062
12064 MFloatScratchSpace interpolatedVars(noPVars, AT_, "interpolatedVars");
12065 for(MInt dom = 0; dom < m_wmNoDomains; dom++) {
12066#ifdef _OPENMP
12067#pragma omp parallel for
12068#endif
12069 for(MInt ip = 0; ip < m_noWMImgPointsSend[dom]; ip++) {
12070 const MInt imgCellId = m_wmImgCellIds[dom][ip];
12071 const MFloat* imgCoords = &m_wmImgCoords[dom][nDim * ip];
12072 getInterpolatedVariablesInCell(imgCellId, &imgCoords[0], &interpolatedVars[0]);
12073 for(MInt v = 0; v < noPVars; v++) {
12074 m_wmImgSendBuffer[sendBufferCounter + (ip * noPVars) + v] = interpolatedVars[v];
12075 }
12076 }
12077 // moving the counter out of the loop allows openmp parallelization
12078 sendBufferCounter += m_noWMImgPointsSend[dom] * noPVars;
12079 }
12080 } else {
12081 for(MInt dom = 0; dom < m_wmNoDomains; dom++) {
12082 for(MInt ip = 0; ip < m_noWMImgPointsSend[dom]; ip++) {
12083 const MInt imgCellId = m_wmImgCellIds[dom][ip];
12084 for(MInt v = 0; v < noPVars; v++) {
12085 m_wmImgSendBuffer[sendBufferCounter + (ip * noPVars) + v] = a_pvariable(imgCellId, v);
12086 }
12087 }
12088 // moving the counter out of the loop allows openmp parallelization
12089 sendBufferCounter += m_noWMImgPointsSend[dom] * noPVars;
12090 }
12091 }
12092}
void getInterpolatedVariablesInCell(const MInt cellId, const MFloat *position, MFloat *vars)
calculates interpolated variables for a given position in a given cell
std::vector< std::vector< MInt > > m_wmImgCellIds
std::vector< std::vector< MFloat > > m_wmImgCoords

◆ generateBndryCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::generateBndryCells

Definition at line 25510 of file fvcartesiansolverxd.cpp.

25510 {
25511 TRACE();
25512
25513 m_log << "Generating FV boundary cells..." << endl;
25514
25515 // TODO labels:FV,DLB skip setting isInterface flag or just perform for halo cells if properties are communicated
25516 // during DLB
25518
25519 // TODO labels:FV,DLB speed this up for DLB reinitialization!
25521
25522 m_log << m_fvBndryCnd->m_bndryCells->size() << " boundary cells created" << endl;
25523}
virtual void generateBndryCells()
generate finite-volume boundary cells
void createBoundaryCells()
identifies bndry cells (Sets a_isInterface for the solver!)

◆ geometry() [1/2]

template<MInt nDim_, class SysEqn >
Geom & FvCartesianSolverXD< nDim_, SysEqn >::geometry ( )
inlineprotected

Definition at line 1413 of file fvcartesiansolverxd.h.

1413{ return *m_geometry; }
Geometry< nDim > * m_geometry

◆ geometry() [2/2]

template<MInt nDim_, class SysEqn >
const Geom & FvCartesianSolverXD< nDim_, SysEqn >::geometry ( ) const
inline

Access the solver's geometry

Definition at line 1399 of file fvcartesiansolverxd.h.

1399{ return *m_geometry; }

◆ getAdjacentLeafCells()

template<MInt nDim_, class SysEqn >
template<MInt diag, MBool recorrectBndryCellCoords>
MInt FvCartesianSolverXD< nDim_, SysEqn >::getAdjacentLeafCells ( const MInt  cellId,
const MInt  noLayers,
MIntScratchSpace adjacentCells,
MIntScratchSpace layerId 
)
Author
Lennart Schneiders

Templeate parameters:

  • diag=0 only direct neighbors are returned
  • diag=1 also determines 2D-diagonal neighbors
  • diag=2 returns all diagonal neighbors
  • recorrectBndryCellCoords: how to treat boundary cells (with a volumetric center other than the cell center)
Parameters
[in]cellIdthe cell id to consider
[in]noLayersthe distance of cell units to consider
[in]adjacentCellswill contain the ids of the neighboring cells
[in]layerIdthe distance in cell units of a given neighbor
Returns
the number of neighbors found

Definition at line 13761 of file fvcartesiansolverxd.cpp.

13763 {
13764 if(recorrectBndryCellCoords != m_fvBndryCnd->m_cellCoordinatesCorrected) {
13765 return getAdjacentLeafCells<diag, !recorrectBndryCellCoords>(cellId, noLayers, adjacentCells, layerId);
13766 }
13767#ifndef NDEBUG
13768 if(recorrectBndryCellCoords && !m_fvBndryCnd->m_cellCoordinatesCorrected)
13769 mTerm(1, AT_, "Corrected cell coordinates are expected.");
13770 if(!recorrectBndryCellCoords && m_fvBndryCnd->m_cellCoordinatesCorrected)
13771 mTerm(1, AT_, "Uncorrected cell coordinates are expected.");
13772#endif
13773 std::array<std::array<MInt, 4>, nDim> tmpNghbrs;
13774
13775 MInt gridcell = cellId;
13776 if(a_hasProperty(cellId, SolverCell::IsSplitClone)) {
13777 gridcell = m_splitChildToSplitCell.find(cellId)->second;
13778 }
13779 if(!a_hasProperty(cellId, SolverCell::IsSplitChild) && c_noChildren(gridcell) > 0) return 0;
13780 map<MInt, MInt> nghbrs;
13781 nghbrs.insert(pair<MInt, MInt>(cellId, 0));
13782 for(MInt layer = 1; layer <= noLayers; layer++) {
13783 set<MInt> nextLayer;
13784 for(auto& nghbr : nghbrs) {
13785 MInt nghbrId = nghbr.first;
13786 for(MInt dir0 = 0; dir0 < 2 * nDim; dir0++) {
13787 const MInt cnt0 = getNghbrLeafCells<recorrectBndryCellCoords>(nghbrId, cellId, layer, &tmpNghbrs[0][0], dir0);
13788 for(MInt c0 = 0; c0 < cnt0; c0++) {
13789 nextLayer.insert(tmpNghbrs[0][c0]);
13790 if(diag > 0) {
13791 for(MInt dir1 = 0; dir1 < 2 * nDim; dir1++) {
13792 if((dir1 / 2) == (dir0 / 2)) {
13793 continue;
13794 }
13795 const MInt cnt1 = getNghbrLeafCells<recorrectBndryCellCoords>(tmpNghbrs[0][c0], cellId, layer,
13796 &tmpNghbrs[1][0], dir1, dir0);
13797 for(MInt c1 = 0; c1 < cnt1; c1++) {
13798 nextLayer.insert(tmpNghbrs[1][c1]);
13799 IF_CONSTEXPR(nDim == 3 && diag == 2) {
13800 for(MInt dir2 = 0; dir2 < 2 * nDim; dir2++) {
13801 if(((dir2 / 2) == (dir0 / 2)) || ((dir2 / 2) == (dir1 / 2))) continue;
13802 const MInt cnt2 = getNghbrLeafCells<recorrectBndryCellCoords>(tmpNghbrs[1][c1], cellId, layer,
13803 &tmpNghbrs[2][0], dir2, dir1, dir0);
13804 for(MInt c2 = 0; c2 < cnt2; c2++) {
13805 nextLayer.insert(tmpNghbrs[2][c2]);
13806 }
13807 }
13808 }
13809 }
13810 }
13811 }
13812 }
13813 }
13814 }
13815 for(MInt it : nextLayer) {
13816 nghbrs.insert(pair<MInt, MInt>(it, layer));
13817 }
13818 }
13819 nghbrs.erase(cellId);
13820 MInt cnt = 0;
13821 for(auto it = nghbrs.begin(); it != nghbrs.end(); it++) {
13822 ASSERT(cnt < (signed)adjacentCells.size(),
13823 to_string(cellId) + " " + to_string(nghbrs.size()) + " " + to_string(a_isHalo(cellId)) + " "
13824 + to_string(a_isWindow(cellId)) + " " + to_string(adjacentCells.size()));
13825 if(a_hasProperty(it->first, SolverCell::IsSplitCell)) {
13826 auto it2 = find(m_splitCells.begin(), m_splitCells.end(), it->first);
13827 if(it2 == m_splitCells.end()) mTerm(1, AT_, "split cells inconsistency.");
13828 const MInt pos = distance(m_splitCells.begin(), it2);
13829 ASSERT(m_splitCells[pos] == it->first, "");
13830 for(MUlong c = 0; c < m_splitChilds[pos].size(); c++) {
13831 adjacentCells[cnt] = m_splitChilds[pos][c];
13832 layerId[cnt] = it->second;
13833 ASSERT(adjacentCells[cnt] > -1, "");
13834 ASSERT(a_hasProperty(adjacentCells[cnt], SolverCell::IsSplitChild) || c_noChildren(adjacentCells[cnt]) == 0,
13835 "");
13836 cnt++;
13837 }
13838 } else {
13839 adjacentCells[cnt] = it->first;
13840 layerId[cnt] = it->second;
13841 ASSERT(adjacentCells[cnt] > -1, "");
13842 ASSERT(c_noChildren(adjacentCells[cnt]) == 0, "");
13843 cnt++;
13844 }
13845 }
13846 return cnt;
13847}
size_type size() const
Definition: scratch.h:302
uint64_t MUlong
Definition: maiatypes.h:65

◆ getAdjacentLeafCells_d0()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::getAdjacentLeafCells_d0 ( const MInt  cellId,
const MInt  noLayers,
MIntScratchSpace nghbrList,
MIntScratchSpace layerId 
)
virtual

Definition at line 13935 of file fvcartesiansolverxd.cpp.

13937 {
13938 return getAdjacentLeafCells<0>(cellId, noLayers, nghbrList, layerId);
13939}

◆ getAdjacentLeafCells_d0_c()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::getAdjacentLeafCells_d0_c ( const MInt  cellId,
const MInt  noLayers,
MIntScratchSpace nghbrList,
MIntScratchSpace layerId 
)
virtual

Definition at line 13953 of file fvcartesiansolverxd.cpp.

13955 {
13956 return getAdjacentLeafCells<0, true>(cellId, noLayers, nghbrList, layerId);
13957}

◆ getAdjacentLeafCells_d1()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::getAdjacentLeafCells_d1 ( const MInt  cellId,
const MInt  noLayers,
MIntScratchSpace nghbrList,
MIntScratchSpace layerId 
)
virtual

Definition at line 13941 of file fvcartesiansolverxd.cpp.

13943 {
13944 return getAdjacentLeafCells<1>(cellId, noLayers, nghbrList, layerId);
13945}

◆ getAdjacentLeafCells_d1_c()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::getAdjacentLeafCells_d1_c ( const MInt  cellId,
const MInt  noLayers,
MIntScratchSpace nghbrList,
MIntScratchSpace layerId 
)
virtual

Definition at line 13959 of file fvcartesiansolverxd.cpp.

13961 {
13962 return getAdjacentLeafCells<1, true>(cellId, noLayers, nghbrList, layerId);
13963}

◆ getAdjacentLeafCells_d2()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::getAdjacentLeafCells_d2 ( const MInt  cellId,
const MInt  noLayers,
MIntScratchSpace nghbrList,
MIntScratchSpace layerId 
)
virtual

Definition at line 13947 of file fvcartesiansolverxd.cpp.

13949 {
13950 return getAdjacentLeafCells<2>(cellId, noLayers, nghbrList, layerId);
13951}

◆ getAdjacentLeafCells_d2_c()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::getAdjacentLeafCells_d2_c ( const MInt  cellId,
const MInt  noLayers,
MIntScratchSpace nghbrList,
MIntScratchSpace layerId 
)
virtual

Definition at line 13965 of file fvcartesiansolverxd.cpp.

13967 {
13968 return getAdjacentLeafCells<2, true>(cellId, noLayers, nghbrList, layerId);
13969}

◆ getAssociatedInternalCell()

template<MInt nDim_, class SysEqn >
const MInt & FvCartesianSolverXD< nDim_, SysEqn >::getAssociatedInternalCell ( const MInt cellId) const
inline

Definition at line 1081 of file fvcartesiansolverxd.h.

1081 {
1082#ifndef NDEBUG
1083 std::ostringstream output;
1084 output << "cellId " << cellId << " Halo " << a_isHalo(cellId) << " IsPeriodic " << a_isPeriodic(cellId)
1085 << " bndryGhostCell " << a_isBndryGhostCell(cellId) << " splitChild "
1086 << a_hasProperty(cellId, SolverCell::IsSplitChild) << " splitCell "
1087 << a_hasProperty(cellId, SolverCell::IsSplitCell) << std::endl;
1088 if(a_isBndryGhostCell(cellId)) {
1089 ASSERT(cellId - m_bndryGhostCellsOffset < (signed)m_associatedInternalCells.size()
1090 && cellId - m_bndryGhostCellsOffset >= 0,
1091 "size exceeds container, cellId: " << cellId << "m_bndryGhostCellsOffset: " << m_bndryGhostCellsOffset
1092 << " m_associatedInterNallCells.size(): "
1093 << m_associatedInternalCells.size() << output.str());
1096 output.str());
1097 } else {
1098 ASSERT(m_splitChildToSplitCell.count(cellId) == 1, "mapped value not found for" << output.str());
1099 ASSERT(m_splitChildToSplitCell.find(cellId)->second < a_noCells(),
1100 "mapped value exceeds grid().tree().size() for cellId "
1101 << cellId << " " << m_splitChildToSplitCell.find(cellId)->second << " " << a_noCells() << " "
1102 << output.str());
1103 ASSERT(m_splitChildToSplitCell.find(cellId)->second > -1, "mapped value is negative for " << output.str());
1104 }
1105#endif
1106 return (
1107 !a_isBndryGhostCell(cellId)
1108 ? m_splitChildToSplitCell.find(cellId)->second
1109 : (a_hasProperty(m_associatedInternalCells[cellId - m_bndryGhostCellsOffset], SolverCell::IsSplitChild)
1112 }
std::vector< MInt > m_associatedInternalCells

◆ getAveragingFactor()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::getAveragingFactor ( )
inline

Definition at line 1233 of file fvcartesiansolverxd.h.

1233{ return F1B8 * m_Ma * sqrt(m_TInfinity) * timeStep(); };

◆ getBoundaryDistance()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getBoundaryDistance ( MFloatScratchSpace distance)
virtual
Author
Lennart Schneiders

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 11052 of file fvcartesiansolverxd.cpp.

11052 {
11053 MBoolScratchSpace interfaceCell(a_noCells(), AT_, "interfaceCell");
11054 interfaceCell.fill(0);
11055 vector<MInt> bndCndIds;
11056 bndCndIds.push_back(3003);
11057
11058 this->identifyBoundaryCells(&interfaceCell[0], bndCndIds);
11059
11060 this->setBoundaryDistance(&interfaceCell[0], &m_outerBandWidth[0], distance);
11061
11062 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
11063 // Fix for partition level shift, start reduce operation at internal cell with a halo parent
11064 const MInt parentId = c_parentId(cellId);
11065 const MBool isPartLvlShift = (parentId > -1 && a_isHalo(parentId));
11066
11067 if(a_level(cellId) != minLevel() && !isPartLvlShift) {
11068 continue;
11069 }
11070 // @ansgar PLA TODO labels:FV
11071 // this does not properly reduces the distance for internal pla cells with halo childs!
11072 // reduce starting from partition cells and ignore partition level ancestors?
11073 reduceData(cellId, &distance(0));
11074 }
11075 exchangeDataFV(distance.data());
11076}
MFloat reduceData(const MInt cellId, MFloat *data, const MInt dataBlockSize=1, const MBool average=true)
determines the value of 'data' in the given cell by recusively volumetric averaging among all its off...
MFloat * m_outerBandWidth
Definition: solver.h:92
void setBoundaryDistance(const MBool *const interfaceCell, const MFloat *const outerBandWidth, MFloatScratchSpace &distance)
transverses over all neighboring cells for a specified length

◆ getBoundaryHeatFlux()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::getBoundaryHeatFlux ( const MInt  cellId) const
virtual
Author
Thomas Schilden
Date
3.10.2015
Parameters
[in]cellId
[out]heatflux

Definition at line 8867 of file fvcartesiansolverxd.cpp.

8867 {
8868 MInt bndryId = a_bndryId(cellId);
8869 if(bndryId > -1) {
8870 if(m_bndryCells->a[bndryId].m_noSrfcs > 1) {
8871 mTerm(1, AT_, "lineOutput not implemented for split cells or such");
8872 }
8873 // temperature gradient
8874 MFloat drhodn = m_bndryCells->a[bndryId].m_srfcVariables[0]->m_normalDeriv[PV->RHO];
8875 MFloat rhoW = m_bndryCells->a[bndryId].m_srfcVariables[0]->m_primVars[PV->RHO];
8876 MFloat pW = m_bndryCells->a[bndryId].m_srfcVariables[0]->m_primVars[PV->P];
8877 return (-m_gamma * pW * drhodn / pow(rhoW, F2));
8878 }
8879 return std::numeric_limits<MFloat>::max();
8880}

◆ getCellDataDlb()

template<MInt nDim_, class SysEqn_ >
void FvCartesianSolverXD< nDim_, SysEqn_ >::getCellDataDlb ( const MInt  dataId,
const MInt  oldNoCells,
const MInt *const  bufferIdToCellId,
MFloat *const  data 
)
override

Store the solver data for a given data id ordered in the given buffer for DLB.

Definition at line 3079 of file fvcartesiansolverxd.h.

3080 {
3081 TRACE();
3082
3083 MInt localBufferId = 0;
3084 for(MInt i = 0; i < oldNoCells; i++) {
3085 const MInt gridCellId = bufferIdToCellId[i];
3086
3087 if(gridCellId < 0) continue;
3088
3089 const MInt cellId = grid().tree().grid2solver(gridCellId);
3090 if(cellId < 0 || cellId >= noInternalCells()) {
3091 continue;
3092 }
3093
3094 switch(dataId) {
3095 case 0: {
3096 const MInt dataSize = CV->noVariables;
3097 std::copy_n(&a_variable(cellId, 0), dataSize, &data[localBufferId * dataSize]);
3098 break;
3099 }
3100 default:
3101 TERMM(1, "Unknown data id.");
3102 break;
3103 }
3104 localBufferId++;
3105 }
3106}

◆ getCellIdByIndex()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::getCellIdByIndex ( const MInt  index)
inline

Definition at line 2123 of file fvcartesiansolverxd.h.

2123{ return index; }

◆ getCellLoad()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::getCellLoad ( const MInt  gridCellId,
const MFloat *const  weights 
) const
override
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Parameters
[in]cellIdRequested grid cell id.
[in]weightsComputational weights for different simulation components.
Returns
Cell load.

Definition at line 24158 of file fvcartesiansolverxd.cpp.

24158 {
24159 TRACE();
24160 ASSERT(isActive(), "solver is not active");
24161
24162 // Convert to solver cell id and check
24163 const MInt cellId = grid().tree().grid2solver(gridCellId);
24164 if(cellId < 0) {
24165 return 0;
24166 }
24167
24168 if(cellId < 0 || cellId >= grid().noInternalCells()) {
24169 mTerm(1, "The given cell id is invalid.");
24170 }
24171
24172 // Default cell load
24173 MFloat cellLoad = 0.0;
24174
24175
24176 if(c_isLeafCell(cellId) && !a_hasProperty(cellId, SolverCell::IsInactive)) {
24177 cellLoad = weights[0];
24178 }
24179 MInt count = 1;
24180
24181 // Add load for boundary/cut-off cells
24182 if(m_weightBndryCells) {
24183 const MInt bndryId = a_bndryId(cellId);
24184 if(bndryId > -1 && c_isLeafCell(cellId)) {
24185 cellLoad += weights[count];
24186 }
24187 count += 1;
24188 }
24189
24191 for(MInt bc = 0; bc < m_fvBndryCnd->m_noCutOffBndryCndIds; bc++) {
24192 if(m_weightBc1601 && bc == m_fvBndryCnd->m_bc1601_bcId) continue; // skip bc1601 if cells are weighted separately
24193
24194 const MInt bcSize = m_fvBndryCnd->m_sortedCutOffCells[bc]->size();
24195 for(MInt i = 0; i < bcSize; i++) {
24196 if(cellId == m_fvBndryCnd->m_sortedCutOffCells[bc]->a[i]) {
24197 cellLoad += weights[count + 1];
24198 }
24199 }
24200 }
24201 count += 1;
24202 }
24203
24204 // Add load for bc1601 cells (random eddy inflow)
24205 if(m_weightBc1601) {
24206 const MInt bc = m_fvBndryCnd->m_bc1601_bcId; // -1 if non-existent
24207 const MInt bcSize = (bc < 0) ? 0 : m_fvBndryCnd->m_sortedCutOffCells[bc]->size();
24208 for(MInt i = 0; i < bcSize; i++) {
24209 if(cellId == m_fvBndryCnd->m_sortedCutOffCells[bc]->a[i]) {
24210 cellLoad += weights[count];
24211 }
24212 }
24213 count += 1;
24214 }
24216 if(cellLoad < MFloatEps) {
24217 cellLoad = weights[count];
24218 }
24219 count += 1;
24220 }
24221
24223 if(a_hasProperty(cellId, SolverCell::NearWall)) {
24224 cellLoad += weights[count];
24225 }
24226 }
24227
24228 if(m_weightLvlJumps) {
24229 MBool atLvlJump = false;
24230 if(c_isLeafCell(cellId)) {
24231 for(MInt dir = 0; dir < m_noDirs; dir++) {
24232 if(c_neighborId(cellId, dir, false) < 0 && c_parentId(cellId) > -1
24233 && c_neighborId(c_parentId(cellId), dir, false) > -1) {
24234 atLvlJump = true;
24235 break;
24236 }
24237 if(c_neighborId(cellId, dir, false) > -1 && !c_isLeafCell(c_neighborId(cellId, dir, false))) {
24238 atLvlJump = true;
24239 break;
24240 }
24241 }
24242 }
24243 if(atLvlJump) {
24244 cellLoad += weights[count];
24245 }
24246 }
24247
24248 if(m_weightSmallCells) {
24249 if(a_cellVolume(cellId) / grid().gridCellVolume(maxLevel()) < m_fvBndryCnd->m_volumeLimitWall) {
24250 cellLoad += weights[count];
24251 }
24252 count += 1;
24253 }
24254
24255 return cellLoad;
24256}
std::vector< List< MInt > * > m_sortedCutOffCells

◆ getCurrentTimeStep()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::getCurrentTimeStep ( ) const
inlineoverridevirtual

Reimplemented from Solver.

Definition at line 2147 of file fvcartesiansolverxd.h.

2147{ return globalTimeStep; }

◆ getDefaultWeights()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getDefaultWeights ( MFloat weights,
std::vector< MString > &  names 
) const

Definition at line 23986 of file fvcartesiansolverxd.cpp.

23986 {
23987 TRACE();
23988
23989 weights[0] = 1.0;
23990 names[0] = "fv_leaf_cell";
23991 MInt count = 1;
23992
23993 if(m_weightBndryCells) {
23994 weights[count] = 5.0;
23995 names[count] = "fv_bndry_cell";
23996 count++;
23997 }
23998
24000 weights[count] = 5.0;
24001 names[count] = "fv_cutoff_cell";
24002 count++;
24003 }
24004
24005 if(m_weightBc1601) {
24006 weights[count] = 10.0;
24007 names[count] = "fv_bc1601";
24008 count++;
24009 }
24010
24012 weights[count] = 0.1;
24013 names[count] = "fv_inactive_cell";
24014 count++;
24015 }
24016
24018 weights[count] = 2.0;
24019 names[count] = "fv_nearBndry_cell";
24020 count++;
24021 }
24022 if(m_weightLvlJumps) {
24023 weights[count] = 1.5;
24024 names[count] = "fv_lvlJump_cell";
24025 count++;
24026 }
24027 if(m_weightSmallCells) {
24028 weights[count] = 1.0;
24029 names[count] = "fv_smallCell";
24030 count++;
24031 }
24032
24033 if(noLoadTypes() != count) {
24034 mTerm(1, "Count does not match noLoadTypes.");
24035 }
24036}
MInt noLoadTypes() const override

◆ getDimensionalizationParams()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getDimensionalizationParams ( std::vector< std::pair< MFloat, MString > > &  dimParams) const
virtual
Author
Ansgar Niemoeller
Date
09.07.2014
Parameters
[out]dimParamsdimensionalization parameters (values and names)

Reimplemented from Solver.

Definition at line 8981 of file fvcartesiansolverxd.cpp.

8981 {
8982 TRACE();
8983
8984 dimParams.clear();
8985 dimParams.push_back(make_pair(m_Re, "Re"));
8986 dimParams.push_back(make_pair(m_Ma, "Ma"));
8987 dimParams.push_back(make_pair(sysEqn().gamma_Ref(), "gamma"));
8988 dimParams.push_back(make_pair(m_gasConstant, "R"));
8989 dimParams.push_back(make_pair(m_referenceTemperature, "T_ref"));
8990}

◆ getDomainDecompositionInformation()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getDomainDecompositionInformation ( std::vector< std::pair< MString, MInt > > &  domainInfo)
override
Author
Tim Wegmann

Definition at line 24910 of file fvcartesiansolverxd.cpp.

24911 {
24912 TRACE();
24913
24914 const MString namePrefix = "b" + std::to_string(solverId()) + "_";
24915
24916 const MInt noCells = (isActive()) ? grid().noInternalCells() : 0;
24917 MInt noLeafCells = 0;
24918 MInt noActiveLeafCells = 0;
24919 MInt noCutOffCells = 0;
24920 MInt noBc1601Cells = 0;
24921 MInt noNearBndryCells = 0;
24922 MInt noBndrycells = 0;
24923 MInt noLvlJumpCells = 0;
24924
24925 if(isActive()) {
24926 for(MInt cellId = 0; cellId < grid().noInternalCells(); cellId++) {
24927 if(c_isLeafCell(cellId)) noLeafCells++;
24928 if(c_isLeafCell(cellId) && !a_hasProperty(cellId, SolverCell::IsInactive)) noActiveLeafCells++;
24929 if(a_hasProperty(cellId, SolverCell::NearWall)) {
24930 noNearBndryCells++;
24931 }
24932 if(a_bndryId(cellId) > -1 && c_isLeafCell(cellId)) {
24933 noBndrycells++;
24934 }
24935 if(c_isLeafCell(cellId)) {
24936 MBool atLvlJump = false;
24937 for(MInt dir = 0; dir < m_noDirs; dir++) {
24938 if(c_neighborId(cellId, dir, false) < 0 && c_parentId(cellId) > -1
24939 && c_neighborId(c_parentId(cellId), dir, false) > -1) {
24940 atLvlJump = true;
24941 break;
24942 }
24943 if(c_neighborId(cellId, dir, false) > -1 && !c_isLeafCell(c_neighborId(cellId, dir, false))) {
24944 atLvlJump = true;
24945 break;
24946 }
24947 }
24948 if(atLvlJump) {
24949 noLvlJumpCells++;
24950 }
24951 }
24952 }
24953 }
24954
24955 for(MInt bc = 0; bc < m_fvBndryCnd->m_noCutOffBndryCndIds; bc++) {
24956 // Note: this also counts halo-cells
24957 const MInt cutOffSize = m_fvBndryCnd->m_sortedCutOffCells[bc]->size();
24958 if(bc == m_fvBndryCnd->m_bc1601_bcId) {
24959 noBc1601Cells = cutOffSize;
24960 } else {
24961 noCutOffCells += cutOffSize;
24962 }
24963 }
24964
24965
24966 domainInfo.emplace_back(namePrefix + "noFvCells", noCells);
24967 domainInfo.emplace_back(namePrefix + "noFvLeafCells", noLeafCells);
24968 domainInfo.emplace_back(namePrefix + "noFvActiveLeafCells", noActiveLeafCells);
24969
24970 // Number of Bndry-Cells
24971 if(m_weightBndryCells) {
24972 domainInfo.emplace_back(namePrefix + "noFvBndryCells", noBndrycells);
24973 }
24974
24975 // Number of cut-off cells
24977 domainInfo.emplace_back(namePrefix + "noCutOffCells", noCutOffCells);
24978 }
24979 // Number of bc1601 cells (random eddy inflow)
24980 if(m_weightBc1601) {
24981 domainInfo.emplace_back(namePrefix + "noBc1601Cells", noBc1601Cells);
24982 }
24983
24984 // Number of near Bndry-Cells
24986 domainInfo.emplace_back(namePrefix + "noNearBndryCells", noNearBndryCells);
24987 }
24988
24989 // number of inactive cells
24991 domainInfo.emplace_back(namePrefix + "noFvInacticeCells", grid().noInternalCells());
24992 }
24993
24994 // number of cells at lvl-jumps
24995 if(m_weightLvlJumps) {
24996 domainInfo.emplace_back(namePrefix + "noFvLvlJumpCells", noLvlJumpCells);
24997 }
24998
24999 // number of small-cells
25000 if(m_weightSmallCells) {
25001 domainInfo.emplace_back(namePrefix + "noFvSmallCells", m_fvBndryCnd->m_smallCutCells.size());
25002 }
25003}
std::vector< MInt > m_smallCutCells

◆ getGlobalSolverVars()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getGlobalSolverVars ( std::vector< MFloat > &  globalFloatVars,
std::vector< MInt > &  globalIdVars 
)
override

Return global solver variables that should be equal on all domains.

Definition at line 10385 of file fvcartesiansolverxd.cpp.

10386 {
10387 TRACE();
10388
10389 // Store global variables that need to be communicated during load balancing with inactive ranks
10390 globalFloatVars.push_back(m_time);
10391 globalFloatVars.push_back(m_timeStep);
10392 globalFloatVars.push_back(m_physicalTime);
10393 // TODO labels:FV,DLB any other variables to be communicated during DLB?
10394}

◆ getHeatRelease()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getHeatRelease ( MFloat *&  heatRelease)
Author
D.Zilles
Date
29.5.2017
Parameters
[out]heatRelease

Definition at line 8853 of file fvcartesiansolverxd.cpp.

8853 {
8854 heatRelease = m_heatRelease;
8855}

◆ getIdAtPoint()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::getIdAtPoint ( const MFloat point,
MBool   NotUsedglobalUnique=false 
)
inline

Definition at line 2126 of file fvcartesiansolverxd.h.

2126 {
2127 return grid().findContainingLeafCell(point);
2128 }

◆ getInterpolatedVariables() [1/2]

template<MInt nDim_, class SysEqn >
template<MInt noSpecies>
void FvCartesianSolverXD< nDim_, SysEqn >::getInterpolatedVariables ( const MInt  cellId,
const MFloat position,
MFloat vars 
)
virtual

Reimplemented from Solver.

◆ getInterpolatedVariables() [2/2]

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getInterpolatedVariables ( const MInt  cellId,
const MFloat position,
MFloat vars 
)
overridevirtual

calculates interpolated variables for a given position in a given cell while allowing for multiple species

Author
Ansgar Niemoeller, Sven Berger
Date
07.06.2014
Parameters
[in]cellIdof the cell used for interpolation
[in]positioninterpolation point
[out]varsarray containing the interpolated variables
Author
Ansgar Niemoeller, Sven Berger
Date
07.06.2014
Parameters
[in]cellIdid of the cell used for interpolation
[in]positioninterpolation point
[out]varsarray containing the interpolated variables

Reimplemented from Solver.

Definition at line 20275 of file fvcartesiansolverxd.cpp.

20276 {
20277 // TRACE();
20278
20279 interpolateVariables<0, nDim + 2>(cellId, position, vars);
20280
20281 ASSERT(noVariables() == nDim + 2, "ERROR: Number of variables not correct.");
20282}

◆ getInterpolatedVariablesInCell()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getInterpolatedVariablesInCell ( const MInt  cellId,
const MFloat position,
MFloat vars 
)
Author
Ansgar Niemoeller, Sven Berger
Date
07.06.2014
Parameters
[in]cellIdof the cell used for interpolation
[in]positioninterpolation point
[out]varsarray containing the interpolated variables

Definition at line 20252 of file fvcartesiansolverxd.cpp.

20253 {
20254 TRACE();
20255 // Function pointer to a_pvariable
20256 std::function<MFloat(const MInt, const MInt)> varPtr = [&](const MInt cellId_, const MInt varId_) {
20257 return static_cast<MFloat>(a_pvariable(cellId_, varId_));
20258 };
20259 interpolateVariablesInCell<0, nDim + 2>(cellId, position, varPtr, vars);
20260 ASSERT(noVariables() == nDim + 2, "ERROR: Number of variables not correct.");
20261}

◆ getLoadQuantities()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getLoadQuantities ( MInt *const  loadQuantities) const
override
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Parameters
[out]loadQuantitiesStorage for load quantities.

Definition at line 24045 of file fvcartesiansolverxd.cpp.

24045 {
24046 TRACE();
24047
24048 // reset
24049 std::fill_n(&loadQuantities[0], noLoadTypes(), 0);
24050
24051 // Nothing to do if solver is not active
24052 if(!grid().isActive()) {
24053 return;
24054 }
24055
24056 // Count the number of leaf cells/boundary cells and store as load quantities
24057 MInt noLeafCells = 0;
24058 MInt noBndryCells = 0;
24059 MInt noNearBndryCells = 0;
24060 MInt totalNoCutOffCells = 0;
24061 MInt noBc1601Cells = 0;
24062 MInt noLvlJumpCells = 0;
24063
24064 for(MInt cellId = 0; cellId < grid().noInternalCells(); cellId++) {
24065 if(c_isLeafCell(cellId) && !a_hasProperty(cellId, SolverCell::IsInactive)) {
24066 noLeafCells++;
24067 }
24068 if(c_isLeafCell(cellId)) {
24069 MBool atLvlJump = false;
24070 for(MInt dir = 0; dir < m_noDirs; dir++) {
24071 if(c_neighborId(cellId, dir, false) < 0 && c_parentId(cellId) > -1
24072 && c_neighborId(c_parentId(cellId), dir, false) > -1) {
24073 atLvlJump = true;
24074 break;
24075 }
24076 if(c_neighborId(cellId, dir, false) > -1 && !c_isLeafCell(c_neighborId(cellId, dir, false))) {
24077 atLvlJump = true;
24078 break;
24079 }
24080 }
24081 if(atLvlJump) {
24082 noLvlJumpCells++;
24083 }
24084 }
24085
24086 const MInt bndryId = a_bndryId(cellId);
24087 if(bndryId > -1 && c_isLeafCell(cellId)) {
24088 noBndryCells++;
24089 }
24090 if(a_hasProperty(cellId, SolverCell::NearWall)) {
24091 noNearBndryCells++;
24092 }
24093 }
24094
24095 for(MInt bc = 0; bc < m_fvBndryCnd->m_noCutOffBndryCndIds; bc++) {
24096 MInt noCutOffCells = 0;
24097
24098 const MInt bcSize = m_fvBndryCnd->m_sortedCutOffCells[bc]->size();
24099 for(MInt i = 0; i < bcSize; i++) {
24100 const MInt cellId = m_fvBndryCnd->m_sortedCutOffCells[bc]->a[i];
24101 if(!a_isHalo(cellId)) {
24102 noCutOffCells++;
24103 }
24104 }
24105
24107 // If enabled, treat random eddy inflow bc cells separately
24108 noBc1601Cells = noCutOffCells;
24109 } else {
24110 // Sum up all other cut-off cells
24111 totalNoCutOffCells += noCutOffCells;
24112 }
24113 }
24114
24115 loadQuantities[0] = noLeafCells;
24116 MInt count = 1;
24117
24118 // Number of boundary cells if enabled
24119 if(m_weightBndryCells) {
24120 loadQuantities[count] = noBndryCells;
24121 count += 1;
24122 }
24124 loadQuantities[count] = totalNoCutOffCells;
24125 count += 1;
24126 }
24127 if(m_weightBc1601) {
24128 loadQuantities[count] = noBc1601Cells;
24129 count += 1;
24130 }
24132 loadQuantities[count] = grid().noInternalCells();
24133 count += 1;
24134 }
24136 loadQuantities[count] = noNearBndryCells;
24137 count += 1;
24138 }
24139 if(m_weightLvlJumps) {
24140 loadQuantities[count] = noLvlJumpCells;
24141 count += 1;
24142 }
24143 if(m_weightSmallCells) {
24144 loadQuantities[count] = m_fvBndryCnd->m_smallCutCells.size();
24145 count += 1;
24146 }
24147}

◆ getNghbrLeafCells()

template<MInt nDim_, class SysEqn >
template<MBool recorrectBndryCellCoords>
MInt FvCartesianSolverXD< nDim_, SysEqn >::getNghbrLeafCells ( const MInt  cellId,
MInt  refCell,
MInt  layer,
MInt nghbrs,
MInt  dir,
MInt  dir1 = -1,
MInt  dir2 = -1 
) const
Author
Lennart Schneiders

Definition at line 13859 of file fvcartesiansolverxd.cpp.

13860 {
13861 MInt count = 0;
13862 // set cellId of split child
13863 const MInt gridcellId =
13864 a_hasProperty(cellId, SolverCell::IsSplitClone) ? m_splitChildToSplitCell.find(cellId)->second : cellId;
13865
13866 if(a_hasProperty(cellId, SolverCell::IsSplitChild)) {
13867 return 0;
13868 }
13869
13870 if(checkNeighborActive(gridcellId, dir) && a_hasNeighbor(gridcellId, dir) > 0) {
13871 const MInt nextId = c_neighborId(gridcellId, dir);
13872 if(nextId < 0) return 0;
13873
13874 if(c_noChildren(nextId) > 0) {
13875 for(MInt child = 0; child < IPOW2(nDim); child++) {
13876 if(!childCode[dir][child]) continue;
13877 if(dir1 > -1 && !childCode[dir1][child]) continue;
13878 if(dir2 > -1 && !childCode[dir2][child]) continue;
13879 const MInt childId = c_childId(nextId, child);
13880 if(childId < 0) continue;
13881 if(c_noChildren(childId) > 0) continue;
13882 if(a_hasProperty(childId, SolverCell::IsOnCurrentMGLevel)) {
13883 nghbrs[count] = childId;
13884 count++;
13885 }
13886 }
13887 } else if(a_hasProperty(nextId, SolverCell::IsOnCurrentMGLevel)) {
13888 nghbrs[0] = nextId;
13889 count = 1;
13890 }
13891 } else if(c_parentId(gridcellId) > -1) {
13892 if(a_hasNeighbor(c_parentId(gridcellId), dir) > 0) {
13893 const MInt nextId = c_neighborId(c_parentId(gridcellId), dir);
13894 if(nextId < 0 || c_noChildren(nextId) > 0) {
13895 return 0;
13896 }
13897 if(a_hasProperty(nextId, SolverCell::IsOnCurrentMGLevel)) {
13898 nghbrs[0] = nextId;
13899 count = 1;
13900 }
13901 }
13902 }
13903
13904 std::array<MFloat, nDim> coord0{};
13905 for(MInt i = 0; i < nDim; i++) {
13906 coord0[i] = a_coordinate(refCell, i)
13907 - ((recorrectBndryCellCoords && a_bndryId(refCell) > -1)
13908 ? m_fvBndryCnd->m_bndryCells->a[a_bndryId(refCell)].m_coordinates[i]
13909 : F0);
13910 }
13911
13912 for(MInt c = 0; c < count; c++) {
13913 const MFloat delta = ((MFloat)layer) * 0.5005 * (c_cellLengthAtCell(nghbrs[c]) + c_cellLengthAtCell(refCell));
13914
13915 for(MInt i = 0; i < nDim; i++) {
13916 const MFloat correctedCoord = a_coordinate(nghbrs[c], i)
13917 - ((recorrectBndryCellCoords && a_bndryId(nghbrs[c]) > -1)
13918 ? m_fvBndryCnd->m_bndryCells->a[a_bndryId(nghbrs[c])].m_coordinates[i]
13919 : F0);
13920 if(std::abs(correctedCoord - coord0[i]) > delta) {
13921 nghbrs[c] = nghbrs[count - 1];
13922 count--;
13923 c--;
13924 break;
13925 }
13926 }
13927 }
13928
13929 return count;
13930}

◆ getPrimitiveVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getPrimitiveVariables ( MInt  cellId,
MFloat Xp,
MFloat vars,
MInt  order 
)

Definition at line 9714 of file fvcartesiansolverxd.cpp.

9714 {
9715 const MInt noPVars = PV->noVariables;
9716
9717 for(MInt vari = 0; vari < noPVars; vari++)
9718 vars[vari] = a_pvariable(cellId, vari);
9719
9720 if(order == 0) return;
9721
9722 for(MInt vari = 0; vari < noPVars; vari++)
9723 for(MInt dimi = 0; dimi < nDim; dimi++)
9724 vars[vari] += a_slope(cellId, vari, dimi) * (Xp[dimi] - a_coordinate(cellId, dimi));
9725}

◆ getSampleVariableNames()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getSampleVariableNames ( std::vector< MString > &  varNames)
override

Definition at line 8792 of file fvcartesiansolverxd.cpp.

8792 {
8793 varNames.clear();
8794 for(MInt i = 0; i < PV->noVariables; i++) {
8795 varNames.push_back(PV->varNames[i]);
8796 }
8797}

◆ getSampleVariables() [1/2]

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getSampleVariables ( MInt  cellId,
const MFloat *&  vars 
)
Author
A. Niemoeller
Date
11.12.2013

get cell variables of a single cell

Parameters
[in]cellIdcell that is accessed
[in,out]varspointer to the variables

Definition at line 8777 of file fvcartesiansolverxd.cpp.

8777 {
8778 vars = &a_pvariable(cellId, 0);
8779}

◆ getSampleVariables() [2/2]

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getSampleVariables ( MInt const  cellId,
std::vector< MFloat > &  vars 
)

Definition at line 8782 of file fvcartesiansolverxd.cpp.

8782 {
8783 const MInt noVars = vars.size();
8784 ASSERT(noVars <= noVariables(), "noVars > noVariables()");
8785 for(MInt varId = 0; varId < noVars; varId++) {
8786 vars[varId] = a_pvariable(cellId, varId);
8787 }
8788}

◆ getSampleVarsDerivatives() [1/2]

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getSampleVarsDerivatives ( const MInt  cellId,
const MFloat *&  vars 
)
virtual
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2016-07-13
Parameters
[in]cellIdRequested cell. \parma[out] vars Pointer to the derivatives of the primitive variables.

Definition at line 8807 of file fvcartesiansolverxd.cpp.

8807 {
8808 vars = &a_slope(cellId, 0, 0);
8809}

◆ getSampleVarsDerivatives() [2/2]

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::getSampleVarsDerivatives ( const MInt  cellId,
std::vector< MFloat > &  vars 
)

Definition at line 8812 of file fvcartesiansolverxd.cpp.

8812 {
8813 std::memcpy(&vars[0], &a_slope(cellId, 0, 0), sizeof(MFloat) * (nDim * PV->noVariables));
8814 return true; // = implemented for this solver
8815}

◆ getSolverSamplingProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getSolverSamplingProperties ( std::vector< MInt > &  samplingVars,
std::vector< MInt > &  noSamplingVars,
std::vector< std::vector< MString > > &  samplingVarNames,
const MString  featureName = "" 
)
overridevirtual

Return sampling properties for the FV solver.

Definition at line 10543 of file fvcartesiansolverxd.cpp.

10545 {
10546 TRACE();
10547
10548 // Read sampling variable names
10549 std::vector<MString> varNamesList;
10550 MInt noVars = readSolverSamplingVarNames(varNamesList, featureName);
10551
10552 // Set default sampling variables if none specified
10553 if(noVars == 0) {
10554 varNamesList.emplace_back("FV_PV");
10555 noVars = 1;
10556 }
10557
10558 for(MInt i = 0; i < noVars; i++) {
10559 const MInt samplingVar = string2enum(varNamesList[i]);
10560 std::vector<MString> varNames;
10561
10562 auto samplingVarIt = std::find(samplingVarIds.begin(), samplingVarIds.end(), samplingVar);
10563 if(samplingVarIt != samplingVarIds.end()) {
10564 mTerm(1, "Sampling variable '" + varNamesList[i] + "' already specified.");
10565 }
10566
10567 switch(samplingVar) {
10568 case FV_PV: {
10569 samplingVarIds.push_back(FV_PV);
10570 noSamplingVars.push_back(PV->noVariables);
10571
10572 varNames.resize(PV->noVariables);
10573 varNames[PV->U] = "u";
10574 varNames[PV->V] = "v";
10575 IF_CONSTEXPR(nDim == 3) { varNames[PV->W] = "w"; }
10576 varNames[PV->P] = "p";
10577 varNames[PV->RHO] = "rho";
10578 MInt varCount = nDim + 2;
10579
10580 IF_CONSTEXPR(isDetChem<SysEqn>) {
10581 if(PV->m_noSpecies > 0) {
10582 for(MUint s = 0; s < PV->m_noSpecies; s++) {
10583 MString str = ("Y" + m_speciesName[s]);
10584 MChar* c = new MChar[10];
10585 strcpy(c, str.c_str());
10586 varNames[PV->Y[s]] = c;
10587 varCount++;
10588 }
10589 }
10590 }
10591 else {
10592 IF_CONSTEXPR(hasPV_C<SysEqn>::value)
10593 if(PV->m_noSpecies > 0) {
10594 varNames[PV->C] = "c";
10595 varCount++;
10596 }
10597 }
10598
10599 TERMM_IF_NOT_COND(PV->noVariables == varCount, "Error: variable count mismatch");
10600
10601 samplingVarNames.push_back(varNames);
10602 break;
10603 }
10604 // TODO labels:FV,PP add sampling of gradients?
10605 case FV_VORT: {
10606 // mTerm(1, "Sampling of vorticity not tested.");
10607 samplingVarIds.push_back(FV_VORT);
10608
10609 const MInt noVorticities = (nDim == 2) ? 1 : 3;
10610 noSamplingVars.push_back(noVorticities);
10611
10612 varNames.resize(noVorticities);
10613 IF_CONSTEXPR(nDim == 2) { varNames[0] = "vort_z"; }
10614 else {
10615 varNames[0] = "vort_x";
10616 varNames[1] = "vort_y";
10617 varNames[2] = "vort_z";
10618 }
10619 samplingVarNames.push_back(varNames);
10620
10621 break;
10622 }
10623 case FV_HEAT_RELEASE: {
10624 samplingVarIds.push_back(FV_HEAT_RELEASE);
10625 noSamplingVars.push_back(1);
10626 varNames.resize(1);
10627 varNames[0] = "h";
10628 samplingVarNames.push_back(varNames);
10629 break;
10630 }
10631 default: {
10632 mTerm(1, "Unknown sampling variable: " + varNamesList[i]);
10633 break;
10634 }
10635 }
10636 }
10637}
std::vector< MString > m_speciesName
MInt readSolverSamplingVarNames(std::vector< MString > &varNames, const MString featureName="") const
Read sampling variables names, store in vector and return the number of sampling variables.
Definition: solver.cpp:167

◆ getSolverTimings()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getSolverTimings ( std::vector< std::pair< MString, MFloat > > &  solverTimings,
const MBool  allTimings 
)
override
Author
Tim Wegmann

Definition at line 10415 of file fvcartesiansolverxd.cpp.

10416 {
10417 TRACE();
10418
10419 const MString namePrefix = "b" + std::to_string(solverId()) + "_";
10420
10421 const MFloat load = returnLoadRecord();
10422 const MFloat idle = returnIdleRecord();
10423
10424 solverTimings.emplace_back(namePrefix + "loadFvCartesianSolver", load);
10425 solverTimings.emplace_back(namePrefix + "idleFvCartesianSolver", idle);
10426
10427#ifdef MAIA_TIMER_FUNCTION
10428 solverTimings.emplace_back(namePrefix + "timeIntegration", RETURN_TIMER_TIME(m_timers[Timers::TimeInt]));
10429
10430 if(allTimings) {
10431 // Full set of timings
10432 solverTimings.emplace_back(namePrefix + "rhs", RETURN_TIMER_TIME(m_timers[Timers::Rhs]));
10433 solverTimings.emplace_back(namePrefix + "MUSCL", RETURN_TIMER_TIME(m_timers[Timers::Muscl]));
10434 solverTimings.emplace_back(namePrefix + "reconstructCellCenter", RETURN_TIMER_TIME(m_timers[Timers::MusclReconst]));
10435 solverTimings.emplace_back(namePrefix + "reconstructSrfcData",
10436 RETURN_TIMER_TIME(m_timers[Timers::MusclReconstSrfc]));
10437 if(m_useSandpaperTrip) {
10438 solverTimings.emplace_back(namePrefix + "SandpaperTrip", RETURN_TIMER_TIME(m_timers[Timers::SandpaperTrip]));
10439 }
10440 if(m_wmLES) {
10441 solverTimings.emplace_back(namePrefix + "WMFluxCorrection",
10442 RETURN_TIMER_TIME(m_timers[Timers::WMFluxCorrection]));
10443 solverTimings.emplace_back(namePrefix + "WMSurfaceLoop", RETURN_TIMER_TIME(m_timers[Timers::WMSurfaceLoop]));
10444 solverTimings.emplace_back(namePrefix + "WMExchange", RETURN_TIMER_TIME(m_timers[Timers::WMExchange]));
10445 }
10446
10447 IF_CONSTEXPR(isDetChem<SysEqn>) {
10448 solverTimings.emplace_back(namePrefix + "SurfaceCoefficients",
10449 RETURN_TIMER_TIME(m_timers[Timers::SurfaceCoefficients]));
10450 solverTimings.emplace_back(namePrefix + "SurfaceMeanMolarWeight",
10451 RETURN_TIMER_TIME(m_timers[Timers::SurfaceMeanMolarWeight]));
10452 solverTimings.emplace_back(namePrefix + "SurfaceTransportCoefficients",
10454 solverTimings.emplace_back(namePrefix + "CellCenterCoefficients",
10455 RETURN_TIMER_TIME(m_timers[Timers::CellCenterCoefficients]));
10456 solverTimings.emplace_back(namePrefix + "SpeciesReactionRates",
10457 RETURN_TIMER_TIME(m_timers[Timers::SpeciesReactionRates]));
10458 }
10459
10460 solverTimings.emplace_back(namePrefix + "AUSM", RETURN_TIMER_TIME(m_timers[Timers::Ausm]));
10461 solverTimings.emplace_back(namePrefix + "viscFlux", RETURN_TIMER_TIME(m_timers[Timers::ViscFlux]));
10462 solverTimings.emplace_back(namePrefix + "distrFlux", RETURN_TIMER_TIME(m_timers[Timers::DistFlux]));
10463
10464 solverTimings.emplace_back(namePrefix + "rhsBnd", RETURN_TIMER_TIME(m_timers[Timers::RhsBnd]));
10465 solverTimings.emplace_back(namePrefix + "lhs", RETURN_TIMER_TIME(m_timers[Timers::Lhs]));
10466
10467 solverTimings.emplace_back(namePrefix + "lhsBnd", RETURN_TIMER_TIME(m_timers[Timers::LhsBnd]));
10468 solverTimings.emplace_back(namePrefix + "smallCellCorr", RETURN_TIMER_TIME(m_timers[Timers::SmallCellCorr]));
10469 solverTimings.emplace_back(namePrefix + "computePV", RETURN_TIMER_TIME(m_timers[Timers::ComputePV]));
10470 solverTimings.emplace_back(namePrefix + "exchange", RETURN_TIMER_TIME(m_timers[Timers::Exchange]));
10471 solverTimings.emplace_back(namePrefix + "cutOff", RETURN_TIMER_TIME(m_timers[Timers::CutOff]));
10472 solverTimings.emplace_back(namePrefix + "bndryCnd", RETURN_TIMER_TIME(m_timers[Timers::BndryCnd]));
10473 solverTimings.emplace_back(namePrefix + "SCC-init", RETURN_TIMER_TIME(m_timers[Timers::SCCorrInit]));
10474
10475 if(m_levelSetMb) {
10476 solverTimings.emplace_back(namePrefix + "SCC-Ex1", RETURN_TIMER_TIME(m_timers[Timers::SCCorrExchange1]));
10477 solverTimings.emplace_back(namePrefix + "SCC-Wait1", RETURN_TIMER_TIME(m_timers[Timers::SCCorrExchange1Wait]));
10478 solverTimings.emplace_back(namePrefix + "SCC-int", RETURN_TIMER_TIME(m_timers[Timers::SCCorrInterp]));
10479 solverTimings.emplace_back(namePrefix + "SCC-redist", RETURN_TIMER_TIME(m_timers[Timers::SCCorrRedist]));
10480 solverTimings.emplace_back(namePrefix + "SCC-Ex2", RETURN_TIMER_TIME(m_timers[Timers::SCCorrExchange2]));
10481 solverTimings.emplace_back(namePrefix + "SCC-wait2", RETURN_TIMER_TIME(m_timers[Timers::SCCorrExchange2Wait]));
10482 }
10483 } else {
10484 // TODO labels:FV,TIMERS Reduced/essential set of timings
10485 solverTimings.emplace_back(namePrefix + "smallCellCorr", RETURN_TIMER_TIME(m_timers[Timers::SmallCellCorr]));
10486 solverTimings.emplace_back(namePrefix + "exchange", RETURN_TIMER_TIME(m_timers[Timers::Exchange]));
10487 // solverTimings.emplace_back(namePrefix + "bndryCnd", RETURN_TIMER_TIME(m_timers[Timers::BndryCnd]));
10488 }
10489#endif
10490}
MFloat returnIdleRecord() const
Definition: solver.h:486
MFloat returnLoadRecord() const
Definition: solver.h:485

◆ getVorticity()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getVorticity ( MFloat *const  vorticity)
virtual
Author
Ansgar Niemoeller
Date
09.07.2014
Parameters
[out]vorticitycollector for computed vorticity

Vorticity w for cells 0, 1, 2 is stored as follows: wx_0, wx_1, wx_2, wy_0, wy_1, wy_2, wz_0, wz_1, wz_2

Definition at line 8907 of file fvcartesiansolverxd.cpp.

8907 {
8908 TRACE();
8909
8910 IF_CONSTEXPR(nDim == 3) { computeVorticity3D(vorticity); }
8911 else IF_CONSTEXPR(nDim == 2) {
8912 computeVorticity2D(vorticity);
8913 }
8914}
void computeVorticity3D(MFloat *const vorticity)

◆ getVorticityT()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getVorticityT ( MFloat *const  vorticity)
virtual
Author
Michael Schlottke-Lakemper
Date
24.11.2015
Parameters
[out]vorticitycollector for computed vorticity

Vorticity w for cells 0, 1, 2 is stored as follows: wx_0, wy_0, wz_0, wx_1, wy_1, wz_1, wx_2, wy_2, wz_2

Definition at line 8956 of file fvcartesiansolverxd.cpp.

8956 {
8957 TRACE();
8958
8959 IF_CONSTEXPR(nDim == 3) { computeVorticity3DT(vorticity); }
8960 else IF_CONSTEXPR(nDim == 2) {
8961 computeVorticity2D(vorticity);
8962 }
8963}

◆ getWallNormalPointVars()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::getWallNormalPointVars
protected

Definition at line 35230 of file fvcartesiansolverxd.cpp.

35230 {
35231 TRACE();
35232
35233 const MInt noVars = PV->noVariables;
35234
35235 ScratchSpace<MInt> localNoWallNormalPoints(noDomains(), AT_, "localNoWallNormalPoints");
35236 localNoWallNormalPoints.fill(0);
35237
35238 ScratchSpace<MInt> localNoWallNormalCoords(noDomains(), AT_, "localNoWallNormalPoints");
35239 localNoWallNormalCoords.fill(0);
35240
35241 localNoWallNormalPoints[domainId()] = m_wallNormalPointCellIDs.size();
35242 localNoWallNormalCoords[domainId()] = m_wallNormalPointCoords.size();
35243
35244 MPI_Allgather(&localNoWallNormalPoints[domainId()], 1, MPI_INT, &localNoWallNormalPoints[0], 1, MPI_INT, mpiComm(),
35245 AT_, "localNoWallNormalPoints", "localNoWallNormalPoints");
35246 MPI_Allgather(&localNoWallNormalCoords[domainId()], 1, MPI_INT, &localNoWallNormalCoords[0], 1, MPI_INT, mpiComm(),
35247 AT_, "localNoWallNormalCoords", "localNoWallNormalCoords");
35248
35249 // Output vector for variables
35250 ScratchSpace<MFloat> outVariables(localNoWallNormalPoints[domainId()] * noVars, AT_, "outVariables");
35251 outVariables.fill(-99999999.9);
35252 ScratchSpace<MFloat> outVariablesTransformed(localNoWallNormalPoints[domainId()], AT_, "outVariablesTransformed");
35253 outVariablesTransformed.fill(-99999999.9);
35254
35255 for(MInt dom = 0; dom < noDomains(); dom++) {
35256 MInt noPoints = localNoWallNormalPoints[dom];
35257 MInt noCoords = localNoWallNormalCoords[dom];
35258 if(noPoints > 0) {
35259 std::vector<MInt> placement;
35260 placement.clear();
35261 std::vector<MFloat> variables;
35262 variables.clear();
35263
35264 ScratchSpace<MInt> sendDomainsBuffer(noPoints, AT_, "sendDomainsBuffer");
35265 sendDomainsBuffer.fill(-1);
35266
35267 ScratchSpace<MInt> sendLocalIdsBuffer(noPoints, AT_, "sendLocalIdsBuffer");
35268 sendLocalIdsBuffer.fill(-1);
35269
35270 ScratchSpace<MFloat> sendLocalCoordsBuffer(noCoords, AT_, "sendLocalCoordsBuffer");
35271 sendLocalCoordsBuffer.fill(0.0);
35272
35273 ScratchSpace<MInt> sendLocalNeighborsBuffer(noPoints * ((pow(3, nDim) - 1) * pow(2, nDim) + 1), AT_,
35274 "sendLocalNeighborsBuffer");
35275 sendLocalIdsBuffer.fill(-1);
35276 ScratchSpace<MInt> sendLocalNoNeighborsBuffer(noPoints, AT_, "sendLocalNoNeighborsBuffer");
35277 sendLocalIdsBuffer.fill(-1);
35278
35279
35280 ScratchSpace<MInt> allPlacements(noPoints, AT_, "allPlacements");
35281 allPlacements.fill(-1);
35282
35283 ScratchSpace<MFloat> allVariables(noPoints * noVars, AT_, "allVariables");
35284 allVariables.fill(-99999999.9);
35285
35286 // number of variables for the send/recv buffer count
35287 ScratchSpace<MInt> bufferNoVariables(noDomains(), AT_, "bufferNoVariables");
35288 bufferNoVariables.fill(0);
35289 // vairable offsets for displacement in the recombined list
35290 ScratchSpace<MInt> bufferVarsOffsets(noDomains(), AT_, "bufferVarsOffsets");
35291 bufferVarsOffsets.fill(0);
35292
35293 ScratchSpace<MInt> bufferNoPoints(noDomains(), AT_, "bufferNoPoints");
35294 bufferNoPoints.fill(0);
35295 ScratchSpace<MInt> bufferPointOffsets(noDomains(), AT_, "bufferPointOffsets");
35296 bufferPointOffsets.fill(0);
35297
35298 // copy info to the buffer
35299 if(domainId() == dom) {
35300 std::vector<MInt> localNeighbors;
35301 localNeighbors.clear();
35302 for(MInt c = 0; c < noPoints; c++) {
35303 sendDomainsBuffer[c] = m_wallNormalPointDomains[c];
35304 sendLocalIdsBuffer[c] = m_wallNormalPointCellIDs[c];
35305 sendLocalNoNeighborsBuffer[c] = m_neighborPointIds[c].size();
35306 for(MInt position = 0; position < MInt(m_neighborPointIds[c].size()); position++) {
35307 localNeighbors.push_back(m_neighborPointIds[c][position]);
35308 }
35309 }
35310 for(MInt neighbor = 0; neighbor < MInt(localNeighbors.size()); neighbor++) {
35311 sendLocalNeighborsBuffer[neighbor] = localNeighbors[neighbor];
35312 }
35313 for(MInt co = 0; co < noCoords; co++) {
35314 sendLocalCoordsBuffer[co] = m_wallNormalPointCoords[co];
35315 }
35316 }
35317
35318 MPI_Bcast(&sendDomainsBuffer[0], noPoints, MPI_INT, dom, mpiComm(), AT_, "sendDomainsBuffer");
35319 MPI_Bcast(&sendLocalIdsBuffer[0], noPoints, MPI_INT, dom, mpiComm(), AT_, "sendLocalIdsBuffer");
35320 MPI_Bcast(&sendLocalCoordsBuffer[0], noCoords, MPI_DOUBLE, dom, mpiComm(), AT_, "sendLocalCoordsBuffer");
35321 MPI_Bcast(&sendLocalNoNeighborsBuffer[0], noPoints, MPI_INT, dom, mpiComm(), AT_, "sendLocalNoNeighborsBuffer");
35322 MPI_Bcast(&sendLocalNeighborsBuffer[0], noPoints * 209, MPI_INT, dom, mpiComm(), AT_, "sendLocalNeighborsBuffer");
35323
35324 MInt count = 0;
35325 MInt count_next = 0;
35326 std::vector<std::vector<MInt>> neighborList;
35327 neighborList.clear();
35328
35329 std::vector<MInt> tempVec;
35330 tempVec.clear();
35331
35332 for(MInt k = 0; k < noPoints; k++) {
35333 count_next = count_next + sendLocalNoNeighborsBuffer[k];
35334 for(MInt j = count; j < count_next; j++) {
35335 tempVec.push_back(sendLocalNeighborsBuffer[j]);
35336 }
35337
35338 neighborList.push_back(tempVec);
35339 count = count_next;
35340 tempVec.clear();
35341 }
35342
35343
35344 for(MInt p = 0; p < noPoints; p++) {
35345 MInt originDomain = sendDomainsBuffer[p];
35346 if(originDomain == domainId()) {
35347 MInt localId = sendLocalIdsBuffer[p];
35348 placement.push_back(p);
35349
35350 MFloat localCoords[nDim];
35351 localCoords[0] = sendLocalCoordsBuffer[nDim * p];
35352 localCoords[1] = sendLocalCoordsBuffer[nDim * p + 1];
35353 if(nDim == 3) {
35354 localCoords[2] = sendLocalCoordsBuffer[nDim * p + 2];
35355 }
35356
35357
35358 for(MInt v = 0; v < noVars; v++) {
35359 // get primitive variables and add them to variable list
35360 MFloat var = a_pvariable(localId, v);
35361 MFloat interpolatedVar = interpolateWallNormalPointVars(v, localCoords, localId, neighborList[p]);
35363 variables.push_back(interpolatedVar);
35364 } else {
35365 variables.push_back(var);
35366 }
35367 }
35368 }
35369 }
35370
35371 bufferNoVariables[domainId()] = variables.size() * 2;
35372 bufferNoPoints[domainId()] = placement.size();
35373
35374
35375 MPI_Allgather(&bufferNoVariables[domainId()], 1, MPI_INT, &bufferNoVariables[0], 1, MPI_INT, mpiComm(), AT_,
35376 "bufferNoVariables", "bufferNoVariables");
35377
35378 MPI_Allgather(&bufferNoPoints[domainId()], 1, MPI_INT, &bufferNoPoints[0], 1, MPI_INT, mpiComm(), AT_,
35379 "bufferNoPoints", "bufferNoPoints");
35380
35381 for(MInt d = 0; d < noDomains(); d++) {
35382 if(d > 0) {
35383 bufferVarsOffsets[d] = bufferVarsOffsets[d - 1] + bufferNoVariables[d - 1];
35384 bufferPointOffsets[d] = bufferPointOffsets[d - 1] + bufferNoPoints[d - 1];
35385 }
35386 }
35387
35388 MPI_Gatherv(&placement[0], bufferNoPoints[domainId()], MPI_INT, &allPlacements[0], &bufferNoPoints[0],
35389 &bufferPointOffsets[0], MPI_INT, dom, mpiComm(), AT_, "placement", "allPlacements");
35390
35391 MPI_Gatherv(&variables[0], bufferNoVariables[domainId()], MPI_FLOAT, &allVariables[0], &bufferNoVariables[0],
35392 &bufferVarsOffsets[0], MPI_FLOAT, dom, mpiComm(), AT_, "variables", "allVariables");
35393
35394 // copy all the info into correct order into output vectors
35395 if(domainId() == dom) {
35396 for(MInt c = 0; c < noPoints; c++) {
35397 MInt p = allPlacements[c];
35398 if(p != -1) {
35399 for(MInt v = 0; v < noVars; v++) {
35400 outVariables[p * noVars + v] = allVariables[c * noVars + v];
35401 }
35402 }
35403 }
35404 }
35405 }
35406 }
35407
35408 if(domainId() == 0) {
35409 MString interpolated = "";
35411 interpolated = "interpolated";
35412 }
35413 cerr << "Writing " << interpolated << " NETCDF wallNormalData at time step " << globalTimeStep << " ... ";
35414 }
35415
35416 //-------------TRANSFORMATION
35417
35418 MFloat nx = 0;
35419 MFloat ny = 0;
35420 MFloat u = 0;
35421 MFloat v = 0;
35422 MInt n = 0;
35423 MFloat ut = 0;
35424
35425 for(MInt p = 0; p < localNoWallNormalPoints[domainId()]; p++) {
35426 if((p % m_normalNoPoints) == 0) {
35427 nx = m_wallNormalVectors[n * 2];
35428 ny = m_wallNormalVectors[n * 2 + 1];
35429 n++;
35430 }
35431
35432 u = outVariables[p * noVars];
35433 v = outVariables[p * noVars + 1];
35434
35435 MFloat tg1 = 0;
35436 MFloat tg2 = 0;
35437 if(ny >= 0) {
35438 tg1 = (nx * cos((3 * PI) / 2) - ny * sin((3 * PI) / 2));
35439 tg2 = (nx * sin((3 * PI) / 2) + ny * cos((3 * PI) / 2));
35440 } else if(ny < 0) {
35441 tg1 = (nx * cos(PI / 2) - ny * sin(PI / 2));
35442 tg2 = (nx * sin(PI / 2) + ny * cos(PI / 2));
35443 }
35444
35445 ut = u * tg1 + v * tg2;
35446
35447 outVariablesTransformed[p] = ut;
35448 }
35449
35450 //-------------OUTPUT
35451
35452 using namespace maia::parallel_io;
35453 MString dataFileName;
35454
35456 dataFileName = outputDir() + "/pp_normals/interpolatedWallNormalData_" + to_string(globalTimeStep) + ".Netcdf";
35457 } else {
35458 dataFileName = outputDir() + "/pp_normals/wallNormalData_" + to_string(globalTimeStep) + ".Netcdf";
35459 }
35460
35461 ParallelIo parallelIo(dataFileName, PIO_REPLACE, mpiComm());
35462
35463 MInt localNoNormalPoints = m_wallNormalPointCoords.size() / nDim;
35464
35465 MInt workaround = 0;
35466 if(localNoNormalPoints == 0) {
35467 workaround++;
35468 }
35469
35470 ParallelIo::size_type pointOffset;
35471 ParallelIo::size_type globalNoPoints;
35472
35473 ParallelIo::size_type normalOffset;
35474 ParallelIo::size_type globalNoNormals;
35475
35476 parallelIo.calcOffset(localNoNormalPoints, &pointOffset, &globalNoPoints, mpiComm());
35477 parallelIo.calcOffset(m_noWallNormals, &normalOffset, &globalNoNormals, mpiComm());
35478
35479 parallelIo.defineScalar(PIO_INT, "points_per_normal");
35480 parallelIo.defineScalar(PIO_FLOAT, "normal_length");
35481 parallelIo.defineScalar(PIO_FLOAT, "segment_length");
35482
35483 parallelIo.defineArray(PIO_FLOAT, "originCoordX", globalNoNormals);
35484 parallelIo.defineArray(PIO_FLOAT, "originCoordZ", globalNoNormals);
35485 parallelIo.defineArray(PIO_INT, "originSide", globalNoNormals);
35486
35487 parallelIo.defineArray(PIO_FLOAT, "coordinate_x", globalNoPoints);
35488 parallelIo.defineArray(PIO_FLOAT, "coordinate_y", globalNoPoints);
35489 if(nDim == 3) {
35490 parallelIo.defineArray(PIO_FLOAT, "coordinate_z", globalNoPoints);
35491 }
35492
35493 parallelIo.defineArray(PIO_FLOAT, "variable_U_t", globalNoPoints);
35494
35495 parallelIo.defineArray(PIO_FLOAT, "variable_rho", globalNoPoints);
35496 parallelIo.defineArray(PIO_FLOAT, "variable_p", globalNoPoints);
35497
35498 MFloat segmentLength = m_normalLength / (m_normalNoPoints - 1);
35499
35500 parallelIo.writeScalar(m_normalNoPoints, "points_per_normal");
35501 parallelIo.writeScalar(m_normalLength, "normal_length");
35502 parallelIo.writeScalar(segmentLength, "segment_length");
35503
35504 if(workaround == 0) {
35505 parallelIo.setOffset(localNoNormalPoints, pointOffset);
35506
35507 parallelIo.writeArray(&m_wallNormalPointCoords[0], "coordinate_x", nDim);
35508 parallelIo.writeArray(&m_wallNormalPointCoords[1], "coordinate_y", nDim);
35509 if(nDim == 3) {
35510 parallelIo.writeArray(&m_wallNormalPointCoords[2], "coordinate_z", nDim);
35511 }
35512
35513 parallelIo.writeArray(&outVariablesTransformed[0], "variable_U_t", 1);
35514
35515 if(nDim == 2) {
35516 parallelIo.writeArray(&outVariables[2], "variable_rho", noVars);
35517 parallelIo.writeArray(&outVariables[3], "variable_p", noVars);
35518 } else {
35519 parallelIo.writeArray(&outVariables[3], "variable_rho", noVars);
35520 parallelIo.writeArray(&outVariables[4], "variable_p", noVars);
35521 }
35522
35523 parallelIo.setOffset(m_noWallNormals, normalOffset);
35524
35525 parallelIo.writeArray(&m_wallSetupOrigin[0], "originCoordX", 2);
35526 parallelIo.writeArray(&m_wallSetupOrigin[1], "originCoordZ", 2);
35527 parallelIo.writeArray(&m_wallSetupOriginSide[0], "originSide", 1);
35528
35529 } else {
35530 parallelIo.setOffset(localNoNormalPoints, pointOffset);
35531 parallelIo.writeArray(&workaround, "coordinate_x", 1);
35532 parallelIo.writeArray(&workaround, "coordinate_y", 1);
35533
35534 if(nDim == 3) {
35535 parallelIo.writeArray(&workaround, "coordinate_z", 1);
35536 }
35537
35538 parallelIo.writeArray(&workaround, "variable_U_t", 1);
35539
35540 parallelIo.writeArray(&workaround, "variable_rho", 1);
35541 parallelIo.writeArray(&workaround, "variable_p", 1);
35542
35543 parallelIo.setOffset(m_noWallNormals, normalOffset);
35544
35545 parallelIo.writeArray(&workaround, "originCoordX", 1);
35546 parallelIo.writeArray(&workaround, "originCoordZ", 1);
35547 parallelIo.writeArray(&workaround, "originSide", 1);
35548 }
35549
35550 //----------------------------------
35551
35552 if(domainId() == 0) {
35553 cerr << "ok" << endl;
35554 }
35555}
MFloat interpolateWallNormalPointVars(MInt var, MFloat coords[], MInt localId, std::vector< MInt > neighborList)
MString outputDir() const
Return the directory for output files.
Definition: solver.h:407
MInt neighborList(const MInt cellId, const MInt dir) const

◆ globalMpiComm()

template<MInt nDim_, class SysEqn >
MPI_Comm FvCartesianSolverXD< nDim_, SysEqn >::globalMpiComm ( ) const
inline

Definition at line 1403 of file fvcartesiansolverxd.h.

1403{ return grid().raw().mpiComm(); }

◆ gridPointIsInside()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::gridPointIsInside ( MInt  exId,
MInt  node 
)
inlineprotectedvirtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 8159 of file fvcartesiansolverxd.cpp.

8159 {
8160 MFloat x[nDim];
8161 ASSERT(exId > -1 && exId < m_extractedCells->size() && node > -1 && node < IPOW2(nDim), "");
8162 MInt gridPointId = m_extractedCells->a[exId].m_pointIds[node];
8163 ASSERT(gridPointId > -1 && gridPointId < m_gridPoints->size(), "");
8164 for(MInt i = 0; i < nDim; i++) {
8165 x[i] = m_gridPoints->a[gridPointId].m_coordinates[i];
8166 }
8167 return m_geometry->pointIsInside2(x);
8168}
Collector< CartesianGridPoint< nDim > > * m_gridPoints

◆ hasRestartTimeStep()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::hasRestartTimeStep ( ) const
inlineoverridevirtual

Return if the restart time step can be determined from the restart file (for useNonSpecifiedRestartFile = true)

Reimplemented from Solver.

Definition at line 2151 of file fvcartesiansolverxd.h.

2151{ return true; }

◆ hasSplitBalancing()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::hasSplitBalancing ( ) const
inlineoverridevirtual

Reimplemented from Solver.

Definition at line 2404 of file fvcartesiansolverxd.h.

2404{ return true; }

◆ identPeriodicCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::identPeriodicCells

Definition at line 31821 of file fvcartesiansolverxd.cpp.

31821 {
31822 IF_CONSTEXPR(nDim == 2) { mTerm(1, "Azimuthal periodicity concept meaningful only in 3D."); }
31823 else {
31825 }
31826}

◆ identPeriodicCells_()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::identPeriodicCells_
inline

\identifies periodic cells to copy PV from (azimuthal periodicity concept)

Author
Alexej Pogorelov

left

right

Definition at line 31833 of file fvcartesiansolverxd.cpp.

31833 {
31834 TRACE();
31835
31836 m_noPeriodicCellData = PV->noVariables;
31838
31839 MFloat periodic_coord[2];
31840 periodic_coord[0] = 0.0;
31841 periodic_coord[1] = 0.0;
31842 if(m_periodicCells == 2 || m_periodicCells == 3) {
31843 for(MInt i = 0; i < 2; i++) {
31844 periodic_coord[i] = Context::getSolverProperty<MFloat>("periodic_coord", m_solverId, AT_, i);
31845 }
31846 }
31847 // init
31848 MInt m_maxNoPeriodicCells = 0;
31849 m_maxNoPeriodicCells = Context::getSolverProperty<MInt>("maxNoPeriodicCells", m_solverId, AT_, &m_maxNoPeriodicCells);
31850
31852
31853 MFloat z_min_1, z_min_2, z_min_11, z_min_12;
31854 MFloat halfLength_1, halfLength_2;
31855
31856 MFloat xmax = -900.0;
31857 MFloat ymax = -900.0;
31858 MFloat zmax = -900.0;
31859
31860 MFloat xmin = 900.0;
31861 MFloat ymin = 900.0;
31862 MFloat zmin = 900.0;
31863
31864
31865 // domain boundaries
31866 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
31867 xmax = mMax(xmax, a_coordinate(cellId, 0));
31868 ymax = mMax(ymax, a_coordinate(cellId, 1));
31869 zmax = mMax(zmax, a_coordinate(cellId, 2));
31870 xmin = mMin(xmin, a_coordinate(cellId, 0));
31871 ymin = mMin(ymin, a_coordinate(cellId, 1));
31872 zmin = mMin(zmin, a_coordinate(cellId, 2));
31873 }
31874
31875 // m_fvBndryCnd->recorrectCellCoordinates();
31876
31877 // search cells in overlapping region and add them to m_sortedPeriodicCells (skip ghost cells)
31878 // m_periodicCells=1 --> azimuthal periodicity (with LS interpolation)
31879 // m_periodicCells=2 --> periodicity in x-direction (without LS interpolation)
31880 // m_periodicCells=3 --> periodicity in x-direction (without LS interpolation + volume forcing)
31881 if(m_periodicCells == 1) {
31882 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
31883 a_hasProperty(cellId, SolverCell::IsPeriodicWithRot) = false;
31884
31885 if(a_isBndryGhostCell(cellId) || c_noChildren(cellId) != 0
31886 || !a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
31887 continue;
31888 }
31889
31890
31891 halfLength_1 = c_cellLengthAtLevel(a_level(cellId) + 1);
31892 halfLength_2 = c_cellLengthAtLevel(maxLevel() + 1);
31893
31894 z_min_1 = -6.3137515147 * a_coordinate(cellId, 1) + 1462.750302935;
31895 z_min_2 = -0.1583844403 * a_coordinate(cellId, 1) + 231.6768880649;
31896 z_min_11 = -6.3137515147 * (a_coordinate(cellId, 1) - halfLength_1) + 1462.750302935;
31897 z_min_12 = -0.1583844403 * (a_coordinate(cellId, 1) + halfLength_1) + 231.6768880649;
31898
31899
31900 if(( // Cells between periodic Bndry
31901 a_coordinate(cellId, 1) < m_rotAxisCoord[0] && a_coordinate(cellId, 2) <= z_min_1
31902 && a_coordinate(cellId, 2) >= z_min_2)
31903 || ( // intersection Cells on left periodic Bndry
31904 a_coordinate(cellId, 1) < m_rotAxisCoord[0] && a_coordinate(cellId, 2) > z_min_1
31905 && (a_coordinate(cellId, 2) - halfLength_1) < z_min_11 //&&a_bndryId( cellId )< 0
31906 )
31907 || ( // intersection Cells on left periodic Bndry
31908 a_coordinate(cellId, 1) > (m_rotAxisCoord[0] - 4.0 * halfLength_2)
31909 && a_coordinate(cellId, 1) < m_rotAxisCoord[0] && a_coordinate(cellId, 2) < z_min_2
31910 && (a_coordinate(cellId, 2) + halfLength_1) > z_min_12 //&&a_bndryId( cellId )< 0
31911 )
31912 || ( // Cells at rotAxis
31913 (fabs(a_coordinate(cellId, 1) - m_rotAxisCoord[0]) < halfLength_1 * 2.0)
31914 && (fabs(a_coordinate(cellId, 2) - m_rotAxisCoord[1]) < halfLength_1 * 2.0))) {
31915 continue;
31916 }
31917
31919 a_hasProperty(cellId, SolverCell::IsPeriodicWithRot) = true;
31921 }
31922 } else if(m_periodicCells == 2 || m_periodicCells == 3) {
31924
31925 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
31926 a_hasProperty(cellId, SolverCell::IsPeriodicWithRot) = false;
31927
31928 if(a_isBndryGhostCell(cellId) || c_noChildren(cellId) != 0
31929 || !a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
31930 continue;
31931 }
31932
31933 if( // Cells between periodic Bndry
31934 a_coordinate(cellId, 0) > periodic_coord[0] && a_coordinate(cellId, 0) < periodic_coord[1]) {
31935 continue;
31936 }
31937
31939 a_hasProperty(cellId, SolverCell::IsPeriodicWithRot) = true;
31941 }
31943 }
31944
31945 if(m_maxNoPeriodicCells < m_sortedPeriodicCells->size()) {
31946 mTerm(1, AT_, "raise max periodc cells");
31947 }
31948
31949
31950 m_log << "*************************" << endl;
31951 m_log << "PeriodicCells Identified" << endl;
31952 m_log << "*************************" << endl;
31953
31954 xmax += c_cellLengthAtLevel(minLevel());
31955 ymax += c_cellLengthAtLevel(minLevel());
31956 zmax += c_cellLengthAtLevel(minLevel());
31957 xmin -= c_cellLengthAtLevel(minLevel());
31958 ymin -= c_cellLengthAtLevel(minLevel());
31959 zmin -= c_cellLengthAtLevel(minLevel());
31960
31961
31962 // m_fvBndryCnd->rerecorrectCellCoordinates();
31963 MInt noPeriodicCells; // no of Cells(in this Domain) in overlapping Region
31964 noPeriodicCells = m_sortedPeriodicCells->size();
31965
31966 // excahnge number of Cells in overlapping region for every domain
31967 mAlloc(m_noPeriodicCellsDom, noDomains(), "m_noPeriodicCellsDom", -1, AT_);
31968
31969 for(MInt i = 0; i < noDomains(); i++) {
31970 m_noPeriodicCellsDom[i] = 0;
31971 }
31972
31973 MPI_Allgather(&noPeriodicCells, 1, MPI_INT, m_noPeriodicCellsDom, 1, MPI_INT, mpiComm(), AT_, "noPeriodicCells",
31974 "m_noPeriodicCellsDom");
31975
31976
31977 // save coordinates of cutted cells and exchange them.....after rotating compare them to uncutted
31978 // cells m_periodicCellDataDom[x][y][z][cellId or -1][left=-1 right=+1] save coordinates of cutted
31979 // cells in m_noPeriodicCellsDom
31981 for(MInt domains = 0; domains < noDomains(); domains++) {
31983 }
31984 m_log << "*************************" << endl;
31985 m_log << "Alloc Memory" << endl;
31986 m_log << "*************************" << endl;
31987
31988 MFloat z_min_45 = 0.0;
31989 MFloat x_mid = 0;
31990 x_mid = (periodic_coord[0] + periodic_coord[1]) / 2.0;
31991
31992 if(m_periodicCells == 1) {
31993 for(MInt id = 0; id < noPeriodicCells; id++) {
31994 for(MInt dim = 0; dim < 3; dim++) {
31997 }
31998 m_periodicCellDataDom[domainId()][3 + m_noPeriodicCellData * id] = -1; // set cellsId to copy from to -1
31999 z_min_45 = -a_coordinate(m_sortedPeriodicCells->a[id], 1) + 400 - c_cellLengthAtLevel(minLevel()) / 10.0;
32000
32001 if(a_coordinate(m_sortedPeriodicCells->a[id], 2) >= z_min_45) {
32003 } else {
32005 }
32006 }
32007 } else if(m_periodicCells == 2 || m_periodicCells == 3) {
32008 for(MInt id = 0; id < noPeriodicCells; id++) {
32009 for(MInt dim = 0; dim < 3; dim++) {
32012 }
32013 m_periodicCellDataDom[domainId()][3 + m_noPeriodicCellData * id] = -1; // set cellsId to copy from to -1
32014
32015 if(a_coordinate(m_sortedPeriodicCells->a[id], 2) < x_mid) {
32016 m_periodicCellDataDom[domainId()][4 + m_noPeriodicCellData * id] = -1.0; // left periodic boundary
32017 } else {
32018 m_periodicCellDataDom[domainId()][4 + m_noPeriodicCellData * id] = 1.0; // right periodic boundary
32019 }
32020 }
32021 }
32022
32023 ScratchSpace<MPI_Request> send_Req(noDomains(), AT_, "sendReq");
32024 ScratchSpace<MPI_Request> recv_Req(noDomains(), AT_, "recvReq");
32025 send_Req.fill(MPI_REQUEST_NULL);
32026 recv_Req.fill(MPI_REQUEST_NULL);
32027
32028 // exchange cell coordinates
32029 for(MInt snd = 0; snd < domainId(); snd++) {
32030 if(m_noPeriodicCellsDom[snd] > 0) {
32032 MPI_Irecv(m_periodicCellDataDom[snd], bufSize, MPI_DOUBLE, snd, 0, mpiComm(), &recv_Req[snd], AT_,
32033 "m_periodicCellDataDom[snd]");
32034 }
32035 }
32036 for(MInt rcv = 0; rcv < noDomains(); rcv++) {
32037 if(rcv != domainId()) {
32038 if(m_noPeriodicCellsDom[domainId()] > 0) {
32040 MPI_Isend(m_periodicCellDataDom[domainId()], bufSize, MPI_DOUBLE, rcv, 0, mpiComm(), &send_Req[rcv], AT_,
32041 "m_periodicCellDataDom[domainId()]");
32042 }
32043 }
32044 }
32045
32046 if(domainId() < noDomains() - 1) {
32047 for(MInt snd = domainId() + 1; snd < noDomains(); snd++) {
32048 if(m_noPeriodicCellsDom[snd] > 0) {
32050 MPI_Irecv(m_periodicCellDataDom[snd], bufSize, MPI_DOUBLE, snd, 0, mpiComm(), &recv_Req[snd], AT_,
32051 "m_periodicCellDataDom[snd]");
32052 }
32053 }
32054 }
32055
32056 MPI_Waitall(noDomains(), &recv_Req[0], MPI_STATUSES_IGNORE, AT_);
32057 MPI_Waitall(noDomains(), &send_Req[0], MPI_STATUSES_IGNORE, AT_);
32058
32059
32060 MFloat halfLength = 0;
32061 MFloat c_x, c_y, c_z, c_x_rot, c_y_rot, c_z_rot;
32062 MBool rotated = false;
32063 MBool found = false;
32064 MFloat count_found = 0;
32065 MInt rot_counter = 0;
32066
32067 // get coordinates of uncutted cells
32069
32070
32071 m_log << "*************************" << endl;
32072 m_log << "Build Tree" << endl;
32073 m_log << "*************************" << endl;
32074
32075
32076 const MInt maxNoNghbrs_ = 45;
32077 MIntScratchSpace nghbrList_(maxNoNghbrs_, AT_, "nghbrList");
32078 MIntScratchSpace layerId_(maxNoNghbrs_, AT_, "layerList");
32079 MInt counter_ = 0;
32080
32081
32082 MInt noCells = noInternalCells();
32083
32084 vector<Point<3>> pts;
32085 for(MInt cellId = 0; cellId < noCells; ++cellId) {
32086 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel) && !a_isBndryGhostCell(cellId) && !a_isHalo(cellId)
32087 && c_isLeafCell(cellId)) {
32088 Point<3> a(a_coordinate(cellId, 0), a_coordinate(cellId, 1), a_coordinate(cellId, 2), cellId);
32089 pts.push_back(a);
32090 }
32091 }
32092
32093 // build up the tree
32094 KDtree<3> tree(pts);
32095 MFloat distance = -1.0;
32097
32098
32099 m_log << "*************************" << endl;
32100 m_log << "Tree Built" << endl;
32101 m_log << "*************************" << endl;
32102
32103 // rotate coordinates and look for cells to copy from in each domain
32104 for(MInt domain = 0; domain < noDomains(); domain++) {
32105 for(MInt cell = 0; cell < m_noPeriodicCellsDom[domain]; cell++) {
32106 found = false;
32107 rot_counter = 0;
32108 c_x = m_periodicCellDataDom[domain][0 + m_noPeriodicCellData * cell];
32109 c_y = m_periodicCellDataDom[domain][1 + m_noPeriodicCellData * cell];
32110 c_z = m_periodicCellDataDom[domain][2 + m_noPeriodicCellData * cell];
32111
32112 // rotate until inner region reached
32113 z_min_45 = -c_y + 400 - c_cellLengthAtLevel(minLevel()) / 10.0;
32114
32115 if(m_periodicCells == 1) {
32116 if(c_z < z_min_45) {
32117 do {
32118 rot_counter++;
32119 rotated = false;
32120 c_y_rot = cos(72.0 / 180.0 * PI) * (c_y - m_rotAxisCoord[0])
32121 + sin(72.0 / 180.0 * PI) * (c_z - m_rotAxisCoord[1]) + m_rotAxisCoord[0];
32122 c_z_rot = -sin(72.0 / 180.0 * PI) * (c_y - m_rotAxisCoord[0])
32123 + cos(72.0 / 180.0 * PI) * (c_z - m_rotAxisCoord[1]) + m_rotAxisCoord[1];
32124 c_x_rot = c_x;
32125 m_periodicCellDataDom[domain][1 + m_noPeriodicCellData * cell] = c_y_rot;
32126 m_periodicCellDataDom[domain][2 + m_noPeriodicCellData * cell] = c_z_rot;
32127 c_y = c_y_rot;
32128 c_z = c_z_rot;
32129
32130 z_min_1 = -6.3137515147 * c_y + 1462.750302935;
32131 z_min_2 = -0.1583844403 * c_y + 231.6768880649;
32132
32133
32134 if((c_z >= (z_min_2 - eps_) && c_z <= (z_min_1 + eps_) && c_y <= m_rotAxisCoord[0])
32135 || rot_counter == 2 // && c_z> 200.0
32136 ) {
32137 rotated = true;
32138 }
32139 } while(!rotated);
32140 } else {
32141 do {
32142 rot_counter++;
32143 rotated = false;
32144 c_y_rot = cos(72.0 / 180.0 * PI) * (c_y - m_rotAxisCoord[0])
32145 - sin(72.0 / 180.0 * PI) * (c_z - m_rotAxisCoord[1]) + m_rotAxisCoord[0];
32146 c_z_rot = +sin(72.0 / 180.0 * PI) * (c_y - m_rotAxisCoord[0])
32147 + cos(72.0 / 180.0 * PI) * (c_z - m_rotAxisCoord[1]) + m_rotAxisCoord[0];
32148 c_x_rot = c_x;
32149 m_periodicCellDataDom[domain][1 + m_noPeriodicCellData * cell] = c_y_rot;
32150 m_periodicCellDataDom[domain][2 + m_noPeriodicCellData * cell] = c_z_rot;
32151 c_y = c_y_rot;
32152 c_z = c_z_rot;
32153
32154 z_min_1 = -6.3137515147 * c_y + 1462.750302935;
32155 z_min_2 = -0.1583844403 * c_y + 231.6768880649;
32156
32157 if((c_z >= (z_min_2 - eps_) && c_z <= (z_min_1 + eps_) && c_y <= m_rotAxisCoord[0])
32158 || rot_counter == 2 // && c_z> 200.0
32159 ) {
32160 rotated = true;
32161 }
32162 } while(!rotated);
32163 }
32164 } else if(m_periodicCells == 2 || m_periodicCells == 3) {
32165 eps_ = 0.0;
32166 if(c_x < x_mid) {
32167 rot_counter++;
32168 c_x_rot = periodic_coord[1] - (periodic_coord[0] - c_x);
32169 c_y_rot = c_y;
32170 c_z_rot = c_z;
32171 m_periodicCellDataDom[domain][0 + m_noPeriodicCellData * cell] = c_x_rot;
32172 c_x = c_x_rot;
32173 } else {
32174 rot_counter++;
32175 c_x_rot = (c_x - periodic_coord[1]) + periodic_coord[0];
32176 c_y_rot = c_y;
32177 c_z_rot = c_z;
32178 m_periodicCellDataDom[domain][0 + m_noPeriodicCellData * cell] = c_x_rot;
32179 c_x = c_x_rot;
32180 }
32181 }
32182
32183 if((c_x >= xmin && c_x <= xmax) && (c_y >= ymin) && (c_y <= ymax) && (c_z >= zmin) && (c_z <= zmax)) {
32184 distance = -1.1111;
32185 Point<3> pt(c_x, c_y, c_z);
32186 MInt cI = tree.nearest(pt, distance);
32187 MFloat delta_x = fabs(a_coordinate(cI, 0) - c_x - eps_);
32188 MFloat delta_y = fabs(a_coordinate(cI, 1) - c_y);
32189 MFloat delta_z = fabs(a_coordinate(cI, 2) - c_z);
32190
32191 halfLength = c_cellLengthAtLevel(a_level(cI) + 1);
32192
32193 if(distance < 0.0) {
32194 mTerm(1, AT_, "negative distance");
32195 }
32196 if(delta_x <= halfLength && delta_y <= halfLength && delta_z <= halfLength && distance >= 0.0) {
32197 found = true;
32198 m_periodicCellDataDom[domain][3 + m_noPeriodicCellData * cell] = cI; // store cellId to copy from
32199 m_periodicCellDataDom[domain][4 + m_noPeriodicCellData * cell] =
32200 m_periodicCellDataDom[domain][4 + m_noPeriodicCellData * cell] * rot_counter; // store number of rotations
32201
32202 if(rot_counter > 2 || rot_counter < -2) {
32203 // cout << "ROT_COUNTER " << m_periodicCellDataDom[domain][4+5*cell] << " y_rot "
32204 //<< c_y_rot << " z_rot" <<c_z_rot<<endl;
32205 }
32206 count_found++;
32207 } else if((delta_x > halfLength || delta_y > halfLength || delta_z > halfLength)
32208 && distance <= 8.0 * halfLength) {
32209 counter_ = 0;
32210 counter_ = getAdjacentLeafCells<2, false>(cI, 1, nghbrList_, layerId_);
32211
32212 for(MInt k = 0; k < counter_; k++) {
32213 MInt nghbr_Id = nghbrList_[k];
32214 if(nghbr_Id < 0) {
32215 continue;
32216 }
32217 if(!a_hasProperty(nghbr_Id, SolverCell::IsOnCurrentMGLevel)) {
32218 continue;
32219 }
32220 if(a_isBndryGhostCell(nghbr_Id)) {
32221 continue;
32222 }
32223 if(a_isHalo(nghbr_Id)) {
32224 continue;
32225 }
32226 if(c_noChildren(nghbr_Id) != 0) {
32227 continue;
32228 }
32229 delta_x = fabs(a_coordinate(nghbr_Id, 0) - c_x - eps_);
32230 delta_y = fabs(a_coordinate(nghbr_Id, 1) - c_y);
32231 delta_z = fabs(a_coordinate(nghbr_Id, 2) - c_z);
32232
32233
32234 halfLength = c_cellLengthAtLevel(a_level(nghbr_Id) + 1);
32235 if(delta_x <= halfLength && delta_y <= halfLength && delta_z <= halfLength) {
32236 found = true;
32237 m_periodicCellDataDom[domain][3 + m_noPeriodicCellData * cell] = nghbr_Id; // store cellId to copy from
32238 m_periodicCellDataDom[domain][4 + m_noPeriodicCellData * cell] =
32240 * rot_counter; // store number of rotations
32241
32242 if(rot_counter > 2 || rot_counter < -2) {
32243 // cout << "ROT_COUNTER " <<
32244 // m_periodicCellDataDom[domain][4+5*cell] << " y_rot "
32245 // << c_y_rot << " z_rot" <<c_z_rot<<endl;
32246 }
32247 count_found++;
32248 break;
32249 }
32250 }
32251 }
32252 }
32253 if(!found) {
32254 m_periodicCellDataDom[domain][3 + m_noPeriodicCellData * cell] = -1;
32255 m_periodicCellDataDom[domain][4 + m_noPeriodicCellData * cell] =
32256 m_periodicCellDataDom[domain][4 + m_noPeriodicCellData * cell] * rot_counter; // store number of rotations
32257 if(noDomains() == 1) {
32258 cout << "nothing found: " << domainId() << " cx: " << c_x << " cy: " << c_y << " cz: " << c_z
32259 << " cx_r: " << c_x << " cy_r: " << c_y << " cz_r: " << c_z << endl;
32260 mTerm(1, AT_, "NOTHING FOUND");
32261 }
32262 }
32263 }
32264 }
32265
32266
32267 // correct cell coordinates back
32269
32270
32271 MPI_Status status;
32272
32273 // array with information how many cells data to send/receive to/from wich domain
32276
32277
32278 for(MInt dom = 0; dom < noDomains(); dom++) {
32279 m_noPerCellsToSend[dom] = 0;
32280 for(MInt c = 0; c < m_noPeriodicCellsDom[dom]; c++) {
32281 if(m_periodicCellDataDom[dom][3 + m_noPeriodicCellData * c] >= 0) {
32282 m_noPerCellsToSend[dom] = m_noPerCellsToSend[dom] + 1;
32283 }
32284 }
32285 }
32286
32288
32289 for(MInt dom = 0; dom < noDomains(); dom++) {
32290 // cout<< "DOMAIN; " << domainId() << " has to send " << m_noPerCellsToSend[dom] << " to
32291 // Domain " << dom << endl;
32292 }
32293
32294
32295 // exchange information how many cell data to send/receive
32296
32297 for(MInt snd = 0; snd < domainId(); snd++) {
32298 MPI_Recv(&m_noPerCellsToReceive[snd], 1, MPI_INT, snd, 0, mpiComm(), &status, AT_, "m_noPerCellsToReceive[snd]");
32299 }
32300 for(MInt rcv = 0; rcv < noDomains(); rcv++) {
32301 if(rcv != domainId()) {
32302 MPI_Send(&m_noPerCellsToSend[rcv], 1, MPI_INT, rcv, 0, mpiComm(), AT_, "m_noPerCellsToSend[rcv]");
32303 }
32304 }
32305
32306 if(domainId() < noDomains() - 1) {
32307 for(MInt snd = domainId() + 1; snd < noDomains(); snd++) {
32308 MPI_Recv(&m_noPerCellsToReceive[snd], 1, MPI_INT, snd, 0, mpiComm(), &status, AT_, "m_noPerCellsToReceive[snd]");
32309 }
32310 }
32311
32312
32313 for(MInt dom = 0; dom < noDomains(); dom++) {
32314 // cout<< "DOMAIN; " << domainId() << " has to receive " << m_noPerCellsToReceive[dom] << "
32315 // from Domain " << dom << endl;
32316 }
32317
32318
32319 m_log << "*************************" << endl;
32320 m_log << "AllocateMemory 2" << endl;
32321 m_log << "*************************" << endl;
32322
32323
32324 // memory for storage of conservative variables + sortedId + cellId to copy from
32326
32327 m_noPeriodicCellData = PV->noVariables;
32329
32330
32331 // RANS Azimuthal
32332 for(MInt dom = 0; dom < noDomains(); dom++) {
32334 }
32335
32336 // memory for storage of received cell data
32338
32339 for(MInt dom = 0; dom < noDomains(); dom++) {
32341 }
32342
32343 MInt counting;
32344
32345 for(MInt dom = 0; dom < noDomains(); dom++) {
32346 counting = 0;
32347 for(MInt c = 0; c < m_noPeriodicCellsDom[dom]; c++) {
32348 if(m_periodicCellDataDom[dom][3 + m_noPeriodicCellData * c] >= 0) { // ACHTUNG int -- float conversion
32349
32350 m_periodicDataToSend[dom][5 + counting * m_noPeriodicData] = c;
32351 m_periodicDataToSend[dom][6 + counting * m_noPeriodicData] =
32353 counting++;
32354 }
32355 }
32356 }
32357
32358 m_log << "*************************" << endl;
32359 m_log << "Connectivity Matrix created" << endl;
32360 m_log << "*************************" << endl;
32361}
void append()
Definition: list.h:66
MInt setSize(MInt inputSize)
Definition: list.h:31
int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status, const MString &name, const MString &varname)
same as MPI_Recv
int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, const MString &name, const MString &varname)
same as MPI_Send
Definition: kdtree.h:73
Definition: pointbox.h:20

◆ implicitTimeStep()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::implicitTimeStep
overridevirtual

Updates old solutions for the physical time derivative (dual time stepping)

Author
Daniel Hartmann, 23.08.2006

Reimplemented from Solver.

Definition at line 21329 of file fvcartesiansolverxd.cpp.

21329 {
21330 TRACE();
21331
21333
21334 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
21335 for(MInt varId = 0; varId < CV->noVariables; varId++) {
21336 a_dt2Variable(cellId, varId) = a_dt1Variable(cellId, varId);
21337 a_dt1Variable(cellId, varId) = a_variable(cellId, varId);
21338 }
21339 }
21340}

◆ initAzimuthalCartesianHaloInterpolation()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initAzimuthalCartesianHaloInterpolation ( )

◆ initAzimuthalMaxLevelExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initAzimuthalMaxLevelExchange ( )

◆ initAzimuthalNearBoundaryExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initAzimuthalNearBoundaryExchange ( MIntScratchSpace activeFlag)

◆ initAzimuthalReconstruction()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initAzimuthalReconstruction ( )

◆ initCanteraObjects()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::initCanteraObjects

Definition at line 689 of file fvcartesiansolverxd.cpp.

689 {
690#if defined(WITH_CANTERA)
691 m_canteraSolution = Cantera::newSolution(m_detChem.reactionMechanism, m_detChem.phaseName, m_detChem.transportModel);
695#endif
696}
std::shared_ptr< Cantera::Kinetics > m_canteraKinetics
struct FvCartesianSolverXD::@9 m_detChem

◆ initCellMaterialNo()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::initCellMaterialNo ( )
inlineprotectedvirtual

Definition at line 2212 of file fvcartesiansolverxd.h.

2212{};

◆ initChannelForce()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initChannelForce
protected

Definition at line 34200 of file fvcartesiansolverxd.cpp.

34200 {
34201 TRACE();
34202 // only for channels for a height of 2*referenceLength
34203 const MFloat channelReTau = Context::getSolverProperty<MFloat>("channelReTau", m_solverId, AT_, &channelReTau);
34204 // Both forumlations give mostly identical results
34205 // m_channelVolumeForce = m_rhoInfinity / m_referenceLength * POW2(channelReTau / m_Re * m_UInfinity);
34206 m_channelVolumeForce = POW2(channelReTau / sysEqn().m_Re0);
34207}

◆ initComputeSurfaceValuesLimitedSlopesMan1()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initComputeSurfaceValuesLimitedSlopesMan1 ( )
virtual
Author
Thomas Schilden, December 2017

◆ initComputeSurfaceValuesLimitedSlopesMan2()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initComputeSurfaceValuesLimitedSlopesMan2 ( )
virtual
Author
Thomas Schilden, December 2017

◆ initCutOffBoundaryCondition()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initCutOffBoundaryCondition

Definition at line 14270 of file fvcartesiansolverxd.cpp.

14270 {
14271 TRACE();
14272
14274}

◆ initDepthCorrection()

template<MInt nDim_, class SysEqn >
template<class _ = void, std::enable_if_t< isEEGas< SysEqn >, _ * > = nullptr>
void FvCartesianSolverXD< nDim_, SysEqn >::initDepthCorrection ( )

◆ initHeatReleaseDamp()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initHeatReleaseDamp

Definition at line 499 of file fvcartesiansolverxd.cpp.

499 {
500 MInt dampDist = 9;
501 if(Context::propertyExists("dampDist", m_solverId))
502 dampDist = Context::getSolverProperty<MInt>("dampDist", m_solverId, AT_, &dampDist);
503
504 MInt noDampedWalls = 0;
505 if(Context::propertyExists("noDampedWalls", m_solverId))
506 noDampedWalls = Context::getSolverProperty<MInt>("noDampedWalls", m_solverId, AT_, &noDampedWalls);
507
508 if(noDampedWalls == 0)
509 mTerm(1, "initHeatReleaseDamp() has been called, but noDampedWalls = 0. Check properties file.");
510
511 std::vector<MString> filename;
512 for(MInt Id = 0; Id < noDampedWalls; Id++) {
513 stringstream name;
514 name << "dampedWall." << Id;
515 filename.push_back(name.str());
516 }
517
518 m_dampFactor.assign(a_noCells(), F1);
519
520 for(MUint Id = 0; Id < filename.size(); Id++) {
521 vector<MInt> markedCells;
522 MIntScratchSpace propDist(grid().raw().treeb().size(), AT_, "propDist");
523 propDist.fill(numeric_limits<MInt>::max());
524
525 IF_CONSTEXPR(nDim == 2) {
526 Geometry2D* auxGeom = new Geometry2D(0, filename[Id], mpiComm());
527 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
528 const MFloat cellHalfLength = c_cellLengthAtLevel(a_level(cellId) + 1);
529 if(!c_noChildren(cellId) && auxGeom->isOnGeometry(cellHalfLength, &a_coordinate(cellId, 0), "SAT"))
530 if(grid().tree().solver2grid(cellId) > -1) markedCells.push_back(grid().tree().solver2grid(cellId));
531 }
532 }
533 IF_CONSTEXPR(nDim == 3) {
534 Geometry3D* auxGeom = new Geometry3D(0, filename[Id], mpiComm());
535 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
536 const MFloat cellHalfLength = c_cellLengthAtLevel(a_level(cellId) + 1);
537 if(!c_noChildren(cellId) && auxGeom->isOnGeometry(cellHalfLength, &a_coordinate(cellId, 0), "SAT"))
538
539 if(grid().tree().solver2grid(cellId) > -1) markedCells.push_back(grid().tree().solver2grid(cellId));
540 }
541 }
542
543 MLong tmp = markedCells.size();
544 MPI_Allreduce(MPI_IN_PLACE, &tmp, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "tmp");
545 m_log << " overall cells on damping region: " << tmp << endl;
546 tmp = 0;
547
548 grid().raw().propagateDistance(markedCells, propDist, dampDist);
549
550 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
551 if(a_isBndryGhostCell(cellId)) continue;
552 const MInt gridCellId = grid().tree().solver2grid(cellId);
553 if(gridCellId < 0) continue;
554 if(propDist[gridCellId] != numeric_limits<MInt>::max()) {
555 m_dampFactor[cellId] = (MFloat)propDist[gridCellId] / ((MFloat)dampDist);
556 tmp++;
557 }
558 }
559
560 MPI_Allreduce(MPI_IN_PLACE, &tmp, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "tmp");
561 m_log << " overall damped cells: " << tmp << endl;
562 }
563}
static MBool propertyExists(const MString &name, MInt solver=m_noSolvers)
This function checks if a property exists in general.
Definition: context.cpp:494
MBool isOnGeometry(const MFloat, const MFloat *, MString)
Definition: geometry.cpp:748

◆ initializeFvCartesianSolver()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initializeFvCartesianSolver ( const MBool propertiesGroups)

◆ initializeMaxLevelExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initializeMaxLevelExchange
virtual
Author
Lennart Schneiders

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 6238 of file fvcartesiansolverxd.cpp.

6238 {
6239 TRACE();
6240
6241 if(noNeighborDomains() == 0) return;
6242
6243 ScratchSpace<MInt> haloCellsCnt(noNeighborDomains(), AT_, "noHaloCells");
6244 ScratchSpace<MInt> windowCellsCnt(noNeighborDomains(), AT_, "noWindowCells");
6245 for(MInt d = 0; d < noNeighborDomains(); d++) {
6246 haloCellsCnt[d] = noHaloCells(d);
6247 windowCellsCnt[d] = noWindowCells(d);
6248 }
6249
6251 mAlloc(m_maxLevelHaloCells, noNeighborDomains(), &haloCellsCnt[0], "m_maxLevelHaloCells", AT_);
6253 mAlloc(m_maxLevelWindowCells, noNeighborDomains(), &windowCellsCnt[0], "m_maxLevelWindowCells", AT_);
6254
6255 ScratchSpace<MInt> isOnMaxLevel(a_noCells(), AT_, "isOnMaxLevel");
6256 isOnMaxLevel.fill(0);
6257
6258 for(MInt i = 0; i < noNeighborDomains(); i++) {
6259 m_noMaxLevelHaloCells[i] = 0;
6260 for(MInt j = 0; j < noHaloCells(i); j++) {
6261 if(!a_hasProperty(haloCellId(i, j), SolverCell::IsOnCurrentMGLevel)) {
6262 continue;
6263 }
6266 isOnMaxLevel(haloCellId(i, j)) = 1;
6267 }
6268 }
6269
6270 MUint recvSize = maia::mpi::getBufferSize(grid().windowCells());
6271 ScratchSpace<MInt> recvBuffer(mMax(1u, recvSize), AT_, "recvBuffer");
6272 maia::mpi::reverseExchangeData(grid().neighborDomains(), grid().haloCells(), grid().windowCells(), mpiComm(),
6273 &isOnMaxLevel[0], &recvBuffer[0]);
6274
6275 recvSize = 0;
6276 for(MInt i = 0; i < noNeighborDomains(); i++) {
6278 for(MInt j = 0; j < noWindowCells(i); j++) {
6279 if(recvBuffer[recvSize]) {
6280 // ASSERT(a_hasProperty(windowCellId(i, j), SolverCell::IsOnCurrentMGLevel), "");
6283 }
6284 recvSize++;
6285 }
6286 }
6287
6289
6290 if(grid().noAzimuthalNeighborDomains() > 0) {
6292 }
6293
6295}
virtual void initNearBoundaryExchange(const MInt mode=0, const MInt offset=0)
Setup the near-boundary communicator needed for the flux-redistribution method.
void initAzimuthalMaxLevelExchange()
MUint getBufferSize(const std::vector< std::vector< MInt > > &exchangeCells)
Generic exchange of data.
Definition: mpiexchange.h:681
void reverseExchangeData(const MInt noNghbrDomains, const MInt *const nghbrDomains, const MInt *const noHaloCells, const MInt **const haloCells, const MInt *const noWindowCells, const MInt **const, const MPI_Comm comm, const U *const data, U *const windowBuffer, const MInt noDat=1)
Generic reverse exchange of data.
Definition: mpiexchange.h:400

◆ initializeRungeKutta()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initializeRungeKutta
virtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 8739 of file fvcartesiansolverxd.cpp.

8739 {
8740 TRACE();
8741
8743 m_RKStep = 0;
8744}
void setRungeKuttaProperties()
This function reads the properties required for Runge Kutta time stepping.

◆ initializeTimers()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initializeTimers
protected

Definition at line 8615 of file fvcartesiansolverxd.cpp.

8615 {
8616 TRACE();
8617
8618 std::fill(m_timers.begin(), m_timers.end(), -1);
8619
8620 // Create timer group & timer for solver, and start the timer
8621 NEW_TIMER_GROUP_NOCREATE(m_timerGroup, "FvCartesianSolver (solverId = " + to_string(m_solverId) + ")");
8622 NEW_TIMER_NOCREATE(m_timers[Timers::SolverType], "total object lifetime", m_timerGroup);
8623 RECORD_TIMER_START(m_timers[Timers::SolverType]);
8624
8625 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::TimeInt], "Time-integration", m_timers[Timers::SolverType]);
8626
8627 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::Rhs], "rhs", m_timers[Timers::TimeInt]);
8628 // RHS subtimers
8629 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::Muscl], "MUSCL", m_timers[Timers::Rhs]);
8630 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::Ausm], "AUSM", m_timers[Timers::Rhs]);
8631 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ViscFlux], "Viscous flux", m_timers[Timers::Rhs]);
8632 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::DistFlux], "Distribute flux", m_timers[Timers::Rhs]);
8633 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::RhsMisc], "Misc", m_timers[Timers::Rhs]);
8634 if(m_useSandpaperTrip) {
8635 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SandpaperTrip], "SandpaperTrip", m_timers[Timers::Rhs]);
8636 }
8637 if(m_wmLES) {
8638 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::WMExchange], "WMExchange", m_timers[Timers::Rhs]);
8639 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::WMSurfaceLoop], "WMSurfaceLoop", m_timers[Timers::Rhs]);
8640 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::WMFluxCorrection], "WMFluxCorrection", m_timers[Timers::Rhs]);
8641 }
8642 IF_CONSTEXPR(isDetChem<SysEqn>) {
8643 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SurfaceCoefficients], "Surface Coefficients", m_timers[Timers::Rhs]);
8644 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SurfaceMeanMolarWeight], "Surface Mean Molar Weight",
8646 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SurfaceTransportCoefficients], "Surface Transport Coefficients",
8648 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::CellCenterCoefficients], "Cell Center Coefficients", m_timers[Timers::Rhs]);
8649 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SpeciesReactionRates], "Species Reaction Rates", m_timers[Timers::Rhs]);
8650 }
8651 // MUSCL subtimers
8652 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::MusclReconst], "LSReconstructCellCenter", m_timers[Timers::Muscl]);
8653 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::MusclCopy], "copySlopesToSmallCells", m_timers[Timers::Muscl]);
8654 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::MusclGhostSlopes], "updateGhostCellSlopesInviscid", m_timers[Timers::Muscl]);
8655 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::MusclCutSlopes], "updateCutOffSlopesInviscid", m_timers[Timers::Muscl]);
8656 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::MusclReconstSrfc], "reconstructSurfaceData", m_timers[Timers::Muscl]);
8657
8658 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ReconstSrfcCompValues], "computeSurfaceValues",
8660 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ReconstSrfcCorrVars], "correctSurfaceVariables",
8662 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ReconstSrfcUpdateGhost], "updateGhost", m_timers[Timers::MusclReconstSrfc]);
8663 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ReconstSrfcUpdateCutOff], "updateCutOff", m_timers[Timers::MusclReconstSrfc]);
8664
8665 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::RhsBnd], "rhsBnd", m_timers[Timers::TimeInt]);
8666
8667 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::Lhs], "lhs", m_timers[Timers::TimeInt]);
8668
8669 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::LhsBnd], "lhsBnd", m_timers[Timers::TimeInt]);
8670
8671 // LHS-BND subtimers
8672 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SmallCellCorr], "small cell correction", m_timers[Timers::LhsBnd]);
8673 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ComputePV], "compute PV", m_timers[Timers::LhsBnd]);
8674 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::Exchange], "exchange", m_timers[Timers::LhsBnd]);
8675 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::CutOff], "cut off", m_timers[Timers::LhsBnd]);
8676 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::BndryCnd], "boundary conditions", m_timers[Timers::LhsBnd]);
8677
8678 // Small cell correction subtimers
8679 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SCCorrInit], "init", m_timers[Timers::SmallCellCorr]);
8680 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SCCorrExchange1], "first exchange", m_timers[Timers::SmallCellCorr]);
8681 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SCCorrExchange1Wait], "waiting/blocking MPI",
8683 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SCCorrInterp], "interpolation", m_timers[Timers::SmallCellCorr]);
8684 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SCCorrRedist], "redistribution", m_timers[Timers::SmallCellCorr]);
8685 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SCCorrExchange2], "second exchange", m_timers[Timers::SmallCellCorr]);
8686 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SCCorrExchange2Wait], "waiting/blocking MPI",
8688
8689 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::Residual], "Residual", m_timers[Timers::TimeInt]);
8690 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ResidualMpi], "MPI", m_timers[Timers::Residual]);
8691
8692 // prepare solver subtimers
8693 if(m_levelSetMb) {
8694 // preTimeStep
8695 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::PreTime], "PreTimeStep", m_timers[Timers::SolverType]);
8696 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ReinitSolu], "ReinitSolutionStep", m_timers[Timers::PreTime]);
8697 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::BndryMb], "generateBndryCells", m_timers[Timers::ReinitSolu]);
8698 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::NearBndry], "initNearBndryExc", m_timers[Timers::ReinitSolu]);
8699 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::InitSmallCorr], "initSmallCellCor", m_timers[Timers::ReinitSolu]);
8700 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::GhostCells], "ghostCells", m_timers[Timers::ReinitSolu]);
8701 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::PostTime], "PostTimeStep", m_timers[Timers::SolverType]);
8702 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::PostSolu], "PostSolutionStep", m_timers[Timers::PostTime]);
8703 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ResidualMb], "Residual-MB", m_timers[Timers::PostSolu]);
8704 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SurfaceForces], "SurfaceForces", m_timers[Timers::PostSolu]);
8705 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::LevelSetCorr], "LevelSetCorr", m_timers[Timers::PostSolu]);
8706 }
8707
8708 // TODO labels:FV,TIMERS Create accumulated timers that monitor selected subsystems
8709 /* NEW_SUB_TIMER_NOCREATE( */
8710 /* m_timers[Timers::Accumulated], "selected accumulated timers", m_timers[Timers::SolverType]); */
8711 /* NEW_SUB_TIMER_NOCREATE(m_timers[Timers::IO], "IO", */
8712 /* m_timers[Timers::Accumulated]); */
8713 /* NEW_SUB_TIMER_NOCREATE(m_timers[Timers::MPI], "MPI", */
8714 /* m_timers[Timers::Accumulated]); */
8715
8716
8717 // Communication
8718 NEW_TIMER_GROUP_NOCREATE(m_tgfv, "FV Exchange");
8719 NEW_TIMER_NOCREATE(m_tcomm, "Communication", m_tgfv);
8720
8721 NEW_SUB_TIMER_NOCREATE(m_texchange, "exchange", m_tcomm);
8722
8723 NEW_SUB_TIMER_NOCREATE(m_tgatherAndSend, "gather and send", m_texchange);
8724 NEW_SUB_TIMER_NOCREATE(m_tgather, "gather", m_tgatherAndSend);
8725 NEW_SUB_TIMER_NOCREATE(m_tsend, "send", m_tgatherAndSend);
8726 NEW_SUB_TIMER_NOCREATE(m_tgatherAndSendWait, "wait", m_tgatherAndSend);
8727 NEW_SUB_TIMER_NOCREATE(m_treceive, "receive", m_texchange);
8728 NEW_SUB_TIMER_NOCREATE(m_tscatter, "scatter", m_texchange);
8729 NEW_SUB_TIMER_NOCREATE(m_tscatterWaitSome, "wait some", m_tscatter);
8730 NEW_SUB_TIMER_NOCREATE(m_treceiving, "receiving", m_treceive);
8731 NEW_SUB_TIMER_NOCREATE(m_treceiveWait, "waiting", m_treceive);
8732
8733 NEW_SUB_TIMER_NOCREATE(m_texchangeDt, "exchange time-step", m_tcomm);
8734}

◆ initInterpolationForCell()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initInterpolationForCell ( const MInt  cellId)
virtual
  1. Find all direct neighboring cells

2b. build the least square matrix LSMatrix...

Definition at line 20812 of file fvcartesiansolverxd.cpp.

20812 {
20813 ASSERT(cellId >= 0, "ERROR: Invalid cellId!");
20814
20815 if(m_cellInterpolationIndex[cellId] != -1) {
20816 /* std::cerr << "Interpolation for cell " << cellId << " already initialndized." << std::endl; */
20817 return;
20818 }
20819
20820 const MFloat* const origin = &a_coordinate(cellId, 0);
20821
20825 vector<MInt> nghbrList;
20826#ifdef _OPENMP
20827#pragma omp critical
20828#endif
20829 {
20830 findDirectNghbrs(cellId, nghbrList);
20831 if(nghbrList.size() < 12) {
20832 findNeighborHood(cellId, 2, nghbrList);
20833#ifndef NDEBUG
20834 if(nghbrList.size() < 14) {
20835 cout << "WARNING: Only found " << nghbrList.size() << " neighbors during interpolation!" << endl;
20836 }
20837#endif
20838 }
20839 }
20840
20841 // check for boundary ghost cells belonging to cells in the neighbor list
20842 // for these cell a pseudoCell element is added, carrying position and velocity
20843 // on the boundary surface
20844 /* vector<vector<MFloat>> pseudoCellVar(nghbrList.size(), vector<MFloat>(b - a)); */
20845 /* vector<vector<MFloat>> pseudoCellPos(nghbrList.size(), {0, 0, 0}); */
20846
20847 for(MUint nId = 0; nId < nghbrList.size(); nId++) {
20848 const MInt nghbrId = nghbrList[nId];
20849 if(nghbrId >= 0 && a_bndryId(nghbrId) > -1) {
20850 mTerm(1, "boundary cells not handled");
20851 // mark as pseudo cell
20852 /* nghbrList[nId] = -1; */
20853 /* for (MInt i = 0; i < nDim; i++) { */
20854 /* pseudoCellPos[nId][i] = m_bndryCells->a[a_bndryId(nghbrId)].m_srfcs[0]->m_coordinates[i]; */
20855 /* } */
20856 /* for (MInt i = a; i < b; i++) { */
20857 /* // todo labels:FV,toenhance bndCnd need to be implemented here (assumes bnd result equals cell result) */
20858 /* if(old){ */
20859 /* pseudoCellVar[nId][i - a] = a_oldVariable(cellId, i); */
20860 /* } else { */
20861 /* pseudoCellVar[nId][i - a] = a_variable(cellId, i); */
20862 /* } */
20863 /* } */
20864 }
20865 }
20866
20867 if(nghbrList.size() < 10) {
20868 mTerm(1, "too few neighbors");
20869 }
20870
20874 MFloatTensor LSMatrix(2 * nDim + pow(2, nDim - 1), 2 * nDim + pow(2, nDim - 1));
20875 /* MFloatTensor rhs(2 * nDim + pow(2, nDim - 1)); */
20876 // MFloatTensor weights(2 * nDim + pow(2, nDim - 1));
20877 MFloatTensor matInv(2 * nDim + pow(2, nDim - 1), 2 * nDim + pow(2, nDim - 1));
20878
20879 LSMatrix.set(0.0);
20880 // weights.set(1.0);
20881 matInv.set(0.0);
20882
20883 MFloat sumX = 0;
20884 MFloat sumY = 0;
20885 MFloat sumZ = 0;
20886 MFloat sumXY = 0;
20887 MFloat sumXZ = 0;
20888 MFloat sumYZ = 0;
20889 MFloat sumX2 = 0;
20890 MFloat sumY2 = 0;
20891 MFloat sumZ2 = 0;
20892 MFloat sumXYZ = 0;
20893 MFloat sumX2Y = 0;
20894 MFloat sumX2Z = 0;
20895 MFloat sumXY2 = 0;
20896 MFloat sumY2Z = 0;
20897 MFloat sumXZ2 = 0;
20898 MFloat sumYZ2 = 0;
20899 MFloat sumX3 = 0;
20900 MFloat sumY3 = 0;
20901 MFloat sumZ3 = 0;
20902 MFloat sumX3Y = 0;
20903 MFloat sumX3Z = 0;
20904 MFloat sumXY3 = 0;
20905 MFloat sumY3Z = 0;
20906 MFloat sumXZ3 = 0;
20907 MFloat sumYZ3 = 0;
20908 MFloat sumX2Y2 = 0;
20909 MFloat sumX2Z2 = 0;
20910 MFloat sumX2YZ = 0;
20911 MFloat sumY2Z2 = 0;
20912 MFloat sumXY2Z = 0;
20913 MFloat sumXYZ2 = 0;
20914 MFloat sumX4 = 0;
20915 MFloat sumY4 = 0;
20916 MFloat sumZ4 = 0;
20917
20918
20919 // 2.1 Calculate intermediate variables
20920 for(MUint nId = 1; nId < nghbrList.size(); nId++) {
20921 MFloat x = 0;
20922 MFloat y = 0;
20923 MFloat z = 0;
20924 const MInt nghbrId = nghbrList[nId];
20925 if(nghbrId < 0) {
20926 mTerm(1, "not supported");
20927 }
20928 /* x = pseudoCellPos[nId][0] - originX; */
20929 /* y = pseudoCellPos[nId][1] - originY; */
20930 /* IF_CONSTEXPR(nDim == 3) { */
20931 /* z = pseudoCellPos[nId][2] - originZ; */
20932 /* } */
20933 /* } else { */
20934 x = a_coordinate(nghbrId, 0) - origin[0];
20935 y = a_coordinate(nghbrId, 1) - origin[1];
20936 IF_CONSTEXPR(nDim == 3) { z = a_coordinate(nghbrId, 2) - origin[2]; }
20937 /* } */
20938
20939 sumX += x;
20940 sumY += y;
20941 sumZ += z;
20942 sumXY += x * y;
20943 sumXZ += x * z;
20944 sumYZ += y * z;
20945 sumX2 += x * x;
20946 sumY2 += y * y;
20947 sumZ2 += z * z;
20948 sumXYZ += x * y * z;
20949 sumX2Y += x * x * y;
20950 sumX2Z += x * x * z;
20951 sumXY2 += x * y * y;
20952 sumY2Z += y * y * z;
20953 sumXZ2 += z * z * x;
20954 sumYZ2 += z * z * y;
20955 sumX3 += x * x * x;
20956 sumY3 += y * y * y;
20957 sumZ3 += z * z * z;
20958 sumX3Y += x * x * x * y;
20959 sumX3Z += x * x * x * z;
20960 sumXY3 += y * y * y * x;
20961 sumY3Z += y * y * y * z;
20962 sumXZ3 += z * z * z * x;
20963 sumYZ3 += z * z * z * y;
20964 sumX2Y2 += x * x * y * y;
20965 sumX2Z2 += x * x * z * z;
20966 sumX2YZ += x * x * y * z;
20967 sumY2Z2 += y * y * z * z;
20968 sumXY2Z += x * y * y * z;
20969 sumXYZ2 += x * y * z * z;
20970 sumX4 += x * x * x * x;
20971 sumY4 += y * y * y * y;
20972 sumZ4 += z * z * z * z;
20973 }
20974
20975 // 2.2 Use intermediate variables to build LSMatrix
20976 IF_CONSTEXPR(nDim == 2) {
20977 // diagonal
20978 LSMatrix(0, 0) = sumX4;
20979 LSMatrix(1, 1) = sumY4;
20980 LSMatrix(2, 2) = sumX2Y2;
20981 LSMatrix(3, 3) = sumX2;
20982 LSMatrix(4, 4) = sumY2;
20983 LSMatrix(5, 5) = nghbrList.size();
20984
20985 // first column/row
20986 LSMatrix(0, 1) = LSMatrix(1, 0) = sumX2Y2;
20987 LSMatrix(0, 2) = LSMatrix(2, 0) = sumX3Y;
20988 LSMatrix(0, 3) = LSMatrix(3, 0) = sumX3;
20989 LSMatrix(0, 4) = LSMatrix(4, 0) = sumX2Y;
20990 LSMatrix(0, 5) = LSMatrix(5, 0) = sumX2;
20991
20992 // second column/row
20993 LSMatrix(1, 2) = LSMatrix(2, 1) = sumXY3;
20994 LSMatrix(1, 3) = LSMatrix(3, 1) = sumXY2;
20995 LSMatrix(1, 4) = LSMatrix(4, 1) = sumY3;
20996 LSMatrix(1, 5) = LSMatrix(5, 1) = sumY2;
20997
20998 // third column/row
20999 LSMatrix(2, 3) = LSMatrix(3, 2) = sumX2Y;
21000 LSMatrix(2, 4) = LSMatrix(4, 2) = sumXY2;
21001 LSMatrix(2, 5) = LSMatrix(5, 2) = sumXY;
21002
21003 // fourth column/row
21004 LSMatrix(3, 4) = LSMatrix(4, 3) = sumXY;
21005 LSMatrix(3, 5) = LSMatrix(5, 3) = sumX;
21006
21007 // fifth coulmn/row
21008 LSMatrix(4, 5) = LSMatrix(5, 4) = sumY;
21009 }
21010 else {
21011 // diagonal
21012 LSMatrix(0, 0) = sumX4;
21013 LSMatrix(1, 1) = sumY4;
21014 LSMatrix(2, 2) = sumZ4;
21015 LSMatrix(3, 3) = sumX2Y2;
21016 LSMatrix(4, 4) = sumX2Z2;
21017 LSMatrix(5, 5) = sumY2Z2;
21018 LSMatrix(6, 6) = sumX2;
21019 LSMatrix(7, 7) = sumY2;
21020 LSMatrix(8, 8) = sumZ2;
21021 LSMatrix(9, 9) = nghbrList.size();
21022
21023 // first column/row
21024 LSMatrix(0, 1) = LSMatrix(1, 0) = sumX2Y2;
21025 LSMatrix(0, 2) = LSMatrix(2, 0) = sumX2Z2;
21026 LSMatrix(0, 3) = LSMatrix(3, 0) = sumX3Y;
21027 LSMatrix(0, 4) = LSMatrix(4, 0) = sumX3Z;
21028 LSMatrix(0, 5) = LSMatrix(5, 0) = sumX2YZ;
21029 LSMatrix(0, 6) = LSMatrix(6, 0) = sumX3;
21030 LSMatrix(0, 7) = LSMatrix(7, 0) = sumX2Y;
21031 LSMatrix(0, 8) = LSMatrix(8, 0) = sumX2Z;
21032 LSMatrix(0, 9) = LSMatrix(9, 0) = sumX2;
21033
21034 // second column/row
21035 LSMatrix(1, 2) = LSMatrix(2, 1) = sumY2Z2;
21036 LSMatrix(1, 3) = LSMatrix(3, 1) = sumXY3;
21037 LSMatrix(1, 4) = LSMatrix(4, 1) = sumXY2Z;
21038 LSMatrix(1, 5) = LSMatrix(5, 1) = sumY3Z;
21039 LSMatrix(1, 6) = LSMatrix(6, 1) = sumXY2;
21040 LSMatrix(1, 7) = LSMatrix(7, 1) = sumY3;
21041 LSMatrix(1, 8) = LSMatrix(8, 1) = sumY2Z;
21042 LSMatrix(1, 9) = LSMatrix(9, 1) = sumY2;
21043
21044 // third column/row
21045 LSMatrix(2, 3) = LSMatrix(3, 2) = sumXYZ2;
21046 LSMatrix(2, 4) = LSMatrix(4, 2) = sumXZ3;
21047 LSMatrix(2, 5) = LSMatrix(5, 2) = sumYZ3;
21048 LSMatrix(2, 6) = LSMatrix(6, 2) = sumXZ2;
21049 LSMatrix(2, 7) = LSMatrix(7, 2) = sumYZ2;
21050 LSMatrix(2, 8) = LSMatrix(8, 2) = sumZ3;
21051 LSMatrix(2, 9) = LSMatrix(9, 2) = sumZ2;
21052
21053 // fourth column, fourth line
21054 LSMatrix(3, 4) = LSMatrix(4, 3) = sumX2YZ;
21055 LSMatrix(3, 5) = LSMatrix(5, 3) = sumXY2Z;
21056 LSMatrix(3, 6) = LSMatrix(6, 3) = sumX2Y;
21057 LSMatrix(3, 7) = LSMatrix(7, 3) = sumXY2;
21058 LSMatrix(3, 8) = LSMatrix(8, 3) = sumXYZ;
21059 LSMatrix(3, 9) = LSMatrix(9, 3) = sumXY;
21060
21061 // fifth coulmn, fifth line
21062 LSMatrix(4, 5) = LSMatrix(5, 4) = sumXYZ2;
21063 LSMatrix(4, 6) = LSMatrix(6, 4) = sumX2Z;
21064 LSMatrix(4, 7) = LSMatrix(7, 4) = sumXYZ;
21065 LSMatrix(4, 8) = LSMatrix(8, 4) = sumXZ2;
21066 LSMatrix(4, 9) = LSMatrix(9, 4) = sumXZ;
21067
21068 // sixth column, sixth line
21069 LSMatrix(5, 6) = LSMatrix(6, 5) = sumXYZ;
21070 LSMatrix(5, 7) = LSMatrix(7, 5) = sumY2Z;
21071 LSMatrix(5, 8) = LSMatrix(8, 5) = sumYZ2;
21072 LSMatrix(5, 9) = LSMatrix(9, 5) = sumYZ;
21073
21074 // seventh column, seventh line
21075 LSMatrix(6, 7) = LSMatrix(7, 6) = sumXY;
21076 LSMatrix(6, 8) = LSMatrix(8, 6) = sumXZ;
21077 LSMatrix(6, 9) = LSMatrix(9, 6) = sumX;
21078
21079 // eigth column, eigth line
21080 LSMatrix(7, 8) = LSMatrix(8, 7) = sumYZ;
21081 LSMatrix(7, 9) = LSMatrix(9, 7) = sumY;
21082
21083 // nineth column, nineth line
21084 LSMatrix(8, 9) = LSMatrix(9, 8) = sumZ;
21085 }
21086
21087 // 2.3 scale solution since the condition number gets really bad for large discrepancies in cell
21088 // size
21089 const MFloat normalizationFactor = FPOW2(2 * a_level(cellId)) / grid().cellLengthAtLevel(0);
21090 for(MInt i = 0; i < 2 * nDim + pow(2, nDim - 1); i++) {
21091 for(MInt j = 0; j < 2 * nDim + pow(2, nDim - 1); j++) {
21092 LSMatrix(i, j) *= normalizationFactor;
21093 }
21094 }
21095
21096 // 2.4 determine the pseudoinverse using SVD
21097 maia::math::invert(LSMatrix, matInv, 2 * nDim + pow(2, nDim - 1), 2 * nDim + pow(2, nDim - 1));
21098
21099 const MInt matSize = 2 * nDim + pow(2, nDim - 1);
21100 std::vector<MFloat> matInvVector(matSize * matSize);
21101
21102 MInt k = 0;
21103 for(MInt i = 0; i < 2 * nDim + pow(2, nDim - 1); i++) {
21104 for(MInt j = 0; j < 2 * nDim + pow(2, nDim - 1); j++) {
21105 matInvVector[k] = matInv(i, j);
21106 k++;
21107 }
21108 }
21109
21110 const MInt interpIndex = m_cellInterpolationIds.size();
21111 // Store interpolation information for points in this cell
21112 m_cellInterpolationIndex[cellId] = interpIndex;
21113 m_cellInterpolationIds.push_back(nghbrList);
21114 m_cellInterpolationMatrix.push_back(matInvVector);
21115}
std::vector< MInt > m_cellInterpolationIndex
void findNeighborHood(MInt cellId, MInt layer, std::vector< MInt > &nghbrList)
Obtain list of neighbors for the given extend.
std::vector< std::vector< MFloat > > m_cellInterpolationMatrix
std::vector< std::vector< MInt > > m_cellInterpolationIds

◆ initMatDat()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::initMatDat ( )
inlinevirtual

Definition at line 2157 of file fvcartesiansolverxd.h.

2157{};

◆ initNearBoundaryExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initNearBoundaryExchange ( const MInt  mode = 0,
const MInt  offset = 0 
)
virtual
Author
Lennart Schneiders
Note
Send and receive buffers are switched on purpose

Definition at line 12688 of file fvcartesiansolverxd.cpp.

12688 {
12689 TRACE();
12690
12691 if(m_fvBndryCnd->m_cellMerging) return;
12692
12693 if(noNeighborDomains() == 0 && grid().noAzimuthalNeighborDomains() == 0
12695 return;
12696
12697#ifndef NDEBUG
12698 MInt test0 = 0;
12699 MInt test1 = 0;
12700 for(MInt i = 0; i < noNeighborDomains(); i++) {
12701 test0 += m_noMaxLevelHaloCells[i];
12702 test1 += m_noMaxLevelWindowCells[i];
12703 }
12704 for(MInt i = 0; i < grid().noAzimuthalNeighborDomains(); i++) {
12705 test0 += m_azimuthalMaxLevelHaloCells[i].size();
12706 test1 += m_azimuthalMaxLevelWindowCells[i].size();
12707 }
12708 if(test0 == 0 && test1 == 0) {
12709 mTerm(1, AT_, "Max level exchange has not yet been initialized.");
12710 }
12711#endif
12712
12713 MIntScratchSpace activeFlag(a_noCells(), AT_, "activeFlag");
12714 MIntScratchSpace sendBufferCnts(noNeighborDomains(), AT_, "sendBufferCnts");
12715 MIntScratchSpace recvBufferCnts(noNeighborDomains(), AT_, "recvBufferCnts");
12716 ScratchSpace<MPI_Request> sendReq(noNeighborDomains(), AT_, "sendReq");
12717 ScratchSpace<MPI_Request> recvReq(noNeighborDomains(), AT_, "recvReq");
12718
12719 sendBufferCnts.fill(0);
12720 recvBufferCnts.fill(0);
12721 sendReq.fill(MPI_REQUEST_NULL);
12722 recvReq.fill(MPI_REQUEST_NULL);
12723 for(MInt i = 0; i < noNeighborDomains(); i++) {
12726 }
12727
12728 activeFlag.fill(0);
12729
12730 setActiveFlag(activeFlag, mode, offset);
12731
12732 setAdditionalActiveFlag(activeFlag);
12733
12734 if(grid().azimuthalPeriodicity()) {
12736 }
12737
12738 for(MInt i = 0; i < noNeighborDomains(); i++) {
12739 MInt sendBufferCounter = 0;
12740 for(MInt j = 0; j < m_noMaxLevelHaloCells[i]; j++) {
12742 m_receiveBuffers[i][sendBufferCounter] = F0;
12743 if(activeFlag(cellId)) {
12744 m_receiveBuffers[i][sendBufferCounter] = F1;
12745 m_fvBndryCnd->m_nearBoundaryHaloCells[i].push_back(cellId);
12746 if(a_hasProperty(cellId, SolverCell::IsSplitCell)) {
12747 for(MUint sc = 0; sc < m_splitCells.size(); sc++) {
12748 if(cellId != m_splitCells[sc]) continue;
12749 for(MUint ssc = 0; ssc < m_splitChilds[sc].size(); ssc++) {
12750 m_fvBndryCnd->m_nearBoundaryHaloCells[i].push_back(m_splitChilds[sc][ssc]);
12751 }
12752 }
12753 }
12754 }
12755 sendBufferCounter++;
12756 }
12757 ASSERT(sendBufferCounter == m_noMaxLevelHaloCells[i], "");
12758 sendBufferCnts(i) = sendBufferCounter;
12759 recvBufferCnts(i) = m_noMaxLevelWindowCells[i];
12760 }
12761
12762 if(noNeighborDomains() > 0) {
12763 if(m_nonBlockingComm) {
12764 for(MInt i = 0; i < noNeighborDomains(); i++) {
12765 ASSERT(recvBufferCnts(i) <= m_noMaxLevelWindowCells[i] * m_dataBlockSize, "");
12766 MPI_Irecv(m_sendBuffers[i], recvBufferCnts(i), MPI_DOUBLE, neighborDomain(i), 2, mpiComm(), &recvReq[i], AT_,
12767 "m_sendBuffers[i]");
12768 }
12769 for(MInt i = 0; i < noNeighborDomains(); i++) {
12770 ASSERT(sendBufferCnts(i) <= m_noMaxLevelHaloCells[i] * m_dataBlockSize, "");
12771 MPI_Isend(m_receiveBuffers[i], sendBufferCnts(i), MPI_DOUBLE, neighborDomain(i), 2, mpiComm(), &sendReq[i], AT_,
12772 "m_receiveBuffers[i]");
12773 }
12774 MPI_Waitall(noNeighborDomains(), &recvReq[0], MPI_STATUSES_IGNORE, AT_);
12775 MPI_Waitall(noNeighborDomains(), &sendReq[0], MPI_STATUSES_IGNORE, AT_);
12776 } else {
12777 for(MInt i = 0; i < noNeighborDomains(); i++) {
12778 ASSERT(sendBufferCnts(i) <= m_noMaxLevelHaloCells[i] * m_dataBlockSize, "");
12779 MPI_Issend(m_receiveBuffers[i], sendBufferCnts(i), MPI_DOUBLE, neighborDomain(i), 2, mpiComm(), &sendReq[i],
12780 AT_, "m_receiveBuffers[i]");
12781 }
12782 for(MInt i = 0; i < noNeighborDomains(); i++) {
12783 ASSERT(recvBufferCnts(i) <= m_noMaxLevelWindowCells[i] * m_dataBlockSize, "");
12784 MPI_Recv(m_sendBuffers[i], recvBufferCnts(i), MPI_DOUBLE, neighborDomain(i), 2, mpiComm(), MPI_STATUS_IGNORE,
12785 AT_, "m_sendBuffers[i]");
12786 }
12787 MPI_Waitall(noNeighborDomains(), &sendReq[0], MPI_STATUSES_IGNORE, AT_);
12788 }
12789
12790 for(MInt i = 0; i < noNeighborDomains(); i++) {
12791 MInt recvBufferCounter = 0;
12792 for(MInt j = 0; j < m_noMaxLevelWindowCells[i]; j++) {
12794 if((MInt)m_sendBuffers[i][recvBufferCounter]) {
12795 m_fvBndryCnd->m_nearBoundaryWindowCells[i].push_back(cellId);
12796 ASSERT(c_noChildren(cellId) == 0, "");
12797 if(a_hasProperty(cellId, SolverCell::IsSplitCell)) {
12798 for(MUint sc = 0; sc < m_splitCells.size(); sc++) {
12799 if(cellId != m_splitCells[sc]) continue;
12800 for(MUint ssc = 0; ssc < m_splitChilds[sc].size(); ssc++) {
12802 }
12803 }
12804 }
12805 }
12806 recvBufferCounter++;
12807 }
12808 }
12809 }
12810
12811
12812#ifdef _MB_DEBUG_
12813 if(globalTimeStep % 100 == 0) {
12814 MLong totalMaxLevelHaloCells = 0;
12815 MLong totalMaxLevelWindowCells = 0;
12816 MLong totalNearBoundaryHaloCells = 0;
12817 MLong totalNearBoundaryWindowCells = 0;
12818 m_log << "Near-boundary exchange size:" << endl;
12819 for(MInt i = 0; i < noNeighborDomains(); i++) {
12820 m_log << "D" << neighborDomain(i) << ":"
12821 << " " << m_fvBndryCnd->m_nearBoundaryWindowCells[i].size() << "/" << m_noMaxLevelWindowCells[i] << " "
12822 << m_fvBndryCnd->m_nearBoundaryHaloCells[i].size() << "/" << m_noMaxLevelHaloCells[i] << endl;
12823 totalMaxLevelHaloCells += m_noMaxLevelHaloCells[i];
12824 totalMaxLevelWindowCells += m_noMaxLevelWindowCells[i];
12825 totalNearBoundaryHaloCells += (signed)m_fvBndryCnd->m_nearBoundaryHaloCells[i].size();
12826 totalNearBoundaryWindowCells += (signed)m_fvBndryCnd->m_nearBoundaryWindowCells[i].size();
12827 }
12828 MPI_Allreduce(MPI_IN_PLACE, &totalMaxLevelHaloCells, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE",
12829 "totalMaxLevelHaloCells");
12830 MPI_Allreduce(MPI_IN_PLACE, &totalMaxLevelWindowCells, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE",
12831 "totalMaxLevelWindowCells");
12832 MPI_Allreduce(MPI_IN_PLACE, &totalNearBoundaryHaloCells, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE",
12833 "totalNearBoundaryHaloCells");
12834 MPI_Allreduce(MPI_IN_PLACE, &totalNearBoundaryWindowCells, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE",
12835 "totalNearBoundaryWindowCells");
12836 m_log << "Global near-boundary exchange size: " << totalNearBoundaryWindowCells << "/" << totalMaxLevelWindowCells
12837 << " (" << 100.0 * ((MFloat)totalNearBoundaryWindowCells / (MFloat)totalMaxLevelWindowCells) << "%)"
12838 << " - " << totalNearBoundaryHaloCells << "/" << totalMaxLevelHaloCells << " ("
12839 << 100.0 * ((MFloat)totalNearBoundaryHaloCells / (MFloat)totalMaxLevelHaloCells) << "%)" << endl;
12840 }
12841#endif
12842}
std::vector< std::vector< MInt > > m_azimuthalMaxLevelWindowCells
virtual void setAdditionalActiveFlag(MIntScratchSpace &)
std::vector< std::vector< MInt > > m_azimuthalMaxLevelHaloCells
void setActiveFlag(MIntScratchSpace &, const MInt mode, const MInt offset)
Set the flag for the cells needed for near bndry exchange.
void initAzimuthalNearBoundaryExchange(MIntScratchSpace &activeFlag)
std::vector< MInt > m_azimuthalRemappedNeighborDomains

◆ initSandpaperTrip()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initSandpaperTrip

Definition at line 33767 of file fvcartesiansolverxd.cpp.

33767 {
33768 TRACE();
33769
33770 m_log << "Initializing Sandpaper Trip... ";
33771
33772 IF_CONSTEXPR(nDim == 2) {
33773 cerr << "Tripping not implemented for 2D" << endl;
33774 return;
33775 }
33776
33777 IF_CONSTEXPR(nDim == 3) {
33778 m_tripAirfoil = false;
33779
33780 if(Context::propertyExists("tripAirfoil", m_solverId)) {
33781 m_tripAirfoil = Context::getSolverProperty<MBool>("tripAirfoil", m_solverId, AT_, &m_tripAirfoil);
33782 }
33783
33785
33786 mAlloc(m_tripDelta1, m_tripNoTrips, "m_tripDelta1", 1.0, AT_);
33787 mAlloc(m_tripXOrigin, m_tripNoTrips, "m_tripXOrigin", 0.0, AT_);
33788 mAlloc(m_tripXLength, m_tripNoTrips, "m_tripXLength", 4.0, AT_);
33789 mAlloc(m_tripYOrigin, m_tripNoTrips, "m_tripYOrigin", 0.0, AT_);
33790 mAlloc(m_tripYHeight, m_tripNoTrips, "m_tripYHeight", 1.0, AT_);
33791 mAlloc(m_tripCutoffZ, m_tripNoTrips, "m_tripCutoffZ", 1.7, AT_);
33792 mAlloc(m_tripMaxAmpSteady, m_tripNoTrips, "m_tripMaxAmpSteady", 0.0, AT_);
33793 mAlloc(m_tripMaxAmpFluc, m_tripNoTrips, "m_tripMaxAmpFluc", 0.005, AT_);
33794 mAlloc(m_tripDeltaTime, m_tripNoTrips, "m_tripDeltaTime", 4.0, AT_);
33795 mAlloc(m_tripTimeStep, m_tripNoTrips, "m_tripTimeStep", 0, AT_);
33796 mAlloc(m_tripNoCells, m_tripNoTrips, "m_tripNoCells", 0, AT_);
33797 mAlloc(m_tripCellOffset, m_tripNoTrips, "m_tripCellOffset", 0, AT_);
33798
33799 for(MInt i = 0; i < m_tripNoTrips; i++) {
33800 m_tripDelta1[i] = Context::getSolverProperty<MFloat>("tripDelta1", m_solverId, AT_, &m_tripDelta1[i], i);
33801
33802 if(!m_tripAirfoil) {
33803 m_tripXOrigin[i] = Context::getSolverProperty<MFloat>("tripXOrigin", m_solverId, AT_, &m_tripXOrigin[i], i);
33804 if(Context::propertyExists("tripYOrigin", m_solverId)) {
33805 m_tripYOrigin[i] = Context::getSolverProperty<MFloat>("tripYOrigin", m_solverId, AT_, &m_tripYOrigin[i], i);
33806 }
33807 }
33808
33809 MFloat tripX = 4.0;
33810 if(Context::propertyExists("tripXLength", m_solverId)) {
33811 tripX = Context::getSolverProperty<MFloat>("tripXLength", m_solverId, AT_, &tripX);
33812 }
33813 m_tripXLength[i] = m_tripDelta1[i] * tripX;
33814
33815
33816 MFloat tripY = 1.0;
33817 if(Context::propertyExists("tripYHeight", m_solverId)) {
33818 tripY = Context::getSolverProperty<MFloat>("tripYHeight", m_solverId, AT_, &tripY);
33819 }
33820 m_tripYHeight[i] = m_tripDelta1[i] * tripY;
33821
33822 MFloat tripZ = 1.7;
33823 if(Context::propertyExists("tripCutoffZ", m_solverId)) {
33824 tripZ = Context::getSolverProperty<MFloat>("tripCutoffZ", m_solverId, AT_, &tripZ);
33825 }
33826 m_tripCutoffZ[i] = m_tripDelta1[i] * tripZ;
33827
33829 Context::getSolverProperty<MFloat>("tripMaxAmpSteady", m_solverId, AT_, &m_tripMaxAmpSteady[i], i);
33830
33831 m_tripMaxAmpFluc[i] =
33832 Context::getSolverProperty<MFloat>("tripMaxAmpFluc", m_solverId, AT_, &m_tripMaxAmpFluc[i], i);
33833
33834 m_tripNoModes = 100;
33835
33836 MFloat timeCutoff = 4.0;
33837 if(Context::propertyExists("tripDeltaTime", m_solverId)) {
33838 timeCutoff = Context::getSolverProperty<MFloat>("tripDeltaTime", m_solverId, AT_, &timeCutoff);
33839 }
33840 m_tripDeltaTime[i] = timeCutoff * m_tripDelta1[i] / m_UInfinity;
33842 }
33843
33844 if(Context::propertyExists("RNGSeed") || Context::propertyExists("seedRNGWithTime"))
33845 mTerm(1, "Properties RNGSeed or seedRNGWithTime not compatible with SandpaperTrip!");
33846 m_tripSeed = 70;
33847 srand(m_tripSeed);
33848 m_tripDomainWidth = 0.0;
33849
33850 m_tripUseRestart = false;
33851 if(Context::propertyExists("tripUseRestart", m_solverId)) {
33852 m_tripUseRestart = Context::getSolverProperty<MBool>("tripUseRestart", m_solverId, AT_, &m_tripUseRestart);
33853 }
33854
33855 if(m_tripAirfoil) {
33856 mAlloc(m_tripAirfoilBndryId, m_tripNoTrips, "m_tripAirfoilBndryId", 0, AT_);
33857 mAlloc(m_tripAirfoilSide, m_tripNoTrips, "m_tripAirfoilSide", 0, AT_);
33858 mAlloc(m_tripAirfoilChordPos, m_tripNoTrips, "m_tripAirfoilChordPos", 0.0, AT_);
33859 mAlloc(m_tripAirfoilNosePos, nDim, "m_tripAirfoilNoisePos", 0.0, AT_);
33860 mAlloc(m_tripAirfoilForceDir, nDim * m_tripNoTrips, "m_tripAirfoilForceDir", 0.0, AT_);
33861
33863 Context::getSolverProperty<MFloat>("tripAirfoilChordLength", m_solverId, AT_, &m_tripAirfoilChordLength);
33864 m_tripAirfoilAOA = Context::getSolverProperty<MFloat>("tripAirfoilAOA", m_solverId, AT_, &m_tripAirfoilAOA);
33865 for(MInt dim = 0; dim < nDim; dim++) {
33867 Context::getSolverProperty<MFloat>("tripAirfoilNosePos", m_solverId, AT_, &m_tripAirfoilNosePos[dim], dim);
33868 }
33869 for(MInt i = 0; i < m_tripNoTrips; i++) {
33871 Context::getSolverProperty<MInt>("tripAirfoilBndryId", m_solverId, AT_, &m_tripAirfoilBndryId[i], i);
33873 Context::getSolverProperty<MInt>("tripAirfoilSide", m_solverId, AT_, &m_tripAirfoilSide[i], i);
33875 Context::getSolverProperty<MFloat>("tripAirfoilChordPos", m_solverId, AT_, &m_tripAirfoilChordPos[i], i);
33876 if(m_tripAirfoilChordPos[i] < 0.0 || m_tripAirfoilChordPos[i] > 1.0)
33877 mTerm(-1, "tripAirfoilChordPos not within the allowed range of 0.0 to 1.0");
33878 }
33879 }
33880
33881 // find cells that belong to the trip zone
33882 for(MInt i = 0; i < m_tripNoTrips; i++) {
33883 if(m_tripAirfoil) {
33884 // finds the center of the tripping region on the airfoil surface with respect to a specified chord position and
33885 // angle of attack get x-position within the domain find bndryCells with minimum distance to the x-position to
33886 // define the x-y center of the tripping region
33887 MInt avgWeight = 0;
33888 for(MInt bCellId = 0; bCellId < m_fvBndryCnd->m_bndryCells->size(); bCellId++) {
33889 MInt bc = m_tripAirfoilBndryId[i];
33890 MInt cellId = m_fvBndryCnd->m_bndryCells->a[bCellId].m_cellId;
33891 MFloat eta = (a_coordinate(cellId, 0) - m_tripAirfoilNosePos[0]) * cos(m_tripAirfoilAOA * PI / 180.0)
33892 - (a_coordinate(cellId, 1) - m_tripAirfoilNosePos[1]) * sin(m_tripAirfoilAOA * PI / 180.0);
33893 MFloat zeta = (a_coordinate(cellId, 0) - m_tripAirfoilNosePos[0]) * sin(m_tripAirfoilAOA * PI / 180.0)
33894 + (a_coordinate(cellId, 1) - m_tripAirfoilNosePos[1]) * cos(m_tripAirfoilAOA * PI / 180.0);
33895 MFloat dEta = abs(eta - (m_tripAirfoilChordPos[i] * m_tripAirfoilChordLength));
33896 if(dEta <= 0.5 * c_cellLengthAtLevel(maxRefinementLevel())) {
33897 if((m_tripAirfoilSide[i] > 0 && zeta > 0.0) || (m_tripAirfoilSide[i] < 0 && zeta < 0.0)) {
33898 for(MInt srfc = 0; srfc < m_fvBndryCnd->m_bndryCells->a[bCellId].m_noSrfcs; srfc++) {
33899 // find the normal vector of the surface to determine the force direction
33900 // this is ambiguous if the cell has multiple surfaces with the same bc, I dont have a better solution
33901 // yet
33902 if(m_fvBndryCnd->m_bndryCells->a[bCellId].m_srfcs[srfc]->m_bndryCndId == bc) {
33903 for(MInt dim = 0; dim < nDim; dim++) {
33904 m_tripAirfoilForceDir[i * nDim + dim] =
33905 m_fvBndryCnd->m_bndryCells->a[bCellId].m_srfcs[srfc]->m_normalVector[dim];
33906 m_tripXOrigin[i] = m_fvBndryCnd->m_bndryCells->a[bCellId].m_srfcs[srfc]->m_coordinates[0];
33907 m_tripYOrigin[i] = m_fvBndryCnd->m_bndryCells->a[bCellId].m_srfcs[srfc]->m_coordinates[1];
33908 }
33909 avgWeight = 1;
33910 break;
33911 }
33912 }
33913 break;
33914 }
33915 }
33916 }
33917 // weights are summed to avoid incorporating domains which do not contain any tripping cells into the averaging
33918 MPI_Allreduce(&avgWeight, &avgWeight, 1, MPI_INT, MPI_SUM, mpiComm(), AT_, "avgWeight", "avgWeight");
33919 MPI_Allreduce(&m_tripXOrigin[i], &m_tripXOrigin[i], 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "m_tripXOrigin",
33920 "m_tripXOrigin");
33921 MPI_Allreduce(&m_tripYOrigin[i], &m_tripYOrigin[i], 1, MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "m_tripYOrigin",
33922 "m_tripYOrigin");
33923 for(MInt dim = 0; dim < nDim; dim++) {
33924 MPI_Allreduce(&m_tripAirfoilForceDir[i * nDim + dim], &m_tripAirfoilForceDir[i * nDim + dim], 1, MPI_DOUBLE,
33925 MPI_SUM, mpiComm(), AT_, "m_tripAirfoilForceDir", "m_tripAirfoilForceDir");
33926 m_tripAirfoilForceDir[i * nDim + dim] /= avgWeight;
33927 }
33928 m_tripXOrigin[i] /= avgWeight;
33929 m_tripYOrigin[i] /= avgWeight;
33930
33931 if(avgWeight > 0) {
33932 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
33933 MFloat maxR2 = POW2(2 * m_tripXLength[i]) + POW2(2 * m_tripYHeight[i]);
33934 MFloat cellR2 =
33935 POW2(a_coordinate(cellId, 0) - m_tripXOrigin[i]) + POW2(a_coordinate(cellId, 1) - m_tripYOrigin[i]);
33936 if(cellR2 < maxR2) {
33937 m_tripCellIds.push_back(cellId);
33938 m_tripCoords.push_back(a_coordinate(cellId, 2));
33939 a_isSandpaperTripCell(cellId) = true;
33940 }
33941 }
33942 }
33944 } else {
33945 if(i > 0) {
33946 m_tripCellOffset[i] = m_tripCellOffset[i - 1] + m_tripNoCells[i - 1];
33947 }
33948 // all cellIds in the tripping zone will be collected in m_tripCellIds
33949 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
33950 MFloat maxR2 = POW2(2 * m_tripXLength[i]) + POW2(2 * m_tripYHeight[i]);
33951 MFloat cellR2 =
33952 POW2(a_coordinate(cellId, 0) - m_tripXOrigin[i]) + POW2(a_coordinate(cellId, 1) - m_tripYOrigin[i]);
33953 if(cellR2 < maxR2) {
33954 m_tripCellIds.push_back(cellId);
33955 m_tripCoords.push_back(a_coordinate(cellId, 2));
33956 a_isSandpaperTripCell(cellId) = true;
33957 }
33958 }
33960 }
33961 }
33962 MInt tripTotalNoCells = m_tripCellIds.size();
33963
33964 MFloat bbox[6];
33965 geometry().getBoundingBox(&bbox[0]);
33966 m_tripDomainWidth = bbox[5] - bbox[2];
33967
33968 m_log << "=================================================" << endl
33969 << " SANDPAPER TRIP PROPERTIES " << endl
33970 << "=================================================" << endl;
33971 for(MInt i = 0; i < m_tripNoTrips; ++i) {
33972 m_log << "######### TRIP NUMBER " << i << " ###########" << endl
33973 << "tripXOrigin: " << m_tripXOrigin[i] << endl
33974 << "tripXLength: " << m_tripXLength[i] << endl
33975 << "tripYOrigin: " << m_tripYOrigin[i] << endl
33976 << "tripYHeight: " << m_tripYHeight[i] << endl
33977 << "tripMaxAmpFluc: " << m_tripMaxAmpFluc[i] << endl
33978 << "tripNoModes: " << m_tripNoModes << endl
33979 << "tripDeltaTime: " << m_tripDeltaTime[i] << endl
33980 << "tripTimeStep: " << m_tripTimeStep[i] << endl
33981 << "tripDomainWidth: " << m_tripDomainWidth << endl
33982 << "###########################################" << endl;
33983 }
33984 m_log << "=================================================" << endl;
33985
33986 if(tripTotalNoCells > 0) {
33987 mAlloc(m_tripG, m_tripNoTrips * tripTotalNoCells, "m_tripG", F0, AT_);
33988 mAlloc(m_tripH1, m_tripNoTrips * tripTotalNoCells, "m_tripH1", F0, AT_);
33989 mAlloc(m_tripH2, m_tripNoTrips * tripTotalNoCells, "m_tripH2", F0, AT_);
33990 }
33991 mAlloc(m_tripModesG, m_tripNoTrips * 2 * m_tripNoModes, "m_tripModesG", F0, AT_);
33992 mAlloc(m_tripModesH1, m_tripNoTrips * 2 * m_tripNoModes, "m_tripModesH1", F0, AT_);
33993 mAlloc(m_tripModesH2, m_tripNoTrips * 2 * m_tripNoModes, "m_tripModesH2", F0, AT_);
33994
33996 m_log << "Reading Sandpaper Trip Vars... ";
33997
33998 stringstream fileName;
34000 fileName << restartDir() << "tripRestart" << ParallelIo::fileExt();
34001 } else {
34002 if(!isMultilevel()) {
34003 fileName << restartDir() << "tripRestart_" << m_restartTimeStep << ParallelIo::fileExt();
34004 } else {
34005 mTerm(-1, "loading Sandpaper trip variables not implemented for multiLevel");
34006 }
34007 }
34008
34009 using namespace maia::parallel_io;
34010 ParallelIo parallelIo(fileName.str(), PIO_READ, mpiComm());
34011
34012 ParallelIo::size_type dataSize = m_tripNoTrips * 2 * m_tripNoModes;
34013
34014 parallelIo.setOffset(dataSize, 0);
34015 parallelIo.readArray(&m_tripModesG[0], "tripModesG");
34016 parallelIo.readArray(&m_tripModesH1[0], "tripModesH1");
34017 parallelIo.readArray(&m_tripModesH2[0], "tripModesH2");
34018
34019 m_log << "ok." << endl;
34020
34021 } else {
34022 for(MInt i = 0; i < m_tripNoTrips; ++i) {
34023 const MInt offsetModes = i * 2 * m_tripNoModes;
34027 }
34028 }
34029
34030 for(MInt i = 0; i < m_tripNoTrips; ++i) {
34031 const MInt offset = m_tripCellOffset[i];
34032 const MInt offsetModes = i * 2 * m_tripNoModes;
34033 tripForceCoefficients(&m_tripModesG[offsetModes], &m_tripG[offset], &m_tripCoords[0], m_tripNoCells[i],
34039 }
34040 }
34041}
static MInt propertyLength(const MString &name, MInt solverId=m_noSolvers)
Returns the number of elements of a property.
Definition: context.cpp:538
MBool a_isSandpaperTripCell(const MInt cellId) const
Returns isWMImgCell of the cell cellId.
const Geom & geometry() const
the references to CartesianGrid data members end here
constexpr MBool isMultilevel() const
Return true if solver is part of a multilevel computation.
void getBoundingBox(MFloat *const bBox) const
Returns the bounding box for the geometry.
Definition: geometry.cpp:84

◆ initSolutionStep()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initSolutionStep ( MInt  mode)
virtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 33357 of file fvcartesiansolverxd.cpp.

33357 {
33358 TRACE();
33359
33360 // only relevant for fvmb!
33361 std::ignore = mode;
33362
33363 // init property IsInvalid - cell is invalid (MGC)
33364 // init property IsPeriodicWithRot - periodic cell (azimuthal periodicity concept)
33365 // will be set false during initSolutionStep if necessary
33366 // cannot be done in setCellProperties as that routine is called more than once
33367 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
33368 a_hasProperty(cellId, SolverCell::IsInvalid) = false;
33369 a_hasProperty(cellId, SolverCell::IsPeriodicWithRot) = false;
33370 }
33371
33372 grid().updateGridInfo();
33373
33375
33376 // NOTE: this is/can be a major time consumer during init/DLB
33378
33379 IF_CONSTEXPR(nDim == 3) {
33381 // shiftHaloAndSplitCells(); //commented out since otherwise split cells are written out as
33382 // regular cells, while no mechanisms exists to detect these cells upon restart. Thus multiple
33383 // cells at the same location will appear, each of which will then be split again into new
33384 // cells, and so forth... Also domainOffsets needs to be updated correspondingly. (Lennart)
33385 }
33386
33387 // deactivates wrong cells when periodic bc is used (azimuthal periodicity concept)
33388 if(m_periodicCells == 0) {
33389 checkCells();
33390 }
33391 }
33392
33393 // shift cell center of boundary cells
33395
33396 // MULTILEVEL
33397 // correct (xyz)cc and body surfaces of coarse boundary cells
33398 // requires that small and master cells are not yet merged!
33399 // for MGC formulation, this does not provide the correct result!
33400 // do not use multilevel with MGC formulation
33402
33403 IF_CONSTEXPR(nDim == 3) {
33404 // identifies cells to copy PV from (using kd tree, azimuthal periodicity concept)
33405 // m_periodicCells=1 --> azimuthal periodicity (with LS interpolation)
33406 // m_periodicCells=2 --> special case: periodicity in x-direction (without LS interpolation)
33407 // m_periodicCells=3 --> special case: periodicity in x-direction (without LS interpolation +
33408 // volume forcing)
33410
33411 // set the neighbor arrays storeNghbrIds, identNghbrIds
33413 }
33414
33416 // detects small cells and identifies a master cell for each
33417 // merges master and small cell(s)
33418 IF_CONSTEXPR(nDim == 2) {
33420 m_log << "Connecting master and slave cells...";
33422 }
33423 else IF_CONSTEXPR(nDim == 3) {
33426 else
33428 m_log << "Connecting master and slave cells...";
33429
33432 else
33434 }
33435 m_log << " found " << m_fvBndryCnd->m_smallBndryCells->size() << "small cells." << endl;
33436 } else {
33437 // flux-redistribution method
33444 } else {
33446 }
33447 }
33448
33449 // write out centerline data
33450 if(m_writeOutData) {
33451 cerr << "Writing out center line and boundary data" << endl;
33454 mTerm(0, AT_);
33455 }
33456
33457 // set the neighbor arrays storeNghbrIds, identNghbrIds
33458 IF_CONSTEXPR(nDim == 2) { findNghbrIds(); }
33459 else IF_CONSTEXPR(nDim == 3) {
33461 }
33462
33463 m_log << "Creating surfaces...";
33464 // create surfaces
33466 IF_CONSTEXPR(nDim == 2) {
33467 checkForSrfcsMGC(); // small cell must already be extracted
33468 }
33469 else IF_CONSTEXPR(nDim == 3) {
33471 checkForSrfcsMGC_2(); // small cell must already be extracted
33472 else
33474 }
33475
33476 // correct all surfaces which were built between two boundary cells
33478 m_log << "ok" << endl;
33479
33480
33481 // adds one ghost cell for each boundary cell
33482 m_log << "Creating ghost cells...";
33484 IF_CONSTEXPR(nDim == 2) { m_fvBndryCnd->computeGhostCells(); }
33485 else IF_CONSTEXPR(nDim == 3) {
33488 else
33490 }
33491 m_log << "ok" << endl;
33492
33493 // update the cell properties
33495
33496 IF_CONSTEXPR(nDim == 2) {
33497 m_log << "Setting the neighbor arrays...";
33498 // set the neighbor arrays storeNghbrIds, identNghbrIds
33499 findNghbrIds();
33500 m_log << "ok" << endl;
33501 }
33502 else IF_CONSTEXPR(nDim == 3) {
33504 m_log << "Setting the neighbor arrays...";
33505 // set the neighbor arrays storeNghbrIds, identNghbrIds
33506 findNghbrIds();
33507 m_log << "ok" << endl;
33508 }
33509 }
33510
33511 // creates boundary surfaces
33512 // requires ghost and small cells
33513 m_log << "Adding body surfaces...";
33515 IF_CONSTEXPR(nDim == 2) { m_fvBndryCnd->addBoundarySurfaces(); }
33516 else IF_CONSTEXPR(nDim == 3) {
33519 } else {
33521 // adds a correction part the boundary surface on interface boundary cells
33524 }
33525 }
33526
33527 m_log << "ok" << endl;
33528 m_log << " *** All surfaces created" << endl;
33529
33530 m_log << "Tagging cells needed for the surface flux computation...";
33532 m_log << "ok" << endl;
33533
33534 // second part of the initialisation of the manual limiter
33536
33537 m_log << "Fill nghbrInterface...";
33539 m_log << "ok" << endl;
33540
33541 m_log << "Filling cell surface mapping...";
33543 m_log << "ok" << endl;
33544
33545 m_log << "Setting upwind coefficient...";
33547 m_log << "ok" << endl;
33548
33549
33550 m_log << "Computing plane vectors...";
33552 m_log << "ok" << endl;
33553
33554
33555 m_log << "Initializing the least-squares reconstruction...";
33556 // builds the least-squares stencil and computes the LS constants
33557 // MGC stencil works bad for refined grids. More research necessary!
33559 m_log << "ok" << endl;
33560
33561
33562 m_log << "Initializing the viscous flux computation...";
33564 m_log << "ok" << endl;
33565
33566 if(grid().azimuthalPeriodicity()) {
33569 }
33570
33571 m_log << "Initializing boundary conditions...";
33572 // initialize the reconstruction scheme for the boundary and ghost cells
33574
33576
33577 IF_CONSTEXPR(nDim == 3) {
33579 }
33580 m_log << "ok" << endl;
33581
33582 m_log << "Computing reconstruction constants...";
33583 // Computes the reconstruction constants for each cell
33586 else
33588 m_log << "ok" << std::endl;
33589
33590 IF_CONSTEXPR(nDim == 3) {
33591 // computes reconstruction constants for LS reconstruction (azimuthal periodicity concept)
33593 }
33594
33596
33597 // compute dx between surfaces and their neighbor cells
33599
33600
33601 // multigrid: set all taus to zero
33602 // deleteTau();
33603
33604
33605 // compute all volumes of the cells inside the integration domain
33607
33608 // Add cut-cell information to grid file if enabled in properties
33610 m_log << "Writing cut cells to grid file...";
33614 m_log << "ok" << endl;
33615 }
33616
33617 // count internal master cells
33618 MInt countFMC = 0;
33619 MInt smallCell;
33620 for(MInt smallId = 0; smallId < m_fvBndryCnd->m_smallBndryCells->size(); smallId++) {
33621 smallCell = m_fvBndryCnd->m_smallBndryCells->a[smallId];
33622 if(a_bndryId(m_fvBndryCnd->m_bndryCells->a[smallCell].m_linkedCellId) == -1) {
33623 countFMC++;
33624 }
33625 }
33626 MLong smallCells = m_fvBndryCnd->m_smallBndryCells->size();
33627 MPI_Allreduce(MPI_IN_PLACE, &smallCells, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE", "smallCells");
33628
33630
33631 // @felix cellMaterialNo needs to be updated in size to be equal to the total number of cells
33632 // including all bndry/ghost/... cells, else this the code will access the memory after the
33633 // currently allocated array, which will lead to segmentation faults in certain cases (i.e. due to
33634 // values of some other allocated variable
33635 // !=0 in memory) / ansgar
33636 IF_CONSTEXPR(nDim == 3) { updateMaterialNo(); }
33637
33638 // Reset interpolation data structures used for sampling data
33640 std::fill(m_cellInterpolationIndex.begin(), m_cellInterpolationIndex.end(), -1);
33642 m_cellInterpolationIds.clear();
33643
33644 if(m_wmLES) {
33645 if(m_restart) {
33647 }
33650
33651 if(m_wmSurfaceProbeInterval > 0) {
33653 }
33654 }
33655
33656 if(m_saSrfcProbeInterval > 0) {
33658 }
33659
33663 }
33664
33665 if(m_useSandpaperTrip) {
33667 }
33668
33669 if(m_useChannelForce) {
33671 }
33672 if(m_isEEGas) {
33673 // Set implicit coefficient to zero
33675 }
33676
33677 // if ( m_restart ) m_restart = false;
33678
33679 m_log << "_________________________________________________________________" << endl << endl;
33680 m_log << "Grid summary at time step " << globalTimeStep << endl;
33681 m_log << "_________________________________________________________________" << endl << endl;
33682 m_log << setfill(' ');
33683 m_log << "number of cells " << setw(7) << a_noCells() << endl;
33684 m_log << "number of surfaces " << setw(7) << a_noSurfaces() << endl;
33685 m_log << "total number of small cells on all process " << setw(7) << smallCells << endl;
33686 m_log << "number of internal master cells " << setw(7) << countFMC << endl;
33687 m_log << "minimum grid level " << setw(7) << minLevel() << endl;
33688 m_log << "maximum grid level " << setw(7) << maxLevel() << endl << endl;
33689 m_log << "level | total no cells | no of leaf cells | ghost cells | bndry cells" << endl;
33690 for(MInt level = maxLevel(); level >= minLevel(); level--) {
33691 MInt total = 0;
33692 MInt leaf = 0;
33693 MInt ghost = 0;
33694 MInt bnd = 0;
33695 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
33696 if(a_isBndryGhostCell(cellId)) {
33697 if(a_level(cellId) == level) {
33698 total++;
33699 leaf++;
33700 ghost++;
33701 }
33702 } else if(a_level(cellId) == level) {
33703 total++;
33704 if(a_hasProperty(cellId, SolverCell::IsSplitClone)) continue;
33705 if(c_isLeafCell(cellId)) {
33706 leaf++;
33707 }
33708 if(a_bndryId(cellId) > -1) {
33709 bnd++;
33710 }
33711 }
33712 }
33713 m_log << setfill(' ');
33714 m_log << setw(3) << level << " " << setw(12) << total << " " << setw(16) << leaf << " " << setw(14) << ghost
33715 << " " << setw(14) << bnd << endl;
33716 }
33717
33718 // check domain boundaries
33719 MFloat maxC[] = {-10000.0, -10000.0, -10000.0};
33720 MFloat minC[] = {10000.0, 10000.0, 10000.0};
33721 for(MInt c = 0; c < noInternalCells(); c++) {
33722 if(!a_hasProperty(c, SolverCell::IsOnCurrentMGLevel)) {
33723 continue;
33724 }
33725 if(a_isHalo(c)) {
33726 continue;
33727 }
33728 if(a_isPeriodic(c)) {
33729 continue;
33730 }
33731 const MFloat cellLength = c_cellLengthAtCell(c);
33732 for(MInt i = 0; i < nDim; i++) {
33733 maxC[i] = mMax(maxC[i], a_coordinate(c, i) + F1B2 * cellLength);
33734 minC[i] = mMin(minC[i], a_coordinate(c, i) - F1B2 * cellLength);
33735 }
33736 }
33737 m_log << "_________________________________________________________________" << endl << endl;
33738
33739 m_log << "Physical domain boundaries: " << endl;
33740 m_log << "min (x,y" << (nDim == 3 ? ",z): (" : "): (") << minC[0] << "," << minC[1];
33741 IF_CONSTEXPR(nDim == 3) m_log << "," << minC[2];
33742 m_log << ")" << endl;
33743 m_log << "max (x,y" << (nDim == 3 ? ",z): (" : "): (") << maxC[0] << "," << maxC[1];
33744 IF_CONSTEXPR(nDim == 3) m_log << "," << maxC[2];
33745 m_log << ")" << endl;
33746
33747 m_log << "_________________________________________________________________" << endl << endl;
33748
33749 m_log << "Process " << domainId() << " finished initialization" << endl;
33750
33751 /*
33752 if( globalTimeStep == m_restartTimeStep ) {
33753 // patch for restart from explicit solution
33754 for( MInt cellId = 0 ; cellId < a_noCells(); cellId++ ) {
33755 for( MInt varId = 0; varId < CV->noVariables; varId ++ ) {
33756 a_dt1Variable( cellId , varId ) =
33757 a_variable( cellId , varId );
33758 a_dt2Variable( cellId , varId ) =
33759 a_variable( cellId , varId );
33760 }
33761 }
33762 }
33763 */
33764}
void initSmallCellCorrection(MInt updateOnlyBndryCndId=-1)
Initialize the small-cell correction for the flux-redistribution method The cell vars are computed us...
void detectSmallBndryCells()
Detects small cells and identifies a master cell Calls mergeCell to merge master and small cell.
void computePlaneVectors()
uses Gram-Schmidt to compute orthonormal vectors in the cut plane
void computeReconstructionConstants_interpolation()
void correctMasterSlaveSurfaces()
Removes surfaces between master-slave pairs and reassigns slave cell surfaces.
void computeImagePointRecConst(MInt updateOnlyBndryCndId=-1)
void addBoundarySurfacesMGC()
adds a surface for the ghost-boundary cell intersections
void detectSmallBndryCellsMGC()
Detects small cells and identifies a master cell Calls mergeCell to merge master and small cell.
void setBCTypes(MInt updateOnlyBndryCndId=-1)
void addBoundarySurfaces()
adds a surface for the ghost-boundary cell intersections
void setNearBoundaryRecNghbrs(MInt updateOnlyBndryCndId=-1)
void mergeCellsMGC()
merges master and small cells - for multiple ghost cells formulation
void computeGhostCellsMGC()
Computes one ghost cell for each boundary surface.
void initSmallCellRHSCorrection(MInt updateOnlyBndryCndId=-1)
virtual void computeReconstructionConstants()
void initAzimuthalReconstruction()
void checkGhostCellIntegrity()
Checks whether cells' isGhost and the boundary Id coincede. Cells' isGhost is is used to tell the gri...
void buildLeastSquaresStencilSimple()
Determine the least squares stencil.
void writeCutCellsToGridFile()
Writes cut cell information to an existing grid file in order to visualize it in ParaView.
void computeReconstructionConstantsSVD()
Compute the reconstruction constants using a weighted least squares approached solved via singular va...
virtual void resetImplicitCoefficients()
void checkForSrfcsMGC()
Check all existing cells if surfaces have to be created member function with the task to check all ex...
virtual void correctBoundarySurfaces()
void checkCellSurfaces()
checks if the surfaces for a cell are correct and balanced The accumulated cell surfaces in +x direct...
virtual void initComputeSurfaceValuesLimitedSlopesMan2()
can be used to apply the slope limiter at certain positions such as refinement interfaces,...
virtual void computeAzimuthalReconstructionConstants(MInt mode=0)
@ HOCD_LIMITED_SLOPES_MAN
Definition: enums.h:180

◆ initSolver()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initSolver
overridevirtual
Author
Sven Berger, Tim Wegmann
Template Parameters
nDim

Implements Solver.

Definition at line 9953 of file fvcartesiansolverxd.cpp.

9953 {
9954 TRACE();
9955
9956 // relevant for Post-Processing and set from pp-init
9958
9960 Context::getBasicProperty<MBool>("statisticCombustionAnalysis", AT_, &m_statisticCombustionAnalysis);
9961 if(m_statisticCombustionAnalysis || isDetChem<SysEqn>) {
9962 mAlloc(m_heatRelease, maxNoGridCells(), "m_heatRelease", F0, AT_);
9963 }
9964
9965 // Nothing to be done if solver is not active
9966 if(!isActive()) return;
9967
9968 const MFloat time0 = MPI_Wtime();
9969
9970 IF_CONSTEXPR(isEEGas<SysEqn>)
9971 if(m_EEGas.depthCorrection) initDepthCorrection();
9972
9974 computePV();
9975
9976 if(m_zonal) {
9980 }
9981 }
9982
9984
9985 if(noNeighborDomains() > 0) {
9986 exchangeDataFV(&a_variable(0, 0), CV->noVariables, false, m_rotIndVarsCV);
9987 exchangeDataFV(&a_oldVariable(0, 0), CV->noVariables, false, m_rotIndVarsCV);
9988 exchangeDataFV(&a_pvariable(0, 0), PV->noVariables, false, m_rotIndVarsPV);
9989 }
9990
9991 const MFloat time1 = MPI_Wtime();
9992 if(domainId() == 0) m_log << "Init solution time " << time1 - time0 << endl;
9993}
std::vector< MInt > m_rotIndVarsCV
virtual void initSTGSponge()
Initializes zonal exchange arrays.

◆ initSolverSamplingVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initSolverSamplingVariables ( const std::vector< MInt > &  varIds,
const std::vector< MInt > &  noSamplingVars 
)
overridevirtual

Initialize sampling variables, i.e., allocate additional memory for sampling quantities.

Definition at line 10642 of file fvcartesiansolverxd.cpp.

10643 {
10644 TRACE();
10645
10647
10648 // TODO labels:FV enable use with balancing
10649 for(MUint i = 0; i < varIds.size(); i++) {
10650 // No additional storage for primitive variables
10651 if(varIds[i] == FV_PV) {
10652 continue;
10653 }
10654 // Storage for sampling variable already allocated
10655 if(m_samplingVariables[varIds[i]] != nullptr) {
10656 continue;
10657 }
10658
10659 MFloat** varPointer = nullptr;
10660 const MInt dataBlockSize = noSamplingVars[i];
10661 mAlloc(varPointer, a_noCells(), dataBlockSize, "m_samplingVariables_" + std::to_string(varIds[i]), 0.0, AT_);
10662 m_samplingVariables[varIds[i]] = varPointer;
10663 }
10664}

◆ initSourceCells()

template<MInt nDim_, class SysEqn >
template<class _ = void, std::enable_if_t< isEEGas< SysEqn >, _ * > = nullptr>
void FvCartesianSolverXD< nDim_, SysEqn >::initSourceCells ( )

◆ initSpanAvgSrfcProbes()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initSpanAvgSrfcProbes
protected

Definition at line 34221 of file fvcartesiansolverxd.cpp.

34221 {
34222 TRACE();
34223
34224 const MInt noVars = 16;
34225
34227
34228 MInt probeBcId = 3399;
34229 probeBcId = Context::getSolverProperty<MInt>("saSrfcBcId", m_solverId, AT_, &probeBcId);
34230
34231 m_saSrfcProbeStart = Context::getSolverProperty<MInt>("saSrfcProbeStart", m_solverId, AT_, &m_saSrfcProbeStart);
34232
34233 if(m_saNoSrfcProbes != Context::propertyLength("saSrfcProbesSide", m_solverId))
34234 mTerm(1, "length of saSrfcProbesX and length of saSrfcProbesSide must match!");
34235
34238
34239 for(MInt p = 0; p < m_saNoSrfcProbes; p++) {
34240 m_saSrfcProbeIds[p].clear();
34241 m_saSrfcProbeSrfcs[p].clear();
34242
34243 const MFloat probeCoord = Context::getSolverProperty<MFloat>("saSrfcProbesX", m_solverId, AT_, &probeCoord, p);
34244 const MInt probeSide = Context::getSolverProperty<MInt>("saSrfcProbesSide", m_solverId, AT_, &probeSide, p);
34245
34246 for(MInt bCellId = 0; bCellId < m_bndryCells->size(); bCellId++) {
34247 MInt cellId = m_bndryCells->a[bCellId].m_cellId;
34248 if(!a_isHalo(cellId)) {
34249 if(abs(a_coordinate(cellId, 0) - probeCoord) < F1B2 * c_cellLengthAtLevel(maxRefinementLevel()) + m_eps) {
34250 for(MInt srfc = 0; srfc < m_bndryCells->a[bCellId].m_noSrfcs; srfc++) {
34251 if(m_bndryCells->a[bCellId].m_srfcs[srfc]->m_bndryCndId == probeBcId) {
34252 const MFloat ny = m_bndryCells->a[bCellId].m_srfcs[srfc]->m_normalVector[1];
34253 if(ny * (MFloat)probeSide > 0) {
34254 m_saSrfcProbeIds[p].push_back(cellId);
34255 m_saSrfcProbeSrfcs[p].push_back(srfc);
34256 break;
34257 }
34258 }
34259 }
34260 }
34261 }
34262 }
34263 }
34264
34265
34266 mAlloc(m_saSrfcProbeBuffer, m_saNoSrfcProbes * noVars, "m_saSrfcProbeBuffer", 0.0, AT_);
34267
34268 MIntScratchSpace localNoSamples(m_saNoSrfcProbes, AT_, "localNoSamples");
34269 for(MInt p = 0; p < m_saNoSrfcProbes; p++) {
34270 localNoSamples[p] = m_saSrfcProbeIds[p].size();
34271 }
34272
34273 if(domainId() == 0) {
34274 mAlloc(m_saSrfcProbeNoSamples, m_saNoSrfcProbes, "m_saSrfcProbeNoSamples", 0, AT_);
34275 }
34276 MPI_Reduce(&localNoSamples[0], &m_saSrfcProbeNoSamples[0], m_saNoSrfcProbes, MPI_INT, MPI_SUM, 0, mpiComm(), AT_,
34277 "&localNoSamples[0]", "&m_saSrfcProbeNoSamples[0]");
34278}
std::vector< std::vector< MInt > > m_saSrfcProbeSrfcs
std::vector< std::vector< MInt > > m_saSrfcProbeIds

◆ initSpongeLayer()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initSpongeLayer
protected

Definition at line 7844 of file fvcartesiansolverxd.cpp.

7844 {
7845 TRACE();
7846
7847 const MInt noCells = a_noCells();
7848 const MInt noDirs = 2 * nDim;
7849 const MFloat epsilon = m_spongeLayerThickness / 10000000.0;
7850 MFloat constant = NAN;
7851 MFloatScratchSpace delta(noDirs, AT_, "delta");
7852 MFloatScratchSpace dis(nDim, AT_, "dis");
7853 MFloat beta = 1.0;
7854 MFloat maxSpongeFactor = 0.0;
7855 MFloat minSpongeFactor = 100.0;
7856
7857 //---
7858
7859 // initialize the arrays containing the list of cells in the sponge layer
7861 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
7862 a_hasProperty(cellId, SolverCell::IsInSpongeLayer) = false;
7863 a_spongeFactor(cellId) = F0;
7864 }
7865
7867 if(m_spongeLayerThickness > F0) {
7868 switch(m_spongeLayerLayout) {
7869 case 0: {
7870 for(MInt cellId = 0; cellId < noCells; cellId++) {
7871 if(a_isBndryGhostCell(cellId)) {
7872 continue;
7873 }
7874 a_hasProperty(cellId, SolverCell::IsInSpongeLayer) = false;
7875 a_spongeFactor(cellId) = F0;
7876 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
7877 // compute the distance from the sponge layer
7878 // if the cell is not inside the sponge layer, the distance is set to zero
7879 for(MInt i = 0; i < nDim; i++) {
7880 delta.p[2 * i] =
7881 mMax(F0, (a_coordinate(cellId, i) - m_spongeCoord[2 * i + 1]) * m_spongeCoord[noDirs + 2 * i + 1]);
7882 delta.p[2 * i + 1] =
7883 mMin(F0, (a_coordinate(cellId, i) - m_spongeCoord[2 * i]) * m_spongeCoord[noDirs + 2 * i]);
7884 delta.p[2 * i + 1] = fabs(delta.p[2 * i + 1]);
7885 dis.p[i] = mMax(delta.p[2 * i], delta.p[2 * i + 1]);
7886 }
7887
7888 // compute the dissipation function...
7889 constant = F0;
7890 for(MInt i = 0; i < nDim; i++) {
7891 constant = mMax(constant, ABS(dis.p[i]));
7892 }
7893 constant = pow(constant, beta);
7894 constant *= m_sigmaSponge;
7895
7896 if(constant > epsilon) {
7899 a_hasProperty(cellId, SolverCell::IsInSpongeLayer) = true;
7900 a_spongeFactor(cellId) = constant;
7901 maxSpongeFactor = mMax(maxSpongeFactor, a_spongeFactor(cellId));
7902 minSpongeFactor = mMin(minSpongeFactor, a_spongeFactor(cellId));
7903 }
7904 }
7905 }
7906 if(globalTimeStep < 1) {
7907 m_log << endl;
7908 m_log << "*************************************************************" << endl;
7909 m_log << "Information for domain sponge: " << endl;
7910 m_log << "*************************************************************" << endl;
7911
7912 m_log << "number of cells inside sponge layer " << m_noCellsInsideSpongeLayer << endl;
7913 m_log << "max sponge factor: " << maxSpongeFactor << endl;
7914 m_log << "min sponge factor: " << minSpongeFactor << endl << endl;
7915 }
7916 break;
7917 }
7918 case 2: {
7919 MFloat radius = NAN;
7920 IF_CONSTEXPR(nDim == 3) {
7921 for(MInt cellId = 0; cellId < noCells; cellId++) {
7922 a_hasProperty(cellId, SolverCell::IsInSpongeLayer) = false;
7923 a_spongeFactor(cellId) = F0;
7924 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
7925 // compute the distance from the sponge layer (streamwise direction is y)
7926 // if the cell is not inside the sponge layer, the distance is set to zero
7927 // radial (xz)
7928 radius = sqrt(POW2(a_coordinate(cellId, 0)) + POW2(a_coordinate(cellId, 2)));
7929 delta.p[0] = mMax(F0, (radius - ABS(m_spongeCoord[1])) * m_spongeCoord[noDirs + 1]);
7930 dis.p[0] = delta.p[0];
7931 dis.p[2] = F0;
7932 // streamwise (y)
7933 delta.p[2] = mMax(F0, (a_coordinate(cellId, 1) - m_spongeCoord[3]) * m_spongeCoord[noDirs + 3]);
7934 delta.p[3] = mMin(F0, (a_coordinate(cellId, 1) - m_spongeCoord[2]) * m_spongeCoord[noDirs + 2]);
7935 delta.p[3] = fabs(delta.p[3]);
7936 dis.p[1] = mMax(delta.p[2], delta.p[3]);
7937
7938 // compute the dissipation function...
7939 constant = F0;
7940 for(MInt i = 0; i < nDim; i++) {
7941 constant = mMax(constant, ABS(dis.p[i]));
7942 }
7943
7944 constant *= m_sigmaSponge;
7945
7946 if(constant > epsilon) {
7949 a_hasProperty(cellId, SolverCell::IsInSpongeLayer) = true;
7950 a_spongeFactor(cellId) = constant;
7951 }
7952 }
7953 }
7954 }
7955 else {
7956 for(MInt cellId = 0; cellId < noCells; cellId++) {
7957 a_hasProperty(cellId, SolverCell::IsInSpongeLayer) = false;
7958 a_spongeFactor(cellId) = F0;
7959 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
7960 // compute the distance from the sponge layer radial (xy)
7961 // if the cell is not inside the sponge layer, the distance is set to zero
7962 radius = sqrt(POW2(a_coordinate(cellId, 0)) + POW2(a_coordinate(cellId, 1)));
7963 // compute the dissipation function...
7964 constant = mMax(F0, (radius - ABS(m_spongeCoord[0])) * m_spongeCoord[noDirs]);
7965 constant *= m_sigmaSponge;
7966
7967 if(constant > epsilon) {
7970 a_hasProperty(cellId, SolverCell::IsInSpongeLayer) = true;
7971 a_spongeFactor(cellId) = constant;
7972 }
7973 }
7974 }
7975 }
7976 break;
7977 }
7978 default: {
7979 mTerm(1, AT_,
7980 "FvCartesianSolver::setCellProperties(): switch variable 'm_spongeLayerLayout' not matching any "
7981 "case");
7982 }
7983 }
7984 }
7985 }
7986}
MFloat & a_spongeFactor(const MInt cellId)
Returns the spongeFactor of the cell cellId.

◆ initSTGSponge()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initSTGSponge
virtual

Definition at line 37881 of file fvcartesiansolverxd.cpp.

37881 {
37882 TRACE();
37883
37884 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
37885
37887 for(MInt i = 0; i < nDim + 3; i++) {
37888 m_STGSpongeFactor[i].clear();
37889 }
37890
37891 for(MInt varId = 0; varId < nDim + 3; varId++) {
37892 m_STGSpongeFactor[varId].resize(c_noCells());
37893 for(MInt c = 0; c < c_noCells(); c++) {
37894 ASSERT(c < (MInt)m_STGSpongeFactor[varId].size(),
37895 "Trying to access data [" + to_string(varId) + "][" + to_string(c) + "] in m_STGSpongeFactor with length "
37896 + to_string(m_STGSpongeFactor[varId].size()));
37897
37898 m_STGSpongeFactor[varId][c] = F0;
37899 }
37900 }
37901}

◆ initSTGSpongeExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initSTGSpongeExchange

Definition at line 37904 of file fvcartesiansolverxd.cpp.

37904 {
37905 TRACE();
37906
37907 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
37908
37909 m_spongeLocations.clear();
37910 m_spongeCells.clear();
37911
37912 MInt noSpongeCells = 0;
37913 MInt noSpongeLocations = 0;
37914
37915 // ======================================================
37916 // 1) Determine cells for periodic average
37917 // ======================================================
37918 MFloat periodicL = 0;
37919 MBool first = true;
37920
37921 for(MInt c = 0; c < (MInt)m_LESAverageCells.size(); c++) {
37923 if(!c_isLeafCell(cellId)) continue;
37924 MInt averageDir = abs(m_7901wallDir + m_7901periodicDir - nDim);
37925 MFloat pos = a_coordinate(cellId, averageDir);
37926 MFloat halfCellLength = grid().halfCellLength(cellId);
37927
37928 if(approx(m_7901Position, pos, halfCellLength) && !a_isInactive(cellId)) {
37929 if(first) {
37930 periodicL = a_coordinate(cellId, m_7901periodicDir) - F1B3 * halfCellLength;
37931 first = false;
37932 }
37933 if(abs(a_coordinate(cellId, m_7901periodicDir) + halfCellLength - 1e-16 - periodicL) < halfCellLength) {
37934 m_spongeLocations.push_back(a_coordinate(cellId, m_7901wallDir));
37936 noSpongeLocations++;
37937 noSpongeLocations++;
37938 }
37939 m_spongeCells.push_back(cellId);
37940 noSpongeCells++;
37941 }
37942 }
37943
37944 m_noSpongeCells = noSpongeCells;
37945
37946 // ======================================================
37947 // 2) Create communicator commSponge
37948 // ======================================================
37949 MInt comm_size;
37950 MPI_Comm_size(mpiComm(), &comm_size);
37951 std::vector<MInt> spongeCellsperDomain(comm_size);
37952
37953 if(noDomains() > 1) {
37954 MPI_Allgather(&noSpongeCells, 1, MPI_INT, &spongeCellsperDomain[0], 1, MPI_INT, mpiComm(), AT_, "noSpongeCells ",
37955 "spongeCellsperDomain");
37956 }
37957
37958 MInt noInvolvedRanks = 0;
37959 std::vector<MInt> involvedRanks(comm_size);
37960 for(MInt i = 0; i < comm_size; i++) {
37961 if(spongeCellsperDomain[i]) {
37962 involvedRanks[noInvolvedRanks] = i;
37963 ++noInvolvedRanks;
37964 }
37965 }
37966
37967 MPI_Comm commSponge;
37968 MPI_Group group;
37969 MPI_Group groupSponge;
37970 MPI_Comm_group(mpiComm(), &group, AT_, "group");
37971 MPI_Group_incl(group, noInvolvedRanks, &involvedRanks[0], &groupSponge, AT_);
37972 MPI_Comm_create(mpiComm(), groupSponge, &commSponge, AT_, "commStg");
37973
37974 m_spongeComm = commSponge;
37975 m_spongeCommSize = noInvolvedRanks;
37976
37977 // find all sponge locations locally on ranks containing the comparison plane
37978 if(m_noSpongeCells > 0) {
37979 for(MInt i = 0; i < noInvolvedRanks; i++) {
37980 if(involvedRanks[i] == domainId()) {
37981 m_spongeRank = i;
37982 break;
37983 }
37984 }
37985
37986 m_spongeRoot = involvedRanks[0];
37987
37988 // ======================================================
37989 // 3) Determine global locations in wall-normal direction for spanwise average
37990 // ======================================================
37991 MInt globalNoBcStgLocations = 0;
37992 MInt globalNoBcStgCells = 0;
37993 MPI_Allreduce(&noSpongeLocations, &globalNoBcStgLocations, 1, MPI_INT, MPI_SUM, m_spongeComm, AT_,
37994 "noSpongeLocations", "globalNoBcStgLocations");
37995
37996 MPI_Allreduce(&noSpongeCells, &globalNoBcStgCells, 1, MPI_INT, MPI_SUM, m_spongeComm, AT_, "noSpongeCells",
37997 "globalNoBcStgCells");
37998
37999 // ScratchSpace<MFloat> globalBcStgLocations(globalNoBcStgLocations, "globalBcStgLocations", FUN_);
38000 mAlloc(m_globalBcStgLocationsG, globalNoBcStgLocations, "m_globalBcStgLocationsG", AT_);
38001 if(m_spongeCommSize > 0) {
38002 ScratchSpace<MInt> recvbuf(comm_size, "recvbuf", FUN_);
38003 recvbuf.fill(0);
38004
38005 MPI_Gather(&noSpongeLocations, 1, MPI_INT, &recvbuf[0], 1, MPI_INT, 0, m_spongeComm, AT_, "noSpongeLocations",
38006 "recvbuf");
38007
38008 ScratchSpace<MInt> displs(comm_size, "displspos", FUN_);
38009 if(domainId() == m_spongeRoot) {
38010 MInt offset = 0;
38011 for(MInt dom = 0; dom < comm_size; dom++) {
38012 displs[dom] = offset;
38013 offset += recvbuf[dom];
38014 }
38015 }
38016
38017 MPI_Gatherv(&m_spongeLocations[0], noSpongeLocations, MPI_DOUBLE, &m_globalBcStgLocationsG[0],
38018 &recvbuf[m_spongeRank], &displs[m_spongeRank], MPI_DOUBLE, 0, m_spongeComm, AT_, "m_spongeLocations",
38019 "globalBcStgLocations");
38020
38021 MPI_Bcast(&m_globalBcStgLocationsG[0], globalNoBcStgLocations, MPI_DOUBLE, 0, m_spongeComm, AT_,
38022 "m_globalBcStgLocationsG");
38023
38024 // for broadcasting to all
38025 m_globalNoSpongeLocations = globalNoBcStgLocations;
38026 // if(domainId() == m_spongeRoot){
38027 // mAlloc(m_globalBcStgLocationsG, globalNoBcStgLocations, "m_globalBcStgLocationsG", AT_);
38028 // for(MInt i = 0; i < globalNoBcStgLocations; i++) {
38029 // m_globalBcStgLocationsG[i] = globalBcStgLocations[i];
38030 // }
38031 // }
38032 }
38033 }
38034
38035 // Broadcast sponge root to all
38036 MPI_Allreduce(MPI_IN_PLACE, &m_spongeRoot, 1, MPI_INT, MPI_MAX, mpiComm(), AT_, "MPI_IN_PLACE", "m_spongeRoot");
38037
38038 // Broadcast from sponge root to all
38039 MInt globalNoBcStgLocationsG = 0;
38040 if(m_noSpongeCells > 0) {
38041 globalNoBcStgLocationsG = m_globalNoSpongeLocations;
38042 }
38043 MPI_Allreduce(MPI_IN_PLACE, &globalNoBcStgLocationsG, 1, MPI_INT, MPI_MAX, mpiComm(), AT_, "MPI_IN_PLACE",
38044 "globalNoBcStgLocationsG");
38045
38046 if(m_noSpongeCells == 0) {
38047 mAlloc(m_globalBcStgLocationsG, globalNoBcStgLocationsG, "m_globalBcStgLocationsG", AT_);
38048 }
38049 MPI_Bcast(&m_globalBcStgLocationsG[0], globalNoBcStgLocationsG, MPI_DOUBLE, m_spongeRoot, mpiComm(), AT_,
38050 "m_globalBcStgLocationsG");
38051
38054
38055 for(MInt i = 0; i < globalNoBcStgLocationsG / 2; i++) {
38056 MFloat L1 = m_globalBcStgLocationsG[2 * i + 0];
38057 MFloat L2 = m_globalBcStgLocationsG[2 * i + 1];
38058 auto it =
38059 std::find_if(m_globalSpongeLocations.begin(), m_globalSpongeLocations.end(),
38060 [&L1](const std::pair<MFloat, MFloat>& element) { return approx(element.first, L1, 1e-16); });
38061 if(it == m_globalSpongeLocations.end()) {
38062 m_globalSpongeLocations.push_back(make_pair(L1, L2));
38064 }
38065 }
38066
38068
38069 // ======================================================
38070 // 4) Determine local cells in periodic locations of global wall-normal locations
38071 // ======================================================
38072 if(m_noSpongeCells > 0) {
38073 mAlloc(m_spongeAverageCellId, m_globalNoSpongeLocations, "m_spongeAverageCellId", FUN_);
38074 mAlloc(m_globalNoPeriodicExchangeCells, m_globalNoSpongeLocations, "m_globalNoPeriodicExchangeCells", 0, FUN_);
38075
38076 for(MInt i = 0; i < m_globalNoSpongeLocations; i++) {
38077 m_spongeAverageCellId[i].clear();
38078 }
38079
38080 vector<MInt> noPeriodicExchangeCells(m_globalNoSpongeLocations, F0);
38081
38082 for(MInt i = 0; i < m_globalNoSpongeLocations; i++) {
38083 for(MInt c = 0; c < m_noSpongeCells; c++) {
38085 if(abs(a_coordinate(cellId, m_7901wallDir) - m_globalSpongeLocations[i].first) < 1e-16) {
38086 if(!a_isHalo(cellId)) {
38087 m_spongeAverageCellId[i].push_back(cellId);
38088 ++noPeriodicExchangeCells[i];
38089 }
38090 }
38091 }
38092 }
38093
38094 if(m_spongeCommSize > 0) {
38096 MPI_INT, MPI_SUM, m_spongeComm, AT_, "noPeriodicExchangeCells", "m_globalNoPeriodicExchangeCells");
38097 }
38098 }
38099
38100 mAlloc(m_LESPeriodicAverage, m_LESNoVarAverage, m_globalNoSpongeLocations, "m_LESPeriodicAverage", F0, FUN_);
38101 mAlloc(m_uvErr, m_globalNoSpongeLocations, "m_uvErr", F0, FUN_);
38102 mAlloc(m_uvRans, m_globalNoSpongeLocations, "m_uvRans", F0, FUN_);
38103 mAlloc(m_uvInt, m_globalNoSpongeLocations, "m_uvInt", F0, FUN_);
38104}
std::vector< MFloat > m_spongeLocations
std::vector< MInt > m_spongeCells
int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm, const MString &name, const MString &varname)
same as MPI_Comm_create, but updates the number of MPI communicators
int MPI_Group_incl(MPI_Group group, int n, const int ranks[], MPI_Group *newgroup, const MString &name)
same as MPI_Group_incl
int MPI_Comm_group(MPI_Comm comm, MPI_Group *group, const MString &name, const MString &varname)
same as MPI_Comm_group
int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Gather

◆ initViscousFluxComputation()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initViscousFluxComputation

computes the interpolation constants for the viscous flux computation

Author
Daniel Hartmann, November 17, 2006

Definition at line 22455 of file fvcartesiansolverxd.cpp.

22455 {
22456 TRACE();
22457
22458 const MInt noSrfcs = a_noSurfaces();
22459 MInt nghbrCells[2];
22460 MFloat eps = F1 / FPOW10[10];
22461 MFloat totalDistance, distance;
22462 MFloat factor0, factor1;
22463 //---
22464
22465
22466 // 1) compute the factors 0 and 1 for all surfaces
22467 for(MInt srfcId = 0; srfcId < noSrfcs; srfcId++) {
22468 nghbrCells[0] = a_surfaceNghbrCellId(srfcId, 0);
22469 nghbrCells[1] = a_surfaceNghbrCellId(srfcId, 1);
22470 distance = F0;
22471 totalDistance = F0;
22472 for(MInt i = 0; i < nDim; i++) {
22473 distance += POW2(a_surfaceCoordinate(srfcId, i) - a_coordinate(nghbrCells[0], i));
22474 totalDistance += POW2(a_surfaceCoordinate(srfcId, i) - a_coordinate(nghbrCells[1], i));
22475 }
22476 distance = sqrt(distance);
22477 totalDistance = sqrt(totalDistance) + distance;
22478 factor1 = distance / mMax(eps, totalDistance);
22479 factor0 = F1 - factor1;
22480 a_surfaceFactor(srfcId, 0) = factor0;
22481 a_surfaceFactor(srfcId, 1) = factor1;
22482 }
22483
22485#ifdef _OPENMP
22486#pragma omp parallel for
22487#endif
22488 for(MInt bs = 0; bs < m_fvBndryCnd->m_noBoundarySurfaces; bs++) {
22489 MInt srfcId = m_fvBndryCnd->m_boundarySurfaces[bs];
22490 a_surfaceFactor(srfcId, 0) = F1B2;
22491 a_surfaceFactor(srfcId, 1) = F1B2;
22492 }
22493 }
22494}
MFloat & a_surfaceFactor(const MInt srfcId, const MInt varId)
Returns the factor of surface srfcId for variable varId.

◆ initWMExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initWMExchange
protected

Definition at line 12156 of file fvcartesiansolverxd.cpp.

12156 {
12157 TRACE();
12158
12167
12168 m_wmImgCellIds.clear();
12169 m_wmImgWMSrfcIds.clear();
12170 m_wmImgCoords.clear();
12171
12172 const MInt noPVars = PV->noVariables;
12173 const MInt noWMSurfaces = m_wmSurfaces.size();
12174
12175 std::vector<MFloat> localWMImgCoords;
12176 std::vector<MInt> localWMImgPointRootIds;
12177 std::vector<MInt> localWMSrfcIds;
12178
12179 for(MInt wmSrfcId = 0; wmSrfcId < noWMSurfaces; wmSrfcId++) {
12180 MInt bndryCellId = m_wmSurfaces[wmSrfcId].m_bndryCellId;
12181 MInt bndrySrfcId = m_wmSurfaces[wmSrfcId].m_bndrySrfcId;
12182
12183 for(MInt dim = 0; dim < nDim; dim++) {
12184 MFloat imgCoord = 0.0;
12185 imgCoord += m_bndryCells->a[bndryCellId].m_srfcs[bndrySrfcId]->m_coordinates[dim];
12186 imgCoord += m_wmDistance * m_bndryCells->a[bndryCellId].m_srfcs[bndrySrfcId]->m_normalVector[dim];
12187 localWMImgCoords.push_back(imgCoord);
12188 }
12189 localWMImgPointRootIds.push_back(domainId());
12190 localWMSrfcIds.push_back(wmSrfcId);
12191 }
12192
12193 ScratchSpace<MInt> localNoWMImgPoints(noDomains(), AT_, "localNoWMImgPoints");
12194 localNoWMImgPoints.fill(0);
12195 ScratchSpace<MInt> localNoWMImgCoords(noDomains(), AT_, "localNoWMImgCoords");
12196 localNoWMImgCoords.fill(0);
12197
12198 localNoWMImgPoints[domainId()] = localWMImgPointRootIds.size();
12199
12200 MPI_Allgather(&localNoWMImgPoints[domainId()], 1, MPI_INT, &localNoWMImgPoints[0], 1, MPI_INT, mpiComm(), AT_,
12201 "localNoWMImgPoints", "localNoWMImgPoints");
12202
12203 for(MInt dom = 0; dom < noDomains(); dom++) {
12204 localNoWMImgCoords[dom] = localNoWMImgPoints[dom] * nDim;
12205 }
12206
12207 // sum up all imagePoints to check if there is any imgPoint to be found, otherwise there is probably something wrong
12208 MInt globalNoWMImgPoints = 0;
12209 for(MInt dom = 0; dom < noDomains(); dom++) {
12210 globalNoWMImgPoints += localNoWMImgPoints[dom];
12211 }
12212
12213 if(!(globalNoWMImgPoints > 0)) {
12214 mTerm(-1, "No WM Image Points were found within the entire geometry! Please check if you have assigned any WM-BC "
12215 "in the geometry file");
12216 }
12217
12218 std::vector<std::vector<MInt>> wmImgCellIds;
12219 std::vector<std::vector<MInt>> wmImgWMSrfcIds;
12220 std::vector<std::vector<MFloat>> wmImgCoords;
12221
12222 wmImgCellIds.resize(noDomains());
12223 wmImgWMSrfcIds.resize(noDomains());
12224 wmImgCoords.resize(noDomains());
12225
12226 ScratchSpace<MInt> noWMImgPointsSend(noDomains(), AT_, "noWMImgPointsSend");
12227 noWMImgPointsSend.fill(0);
12228 ScratchSpace<MInt> noWMImgPointsRecv(noDomains(), AT_, "noWMImgPointsRecv");
12229 noWMImgPointsRecv.fill(0);
12230
12231 // now treat all domains sequentially to avoid massive allocation of memory
12232 MInt totalNoWMImgPointsSend = 0;
12233 MInt outsideImagePoints = 0;
12234 for(MInt dom = 0; dom < noDomains(); dom++) {
12235 if(localNoWMImgPoints[dom] == 0) continue; // this domain has no wmBndryCells
12236
12237 // allocate temp memory to communicate the image points to every other domain
12238 ScratchSpace<MFloat> domWMImgCoords(nDim * localNoWMImgPoints[dom], AT_, "domWMImgCoords");
12239 ScratchSpace<MInt> domWMImgPointRootIds(localNoWMImgPoints[dom], AT_, "domWMImgPointRootIds");
12240 ScratchSpace<MInt> domWMSrfcIds(localNoWMImgPoints[dom], AT_, "domWMSrfcIds");
12241
12242 if(domainId() == dom) {
12243 // sending domain, fill array with actual values
12244 for(MInt ip = 0; ip < localNoWMImgPoints[dom]; ip++) {
12245 for(MInt dim = 0; dim < nDim; dim++) {
12246 domWMImgCoords[nDim * ip + dim] = localWMImgCoords[nDim * ip + dim];
12247 }
12248 domWMImgPointRootIds[ip] = localWMImgPointRootIds[ip];
12249 domWMSrfcIds[ip] = localWMSrfcIds[ip];
12250 }
12251 } else {
12252 // receiving domain, fill with dummy values
12253 domWMImgCoords.fill(-9999.9999);
12254 domWMImgPointRootIds.fill(-1);
12255 domWMSrfcIds.fill(-1);
12256 }
12257
12258 // Broadcast coordinates, rootIds and wmSrfcIds to everyone to allow searching
12259 MPI_Bcast(&domWMImgCoords[0], localNoWMImgCoords[dom], MPI_DOUBLE, dom, mpiComm(), AT_, "domWMImgCoords[0]");
12260 MPI_Bcast(&domWMImgPointRootIds[0], localNoWMImgPoints[dom], MPI_INT, dom, mpiComm(), AT_,
12261 "domWMImgPointRootIds[0]");
12262 MPI_Bcast(&domWMSrfcIds[0], localNoWMImgPoints[dom], MPI_INT, dom, mpiComm(), AT_, "domWMSrfcIds[0]");
12263
12264 // now search for image points of dom in the local domain
12265 for(MInt ip = 0; ip < localNoWMImgPoints[dom]; ip++) {
12266 MFloat imgCoords[nDim];
12267 MInt dummyId = -1;
12268 for(MInt dim = 0; dim < nDim; dim++) {
12269 imgCoords[dim] = domWMImgCoords[nDim * ip + dim];
12270 }
12271 dummyId = grid().findContainingLeafCell(imgCoords);
12272 if(dummyId > -1) {
12273 wmImgCellIds[dom].push_back(dummyId);
12274 wmImgWMSrfcIds[dom].push_back(domWMSrfcIds[ip]);
12275 for(MInt dim = 0; dim < nDim; dim++) {
12276 wmImgCoords[dom].push_back(imgCoords[dim]);
12277 }
12279 a_isWMImgCell(dummyId) = true;
12280 noWMImgPointsSend[dom]++;
12281 totalNoWMImgPointsSend++;
12282 if(dom != domainId()) outsideImagePoints++;
12283 }
12284 }
12285
12286 // communicate found points to receiving domain (dom)
12287 MPI_Gather(&noWMImgPointsSend[dom], 1, MPI_INT, &noWMImgPointsRecv[0], 1, MPI_INT, dom, mpiComm(), AT_,
12288 "&noWMImgPointsSend[dom]", "noWMImgPointsRecv[0]");
12289 }
12290
12291 MPI_Allreduce(MPI_IN_PLACE, &outsideImagePoints, 1, MPI_INT, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE",
12292 "outsideImagePoints");
12293
12294 m_log << "initWMExchange() found " << outsideImagePoints << " non-local image points!";
12295
12296 MInt totalNoWMImgPointsRecv = 0;
12297 for(MInt dom = 0; dom < noDomains(); dom++) {
12298 totalNoWMImgPointsRecv += noWMImgPointsRecv[dom];
12299 }
12300
12301 // every domain now knows if it has to send or receive imgPointVars
12302 // we can now create a sub-communicator only containing the relevant ranks
12303 if(totalNoWMImgPointsRecv > 0 || totalNoWMImgPointsSend > 0) {
12304 MPI_Comm_split(mpiComm(), 0, 0, &m_comm_wm, AT_, "m_comm_wm");
12305 MPI_Comm_rank(m_comm_wm, &m_wmDomainId);
12306 MPI_Comm_size(m_comm_wm, &m_wmNoDomains);
12307 } else {
12308 MPI_Comm_split(mpiComm(), MPI_UNDEFINED, 0, &m_comm_wm, AT_, "m_comm_wm");
12309 m_wmDomainId = -1;
12310 m_wmNoDomains = 0;
12311 }
12312
12313 // ranks uninvolved in the wmExchange can now return
12314 if(m_wmDomainId < 0) return;
12315
12316 // =========================================================================
12317 // ===================== ONLY INVOLVED RANKS FROM HERE =====================
12318 // =========================================================================
12319
12320 // to reduce the data structures of the imgPoints we need to map the ranks from m_comm_wm to mpiComm()
12321 ScratchSpace<MInt> wmIdToWorldId(m_wmNoDomains, AT_, "wmIdToWorldId");
12322 MInt domId = domainId();
12323 MPI_Allgather(&domId, 1, MPI_INT, &wmIdToWorldId[0], 1, MPI_INT, m_comm_wm, AT_, "domId", "wmIdToWorldId");
12324
12325 if(totalNoWMImgPointsSend > 0) {
12326 mAlloc(m_wmImgSendBuffer, noPVars * totalNoWMImgPointsSend, "m_wmImgSendBuffer", 0.0, AT_);
12327 }
12328
12329 if(totalNoWMImgPointsRecv > 0) {
12330 mAlloc(m_wmImgRecvBuffer, noPVars * totalNoWMImgPointsRecv, "m_wmImgPointsRecvBuffer", 0.0, AT_);
12331 mAlloc(m_wmImgRecvIdMap, totalNoWMImgPointsRecv, "m_wmImgRecvIdMap", -1, AT_);
12332 }
12333
12337
12338 mAlloc(m_noWMImgPointsSend, m_wmNoDomains, "m_noWMImgPointsSend", 0, AT_);
12339 mAlloc(m_noWMImgPointsRecv, m_wmNoDomains, "m_noWMImgPointsRecv", 0, AT_);
12340 mAlloc(m_mpi_wmRequest, m_wmNoDomains, "m_mpi_wmRequest", AT_);
12341 mAlloc(m_mpi_wmSendReq, m_wmNoDomains, "m_mpi_wmSendReq", AT_);
12342 mAlloc(m_mpi_wmRecvReq, m_wmNoDomains, "m_mpi_wmRecvReq", AT_);
12343
12344 // create reduced data structures in the order of the dedicated wm communicator
12345 for(MInt wmDom = 0; wmDom < m_wmNoDomains; wmDom++) {
12346 const MInt dom = wmIdToWorldId[wmDom];
12347 m_noWMImgPointsSend[wmDom] = noWMImgPointsSend[dom];
12348 m_noWMImgPointsRecv[wmDom] = noWMImgPointsRecv[dom];
12349 for(MInt ip = 0; ip < noWMImgPointsSend[dom]; ip++) {
12350 m_wmImgCellIds[wmDom].push_back(wmImgCellIds[dom][ip]);
12351 m_wmImgWMSrfcIds[wmDom].push_back(wmImgWMSrfcIds[dom][ip]);
12352 for(MInt dim = 0; dim < nDim; dim++) {
12353 m_wmImgCoords[wmDom].push_back(wmImgCoords[dom][nDim * ip + dim]);
12354 }
12355 }
12356 }
12357
12358 // now communicate the receive map by means of the WM communicator
12359 for(MInt wmDom = 0; wmDom < m_wmNoDomains; wmDom++) {
12360 MPI_Issend(&m_wmImgWMSrfcIds[wmDom][0], m_noWMImgPointsSend[wmDom], MPI_INT, wmDom, 0, m_comm_wm,
12361 &m_mpi_wmRequest[wmDom], AT_, "&m_wmImgSrfcIds[wmDom][0]");
12362 }
12363
12364 MPI_Status status;
12365 MInt offset = 0;
12366 for(MInt wmDom = 0; wmDom < m_wmNoDomains; wmDom++) {
12367 MPI_Recv(&m_wmImgRecvIdMap[offset], m_noWMImgPointsRecv[wmDom], MPI_INT, wmDom, 0, m_comm_wm, &status, AT_,
12368 "&m_wmImgRecvIdMap[offset]");
12369 offset += m_noWMImgPointsRecv[wmDom];
12370 }
12371
12372 for(MInt wmDom = 0; wmDom < m_wmNoDomains; wmDom++) {
12373 MPI_Wait(&m_mpi_wmRequest[wmDom], &status, AT_);
12374 }
12375
12376 // set flag in wmBndryCells that an imgCell has been found and a communication mapping has been setup correctly
12377 // cells without an img cell will need special treatment (return 0.0) in the wmViscosity computation.
12378 MInt ipCounter = 0;
12379 for(MInt dom = 0; dom < m_wmNoDomains; dom++) {
12380#ifdef _OPENMP
12381#pragma omp parallel for
12382#endif
12383 for(MInt ip = 0; ip < m_noWMImgPointsRecv[dom]; ip++) {
12384 const MInt wmSrfcId = m_wmImgRecvIdMap[ipCounter + ip];
12385 m_wmSurfaces[wmSrfcId].m_wmHasImgCell = true;
12386 }
12387 ipCounter += m_noWMImgPointsRecv[dom];
12388 }
12389 m_log << "ok." << endl;
12390}
virtual void initInterpolationForCell(const MInt cellId)
Init the interpolation for points inside a given cell (based on interpolateVariables())
std::vector< std::vector< MInt > > m_wmImgWMSrfcIds
MBool a_isWMImgCell(const MInt cellId) const
Returns isWMImgCell of the cell cellId.
int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm, const MString &name, const MString &varname)
same as MPI_Comm_split, but updates the number of MPI communicators

◆ initWMSurfaceProbes()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::initWMSurfaceProbes
protected

Definition at line 12395 of file fvcartesiansolverxd.cpp.

12395 {
12396 TRACE();
12397
12398 // read cell coordinates from property file and find cells
12399 MInt noVars = 13;
12400
12401 MInt noSurfaceProbes = Context::propertyLength("wmSurfaceProbesX", m_solverId);
12402
12403 if(noSurfaceProbes != Context::propertyLength("wmSurfaceProbesZ", m_solverId))
12404 mTerm(1, "no of coordinates for WM Surface probes must be equal for X and Z");
12405
12406 for(MInt p = 0; p < noSurfaceProbes; p++) {
12407 MFloat probeCoord[3] = {0.0, 0.0, 0.0};
12408 probeCoord[0] = Context::getSolverProperty<MFloat>("wmSurfaceProbesX", m_solverId, AT_, &probeCoord[0], p);
12409 probeCoord[2] = Context::getSolverProperty<MFloat>("wmSurfaceProbesZ", m_solverId, AT_, &probeCoord[2], p);
12410
12411 for(MInt bCellId = 0; bCellId < m_bndryCells->size(); bCellId++) {
12412 MInt cellId = m_bndryCells->a[bCellId].m_cellId;
12413 MFloat cellCoord[3] = {0.0, 0.0, 0.0};
12414 for(MInt dim = 0; dim < nDim; dim++) {
12415 cellCoord[dim] = a_coordinate(cellId, dim);
12416 }
12417 if(abs(cellCoord[0] - probeCoord[0]) < F1B2 * c_cellLengthAtLevel(maxRefinementLevel()) + m_eps
12418 && abs(cellCoord[2] - probeCoord[2]) < F1B2 * c_cellLengthAtLevel(maxRefinementLevel()) + m_eps) {
12419 if(!a_isHalo(cellId)) {
12420 for(MInt srfc = 0; srfc < m_bndryCells->a[bCellId].m_noSrfcs; srfc++) {
12421 if(m_bndryCells->a[bCellId].m_srfcs[srfc]->m_bndryCndId == 3399) {
12422 m_wmSurfaceProbeIds.push_back(cellId);
12423 m_wmSurfaceProbeSrfcs.push_back(srfc);
12424 break;
12425 }
12426 }
12427 }
12428 }
12429 }
12430 }
12431
12432 mAlloc(m_wmLocalNoSrfcProbeIds, noDomains(), "m_wmLocalNoSrfcProbeIds", 0, AT_);
12435 AT_, "m_wmLocalNoSrfcProbeIds", "m_wmLocalNoSrfcProbeIds");
12436
12438 for(MInt dom = 0; dom < noDomains(); dom++) {
12440 }
12441
12443 mAlloc(m_wmSrfcProbeSendBuffer, noVars * m_wmLocalNoSrfcProbeIds[domainId()], "m_wmSrfcProbeSendBuffer", 0.0, AT_);
12444 }
12445 if(domainId() == 0) {
12446 mAlloc(m_wmSrfcProbeRecvBuffer, noVars * m_wmGlobalNoSrfcProbeIds, "m_wmSrfcProbeRecvBuffer", 0.0, AT_);
12447 }
12448}
std::vector< MInt > m_wmSurfaceProbeIds
std::vector< MInt > m_wmSurfaceProbeSrfcs

◆ interpolateAzimuthalData()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::interpolateAzimuthalData ( MFloat data,
MInt  offset,
MInt  noVars,
const MFloat vars 
)

◆ interpolateAzimuthalDataReverse()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::interpolateAzimuthalDataReverse ( MFloat data,
MInt  offset,
MInt  noVars,
const MFloat vars 
)

◆ interpolateSurfaceDiffusionFluxOnCellCenter() [1/2]

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::interpolateSurfaceDiffusionFluxOnCellCenter ( MFloat *const   NotUsedJA,
MFloat *const  dtdn 
)

Definition at line 7214 of file fvcartesiansolverxd.cpp.

7215 {
7216 TRACE();
7217
7218 const MInt noDirs = 2 * nDim;
7219 const MUint noPVars = PV->noVariables;
7220 const MUint noSurfaceCoefficients = hasSC ? SC->m_noSurfaceCoefficients : 0;
7221 const MUint surfaceVarMemory = 2 * noPVars;
7222 const MUint noSlopes = nDim * noPVars;
7223
7224 const MInt* const RESTRICT orientations = ALIGNED_I(&a_surfaceOrientation(0));
7225 const MInt* const RESTRICT nghbrCellIds = ALIGNED_I(&a_surfaceNghbrCellId(0, 0));
7226 const MFloat* const RESTRICT surfaceVars = ALIGNED_F(&a_surfaceVariable(0, 0, 0));
7227 const MFloat* const RESTRICT surfaceCoefficients = hasSC ? ALIGNED_F(&a_surfaceCoefficient(0, 0)) : nullptr;
7228 const MFloat* const RESTRICT factor = ALIGNED_F(&a_surfaceFactor(0, 0));
7229 const MFloat* const RESTRICT slope = ALIGNED_F(&a_slope(0, 0, 0));
7230
7231#ifdef _OPENMP
7232#pragma omp parallel for
7233#endif
7234
7235 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
7236 vector<vector<MFloat>> J(noDirs, vector<MFloat>(PV->m_noSpecies, F0));
7237 vector<vector<MFloat>> J_noSoret(noDirs, vector<MFloat>(PV->m_noSpecies, F0));
7238 vector<vector<MFloat>> dXdn(noDirs, vector<MFloat>(PV->m_noSpecies, F0));
7239 vector<vector<MFloat>> dXdn_int(nDim, vector<MFloat>(PV->m_noSpecies, F0));
7240 vector<MFloat> dXH2dn1(2, F0);
7241 vector<MFloat> dTdn(noDirs, F0);
7242 vector<MFloat> DH2(noDirs, F0);
7243 vector<vector<MFloat>> J_int(nDim, vector<MFloat>(PV->m_noSpecies, F0));
7244 vector<vector<MFloat>> J_noSoret_int(nDim, vector<MFloat>(PV->m_noSpecies, F0));
7245 vector<MFloat> dTdn_int(nDim, F0);
7246
7247
7248 for(MInt dir = 0; dir < noDirs; dir++) {
7249 const MInt srfcId = m_cellSurfaceMapping[cellId][dir];
7250 if(srfcId < 0) continue;
7251
7252 ASSERT((nghbrCellIds[2 * srfcId] == cellId) || (nghbrCellIds[2 * srfcId + 1] == cellId), "");
7253
7254 const MUint offset = srfcId * surfaceVarMemory;
7255 const MFloat* const RESTRICT vars0 = ALIGNED_F(surfaceVars + offset);
7256 const MFloat* const RESTRICT vars1 = ALIGNED_F(vars0 + noPVars);
7257 const MFloat f0 = factor[srfcId * 2];
7258 const MFloat f1 = factor[srfcId * 2 + 1];
7259 const MUint offset0 = nghbrCellIds[2 * srfcId] * noSlopes;
7260 const MUint offset1 = nghbrCellIds[2 * srfcId + 1] * noSlopes;
7261 const MFloat* const RESTRICT slope0 = ALIGNED_F(slope + offset0);
7262 const MFloat* const RESTRICT slope1 = ALIGNED_F(slope + offset1);
7263 const MUint coefficientOffset = srfcId * noSurfaceCoefficients;
7264 const MFloat* const RESTRICT srfcCoeff = hasSC ? ALIGNED_F(surfaceCoefficients + coefficientOffset) : nullptr;
7265
7266 sysEqn().getSpeciesDiffusionMassFluxes(orientations[srfcId], vars0, vars1, slope0, slope1, srfcCoeff, f0, f1,
7267 J[dir], dXdn[dir], dTdn[dir], sysEqn().m_soretEffect);
7268 sysEqn().getSpeciesDiffusionMassFluxes(orientations[srfcId], vars0, vars1, slope0, slope1, srfcCoeff, f0, f1,
7269 J_noSoret[dir], dXdn[dir], dTdn[dir], false);
7270 for(MUint s = 0; s < PV->m_noSpecies; s++) {
7271 if(m_speciesName[s] == "H2") DH2[dir] = a_srfcCoeffs(srfcId, SC->D[s]);
7272 if(m_speciesName[s] == "H2" && (dir == 0 || dir == 1)) dXH2dn1[dir] = dXdn[dir][s];
7273 }
7274 }
7275
7276 for(MInt dim = 0; dim < nDim; dim++) {
7277 dTdn_int[dim] = dTdn[2 * dim] + F1B2 * (dTdn[2 * dim + 1] - dTdn[2 * dim]);
7278 dtdn[cellId * nDim + dim] = dTdn_int[dim];
7279 for(MUint s = 0; s < PV->m_noSpecies; s++) {
7280 J_int[dim][s] = J[2 * dim][s] + F1B2 * (J[2 * dim + 1][s] - J[2 * dim][s]);
7281 dXdn_int[dim][s] = dXdn[2 * dim][s] + F1B2 * (dXdn[2 * dim + 1][s] - dXdn[2 * dim][s]);
7282 dXdn[cellId * nDim * PV->m_noSpecies + dim * PV->m_noSpecies + s] = dXdn_int[dim][s];
7283 J[cellId * nDim * PV->m_noSpecies + dim * PV->m_noSpecies + s] = J_int[dim][s];
7284 }
7285 }
7286 }
7287}

◆ interpolateSurfaceDiffusionFluxOnCellCenter() [2/2]

template<MInt nDim_, class SysEqn >
template<class _ = void, std::enable_if_t< isDetChem< SysEqn >, _ * > = nullptr>
void FvCartesianSolverXD< nDim_, SysEqn >::interpolateSurfaceDiffusionFluxOnCellCenter ( MFloat * const  ,
MFloat * const   
)

◆ interpolateVariables()

template<MInt nDim_, class SysEqn >
template<MInt a, MInt b, MBool old>
void FvCartesianSolverXD< nDim_, SysEqn >::interpolateVariables ( const MInt  cellId,
const MFloat position,
MFloat interpolatedVar 
)
Author
Sven Berger
Date
January 2016
Parameters
[in]cellIdid of the cell used for interpolation
[in]positioninterpolation point
[out]interpolatedVararray containing the interpolated variables
  1. Find all direct neighboring cells

2a. if only a low number of neighbors is found use distance weighted averaging

2b. build the least square matrix LSMatrix...

  1. Build rhs and solve the LS problem
  2. determine solution

Definition at line 20319 of file fvcartesiansolverxd.cpp.

20320 {
20321 // TRACE();
20322 ASSERT((b - a) > 0, "ERROR: Difference between b and a needs to be positive!");
20323 ASSERT(cellId >= 0, "ERROR: Invalid cellId!");
20324
20325 const MFloat originX = a_coordinate(cellId, 0);
20326 const MFloat originY = a_coordinate(cellId, 1);
20327 const MFloat originZ = a_coordinate(cellId, 2);
20328
20332 vector<MInt> nghbrList;
20333#ifdef _OPENMP
20334#pragma omp critical
20335#endif
20336 {
20337 if(m_cellToNghbrHood.count(cellId) > 0) {
20338 nghbrList = m_cellToNghbrHood[cellId];
20339 // std::cout << "Old use existing hood with " << nghbrList.size() << " for " << cellId << std::endl;
20340 } else {
20341 findDirectNghbrs(cellId, nghbrList);
20342 // std::cout << "Old find hood with " << nghbrList.size() << std::endl;
20343 if(nghbrList.size() < 12) {
20344 findNeighborHood(cellId, 2, nghbrList);
20345 // std::cout << "Old find better hood with " << nghbrList.size() << std::endl;
20346#ifndef NDEBUG
20347 if(nghbrList.size() < 14) {
20348 cout << "WARNING: Only found " << nghbrList.size() << " neighbors during interpolation!" << endl;
20349 }
20350#endif
20351 }
20352 m_cellToNghbrHood.emplace(make_pair(cellId, nghbrList));
20353 }
20354 }
20355
20356 // std::cout << "Old Interpolation with " << nghbrList.size() << " points" << std::endl;
20357
20358 // check for boundary ghost cells belonging to cells in the neighbor list
20359 // for these cell a pseudoCell element is added, carrying position and velocity
20360 // on the boundary surface
20361 vector<array<MFloat, b - a>> pseudoCellVar(nghbrList.size());
20362 vector<array<MFloat, nDim>> pseudoCellPos(nghbrList.size());
20363
20364 for(MUint nId = 0; nId < nghbrList.size(); nId++) {
20365 const MInt nghbrId = nghbrList[nId];
20366 if(nghbrId >= 0 && a_bndryId(nghbrId) > -1) {
20367 // mark as pseudo cell
20368 nghbrList[nId] = -1;
20369 for(MInt i = 0; i < nDim; i++) {
20370 pseudoCellPos[nId][i] = m_bndryCells->a[a_bndryId(nghbrId)].m_srfcs[0]->m_coordinates[i];
20371 }
20372
20373 // const MInt bndryCndId = m_fvBndryCnd->m_bndryCndIds[a_bndryId(nghbrId)];
20374
20375 for(MInt i = a; i < b; i++) {
20376 // todo labels:FV bndCnd need to be implemented here (assumes bnd result equals cell result)
20377 if(old) {
20378 pseudoCellVar[nId][i - a] = a_oldVariable(cellId, i);
20379 } else {
20380 pseudoCellVar[nId][i - a] = a_variable(cellId, i);
20381 }
20382 }
20383
20384 // if(bndryCndId == 3003){ //no-slip wall
20385 // for(MInt i = a; i < 3; i++){
20386 // pseudoCellVar[nId][i - a] = 0;
20387 // }
20388 // }
20389 }
20390 }
20391 // std::cout << "Old interpolation with " << nghbrList.size() << " points at cell gid " << c_globalId(cellId) <<
20392 // std::endl;
20393 for(MUint nId = 0; nId < nghbrList.size(); nId++) {
20394 const MInt nghbrId = nghbrList[nId];
20395 // const MFloat a0 = 343.203775724;
20396 if(a_bndryId(nghbrId) > -1) {
20397 // std::cout << "Old outside " << pseudoCellVar[nId][0]*a0 << " " << pseudoCellVar[nId][1]*a0 << " " <<
20398 // pseudoCellVar[nId][2]*a0 << std::endl;
20399 } else {
20400 // std::cout << "Old inside " << a_variable(nghbrId,0)*a0 << " " << a_variable(nghbrId,1)*a0 << " " <<
20401 // a_variable(nghbrId,2)*a0 << std::endl;
20402 }
20403 }
20404
20407 if(nghbrList.size() < 10) {
20408 vector<MFloat> dist(nghbrList.size(), 0);
20409 for(MUint nId = 0; nId < nghbrList.size(); nId++) {
20410 const MInt nghbrId = nghbrList[nId];
20411 // calculate distance for each neighbor to the origin
20412 if(nghbrId < 0) {
20413 IF_CONSTEXPR(nDim == 2) {
20414 dist[nId] = POW2(pseudoCellPos[nId][0] - position[0]) + POW2(pseudoCellPos[nId][1] - position[1]);
20415 }
20416 else {
20417 dist[nId] = POW2(pseudoCellPos[nId][0] - position[0]) + POW2(pseudoCellPos[nId][1] - position[1])
20418 + POW2(pseudoCellPos[nId][2] - position[2]);
20419 }
20420 } else {
20421 IF_CONSTEXPR(nDim == 2) {
20422 dist[nId] = POW2(a_coordinate(nghbrId, 0) - position[0]) + POW2(a_coordinate(nghbrId, 1) - position[1]);
20423 }
20424 else {
20425 dist[nId] = POW2(a_coordinate(nghbrId, 0) - position[0]) + POW2(a_coordinate(nghbrId, 1) - position[1])
20426 + POW2(a_coordinate(nghbrId, 2) - position[2]);
20427 }
20428 }
20429 }
20430
20431 MFloat sum = accumulate(dist.begin(), dist.end(), 0.0);
20432
20433 for(MInt k = a; k < b; k++) {
20434 MFloat var = 0;
20435 interpolatedVar[k] = 0.0;
20436
20437 for(MUint nId = 1; nId < nghbrList.size(); nId++) {
20438 const MInt nghbrId = nghbrList[nId];
20439 if(nghbrId < 0) {
20440 var = pseudoCellVar[nId][k - a];
20441 } else {
20442 if(old) {
20443 var = a_oldVariable(nghbrId, k);
20444 } else {
20445 var = a_variable(nghbrId, k);
20446 }
20447 }
20448 interpolatedVar[k] += dist[nId] / sum * var;
20449 }
20450 }
20451
20452#ifndef NDEBUG
20453 // cout << "WARNING: Not enough neighbors found to use LS using weighted averaging instead!" << endl;
20454 m_log << "WARNING: Not enough neighbors found to use LS using weighted averaging instead!" << endl;
20455#endif
20456 } else {
20460 MFloatTensor LSMatrix(2 * nDim + pow(2, nDim - 1), 2 * nDim + pow(2, nDim - 1));
20461 MFloatTensor rhs(2 * nDim + pow(2, nDim - 1));
20462 // MFloatTensor weights(2 * nDim + pow(2, nDim - 1));
20463 MFloatTensor matInv(2 * nDim + pow(2, nDim - 1), 2 * nDim + pow(2, nDim - 1));
20464
20465 LSMatrix.set(0.0);
20466 // weights.set(1.0);
20467 matInv.set(0.0);
20468
20469 MFloat sumX = 0;
20470 MFloat sumY = 0;
20471 MFloat sumZ = 0;
20472 MFloat sumXY = 0;
20473 MFloat sumXZ = 0;
20474 MFloat sumYZ = 0;
20475 MFloat sumX2 = 0;
20476 MFloat sumY2 = 0;
20477 MFloat sumZ2 = 0;
20478 MFloat sumXYZ = 0;
20479 MFloat sumX2Y = 0;
20480 MFloat sumX2Z = 0;
20481 MFloat sumXY2 = 0;
20482 MFloat sumY2Z = 0;
20483 MFloat sumXZ2 = 0;
20484 MFloat sumYZ2 = 0;
20485 MFloat sumX3 = 0;
20486 MFloat sumY3 = 0;
20487 MFloat sumZ3 = 0;
20488 MFloat sumX3Y = 0;
20489 MFloat sumX3Z = 0;
20490 MFloat sumXY3 = 0;
20491 MFloat sumY3Z = 0;
20492 MFloat sumXZ3 = 0;
20493 MFloat sumYZ3 = 0;
20494 MFloat sumX2Y2 = 0;
20495 MFloat sumX2Z2 = 0;
20496 MFloat sumX2YZ = 0;
20497 MFloat sumY2Z2 = 0;
20498 MFloat sumXY2Z = 0;
20499 MFloat sumXYZ2 = 0;
20500 MFloat sumX4 = 0;
20501 MFloat sumY4 = 0;
20502 MFloat sumZ4 = 0;
20503
20504
20505 // 2.1 Calculate intermediate variables
20506 for(MUint nId = 1; nId < nghbrList.size(); nId++) {
20507 MFloat x = 0;
20508 MFloat y = 0;
20509 MFloat z = 0;
20510 const MInt nghbrId = nghbrList[nId];
20511 if(nghbrId < 0) {
20512 x = pseudoCellPos[nId][0] - originX;
20513 y = pseudoCellPos[nId][1] - originY;
20514 IF_CONSTEXPR(nDim == 3) { z = pseudoCellPos[nId][2] - originZ; }
20515 } else {
20516 x = a_coordinate(nghbrId, 0) - originX;
20517 y = a_coordinate(nghbrId, 1) - originY;
20518 IF_CONSTEXPR(nDim == 3) { z = a_coordinate(nghbrId, 2) - originZ; }
20519 }
20520
20521 sumX += x;
20522 sumY += y;
20523 sumZ += z;
20524 sumXY += x * y;
20525 sumXZ += x * z;
20526 sumYZ += y * z;
20527 sumX2 += x * x;
20528 sumY2 += y * y;
20529 sumZ2 += z * z;
20530 sumXYZ += x * y * z;
20531 sumX2Y += x * x * y;
20532 sumX2Z += x * x * z;
20533 sumXY2 += x * y * y;
20534 sumY2Z += y * y * z;
20535 sumXZ2 += z * z * x;
20536 sumYZ2 += z * z * y;
20537 sumX3 += x * x * x;
20538 sumY3 += y * y * y;
20539 sumZ3 += z * z * z;
20540 sumX3Y += x * x * x * y;
20541 sumX3Z += x * x * x * z;
20542 sumXY3 += y * y * y * x;
20543 sumY3Z += y * y * y * z;
20544 sumXZ3 += z * z * z * x;
20545 sumYZ3 += z * z * z * y;
20546 sumX2Y2 += x * x * y * y;
20547 sumX2Z2 += x * x * z * z;
20548 sumX2YZ += x * x * y * z;
20549 sumY2Z2 += y * y * z * z;
20550 sumXY2Z += x * y * y * z;
20551 sumXYZ2 += x * y * z * z;
20552 sumX4 += x * x * x * x;
20553 sumY4 += y * y * y * y;
20554 sumZ4 += z * z * z * z;
20555 }
20556
20557 // 2.2 Use intermediate variables to build LSMatrix
20558 IF_CONSTEXPR(nDim == 2) {
20559 // diagonal
20560 LSMatrix(0, 0) = sumX4;
20561 LSMatrix(1, 1) = sumY4;
20562 LSMatrix(2, 2) = sumX2Y2;
20563 LSMatrix(3, 3) = sumX2;
20564 LSMatrix(4, 4) = sumY2;
20565 LSMatrix(5, 5) = nghbrList.size();
20566
20567 // first column/row
20568 LSMatrix(0, 1) = LSMatrix(1, 0) = sumX2Y2;
20569 LSMatrix(0, 2) = LSMatrix(2, 0) = sumX3Y;
20570 LSMatrix(0, 3) = LSMatrix(3, 0) = sumX3;
20571 LSMatrix(0, 4) = LSMatrix(4, 0) = sumX2Y;
20572 LSMatrix(0, 5) = LSMatrix(5, 0) = sumX2;
20573
20574 // second column/row
20575 LSMatrix(1, 2) = LSMatrix(2, 1) = sumXY3;
20576 LSMatrix(1, 3) = LSMatrix(3, 1) = sumXY2;
20577 LSMatrix(1, 4) = LSMatrix(4, 1) = sumY3;
20578 LSMatrix(1, 5) = LSMatrix(5, 1) = sumY2;
20579
20580 // third column/row
20581 LSMatrix(2, 3) = LSMatrix(3, 2) = sumX2Y;
20582 LSMatrix(2, 4) = LSMatrix(4, 2) = sumXY2;
20583 LSMatrix(2, 5) = LSMatrix(5, 2) = sumXY;
20584
20585 // fourth column/row
20586 LSMatrix(3, 4) = LSMatrix(4, 3) = sumXY;
20587 LSMatrix(3, 5) = LSMatrix(5, 3) = sumX;
20588
20589 // fifth coulmn/row
20590 LSMatrix(4, 5) = LSMatrix(5, 4) = sumY;
20591 }
20592 else {
20593 // diagonal
20594 LSMatrix(0, 0) = sumX4;
20595 LSMatrix(1, 1) = sumY4;
20596 LSMatrix(2, 2) = sumZ4;
20597 LSMatrix(3, 3) = sumX2Y2;
20598 LSMatrix(4, 4) = sumX2Z2;
20599 LSMatrix(5, 5) = sumY2Z2;
20600 LSMatrix(6, 6) = sumX2;
20601 LSMatrix(7, 7) = sumY2;
20602 LSMatrix(8, 8) = sumZ2;
20603 LSMatrix(9, 9) = nghbrList.size();
20604
20605 // first column/row
20606 LSMatrix(0, 1) = LSMatrix(1, 0) = sumX2Y2;
20607 LSMatrix(0, 2) = LSMatrix(2, 0) = sumX2Z2;
20608 LSMatrix(0, 3) = LSMatrix(3, 0) = sumX3Y;
20609 LSMatrix(0, 4) = LSMatrix(4, 0) = sumX3Z;
20610 LSMatrix(0, 5) = LSMatrix(5, 0) = sumX2YZ;
20611 LSMatrix(0, 6) = LSMatrix(6, 0) = sumX3;
20612 LSMatrix(0, 7) = LSMatrix(7, 0) = sumX2Y;
20613 LSMatrix(0, 8) = LSMatrix(8, 0) = sumX2Z;
20614 LSMatrix(0, 9) = LSMatrix(9, 0) = sumX2;
20615
20616 // second column/row
20617 LSMatrix(1, 2) = LSMatrix(2, 1) = sumY2Z2;
20618 LSMatrix(1, 3) = LSMatrix(3, 1) = sumXY3;
20619 LSMatrix(1, 4) = LSMatrix(4, 1) = sumXY2Z;
20620 LSMatrix(1, 5) = LSMatrix(5, 1) = sumY3Z;
20621 LSMatrix(1, 6) = LSMatrix(6, 1) = sumXY2;
20622 LSMatrix(1, 7) = LSMatrix(7, 1) = sumY3;
20623 LSMatrix(1, 8) = LSMatrix(8, 1) = sumY2Z;
20624 LSMatrix(1, 9) = LSMatrix(9, 1) = sumY2;
20625
20626 // third column/row
20627 LSMatrix(2, 3) = LSMatrix(3, 2) = sumXYZ2;
20628 LSMatrix(2, 4) = LSMatrix(4, 2) = sumXZ3;
20629 LSMatrix(2, 5) = LSMatrix(5, 2) = sumYZ3;
20630 LSMatrix(2, 6) = LSMatrix(6, 2) = sumXZ2;
20631 LSMatrix(2, 7) = LSMatrix(7, 2) = sumYZ2;
20632 LSMatrix(2, 8) = LSMatrix(8, 2) = sumZ3;
20633 LSMatrix(2, 9) = LSMatrix(9, 2) = sumZ2;
20634
20635 // fourth column, fourth line
20636 LSMatrix(3, 4) = LSMatrix(4, 3) = sumX2YZ;
20637 LSMatrix(3, 5) = LSMatrix(5, 3) = sumXY2Z;
20638 LSMatrix(3, 6) = LSMatrix(6, 3) = sumX2Y;
20639 LSMatrix(3, 7) = LSMatrix(7, 3) = sumXY2;
20640 LSMatrix(3, 8) = LSMatrix(8, 3) = sumXYZ;
20641 LSMatrix(3, 9) = LSMatrix(9, 3) = sumXY;
20642
20643 // fifth coulmn, fifth line
20644 LSMatrix(4, 5) = LSMatrix(5, 4) = sumXYZ2;
20645 LSMatrix(4, 6) = LSMatrix(6, 4) = sumX2Z;
20646 LSMatrix(4, 7) = LSMatrix(7, 4) = sumXYZ;
20647 LSMatrix(4, 8) = LSMatrix(8, 4) = sumXZ2;
20648 LSMatrix(4, 9) = LSMatrix(9, 4) = sumXZ;
20649
20650 // sixth column, sixth line
20651 LSMatrix(5, 6) = LSMatrix(6, 5) = sumXYZ;
20652 LSMatrix(5, 7) = LSMatrix(7, 5) = sumY2Z;
20653 LSMatrix(5, 8) = LSMatrix(8, 5) = sumYZ2;
20654 LSMatrix(5, 9) = LSMatrix(9, 5) = sumYZ;
20655
20656 // seventh column, seventh line
20657 LSMatrix(6, 7) = LSMatrix(7, 6) = sumXY;
20658 LSMatrix(6, 8) = LSMatrix(8, 6) = sumXZ;
20659 LSMatrix(6, 9) = LSMatrix(9, 6) = sumX;
20660
20661 // eigth column, eigth line
20662 LSMatrix(7, 8) = LSMatrix(8, 7) = sumYZ;
20663 LSMatrix(7, 9) = LSMatrix(9, 7) = sumY;
20664
20665 // nineth column, nineth line
20666 LSMatrix(8, 9) = LSMatrix(9, 8) = sumZ;
20667 }
20668
20669 // 2.3 scale solution since the condition number gets really bad for large discrepancies in cell size
20670 const MFloat normalizationFactor = FPOW2(2 * a_level(cellId)) / c_cellLengthAtLevel(0);
20671 for(MInt i = 0; i < 2 * nDim + pow(2, nDim - 1); i++) {
20672 for(MInt j = 0; j < 2 * nDim + pow(2, nDim - 1); j++) {
20673 LSMatrix(i, j) *= normalizationFactor;
20674 }
20675 }
20676
20677 // 2.4 determine the pseudoinverse using SVD
20678 maia::math::invert(LSMatrix, matInv, 2 * nDim + pow(2, nDim - 1), 2 * nDim + pow(2, nDim - 1));
20679
20683 for(MInt k = a; k < b; k++) {
20684 MFloat sumVar = 0;
20685 if(old) {
20686 sumVar = a_oldVariable(cellId, k);
20687 } else {
20688 sumVar = a_variable(cellId, k);
20689 }
20690 MFloat sumVarX = 0;
20691 MFloat sumVarY = 0;
20692 MFloat sumVarZ = 0;
20693 MFloat sumVarXY = 0;
20694 MFloat sumVarXZ = 0;
20695 MFloat sumVarYZ = 0;
20696 MFloat sumVarX2 = 0;
20697 MFloat sumVarY2 = 0;
20698 MFloat sumVarZ2 = 0;
20699
20700 rhs.set(0.0);
20701
20702 // 3.1 Calculate intermediate variables
20703 for(MUint nId = 1; nId < nghbrList.size(); nId++) {
20704 MFloat x = 0;
20705 MFloat y = 0;
20706 MFloat z = 0;
20707 MFloat var = 0;
20708 const MInt nghbrId = nghbrList[nId];
20709 if(nghbrId < 0) {
20710 x = pseudoCellPos[nId][0] - originX;
20711 y = pseudoCellPos[nId][1] - originY;
20712 var = pseudoCellVar[nId][k - a];
20713
20714 IF_CONSTEXPR(nDim == 3) { z = pseudoCellPos[nId][2] - originZ; }
20715 } else {
20716 x = a_coordinate(nghbrId, 0) - originX;
20717 y = a_coordinate(nghbrId, 1) - originY;
20718 if(old) {
20719 var = a_oldVariable(nghbrId, k);
20720 } else {
20721 var = a_variable(nghbrId, k);
20722 }
20723 IF_CONSTEXPR(nDim == 3) { z = a_coordinate(nghbrId, 2) - originZ; }
20724 }
20725
20726 sumVar += var;
20727 sumVarX += var * x;
20728 sumVarY += var * y;
20729 sumVarZ += var * z;
20730 sumVarXY += var * x * y;
20731 sumVarXZ += var * x * z;
20732 sumVarYZ += var * y * z;
20733 sumVarX2 += var * x * x;
20734 sumVarY2 += var * y * y;
20735 sumVarZ2 += var * z * z;
20736 }
20737
20738 // 3.2 assign intermediate variables to rhs
20739 IF_CONSTEXPR(nDim == 2) {
20740 rhs[0] = sumVarX2;
20741 rhs[1] = sumVarY2;
20742 rhs[2] = sumVarXY;
20743 rhs[3] = sumVarX;
20744 rhs[4] = sumVarY;
20745 rhs[5] = sumVar;
20746 }
20747 else {
20748 rhs(0) = sumVarX2;
20749 rhs(1) = sumVarY2;
20750 rhs(2) = sumVarZ2;
20751 rhs(3) = sumVarXY;
20752 rhs(4) = sumVarXZ;
20753 rhs(5) = sumVarYZ;
20754 rhs(6) = sumVarX;
20755 rhs(7) = sumVarY;
20756 rhs(8) = sumVarZ;
20757 rhs(9) = sumVar;
20758 }
20759
20760 // 3.3 scale rhs
20761 for(MInt i = 0; i < 2 * nDim + pow(2, nDim - 1); i++) {
20762 rhs(i) *= normalizationFactor;
20763 }
20764
20765 MFloatTensor coeff(2 * nDim + pow(2, nDim - 1));
20766 coeff.set(0.0);
20767
20768 // 3.4 determine coefficients of the aim function polynomial
20769 for(MInt i = 0; i < 2 * nDim + pow(2, nDim - 1); i++) {
20770 for(MInt j = 0; j < 2 * nDim + pow(2, nDim - 1); j++) {
20771 coeff(i) += matInv(i, j) * rhs(j);
20772 }
20773 }
20774
20778 MFloat positionX = position[0] - originX;
20779 MFloat positionY = position[1] - originY;
20780 MFloat positionZ = 0;
20781 IF_CONSTEXPR(nDim == 3) { positionZ = position[2] - originZ; }
20782 MFloat result = coeff((MInt)(2 * nDim + pow(2, nDim - 1) - 1));
20783 IF_CONSTEXPR(nDim == 2) {
20784 result += coeff(0) * positionX * positionX;
20785 result += coeff(1) * positionY * positionY;
20786 result += coeff(2) * positionX * positionY;
20787 result += coeff(3) * positionX;
20788 result += coeff(4) * positionY;
20789 }
20790 else {
20791 result += coeff(0) * positionX * positionX;
20792 result += coeff(1) * positionY * positionY;
20793 result += coeff(2) * positionZ * positionZ;
20794 result += coeff(3) * positionX * positionY;
20795 result += coeff(4) * positionX * positionZ;
20796 result += coeff(5) * positionY * positionZ;
20797 result += coeff(6) * positionX;
20798 result += coeff(7) * positionY;
20799 result += coeff(8) * positionZ;
20800 }
20801
20802 interpolatedVar[k - a] = result;
20803 }
20804 }
20805
20806 // TRACE_OUT();
20807}
std::map< MInt, std::vector< MInt > > m_cellToNghbrHood

◆ interpolateVariablesInCell()

template<MInt nDim_, class SysEqn >
template<MInt a, MInt b>
void FvCartesianSolverXD< nDim_, SysEqn >::interpolateVariablesInCell ( const MInt  cellId,
const MFloat position,
std::function< MFloat(MInt, MInt)>  variables,
MFloat result 
)
  1. Build rhs and solve the LS problem
  2. determine solution

Definition at line 21122 of file fvcartesiansolverxd.cpp.

21124 {
21125 ASSERT((b - a) > 0, "ERROR: Difference between b and a needs to be positive!");
21126 ASSERT(cellId >= 0, "ERROR: Invalid cellId!");
21127
21128 const MInt interpIndex = m_cellInterpolationIndex[cellId];
21129 if(interpIndex < 0) {
21130 mTerm(1, "Interpolation for cell not initialized");
21131 /* std::cerr << "Interpolation for cell " << cellId << " not initialized." << std::endl; */
21132 // interpolateVariables<a, b>(cellId, position, variables, interpolatedVar);
21133 /* return; */
21134 }
21135
21136 const MFloat originX = a_coordinate(cellId, 0);
21137 const MFloat originY = a_coordinate(cellId, 1);
21138 MFloat originZ = 0.0;
21139 IF_CONSTEXPR(nDim == 3) { originZ = a_coordinate(cellId, 2); }
21140
21141 const MFloat normalizationFactor = FPOW2(2 * a_level(cellId)) / grid().cellLengthAtLevel(0);
21142
21143 const MInt noNghbrs = m_cellInterpolationIds[interpIndex].size();
21144 const MInt* const nghbrList = &m_cellInterpolationIds[interpIndex][0];
21145
21146 const MInt matSize = 2 * nDim + pow(2, nDim - 1);
21147 MFloatTensor interpMatInv(&m_cellInterpolationMatrix[interpIndex][0], matSize, matSize);
21148
21152 MFloat rhs[10];
21153 MFloat coeff[10];
21154
21155 for(MInt k = a; k < b; k++) {
21156 MFloat sumVar = variables(cellId, k);
21157 MFloat sumVarX = 0;
21158 MFloat sumVarY = 0;
21159 MFloat sumVarZ = 0;
21160 MFloat sumVarXY = 0;
21161 MFloat sumVarXZ = 0;
21162 MFloat sumVarYZ = 0;
21163 MFloat sumVarX2 = 0;
21164 MFloat sumVarY2 = 0;
21165 MFloat sumVarZ2 = 0;
21166
21167 std::fill_n(&rhs[0], matSize, 0.0);
21168
21169 // 3.1 Calculate intermediate variables
21170 for(MInt nId = 1; nId < noNghbrs; nId++) {
21171 const MInt nghbrId = nghbrList[nId];
21172 const MFloat x = a_coordinate(nghbrId, 0) - originX;
21173 const MFloat y = a_coordinate(nghbrId, 1) - originY;
21174 const MFloat var = variables(nghbrId, k);
21175 MFloat z = 0.0;
21176 IF_CONSTEXPR(nDim == 3) { z = a_coordinate(nghbrId, 2) - originZ; }
21177
21178 const MFloat varX = var * x;
21179 const MFloat varY = var * y;
21180 const MFloat varZ = var * z;
21181
21182 sumVar += var;
21183 sumVarX += varX;
21184 sumVarY += varY;
21185 sumVarZ += varZ;
21186
21187 sumVarXY += varX * y;
21188 sumVarXZ += varX * z;
21189 sumVarYZ += varY * z;
21190
21191 sumVarX2 += varX * x;
21192 sumVarY2 += varY * y;
21193 sumVarZ2 += varZ * z;
21194 }
21195
21196 // 3.2 assign intermediate variables to rhs
21197 IF_CONSTEXPR(nDim == 2) {
21198 rhs[0] = sumVarX2;
21199 rhs[1] = sumVarY2;
21200 rhs[2] = sumVarXY;
21201 rhs[3] = sumVarX;
21202 rhs[4] = sumVarY;
21203 rhs[5] = sumVar;
21204 }
21205 else {
21206 rhs[0] = sumVarX2;
21207 rhs[1] = sumVarY2;
21208 rhs[2] = sumVarZ2;
21209
21210 rhs[3] = sumVarXY;
21211 rhs[4] = sumVarXZ;
21212 rhs[5] = sumVarYZ;
21213
21214 rhs[6] = sumVarX;
21215 rhs[7] = sumVarY;
21216 rhs[8] = sumVarZ;
21217 rhs[9] = sumVar;
21218 }
21219
21220 // 3.3 scale rhs
21221 for(MInt i = 0; i < matSize; i++) {
21222 rhs[i] *= normalizationFactor;
21223 }
21224
21225 std::fill_n(&coeff[0], matSize, 0.0);
21226
21227 // 3.4 determine coefficients of the aim function polynomial
21228 for(MInt i = 0; i < matSize; i++) {
21229 for(MInt j = 0; j < matSize; j++) {
21230 coeff[i] += interpMatInv(i, j) * rhs[j];
21231 }
21232 }
21233
21237 const MFloat positionX = position[0] - originX;
21238 const MFloat positionY = position[1] - originY;
21239 MFloat positionZ = 0.0;
21240 IF_CONSTEXPR(nDim == 3) { positionZ = position[2] - originZ; }
21241
21242 MFloat result = coeff[matSize - 1];
21243 IF_CONSTEXPR(nDim == 2) {
21244 result += coeff[0] * positionX * positionX;
21245 result += coeff[1] * positionY * positionY;
21246 result += coeff[2] * positionX * positionY;
21247 result += coeff[3] * positionX;
21248 result += coeff[4] * positionY;
21249 }
21250 else {
21251 result += coeff[0] * positionX * positionX;
21252 result += coeff[1] * positionY * positionY;
21253 result += coeff[2] * positionZ * positionZ;
21254 result += coeff[3] * positionX * positionY;
21255 result += coeff[4] * positionX * positionZ;
21256 result += coeff[5] * positionY * positionZ;
21257 result += coeff[6] * positionX;
21258 result += coeff[7] * positionY;
21259 result += coeff[8] * positionZ;
21260 }
21261
21262 interpolatedVar[k - a] = result;
21263 }
21264}

◆ interpolateWallNormalPointVars()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::interpolateWallNormalPointVars ( MInt  var,
MFloat  coords[],
MInt  localId,
std::vector< MInt neighborList 
)
protected

Definition at line 35067 of file fvcartesiansolverxd.cpp.

35068 {
35069 TRACE();
35070
35071 m_log << "Interpolate Wall Normal Point Variables ... " << endl;
35072
35073 MFloat result = -99999999.9;
35074 const MInt tmpId = localId;
35075 MFloat pointCoords[nDim];
35076 // inizialize interpolation matrix
35077 MFloatTensor LMatrix(nDim + 1, nDim + 1);
35078 MFloatTensor InverseMatrix(nDim + 1, nDim + 1);
35079
35080 LMatrix.set(0.0);
35081 InverseMatrix.set(0.0);
35082 MFloat originX = 0.0;
35083 MFloat originY = 0.0;
35084 MFloat originZ = 0.0;
35085
35086 std::vector<MInt> neghbrIds;
35087 neghbrIds.clear();
35088 neghbrIds = neighborList;
35089 const MInt noNeghbrs = neghbrIds.size();
35090
35091 // if list is to short for interpolation just return variable value
35092 if(noNeghbrs < ((nDim + 1) * 2)) {
35093 return a_pvariable(tmpId, variable);
35094 }
35095 // when the wrong list is identified, search for neighbors again
35096 if(!neghbrIds.empty() && neghbrIds.back() != tmpId) {
35097 cout << "WrongList " << endl;
35098 neghbrIds = findWallNormalNeighbors(tmpId);
35099 }
35100
35101 originX = a_coordinate(tmpId, 0);
35102 originY = a_coordinate(tmpId, 1);
35103 pointCoords[0] = coords[0];
35104 pointCoords[1] = coords[1];
35105
35106 if(nDim == 3) {
35107 originZ = a_coordinate(tmpId, 2);
35108 pointCoords[2] = coords[2];
35109 }
35110
35111 // setup interpolation matrix and vector
35112 if(tmpId != -1) {
35113 MFloat sumX = 0.0;
35114 MFloat sumY = 0.0;
35115 MFloat sumZ = 0.0;
35116 MFloat sumXY = 0.0;
35117 MFloat sumXZ = 0.0;
35118 MFloat sumYZ = 0.0;
35119 MFloat sumX2 = 0.0;
35120 MFloat sumY2 = 0.0;
35121 MFloat sumZ2 = 0.0;
35122 MFloat sumVar = 0.0;
35123 MFloat sumVarX = 0.0;
35124 MFloat sumVarY = 0.0;
35125 MFloat sumVarZ = 0.0;
35126
35127 for(MInt nId = 0; nId < noNeghbrs; nId++) {
35128 MFloat x = 0.0;
35129 MFloat y = 0.0;
35130 MFloat z = 0.0;
35131
35132 const MInt tmpNeghbrId = neghbrIds[nId];
35133 if(tmpNeghbrId < 0) {
35134 mTerm(1, "neighborId < 0 during normal point interpolation");
35135 }
35136
35137 x = a_coordinate(tmpNeghbrId, 0) - originX;
35138 y = a_coordinate(tmpNeghbrId, 1) - originY;
35139 if(nDim == 3) {
35140 z = a_coordinate(tmpNeghbrId, 2) - originZ;
35141 }
35142
35143 const MFloat var = a_pvariable(tmpNeghbrId, variable);
35144 sumX += x;
35145 sumY += y;
35146 sumZ += z;
35147 sumXY += x * y;
35148 sumXZ += x * z;
35149 sumYZ += y * z;
35150 sumX2 += x * x;
35151 sumY2 += y * y;
35152 sumZ2 += z * z;
35153 sumVar += var;
35154 sumVarX += var * x;
35155 sumVarY += var * y;
35156 sumVarZ += var * z;
35157 }
35158
35159 // fill matrix
35160 if(nDim == 2) {
35161 LMatrix(0, 0) = noNeghbrs;
35162 LMatrix(1, 1) = sumX2;
35163 LMatrix(2, 2) = sumY2;
35164
35165 LMatrix(0, 1) = LMatrix(1, 0) = sumX;
35166 LMatrix(0, 2) = LMatrix(2, 0) = sumY;
35167
35168 LMatrix(1, 2) = LMatrix(2, 1) = sumXY;
35169 } else {
35170 LMatrix(0, 0) = noNeghbrs;
35171 LMatrix(1, 1) = sumX2;
35172 LMatrix(2, 2) = sumY2;
35173 LMatrix(3, 3) = sumZ2;
35174
35175 LMatrix(0, 1) = LMatrix(1, 0) = sumX;
35176 LMatrix(0, 2) = LMatrix(2, 0) = sumY;
35177 LMatrix(0, 3) = LMatrix(3, 0) = sumZ;
35178
35179 LMatrix(1, 2) = LMatrix(2, 1) = sumXY;
35180 LMatrix(1, 3) = LMatrix(3, 1) = sumXZ;
35181
35182 LMatrix(2, 3) = LMatrix(3, 2) = sumYZ;
35183 }
35184
35185 MFloat normFactor = FPOW2(2 * a_level(tmpId)) / grid().cellLengthAtLevel(0);
35186
35187 for(MInt i = 0; i < nDim + 1; i++) {
35188 for(MInt j = 0; j < nDim + 1; j++) {
35189 LMatrix(i, j) *= normFactor;
35190 }
35191 }
35192
35193 maia::math::invert(LMatrix, InverseMatrix, nDim + 1, nDim + 1);
35194
35195
35196 // setup right hand side vector
35197 MFloat rightVector[4];
35198 MFloat coeffVector[4];
35199 std::fill_n(&rightVector[0], nDim + 1, 0.0);
35200 std::fill_n(&coeffVector[0], nDim + 1, 0.0);
35201
35202 rightVector[0] = sumVar;
35203 rightVector[1] = sumVarX;
35204 rightVector[2] = sumVarY;
35205 if(nDim == 3) {
35206 rightVector[3] = sumVarZ;
35207 }
35208
35209 for(MInt i = 0; i < nDim + 1; i++) {
35210 rightVector[i] *= normFactor;
35211 }
35212
35213 for(MInt i = 0; i < nDim + 1; i++) {
35214 for(MInt j = 0; j < nDim + 1; j++) {
35215 coeffVector[i] += InverseMatrix(i, j) * rightVector[j];
35216 }
35217 }
35218
35219 result = coeffVector[0] + coeffVector[1] * (pointCoords[0] - originX) + coeffVector[2] * (pointCoords[1] - originY);
35220 if(nDim == 3) {
35221 result += coeffVector[3] * (pointCoords[2] - originZ);
35222 }
35223 }
35224 // return interpolated variable value
35225 return result;
35226}

◆ isMultilevel()

template<MInt nDim_, class SysEqn >
constexpr MBool FvCartesianSolverXD< nDim_, SysEqn >::isMultilevel ( ) const
inlineconstexpr

Definition at line 2095 of file fvcartesiansolverxd.h.

2095{ return m_multilevel; }
MBool m_multilevel
Stores whether this solver is part of a multilevel computation.

◆ isMultilevelLowestSecondary()

template<MInt nDim_, class SysEqn >
constexpr MBool FvCartesianSolverXD< nDim_, SysEqn >::isMultilevelLowestSecondary ( ) const
inlineconstexpr

Definition at line 2100 of file fvcartesiansolverxd.h.

◆ isMultilevelPrimary()

template<MInt nDim_, class SysEqn >
constexpr MBool FvCartesianSolverXD< nDim_, SysEqn >::isMultilevelPrimary ( ) const
inlineconstexpr

Definition at line 2098 of file fvcartesiansolverxd.h.

2098{ return isMultilevel() && m_isMultilevelPrimary; }
MBool m_isMultilevelPrimary
Stores whether this solver is the primary solver (i.e., it has the finshest mesh) of a multilevel com...

◆ isZonal()

template<MInt nDim_, class SysEqn >
constexpr MBool FvCartesianSolverXD< nDim_, SysEqn >::isZonal ( ) const
inlineconstexpr

Definition at line 2105 of file fvcartesiansolverxd.h.

2105{ return m_zonal; }

◆ lhsBnd()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::lhsBnd
inline
Author
Sven Berger
Template Parameters
nDim
Parameters
lhsBndTimerId

Definition at line 10257 of file fvcartesiansolverxd.cpp.

10257 {
10258 TRACE();
10259
10260 RECORD_TIMER_START(m_timers[Timers::TimeInt]);
10261 RECORD_TIMER_START(m_timers[Timers::LhsBnd]);
10262
10263#if defined _MB_DEBUG_ || !defined NDEBUG
10264 checkDiv();
10265#endif
10266
10267 if(m_noSpecies > 0) {
10268 scalarLimiter();
10269 }
10270
10271 RECORD_TIMER_START(m_timers[Timers::SmallCellCorr]);
10273 RECORD_TIMER_STOP(m_timers[Timers::SmallCellCorr]);
10275
10276#if defined _MB_DEBUG_
10277 checkDiv();
10278#endif
10279
10280 RECORD_TIMER_START(m_timers[Timers::ComputePV]);
10281 computePV();
10282 RECORD_TIMER_STOP(m_timers[Timers::ComputePV]);
10283
10284 RECORD_TIMER_START(m_timers[Timers::Exchange]);
10285 // periodic exchange (azimuthal periodicity concept)
10286 if(m_periodicCells == 3) {
10287 exchange();
10289 }
10290
10291 // Cut-off cells are used for azimuthal reconstruction and for non cbc boundaries not part of smallcellcorrection
10292 if(grid().azimuthalPeriodicity()) {
10295 for(MInt cellId = 0; cellId < c_noCells(); cellId++) {
10296 if(a_hasProperty(cellId, SolverCell::IsCutOff)) {
10297 sysEqn().computeConservativeVariables(&a_pvariable(cellId, 0), &a_variable(cellId, 0), 0);
10298 }
10299 }
10300 }
10301 }
10302
10303 if(g_splitMpiComm) {
10304 RECORD_TIMER_START(m_tcomm);
10305 RECORD_TIMER_START(m_texchange);
10307 RECORD_TIMER_STOP(m_texchange);
10308 RECORD_TIMER_STOP(m_tcomm);
10309 } else {
10310 exchange();
10311 }
10312 RECORD_TIMER_STOP(m_timers[Timers::Exchange]);
10313
10314 // periodic exchange (azimuthal periodicity concept)
10315 if(m_periodicCells == 1 || m_periodicCells == 2) {
10316 RECORD_TIMER_START(m_timers[Timers::CutOff]);
10318 RECORD_TIMER_STOP(m_timers[Timers::CutOff]);
10319
10320 RECORD_TIMER_START(m_timers[Timers::Exchange]);
10322 RECORD_TIMER_STOP(m_timers[Timers::Exchange]);
10323 }
10324
10325 if(!g_splitMpiComm) {
10326 // Note: if anything here is changed, make sure to apply the same changes in
10327 // lhsBndFinish()
10329 // return command for non-combustion computations
10330
10331 RECORD_TIMER_START(m_timers[Timers::CutOff]);
10333 RECORD_TIMER_STOP(m_timers[Timers::CutOff]);
10334
10335 RECORD_TIMER_START(m_timers[Timers::BndryCnd]);
10337 RECORD_TIMER_STOP(m_timers[Timers::BndryCnd]);
10338
10340 // return command for non-combustion computations
10341 // solver->computeConservativeVariables();
10342
10343 // Compute the cell center slopes here if changed slope calculation
10344 // activated
10345 if(calcSlopesAfterStep()) {
10346 RECORD_TIMER_STOP(m_timers[Timers::LhsBnd]);
10347
10348 RECORD_TIMER_START(m_timers[Timers::Rhs]);
10349 RECORD_TIMER_START(m_timers[Timers::Muscl]);
10350
10351 RECORD_TIMER_START(m_timers[Timers::MusclReconst]);
10353 RECORD_TIMER_STOP(m_timers[Timers::MusclReconst]);
10354
10355 // copy the slopes from the master to the slave cells
10356 RECORD_TIMER_START(m_timers[Timers::MusclCopy]);
10357 m_fvBndryCnd->copySlopesToSmallCells();
10358 RECORD_TIMER_STOP(m_timers[Timers::MusclCopy]);
10359
10360 // update the ghost cell slopes for reconstruction of the primitive variables
10361 // on the surfaces for the AUSM scheme
10362 RECORD_TIMER_START(m_timers[Timers::MusclGhostSlopes]);
10364 RECORD_TIMER_STOP(m_timers[Timers::MusclGhostSlopes]);
10365
10366 RECORD_TIMER_START(m_timers[Timers::MusclCutSlopes]);
10368 RECORD_TIMER_STOP(m_timers[Timers::MusclCutSlopes]);
10369 // m_fvBndryCnd->updateGhostCellSlopesViscous();
10370
10371 RECORD_TIMER_STOP(m_timers[Timers::Muscl]);
10372 RECORD_TIMER_STOP(m_timers[Timers::Rhs]);
10373
10374 RECORD_TIMER_START(m_timers[Timers::LhsBnd]);
10375 }
10376 }
10377
10378 RECORD_TIMER_STOP(m_timers[Timers::LhsBnd]);
10379 RECORD_TIMER_STOP(m_timers[Timers::TimeInt]);
10380}
virtual void updateSplitParentVariables()
virtual void smallCellCorrection(const MInt timerId=-1)
Flux-redistribution method Apply a stable correction to small-cells and redistribute the defective fl...

◆ lhsBndFinish()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::lhsBndFinish
inline
Author
Ansgar Niemoeller (ansgar) a.nie.nosp@m.moel.nosp@m.ler@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2016-11-05

Definition at line 10178 of file fvcartesiansolverxd.cpp.

10178 {
10179 TRACE();
10180
10181 RECORD_TIMER_START(m_timers[Timers::TimeInt]);
10182 RECORD_TIMER_START(m_timers[Timers::LhsBnd]);
10183
10184 if(!g_splitMpiComm) {
10185 mTerm(1, "lhsBndFinish() should only be used with split MPI communication "
10186 "(splitMpiComm) activated.");
10187 }
10188
10189 RECORD_TIMER_START(m_timers[Timers::Exchange]);
10190
10191 RECORD_TIMER_START(m_tcomm);
10192 RECORD_TIMER_START(m_texchange);
10194 RECORD_TIMER_STOP(m_texchange);
10195 RECORD_TIMER_STOP(m_tcomm);
10196
10197 RECORD_TIMER_STOP(m_timers[Timers::Exchange]);
10198
10199 // These are the remaining calls in lhsBnd() that need to be executed after
10200 // the data exchange finished
10201 // Note: if anything here is changed, make sure to apply the same changes in
10202 // lhsBnd()
10204
10205 RECORD_TIMER_START(m_timers[Timers::CutOff]);
10207 RECORD_TIMER_STOP(m_timers[Timers::CutOff]);
10208
10209 RECORD_TIMER_START(m_timers[Timers::BndryCnd]);
10211 RECORD_TIMER_STOP(m_timers[Timers::BndryCnd]);
10212
10214
10215 // Compute the cell center slopes here if changed slope calculation activated
10216 if(calcSlopesAfterStep()) {
10217 RECORD_TIMER_STOP(m_timers[Timers::LhsBnd]);
10218
10219 RECORD_TIMER_START(m_timers[Timers::Rhs]);
10220 RECORD_TIMER_START(m_timers[Timers::Muscl]);
10221
10222 RECORD_TIMER_START(m_timers[Timers::MusclReconst]);
10224 RECORD_TIMER_STOP(m_timers[Timers::MusclReconst]);
10225
10226 // copy the slopes from the master to the slave cells
10227 RECORD_TIMER_START(m_timers[Timers::MusclCopy]);
10228 m_fvBndryCnd->copySlopesToSmallCells();
10229 RECORD_TIMER_STOP(m_timers[Timers::MusclCopy]);
10230
10231 // update the ghost cell slopes for reconstruction of the primitive variables
10232 // on the surfaces for the AUSM scheme
10233 RECORD_TIMER_START(m_timers[Timers::MusclGhostSlopes]);
10235 RECORD_TIMER_STOP(m_timers[Timers::MusclGhostSlopes]);
10236
10237 RECORD_TIMER_START(m_timers[Timers::MusclCutSlopes]);
10239 RECORD_TIMER_STOP(m_timers[Timers::MusclCutSlopes]);
10240 // m_fvBndryCnd->updateGhostCellSlopesViscous();
10241
10242 RECORD_TIMER_STOP(m_timers[Timers::Muscl]);
10243 RECORD_TIMER_STOP(m_timers[Timers::Rhs]);
10244
10245 RECORD_TIMER_START(m_timers[Timers::LhsBnd]);
10246 }
10247
10248 RECORD_TIMER_STOP(m_timers[Timers::LhsBnd]);
10249 RECORD_TIMER_STOP(m_timers[Timers::TimeInt]);
10250}

◆ limitWeights()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::limitWeights ( MFloat weights)
override
Author
Tim Wegmann

Definition at line 23939 of file fvcartesiansolverxd.cpp.

23939 {
23940 TRACE();
23941
23942 if(m_limitWeights) {
23943 ASSERT(m_weightInactiveCell, "");
23945 weights[count] = mMax(weights[count], 0.01 * weights[0]);
23946 }
23947}

◆ linearInterpolation()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::linearInterpolation ( MInt  child,
MInt  cellId,
MInt stencilCellIds 
)

interpolates all variables to child using the stencil support of three cells: cellId, stencilCellIds[ 0 ], stencilCellIds[ 1 ]

Author
Daniel Hartmann

Definition at line 22336 of file fvcartesiansolverxd.cpp.

22336 {
22337 TRACE();
22338
22339 MInt noCVars = CV->noVariables;
22340 MFloat coordinates[3 * nDim];
22341 MFloat parameter[3];
22342 MFloat ratio;
22343
22344 // shift coordinates such that the coordinates of cellId are (0,0)
22345 for(MInt spaceId = 0; spaceId < nDim; spaceId++) {
22346 coordinates[spaceId] = a_coordinate(child, spaceId) - a_coordinate(cellId, spaceId);
22347 coordinates[nDim + spaceId] = a_coordinate(stencilCellIds[0], spaceId) - a_coordinate(cellId, spaceId);
22348 coordinates[2 * nDim + spaceId] = a_coordinate(stencilCellIds[1], spaceId) - a_coordinate(cellId, spaceId);
22349 }
22350
22351 // interpolate
22352 for(MInt varId = 0; varId < noCVars; varId++) {
22353 parameter[2] = a_variable(cellId, varId);
22354
22355 if(approx(coordinates[2 * nDim], 0.0, MFloatEps)) {
22356 parameter[1] = (a_variable(stencilCellIds[1], varId) - a_variable(cellId, varId)) / coordinates[2 * nDim + 1];
22357 } else {
22358 ratio = coordinates[2 * nDim] / coordinates[nDim];
22359 parameter[1] = (parameter[2] * (ratio - 1.) + a_variable(stencilCellIds[1], varId)
22360 - a_variable(stencilCellIds[0], varId) * ratio)
22361 / (coordinates[2 * nDim + 1] - coordinates[nDim + 1] * ratio);
22362 }
22363
22364 if(approx(coordinates[nDim + 1], 0.0, MFloatEps)) {
22365 parameter[0] = (a_variable(stencilCellIds[0], varId) - a_variable(cellId, varId)) / coordinates[nDim];
22366 } else {
22367 parameter[0] = (a_variable(stencilCellIds[0], varId) - parameter[2] - parameter[1] * coordinates[nDim + 1])
22368 / coordinates[nDim];
22369 }
22370
22371 a_variable(child, varId) = parameter[0] * coordinates[0] + parameter[1] * coordinates[1] + parameter[2];
22372 }
22373}

◆ loadGridFlowVarsPar()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::loadGridFlowVarsPar ( const MChar fileName)
protectedvirtual
Todo:
labels:FV,IO include the function in an IO class, but write it for general use, see saveGridFlowVars(Pars)Par()

Definition at line 18246 of file fvcartesiansolverxd.cpp.

18246 {
18247 TRACE();
18248
18249 IF_CONSTEXPR(nDim != 2 && nDim != 3) {
18250 cerr << " In global function loadGridFlowVarsPar: wrong number of "
18251 "dimensions !"
18252 << endl;
18253 mTerm(1, AT_);
18254 return;
18255 }
18256
18257 // File loading.
18258 stringstream variables;
18259
18260 using namespace maia;
18261 using namespace parallel_io;
18262 ParallelIo parallelIo(fileName, maia::parallel_io::PIO_READ, mpiComm());
18263
18264 // This should be the same for all the variables
18265 ParallelIo::size_type dimLen = noInternalCells();
18266 ParallelIo::size_type start = domainOffset(domainId()) - grid().bitOffset();
18267
18268 // set offset for all read operations
18269 parallelIo.setOffset(dimLen, start);
18270
18271 // load variable names
18272 static constexpr MInt maxVariables = 128;
18273 array<MString, maxVariables> varNames;
18274
18275 for(MInt vId = 0; vId < maxVariables; vId++) {
18276 MString varName = "variables" + to_string(vId);
18277
18278 if(!parallelIo.hasDataset(varName)) {
18279 break;
18280 }
18281
18282 MString tmp;
18283 parallelIo.getAttribute(&tmp, "name", varName);
18284 varNames[vId] = tmp;
18285 }
18286
18287 auto varPosition = [&](const MString& _varName) {
18288 auto it = find(varNames.begin(), varNames.end(), _varName);
18289 if(it == varNames.end()) {
18290 mTerm(-1, "Couldn't find variable with name " + _varName + " for solver " + to_string(m_solverId));
18291 }
18292 return "variables" + to_string(distance(varNames.begin(), it));
18293 };
18294
18295 auto hasVar = [&](const MString& _varName) {
18296 auto it = find(varNames.begin(), varNames.end(), _varName);
18297 return !(it == varNames.end());
18298 };
18299
18300 // Load our variables
18301 MFloatScratchSpace tmpVar((MInt)dimLen, AT_, "tmpVar");
18302
18303 // Velocity u
18304 parallelIo.readArray(tmpVar.getPointer(), varPosition("u"));
18305 for(MInt i = 0; i < (MInt)dimLen; ++i) {
18306 a_pvariable(i, PV->U) = tmpVar.p[i];
18307 }
18308
18309 // Velocity v
18310 parallelIo.readArray(tmpVar.getPointer(), varPosition("v"));
18311 for(MInt i = 0; i < (MInt)dimLen; ++i) {
18312 a_pvariable(i, PV->V) = tmpVar.p[i];
18313 }
18314
18315 // Density rho
18316 parallelIo.readArray(tmpVar.getPointer(), varPosition("rho"));
18317 for(MInt i = 0; i < (MInt)dimLen; ++i) {
18318 a_pvariable(i, PV->RHO) = tmpVar.p[i];
18319 }
18320
18321 // pressure p
18322 parallelIo.readArray(tmpVar.getPointer(), varPosition("p"));
18323 for(MInt i = 0; i < (MInt)dimLen; ++i) {
18324 a_pvariable(i, PV->P) = tmpVar.p[i];
18325 }
18326
18327 // RANS
18328 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) {
18329 for(MInt r = 0; r < m_noRansEquations; r++) {
18330 parallelIo.readArray(tmpVar.getPointer(), varPosition(m_variablesName[nDim + 2 + r]));
18331 for(MInt i = 0; i < (MInt)dimLen; ++i) {
18332 a_pvariable(i, PV->NN[r]) = tmpVar.p[i];
18333 }
18334 }
18335 }
18336
18337 if(m_combustion) {
18338 if(m_noSpecies > 1) {
18339 mTerm(-1, "code is incorrect!");
18340 }
18341
18342 // species
18343 IF_CONSTEXPR(hasPV_C<SysEqn>::value)
18344 if(m_noSpecies == 1) {
18345 parallelIo.readArray(tmpVar.getPointer(), varPosition("c"));
18346 for(MInt i = 0; i < (MInt)dimLen; ++i) {
18347 a_pvariable(i, PV->C) = tmpVar.p[i];
18348 }
18349 }
18351 // heat release rate
18352 parallelIo.readArray(tmpVar.getPointer(), varPosition("h"));
18353 for(MInt i = 0; i < (MInt)dimLen; ++i) {
18354 m_heatRelease[i] = tmpVar.p[i];
18355 }
18356 }
18357 } else {
18358 if(m_localTS && hasVar("localTS")) {
18359 parallelIo.readArray(tmpVar.getPointer(), varPosition("localTS"));
18360 for(MInt i = 0; i < (MInt)dimLen; ++i) {
18361 a_localTimeStep(i) = tmpVar.p[i];
18362 }
18363 }
18364 if(m_noSpecies == 1 && hasVar("Y")) {
18365 parallelIo.readArray(tmpVar.getPointer(), varPosition("Y"));
18366 for(MInt i = 0; i < (MInt)dimLen; ++i) {
18367 a_pvariable(i, PV->Y[0]) = tmpVar.p[i];
18368 }
18369 } else {
18370 for(MInt s = 0; s < m_noSpecies; s++) {
18371 MString tmpString = "Y" + m_speciesName[s];
18372 if(hasVar(tmpString)) {
18373 parallelIo.readArray(tmpVar.getPointer(), varPosition(tmpString));
18374 for(MInt i = 0; i < (MInt)dimLen; ++i) {
18375 a_pvariable(i, PV->Y[s]) = tmpVar.p[i];
18376 }
18377 }
18378 }
18379 }
18380 }
18381
18382 IF_CONSTEXPR(nDim == 3) {
18383 // Velocity w
18384 parallelIo.readArray(tmpVar.getPointer(), varPosition("w"));
18385 for(MInt i = 0; i < (MInt)dimLen; ++i) {
18386 a_pvariable(i, PV->W) = tmpVar.p[i];
18387 }
18388
18389 // Load vorticity data if used for averaging (but not for moving average)
18391 mTerm(-666, "fix calls see above");
18392
18393 parallelIo.readArray(&m_vorticity[0][0], "variables5", 3);
18394 parallelIo.readArray(&m_vorticity[0][1], "variables6", 3);
18395 parallelIo.readArray(&m_vorticity[0][2], "variables7", 3);
18396 }
18397 }
18398 else {
18399 // Load vorticity data if used for averaging (but not for moving average)
18401 mTerm(-666, "fix calls see above");
18402 parallelIo.readArray(&m_vorticity[0][0], "variables4");
18403 }
18404 }
18405
18406 // Getting solution parameters.
18407 parallelIo.getAttribute(&m_noSamples, "noSamples");
18408
18410 parallelIo.getAttribute(&globalTimeStep, "globalTimeStep");
18412 parallelIo.getAttribute(&m_physicalTime, "time");
18413 } else {
18414 parallelIo.getAttribute(&m_time, "time");
18415 }
18416 parallelIo.getAttribute(&m_timeStep, "timeStep");
18417 parallelIo.getAttribute(&m_physicalTime, "physicalTime");
18418 }
18419
18421 mTerm(1, AT_,
18422 "the time-step from the restart file will be used but its equal to -1. That might not do what you think "
18423 "it "
18424 "does...");
18425 }
18426
18427 if(m_restartBc2800) {
18428 parallelIo.getAttribute(&m_restartTimeBc2800, "restartTimeBc2800");
18429 }
18430
18431 parallelIo.getAttribute(&m_noTimeStepsBetweenSamples, "noTimeStepsBetweenSamples");
18432
18433 // ncmpi_inq_varid(ncId, "forcing", &varId);
18434 // ncmpi_get_vara_int_all(ncId, varId, &start, &cnt, &m_forcing);
18435
18436 if(parallelIo.hasAttribute("meanPressure")) {
18437 parallelIo.getAttribute(&m_meanPressure, "meanPressure");
18438 m_log << "meanPressure is" << m_meanPressure << endl;
18439 }
18440
18441 if(m_jet || m_confinedFlame) {
18442 parallelIo.getAttribute(&m_jetDensity, "jetDensity");
18443 m_log << "jetDensity is" << m_jetDensity << endl;
18444
18445 parallelIo.getAttribute(&m_jetPressure, "jetPressure");
18446 m_log << "jetPressure is" << m_jetPressure << endl;
18447
18448 parallelIo.getAttribute(&m_jetTemperature, "jetTemperature");
18449 m_log << "jetTemperature is" << m_jetTemperature << endl;
18450 }
18451
18452 if(parallelIo.hasAttribute("Re", "")) {
18453 parallelIo.getAttribute(&m_Re, "Re");
18454 parallelIo.getAttribute(&sysEqn().m_Re0, "Re0");
18455 parallelIo.getAttribute(&m_randomDeviceSeed, "randomDeviceSeed");
18456 if(domainId() == 0) m_log << "Read Reynolds number: " << m_Re << " (" << sysEqn().m_Re0 << ")." << endl;
18457 }
18458
18460}
MBool useTimeStepFromRestartFile() const
Returns true if the time-step from a restart file should be reused.
static MString printSelfReport()
Returns a shortened string summing up the scratch space state information.
Definition: scratch.cpp:129
const MInt PIO_READ
Definition: parallelio.h:40
Namespace for auxiliary functions/classes.

◆ loadLESAverage()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::loadLESAverage

Definition at line 37695 of file fvcartesiansolverxd.cpp.

37695 {
37696 TRACE();
37697
37698 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
37699
37700 stringstream fn;
37701 fn.clear();
37703 fn << restartDir() << "restartLESAverage" << m_solverId;
37704 } else {
37705 fn << restartDir() << "restartLESAverage" << m_solverId << "_" << globalTimeStep;
37706 }
37707 fn << ParallelIo::fileExt();
37708
37709 MString fileName = fn.str();
37710
37711 if(domainId() == 0) {
37712 cerr << "loading LES average restart file " << fn.str() << "...";
37713 }
37714
37715 using namespace maia::parallel_io;
37716 ParallelIo parallelIo(fileName, PIO_READ, mpiComm());
37717
37718 ParallelIo::size_type size = 0;
37719 ParallelIo::size_type start = 0;
37720 ParallelIo::size_type count = 0;
37721
37722 size = parallelIo.getArraySize("avgCellIds");
37723
37724 start = 0;
37725 count = size;
37726
37727 vector<MLong> avgCellIds((MInt)size, -1);
37728 ScratchSpace<MFloat> LESVar((MInt)size, AT_, "LESVar");
37729
37730 parallelIo.setOffset(count, start);
37731 parallelIo.readArray(&avgCellIds[0], "avgCellIds");
37732
37733 for(MInt var = 0; var < m_LESNoVarAverage; var++) {
37734 MString s = "LESAverageVar" + to_string(var);
37735 parallelIo.readArray(&LESVar[0], s);
37736
37737 for(MInt c = 0; c < (MInt)m_LESAverageCells.size(); c++) {
37739
37740 if(a_isBndryGhostCell(cellId)) continue;
37741
37742 MLong gCellId = (MLong)c_globalId(cellId);
37743 vector<MLong>::iterator findLESGlobalId = find(avgCellIds.begin(), avgCellIds.end(), gCellId);
37744 if(findLESGlobalId != avgCellIds.end()) {
37745 MInt dist = std::distance(avgCellIds.begin(), findLESGlobalId);
37746 m_LESVarAverage[var][c] = LESVar[dist];
37747 }
37748 }
37749 }
37750
37751 // set bndryGhostCells
37752 for(MInt c = 0; c < (MInt)m_LESAverageCells.size(); c++) {
37754 if(a_isBndryCell(cellId)) {
37755 // find corresponding bndryGhostCell and set the value according to BC
37756 for(MInt nghbr = 0; nghbr < a_noReconstructionNeighbors(cellId); nghbr++) {
37757 const MInt recNghbrId = a_reconstructionNeighborId(cellId, nghbr);
37758 if(a_isBndryGhostCell(recNghbrId)) {
37759 vector<MInt>::iterator findBndryGhostId =
37760 find(m_LESAverageCells.begin(), m_LESAverageCells.end(), recNghbrId);
37761 if(findBndryGhostId != m_LESAverageCells.end()) {
37762 MInt index = std::distance(m_LESAverageCells.begin(), findBndryGhostId);
37763
37764 // set values (TODO: only for wall-BC implemented for now)
37765 for(MInt var = 0; var < noVariables(); var++) {
37766 m_LESVarAverage[var][index] = -m_LESVarAverage[var][c];
37767 }
37768 for(MInt var = noVariables(); var < m_LESNoVarAverage; var++) {
37769 m_LESVarAverage[var][index] = m_LESVarAverage[var][c];
37770 }
37771 }
37772 }
37773 }
37774 }
37775 }
37776
37777 if(domainId() == 0) {
37778 cerr << "done" << endl;
37779 }
37780}

◆ loadOldVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::loadOldVariables ( const MString fileName)
protectedvirtual

Definition at line 18466 of file fvcartesiansolverxd.cpp.

18466 {
18467 TRACE();
18468 IF_CONSTEXPR(!hasE<SysEqn>)
18469 mTerm(1, AT_, "Not compatible with SysEqn without RHO_E!");
18470
18471 ParallelIo parallelIo(fileName, maia::parallel_io::PIO_READ, mpiComm());
18472 parallelIo.setOffset(noInternalCells(), domainOffset(domainId()));
18473
18474 MFloatScratchSpace buffer(noInternalCells(), AT_, "buffer");
18475 IF_CONSTEXPR(nDim == 2) {
18476 // rho*e
18477 parallelIo.readArray(&buffer[0], "variables7");
18478 for(MInt i = 0; i < noInternalCells(); i++) {
18479 a_oldVariable(i, CV->RHO_E) = buffer[i];
18480 }
18481 // rho*u
18482 parallelIo.readArray(&buffer[0], "variables8");
18483 for(MInt i = 0; i < noInternalCells(); i++) {
18484 a_oldVariable(i, CV->RHO_VV[0]) = buffer[i];
18485 }
18486 // rho*v
18487 parallelIo.readArray(&buffer[0], "variables9");
18488 for(MInt i = 0; i < noInternalCells(); i++) {
18489 a_oldVariable(i, CV->RHO_VV[1]) = buffer[i];
18490 }
18491 // rho
18492 parallelIo.readArray(&buffer[0], "variables10");
18493 for(MInt i = 0; i < noInternalCells(); i++) {
18494 a_oldVariable(i, CV->RHO) = buffer[i];
18495 }
18496
18497 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) {
18498 for(MInt rans = 1; rans < (m_noRansEquations + 1); rans++) {
18499 MString varname = "variables" + to_string(10 + rans);
18500 parallelIo.readArray(&buffer[0], varname);
18501 for(MInt i = 0; i < noInternalCells(); i++) {
18502 a_oldVariable(i, CV->RHO_NN[rans]) = buffer[i];
18503 }
18504 }
18505 }
18506 }
18507 else IF_CONSTEXPR(nDim == 3) {
18508 // rho*e
18509 parallelIo.readArray(&buffer[0], "variables8");
18510 for(MInt i = 0; i < noInternalCells(); i++) {
18511 a_oldVariable(i, CV->RHO_E) = buffer[i];
18512 }
18513 // rho*u
18514 parallelIo.readArray(&buffer[0], "variables9");
18515 for(MInt i = 0; i < noInternalCells(); i++) {
18516 a_oldVariable(i, CV->RHO_VV[0]) = buffer[i];
18517 }
18518 // rho*v
18519 parallelIo.readArray(&buffer[0], "variables10");
18520 for(MInt i = 0; i < noInternalCells(); i++) {
18521 a_oldVariable(i, CV->RHO_VV[1]) = buffer[i];
18522 }
18523 // rho*w
18524 parallelIo.readArray(&buffer[0], "variables11");
18525 for(MInt i = 0; i < noInternalCells(); i++) {
18526 a_oldVariable(i, CV->RHO_VV[2]) = buffer[i];
18527 }
18528 // rho
18529 parallelIo.readArray(&buffer[0], "variables12");
18530 for(MInt i = 0; i < noInternalCells(); i++) {
18531 a_oldVariable(i, CV->RHO) = buffer[i];
18532 }
18533 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) {
18534 for(MInt rans = 1; rans < (m_noRansEquations + 1); rans++) {
18535 MString varname = "variables" + to_string(12 + rans);
18536 parallelIo.readArray(&buffer[0], varname);
18537 for(MInt i = 0; i < noInternalCells(); i++) {
18538 a_oldVariable(i, CV->RHO_NN[rans]) = buffer[i];
18539 }
18540 }
18541 }
18542 }
18543 else {
18544 mTerm(1, "bad number of dimensions");
18545 }
18546}

◆ loadRestartFile()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::loadRestartFile
overridevirtual

Loads the restart files

Author
: D. Hartmann, May 24, 2006

Reimplemented from Solver.

Definition at line 18132 of file fvcartesiansolverxd.cpp.

18132 {
18133 TRACE();
18134
18135 {
18136 stringstream varFileName; // gridFileName
18137 //---
18138
18140 // gridFileName << restartDir() << "restartGrid_" << domainId() << ParallelIo::fileExt();
18141 if(m_multipleFvSolver) {
18142 varFileName << restartDir() << "restartVariables" << m_solverId << ParallelIo::fileExt();
18143 } else {
18144 varFileName << restartDir() << "restartVariables" << ParallelIo::fileExt();
18145 }
18146 } else {
18147 // TODO labels:FV,toremove remove this, globalTimeStep should not be changed by any solver!
18149
18150 // gridFileName << restartDir() << "restartGrid_" << globalTimeStep << "_" << domainId() <<
18151 // ParallelIo::fileExt();
18152 if(!isMultilevel()) {
18153 if(m_multipleFvSolver) {
18154 varFileName << restartDir() << "restartVariables" << m_solverId << "_" << globalTimeStep
18155 << ParallelIo::fileExt();
18156 } else {
18157 varFileName << restartDir() << "restartVariables_" << globalTimeStep << ParallelIo::fileExt();
18158 }
18159 } else {
18160 // For multilevel, use solver-specific file name for restart files
18161 const MInt maxLength = 256;
18162 array<MChar, maxLength> buffer{};
18163 snprintf(buffer.data(), maxLength, "restart_b%02d_t%08d", solverId(), globalTimeStep);
18164 varFileName << restartDir() << MString(buffer.data()) << ParallelIo::fileExt();
18165 }
18166 }
18167
18168 m_log << "loading primitive variables ... ";
18169 loadGridFlowVarsPar((varFileName.str()).c_str());
18170
18171 // Load oldVariable data
18173 m_log << "loading old variables..." << endl;
18174 loadOldVariables(varFileName.str());
18175 }
18176
18180 stringstream errorMessage;
18181 m_log << "globalTimeStep unequal m_restartTimeStep!" << endl;
18182 m_log << "globalTimeStep = " << globalTimeStep << " and m_restartTimeStep = " << m_restartTimeStep << endl;
18183 m_log << "abort!" << endl;
18184 errorMessage << "globalTimeStep unequal m_restartTimeStep!" << endl;
18185 errorMessage << "globalTimeStep = " << globalTimeStep << " and m_restartTimeStep = " << m_restartTimeStep
18186 << endl;
18187 errorMessage << "abort!" << endl;
18188 // mTerm(1,AT_,errorMessage.str());
18189 }
18190 } else {
18192 // stringstream backupFileName;
18193 // backupFileName << "cp " << varFileName.str() << " " << restartDir() << "restartVariables_" << globalTimeStep
18194 // << ParallelIo::fileExt(); system( (backupFileName.str()).c_str() );
18195 }
18196 }
18197 m_log << "ok" << endl;
18198
18199 exchangeAll();
18200
18201 if(m_changeMa) {
18202 m_log << "convert primitive restart variables ( " << m_previousMa << " ) to the Mach number " << m_Ma << "..."
18203 << endl;
18205 m_log << "ok" << endl;
18206 }
18207 if(m_combustion) { // needed when level set grid is not matching the flow grid at the boundaries
18209 // needed if you use more than two layers
18210 exchangeAll();
18212 }
18213
18214 m_log << "computing conservative variables (only on internal cells)... "; // will be updated on all active cells
18215 // (halo cells included) in the
18216 // RungeKutta constructor
18218 m_log << "ok" << endl;
18219
18221 m_log << "Resetting old variables..." << endl;
18222 if(domainId() == 0) std::cout << "FVSolver: Resetting old variables..." << endl;
18223
18224 std::copy_n(&a_variable(0, 0), a_noCells() * CV->noVariables, &a_oldVariable(0, 0));
18225 }
18226
18228 m_log << "restart at time step: " << globalTimeStep << " - solution physical time: " << m_physicalTime << endl;
18229 } else {
18230 m_log << "restart at time step: " << globalTimeStep << " - solution time: " << m_time << endl;
18231 }
18232 m_log << m_noSamples << " samples read" << endl;
18233
18235 }
18236}
virtual void loadGridFlowVarsPar(const MChar *fileName)
This function loads the flow information of the cells such as variables and attributes like u_velocit...
virtual void convertPrimitiveRestartVariables()
converts the primitive restart variables to a new Mach Number
virtual void loadOldVariables(const MString &fileName)
This function loads oldVariable data from a restartFile-type file.
static MString printSelf()
Returns a string summing up the scratch state information and all scratch space elements information.
Definition: scratch.cpp:106

◆ loadRestartMaterial()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::loadRestartMaterial ( )
inlineprotectedvirtual

Definition at line 2211 of file fvcartesiansolverxd.h.

2211{};

◆ loadRestartTime()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::loadRestartTime ( const MChar fileName,
MInt globalTimeStepInput,
MFloat timeInput,
MFloat physicalTimeInput 
)
protected

Definition at line 8565 of file fvcartesiansolverxd.cpp.

8566 {
8567 TRACE();
8568
8569 ParallelIo parallelIo(fileName, maia::parallel_io::PIO_READ, MPI_COMM_SELF);
8570
8571 CartesianNetcdf CN;
8572 // ----------------------------------------------------------
8573
8574 // --------------------------------------------------------------
8575 // Read solution parameters
8576 // number of samples used for averaging
8577
8578 // global time step
8579 parallelIo.getAttribute(&globalTimeStepInput, CN.globalTimeStep);
8580 // solution time
8581 parallelIo.getAttribute(&timeInput, CN.time);
8582 // physical time
8583 parallelIo.getAttribute(&physicalTimeInput, CN.physicalTime);
8584}
define the names of all variables and attributes in the netcdf file
const MChar * time
const MChar * globalTimeStep
const MChar * physicalTime

◆ loadSampleVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::loadSampleVariables ( MInt  timeStep)
Author
A. Niemoeller
Date
11.12.2013

loads the variables from a restartFile for a given timeStep

Parameters
[in]timeSteptimestep of restartfile

Definition at line 8758 of file fvcartesiansolverxd.cpp.

8758 {
8759 m_loadSampleVariables = true;
8762 m_loadSampleVariables = false;
8763}

◆ loadSpongeData()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::loadSpongeData

Definition at line 38393 of file fvcartesiansolverxd.cpp.

38393 {
38394 TRACE();
38395
38396 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
38397
38398 if(m_spongeRank > -1 && domainId() == m_spongeRoot) {
38399 stringstream fn;
38400 fn.clear();
38402 fn << restartDir() << "stgSpongeData";
38403 } else {
38404 fn << restartDir() << "stgSpongeData_" << globalTimeStep;
38405 }
38406 fn << ".txt";
38407
38408 MString fname = fn.str();
38409
38410 cerr << "Loading STG sponge data at " << globalTimeStep << " ..";
38411
38412 ifstream spongeData;
38413 spongeData.open(fname);
38414
38415 vector<double> data(3);
38416 char ch;
38417 MFloat num;
38418
38419 while(spongeData >> num) {
38420 data.push_back(num);
38421 spongeData >> ch;
38422 }
38423
38424 // MInt count = 0;
38425 if(m_globalSpongeLocations.size() == 0) {
38426 cerr << "ERROR in loading sponge data" << endl;
38427 return;
38428 }
38429 MInt dataCount = 0;
38430 for(MInt i = 0; i < m_globalNoSpongeLocations; i++) {
38431 for(unsigned int d = 0; d < data.size() - 3; d++) {
38432 // read wall normal position and compare it to calculated wall positions
38433 if(d % 3 == 0) {
38434 // Interpolation
38435 if((data[d] <= m_globalSpongeLocations[i].first || approx(data[d], m_globalSpongeLocations[i].first, 1e-8))
38436 && (data[d + 3] >= m_globalSpongeLocations[i].first
38437 || approx(data[d + 3], m_globalSpongeLocations[i].first, 1e-8))) {
38438 m_uvInt[i] =
38439 data[d + 2]
38440 + (data[d + 5] - data[d + 2]) / (data[d + 3] - data[d]) * (m_globalSpongeLocations[i].first - data[d]);
38441 dataCount++;
38442 }
38443 }
38444 }
38445 }
38446
38447 // check if all data was correctly read
38448 if(dataCount != m_globalNoSpongeLocations) {
38449 cerr << "not all data was correctly read" << endl;
38450 cerr << "read data count: " << dataCount << ", should be: " << m_globalNoSpongeLocations << endl;
38451 }
38452
38453 spongeData.close();
38454
38455 cerr << "ok" << endl;
38456 }
38457
38458 // commuicate data to all ranks
38459 if(m_spongeRank > -1 && m_spongeCommSize > 0) {
38460 MPI_Allreduce(MPI_IN_PLACE, &m_uvInt[0], m_globalNoSpongeLocations, MPI_DOUBLE, MPI_SUM, m_spongeComm, AT_,
38461 "MPI_IN_PLACE", "m_uvInt");
38462 }
38463}

◆ LSReconstructCellCenter()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::LSReconstructCellCenter
virtual

NOTE: m_noSpecies is a run-time variable. The point of the if case is to encourage the compiler to produce optimized loops for the special cases.

Definition at line 18743 of file fvcartesiansolverxd.cpp.

18743 {
18744 TRACE();
18745 const MInt noSpecies = m_noSpecies;
18746 if(noSpecies == 0) {
18747 LSReconstructCellCenter_(0);
18748 } else if(noSpecies == 1) {
18749 LSReconstructCellCenter_(1);
18750 } else {
18751 LSReconstructCellCenter_(noSpecies);
18752 }
18753}

◆ LSReconstructCellCenter_Boundary()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::LSReconstructCellCenter_Boundary
virtual

needed if boundary condition has to be applied iteratively to reduce the computational overhead

Author
Claudia Guenther, April 2010

Definition at line 25455 of file fvcartesiansolverxd.cpp.

25455 {
25456 TRACE();
25457
25458 const MInt noCells = m_fvBndryCnd->m_bndryCells->size();
25459 const MInt noPVars = PV->noVariables;
25460 const MInt noSlopes = nDim * noPVars;
25461 const MInt slopeMemory = m_slopeMemory;
25462 MInt j, cellId, linkedCell;
25463 MFloat* slope = (MFloat*)(&(a_slope(0, 0, 0)));
25464 MInt reconstructionDataLocation, nghbrId;
25465 MInt recCellId;
25466 //---
25467
25468 // reset the slopes on the boundary cells
25469 for(MInt bndryId = 0; bndryId < noCells; bndryId++) {
25470 cellId = m_fvBndryCnd->m_bndryCells->a[bndryId].m_cellId;
25471 j = slopeMemory * cellId;
25472 for(MInt i = 0; i < noSlopes; i++) {
25473 slope[j + i] = F0;
25474 }
25475 }
25476
25477 // compute the slopes on all boundary cells on the respective computing level
25478 for(MInt bndryId = 0; bndryId < noCells; bndryId++) {
25479 cellId = m_fvBndryCnd->m_bndryCells->a[bndryId].m_cellId;
25480 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
25481 continue;
25482 }
25483 linkedCell = m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId;
25484 recCellId = cellId;
25485 if(linkedCell > -1) { // use master cell reconstruction neighbors and constants!
25486 recCellId = linkedCell;
25487 }
25488 reconstructionDataLocation = a_reconstructionData(recCellId);
25489 for(MInt nghbr = 0; nghbr < a_noReconstructionNeighbors(recCellId); nghbr++) {
25490 nghbrId = a_reconstructionNeighborId(recCellId, nghbr);
25491 for(MInt var = 0; var < noPVars; var++) {
25492 for(MInt i = 0; i < nDim; i++) {
25493 a_slope(cellId, var, i) += m_reconstructionConstants[nDim * reconstructionDataLocation + i]
25494 * (a_pvariable(nghbrId, var) - a_pvariable(recCellId, var));
25495 }
25496 }
25497 reconstructionDataLocation++;
25498 }
25499 }
25500}

◆ LSReconstructCellCenterCons()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::LSReconstructCellCenterCons ( const MUint  noSpecies)

Determine gradients of conservative variables at cell centers and store in a_storedSlope.

Author
Michael Schlottke-Lakemper (mic) mic@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2018-12-12

Copied from/based on src/fvsolverxd.h::FvCartesianSolverXD::LSReconstructCellCenter(...)

Definition at line 18763 of file fvcartesiansolverxd.cpp.

18763 {
18764 // TRACE();
18765 const MUint noCVars = CV->noVariables;
18766 const MUint noSlopes = nDim * noCVars;
18767 const MUint totalNoSlopes = noSlopes * a_noCells();
18768 const MUint recDataSize = m_reconstructionDataSize;
18769 MFloat* const RESTRICT slopes = ALIGNED_MF(&a_storedSlope(0, 0, 0));
18770 const MInt* const RESTRICT recCellIds = ALIGNED_I(m_reconstructionCellIds.data());
18771 const MInt* const RESTRICT recNghbrIds = ALIGNED_I(m_reconstructionNghbrIds.data());
18772 const MFloat* const RESTRICT vars = ALIGNED_F(&a_variable(0, 0));
18773 const MFloat* const RESTRICT cellCoord = ALIGNED_F(&a_coordinate(0, 0));
18774
18775// Reset slopes to zero:
18776#ifdef _OPENMP
18777#pragma omp parallel for
18778#endif
18779 for(MUint slopeId = 0; slopeId < totalNoSlopes; ++slopeId) {
18780 slopes[slopeId] = F0;
18781 }
18782
18783 // Compute slopes:
18784 for(MUint k = 0; k < recDataSize; ++k) {
18785 const MFloat* const RESTRICT recNghbrVars = ALIGNED_F(vars + noCVars * recNghbrIds[k]);
18786 const MFloat* const RESTRICT recCellVars = ALIGNED_F(vars + noCVars * recCellIds[k]);
18787 const MUint slopeId = noSlopes * recCellIds[k];
18788 for(MUint v = 0; v < noCVars; ++v) {
18789 const MFloat tmp = recNghbrVars[v] - recCellVars[v];
18790 slopes[slopeId + v * nDim] += m_reconstructionConstants[nDim * k] * tmp;
18791 slopes[slopeId + v * nDim + 1] += m_reconstructionConstants[nDim * k + 1] * tmp;
18792 IF_CONSTEXPR(nDim == 3) slopes[slopeId + v * nDim + 2] += m_reconstructionConstants[nDim * k + 2] * tmp;
18793 }
18794 }
18795
18796 if(m_reConstSVDWeightMode == 3) {
18797 for(MInt cellId = 0; cellId < a_noCells(); ++cellId) {
18798 if(!a_hasProperty(cellId, SolverCell::HasCoarseNghbr)) {
18799 continue;
18800 }
18801 const MFloat* const RESTRICT recCellVars = ALIGNED_F(vars + noCVars * cellId);
18802 const MUint slopeId = nDim * noCVars * cellId;
18803 std::array<MBool, nDim> dirsJmp = {};
18804 for(MInt d = 0; d < nDim; ++d) {
18805 if(m_cells.nghbrInterface(cellId, 2 * d) == 3 || m_cells.nghbrInterface(cellId, 2 * d + 1) == 3) {
18806 dirsJmp[d] = true;
18807 } else {
18808 dirsJmp[d] = false;
18809 }
18810 }
18811
18812 const MUint cc1 = cellId * nDim;
18813 const MFloat* const RESTRICT cellIdCoord = ALIGNED_F(cellCoord + cc1);
18814 for(MUint v = 0; v < noCVars; ++v) {
18815 for(MInt d = 0; d < nDim; ++d) {
18816 if(dirsJmp[d]) {
18817 slopes[slopeId + v * nDim + d] = 0.0;
18818 }
18819 }
18820 }
18821
18822 for(MInt k = a_reconstructionData(cellId); k < a_reconstructionData(cellId + 1); ++k) {
18823 const MFloat* const RESTRICT recNghbrVars = ALIGNED_F(vars + noCVars * recNghbrIds[k]);
18824 const MUint cc = recNghbrIds[k] * nDim;
18825 const MUint slopeId2 = nDim * noCVars * cellId;
18826 const MFloat* const RESTRICT nghbrCoord = ALIGNED_F(cellCoord + cc);
18827
18828 for(MUint v = 0; v < noCVars; ++v) {
18829 MFloat tmp = recNghbrVars[v] - recCellVars[v];
18830 for(MInt d = 0; d < nDim; ++d) {
18831 if(!dirsJmp[d]) {
18832 const MFloat dx = nghbrCoord[d] - cellIdCoord[d];
18833 tmp -= slopes[slopeId2 + v * nDim + d] * dx;
18834 }
18835 }
18836 for(MInt d = 0; d < nDim; ++d) {
18837 if(dirsJmp[d]) {
18838 slopes[slopeId + v * nDim + d] += m_reconstructionConstants[nDim * k + d] * tmp;
18839 }
18840 }
18841 }
18842 }
18843 }
18844 }
18845}
MFloat & a_storedSlope(const MInt cellId, MInt const varId, const MInt dir)
Returns the stored slope of the cell cellId for the variable varId in direction dir.

◆ m_surfaceCollector()

template<MInt nDim_, class SysEqn >
FvSurfaceCollector & FvCartesianSolverXD< nDim_, SysEqn >::m_surfaceCollector ( )
inlineprotected

Definition at line 1418 of file fvcartesiansolverxd.h.

1418{ return m_surfaces; }

◆ maxResidual()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::maxResidual ( MInt  mode = 0)
virtual
Author
Lennart Schneiders

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >, and FvApeSolver2D.

Definition at line 21719 of file fvcartesiansolverxd.cpp.

21719 {
21720 TRACE();
21721
21723 return true;
21724 }
21725
21726 // Return if this is not the primary solver in a multilevel computation
21727 if(isMultilevel() && !isMultilevelPrimary()) {
21728 return true;
21729 }
21730
21731 RECORD_TIMER_START(m_timers[Timers::TimeInt]);
21732 RECORD_TIMER_START(m_timers[Timers::Residual]);
21733
21734 const MInt noCells = a_noCells();
21735 const MInt noCVars = CV->noVariables;
21736 MFloatScratchSpace rmsResidual(noCVars + 1, AT_, "rmsResidual");
21737 MFloatScratchSpace maxResidual(noCVars, AT_, "maxResidual");
21738 MFloatScratchSpace avgResidual(noCVars + 1, AT_, "rmsResidual");
21739 rmsResidual.fill(F0);
21740
21741 //---end of initialization
21742
21743 // Compute residual
21744 // ----------------
21745 for(MInt cellId = 0; cellId < noCells; cellId++) {
21746 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) continue;
21747 if(a_isHalo(cellId)) continue;
21748 if(a_isBndryGhostCell(cellId)) continue;
21749 if(a_isPeriodic(cellId)) continue;
21750 if(a_hasProperty(cellId, SolverCell::IsPeriodicWithRot)) continue;
21751 if(a_hasProperty(cellId, SolverCell::IsCutOff)) continue;
21752 if(a_hasProperty(cellId, SolverCell::IsInvalid)) continue;
21753 MInt gridcellId = cellId;
21754 if(a_hasProperty(cellId, SolverCell::IsSplitClone) || a_hasProperty(cellId, SolverCell::IsSplitChild)) {
21755 gridcellId = m_splitChildToSplitCell.find(cellId)->second;
21756 }
21757 if(c_noChildren(gridcellId) > 0) continue;
21758 if(a_bndryId(cellId) > -1 && m_fvBndryCnd->m_bndryCells->a[a_bndryId(cellId)].m_linkedCellId > -1) continue;
21759 if(a_isInactive(cellId)) continue;
21760
21761 rmsResidual(0) += a_cellVolume(cellId);
21762 avgResidual(0)++;
21763 for(MInt var = 0; var < noCVars; var++) {
21764 if(!m_localTS) {
21765 MBool useOldResidual = true;
21766 if(useOldResidual) {
21767 rmsResidual(1 + var) += a_cellVolume(cellId) * POW2(a_FcellVolume(cellId) * a_rightHandSide(cellId, var));
21768 } else {
21769 rmsResidual(1 + var) += a_cellVolume(cellId) * POW2(a_variable(cellId, var) - a_oldVariable(cellId, var));
21770 }
21771 avgResidual(1 + var) += POW2(a_variable(cellId, var) - a_oldVariable(cellId, var));
21772 maxResidual(var) = mMax(maxResidual(var), POW2(a_variable(cellId, var) - a_oldVariable(cellId, var)));
21773 } else {
21774 rmsResidual(1 + var) +=
21775 a_cellVolume(cellId) * POW2(a_variable(cellId, var) - a_oldVariable(cellId, var)) / a_localTimeStep(cellId);
21776 avgResidual(1 + var) += POW2(a_variable(cellId, var) - a_oldVariable(cellId, var)) / a_localTimeStep(cellId);
21777 maxResidual(var) = mMax(maxResidual(var),
21778 POW2(a_variable(cellId, var) - a_oldVariable(cellId, var)) / a_localTimeStep(cellId));
21779 }
21780 }
21781 }
21782
21783 RECORD_TIMER_START(m_timers[Timers::ResidualMpi]);
21784 MPI_Allreduce(MPI_IN_PLACE, &rmsResidual(0), rmsResidual.size(), MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE",
21785 "rmsResidual(0)");
21786 MPI_Allreduce(MPI_IN_PLACE, &maxResidual(0), maxResidual.size(), MPI_DOUBLE, MPI_MAX, mpiComm(), AT_, "MPI_IN_PLACE",
21787 "maxResidual(0)");
21788 MPI_Allreduce(MPI_IN_PLACE, &avgResidual(0), avgResidual.size(), MPI_DOUBLE, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE",
21789 "avgResidual(0)");
21790 RECORD_TIMER_STOP(m_timers[Timers::ResidualMpi]);
21791
21792 // compute RMS error (volume integral)
21793 for(MInt var = 0; var < noCVars; var++) {
21794 if(!m_localTS) {
21795 rmsResidual(1 + var) = sqrt(rmsResidual(1 + var) / rmsResidual(0));
21796 avgResidual(1 + var) = sqrt(avgResidual(1 + var) / avgResidual(0));
21797 maxResidual(var) = sqrt(maxResidual(var));
21798 } else {
21799 rmsResidual(1 + var) = sqrt(rmsResidual(1 + var) / rmsResidual(0)) / timeStep();
21800 avgResidual(1 + var) = sqrt(avgResidual(1 + var) / avgResidual(0)) / timeStep();
21801 maxResidual(var) = sqrt(maxResidual(var)) / timeStep();
21802 }
21803 }
21804
21805 if(mode == 0 && this->m_adaptation && this->m_resTriggeredAdapt && maxResidual(1 + PV->RHO) < 0.00001) {
21806 MInt limit = m_localTS ? 10 : 350;
21807 if(globalTimeStep - m_lastAdapTS < limit) {
21808 if(domainId() == 0) {
21809 cerr << "Residual threshold reached within 100 TS after last adaptation at " << globalTimeStep << endl;
21810 cerr << " -> Deactivating residual triggered Adaptation" << endl;
21811 }
21812 this->m_resTriggeredAdapt = false;
21813 } else {
21814 if(domainId() == 0) {
21815 cerr << "Forcing residual-based adaptation at time-step " << globalTimeStep << " with rms-density Residual of "
21816 << rmsResidual(1 + PV->RHO) << endl;
21817 }
21818 m_forceAdaptation = true;
21819 }
21820 }
21821
21822 MBool abort = false;
21823 MFloat maxRes = F0;
21824 for(MInt var = 0; var < noCVars; var++) {
21825 // Exit on NaN of average residual
21826 if(!(rmsResidual(1 + var) >= F0 || rmsResidual(1 + var) < F0)) {
21827 if(domainId() == 0) {
21828 cerr << "Solution diverged, average residual is nan " << endl;
21829 }
21830 m_log << "Solution diverged, average residual is nan " << endl;
21831 abort = true;
21832 }
21833 maxRes = mMax(maxRes, rmsResidual(1 + var));
21834 }
21835
21836 if(abort) {
21837 // Save output and exit
21839 m_vtuWritePointData = false;
21842 if(!m_levelSetMb) {
21843 mTerm(1, AT_, "Solution diverged, average residual is NaN!");
21844 }
21845 }
21846
21847 if(mode == 1) return false;
21848
21849 if(domainId() == 0) {
21850 MString surname;
21852 surname = "Residual";
21853 } else {
21854 surname = "Residual_s" + to_string(solverId());
21855 }
21856 MString surnameBAK = surname + "_BAK";
21857
21858 // Output, residual
21859 // -----------------------
21860 FILE* datei;
21862 struct stat buffer;
21863 if(stat(surname.c_str(), &buffer) == 0) {
21864 rename(surname.c_str(), "Residual_BAK");
21865 }
21866 datei = fopen(surname.c_str(), "w");
21867 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) {
21868 IF_CONSTEXPR(nDim == 3) {
21869 fprintf(datei, "%s",
21870 "# 1:time_step 2:hydrodynamic_time 3:acoustic_time 4:res_rhoU 5:res_rhoV 6:res_rhoW 7:res_rhoE "
21871 " 8:res_rho "
21872 "9:res_rhon 10:maxRes_rhoU 11:maxRes_rhoV 12:maxRes_rhoW 13:maxRes_rhoE 14:maxRes_rho "
21873 "15:avgRes_rhoU 16:avgRes_rhoV 17:avgRes_rhoW 18:avgRes_rhoE 19:avgRes_rho\n");
21874 }
21875 else {
21876 fprintf(datei, "%s",
21877 "# 1:time_step 2:hydrodynamic_time 3:acoustic_time 4:res_rhoU 5:res_rhoV 6:res_rhoE 7:res_rho "
21878 "8:res_rhon 9:maxRes_rhoU 10:maxRes_rhoV 11:maxRes_rhoE 12:maxRes_rho "
21879 "13:avgRes_rhoU 14:avgRes_rhoV 15:avgRes_rhoE 16:avgRes_rho\n");
21880 }
21881 }
21882 else {
21883 IF_CONSTEXPR(nDim == 3) {
21884 fprintf(datei, "%s",
21885 "# 1:time_step 2:hydrodynamic_time 3:acoustic_time 4:res_rhoU 5:res_rhoV 6:res_rhoW 7:res_rhoE "
21886 " 8:res_rho "
21887 "9:maxRes_rhoU 10:maxRes_rhoV 11:maxRes_rhoW 12:maxRes_rhoE 13:maxRes_rho "
21888 "14:avgRes_rhoU 15:avgRes_rhoV 16:avgRes_rhoW 17:avgRes_rhoE 18:avgRes_rho\n");
21889 }
21890 else {
21891 fprintf(datei, "%s",
21892 "# 1:time_step 2:hydrodynamic_time 3:acoustic_time 4:res_rhoU 5:res_rhoV 6:res_rhoE 7:res_rho "
21893 "8:maxRes_rhoU 9:maxRes_rhoV 10:maxRes_rhoE 11:maxRes_rho "
21894 "12:avgRes_rhoU 13:avgRes_rhoV 14:avgRes_rhoE 15:avgRes_rho\n");
21895 }
21896 }
21897 } else {
21898 datei = fopen(surname.c_str(), "a");
21899 }
21900 fprintf(datei, "%d", globalTimeStep);
21901 fprintf(datei, " %f", m_physicalTime);
21902 fprintf(datei, " %f", m_time);
21903 for(MInt var = 0; var < noCVars; var++) {
21904 fprintf(datei, " %.8g", rmsResidual(1 + var));
21905 }
21906 for(MInt var = 0; var < noCVars; var++) {
21907 fprintf(datei, " %.8g", maxResidual(var));
21908 }
21909 for(MInt var = 0; var < noCVars; var++) {
21910 fprintf(datei, " %.8g", avgResidual(1 + var));
21911 }
21912 fprintf(datei, "\n");
21913 fclose(datei);
21914 }
21915
21916 RECORD_TIMER_STOP(m_timers[Timers::Residual]);
21917 RECORD_TIMER_STOP(m_timers[Timers::TimeInt]);
21918
21920 return true;
21921 }
21922
21923 return false;
21924}
virtual MBool maxResidual(MInt mode=0)
Computes the global root-mean-square residual. The residual is defined as time derivative of conserva...
constexpr MBool isMultilevelPrimary() const
Return true if solver is primary solver in multilevel computation.
MInt m_residualInterval
The number of timesteps before writing the next residual.
Definition: solver.h:87

◆ Muscl()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::Muscl ( MInt  = -1)
virtual
Author
Daniel Hartmann
Date
May 2008

MUSCL stands for Monotone Upstream-centered Schemes for Conservation Laws and is a method for reconstructing the fluxes on the cell surfaces. For this, the fluxes from the left and right of the surface are obtained by extrapolating the conservative variables (and not the fluxes) from the cell centers to the surface.

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 21940 of file fvcartesiansolverxd.cpp.

21940 {
21941 TRACE();
21942
21943 if(!calcSlopesAfterStep()) {
21944 RECORD_TIMER_START(m_timers[Timers::MusclReconst]);
21946 RECORD_TIMER_STOP(m_timers[Timers::MusclReconst]);
21947
21948 // copy the slopes from the master to the slave cells
21949 RECORD_TIMER_START(m_timers[Timers::MusclCopy]);
21950 m_fvBndryCnd->copySlopesToSmallCells();
21951 RECORD_TIMER_STOP(m_timers[Timers::MusclCopy]);
21952
21953 // update the ghost cell slopes for reconstruction of the primitive variables
21954 // on the surfaces for the AUSM scheme
21955 RECORD_TIMER_START(m_timers[Timers::MusclGhostSlopes]);
21957 RECORD_TIMER_STOP(m_timers[Timers::MusclGhostSlopes]);
21958
21959 RECORD_TIMER_START(m_timers[Timers::MusclCutSlopes]);
21961 RECORD_TIMER_STOP(m_timers[Timers::MusclCutSlopes]);
21962 // m_fvBndryCnd->updateGhostCellSlopesViscous();
21963 }
21964
21965 // reconstruction of the slopes and variables at the center of the surfaces
21966 RECORD_TIMER_START(m_timers[Timers::MusclReconstSrfc]);
21967 (this->*m_reconstructSurfaceData)(-1);
21968 RECORD_TIMER_STOP(m_timers[Timers::MusclReconstSrfc]);
21969
21970 if(m_useSandpaperTrip) {
21971 RECORD_TIMER_START(m_timers[Timers::SandpaperTrip]);
21973 RECORD_TIMER_STOP(m_timers[Timers::SandpaperTrip]);
21974 }
21975
21976 if(m_useChannelForce) {
21978 }
21979}
void(FvCartesianSolverXD::* m_reconstructSurfaceData)(MInt)

◆ noCellDataDlb()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::noCellDataDlb ( ) const
inlineoverridevirtual

Reimplemented from Solver.

Definition at line 2385 of file fvcartesiansolverxd.h.

2385{ return 1; };

◆ noInternalCells()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::noInternalCells ( ) const
inlineoverridevirtual

Implements Solver.

Definition at line 349 of file fvcartesiansolverxd.h.

349{ return grid().noInternalCells(); }

◆ noLoadTypes()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::noLoadTypes
overridevirtual

Reimplemented from Solver.

Definition at line 23954 of file fvcartesiansolverxd.cpp.

23954 {
23955 TRACE();
23956
23957 MInt noFvLoadTypes = 1; // active leaf cells
23958 if(m_weightBndryCells) {
23959 noFvLoadTypes += 1; // boundary cells
23960 }
23962 noFvLoadTypes += 1; // cut-off cells
23963 }
23964 if(m_weightBc1601) {
23965 noFvLoadTypes += 1; // bc1601 cells
23966 }
23968 noFvLoadTypes += 1; // memory weight
23969 }
23971 noFvLoadTypes += 1; // near boundary cells
23972 }
23973 if(m_weightLvlJumps) {
23974 noFvLoadTypes += 1; // cells at lvl-jump
23975 }
23976 if(m_weightSmallCells) {
23977 noFvLoadTypes += 1; // small cells
23978 }
23979
23980 return noFvLoadTypes;
23981}

◆ nonReflectingBCAfterTreatmentCutOff()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::nonReflectingBCAfterTreatmentCutOff
virtual

Definition at line 14290 of file fvcartesiansolverxd.cpp.

14290 {
14291 TRACE();
14292
14294}
void applyNonReflectingBCAfterTreatmentCutOff()

◆ nonReflectingBCCutOff()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::nonReflectingBCCutOff
virtual

Definition at line 14279 of file fvcartesiansolverxd.cpp.

14279 {
14280 TRACE();
14281
14283}

◆ noSolverTimers()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::noSolverTimers ( const MBool  allTimings)
inlineoverride

Definition at line 2369 of file fvcartesiansolverxd.h.

2369 {
2370#ifdef MAIA_TIMER_FUNCTION
2371 // 11 additional times are created, but only 6 are written
2372 const MInt additionalTimer = m_levelSetMb ? 6 : 0;
2373 if(allTimings) {
2374 return 2 + 17 + additionalTimer;
2375 } else {
2376 return 6;
2377 }
2378#else
2379 return 2;
2380#endif
2381 }

◆ noVariables()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::noVariables ( ) const
inlineoverridevirtual

Reimplemented from Solver.

Definition at line 2090 of file fvcartesiansolverxd.h.

2090{ return PV->noVariables; };

◆ oldPressure()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::oldPressure ( MFloat *const  p)

Definition at line 8920 of file fvcartesiansolverxd.cpp.

8920 {
8921 TRACE();
8922
8923 IF_CONSTEXPR(!hasE<SysEqn>)
8924 mTerm(1, AT_, "Not compatible with SysEqn without RHO_E!");
8925
8926
8927 for(MInt c = 0; c < noInternalCells(); c++) {
8928 const MFloat rho = a_oldVariable(c, CV->RHO);
8929 const MFloat rhoE = a_oldVariable(c, CV->RHO_E);
8930 IF_CONSTEXPR(nDim == 2) {
8931 p[c] =
8932 sysEqn().pressure(rho, POW2(a_oldVariable(c, CV->RHO_VV[0])) + POW2(a_oldVariable(c, CV->RHO_VV[1])), rhoE);
8933 }
8934 IF_CONSTEXPR(nDim == 3) {
8935 p[c] = sysEqn().pressure(rho,
8936 POW2(a_oldVariable(c, CV->RHO_VV[0])) + POW2(a_oldVariable(c, CV->RHO_VV[1]))
8937 + POW2(a_oldVariable(c, CV->RHO_VV[2])),
8938 rhoE);
8939 }
8940 }
8941}

◆ physicalTime()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::physicalTime ( )
inline

Definition at line 1347 of file fvcartesiansolverxd.h.

1347{ return m_physicalTime; }

◆ postAdaptation()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::postAdaptation
overridevirtual
Author
Tim Wegmann

Reimplemented from Solver.

Definition at line 23715 of file fvcartesiansolverxd.cpp.

23715 {
23716 TRACE();
23717
23718#ifdef _OPENMP
23719#pragma omp parallel for
23720#endif
23721 for(MInt i = 0; i < grid().raw().noNeighborDomains(); i++) {
23722 for(MInt j = 0; j < grid().raw().noHaloCells(i); j++) {
23723 MInt gridId = grid().raw().m_haloCells[i][j];
23724 MInt l_solverId = this->grid().tree().grid2solver(gridId);
23725 if(l_solverId < 0) {
23726 continue;
23727 }
23728
23729 if(!grid().raw().treeb().solver(gridId, m_solverId)) {
23730 // cerr << "removing a Halo-cell " << endl;
23731 this->removeCellId(l_solverId);
23732 }
23733 }
23734 }
23735
23736 this->compactCells();
23737
23738 if(!g_multiSolverGrid) {
23739 for(MInt gridCellId = 0; gridCellId < grid().raw().treeb().size(); gridCellId++) {
23740 ASSERT(grid().tree().solver2grid(gridCellId) == gridCellId, "");
23741 ASSERT(grid().tree().grid2solver(gridCellId) == gridCellId, "");
23742 }
23743 }
23744
23745 grid().updateOther();
23747 this->checkNoHaloLayers();
23748
23749 m_cells.size(c_noCells());
23752
23753 // updates Halo-Information!
23755
23756 // Nothing further to be done if inactive
23757 if(!isActive()) return;
23758
23759 if(!g_multiSolverGrid) {
23760 ASSERT(a_noCells() == c_noCells() && c_noCells() == grid().raw().treeb().size(), "");
23761 }
23762
23764
23765 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
23766 ASSERT(!a_isBndryGhostCell(cellId), "");
23767 ASSERT(a_bndryId(cellId) >= -1, to_string(a_bndryId(cellId)));
23768 }
23769
23770 // create exchange functions:
23771 if(globalTimeStep < 0) {
23774 // initializeMaxLevelExchange();
23775 exchangeDataFV(&a_pvariable(0, 0), PV->noVariables, false, m_rotIndVarsPV);
23777 } else {
23778 // correct values on halo cells
23779 exchangeDataFV(&a_variable(0, 0), CV->noVariables, false, m_rotIndVarsCV);
23780 exchangeDataFV(&a_oldVariable(0, 0), CV->noVariables, false, m_rotIndVarsCV);
23782 IF_CONSTEXPR(isDetChem<SysEqn>) correctMajorSpeciesMassFraction();
23783 IF_CONSTEXPR(isDetChem<SysEqn>) computeMeanMolarWeights_CV();
23785 }
23786
23787 if(m_closeGaps) {
23789 }
23790
23791 if(m_sensorParticle) {
23793 0)); // Since azimuthal window/halos cells do not overlap an meaningful way to exchange this needs to be found!
23794 }
23795
23796 if(m_zonal) {
23798 }
23799
23800#if defined _MB_DEBUG_ || !defined NDEBUG
23801 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
23802 for(MInt v = 0; v < PV->noVariables; v++) {
23803 if(std::isnan(a_pvariable(cellId, v)) && a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
23804 cerr << "Cell with invalid value 1" << cellId << " " << a_isHalo(cellId) << " "
23805 << a_hasProperty(cellId, SolverCell::IsInactive) << endl;
23806 }
23807 }
23808 }
23809#endif
23810
23811 m_freeIndices.clear();
23813}
void correctMajorSpeciesMassFraction()
Corrects the mass fraction of the predominant species to ensure conservation due to numerical or appr...
MInt & a_noPart(MInt cellId)
Return no particles.
void exchangeProperties()
exchanges isInactive and isOnCurrentMGLevel
std::set< MInt > m_freeIndices
Definition: solver.h:101
void compactCells()
Removes all holes in the cell collector and moves halo cells to the back of the collector.
MBool g_multiSolverGrid

◆ postSolutionStep()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::postSolutionStep ( )
inlineoverridevirtual

Reimplemented from Solver.

Definition at line 1322 of file fvcartesiansolverxd.h.

1322{ return true; };

◆ postTimeStep()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::postTimeStep
overridevirtual
Author
Thomas Hoesgen

Implements Solver.

Definition at line 11175 of file fvcartesiansolverxd.cpp.

11175 {
11176 TRACE();
11177
11178 if(m_calcLESAverage) {
11182 }
11183 }
11186 }
11189 }
11191
11193 // Finish MPI communication in split MPI mode after completed timestep
11194 lhsBndFinish();
11195 // At the beginning of the next timestep there is nothing to receive
11196 m_splitMpiCommRecv = false;
11197 }
11198
11200}
virtual MBool adaptationTrigger()
MBool m_timeStepConverged
Convergence status of the current time step.
void lhsBndFinish()
Finish the split MPI communication and perform the left out part from lhsBnd().

◆ prepareAdaptation()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::prepareAdaptation
overridevirtual
Author
Tim Wegmann

Reimplemented from Solver.

Definition at line 23532 of file fvcartesiansolverxd.cpp.

23532 {
23533 TRACE();
23534
23535 if(globalTimeStep > 0) {
23537 }
23538 m_wasAdapted = true;
23539 this->m_adaptationStep = 0;
23540
23541 if(!isActive()) return;
23542
23543 if(globalTimeStep > 0) {
23549 resetSurfaces();
23550 resetSponge();
23551 } else {
23553 }
23554
23555#ifndef NDEBUG
23556 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
23557 ASSERT(!a_isBndryGhostCell(cellId), "");
23558 ASSERT(a_bndryId(cellId) == -1,
23559 "Error: bndryCellId " + std::to_string(a_bndryId(cellId)) + " for cell " + std::to_string(cellId));
23560 ASSERT(!a_hasProperty(cellId, SolverCell::IsSplitChild), "");
23561 if(!a_isHalo(cellId) && a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
23562 for(MInt v = 0; v < CV->noVariables; v++) {
23563 ASSERT(!std::isnan(a_variable(cellId, v)), "");
23564 }
23565 }
23566 if(!m_levelSetMb) {
23567 ASSERT(a_cellVolume(cellId) > 0, "");
23568 ASSERT(!a_hasProperty(cellId, SolverCell::IsInactive), "");
23569 }
23570 }
23571#endif
23572
23575
23576 // Azimuthal exchange needs to be reinitialized after adaptation
23577 if(grid().azimuthalPeriodicity()) {
23578 m_azimuthalRecConstSet = false;
23580 }
23581
23582 // STG adaptation
23583 IF_CONSTEXPR(SysEqn::m_noRansEquations == 0) {
23584 if(m_zonal) {
23585 for(MInt c = (MInt)m_LESAverageCells.size() - 1; c >= 0; c--) {
23587 if(a_isHalo(cellId)) {
23588 m_LESAverageCells.erase(m_LESAverageCells.begin() + c);
23589 for(MInt var = 0; var < m_LESNoVarAverage; var++) {
23590 m_LESVarAverage[var].erase(m_LESVarAverage[var].begin() + c);
23591 }
23592 }
23593 }
23594 }
23595 }
23596}
void resetCutOffFirst()
reset first for cutOffBndryCnd, this is necessary after a balance!
void resetSponge()
reset sponge properties
virtual void resetBoundaryCells(const MInt offset=0)
void resetCutOffCells()
resets all Cut-Off Information should only be called before the adaptation and balance!

◆ prepareMpiExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::prepareMpiExchange

Definition at line 6301 of file fvcartesiansolverxd.cpp.

6301 {
6302 TRACE();
6303
6304
6305 if(m_nonBlockingComm) {
6308 MInt noSendNghbrs = 0;
6309 MInt noRecvNghbrs = 0;
6310
6311
6312 for(MInt i = 0; i < noNeighborDomains(); i++) {
6313 if(m_mpi_receiveRequest[i] != MPI_REQUEST_NULL) {
6315 }
6316 if(m_mpi_sendRequest[i] != MPI_REQUEST_NULL) {
6318 }
6319 }
6320
6321 for(MInt i = 0; i < noNeighborDomains(); i++) {
6322 MInt bufferCounter = m_noMaxLevelHaloCells[i] * m_dataBlockSize;
6323 if(bufferCounter > 0) {
6325 mpiComm(), &m_mpi_receiveRequest[noRecvNghbrs], AT_, "m_receiveBuffersNoBlocking[i]");
6326 m_maxLvlMpiRecvNeighbor.push_back(i);
6327 noRecvNghbrs++;
6328 }
6329 bufferCounter = m_noMaxLevelWindowCells[i] * m_dataBlockSize;
6330 if(bufferCounter > 0) {
6331 MPI_Send_init(m_sendBuffersNoBlocking[i], bufferCounter, MPI_DOUBLE, neighborDomain(i), MAIA_MPI_FV_TAG,
6332 mpiComm(), &m_mpi_sendRequest[noSendNghbrs], AT_, "m_sendBuffersNoBlocking[i]");
6333 m_maxLvlMpiSendNeighbor.push_back(i);
6334 noSendNghbrs++;
6335 }
6336 }
6337 // Set status of MPI requests
6338 m_mpiSendRequestsOpen = false;
6339 m_mpiRecvRequestsOpen = false;
6340 }
6341}
@ MAIA_MPI_FV_TAG
Definition: enums.h:20
int MPI_Send_init(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request, const MString &name, const MString &varname)
same as MPI_Send_init
int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request, const MString &name, const MString &varname)
same as MPI_Recv_init

◆ prepareRestart()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::prepareRestart ( MBool  ,
MBool  
)
overridevirtual

Reimplemented from Solver.

Definition at line 17065 of file fvcartesiansolverxd.cpp.

17065 {
17066 TRACE();
17067
17068 writeGridRestart = false;
17069
17070 // write intermediate restart file
17071 if(m_restartInterval == -1 && !writeRestart) {
17072 writeRestart = false;
17073 }
17074
17075 MInt relativeTimeStep = globalTimeStep - m_restartOffset;
17076 MInt relativeRestartTimeStep = m_restartTimeStep - m_restartOffset;
17077
17078 if(((relativeTimeStep % m_restartInterval) == 0 && relativeTimeStep > relativeRestartTimeStep) || writeRestart) {
17079 writeRestart = true;
17080
17081 if(m_forceRestartGrid) {
17083 writeGridRestart = true;
17084 if(m_recalcIds == nullptr && isActive()) mAlloc(m_recalcIds, maxNoGridCells(), "m_recalcIds", -1, AT_);
17085 }
17086
17088 writeGridRestart = true;
17089 }
17090 }
17091
17092 if(isActive() && m_levelSetMb && writeRestart) {
17093 if(maxLevel() > minLevel()) {
17094 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
17095 if(a_isBndryGhostCell(cellId)) continue;
17096 if(a_isHalo(cellId)) continue;
17097 if(a_level(cellId) != minLevel()) continue;
17098 reduceData(cellId, &a_pvariable(0, 0), PV->noVariables);
17099 }
17100 }
17101 }
17102
17103 return writeRestart;
17104}
MInt m_restartOffset
Definition: solver.h:81

◆ preSolutionStep()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::preSolutionStep ( MInt  )
inlineoverridevirtual

Reimplemented from Solver.

Definition at line 1320 of file fvcartesiansolverxd.h.

1320{};

◆ preTimeStep()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::preTimeStep ( )
inlineoverridevirtual

Implements Solver.

Definition at line 2551 of file fvcartesiansolverxd.h.

2551{ m_timeStepUpdated = false; }
MBool m_timeStepUpdated
time-step has been updated

◆ readPreliminarySTGSpongeData()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::readPreliminarySTGSpongeData

Definition at line 38107 of file fvcartesiansolverxd.cpp.

38107 {
38108 TRACE();
38109
38110 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
38111
38112 // load preliminary sponge data and fill m_uvRans
38113 stringstream fn;
38114 fn.clear();
38115 MString fname = Context::getSolverProperty<MString>("preliminarySpongeDataFile", m_solverId, AT_, &fname);
38116 if(m_spongeRank == 0) cerr << "loading STG preliminary sponge data from " << fname << "...";
38117
38118 ifstream preliminarySpongeData;
38119 preliminarySpongeData.open(fname);
38120
38121 vector<MFloat> data;
38122 MFloat num;
38123 string line;
38124
38125 while(preliminarySpongeData >> num) {
38126 data.push_back(num);
38127 }
38128
38129 // MInt count = 0;
38130 MInt preliminarySpongeDataVarCount = Context::getSolverProperty<MInt>("preliminarySpongeDataVarCount", m_solverId,
38131 AT_, &preliminarySpongeDataVarCount);
38132 MInt uvIndex = Context::getSolverProperty<MInt>("preliminarySpongeDataUVIndex", m_solverId, AT_, &uvIndex);
38133 MInt dataCount = data.size() / preliminarySpongeDataVarCount;
38134
38135 vector<vector<MFloat>> preData(dataCount, vector<MFloat>(preliminarySpongeDataVarCount, 0));
38136
38137 MInt index = 0;
38138 for(MInt d = 0; d < dataCount; d++) {
38139 for(MInt dd = 0; dd < preliminarySpongeDataVarCount; dd++) {
38140 index = preliminarySpongeDataVarCount * d + dd;
38141 preData[d][dd] = data[index];
38142 }
38143 }
38144
38145 preliminarySpongeData.close();
38146
38147 for(MInt i = 0; i < m_globalNoSpongeLocations; i++) {
38148 MFloat pos = m_globalSpongeLocations[i].first;
38149 for(MInt d = 0; d < dataCount - 1; d++) {
38150 // Interpolation
38151 if(preData[d][0] < pos && preData[d + 1][0] > pos) {
38152 m_uvRans[i] = preData[d][uvIndex]
38153 + (preData[d + 1][uvIndex] - preData[d][uvIndex]) / (preData[d + 1][0] - preData[d][0])
38154 * (pos - preData[d][0]);
38155 }
38156 }
38157 }
38158
38159 if(m_spongeRank == 0) cerr << "ok" << endl;
38160}

◆ readWallModelProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::readWallModelProperties
protected

Definition at line 11971 of file fvcartesiansolverxd.cpp.

11971 {
11972 TRACE();
11973
11974 m_wmLES = Context::getSolverProperty<MBool>("wmLES", m_solverId, AT_, &m_wmLES);
11975
11976 if(m_wmLES) {
11977 m_log << endl << "Reading WM properties ... " << endl;
11978
11979 if(Context::propertyExists("wmUseInterpolation", m_solverId)) {
11981 Context::getSolverProperty<MBool>("wmUseInterpolation", m_solverId, AT_, &m_wmUseInterpolation);
11982 } else {
11983 m_wmUseInterpolation = true;
11984 }
11985
11986 if(Context::propertyExists("wmDistance", m_solverId)) {
11987 m_wmDistance = Context::getSolverProperty<MFloat>("wmDistance", m_solverId, AT_, &m_wmDistance);
11988 } else {
11990 }
11991
11992 if(Context::propertyExists("wmOutput", m_solverId)) {
11993 m_wmOutput = Context::getSolverProperty<MBool>("wmOutput", m_solverId, AT_, &m_wmOutput);
11994 } else {
11995 m_wmOutput = false;
11996 }
11997
11998 if(Context::propertyExists("wmSurfaceProbeInterval", m_solverId)) {
12000 Context::getSolverProperty<MInt>("wmSurfaceProbeInterval", m_solverId, AT_, &m_wmSurfaceProbeInterval);
12001 } else {
12003 }
12004
12005 if(Context::propertyExists("wmTimeFilter", m_solverId)) {
12006 m_wmTimeFilter = Context::getSolverProperty<MBool>("wmTimeFilter", m_solverId, AT_, &m_wmTimeFilter);
12007 } else {
12008 m_wmTimeFilter = false;
12009 }
12010
12011 m_log << "wmDistance = " << m_wmDistance << endl;
12012 m_log << "wmUseInterpolation = " << m_wmUseInterpolation << endl;
12013 m_log << "wmOutput = " << m_wmOutput << endl;
12014 m_log << "wmSurfaceProbeInterval = " << m_wmSurfaceProbeInterval << endl;
12015 m_log << "done.";
12016 }
12017}

◆ rebuildAzimuthalReconstructionConstants()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::rebuildAzimuthalReconstructionConstants ( MInt  cellId,
MInt  offset,
MFloat recCoord,
MInt  mode = 0 
)

◆ receive()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::receive ( const MBool  exchangeAll = false)
Parameters
exchangeAllreceive all halo cell data and not just the data of the max-level halo cells

Definition at line 7157 of file fvcartesiansolverxd.cpp.

7157 {
7158 TRACE();
7159 if(noNeighborDomains() == 0) {
7160 return; // No neighbor -> serial + nonperiodic case
7161 }
7162 RECORD_TIMER_START(m_treceive);
7163
7164 ScratchSpace<MPI_Request> recvRequests(noNeighborDomains(), AT_, "recvRequests");
7165 recvRequests.fill(MPI_REQUEST_NULL);
7166
7167 RECORD_TIMER_START(m_treceiving);
7168 // Start receiving from all neighbors
7169 for(MInt i = 0; i < noNeighborDomains(); i++) {
7170 const MInt noHalos = (exchangeAll) ? noHaloCells(i) : m_noMaxLevelHaloCells[i];
7171 const MInt bufSize = noHalos * m_dataBlockSize;
7173 &recvRequests[i], AT_, "m_receiveBuffer[i]");
7174 }
7175 RECORD_TIMER_STOP(m_treceiving);
7176
7177 RECORD_TIMER_START(m_treceiveWait);
7178 // Wait for all send and receive requests to finish
7179 MPI_Waitall(noNeighborDomains(), &m_mpi_request[0], MPI_STATUSES_IGNORE, AT_);
7180 MPI_Waitall(noNeighborDomains(), &recvRequests[0], MPI_STATUSES_IGNORE, AT_);
7181 RECORD_TIMER_STOP(m_treceiveWait);
7182
7183 RECORD_TIMER_STOP(m_treceive);
7184}

◆ receiveWMVars()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::receiveWMVars
protected

Definition at line 12111 of file fvcartesiansolverxd.cpp.

12111 {
12112 TRACE();
12113 const MInt noPVars = PV->noVariables;
12114 MInt offset = 0;
12115 MInt bufSize = 0;
12116 MPI_Status status;
12117
12118 // TODO labels:FV,COMM switch to Irecv + Waitall
12119 for(MInt dom = 0; dom < noDomains(); dom++) {
12120 bufSize = m_noWMImgPointsRecv[dom] * noPVars;
12121 MPI_Recv(&m_wmImgRecvBuffer[offset], bufSize, MPI_DOUBLE, dom, 0, mpiComm(), &status, AT_,
12122 "m_wmImgRecvBuffer[offset]");
12123 offset += bufSize;
12124 }
12125 for(MInt dom = 0; dom < noDomains(); dom++) {
12126 MPI_Wait(&m_mpi_wmRequest[dom], &status, AT_);
12127 }
12128}

◆ reduceData()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::reduceData ( const MInt  cellId,
MFloat data,
const MInt  dataBlockSize = 1,
const MBool  average = true 
)
protected
Author
Lennart Schneiders

Definition at line 11084 of file fvcartesiansolverxd.cpp.

11085 {
11086 MFloat vol = a_cellVolume(cellId);
11087 if(c_noChildren(cellId) > 0) {
11088 vol = F0;
11089 for(MInt d = 0; d < dataBlockSize; d++) {
11090 data[dataBlockSize * cellId + d] = F0;
11091 }
11092 for(MInt child = 0; child < IPOW2(nDim); child++) {
11093 MInt childId = c_childId(cellId, child);
11094 if(childId < 0) continue;
11095 if(c_noChildren(childId) == 0 && !a_hasProperty(childId, SolverCell::IsOnCurrentMGLevel)) continue;
11096 MFloat volc = reduceData(childId, data, dataBlockSize);
11097 for(MInt d = 0; d < dataBlockSize; d++) {
11098 data[dataBlockSize * cellId + d] += volc * data[dataBlockSize * childId + d];
11099 }
11100 vol += volc;
11101 }
11102 if(average) {
11103 for(MInt d = 0; d < dataBlockSize; d++) {
11104 data[dataBlockSize * cellId + d] /= mMax(1e-14, vol);
11105 }
11106 }
11107 }
11108 return vol;
11109}

◆ reduceVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::reduceVariables
Author
Lennart Schneiders

Definition at line 17590 of file fvcartesiansolverxd.cpp.

17590 {
17591 TRACE();
17592
17593 const MInt noPVars = PV->noVariables;
17594 const MBool needSlopes =
17596 if(m_extractedCells == nullptr) {
17597 cerr << "Extracted cells not allocated." << endl;
17598 return;
17599 }
17600
17602 if(needSlopes && m_vtuLevelThreshold > maxUniformRefinementLevel()) {
17604 }
17605 for(MInt c = 0; c < m_extractedCells->size(); c++) {
17606 MInt cellId = m_extractedCells->a[c].m_cellId;
17607 if(c_noChildren(cellId) > 0 && a_level(cellId) == m_vtuLevelThreshold) {
17608 reduceData(cellId, &a_pvariable(0, 0), noPVars);
17609 }
17610 }
17611 if(needSlopes && m_vtuLevelThreshold <= maxUniformRefinementLevel()) {
17612 exchangeDataFV(&a_pvariable(0, 0), noPVars, false, m_rotIndVarsPV);
17614 } else if(m_vtuWritePointData) {
17615 exchangeDataFV(&a_pvariable(0, 0), noPVars, false, m_rotIndVarsPV);
17616 }
17617 if(needSlopes) {
17618 for(MInt c = 0; c < m_extractedCells->size(); c++) {
17619 MInt cellId = m_extractedCells->a[c].m_cellId;
17620 if(c_noChildren(cellId) > 0 && a_level(cellId) == m_vtuLevelThreshold) {
17621 reduceData(cellId, &a_slope(0, 0, 0), noPVars * nDim);
17622 }
17623 }
17624 }
17625 }
17627 if(needSlopes) {
17628 // Rotation of slopes for azimuthal periodicity is not yet handled
17629 exchangeDataFV(&a_slope(0, 0, 0), noPVars * nDim, false);
17630 }
17631 }
17632}

◆ refineCell()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::refineCell ( const MInt  gridCellId)
overridevirtual
Author
Lennart Schneiders

Reimplemented from Solver.

Definition at line 22502 of file fvcartesiansolverxd.cpp.

22502 {
22503 static constexpr MFloat signStencil[8][3] = {{-F1, -F1, -F1}, {F1, -F1, -F1}, {-F1, F1, -F1}, {F1, F1, -F1},
22504 {-F1, -F1, F1}, {F1, -F1, F1}, {-F1, F1, F1}, {F1, F1, F1}};
22505
22506 if(!g_multiSolverGrid) ASSERT(grid().raw().a_hasProperty(gridCellId, Cell::WasRefined), "");
22507
22508 const MInt noCVars = CV->noVariables;
22509 const MInt noFVars = FV->noVariables;
22510 const MInt noPVars = PV->noVariables;
22511 const MInt childLevel = grid().raw().a_level(gridCellId) + 1;
22512 const MFloat childCellLength = c_cellLengthAtLevel(childLevel);
22513 const MFloat childVolume = grid().cellVolumeAtLevel(childLevel);
22514
22515 const MInt solverCellId = grid().tree().grid2solver(gridCellId);
22516
22517 const MFloat* const pvarsCell = ALIGNED_F(&a_pvariable(solverCellId, 0));
22518 const MFloat* const cvarsCell = ALIGNED_F(&a_variable(solverCellId, 0));
22519 const MFloat* const avarsCell = ALIGNED_F(&a_avariable(solverCellId, 0));
22520 const MFloat* const slopesCell = ALIGNED_F(&a_slope(solverCellId, 0, 0));
22521
22522 if(!g_multiSolverGrid) ASSERT(solverCellId == gridCellId, "");
22523 if(solverCellId < 0) return;
22524
22525 MInt noAddedChilds = 0;
22526
22527 for(MInt c = 0; c < grid().m_maxNoChilds; c++) {
22528 const MInt gridChildId = grid().raw().a_childId(gridCellId, c);
22529
22530 if(gridChildId < 0) continue;
22531 // not necessarily all childs will be used, some have not been added to the grid-tree
22532
22533 if(grid().azimuthalPeriodicity()) {
22534 // Solver flag will be set in proxy
22535 // The cartesianGrid does not know the geometry, therefore it needs to be checked
22536 // that the child actually is inside the geometry
22537 if(grid().checkOutsideGeometry(gridChildId) == 1) {
22538 grid().raw().setSolver(gridChildId, solverId(), false);
22539 continue;
22540 }
22541 }
22542
22543 // solverFlag is set in CartesianGrid<nDim>::setChildSolverFlag
22544 // solverFlag is false if the specific child lies outside the solver geoemtry
22545 if(!grid().solverFlag(gridChildId, solverId())) continue;
22546
22547 // Skip if cell is a partition level ancestor and its child was not newly created
22548 if(!grid().raw().a_hasProperty(gridChildId, Cell::WasNewlyCreated)
22549 && grid().raw().a_hasProperty(gridCellId, Cell::IsPartLvlAncestor)) {
22550 continue;
22551 }
22552
22553 MInt solverChildId = this->createCellId(gridChildId);
22554 noAddedChilds++;
22555
22556 ASSERT(grid().tree().solver2grid(solverChildId) == gridChildId, " ");
22557 if(!g_multiSolverGrid) ASSERT(solverChildId == gridChildId, "");
22558
22559 std::vector<std::vector<MFloat>> dQ(PV->noVariables, std::vector<MFloat>(nDim));
22560 MFloat U2 = F0;
22561 for(MInt i = 0; i < nDim; i++) {
22562 U2 += POW2(a_pvariable(solverCellId, PV->VV[i]));
22563 }
22564
22565 dQ = sysEqn().conservativeSlopes(pvarsCell, cvarsCell, avarsCell, slopesCell);
22566
22567 for(MInt v = 0; v < noCVars; v++) {
22568 for(MInt i = 0; i < nDim; i++) {
22569 dQ[v][i] *= F1B2 * childCellLength;
22570 if(std::isnan(dQ[v][i])) {
22571 dQ[v][i] = 0.0;
22572 }
22573 }
22574 }
22575 for(MInt v = 0; v < noCVars; v++) {
22576 a_variable(solverChildId, v) = a_variable(solverCellId, v);
22577 if(globalTimeStep > 0) {
22578 for(MInt i = 0; i < nDim; i++) {
22579 ASSERT(!std::isnan(dQ[v][i]), "");
22580 a_variable(solverChildId, v) += signStencil[c][i] * dQ[v][i];
22581 }
22582 }
22583 }
22584
22585 IF_CONSTEXPR(isDetChem<SysEqn>) {
22586 for(MUint v = 0; v < PV->m_noSpecies; v++) {
22587 a_speciesReactionRate(solverChildId, v) = a_speciesReactionRate(solverCellId, v);
22588 }
22589 }
22590 else {
22591 // ensure mass-conservancy for species:
22592 for(MInt s = 0; s < m_noSpecies; s++) {
22593 a_variable(solverChildId, CV->RHO_Y[s]) = a_variable(solverCellId, CV->RHO_Y[s]);
22594 }
22595 }
22596
22597 for(MInt v = 0; v < noCVars; v++) {
22598 a_oldVariable(solverChildId, v) = a_variable(solverChildId, v);
22599 }
22600 for(MInt v = 0; v < noFVars; v++) {
22601 a_rightHandSide(solverChildId, v) = FFPOW2(nDim) * a_rightHandSide(solverCellId, v);
22602 }
22603 for(MInt v = 0; v < noPVars; v++) {
22604 for(MInt i = 0; i < nDim; i++) {
22605 a_slope(solverChildId, v, i) = a_slope(solverCellId, v, i);
22606 }
22607 }
22608
22609 // STG adaptation
22610 IF_CONSTEXPR(SysEqn::m_noRansEquations == 0) {
22611 if(m_zonal) {
22612 vector<MInt>::iterator findAverageId = find(m_LESAverageCells.begin(), m_LESAverageCells.end(), solverCellId);
22613 vector<MInt>::iterator findAverageChildId =
22614 find(m_LESAverageCells.begin(), m_LESAverageCells.end(), solverChildId);
22615
22616 if(findAverageId != m_LESAverageCells.end() && !a_isHalo(solverChildId)) {
22617 if(findAverageChildId == m_LESAverageCells.end() && !a_isHalo(solverChildId)) {
22618 MInt LESAvgId = distance(m_LESAverageCells.begin(), findAverageId);
22619 for(MInt v = 0; v < m_LESNoVarAverage; v++) {
22620 m_LESVarAverage[v].push_back(m_LESVarAverage[v][LESAvgId]);
22621 }
22622 m_LESAverageCells.push_back(solverChildId);
22623 }
22624 }
22625 }
22626 }
22627
22628 setPrimitiveVariables(solverChildId);
22629
22630 a_bndryId(solverChildId) = -1;
22631
22632 a_cellVolume(solverChildId) = childVolume;
22633 a_FcellVolume(solverChildId) = F1 / childVolume;
22634
22635 a_noReconstructionNeighbors(solverChildId) = 0;
22636 for(MInt k = 0; k < m_cells.noRecNghbrs(); k++) {
22637 a_reconstructionNeighborId(solverChildId, k) = -1;
22638 }
22639
22640 // check-child-values
22641#if defined _MB_DEBUG_ || !defined NDEBUG
22642 for(MInt v = 0; v < noPVars; v++) {
22643 if(std::isnan(a_pvariable(solverChildId, v)) && a_hasProperty(solverCellId, SolverCell::IsOnCurrentMGLevel)
22644 && !a_isHalo(solverCellId)) {
22645 cerr << "Invalid-value in refined-Cell! "
22646 << " " << solverChildId << " " << endl;
22647 }
22648 }
22649 if(a_hasProperty(solverCellId, SolverCell::IsOnCurrentMGLevel) && !a_isHalo(solverCellId)
22650 && a_variable(solverChildId, CV->RHO) < m_eps) {
22651 cerr << "rho is zero or negative-2!" << endl;
22652 }
22653#endif
22654
22655 // necessary for diagonal bndryRefinement!
22656 // TODO labels:FV check why this changes the 2D_cylinder_adaptive-loadbalance_highPartitionLevelShift
22657 // testcase!
22658 if(m_levelSetMb) {
22659 a_hasProperty(solverChildId, SolverCell::IsOnCurrentMGLevel) =
22660 a_hasProperty(solverCellId, SolverCell::IsOnCurrentMGLevel);
22661 a_hasProperty(solverChildId, SolverCell::IsInactive) = a_hasProperty(solverCellId, SolverCell::IsInactive);
22662 }
22663 }
22664 a_noReconstructionNeighbors(solverCellId) = 0;
22665 for(MInt k = 0; k < m_cells.noRecNghbrs(); k++) {
22666 a_reconstructionNeighborId(solverCellId, k) = -1;
22667 }
22668
22669 if(m_sensorParticle && !a_isHalo(solverCellId) && noAddedChilds > 0) {
22670 const MInt noParticles = a_noPart(solverCellId);
22671
22672 MInt noParticlesEach = noParticles / noAddedChilds;
22673 MInt lastChild = -1;
22674 for(MInt child = 0; child < grid().m_maxNoChilds; child++) {
22675 const MInt childId = c_childId(solverCellId, child);
22676 if(childId < 0) continue;
22677 a_noPart(childId) = noParticles > 0 ? noParticlesEach : 0;
22678 lastChild = child;
22679 }
22680 MInt remainingParticles = noParticles - ((c_noChildren(solverCellId) - 1) * noParticlesEach);
22681 if(lastChild > -1) {
22682 a_noPart(c_childId(solverCellId, lastChild)) = noParticles > 0 ? remainingParticles : 0;
22683 }
22684
22685 if(noAddedChilds > 0) {
22686 a_noPart(solverCellId) = 0;
22687 }
22688 }
22689
22690 if(noAddedChilds > 0) {
22691 a_hasProperty(solverCellId, SolverCell::IsOnCurrentMGLevel) = false;
22692 }
22693}
constexpr MFloat FFPOW2(MInt x)

◆ reInitActiveCellIdsMemory()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::reInitActiveCellIdsMemory

Definition at line 23511 of file fvcartesiansolverxd.cpp.

23511 {
23513 mAlloc(m_activeCellIds, a_noCells(), "m_activeCellIds", -1, AT_);
23514}

◆ reInitSmallCellIdsMemory()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::reInitSmallCellIdsMemory

Definition at line 23520 of file fvcartesiansolverxd.cpp.

23520 {
23522 mAlloc(m_smallCellIds, a_noCells(), "m_smallCellIds", -1, AT_);
23524 mAlloc(m_masterCellIds, a_noCells(), "m_masterCellIds", -1, AT_);
23525}

◆ reIntAfterRestart()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::reIntAfterRestart ( MBool  doneRestart)
virtual

Reimplemented from Solver.

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 17107 of file fvcartesiansolverxd.cpp.

17107 {
17108 TRACE();
17109
17110 if(doneRestart) {
17113 }
17114}

◆ releaseMemory()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::releaseMemory ( )

◆ removeCell()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::removeCell ( const MInt  MInt)
overridevirtual

Reimplemented from Solver.

Definition at line 22839 of file fvcartesiansolverxd.cpp.

22839 {
22840 const MInt solverCellId = grid().tree().grid2solver(gridCellId);
22841
22842 ASSERT(gridCellId > -1 && gridCellId < grid().raw().treeb().size() && solverCellId > -1
22843 && solverCellId < m_cells.size() && grid().tree().solver2grid(solverCellId) == gridCellId,
22844 "");
22845 ASSERT(c_noChildren(solverCellId) == 0, "");
22846
22847 this->removeCellId(solverCellId);
22848}

◆ removeChilds()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::removeChilds ( const MInt  gridCellId)
overridevirtual
Author
Lennart Schneiders

Reimplemented from Solver.

Definition at line 22703 of file fvcartesiansolverxd.cpp.

22703 {
22704 const MInt solverCellId = grid().tree().grid2solver(gridCellId);
22705
22706 ASSERT(solverCellId > -1 && solverCellId < m_cells.size(), "");
22707 ASSERT(c_noChildren(solverCellId) > 0, "");
22708
22709 if(!g_multiSolverGrid) ASSERT(solverCellId == gridCellId, "");
22710 if(!g_multiSolverGrid) ASSERT(m_cells.size() == grid().raw().treeb().size(), "");
22711
22712 // reset the solverCell-properties for the new leaf-cell:
22713 //- volume
22714 //- variables
22715 //- oldVariables only if not already updated in fvmb-version!
22716 //- slope
22717 //- rightHandSide
22718 const MInt noCVars = CV->noVariables;
22719 const MInt noFVars = FV->noVariables;
22720 const MInt noPVars = PV->noVariables;
22721 a_cellVolume(solverCellId) = F0;
22722
22723 for(MInt v = 0; v < noCVars; v++) {
22724 a_variable(solverCellId, v) = F0;
22725 if(!m_levelSetMb) {
22726 a_oldVariable(solverCellId, v) = F0;
22727 }
22728 for(MInt i = 0; i < nDim; i++) {
22729 a_slope(solverCellId, v, i) = F0;
22730 }
22731 }
22732 for(MInt v = 0; v < noFVars; v++) {
22733 a_rightHandSide(solverCellId, v) = F0;
22734 }
22735
22736 MInt isInactive = 0;
22737 MInt noRemovedChilds = 0;
22738 MInt noParticles = 0;
22739
22740 for(MInt c = 0; c < grid().m_maxNoChilds; c++) {
22741 const MInt gridChildId = grid().raw().a_childId(gridCellId, c);
22742 const MInt childId = c_childId(solverCellId, c);
22743
22744 if(childId < 0) continue;
22745 noRemovedChilds++;
22746 if(m_sensorParticle) noParticles += a_noPart(childId);
22747
22748 ASSERT(grid().tree().solver2grid(childId) == gridChildId, "");
22749
22750 // only use active childs for interpolation!
22751 if(!a_hasProperty(childId, SolverCell::IsInactive)) {
22752 const MFloat vol = a_cellVolume(childId);
22753 a_cellVolume(solverCellId) += vol;
22754 for(MInt v = 0; v < noCVars; v++) {
22755 a_variable(solverCellId, v) += vol * a_variable(childId, v);
22756 if(!m_levelSetMb) {
22757 a_oldVariable(solverCellId, v) += vol * a_oldVariable(childId, v);
22758 }
22759 }
22760 for(MInt v = 0; v < noFVars; v++) {
22761 a_rightHandSide(solverCellId, v) += a_rightHandSide(childId, v);
22762 }
22763 for(MInt v = 0; v < noPVars; v++) {
22764 for(MInt j = 0; j < nDim; j++) {
22765 a_slope(solverCellId, v, j) += vol * a_slope(childId, v, j);
22766 }
22767 }
22768
22769 // STG adaptation
22770 IF_CONSTEXPR(SysEqn::m_noRansEquations == 0) {
22771 if(m_zonal) {
22772 vector<MInt>::iterator findAverageChildId =
22773 find(m_LESAverageCells.begin(), m_LESAverageCells.end(), solverCellId);
22774 if(findAverageChildId != m_LESAverageCells.end()) {
22775 MInt LESChildId = distance(m_LESAverageCells.begin(), findAverageChildId);
22776 for(MInt v = 0; v < m_LESNoVarAverage; v++) {
22777 m_LESVarAverage[v].erase(m_LESVarAverage[v].begin() + LESChildId);
22778 }
22779 m_LESAverageCells.erase(m_LESAverageCells.begin() + LESChildId);
22780 // m_noLESAverageCells--;
22781 }
22782 }
22783 }
22784
22785 } else {
22786 isInactive++;
22787 }
22788
22789 a_bndryId(childId) = -1;
22790 this->removeCellId(childId);
22791 }
22792
22793 if(m_sensorParticle) a_noPart(solverCellId) = noParticles;
22794
22795 // update variables and properties for the new leaf-cell:
22796 if(isInactive == noRemovedChilds) {
22797 // if of all childs are inactive, default variables are set!
22798 a_hasProperty(solverCellId, SolverCell::IsInactive) = true;
22799 a_hasProperty(solverCellId, SolverCell::IsOnCurrentMGLevel) = false;
22800 a_cellVolume(solverCellId) = c_cellVolumeAtLevel(a_level(solverCellId));
22801
22802 a_variable(solverCellId, CV->RHO) = m_rhoInfinity;
22803 IF_CONSTEXPR(hasE<SysEqn>)
22804 a_variable(solverCellId, CV->RHO_E) = m_rhoEInfinity;
22805 for(MInt dir = 0; dir < nDim; dir++) {
22806 a_variable(solverCellId, CV->RHO_VV[dir]) = m_rhoVVInfinity[dir];
22807 }
22808 } else {
22809 if(!a_isHalo(solverCellId)) {
22810 ASSERT(a_variable(solverCellId, CV->RHO) > 0, "Zero density when removing childs!");
22811 }
22812 for(MInt v = 0; v < noCVars; v++) {
22813 a_variable(solverCellId, v) /= mMax(m_volumeThreshold, a_cellVolume(solverCellId));
22814 if(!m_levelSetMb) {
22815 a_oldVariable(solverCellId, v) /= mMax(m_volumeThreshold, a_cellVolume(solverCellId));
22816 }
22817 }
22818 for(MInt v = 0; v < noPVars; v++) {
22819 for(MInt i = 0; i < nDim; i++) {
22820 a_slope(solverCellId, v, i) /= mMax(m_volumeThreshold, a_cellVolume(solverCellId));
22821 }
22822 }
22823 a_hasProperty(solverCellId, SolverCell::IsOnCurrentMGLevel) = true;
22824 a_hasProperty(solverCellId, SolverCell::IsInactive) = false;
22825 }
22826
22827 a_FcellVolume(solverCellId) = F1 / mMax(m_volumeThreshold, a_cellVolume(solverCellId));
22828 setPrimitiveVariables(solverCellId);
22829
22830 // only single-solver!
22831 if(!g_multiSolverGrid) ASSERT((m_cells.size() - grid().raw().treeb().size()) <= grid().m_maxNoChilds, "");
22832}

◆ requiresTimeStepUpdate()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::requiresTimeStepUpdate
protected

Does the time-step need to be recomputed on this step?

Definition at line 9742 of file fvcartesiansolverxd.cpp.

9742 {
9744 case -1:
9745 case 0: {
9746 return false;
9747 } // only once at the beginning
9748 default: {
9750 mTerm(1, AT_,
9751 "timeStepComputationInterval is " + to_string(m_timeStepComputationInterval)
9752 + " and out-of-range [-1, infinity)");
9753 }
9755 }
9756 }
9757}

◆ resetBoundaryCells()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::resetBoundaryCells ( const MInt  offset = 0)
virtual

◆ resetCutOffCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resetCutOffCells
  • *
    Author
    Tim Wegmann

Definition at line 25062 of file fvcartesiansolverxd.cpp.

25062 {
25063 TRACE();
25064
25065 // Note: reset only for existing cells and not for maxNoGridCell(), clearing the collector or
25066 // adding new cells will invalidate the properties anyways
25067 for(MInt c = 0; c < m_cells.size(); c++) {
25068 a_hasProperty(c, SolverCell::IsCutOff) = false;
25069 }
25070
25072}
void resetCutOff()
reset sorterdCutOff Cells and cutOff communicator before balancing and adaptation!

◆ resetExternalSources()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resetExternalSources
Author
Sven Berger
Date
April 2018

Definition at line 9701 of file fvcartesiansolverxd.cpp.

9701 {
9702 TRACE();
9703
9704 ASSERT(m_hasExternalSource, "");
9705
9706 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
9707 for(MInt var = 0; var < CV->noVariables; var++) {
9708 a_externalSource(cellId, var) = 0;
9709 }
9710 }
9711}

◆ resetImplicitCoefficients()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resetImplicitCoefficients
virtual

Definition at line 11238 of file fvcartesiansolverxd.cpp.

11238 {
11239 TRACE();
11240
11241#ifdef _OPENMP
11242#pragma omp parallel for collapse(2)
11243#endif
11244 // Set implicit coefficient to zero
11245 for(MInt i = 0; i < a_noCells(); i++) {
11246 for(MInt j = 0; j < 2 * nDim; j++) {
11247 a_implicitCoefficient(i, j) = F0;
11248 }
11249 }
11250}
MFloat & a_implicitCoefficient(const MInt cellId, const MInt coefId)
Returns the implicitCoefficient of cell cellId for coefficient coefId.

◆ resetRHS()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resetRHS
virtual

Definition at line 6120 of file fvcartesiansolverxd.cpp.

6120 {
6121 TRACE();
6122
6123 const MInt noFVars = FV->noVariables;
6124 //---
6125
6126#ifdef _OPENMP
6127#pragma omp parallel for collapse(2)
6128#endif
6129 for(MInt id = 0; id < a_noCells(); id++) {
6130 for(MInt varId = 0; varId < noFVars; varId++) {
6131 a_rightHandSide(id, varId) = F0;
6132 }
6133 }
6134}

◆ resetRHSCutOffCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resetRHSCutOffCells
virtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 12532 of file fvcartesiansolverxd.cpp.

12532 {
12533 TRACE();
12534 const MInt noFVars = FV->noVariables;
12535 //---
12536
12537
12538 // reset rhs rot periodic cells (azimuthal periodicity concept)
12539 if(m_periodicCells == 1 || m_periodicCells == 2 || m_periodicCells == 3) {
12540#ifdef _OPENMP
12541#pragma omp parallel for collapse(2)
12542#endif
12543 for(MInt c = 0; c < m_sortedPeriodicCells->size(); c++) {
12544 for(MInt v = 0; v < noFVars; v++) {
12546 }
12547 }
12548 }
12549
12550// reset rhs of cutoff boundary cells
12551#ifdef _OPENMP
12552#pragma omp parallel for
12553#endif
12554 for(MInt bcId = 0; bcId < m_fvBndryCnd->m_noCutOffBndryCndIds; bcId++) {
12555 const MInt noCutOffCells = m_fvBndryCnd->m_sortedCutOffCells[bcId]->size();
12556 for(MInt scc = 0; scc < noCutOffCells; scc++) {
12557 for(MInt v = 0; v < noFVars; v++) {
12558 a_rightHandSide(m_fvBndryCnd->m_sortedCutOffCells[bcId]->a[scc], v) = F0;
12559 }
12560 }
12561 }
12562}

◆ resetRHSNonInternalCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resetRHSNonInternalCells
virtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 7623 of file fvcartesiansolverxd.cpp.

7623 {
7624 TRACE();
7625
7626 const MInt noFVars = FV->noVariables;
7627 const MInt noCells = a_noCells();
7628
7629 const MInt offset = noInternalCells();
7630 //---
7631
7632#ifdef _OPENMP
7633#pragma omp parallel for collapse(2)
7634#endif
7635 for(MInt c = offset; c < noCells; c++) {
7636 for(MInt varId = 0; varId < noFVars; varId++) {
7637 a_rightHandSide(c, varId) = F0;
7638 }
7639 }
7640}

◆ resetSolver()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resetSolver
overridevirtual
Author
Lennart Schneiders

Reimplemented from Solver.

Definition at line 24264 of file fvcartesiansolverxd.cpp.

24264 {
24266
24267 // apply and reset, as external sources are not exchanged during balance!
24268 /*
24269 if(m_hasExternalSource && m_levelSetMb) {
24270 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
24271 if(!a_hasProperty(cellId, SolverCell::IsActive)) continue;
24272 for(MInt var = 0; var < CV->noVariables; var++) {
24273 a_rightHandSide(cellId, var) -= a_externalSource(cellId, var);
24274 }
24275 }
24276 }
24277 */
24281 }
24282}
virtual void advanceExternalSource()

◆ resetSolverFull()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::resetSolverFull ( )
virtual

◆ resetSponge()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resetSponge
Author
Tim Wegmann

Definition at line 24290 of file fvcartesiansolverxd.cpp.

24290 {
24291 TRACE();
24292
24293 for(MInt c = 0; c < m_noCellsInsideSpongeLayer; c++) {
24294 // const MInt cellId = m_cellsInsideSpongeLayer[ c ];
24295 // a_hasProperty(cellId, SolverCell::IsInSpongeLayer) = false;
24296 // a_spongeFactor(cellId) = F0;
24298 }
24300}

◆ resetSurfaces()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resetSurfaces
virtual
Author
Lennart Schneiders

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 23000 of file fvcartesiansolverxd.cpp.

23000 {
23001 m_surfaces.clear(); // invalidate all elements and set size to 0
23003 std::set<MInt>().swap(m_splitSurfaces);
23004}
std::set< MInt > m_splitSurfaces

◆ resetZonalLESAverage()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resetZonalLESAverage
virtual

Definition at line 38256 of file fvcartesiansolverxd.cpp.

38256 {
38257 TRACE();
38258
38259 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
38260
38261 for(MInt var = 0; var < m_LESNoVarAverage; var++) {
38262 m_LESVarAverage[var].clear();
38263 for(auto it = std::begin(m_LESAverageCells); it != std::end(m_LESAverageCells); ++it) {
38264 m_LESVarAverage[var].push_back(F0);
38265 }
38266 }
38267}

◆ resetZonalSolverData()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resetZonalSolverData
virtual

Definition at line 38337 of file fvcartesiansolverxd.cpp.

38337 {
38338 TRACE();
38339
38340 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) {
38341 for(MInt var = 0; var < m_noLESVariables; var++) {
38342 m_LESValues[var].resize(c_noCells());
38343 }
38344 }
38345 else {
38346 for(MInt var = 0; var < m_noRANSVariables; var++) {
38347 m_RANSValues[var].resize(c_noCells());
38348 }
38349 }
38350}
std::vector< MFloat > * m_LESValues

◆ resizeGridMap()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::resizeGridMap
overridevirtual

Reimplemented from Solver.

Definition at line 22957 of file fvcartesiansolverxd.cpp.

22957 {
22958 grid().resizeGridMap(m_cells.size());
22959}

◆ restartWMSurfaces()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::restartWMSurfaces
protected

Definition at line 18549 of file fvcartesiansolverxd.cpp.

18549 {
18550 TRACE();
18551
18552 m_log << "Reading WM Surface data from restart file ...";
18553
18554 using namespace maia;
18555 using namespace parallel_io;
18556
18557 // This should be the same of the function calling this and providing tmpVar
18558 ParallelIo::size_type dimLen = noInternalCells();
18559 ParallelIo::size_type start = domainOffset(domainId()) - grid().bitOffset();
18560
18561
18562 stringstream varFileName;
18563
18565 // gridFileName << restartDir() << "restartGrid_" << domainId() << ParallelIo::fileExt();
18566 if(m_multipleFvSolver) {
18567 varFileName << restartDir() << "restartVariables" << m_solverId << ParallelIo::fileExt();
18568 } else {
18569 varFileName << restartDir() << "restartVariables" << ParallelIo::fileExt();
18570 }
18571 } else {
18572 if(!isMultilevel()) {
18573 if(m_multipleFvSolver) {
18574 varFileName << restartDir() << "restartVariables" << m_solverId << "_" << m_restartTimeStep
18575 << ParallelIo::fileExt();
18576 } else {
18577 varFileName << restartDir() << "restartVariables_" << m_restartTimeStep << ParallelIo::fileExt();
18578 }
18579 } else {
18580 // For multilevel, use solver-specific file name for restart files
18581 const MInt maxLength = 256;
18582 array<MChar, maxLength> buffer{};
18583 snprintf(buffer.data(), maxLength, "restart_b%02d_t%08d", solverId(), m_restartTimeStep);
18584 varFileName << restartDir() << MString(buffer.data()) << ParallelIo::fileExt();
18585 }
18586 }
18587
18588 ParallelIo parallelIo(varFileName.str().c_str(), maia::parallel_io::PIO_READ, mpiComm());
18589
18590 // set offset for all read operations
18591 parallelIo.setOffset(dimLen, start);
18592
18593 // load variable names :
18594 static constexpr MInt maxVariables(128);
18595 array<MString, maxVariables> varNames;
18596
18597 for(MInt vId = 0; vId < maxVariables; vId++) {
18598 MString varName = "variables" + to_string(vId);
18599
18600 if(!parallelIo.hasDataset(varName)) {
18601 break;
18602 }
18603 MString tmp;
18604 parallelIo.getAttribute(&tmp, "name", varName);
18605 varNames[vId] = tmp;
18606 }
18607
18608 auto varPosition = [&](const MString& _varName) {
18609 auto it = find(varNames.begin(), varNames.end(), _varName);
18610 if(it == varNames.end()) {
18611 mTerm(-1, "Couldn't find variable with name " + _varName + " for solver " + to_string(m_solverId));
18612 }
18613 return "variables" + to_string(distance(varNames.begin(), it));
18614 };
18615
18616 /*
18617 auto hasVar = [&](const MString& _varName) {
18618 auto it = find(varNames.begin(), varNames.end(), _varName);
18619 return !(it == varNames.end());
18620 };
18621 */
18622
18623 // load out variables
18624 MFloatScratchSpace tmpVar((MInt)dimLen, AT_, "tmpVar");
18625
18626 // shear velocity utau
18627 parallelIo.readArray(tmpVar.getPointer(), varPosition("utau"));
18628 for(MUint wmSrfcId = 0; wmSrfcId < m_wmSurfaces.size(); wmSrfcId++) {
18629 const MInt bndryCellId = m_wmSurfaces[wmSrfcId].m_bndryCellId;
18630 const MInt cellId = m_bndryCells->a[bndryCellId].m_cellId;
18631 m_wmSurfaces[wmSrfcId].m_wmUTAU = tmpVar.p[cellId];
18632 }
18633
18634 // parallel velocity u_II
18635 parallelIo.readArray(tmpVar.getPointer(), varPosition("u_II"));
18636 for(MUint wmSrfcId = 0; wmSrfcId < m_wmSurfaces.size(); wmSrfcId++) {
18637 const MInt bndryCellId = m_wmSurfaces[wmSrfcId].m_bndryCellId;
18638 const MInt cellId = m_bndryCells->a[bndryCellId].m_cellId;
18639 m_wmSurfaces[wmSrfcId].m_wmUII = tmpVar.p[cellId];
18640 }
18641
18642 m_log << " done." << endl;
18643}

◆ revertTimestep()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::revertTimestep

Definition at line 11230 of file fvcartesiansolverxd.cpp.

11230 {
11231 const MFloat dt = timeStep(true);
11232 m_time -= dt;
11233 m_physicalTime -= dt * m_timeRef;
11234 m_RKStep = 0;
11235}

◆ rhs()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::rhs

Compute right-hand side.

Author
Sven Berger
Template Parameters
nDim

Definition at line 9772 of file fvcartesiansolverxd.cpp.

9772 {
9773 TRACE();
9774 RECORD_TIMER_START(m_timers[Timers::TimeInt]);
9775 RECORD_TIMER_START(m_timers[Timers::Rhs]);
9776
9777 resetRHS();
9778
9779 IF_CONSTEXPR(isDetChem<SysEqn>) {
9780 RECORD_TIMER_START(m_timers[Timers::CellCenterCoefficients]);
9782 RECORD_TIMER_STOP(m_timers[Timers::CellCenterCoefficients]);
9783 }
9784
9785 RECORD_TIMER_START(m_timers[Timers::Muscl]);
9786 Muscl();
9787 RECORD_TIMER_STOP(m_timers[Timers::Muscl]);
9788
9789#if defined(WITH_CANTERA)
9790 if(m_detChem.hasChemicalReaction && (m_RKStep == 0)) {
9791 IF_CONSTEXPR(isDetChem<SysEqn>) {
9792 RECORD_TIMER_START(m_timers[Timers::SpeciesReactionRates]);
9794 RECORD_TIMER_STOP(m_timers[Timers::SpeciesReactionRates]);
9795 }
9796 }
9797 IF_CONSTEXPR(isDetChem<SysEqn>) {
9798 RECORD_TIMER_START(m_timers[Timers::SurfaceCoefficients]);
9800 RECORD_TIMER_STOP(m_timers[Timers::SurfaceCoefficients]);
9801 }
9802#endif
9803
9804 RECORD_TIMER_START(m_timers[Timers::Ausm]);
9805 Ausm();
9806 RECORD_TIMER_STOP(m_timers[Timers::Ausm]);
9807
9808 RECORD_TIMER_START(m_timers[Timers::ViscFlux]);
9809 if(!m_euler) {
9810 viscousFlux();
9811 // TODO labels:FV Decide if those two variants are still needed. If yes, move to appropriate SysEqn!
9812 IF_CONSTEXPR(nDim == 2) {
9813 if(m_combustion) {
9814 if(m_plenum) {
9815 mTerm(1, "Move to sysEqn!");
9817 } else if(m_divergenceTreatment) {
9818 mTerm(1, "Move to sysEqn!");
9820 }
9821 }
9822 }
9823 }
9824 RECORD_TIMER_STOP(m_timers[Timers::ViscFlux]);
9825
9826 RECORD_TIMER_START(m_timers[Timers::DistFlux]);
9828 RECORD_TIMER_STOP(m_timers[Timers::DistFlux]);
9829
9830 RECORD_TIMER_START(m_timers[Timers::RhsMisc]);
9831 if(m_combustion) {
9833 }
9834
9835 IF_CONSTEXPR(isDetChem<SysEqn>) {
9836 if(m_detChem.hasChemicalReaction) {
9838 }
9839 }
9840
9843 }
9844
9845 if(m_rans) {
9847 }
9848
9851 }
9852
9853 if(m_dualTimeStepping) {
9854 dqdtau();
9855 }
9856
9857 IF_CONSTEXPR(isEEGas<SysEqn>) rhsEEGas();
9858
9861 }
9862 RECORD_TIMER_STOP(m_timers[Timers::RhsMisc]);
9863
9864 RECORD_TIMER_STOP(m_timers[Timers::Rhs]);
9865 RECORD_TIMER_STOP(m_timers[Timers::TimeInt]);
9866}
virtual void viscousFlux_Gequ_Pv_Plenum()
Computes the viscous flux using a central difference scheme, modified version for flame plenum comput...
void computeSpeciesReactionRates()
Dispatches the species reaction rate computation at each cell by calling the relevant method from the...
virtual void viscousFlux_Gequ_Pv()
Computes the viscous flux using a central difference scheme.
virtual void Ausm()
Dispatches the AUSM flux computation for different number of species.
virtual void Muscl(MInt=-1)
Reconstructs the flux on the surfaces.
virtual void distributeFluxToCells()
Distributes the surface fluxes to the cell RHS.
virtual void applyExternalSource()
Add external sources to the RHS.

◆ rhsBnd()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::rhsBnd

Apply boundary condition

Author
Sven Berger
Template Parameters
nDim

Definition at line 9873 of file fvcartesiansolverxd.cpp.

9873 {
9874 TRACE();
9875 RECORD_TIMER_START(m_timers[Timers::TimeInt]);
9876 RECORD_TIMER_START(m_timers[Timers::RhsBnd]);
9877
9879
9880 updateJet();
9881
9883
9885
9887
9889
9893 }
9894
9895 RECORD_TIMER_STOP(m_timers[Timers::RhsBnd]);
9896 RECORD_TIMER_STOP(m_timers[Timers::TimeInt]);
9897}
virtual void smallCellRHSCorrection(const MInt timerId=-1)
virtual void updateJet()
jet volume forcing jet volume forcing with vortex rings. Velocity profile and forcing ref: "Effects o...
virtual void resetRHSNonInternalCells()
virtual void correctMasterCells()
adds the right hand side of small cells to their corresponding master cells and sets the small cell R...
virtual void updateSpongeLayer()
computes the additional rhs of all cells lying inside the sponge layer to dissipate outgoing waves.
virtual void nonReflectingBCCutOff()
virtual void resetRHSCutOffCells()

◆ rhsEEGas()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isEEGas< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::rhsEEGas

Definition at line 11254 of file fvcartesiansolverxd.cpp.

11254 {
11255 TRACE();
11256 if(nDim != 3) mTerm(1, AT_, "nDim has to be 3 for EEGas simulations");
11257
11258 // gas mass source
11259 if(m_EEGas.gasSource != 0) {
11260 for(auto& sourceCell : m_EEGas.gasSourceCells) {
11261 a_rightHandSide(sourceCell, CV->A_RHO) -= m_EEGas.massSource * a_cellVolume(sourceCell);
11262 }
11263 }
11264
11265// adapted from computeVolumeForces()
11266// Gravity
11267#ifdef _OPENMP
11268#pragma omp parallel for
11269#endif
11270 for(MInt ac = 0; ac < m_noActiveCells; ac++) {
11271 for(MInt i = 0; i < nDim; i++) {
11272 a_rightHandSide(m_activeCellIds[ac], CV->A_RHO_VV[i]) -=
11274 * a_pvariable(m_activeCellIds[ac], PV->A);
11275 IF_CONSTEXPR(hasE<SysEqn>)
11276 a_rightHandSide(m_activeCellIds[ac], CV->A_RHO_E) -=
11279 }
11280 }
11281
11282
11283 // Interface forces between bubbles and liquid
11284 static const MFloat Eo_factor = m_EEGas.Eo0 / (m_EEGas.liquidDensity - m_rhoInfinity);
11285 const MFloat F_D_factor = F3B4 * m_EEGas.liquidDensity / m_EEGas.bubbleDiameter; // = 3/4 * rho_l / d_B
11286 const MFloat F1Bdt = F1 / timeStep(true);
11287 const MFloat F1BdtLiquid =
11288 F1
11289 / (timeStep(true)
11290 * (m_EEGas.interpolationFactor > 0.0 ? m_EEGas.interpolationFactor * m_RKalpha[m_RKStep] : 1.0));
11291 const MFloat* const RESTRICT cellVol = &a_cellVolume(0);
11292#ifdef _OPENMP
11293#pragma omp parallel for
11294#endif
11295 for(MInt ac = 0; ac < m_noActiveCells; ac++) {
11296 const MInt cellId = m_activeCellIds[ac];
11297 if(a_isBndryGhostCell(cellId)) continue;
11298 MFloat F_D_factorCell = 0.0;
11299 MFloat C_D = 0.0;
11300 if(m_EEGas.dragModel == 0) {
11301 const MFloat Eo = Eo_factor * (m_EEGas.liquidDensity - a_pvariable(cellId, PV->RHO)); // Eotvos number
11302 C_D = F2B3 * sqrt(Eo); // only valid in regime of distorted bubbles (see Mohammadi et al. 2019)
11303 F_D_factorCell = F_D_factor * C_D;
11304 } else if(m_EEGas.dragModel == 1) {
11305 MFloat uSlip = 0.0;
11306 for(MInt i = 0; i < nDim; i++) {
11307 uSlip = mMax(uSlip, abs(a_uOtherPhase(cellId, i) - a_pvariable(cellId, PV->VV[i])));
11308 }
11309 const MFloat nu_l = a_nuEffOtherPhase(cellId) - a_nuTOtherPhase(cellId);
11310 const MFloat l_bubbleDiameter = m_EEGas.bubbleDiameter;
11311 C_D = 24.0 * nu_l / (sysEqn().m_Re0 * uSlip * l_bubbleDiameter);
11312 F_D_factorCell = F_D_factor * C_D;
11313 } else if(m_EEGas.dragModel == 2) {
11314 C_D = m_EEGas.CD;
11315 F_D_factorCell = F_D_factor * C_D;
11316 } else if(m_EEGas.dragModel == 3) {
11317 F_D_factorCell = a_alphaGas(cellId) * 18.0 / sysEqn().m_Re0
11318 * (a_nuEffOtherPhase(cellId) - a_nuTOtherPhase(cellId)) * m_EEGas.liquidDensity
11319 / mMin(10.0, 1 - a_alphaGas(cellId)) / m_EEGas.bubbleDiameter / m_EEGas.bubbleDiameter;
11320 }
11321
11322 MFloat u_d[3];
11323 MFloat liftV[3];
11324 for(MInt i = 0; i < 3; i++) {
11325 u_d[i] = a_pvariable(cellId, PV->VV[i]) - a_uOtherPhase(cellId, i);
11326 }
11327 maia::math::cross(&u_d[0], &a_vortOtherPhase(cellId, 0), &liftV[0]);
11328
11329 const MFloat F_L_factorCell = m_EEGas.CL * a_alphaGas(cellId) * m_EEGas.liquidDensity;
11330
11331 MFloat F1BOldrhoAlpha = F0;
11332 if(a_oldVariable(cellId, CV->A_RHO) > -m_EEGas.eps) {
11333 F1BOldrhoAlpha = F1 / max(m_EEGas.eps, a_oldVariable(cellId, CV->A_RHO));
11334 } else {
11335 F1BOldrhoAlpha = F1 / a_oldVariable(cellId, CV->A_RHO);
11336 }
11337 const MFloat F_VM_factorCell = 0.5 * a_alphaGas(cellId) * m_EEGas.liquidDensity;
11338
11339 const MFloat Sc = m_EEGas.schmidtNumber; // Schmidt number
11340 MFloat F_TD_factorCell = 0.0;
11341 if(m_EEGas.dragModel == 3) {
11342 F_TD_factorCell = -18.0 / sysEqn().m_Re0 / sysEqn().m_Re0 / Sc * m_EEGas.liquidDensity / m_EEGas.bubbleDiameter
11343 / m_EEGas.bubbleDiameter * a_nuEffOtherPhase(cellId)
11344 * (a_nuEffOtherPhase(cellId) - a_nuTOtherPhase(cellId)) / mMin(10.0, 1 - a_alphaGas(cellId));
11345 } else {
11346 F_TD_factorCell = -F1 / sysEqn().m_Re0 * F_D_factorCell / Sc * a_nuEffOtherPhase(cellId);
11347 }
11348
11349 const MInt dragModel = m_EEGas.dragModel;
11350
11351 const MFloat C_D0 = F_D_factorCell * m_EEGas.RKSemiImplicitFactor;
11352 const MFloat dt = timeStep(true) * m_RKalpha[m_RKStep];
11353 const MFloat C_VM0 = F_VM_factorCell / dt * m_EEGas.RKSemiImplicitFactor;
11354
11355 for(MInt i = 0; i < nDim; i++) {
11356 // Calculation of the implicit coefficients
11357 MFloat C_D1, C_D2;
11358 const MInt sign = (0.0 < (-u_d[i])) - ((-u_d[i]) < 0.0);
11359 if(dragModel == 3) {
11360 C_D1 = C_D0 * a_uOtherPhase(cellId, i);
11361 C_D2 = -C_D0;
11362 } else {
11363 C_D1 =
11364 C_D0 * a_alphaGas(cellId) * sign * (POW2(a_uOtherPhase(cellId, i)) - POW2(a_pvariable(cellId, PV->VV[i])));
11365 C_D2 = 2.0 * C_D0 * a_alphaGas(cellId) * sign * u_d[i];
11366 }
11367 const MFloat gradAlpha = a_slope(cellId, PV->A, i);
11368 const MFloat C_TD0 = -F1 / sysEqn().m_Re0 * C_D0 / Sc * a_nuEffOtherPhase(cellId) * gradAlpha;
11369 MFloat C_TD1, C_TD2;
11370 if(dragModel == 3) {
11371 C_TD1 = 0.0;
11372 C_TD2 = 0.0;
11373 } else {
11374 C_TD1 = C_TD0 * a_uOtherPhase(cellId, i) * sign;
11375 C_TD2 = -C_TD0 * sign;
11376 }
11377 const MFloat C_VM1 = C_VM0 * a_pvariable(cellId, PV->VV[i]);
11378 const MFloat C_VM2 = -C_VM0;
11379 a_implicitCoefficient(cellId, i * 2) = (C_D1 + C_TD1 + C_VM1) * cellVol[cellId];
11380 a_implicitCoefficient(cellId, i * 2 + 1) = (C_D2 + C_TD2 + C_VM2) * cellVol[cellId];
11381 // Drag force
11382 MFloat F_D = 0.0;
11383 if(m_EEGas.dragModel == 3) {
11384 F_D = F_D_factorCell * -u_d[i];
11385 } else {
11386 F_D = F_D_factorCell * a_alphaGas(cellId) * -u_d[i] * abs(u_d[i]);
11387 }
11388
11389 // Lift force
11390 // Mohammadi et al. 2019
11391 const MFloat F_L = F_L_factorCell * liftV[i];
11392
11393 // buoyancy force
11394 // F_B = - alpha_g * rho_l * g_vec
11395 const MFloat F_B =
11396 m_EEGas.depthCorrection ? -a_alphaGas(cellId) * m_EEGas.liquidDensity * m_EEGas.gravity[i] : 0.0;
11397
11398 // Virtual mass force
11399 // Mohammadi et al. 2019
11400 MFloat duOtherPhaseDt = (a_uOtherPhase(cellId, i) - a_uOtherPhaseOld(cellId, i)) * F1BdtLiquid;
11401 MFloat duDt = 0.0;
11402 if(m_RKStep == 0) {
11403 duDt = (a_pvariable(cellId, PV->VV[i]) - a_oldVariable(cellId, CV->A_RHO_VV[i]) * F1BOldrhoAlpha) * F1Bdt;
11404 } else {
11405 duDt = (a_pvariable(cellId, PV->VV[i]) - a_oldVariable(cellId, CV->A_RHO_VV[i]) * F1BOldrhoAlpha) * F1Bdt
11406 / m_RKalpha[m_RKStep - 1];
11407 }
11408 const MFloat F_VM_I = (F1BOldrhoAlpha > F1 / m_EEGas.eps * 0.999 || F1BOldrhoAlpha < -F1 / m_EEGas.eps * 0.999)
11409 ? 0.0
11410 : -F_VM_factorCell * duDt;
11411 const MFloat F_VM_E = F_VM_factorCell
11412 * ((duOtherPhaseDt + a_uOtherPhase(cellId, 0) * a_gradUOtherPhase(cellId, i, 0)
11413 + a_uOtherPhase(cellId, 1) * a_gradUOtherPhase(cellId, i, 1)
11414 + a_uOtherPhase(cellId, 2) * a_gradUOtherPhase(cellId, i, 2))
11415 - (a_pvariable(cellId, PV->VV[0]) * a_slope(cellId, PV->VV[i], 0)
11416 + a_pvariable(cellId, PV->VV[1]) * a_slope(cellId, PV->VV[i], 1)
11417 + a_pvariable(cellId, PV->VV[2]) * a_slope(cellId, PV->VV[i], 2)));
11418
11419 // Turbulent dispersion force
11420 // Mohammadi et al. 2019
11421 MFloat F_TD = 0.0;
11422 if(m_EEGas.dragModel == 3) {
11423 F_TD = F_TD_factorCell * a_slope(cellId, PV->A, i);
11424 } else {
11425 F_TD = F_TD_factorCell * abs(u_d[i]) * a_slope(cellId, PV->A, i);
11426 }
11427 const MFloat explicitFF = 1.0 - m_EEGas.RKSemiImplicitFactor;
11428
11429 a_rightHandSide(cellId, CV->A_RHO_VV[i]) -= // (-) because rhs is substracted from cell value in RK-step
11430 (F_D * explicitFF + F_L + F_VM_I * explicitFF + F_VM_E + F_TD * (m_EEGas.dragModel == 3 ? 1.0 : explicitFF)
11431 + F_B)
11432 * a_cellVolume(cellId);
11433 }
11434 }
11435}
MFloat a_nuEffOtherPhase(const MInt cellId) const
MFloat a_gradUOtherPhase(const MInt cellId, const MInt uDir, const MInt gradDir) const
MFloat a_vortOtherPhase(const MInt cellId, const MInt dir) const
MFloat a_nuTOtherPhase(const MInt cellId) const
MFloat a_uOtherPhase(const MInt cellId, const MInt dir) const
MFloat a_uOtherPhaseOld(const MInt cellId, const MInt dir) const
void cross(const T *const u, const T *const v, T *const c)
Definition: maiamath.h:101

◆ rotateVectorAzimuthal()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::rotateVectorAzimuthal ( MInt  side,
MFloat data,
MInt  noData,
const std::vector< MInt > &  indices 
)

◆ rungeKuttaStep()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::rungeKuttaStep
virtual

The objective is to encourage the compiler to generate different optimized version depending on the value of m_noSpecies.

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 19813 of file fvcartesiansolverxd.cpp.

19813 {
19814 const MUint noSpecies = m_noSpecies;
19815
19816 IF_CONSTEXPR(isEEGas<SysEqn>) { return rungeKuttaStepEEGas(); }
19817 else {
19818 if(noSpecies == 0) {
19819 return rungeKuttaStep_(0);
19820 } else if(noSpecies == 1) {
19821 return rungeKuttaStep_(1);
19822 } else {
19823 return rungeKuttaStep_(noSpecies);
19824 }
19825 }
19826}

◆ samplingInterval()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::samplingInterval

Definition at line 6227 of file fvcartesiansolverxd.cpp.

6227 {
6228 TRACE();
6229 return mMax(1, (MInt)(F1 / (timeStep() * m_timeRef * m_sampleRate)));
6230}

◆ saveDebugRestartFile()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::saveDebugRestartFile
Author
Tim Wegmann

Definition at line 18113 of file fvcartesiansolverxd.cpp.

18113 {
18114 stringstream gridFile;
18115 stringstream gridFilePath;
18116 gridFile << "grid_" << globalTimeStep << ".Netcdf";
18117 gridFilePath << outputDir() << "grid_" << globalTimeStep << ".Netcdf";
18118 MIntScratchSpace recalcIds(grid().raw().treeb().size(), AT_, "recalcIds");
18119
18120 grid().raw().saveGrid((gridFilePath.str()).c_str(), recalcIds.begin());
18121
18122 writeRestartFile(true, false, (gridFile.str()).c_str(), recalcIds.begin());
18123}
void writeRestartFile(const MBool, const MBool, const MString, MInt *) override

◆ saveGridFlowVarsPar()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::saveGridFlowVarsPar ( const MChar fileName,
MInt  noTotalCells,
MLong  noInternalCellIds,
MFloatScratchSpace dbVariables,
std::vector< MString > &  dbVariablesName,
MInt  noDbVars,
MIntScratchSpace idVariables,
std::vector< MString > &  idVariablesName,
MInt  noIdVars,
MFloatScratchSpace dbParameters,
std::vector< MString > &  dbParametersName,
MIntScratchSpace idParameters,
std::vector< MString > &  idParametersName,
const MInt recalcIds 
)
protected

possible variables: doubles, integers collected by this->collectVariables() possible parameters: doubles, integers collected by this->collectParameters()

Todo:
labels:FV,IO writing an IO class
Author
Stephan Schlimpert, update Tim Wegmann
Date
October 2011, Nov. 2020

Definition at line 8403 of file fvcartesiansolverxd.cpp.

8407 {
8408 TRACE();
8409
8410 IF_CONSTEXPR(nDim != 2 && nDim != 3) {
8411 stringstream errorMessage;
8412 errorMessage << " In global function saveGridFlowVarsPar: wrong number of dimensions !" << endl;
8413 mTerm(1, AT_, errorMessage.str());
8414 return;
8415 }
8416
8417 // File creation.
8418 MString tmpNcVariablesName;
8419 noDbVars = dbVariablesName.size();
8420 noIdVars = idVariablesName.size();
8421 MInt noIdPars = idParametersName.size();
8422 MInt noDbPars = dbParametersName.size();
8423 vector<MString> ncVariablesName;
8424 MFloat* tmpDbVariables;
8425 MInt* tmpIdVariables;
8426
8427 using namespace parallel_io;
8428 ParallelIo parallelIo(fileName, PIO_REPLACE, mpiComm());
8429
8430 // Creating file header
8431 MLong num = -1;
8432 auto longNoInternalCells = (MLong)noInternalCellIds;
8433 MPI_Allreduce(&longNoInternalCells, &num, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "longNoInternalCells", "num");
8434 parallelIo.setAttribute(num, "noCells");
8435
8436 parallelIo.setAttribute(solverId(), "solverId");
8437
8438
8439 for(MInt j = 0; j < noDbVars; j++) {
8440 tmpNcVariablesName = "variables" + to_string(j);
8441 ncVariablesName.push_back(tmpNcVariablesName);
8442
8443 parallelIo.defineArray(PIO_FLOAT, ncVariablesName[j], num);
8444 m_log << dbVariablesName[j].c_str() << endl;
8445 parallelIo.setAttribute(dbVariablesName[j], "name", ncVariablesName[j]);
8446 }
8447
8448 for(MInt j = 0; j < noIdVars; j++) {
8449 MInt k = j + noDbVars;
8450 tmpNcVariablesName = "variables" + to_string(k);
8451 ncVariablesName.push_back(tmpNcVariablesName);
8452
8453 parallelIo.defineArray(PIO_INT, ncVariablesName[k], num);
8454 parallelIo.setAttribute(idVariablesName[j], "name", ncVariablesName[k]);
8455 }
8456
8457 MString XString = "variables" + to_string(noDbVars + noIdVars + (MInt)isDetChem<SysEqn> + 1);
8458 MString YString = "variables" + to_string(noDbVars + noIdVars + (MInt)isDetChem<SysEqn> + 2);
8459
8460 IF_CONSTEXPR(isDetChem<SysEqn>) {
8461 parallelIo.defineArray(PIO_FLOAT, XString, num);
8462 parallelIo.defineArray(PIO_FLOAT, YString, num);
8463 parallelIo.setAttribute("XCoord", "name", XString);
8464 parallelIo.setAttribute("YCoord", "name", YString);
8465 }
8466
8467 for(MInt j = 0; j < noIdPars; j++) {
8468 // solution parameters
8469 parallelIo.setAttribute(idParameters.p[j], idParametersName[j]);
8470 }
8471
8472 for(MInt j = 0; j < noDbPars; j++) {
8473 // solution parameters
8474 parallelIo.setAttribute(dbParameters.p[j], dbParametersName[j]);
8475 }
8476 parallelIo.setAttribute(m_currentGridFileName, "gridFile");
8477
8478 if(m_initialCondition == 16) {
8479 parallelIo.setAttributes(&m_Re, "Re", 1);
8480 parallelIo.setAttributes(&sysEqn().m_Re0, "Re0", 1);
8481 parallelIo.setAttributes(&m_randomDeviceSeed, "randomDeviceSeed", 1);
8482 }
8483
8484 ParallelIo::size_type start = 0;
8485 ParallelIo::size_type count = 1;
8486
8487 // Update start and count for parallel writing
8488 MPI_Exscan(&noInternalCellIds, &start, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "noInternalCells", "start");
8489 count = noInternalCellIds;
8490 parallelIo.setOffset(count, start);
8491
8492 for(MInt j = 0; j < noDbVars; j++) {
8493 tmpDbVariables = &(dbVariables.p[j * noTotalCells]);
8494
8495 if(m_recalcIds != nullptr) {
8496 MFloatScratchSpace tmpDouble(count, AT_, "tmpDouble");
8497 for(MInt l = 0; l < count; ++l) {
8498 tmpDouble[l] = tmpDbVariables[recalcIds[l]];
8499 }
8500 parallelIo.writeArray(tmpDouble.begin(), ncVariablesName[j]);
8501 } else {
8502 parallelIo.writeArray(tmpDbVariables, ncVariablesName[j]);
8503 }
8504 }
8505
8506 IF_CONSTEXPR(isDetChem<SysEqn>) {
8507 MFloatScratchSpace tmpX(a_noCells(), AT_, "tmpX");
8508 MFloatScratchSpace tmpY(a_noCells(), AT_, "tmpY");
8509 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
8510 tmpX[cellId] = a_coordinate(cellId, 0);
8511 }
8512 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
8513 tmpY[cellId] = a_coordinate(cellId, 1);
8514 }
8515 parallelIo.writeArray(&tmpX[0], XString);
8516 parallelIo.writeArray(&tmpY[0], YString);
8517 }
8518
8519 for(MInt j = 0; j < noIdVars; j++) {
8520 tmpIdVariables = &(idVariables.p[j * noTotalCells]);
8521 if(m_recalcIds != nullptr) {
8522 MIntScratchSpace tmpInt(count, AT_, "tmpInt");
8523 for(MInt l = 0; l < count; ++l) {
8524 tmpInt[l] = tmpIdVariables[recalcIds[l]];
8525 }
8526 parallelIo.writeArray(tmpInt.begin(), ncVariablesName[j + noDbVars]);
8527 } else {
8528 parallelIo.writeArray(tmpIdVariables, ncVariablesName[j + noDbVars]);
8529 }
8530 }
8531
8533}
int MPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Exscan

◆ saveLESAverage()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::saveLESAverage

Definition at line 37784 of file fvcartesiansolverxd.cpp.

37784 {
37785 TRACE();
37786
37787 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
37788
37789 if(domainId() == 0) {
37790 cerr << "Writing LES average restart file at " << globalTimeStep << "...";
37791 }
37792
37793 MLong noAvgCells = 0;
37794 vector<pair<MInt, MInt>> LESCellsGlobalId;
37795 for(MInt c = 0; c < (MInt)m_LESAverageCells.size(); c++) {
37797 if(a_isHalo(cellId)) continue;
37798 if(a_isPeriodic(cellId)) continue;
37799 if(a_isBndryGhostCell(cellId)) continue;
37800 if(a_hasProperty(cellId, FvCell::IsSplitChild)) continue;
37801 if(a_hasProperty(cellId, FvCell::IsSplitClone)) continue;
37802 MInt globalLESId = c_globalId(cellId);
37803 LESCellsGlobalId.emplace_back(make_pair(globalLESId, c));
37804 noAvgCells++;
37805 }
37806
37807 MLong noAvgCellsGlobal = noAvgCells;
37808 ScratchSpace<MPI_Offset> offsets(noDomains() + 1, AT_, "offsets");
37809 offsets(0) = 0;
37810 if(noDomains() > 1) {
37811 offsets(domainId() + 1) = (MPI_Offset)noAvgCells;
37812
37813 MPI_Allgather(&noAvgCells, 1, MPI_LONG, &offsets[1], 1, MPI_LONG, mpiComm(), AT_, "noAvgCells", "offsets[1]");
37814
37815 for(MInt d = 0; d < noDomains(); d++) {
37816 offsets(d + 1) += offsets(d);
37817 }
37818 noAvgCellsGlobal = noAvgCells;
37819
37820 MPI_Allreduce(MPI_IN_PLACE, &noAvgCellsGlobal, 1, MPI_LONG, MPI_SUM, mpiComm(), AT_, "MPI_IN_PLACE",
37821 "noAvgCellsGlobal");
37822
37823 if(noAvgCellsGlobal != offsets(noDomains())) {
37824 mTerm(1, AT_, "Dimension mismatch.");
37825 }
37826 }
37827
37828 offsets(noDomains()) = (MPI_Offset)noAvgCellsGlobal;
37829
37830 stringstream fn;
37831 fn.clear();
37833 fn << outputDir() << "restartLESAverage" << m_solverId;
37834 } else {
37835 fn << outputDir() << "restartLESAverage" << m_solverId << "_" << globalTimeStep;
37836 }
37837 fn << ParallelIo::fileExt();
37838 MString fileName = fn.str();
37839
37840 MLongScratchSpace avgCellIds(noAvgCells, AT_, "avgCellIds");
37841 for(MInt i = 0; i < noAvgCells; i++) {
37842 avgCellIds[i] = LESCellsGlobalId[i].first;
37843 }
37844
37845 ParallelIo::size_type start = 0;
37846 ParallelIo::size_type count = 0;
37847
37848 using namespace maia::parallel_io;
37849 ParallelIo parallelIo(fileName, PIO_REPLACE, mpiComm());
37850
37851 count = noAvgCellsGlobal;
37852 parallelIo.defineArray(PIO_LONG, "avgCellIds", count);
37853 for(MInt var = 0; var < m_LESNoVarAverage; var++) {
37854 MString s = "LESAverageVar" + to_string(var);
37855 parallelIo.defineArray(PIO_FLOAT, s, count);
37856 }
37857
37858 start = offsets(domainId());
37859 count = noAvgCells;
37860 parallelIo.setOffset(count, start);
37861
37862 parallelIo.writeArray(avgCellIds.begin(), "avgCellIds");
37863
37864 ScratchSpace<MFloat> LESVar(noAvgCells, AT_, "LESVar");
37865 for(MInt var = 0; var < m_LESNoVarAverage; var++) {
37866 MString s = "LESAverageVar" + to_string(var);
37867 for(MInt i = 0; i < noAvgCells; i++) {
37868 LESVar[i] = m_LESVarAverage[var][LESCellsGlobalId[i].second];
37869 }
37870 parallelIo.writeArray(LESVar.begin(), s);
37871 }
37872
37873 if(domainId() == 0) cerr << "ok" << endl;
37874}

◆ saveRestartFile()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::saveRestartFile ( const MBool  writeBackup)
virtual

Saves the restart file as triggerd in the grid controller (this includes a separate grid call to check if a restarGrid file needs to be written)

Author
D. Hartmann, Update Tim Wegmann

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 17645 of file fvcartesiansolverxd.cpp.

17645 {
17646 TRACE();
17647
17648 MBool debugOutput = m_domainIdOutput;
17649#ifdef _MB_DEBUG_
17650 debugOutput = true;
17651#endif
17652
17653 MBool jet = false;
17654 if(m_jet || m_confinedFlame) jet = true;
17656
17657 MInt noCells;
17658 MInt noInternalCellIds;
17659 std::vector<MInt> recalcIdsSolver(0);
17660 std::vector<MInt> reOrderedCells(0);
17661 // << TODO labels:FVMB Without this IMHO memory-leaking but backward-compatible
17662 // move FVMB test case fails (LS/3D_minLevelIncrease)
17663 if(grid().newMinLevel() > 0) {
17664 m_recalcIds = nullptr;
17665 }
17666 // >>
17667 this->calcRecalcCellIdsSolver(m_recalcIds, noCells, noInternalCellIds, recalcIdsSolver, reOrderedCells);
17668 // a_noCells(), however pVariables need to be written in a different way then!
17669 noCells = (grid().newMinLevel() < 0) ? a_noCells() : reOrderedCells.size();
17670
17671 stringstream varFileName;
17672 stringstream backupFileName;
17673 const MInt noDbVariables =
17674 noCells
17675 * (PV->noVariables // primitive variables
17676 + (MInt)debugOutput * 2 // visualise window/halo-Cells and cellId
17677 + (MInt)m_levelSetRans + ((MInt)m_acousticAnalysis) * 3 // acoustics analysis variables
17679 * m_vorticitySize // vorticity variables
17680 + (MInt)m_restartOldVariables * CV->noVariables // dpdt
17682 + ((MInt)(isDetChem<SysEqn> && m_detChemExtendedOutput)) * 3
17683 + ((MInt)(isDetChem<SysEqn> && m_detChemExtendedOutput && m_acousticAnalysis)) * 4 + (MInt)m_wmLES * 2);
17684
17686 MFloatScratchSpace dbVariables(noDbVariables, AT_, "dbVariables");
17687 MFloatScratchSpace tmp(noCells * ((MInt)addVarOut), AT_, "tmp");
17688 MFloatScratchSpace tmpW(noCells * ((MInt)debugOutput), AT_, "tmpW");
17689 MFloatScratchSpace tmpDetChem(noCells * ((MInt)isDetChem<SysEqn>), AT_, "tmpDetChem");
17690
17691 const MInt noIdVariables = (MInt)m_isActiveOutput;
17692 MIntScratchSpace idVariables(noIdVariables, AT_, "idVariables");
17693 MIntScratchSpace tmpId(noCells * noIdVariables, AT_, "idVariables");
17694
17695 MInt writeRestartTimeBc2800 = 0;
17696 if(Context::propertyExists("modeType", m_solverId)) writeRestartTimeBc2800 = 1;
17697 MFloatScratchSpace dbParameters(writeRestartTimeBc2800 + 5 + 3 * (MInt)jet, AT_, "dbParameters");
17698 MIntScratchSpace idParameters(4, AT_, "idParameters");
17699 vector<MString> dbVariablesName;
17700 vector<MString> idVariablesName;
17701 vector<MString> dbParametersName;
17702 vector<MString> idParametersName;
17703 vector<MString> name;
17704
17705 for(MInt v = 0; v < PV->noVariables; v++) {
17706 name.push_back(m_variablesName[v]);
17707 }
17708
17709 if(grid().newMinLevel() < 0) {
17710 this->collectVariables(&a_pvariable(0, 0), dbVariables, name, dbVariablesName, PV->noVariables, a_noCells());
17711 } else {
17712 MFloat** variables = nullptr;
17713 const MInt noPVars = PV->noVariables;
17714 mAlloc(variables, noCells, noPVars, "variables", 0.0, AT_);
17715
17716 for(MInt cell = 0; cell < noCells; cell++) {
17717 for(MInt var = 0; var < noPVars; var++)
17718 variables[cell][var] = a_pvariable(reOrderedCells[cell], var);
17719 }
17720
17721 this->collectVariables(variables, dbVariables, name, dbVariablesName, noPVars, noCells);
17722 variables = nullptr;
17723 mDeallocate(variables);
17724 }
17725
17726 IF_CONSTEXPR(isDetChem<SysEqn>) {
17728 name.clear();
17729 name.push_back("RHO_E");
17730 if(grid().newMinLevel() < 0) {
17731 for(MInt cellId = 0; cellId < noCells; cellId++) {
17732 tmpDetChem[cellId] = a_variable(cellId, CV->RHO_E);
17733 }
17734 } else {
17735 for(MInt cellId = 0; cellId < noCells; cellId++) {
17736 tmpDetChem[cellId] = a_variable(reOrderedCells[cellId], CV->RHO_E);
17737 }
17738 }
17739 this->collectVariables(tmpDetChem.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17740
17741 name.clear();
17742 name.push_back("T");
17743 if(grid().newMinLevel() < 0) {
17744 for(MInt cellId = 0; cellId < noCells; cellId++) {
17745 tmpDetChem[cellId] = a_pvariable(cellId, PV->P) / m_gasConstant * a_avariable(cellId, AV->W_MEAN)
17746 / a_pvariable(cellId, PV->RHO);
17747 }
17748 } else {
17749 for(MInt cellId = 0; cellId < noCells; cellId++) {
17750 tmpDetChem[cellId] = a_pvariable(reOrderedCells[cellId], PV->P) / m_gasConstant
17751 * a_avariable(reOrderedCells[cellId], AV->W_MEAN)
17752 / a_pvariable(reOrderedCells[cellId], PV->RHO);
17753 }
17754 }
17755 this->collectVariables(tmpDetChem.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17756
17757 name.clear();
17758 name.push_back("HeatRelease");
17759 if(grid().newMinLevel() < 0) {
17760 for(MInt cellId = 0; cellId < noCells; cellId++) {
17761 if(a_isBndryGhostCell(cellId)) continue;
17762 const MFloat dampeningFactor = m_heatReleaseDamp ? m_dampFactor[cellId] : F1;
17763 tmpDetChem[cellId] = 0;
17764 for(MUint s = 0; s < PV->m_noSpecies; ++s) {
17765 tmpDetChem[cellId] -= dampeningFactor * a_speciesReactionRate(cellId, s) * m_standardHeatFormation[s];
17766 }
17767 }
17768 } else {
17769 for(MInt cellId = 0; cellId < noCells; cellId++) {
17770 if(a_isBndryGhostCell(cellId)) continue;
17771 const MFloat dampeningFactor = m_heatReleaseDamp ? m_dampFactor[cellId] : F1;
17772 tmpDetChem[cellId] = 0;
17773 for(MUint s = 0; s < PV->m_noSpecies; ++s) {
17774 tmpDetChem[cellId] -=
17775 dampeningFactor * a_speciesReactionRate(reOrderedCells[cellId], s) * m_standardHeatFormation[s];
17776 }
17777 }
17778 }
17779 this->collectVariables(tmpDetChem.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17780
17781 if(m_acousticAnalysis) {
17782 MFloatScratchSpace QeI(a_noCells(), AT_, "QeI");
17783 MFloatScratchSpace QeIII(a_noCells(), AT_, "QeIII");
17784 MFloatScratchSpace cSquared(a_noCells(), AT_, "cSquared");
17785 MFloatScratchSpace drhodt(a_noCells(), AT_, "drhodt");
17786
17787 computeAcousticSourceTermQe(QeI, QeIII, cSquared, drhodt);
17788
17789 name.clear();
17790 name.push_back("QeI");
17791 this->collectVariables(QeI.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17792
17793 name.clear();
17794 name.push_back("QeIII");
17795 this->collectVariables(QeIII.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17796
17797 name.clear();
17798 name.push_back("cSquared");
17799 this->collectVariables(cSquared.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17800
17801 name.clear();
17802 name.push_back("drhodt");
17803 this->collectVariables(drhodt.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17804 }
17805 }
17806 }
17807
17808 if(m_wmLES) {
17809 MFloat** wmVariables = nullptr;
17810 const MInt noWMVars = 2;
17811 mAlloc(wmVariables, noCells, noWMVars, "wmVariables", 0.0, AT_);
17812 name.clear();
17813 name.emplace_back("utau");
17814 name.emplace_back("u_II");
17815 for(MUint wmSrfcId = 0; wmSrfcId < m_wmSurfaces.size(); wmSrfcId++) {
17816 const MInt bndryCellId = m_wmSurfaces[wmSrfcId].m_bndryCellId;
17817 const MInt cell = m_bndryCells->a[bndryCellId].m_cellId;
17818 wmVariables[cell][0] = m_wmSurfaces[wmSrfcId].m_wmUTAU;
17819 wmVariables[cell][1] = m_wmSurfaces[wmSrfcId].m_wmUII;
17820 }
17821 this->collectVariables(wmVariables, dbVariables, name, dbVariablesName, noWMVars, noCells);
17822 wmVariables = nullptr;
17823 mDeallocate(wmVariables);
17824 }
17825
17826 if(debugOutput) {
17827 name.clear();
17828 name.push_back("domainId");
17829 for(MInt i = 0; i < c_noCells(); i++) {
17830 if(a_isWindow(i)) {
17831 tmpW[i] = -domainId();
17832 } else {
17833 tmpW[i] = domainId();
17834 }
17835 }
17836 this->collectVariables(tmpW.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17837
17838 name.clear();
17839 name.push_back("globalId");
17840 for(MInt i = 0; i < c_noCells(); i++) {
17842 tmpW[i] = c_globalId(i);
17843 }
17844 for(MInt i = c_noCells(); i < noCells; i++) {
17845 tmpW[i] = -1;
17846 }
17847 this->collectVariables(tmpW.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17848 }
17849
17850 if(m_levelSetOutput) {
17851 name.clear();
17852 name.push_back("G");
17853 if(m_levelSetMb) {
17854 if(grid().newMinLevel() < 0) {
17855 for(MInt cellId = 0; cellId < noCells; cellId++) {
17856 tmp[cellId] = a_levelSetValuesMb(cellId, 0);
17857 }
17858 } else {
17859 for(MInt cellId = 0; cellId < noCells; cellId++) {
17860 tmp[cellId] = a_levelSetValuesMb(reOrderedCells[cellId], 0);
17861 }
17862 }
17863 } else {
17864 for(MInt i = 0; i < noCells; i++) {
17865 tmp[i] = a_levelSetFunction(i, 0);
17866 }
17867 }
17868 this->collectVariables(tmp.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17869 }
17870
17871 if(m_localTS) {
17872 name.clear();
17873 name.push_back("localTS");
17874 for(MInt cellId = 0; cellId < noCells; cellId++) {
17875 tmp[cellId] = a_localTimeStep(cellId);
17876 }
17877 this->collectVariables(tmp.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17878 }
17879
17880 if(m_levelSetRans) {
17881 name.clear();
17882 name.push_back("d");
17883 for(MInt cellId = 0; cellId < noCells; cellId++) {
17884 tmp[cellId] = a_levelSetFunction(cellId, 0);
17885 }
17886 this->collectVariables(tmp.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17887 }
17888
17889 if(m_bodyIdOutput) {
17890 ASSERT(m_levelSetMb, "");
17891 if(grid().newMinLevel() < 0) {
17892 for(MInt cellId = 0; cellId < noCells; cellId++) {
17893 tmp[cellId] = a_associatedBodyIds(cellId, 0);
17894 }
17895 } else {
17896 for(MInt cellId = 0; cellId < noCells; cellId++) {
17897 tmp[cellId] = a_associatedBodyIds(reOrderedCells[cellId], 0);
17898 }
17899 }
17900 name.clear();
17901 name.push_back("BodyId");
17902 this->collectVariables(tmp.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17903 }
17904
17905 if(m_isActiveOutput) {
17906 if(grid().newMinLevel() < 0) {
17907 for(MInt cellId = 0; cellId < noCells; cellId++) {
17908 tmpId[cellId] = (MInt)(!a_hasProperty(cellId, SolverCell::IsInactive));
17909 }
17910 } else {
17911 for(MInt cellId = 0; cellId < noCells; cellId++) {
17912 tmpId[cellId] = (MInt)(!a_hasProperty(reOrderedCells[cellId], SolverCell::IsInactive));
17913 }
17914 }
17915 name.clear();
17916 name.push_back("IsActive");
17917 this->collectVariables(tmpId.begin(), idVariables, name, idVariablesName, 1, noCells);
17918 }
17919
17921 IF_CONSTEXPR(!hasE<SysEqn>)
17922 mTerm(1, AT_, "Not compatible with SysEqn without RHO_E!");
17923 const MFloat gammaMinusOne = m_gamma - F1;
17924 const MFloat FgammaMinusOne = F1 / gammaMinusOne;
17925 MFloat reactionEnthalpy = (m_burntUnburntTemperatureRatio - F1) * FgammaMinusOne;
17926 MFloat FtimeStep = 1 / timeStep();
17927
17928 MFloatScratchSpace dPdT(noCells, AT_, "dPdT");
17929 MFloatScratchSpace dHdT(noCells, AT_, "dHdT");
17930 MFloatScratchSpace h(noCells, AT_, "h");
17931
17932 for(MInt cell = 0; cell < noCells; cell++) {
17933 dPdT[cell] = F0;
17934 dHdT[cell] = F0;
17935 h[cell] = F0;
17936
17937 if(!a_hasProperty(cell, SolverCell::IsOnCurrentMGLevel)) continue;
17938
17939 // compute the velocities
17940 MFloat velPOW2 = F0;
17941 for(MInt i = 0; i < nDim; i++) {
17942 velPOW2 += POW2(a_oldVariable(cell, CV->RHO_VV[i]));
17943 }
17944
17945 dPdT[cell] = a_pvariable(cell, 3);
17946 // compute primitive old pressure from conservative variables
17947 const MFloat pold = sysEqn().pressure(a_oldVariable(cell, CV->RHO), velPOW2, a_oldVariable(cell, CV->RHO_E));
17948
17949 dPdT[cell] -= pold;
17950 dPdT[cell] *= FtimeStep;
17951
17952 h[cell] = a_reactionRate(cell, 0);
17953 h[cell] *= a_cellVolume(cell) * reactionEnthalpy;
17954 dHdT[cell] = a_reactionRate(cell, 0);
17955 dHdT[cell] -= a_reactionRateBackup(cell, 0);
17956 dHdT[cell] *= a_cellVolume(cell) * reactionEnthalpy;
17957 dHdT[cell] *= FtimeStep;
17958 }
17959
17960 stringstream dPdTname;
17961 stringstream dHdTname;
17962 stringstream hName;
17963 dPdTname << "dPdT";
17964 dHdTname << "dHdT";
17965 hName << "h";
17966 name.clear();
17967 name.push_back(dPdTname.str());
17968 this->collectVariables(dPdT.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17969 name.clear();
17970 name.push_back(dHdTname.str());
17971 this->collectVariables(dHdT.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17972 name.clear();
17973 name.push_back(hName.str());
17974 this->collectVariables(h.begin(), dbVariables, name, dbVariablesName, 1, noCells);
17975 }
17976
17978
17979 this->collectParameters(m_noSamples, idParameters, "noSamples", idParametersName);
17980 this->collectParameters(globalTimeStep, idParameters, "globalTimeStep", idParametersName);
17982 this->collectParameters(m_physicalTime, dbParameters, "time", dbParametersName);
17983 } else {
17984 this->collectParameters(m_time, dbParameters, "time", dbParametersName);
17985 }
17986 this->collectParameters(m_restartFileOutputTimeStep, dbParameters, "timeStep", dbParametersName);
17987 this->collectParameters(m_noTimeStepsBetweenSamples, idParameters, "noTimeStepsBetweenSamples", idParametersName);
17988 this->collectParameters(m_physicalTime, dbParameters, "physicalTime", dbParametersName);
17989 this->collectParameters((MInt)m_forcing, idParameters, "forcing", idParametersName);
17990 if(writeRestartTimeBc2800 != 0) {
17991 this->collectParameters(m_restartTimeBc2800, dbParameters, "restartTimeBc2800", dbParametersName);
17992 }
17993
17994 if(m_jet || m_confinedFlame) {
17995 this->collectParameters(m_jetDensity, dbParameters, "jetDensity", dbParametersName);
17996 this->collectParameters(m_jetPressure, dbParameters, "jetPressure", dbParametersName);
17997 this->collectParameters(m_jetTemperature, dbParameters, "jetTemperature", dbParametersName);
17998 }
17999
18000 // Add vorticity to restart file
18002 MFloatScratchSpace vorticity(noCells * m_vorticitySize, AT_, "vorticity");
18003 getVorticity(&vorticity[0]);
18004 name.clear();
18005 for(MInt i = 0; i < m_vorticitySize; i++) {
18006 name.push_back(m_vorticityName[i]);
18007 }
18008 this->collectVariables(vorticity.begin(), dbVariables, name, dbVariablesName, m_vorticitySize, noCells, true);
18009 }
18010
18011 // Store oldVariables in restart file if requested in property file
18013 // Prepare buffers
18014 MFloatScratchSpace oldRhoE(noCells, AT_, "oldRhoE");
18015 MFloatScratchSpace oldRhoU(noCells, AT_, "oldRhoU");
18016 MFloatScratchSpace oldRhoV(noCells, AT_, "oldRhoV");
18017 MFloatScratchSpace oldRhoW(nDim == 3 ? noCells : 1, AT_, "oldRhoW");
18018 MFloatScratchSpace oldRho(noCells, AT_, "oldRho");
18019
18020 // Copy data to buffers
18021 IF_CONSTEXPR(nDim == 3) {
18022 // 3D version
18023 for(MInt c = 0; c < noCells; c++) {
18024 IF_CONSTEXPR(hasE<SysEqn>)
18025 oldRhoE[c] = a_oldVariable(c, CV->RHO_E);
18026 oldRhoU[c] = a_oldVariable(c, CV->RHO_VV[0]);
18027 oldRhoV[c] = a_oldVariable(c, CV->RHO_VV[1]);
18028 oldRhoW[c] = a_oldVariable(c, CV->RHO_VV[2]);
18029 oldRho[c] = a_oldVariable(c, CV->RHO);
18030 }
18031 }
18032 else {
18033 // 2D version
18034 for(MInt c = 0; c < noCells; c++) {
18035 IF_CONSTEXPR(hasE<SysEqn>)
18036 oldRhoE[c] = a_oldVariable(c, CV->RHO_E);
18037 oldRhoU[c] = a_oldVariable(c, CV->RHO_VV[0]);
18038 oldRhoV[c] = a_oldVariable(c, CV->RHO_VV[1]);
18039 oldRho[c] = a_oldVariable(c, CV->RHO);
18040 }
18041 }
18042
18043 // Collect data
18044 name.clear();
18045 name.push_back("oldRhoE");
18046 this->collectVariables(oldRhoE.begin(), dbVariables, name, dbVariablesName, 1, noCells);
18047 name.clear();
18048 name.push_back("oldRhoU");
18049 this->collectVariables(oldRhoU.begin(), dbVariables, name, dbVariablesName, 1, noCells);
18050 name.clear();
18051 name.push_back("oldRhoV");
18052 this->collectVariables(oldRhoV.begin(), dbVariables, name, dbVariablesName, 1, noCells);
18053 IF_CONSTEXPR(nDim == 3) {
18054 name.clear();
18055 name.push_back("oldRhoW");
18056 this->collectVariables(oldRhoW.begin(), dbVariables, name, dbVariablesName, 1, noCells);
18057 }
18058 name.clear();
18059 name.push_back("oldRho");
18060 this->collectVariables(oldRho.begin(), dbVariables, name, dbVariablesName, 1, noCells);
18061 }
18062
18063 MInt* pointerRecalcIds = (m_recalcIds == nullptr) ? nullptr : recalcIdsSolver.data();
18064
18066 if(writeBackup) {
18067 // write a backup restart file
18068 backupFileName << outputDir() << "restartVariablesBackup_" << globalTimeStep << ParallelIo::fileExt();
18069
18070 cerr0 << "writing flow variables (backup) for the fv-solver... ";
18071
18072 saveGridFlowVarsPar((backupFileName.str()).c_str(), noCells, noInternalCellIds, dbVariables, dbVariablesName, 0,
18073 idVariables, idVariablesName, 0, dbParameters, dbParametersName, idParameters,
18074 idParametersName, pointerRecalcIds);
18075
18076 cerr0 << "ok" << endl;
18077 }
18078 varFileName << outputDir() << "restartVariables" << ParallelIo::fileExt();
18079 struct stat buffer {};
18080 if(stat((varFileName.str()).c_str(), &buffer) == 0) {
18081 // restart already exists rename to current timestep backup
18082 std::rename(varFileName.str().c_str(), (varFileName.str() + to_string(globalTimeStep) + "backup").c_str());
18083 }
18084 } else {
18085 if(!isMultilevel()) {
18086 varFileName << outputDir() << "restartVariables" << getIdentifier(m_multipleFvSolver, "", "") << "_"
18087 << globalTimeStep << ParallelIo::fileExt();
18088 } else {
18089 // For multilevel, use solver-specific file name for restart files
18090 const MInt maxLength = 256;
18091 array<MChar, maxLength> buffer{};
18092 snprintf(buffer.data(), maxLength, "restart_b%02d_t%08d", solverId(), globalTimeStep);
18093 varFileName << outputDir() << MString(buffer.data()) << ParallelIo::fileExt();
18094 }
18095 }
18096
18097 saveGridFlowVarsPar((varFileName.str()).c_str(), noCells, noInternalCellIds, dbVariables, dbVariablesName, 0,
18098 idVariables, idVariablesName, 0, dbParameters, dbParametersName, idParameters, idParametersName,
18099 pointerRecalcIds);
18100
18101 if(domainId() == 0) cerr << "ok" << endl;
18102}
MFloat & a_levelSetValuesMb(const MInt cellId, const MInt set)
Returns the levelSetMb-value for fv-CellId cellId and set.
void saveGridFlowVarsPar(const MChar *fileName, MInt noTotalCells, MLong noInternalCells, MFloatScratchSpace &variables, std::vector< MString > &dbVariablesName, MInt, MIntScratchSpace &idVariables, std::vector< MString > &idVariablesName, MInt, MFloatScratchSpace &dbParameters, std::vector< MString > &dbParametersName, MIntScratchSpace &idParameters, std::vector< MString > &idParametersName, const MInt *recalcIds)
This function stores the massivley parallel flow information of the cells.
MInt & a_associatedBodyIds(const MInt cellId, const MInt set)
Returns the associatedBodyIds for fv-CellId cellId and set.
virtual void getVorticity(MFloat *const vorticity)
wrapper for vorticity computation
void computeAcousticSourceTermQe(MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &)
MString getIdentifier(const MBool useSolverId=false, const MString preString="", const MString postString="_")
Definition: solver.cpp:188
void collectVariables(T *variablesIn, ScratchSpace< T > &variablesOut, const std::vector< MString > &variablesNameIn, std::vector< MString > &variablesNameOut, const MInt noVars, const MInt noCells, const MBool reverseOrder=false)
generalised helper function for writing restart files! This is necessary for example if the minLevel ...
void collectParameters(T, ScratchSpace< T > &, const MChar *, std::vector< MString > &)
This function collects a single parameters for the massivley parallel IO functions.
void calcRecalcCellIdsSolver(const MInt *const recalcIdsTree, MInt &noCells, MInt &noInternalCellIds, std::vector< MInt > &recalcCellIdsSolver, std::vector< MInt > &reorderedCellIds)
Derive recalc cell ids of the solver and reordered cell ids.

◆ saveSampleFiles()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::saveSampleFiles

Definition at line 17120 of file fvcartesiansolverxd.cpp.

17120 {
17121 TRACE();
17122
17124 return;
17125 }
17127 return;
17128 }
17129 if(globalTimeStep % samplingInterval() != 0) {
17130 return;
17131 }
17132
17133 const MInt oldSize = a_noCells();
17135
17136 MInt ghostcellbackup = m_totalnoghostcells;
17137 MInt splitchildbackup = m_totalnosplitchilds;
17140
17141 stringstream varFileName;
17142
17143 {
17144 varFileName << outputDir() << "Q_" << m_noSamples << ParallelIo::fileExt();
17145
17146 MFloatScratchSpace dbVariables(
17147 a_noCells() * (PV->noVariables + (MInt)m_levelSet + m_vorticitySize + (MInt)m_qCriterionOutput), AT_,
17148 "dbVariables");
17149 MIntScratchSpace idVariables(0, AT_, "idVariables");
17150 MFloatScratchSpace dbParameters(6, AT_, "dbParameters");
17151 MIntScratchSpace idParameters(4, AT_, "idParameters");
17152 vector<MString> dbVariablesName;
17153 vector<MString> idVariablesName;
17154 vector<MString> dbParametersName;
17155 vector<MString> idParametersName;
17156 vector<MString> name;
17157
17158 for(MInt v = 0; v < PV->noVariables; v++) {
17159 name.push_back(m_variablesName[v]);
17160 }
17161
17162 this->collectVariables(&a_pvariable(0, 0), dbVariables, name, dbVariablesName, PV->noVariables, a_noCells());
17163
17164 if(m_vorticityOutput) {
17165 MFloatScratchSpace vorticity(a_noCells() * m_vorticitySize, AT_, "vorticity");
17166 getVorticity(&vorticity[0]);
17167 name.clear();
17168 for(MInt i = 0; i < m_vorticitySize; i++) {
17169 name.push_back(m_vorticityName[i]);
17170 }
17171 this->collectVariables(vorticity.begin(), dbVariables, name, dbVariablesName, m_vorticitySize, a_noCells(), true);
17172 }
17173
17174 if(m_qCriterionOutput) {
17175 MFloatScratchSpace qCriterion(a_noCells(), AT_, "qCriterion");
17176 computeQCriterion(qCriterion);
17177 name.clear();
17178 name.push_back("qCriterion");
17179 this->collectVariables(qCriterion.begin(), dbVariables, name, dbVariablesName, 1, a_noCells());
17180 }
17182 this->collectParameters(m_noSamples, idParameters, "noSamples", idParametersName);
17183 this->collectParameters(globalTimeStep, idParameters, "globalTimeStep", idParametersName);
17185 this->collectParameters(m_physicalTime, dbParameters, "time", dbParametersName);
17186 } else {
17187 this->collectParameters(m_time, dbParameters, "time", dbParametersName);
17188 }
17189 this->collectParameters(m_restartFileOutputTimeStep, dbParameters, "timeStep", dbParametersName);
17190 this->collectParameters(m_noTimeStepsBetweenSamples, idParameters, "noTimeStepsBetweenSamples", idParametersName);
17191 this->collectParameters(m_physicalTime, dbParameters, "physicalTime", dbParametersName);
17192 this->collectParameters((MInt)m_forcing, idParameters, "forcing", idParametersName);
17193 this->collectParameters(m_meanPressure, dbParameters, "meanPressure", dbParametersName);
17194
17195 // TODO labels:FV,IO currently not working for adaptation, check save restartFile
17196 // and get solver recalcIds!
17197 //
17198 saveGridFlowVarsPar((varFileName.str()).c_str(), a_noCells(), noInternalCells(), dbVariables, dbVariablesName, 0,
17199 idVariables, idVariablesName, 0, dbParameters, dbParametersName, idParameters, idParametersName,
17200 m_recalcIds);
17201 }
17202
17203 m_noSamples++;
17204
17205
17206 m_cells.size(oldSize);
17207 m_totalnoghostcells = ghostcellbackup;
17208 m_totalnosplitchilds = splitchildbackup;
17209}
void computeQCriterion(MFloatScratchSpace &qCriterion)

◆ saveSandpaperTripVars()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::saveSandpaperTripVars

Definition at line 34110 of file fvcartesiansolverxd.cpp.

34110 {
34111 m_log << "writing Sandpaper Trip Vars... ";
34112
34113 stringstream fileName;
34115 fileName << restartDir() << "tripRestart" << ParallelIo::fileExt();
34116 } else {
34117 if(!isMultilevel()) {
34118 fileName << restartDir() << "tripRestart_" << globalTimeStep << ParallelIo::fileExt();
34119 } else {
34120 mTerm(-1, "writing Sandpaper trip variables not implemented for multiLevel");
34121 }
34122 }
34123
34124 using namespace maia::parallel_io;
34125 ParallelIo parallelIo(fileName.str(), PIO_REPLACE, mpiComm());
34126
34127 MInt dataSize = m_tripNoModes * 2 * m_tripNoTrips;
34128
34129 parallelIo.defineArray(PIO_FLOAT, "tripModesG", dataSize);
34130 parallelIo.defineArray(PIO_FLOAT, "tripModesH1", dataSize);
34131 parallelIo.defineArray(PIO_FLOAT, "tripModesH2", dataSize);
34132
34133 if(domainId() == 0) {
34134 parallelIo.setOffset(dataSize, 0);
34135 parallelIo.writeArray(&m_tripModesG[0], "tripModesG");
34136 parallelIo.writeArray(&m_tripModesH1[0], "tripModesH1");
34137 parallelIo.writeArray(&m_tripModesH2[0], "tripModesH2");
34138
34139 } else {
34140 parallelIo.setOffset(0, 0);
34141 parallelIo.writeArray(&m_tripModesG[0], "tripModesG");
34142 parallelIo.writeArray(&m_tripModesH1[0], "tripModesH1");
34143 parallelIo.writeArray(&m_tripModesH2[0], "tripModesH2");
34144 }
34145 m_log << " ok." << endl;
34146}

◆ saveSolverSolution()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::saveSolverSolution ( const MBool  forceOutput = false,
const MBool  finalTimeStep = false 
)
override
Author
Daniel Hartmann, Stephan Schlimpert
Date
unknown, June 2011, January 2013

last changes: VTU format included (cut cell output in 2D)

outputs are only given for the zeroth level-set function (set = 0)

◆ saveSpongeData()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::saveSpongeData

Definition at line 38354 of file fvcartesiansolverxd.cpp.

38354 {
38355 TRACE();
38356
38357 IF_CONSTEXPR(SysEqn::m_noRansEquations > 0) return;
38358
38359 if(m_spongeRank > -1 && domainId() == m_spongeRoot) {
38360 stringstream fn;
38361 fn.clear();
38363 fn << outputDir() << "stgSpongeData";
38364 } else {
38365 fn << outputDir() << "stgSpongeData_" << globalTimeStep;
38366 }
38367 fn << ".txt";
38368
38369 MString fname = fn.str();
38370
38371 cerr << "Writing STG sponge data at " << globalTimeStep << " ..";
38372
38373 MString header = "#x1 x2 m_uvInt";
38374
38375 ofstream spongeData;
38376 spongeData.precision(16);
38377
38378 spongeData.open(fname);
38379 for(MInt i = 0; i < m_globalNoSpongeLocations; i++) {
38380 MString line;
38381 line.append(to_string(m_globalSpongeLocations[i].first) + ";" + to_string(m_globalSpongeLocations[i].second) + ";"
38382 + to_string(m_uvInt[i]) + ";");
38383
38384 spongeData << line << endl;
38385 }
38386 spongeData.close();
38387
38388 cerr << "ok" << endl;
38389 }
38390}

◆ scalarLimiter()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::scalarLimiter

brief: limits scalar variables to [0,1]

Definition at line 11210 of file fvcartesiansolverxd.cpp.

11210 {
11211 TRACE();
11212 if(m_isEEGas) return;
11213
11214 if(m_hasExternalSource) return;
11215
11216 const MInt noCVars = CV->noVariables;
11217 MInt cellId;
11218 auto* var = (MFloat*)(&(a_variable(0, 0)));
11219 // auto* pvar = (MFloat*)(&(a_pvariable(0, 0)));
11220
11221 for(MInt id = 0; id < m_noActiveCells; id++) {
11223 for(MInt i = 0; i < m_noSpecies; i++)
11224 var[cellId * noCVars + CV->RHO_Y[i]] =
11225 mMin(var[cellId * noCVars + CV->RHO], mMax(var[cellId * noCVars + CV->RHO_Y[i]], F0));
11226 }
11227}

◆ scatter()

template<MInt nDim_, class SysEqn >
template<MBool exchangeAll_>
void FvCartesianSolverXD< nDim_, SysEqn >::scatter
Template Parameters
exchangeAll_scatter all halo cell data and not just the data of the max-level halo cells

Definition at line 7118 of file fvcartesiansolverxd.cpp.

7118 {
7119 TRACE();
7120 RECORD_TIMER_START(m_tscatter);
7121 for(MInt i = 0; i < noNeighborDomains(); i++) {
7122 MInt receiveBufferCounter = 0;
7123 const MInt noHalos = (exchangeAll_) ? noHaloCells(i) : m_noMaxLevelHaloCells[i];
7124 for(MInt j = 0; j < noHalos; j++) {
7125 const MInt haloCell = (exchangeAll_) ? haloCellId(i, j) : m_maxLevelHaloCells[i][j];
7126 std::copy_n(&m_receiveBuffers[i][receiveBufferCounter], m_dataBlockSize, &a_pvariable(haloCell, 0));
7127 receiveBufferCounter += m_dataBlockSize;
7128 }
7129 }
7130 RECORD_TIMER_STOP(m_tscatter);
7131}
const MInt & haloCell(const MInt domainId, const MInt cellId) const

◆ scatterWMVars()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::scatterWMVars
protected

Definition at line 12131 of file fvcartesiansolverxd.cpp.

12131 {
12132 TRACE();
12133
12134 if(PV->noVariables > 5) mTerm(1, AT_, "WMLES not implemented for noPVars > 5");
12135
12136 const MInt noPVars = mMin(PV->noVariables, 5);
12137 MInt ipCounter = 0;
12138
12139 for(MInt dom = 0; dom < m_wmNoDomains; dom++) {
12140#ifdef _OPENMP
12141#pragma omp parallel for
12142#endif
12143 for(MInt ip = 0; ip < m_noWMImgPointsRecv[dom]; ip++) {
12144 const MInt wmSrfcId = m_wmImgRecvIdMap[ipCounter + ip];
12145 for(MInt v = 0; v < noPVars; v++) {
12146 m_wmSurfaces[wmSrfcId].m_wmImgVars[v] = m_wmImgRecvBuffer[noPVars * (ipCounter + ip) + v];
12147 }
12148 // ipCounter++;
12149 }
12150 // moving the counter out of the loop allows openmp parallelization
12151 ipCounter += m_noWMImgPointsRecv[dom];
12152 }
12153}

◆ send()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::send ( const MBool  exchangeAll = false)
Parameters
exchangeAllsend all window cell data and not just the data of the max-level window cells

Definition at line 7138 of file fvcartesiansolverxd.cpp.

7138 {
7139 TRACE();
7140 RECORD_TIMER_START(m_tgatherAndSend);
7141 RECORD_TIMER_START(m_tsend);
7142 for(MInt i = 0; i < noNeighborDomains(); i++) {
7143 const MInt noWindows = (exchangeAll) ? noWindowCells(i) : m_noMaxLevelWindowCells[i];
7144 const MInt bufSize = noWindows * m_dataBlockSize;
7145 MPI_Issend(m_sendBuffers[i], bufSize, MPI_DOUBLE, neighborDomain(i), 0, mpiComm(), &m_mpi_request[i], AT_,
7146 "m_sendBuffers[i]");
7147 }
7148 RECORD_TIMER_STOP(m_tsend);
7149 RECORD_TIMER_STOP(m_tgatherAndSend);
7150}

◆ sendWMVars()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sendWMVars
protected

Definition at line 12096 of file fvcartesiansolverxd.cpp.

12096 {
12097 TRACE();
12098 const MInt noPVars = PV->noVariables;
12099 MInt bufSize = 0;
12100 MInt offset = 0;
12101
12102 for(MInt dom = 0; dom < noDomains(); dom++) {
12103 bufSize = m_noWMImgPointsSend[dom] * noPVars;
12104 MPI_Issend(&m_wmImgSendBuffer[offset], bufSize, MPI_DOUBLE, dom, 0, mpiComm(), &m_mpi_wmRequest[dom], AT_,
12105 "m_wmImgSendBuffer[offset]");
12106 offset += bufSize;
12107 }
12108}

◆ sensorCutOff()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorCutOff ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)
virtual

Reimplemented from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >.

Definition at line 23389 of file fvcartesiansolverxd.cpp.

23391 {
23392 MIntScratchSpace cutOffCells(a_noCells(), AT_, "cutOffCells");
23393 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
23394 cutOffCells(cellId) = 0;
23395 }
23396
23397 m_fvBndryCnd->markCutOff(cutOffCells);
23398
23399 MIntScratchSpace bandWidth(this->m_maxSensorRefinementLevel[sen], AT_, "bandWidth");
23400 constexpr MInt additionalLayers = 1;
23401
23402 bandWidth[this->m_maxSensorRefinementLevel[sen] - 1] =
23403 m_bandWidth[this->m_maxSensorRefinementLevel[sen] - 1] + additionalLayers;
23404
23405
23406 for(MInt i = this->m_maxSensorRefinementLevel[sen] - 2; i >= 0; i--) {
23407 bandWidth[i] = (bandWidth[i + 1] / 2) + 1;
23408 }
23409
23410 for(MInt level = minLevel(); level < this->m_maxSensorRefinementLevel[sen]; level++) {
23411 this->markSurrndCells(cutOffCells, bandWidth[level], level, m_refineDiagonals);
23412 }
23413
23414#ifdef _OPENMP
23415#pragma omp parallel for
23416#endif
23417 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
23418 ASSERT(!a_isBndryGhostCell(cellId), "");
23419 ASSERT(!a_isHalo(cellId), "");
23420 ASSERT(!c_isToDelete(cellId), "");
23421 const MInt gridCellId = grid().tree().solver2grid(cellId);
23422 if(cutOffCells(cellId) > 0) {
23423 if(a_level(cellId) < this->m_maxSensorRefinementLevel[sen]) {
23424 sensors[sensorOffset + sen][gridCellId] = 1.0;
23425 sensorCellFlag[gridCellId][sensorOffset + sen] = true;
23426 MInt parent = c_parentId(cellId);
23427 if(parent > -1 && parent < a_noCells()) {
23428 MInt parentGridCellId = grid().tree().solver2grid(parent);
23429 if(parentGridCellId > -1 && parentGridCellId < grid().raw().m_noInternalCells) {
23430 sensors[sensorOffset + sen][parentGridCellId] = 1.0;
23431 sensorCellFlag[parentGridCellId][sensorOffset + sen] = true;
23432 }
23433 }
23434 }
23435 } else {
23436 sensors[sensorOffset + sen][gridCellId] = 0.0;
23437 sensorCellFlag[gridCellId][sensorOffset + sen] = false;
23438 }
23439 }
23440
23441 if(m_engineSetup) {
23442 MInt noCutOffBndryIds = Context::propertyLength("cutOffBndryIds", m_solverId);
23443
23444 MFloat xmin = -2.95;
23445 MFloat xmax = 1.65;
23446
23447 xmin = Context::getSolverProperty<MFloat>("cutOffCoordinates", m_solverId, AT_, 0);
23448
23449 if(noCutOffBndryIds > 1) {
23450 xmax = Context::getSolverProperty<MFloat>("cutOffCoordinates", m_solverId, AT_, 6);
23451 }
23452
23453 const MFloat dist1 = 0.15;
23454 const MFloat dist2 = 0.25;
23455
23456 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
23457 if(a_coordinate(cellId, 0) < (xmin + dist1) && a_levelSetValuesMb(cellId, 0) > -m_maxLsValue
23458 && a_level(cellId) < this->m_maxSensorRefinementLevel[sen]) {
23459 const MInt gridCellId = grid().tree().solver2grid(cellId);
23460 sensors[sensorOffset + sen][gridCellId] = 1.0;
23461 sensorCellFlag[gridCellId][sensorOffset + sen] = 1;
23462 }
23463
23464 if(a_coordinate(cellId, 0) > (xmax - dist1) && a_levelSetValuesMb(cellId, 0) > -m_maxLsValue
23465 && a_level(cellId) < this->m_maxSensorRefinementLevel[sen]) {
23466 const MInt gridCellId = grid().tree().solver2grid(cellId);
23467 sensors[sensorOffset + sen][gridCellId] = 1.0;
23468 sensorCellFlag[gridCellId][sensorOffset + sen] = 1;
23469 }
23470 }
23471 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
23472 if(a_coordinate(cellId, 0) < (xmin + dist2) && a_levelSetValuesMb(cellId, 0) > -m_maxLsValue
23473 && a_level(cellId) < this->m_maxSensorRefinementLevel[sen] - 1) {
23474 const MInt gridCellId = grid().tree().solver2grid(cellId);
23475 sensors[sensorOffset + sen][gridCellId] = 1.0;
23476 sensorCellFlag[gridCellId][sensorOffset + sen] = 1;
23477 }
23478
23479 if(a_coordinate(cellId, 0) > (xmax - dist2) && a_levelSetValuesMb(cellId, 0) > -m_maxLsValue
23480 && a_level(cellId) < this->m_maxSensorRefinementLevel[sen] - 1) {
23481 const MInt gridCellId = grid().tree().solver2grid(cellId);
23482 sensors[sensorOffset + sen][gridCellId] = 1.0;
23483 sensorCellFlag[gridCellId][sensorOffset + sen] = 1;
23484 }
23485 }
23486 }
23487
23488
23489 sensorWeight[sensorOffset + sen] = this->m_sensorWeight[sen];
23490}
void markCutOff(MIntScratchSpace &cutOffCells)
MBool c_isToDelete(const MInt cellId) const
Returns the delete of the cell cellId.
MInt * m_bandWidth
Definition: solver.h:94
void markSurrndCells(MIntScratchSpace &inList, const MInt bandWidth, const MInt level, const MBool refineDiagonals=true)

◆ sensorDerivative()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorDerivative ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)
overrideprotectedvirtual
Author
Andreas Lintermann
Date
25.04.2019

Function is called by a function pointer in the array of function pointer (m_sensorFnPtr). The function runs over all cells and computes the derivatives by a simple finite difference stencil.

Parameters
[in]sensorsvector of vector of sensor values
[in]sensonWeightweighting of each sensor
[in]sensorCellFlagindicates if a cell is suited for adaptation
[in]sensorOffsetthe present sensor offset

Reimplemented from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >.

Definition at line 10883 of file fvcartesiansolverxd.cpp.

10886 {
10887 m_log << " - Sensor preparation for the derivative sensor" << endl;
10888
10889 // weightings depending on the refinement
10890 ScratchSpace<MFloat> lengthFactor(maxRefinementLevel() + 1, AT_, "lengthFactor");
10891 for(MInt l = 0; l <= maxRefinementLevel(); l++) {
10892 lengthFactor[l] = pow(c_cellLengthAtLevel(l), F3B2);
10893 }
10894
10895 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
10896 ASSERT(!c_isToDelete(cellId), "");
10897
10898 // skip all unnecessary cells
10899 if(a_bndryId(cellId) != -1) continue;
10900 if(a_isBndryGhostCell(cellId)) continue;
10901 if(c_noChildren(cellId) > 0) continue;
10902 if(a_isHalo(cellId)) continue;
10903
10904 if(a_hasProperty(cellId, SolverCell::IsInactive)) continue;
10905 // if ( a_hasProperty( cellId , SolverCell::WasInactive ) ) continue;
10906
10907 if(a_level(cellId) > this->m_maxSensorRefinementLevel[sen]) {
10908 continue;
10909 }
10910
10911 const MInt gridId = this->grid().tree().solver2grid(cellId);
10912
10913 // skip cells outside the bore
10914 if(m_engineSetup) {
10915 if(a_coordinate(cellId, 0) < -0.5 || a_coordinate(cellId, 0) > 0.5) continue;
10916 }
10917
10918 MFloat tau = F0;
10919
10920 // option to trigger velocity magnitude gradient!
10921 if((MInt)this->m_sensorDerivativeVariables[sen] == 10) {
10922 MFloat gradMax = F0;
10923 for(MInt d = 0; d < nDim; d++) {
10924 MFloat grad = 0;
10925 for(MInt i = 0; i < nDim; i++) {
10926 grad += POW2(a_slope(cellId, PV->VV[d], i));
10927 }
10928 if(grad > gradMax) gradMax = grad;
10929 }
10930 tau = sqrt(gradMax);
10931 } else if((MInt)this->m_sensorDerivativeVariables[sen] == 9) {
10932 // largest species gradient if species above 0.001
10933 if(a_pvariable(cellId, PV->Y[0]) > 0.001) {
10934 MFloat gradMax = F0;
10935 for(MInt d = 0; d < nDim; d++) {
10936 MFloat grad = 0;
10937 for(MInt i = 0; i < nDim; i++) {
10938 grad += POW2(a_slope(cellId, PV->Y[0], i));
10939 }
10940 if(grad > gradMax) gradMax = grad;
10941 }
10942 tau = sqrt(gradMax);
10943 }
10944
10945 } else {
10946 // compute the magnitude of the gradient
10947 for(MInt d = 0; d < nDim; d++) {
10948 MFloat grad = a_slope(cellId, this->m_sensorDerivativeVariables[sen], d);
10949 tau += POW2(grad);
10950 }
10951 tau = sqrt(tau);
10952 }
10953
10954 tau *= lengthFactor[a_level(cellId)];
10955
10956 sensors[sensorOffset + sen][gridId] = tau;
10957 sensorCellFlag[gridId][sensorOffset + sen] = true;
10958 }
10959
10960 sensorWeight[sensorOffset + sen] = this->m_sensorWeight[sen];
10961}

◆ sensorEntropyGrad()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorEntropyGrad ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)
overrideprotectedvirtual

Reimplemented from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >.

Definition at line 10725 of file fvcartesiansolverxd.cpp.

10728 {
10729 m_log << " - Sensor preparation for the entropy sensor" << endl;
10730
10731 // weightings depending on the refinement
10732 ScratchSpace<MFloat> lengthFactor(maxRefinementLevel() + 1, AT_, "lengthFactor");
10733 for(MInt l = 0; l <= maxRefinementLevel(); l++)
10734 lengthFactor.p[l] = pow(c_cellLengthAtLevel(l), F3B2);
10735
10736 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
10737 ASSERT(!c_isToDelete(cellId), "");
10738 // skip all unnecessary cells
10739 if(a_bndryId(cellId) != -1) continue;
10740 if(a_isBndryGhostCell(cellId)) continue;
10741 if(c_noChildren(cellId) > 0) continue;
10742 if(a_isHalo(cellId)) continue;
10743
10744 if(a_hasProperty(cellId, SolverCell::IsInactive)) continue;
10745 // if ( a_hasProperty( cellId , SolverCell::WasInactive ) ) continue;
10746
10747 // shortcuts
10748 const MInt level = a_level(cellId);
10749 const MInt gridId = grid().tree().solver2grid(cellId);
10750
10751 // compute the magnitude of the temperature gradient (stored in PV->P)
10752 MFloat a2 = sysEqn().temperature_ES(a_pvariable(cellId, PV->RHO), a_pvariable(cellId, PV->P));
10753 MFloat tau = F0;
10754 for(MInt i = 0; i < nDim; i++) {
10755 tau += POW2(a_slope(cellId, PV->P, i) - a_slope(cellId, PV->RHO, i) * a2);
10756 }
10757 tau = sqrt(tau);
10758 tau *= lengthFactor.p[level];
10759 sensors[sensorOffset + sen][gridId] = tau;
10760 sensorCellFlag[gridId][sensorOffset + sen] = 1;
10761 }
10762
10763 sensorWeight[sensorOffset + sen] = this->m_sensorWeight[sen];
10764}

◆ sensorEntropyQuot()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorEntropyQuot ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)
overrideprotectedvirtual

Reimplemented from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >.

Definition at line 10773 of file fvcartesiansolverxd.cpp.

10776 {
10777 m_log << " - Sensor preparation for the entropy sensor" << endl;
10778
10779 // weightings depending on the refinement
10780 ScratchSpace<MFloat> lengthFactor(maxRefinementLevel() + 1, AT_, "lengthFactor");
10781 for(MInt l = 0; l <= maxRefinementLevel(); l++)
10782 lengthFactor.p[l] = pow(c_cellLengthAtLevel(l), F3B2);
10783
10784 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
10785 ASSERT(!c_isToDelete(cellId), "");
10786 // skip all unnecessary cells
10787 if(a_bndryId(cellId) != -1) continue;
10788 if(a_isBndryGhostCell(cellId)) continue;
10789 if(c_noChildren(cellId) > 0) continue;
10790 if(a_isHalo(cellId)) continue;
10791
10792 if(a_hasProperty(cellId, SolverCell::IsInactive)) continue;
10793 // if ( a_hasProperty( cellId , SolverCell::WasInactive ) ) continue;
10794
10795 // shortcuts
10796 const MInt level = a_level(cellId);
10797 const MInt gridId = grid().tree().solver2grid(cellId);
10798
10799 MFloat tau = F0;
10800 tau = pow(mMax(F0, ((entropy(cellId) - m_SInfinity) / m_SInfinity)), 1.2);
10801 tau *= lengthFactor.p[level];
10802 sensors[sensorOffset + sen][gridId] = tau;
10803 sensorCellFlag[gridId][sensorOffset + sen] = 1;
10804 }
10805
10806 sensorWeight[sensorOffset + sen] = this->m_sensorWeight[sen];
10807}
virtual MFloat entropy(MInt cellId)

◆ sensorInterface()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorInterface ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)
overridevirtual

Reimplemented from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >.

Definition at line 23204 of file fvcartesiansolverxd.cpp.

23207 {
23208 // Setting function pointer for sensorInterface
23209
23211 sensorInterfaceLs(sensors, sensorCellFlag, sensorWeight, sensorOffset, sen);
23213 sensorInterfaceLsMb(sensors, sensorCellFlag, sensorWeight, sensorOffset, sen);
23214 } else {
23215 sensorInterfaceDelta(sensors, sensorCellFlag, sensorWeight, sensorOffset, sen);
23216 }
23217}
void sensorInterfaceLs(std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen)
void sensorInterfaceLsMb(std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen)
void sensorInterfaceDelta(std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen)

◆ sensorInterfaceDelta()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorInterfaceDelta ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)

Definition at line 23303 of file fvcartesiansolverxd.cpp.

23306 {
23307 m_log << " - Sensor preparation for the interface sensor" << endl;
23308
23309 ScratchSpace<MFloat> distance(a_noCells(), AT_, "distance");
23310 distance.fill(MFloatNaN); // fill with NaN to find errors
23311
23312 getBoundaryDistance(distance);
23313
23314#ifdef _OPENMP
23315#pragma omp parallel for
23316#endif
23317 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
23318 ASSERT(!a_isBndryGhostCell(cellId), "");
23319 ASSERT(!a_isHalo(cellId), "");
23320 ASSERT(!c_isToDelete(cellId), "");
23321 const MInt gridId = this->grid().tree().solver2grid(cellId);
23322 const MInt level = a_level(cellId);
23323 MFloat delta = F0;
23324 if(level < maxRefinementLevel()) {
23325 delta = mMin(m_outerBandWidth[level] - distance[cellId], distance[cellId] - m_innerBandWidth[level]);
23326 sensors[sensorOffset + sen][gridId] = delta;
23327 sensorCellFlag[gridId][sensorOffset + sen] = true;
23328 }
23329 }
23330
23331 sensorWeight[sensorOffset + sen] = this->m_sensorWeight[sen];
23332}
virtual void getBoundaryDistance(MFloatScratchSpace &)
Get distance to boundary, currently bc 3003. Should be replaced by more precise distance using STL in...
MFloat * m_innerBandWidth
Definition: solver.h:93

◆ sensorInterfaceLs()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorInterfaceLs ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)

Definition at line 23336 of file fvcartesiansolverxd.cpp.

23339 {
23340 m_log << " - Sensor preparation for the interface sensor" << endl;
23341
23342 MIntScratchSpace inList(a_noCells(), AT_, "inList");
23343
23344 ScratchSpace<MFloat> distance(a_noCells(), AT_, "distance");
23345 getBoundaryDistance(distance);
23346
23347#ifdef _OPENMP
23348#pragma omp parallel for
23349#endif
23350 // cast floating array in int-array!
23351 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
23352 inList(cellId) = 0;
23353 if(a_level(cellId) < this->m_maxSensorRefinementLevel[sen]) {
23354 inList(cellId) = (MInt)distance(cellId);
23355 }
23356 }
23357
23358 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
23359 if(inList(cellId) == 0) {
23360 if(a_level(cellId) == minLevel()) continue;
23361 if(c_noChildren(cellId) == 0) {
23362 MInt gridCellId = grid().tree().solver2grid(cellId);
23363 sensors[sensorOffset + sen][gridCellId] = -1.0;
23364 sensorCellFlag[gridCellId][sensorOffset + sen] = 1;
23365 }
23366 } else {
23367 ASSERT(inList(cellId) > 0, "");
23368 MInt gridCellId = grid().tree().solver2grid(cellId);
23369 if(a_level(cellId) < maxRefinementLevel()) { // refine cell
23370 if(c_noChildren(cellId) > 0) continue;
23371 if(a_isHalo(cellId)) continue;
23372 sensors[sensorOffset + sen][gridCellId] = 1.0;
23373 sensorCellFlag[gridCellId][sensorOffset + sen] = 1;
23374 }
23375 }
23376 }
23377
23378 sensorWeight[sensorOffset + sen] = this->m_sensorWeight[sen];
23379}

◆ sensorInterfaceLsMb()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorInterfaceLsMb ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)

Definition at line 23220 of file fvcartesiansolverxd.cpp.

23223 {
23224 m_log << " - Sensor preparation for the interface sensor" << endl;
23225 ScratchSpace<MFloat> distance(a_noCells(), AT_, "distance");
23226 getBoundaryDistance(distance);
23227
23228 MIntScratchSpace inList(a_noCells(), AT_, "inList");
23229
23230 // cast floating array in MInt-array!
23231 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
23232 inList(cellId) = 0;
23233 if(a_level(cellId) < this->m_maxSensorRefinementLevel[sen]) {
23234 inList(cellId) = (MInt)distance(cellId);
23235 }
23236 }
23237
23238 for(MInt level = minLevel(); level < this->m_maxSensorRefinementLevel[sen]; level++) {
23239 this->markSurrndCells(inList, m_bandWidth[level], level, m_refineDiagonals);
23240 }
23241
23242 // unset sensor for cells ouside the liner geometry
23243 if(m_engineSetup) {
23244 const MInt linerSet = 1;
23245 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
23246 if(inList(cellId) == 0) continue;
23247 if(a_level(cellId) == minLevel()) continue;
23248 if(c_noChildren(cellId) > 0) continue;
23249 if(a_levelSetValuesMb(cellId, linerSet) < -(m_maxLsValue - m_eps)) {
23250 inList(cellId) = 0;
23251 // MInt parentId = c_parentId( cellId );
23252 // while ( parentId > -1 && parentId < a_noCells()) {
23253 // inList(cellId) = 0;
23254 // parentId = c_parentId( parentId );
23255 //}
23256 }
23257 }
23258 }
23259
23260
23261#ifdef _OPENMP
23262#pragma omp parallel for
23263#endif
23264 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
23265 ASSERT(!a_isBndryGhostCell(cellId), "");
23266 ASSERT(!a_isHalo(cellId), "");
23267 ASSERT(!c_isToDelete(cellId), "");
23268 if(inList(cellId) == 0) {
23269 if(a_level(cellId) == minLevel()) continue;
23270 if(inList(c_parentId(cellId))) continue;
23271 if(!c_isLeafCell(cellId)) continue;
23272 const MInt gridCellId = grid().tree().solver2grid(cellId);
23273 sensors[sensorOffset + sen][gridCellId] = -1.0;
23274 sensorCellFlag[gridCellId][sensorOffset + sen] = true;
23275 } else {
23276 MInt lvl = this->m_maxSensorRefinementLevel[sen] - 1;
23277 if(m_linerLvlJump && a_coordinate(cellId, 0) > -0.515 && a_coordinate(cellId, 0) < 0.515) {
23278 lvl = this->m_maxSensorRefinementLevel[sen];
23279 }
23280 const MInt sensorLvl = m_linerLvlJump ? lvl : this->m_maxSensorRefinementLevel[sen];
23281 if(a_level(cellId) < sensorLvl) {
23282 // if(c_noChildren(cellId) > 0) continue;
23283 const MInt gridCellId = grid().tree().solver2grid(cellId);
23284 sensors[sensorOffset + sen][gridCellId] = 1.0;
23285 sensorCellFlag[gridCellId][sensorOffset + sen] = true;
23286
23287 MInt parent = c_parentId(cellId);
23288 if(parent > -1 && parent < c_noCells()) {
23289 MInt parentGridCellId = grid().tree().solver2grid(parent);
23290 if(parentGridCellId > -1 && parentGridCellId < grid().raw().m_noInternalCells) {
23291 sensors[sensorOffset + sen][parentGridCellId] = 1.0;
23292 sensorCellFlag[parentGridCellId][sensorOffset + sen] = true;
23293 }
23294 }
23295 }
23296 }
23297 }
23298
23299 sensorWeight[sensorOffset + sen] = this->m_sensorWeight[sen];
23300}

◆ sensorParticle()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorParticle ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)
overrideprotectedvirtual

Reimplemented from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >.

Definition at line 11014 of file fvcartesiansolverxd.cpp.

11017 {
11018 static constexpr MInt particleLimit = 1;
11019
11020 std::function<MFloat(const MInt)> noPart = [&](const MInt cellId) { return static_cast<MFloat>(a_noPart(cellId)); };
11021
11023 sensors, sensorCellFlag, sensorWeight, sensorOffset, sen, noPart, particleLimit, &m_particleWidth[0],
11025
11026 // reset sensor for inactive cells and outside engine
11027 if(m_levelSetMb) {
11028 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
11029 if(m_engineSetup && (a_coordinate(cellId, 0) < -0.515 || a_coordinate(cellId, 0) > 0.515)) {
11030 const MInt gridCellId = grid().tree().solver2grid(cellId);
11031 if(sensors[sensorOffset + sen][gridCellId] > 0) {
11032 sensors[sensorOffset + sen][gridCellId] = 0;
11033 sensorCellFlag[gridCellId][sensorOffset + sen] = false;
11034 }
11035 }
11036 if(!a_isInactive(cellId)) continue;
11037 if(a_levelSetValuesMb(cellId, 0) > -(m_maxLsValue - m_eps)) continue;
11038 const MInt gridCellId = grid().tree().solver2grid(cellId);
11039 if(sensors[sensorOffset + sen][gridCellId] > 0) {
11040 sensors[sensorOffset + sen][gridCellId] = 0;
11041 sensorCellFlag[gridCellId][sensorOffset + sen] = false;
11042 }
11043 }
11044 }
11045}
void sensorLimit(std::vector< std::vector< MFloat > > &, std::vector< std::bitset< 64 > > &, std::vector< MFloat > &, MInt, MInt, std::function< MFloat(MInt)>, const MFloat, const MInt *, const MBool, const MBool allowCoarsening=true)
simple sensor to apply a limit for a value

◆ sensorPatch()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorPatch ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)
overridevirtual

Reimplemented from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >.

Definition at line 23500 of file fvcartesiansolverxd.cpp.

23502 {
23503 this->patchRefinement(sensors, sensorCellFlag, sensorWeight, sensorOffset, sen);
23504}
void patchRefinement(std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen)

◆ sensorSpecies()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorSpecies ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)
overrideprotectedvirtual

◆ sensorVorticity()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::sensorVorticity ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MFloat > &  sensorWeight,
MInt  sensorOffset,
MInt  sen 
)
overrideprotectedvirtual

Reimplemented from maia::CartesianSolver< nDim_, FvCartesianSolverXD< nDim_, SysEqn > >.

Definition at line 10816 of file fvcartesiansolverxd.cpp.

10819 {
10820 m_log << " - Sensor preparation for the vorticity sensor" << endl;
10821
10822 // weightings depending on the refinement
10823 ScratchSpace<MFloat> lengthFactor(maxRefinementLevel() + 1, AT_, "lengthFactor");
10824 for(MInt l = 0; l <= maxRefinementLevel(); l++)
10825 lengthFactor.p[l] = pow(c_cellLengthAtLevel(l), F3B2);
10826
10827 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
10828 ASSERT(!c_isToDelete(cellId), "");
10829
10830 // skip all unnecessary cells
10831 if(a_bndryId(cellId) != -1) continue;
10832 if(a_isBndryGhostCell(cellId)) continue;
10833 if(c_noChildren(cellId) > 0) continue;
10834 if(a_isHalo(cellId)) continue;
10835 if(a_hasProperty(cellId, SolverCell::IsInactive)) continue;
10836 // if ( a_hasProperty( cellId , SolverCell::WasInactive ) ) continue;
10837
10838 // shortcuts
10839 const MInt level = a_level(cellId);
10840 const MInt gridId = this->grid().tree().solver2grid(cellId);
10841
10842 MFloat tau = F0;
10843 if(m_euler) {
10844 tau = sqrt(mMax(F1, (entropy(cellId) / m_SInfinity))) - F1;
10845 } else {
10846 IF_CONSTEXPR(nDim == 2) { tau = fabs(a_slope(cellId, PV->V, 0) - a_slope(cellId, PV->U, 1)); }
10847 else {
10848 tau = sqrt(POW2(a_slope(cellId, PV->W, 1) - a_slope(cellId, PV->V, 2))
10849 + POW2(a_slope(cellId, PV->U, 2) - a_slope(cellId, PV->W, 0))
10850 + POW2(a_slope(cellId, PV->V, 0) - a_slope(cellId, PV->U, 1)));
10851 }
10852 }
10853
10854 tau *= lengthFactor.p[level];
10855 sensors[sensorOffset + sen][gridId] = tau;
10856 sensorCellFlag[gridId][sensorOffset + sen] = true;
10857 }
10858
10859 sensorWeight[sensorOffset + sen] = this->m_sensorWeight[sen];
10860}

◆ setActiveFlag()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setActiveFlag ( MIntScratchSpace activeFlag,
const MInt  mode,
const MInt  offset 
)

Definition at line 12848 of file fvcartesiansolverxd.cpp.

12849 {
12850 TRACE();
12851
12852 for(MInt bndryId = 0; bndryId < m_fvBndryCnd->m_bndryCells->size(); bndryId++) {
12853 const MInt cellId = m_fvBndryCnd->m_bndryCells->a[bndryId].m_cellId;
12854 // maxLevelChange!
12855 const MFloat vfrac = a_cellVolume(cellId) / grid().cellVolumeAtLevel(maxLevel());
12856 MBool atWall = false;
12857 for(MInt srfc = 0; srfc < m_fvBndryCnd->m_bndryCells->a[bndryId].m_noSrfcs; srfc++) {
12858 if(m_fvBndryCnd->m_bndryCell[bndryId].m_srfcs[srfc]->m_bndryCndId / 1000 == 3) atWall = true;
12859 }
12860 const MFloat volumeLimit = atWall ? m_fvBndryCnd->m_volumeLimitWall : m_fvBndryCnd->m_volumeLimitOther;
12861 if(mode == 0 && vfrac > volumeLimit) continue;
12862 if(mode == 1 && bndryId < offset && vfrac > volumeLimit) continue;
12863 activeFlag(cellId) = 1;
12864 const MInt noSrfcs = m_fvBndryCnd->m_bndryCells->a[bndryId].m_noSrfcs;
12865 const MUint noRecNghbrs = m_fvBndryCnd->m_bndryCell[bndryId].m_recNghbrIds.size();
12866 for(MUint n = noSrfcs; n < noRecNghbrs; n++) {
12867 MInt nghbrId = m_fvBndryCnd->m_bndryCell[bndryId].m_recNghbrIds[n];
12868 if(nghbrId < 0) continue;
12869 activeFlag(nghbrId) = 1;
12870 if(a_hasProperty(nghbrId, SolverCell::IsSplitChild)) {
12871 activeFlag(getAssociatedInternalCell(nghbrId)) = 1;
12872 }
12873 }
12874 if(!a_hasProperty(cellId, SolverCell::IsSplitChild) && !a_hasProperty(cellId, SolverCell::IsSplitClone)) {
12875 for(MInt dir = 0; dir < m_noDirs; dir++) {
12876 if(checkNeighborActive(cellId, dir) && a_hasNeighbor(cellId, dir)) {
12877 activeFlag(c_neighborId(cellId, dir)) = 1;
12878 }
12879 }
12880 }
12881 }
12882}

◆ setAdditionalActiveFlag()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::setAdditionalActiveFlag ( MIntScratchSpace )
inlinevirtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 1137 of file fvcartesiansolverxd.h.

1137{};

◆ setAndAllocateAdaptationProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setAndAllocateAdaptationProperties ( )
Author
Gonzalo Brito Gadeschi
Date
October, 2012

◆ setAndAllocateCombustionGequPvProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setAndAllocateCombustionGequPvProperties ( )
Author
Stephan Schlimpert
Date
12.12.2010, 17.06.2011

◆ setAndAllocateCombustionTFProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setAndAllocateCombustionTFProperties ( )
Todo:
labels:FV Stephan: clean up combustion stuff if possible!

◆ setAndAllocateDetailedChemistryProperties()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::setAndAllocateDetailedChemistryProperties

Definition at line 573 of file fvcartesiansolverxd.cpp.

573 {
574 TRACE();
575
576 if(domainId() == 0) cout << "Starting a full detailed chemistry simulation." << endl;
577
580 Context::getSolverProperty<MBool>("detChemExtendedOutput", m_solverId, AT_, &m_detChemExtendedOutput);
581
582 m_acousticAnalysis = false;
583 m_acousticAnalysis = Context::getSolverProperty<MBool>("acousticAnalysis", m_solverId, AT_, &m_acousticAnalysis);
584
585 m_YInfinity = nullptr;
586 m_molarMass = nullptr;
587 m_fMolarMass = nullptr;
588 m_standardHeatFormation = nullptr;
589
590 m_detChem.infSpeciesName = nullptr;
591 m_detChem.infSpeciesMassFraction = nullptr;
592
593
594 m_heatReleaseDamp = true;
595 m_heatReleaseDamp = Context::getSolverProperty<MBool>("heatReleaseDamp", m_solverId, AT_, &m_heatReleaseDamp);
596
597 m_detChem.hasChemicalReaction =
598 Context::getSolverProperty<MBool>("hasChemicalReaction", m_solverId, AT_, &m_detChem.hasChemicalReaction);
599
600 // Infinity Values
601 m_detChem.infTemperature =
602 Context::getSolverProperty<MFloat>("infTemperature", m_solverId, AT_, &m_detChem.infTemperature);
603 m_detChem.infVelocity = Context::getSolverProperty<MFloat>("infVelocity", m_solverId, AT_, &m_detChem.infVelocity);
604 m_detChem.infPressure = Context::getSolverProperty<MFloat>("infPressure", m_solverId, AT_, &m_detChem.infPressure);
605
606 m_detChem.laminarFlameSpeedFactor = 1.0;
607 m_detChem.laminarFlameSpeedFactor = Context::getSolverProperty<MFloat>("laminarFlameSpeedFactor", m_solverId, AT_,
608 &m_detChem.laminarFlameSpeedFactor);
609
610 const MInt speciesArrayLength = Context::propertyLength("infSpeciesName", m_solverId);
611 const MInt massFractionArrayLength = Context::propertyLength("infSpeciesMassFraction", m_solverId);
612
613 ASSERT(speciesArrayLength == massFractionArrayLength,
614 "Check speciesArrayLength and massFractionArrayLength. Unequal.");
615
616 mAlloc(m_detChem.infSpeciesName, speciesArrayLength, "infSpeciesName", AT_);
617 mAlloc(m_detChem.infSpeciesMassFraction, massFractionArrayLength, "infSpeciesMassFraction", AT_);
618
619 // Array containing species mass fractions at infinity (uniform)
620 mAlloc(m_YInfinity, PV->m_noSpecies, "m_YInfinity", F0, AT_);
621 mAlloc(m_molarMass, PV->m_noSpecies, "m_molarMass", 0.0, AT_);
622 mAlloc(m_fMolarMass, PV->m_noSpecies, "m_fMolarMass", 0.0, AT_);
623 mAlloc(m_standardHeatFormation, PV->m_noSpecies, "m_standardHeatFormation", 0.0, AT_);
624
625 MFloat summSpecies = F0;
626 for(MInt i = 0; i < speciesArrayLength; ++i) {
627 m_detChem.infSpeciesName[i] = Context::getSolverProperty<MString>("infSpeciesName", m_solverId, AT_, i);
628 m_detChem.infSpeciesMassFraction[i] =
629 Context::getSolverProperty<MFloat>("infSpeciesMassFraction", m_solverId, AT_, i);
630 summSpecies += m_detChem.infSpeciesMassFraction[i];
631 }
632
633 ASSERT(summSpecies - F1 < m_eps,
634 "Initial species mass fraction composition does not equal 1. Check properties file.");
635
636 m_detChem.infPhi = Context::getSolverProperty<MFloat>("infPhi", m_solverId, AT_, &m_detChem.infPhi);
637
638 // Get the name of the reaction mechanism for detailed chemistry computation
639 m_detChem.reactionMechanism =
640 Context::getSolverProperty<MString>("reactionMechanism", m_solverId, AT_, &m_detChem.reactionMechanism);
641
642 m_detChem.phaseName = Context::getSolverProperty<MString>("phaseName", m_solverId, AT_, &m_detChem.phaseName);
643
644 m_detChem.transportModel =
645 Context::getSolverProperty<MString>("transportModel", m_solverId, AT_, &m_detChem.transportModel);
646
647 for(MUint s = 0; s < PV->m_noSpecies; ++s) {
648 m_speciesName.push_back(sysEqn().m_species->speciesName[s]);
649 m_molarMass[s] = sysEqn().m_species->molarMass[s];
650 m_fMolarMass[s] = sysEqn().m_species->fMolarMass[s];
651 m_standardHeatFormation[s] = sysEqn().m_species->standardHeatFormation[s];
652 }
653
654 // Fill m_YInfinity with non-zero values given in the properties file
655 for(MInt i = 0; i < speciesArrayLength; ++i) {
656 const MString species = m_detChem.infSpeciesName[i];
657 const MInt speciesNameFound = sysEqn().m_species->speciesMap.count(species);
658 if(speciesNameFound == true) {
659 const MInt speciesIndex = sysEqn().m_species->speciesMap[species];
660 m_YInfinity[speciesIndex] = m_detChem.infSpeciesMassFraction[i];
661 } else {
662 mTerm(1, AT_, "Species name given in the properties file could not be found in the reaction mechanism.");
663 }
664 }
665
666 if(domainId() == 0) cout << "Allocation of detailed chemistry primary values done." << endl;
667
669
670 m_oneDimFlame = std::make_unique<OneDFlame>(m_detChem.infTemperature, m_detChem.infPressure, m_YInfinity, domainId(),
672
673#if defined(WITH_CANTERA)
675#endif
676
677 m_oneDimFlame->run();
678
680}
void initCanteraObjects()
Allocates the Cantera objects that define a thermodynamic phase, reaction kinetics and transport prop...
std::unique_ptr< OneDFlame > m_oneDimFlame

◆ setAndAllocateJetProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setAndAllocateJetProperties ( )
protected
Authors
Onur Cetin, Stephan Schlimpert

◆ setAndAllocateSpongeBoundaryProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setAndAllocateSpongeBoundaryProperties ( )
Author
Stephan Schlimpert
Date
17.06.2011

◆ setAndAllocateSpongeDomainProperties()

template<MInt nDim_, class SysEqn >
double FvCartesianSolverXD< nDim_, SysEqn >::setAndAllocateSpongeDomainProperties ( MFloat  allocatedBytes)
Author
Stephan Schlimpert
Date
17.06.2011

◆ setAndAllocateSpongeLayerProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setAndAllocateSpongeLayerProperties ( )

◆ setAndAllocateZonalProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setAndAllocateZonalProperties ( )

◆ setCellDataDlb()

template<MInt nDim_, class SysEqn_ >
void FvCartesianSolverXD< nDim_, SysEqn_ >::setCellDataDlb ( const MInt  dataId,
const MFloat *const  data 
)
override

Set the solver cell data after DLB.

Definition at line 3112 of file fvcartesiansolverxd.h.

3112 {
3113 TRACE();
3114
3115 // Nothing to do if solver is not active
3116 if(!isActive()) {
3117 return;
3118 }
3119
3120 // Set the variables if this is the correct reinitialization stage
3122 switch(dataId) {
3123 case 0: {
3124 std::copy_n(data, noInternalCells() * CV->noVariables, &a_variable(0, 0));
3125 break;
3126 }
3127 default:
3128 TERMM(1, "Unknown data id.");
3129 }
3130 }
3131}

◆ setCellProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setCellProperties
protectedvirtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 7696 of file fvcartesiansolverxd.cpp.

7696 {
7697 TRACE();
7698 const MInt noCells = a_noCells();
7699 const MInt noDirs = 2 * nDim;
7700
7701 //---
7702
7703 // set property 13 - cell is on the current computing level
7704 // if multilevel computation is applied the maxRfnmntLevel should be changed to a new variable like
7705 // m_currentMultiGridLevel
7706 for(MInt cellId = 0; cellId < c_noCells(); cellId++) {
7707 a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel) =
7708 ((c_isLeafCell(cellId) && a_level(cellId) <= maxRefinementLevel())
7709 || (!c_isLeafCell(cellId) && a_level(cellId) == maxRefinementLevel()))
7710 && !a_hasProperty(cellId, SolverCell::IsInvalid);
7711 }
7712
7713
7714 // set property defaults:
7715#ifdef _OPENMP
7716#pragma omp parallel for simd
7717#endif
7718 for(MInt c = 0; c < noCells; c++) {
7719 a_isHalo(c) = false;
7720 a_hasProperty(c, SolverCell::IsNotGradient) = false;
7721 }
7722
7723 // set property 15 - cell is a multisolver halo cell
7724 for(MInt i = 0; i < noNeighborDomains(); i++) {
7725 for(MInt c = 0; c < noHaloCells(i); c++) {
7726 a_isHalo(haloCellId(i, c)) = true;
7727 }
7728 }
7729 // Azimuthal periodicty exchange halos
7730 for(MInt i = 0; i < grid().noAzimuthalNeighborDomains(); i++) {
7731 for(MInt c = 0; c < grid().noAzimuthalHaloCells(i); c++) {
7732 a_isHalo(grid().azimuthalHaloCell(i, c)) = true;
7733 }
7734 }
7735 for(MInt c = 0; c < grid().noAzimuthalUnmappedHaloCells(); c++) {
7736 a_isHalo(grid().azimuthalUnmappedHaloCell(c)) = true;
7737 }
7738
7739 // set property 7 - cell is a not gradient
7740 // no gradient needs to be computed on those cells
7741 for(MInt i = 0; i < noNeighborDomains(); i++) {
7742 for(MInt c = 0; c < noHaloCells(i); c++) {
7743 a_hasProperty(haloCellId(i, c), SolverCell::IsNotGradient) = true;
7744 if(!a_hasProperty(haloCellId(i, c), SolverCell::IsOnCurrentMGLevel)) continue;
7745 for(MInt d = 0; d < noDirs; d++) {
7746 if(a_hasNeighbor(haloCellId(i, c), d) > 0) {
7747 if(!a_isHalo(c_neighborId(haloCellId(i, c), d))) {
7748 a_hasProperty(haloCellId(i, c), SolverCell::IsNotGradient) = false;
7749 }
7750 } else {
7751 MInt parentId = c_parentId(haloCellId(i, c));
7752 if(parentId > -1) {
7753 if(a_hasNeighbor(parentId, d) > 0) {
7754 if(!a_isHalo(c_neighborId(parentId, d))) {
7755 a_hasProperty(haloCellId(i, c), SolverCell::IsNotGradient) = false;
7756 }
7757 }
7758 }
7759 }
7760 }
7761 }
7762 }
7763
7764 // Azimuthal periodicty exchange halos
7765 for(MInt i = 0; i < grid().noAzimuthalNeighborDomains(); i++) {
7766 for(MInt c = 0; c < grid().noAzimuthalHaloCells(i); c++) {
7767 MInt cellId = grid().azimuthalHaloCell(i, c);
7768 a_hasProperty(cellId, SolverCell::IsNotGradient) = true;
7769 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) continue;
7770 for(MInt d = 0; d < noDirs; d++) {
7771 if(a_hasNeighbor(cellId, d) > 0) {
7772 if(!a_isHalo(c_neighborId(cellId, d))) {
7773 a_hasProperty(cellId, SolverCell::IsNotGradient) = false;
7774 }
7775 } else {
7776 MInt parentId = c_parentId(cellId);
7777 if(parentId > -1) {
7778 if(a_hasNeighbor(parentId, d) > 0) {
7779 if(!a_isHalo(c_neighborId(parentId, d))) {
7780 a_hasProperty(cellId, SolverCell::IsNotGradient) = false;
7781 }
7782 }
7783 }
7784 }
7785 }
7786 }
7787 }
7788 for(MInt c = 0; c < grid().noAzimuthalUnmappedHaloCells(); c++) {
7789 MInt cellId = grid().azimuthalUnmappedHaloCell(c);
7790 a_hasProperty(cellId, SolverCell::IsNotGradient) = true;
7791 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) continue;
7792 for(MInt d = 0; d < noDirs; d++) {
7793 if(a_hasNeighbor(cellId, d) > 0) {
7794 if(!a_isHalo(c_neighborId(cellId, d))) {
7795 a_hasProperty(cellId, SolverCell::IsNotGradient) = false;
7796 }
7797 } else {
7798 MInt parentId = c_parentId(cellId);
7799 if(parentId > -1) {
7800 if(a_hasNeighbor(parentId, d) > 0) {
7801 if(!a_isHalo(c_neighborId(parentId, d))) {
7802 a_hasProperty(cellId, SolverCell::IsNotGradient) = false;
7803 }
7804 }
7805 }
7806 }
7807 }
7808 }
7809
7810 // Copy Periodic-Cell-Property as a grid-property!
7811 for(MInt id = 0; id < a_noCells(); ++id) {
7812 if(a_hasProperty(id, SolverCell::IsSplitChild)) continue;
7813 if(a_isBndryGhostCell(id)) continue;
7814 if(a_hasProperty(id, SolverCell::IsSplitClone)) continue;
7816 a_isPeriodic(id) = grid().isPeriodic(id);
7817 }
7818
7819 // Set Cell-Properties for Splitchilds:
7820 for(MInt splitId = 0; (unsigned)splitId < m_splitCells.size(); splitId++) {
7821 MInt scId = m_splitCells[splitId];
7822 if(a_isHalo(scId)) {
7823 for(MInt ssc = 0; (unsigned)ssc < m_splitChilds[splitId].size(); ssc++) {
7824 MInt splitChildId = m_splitChilds[splitId][ssc];
7825 a_isHalo(splitChildId) = true;
7826 }
7827 }
7828 if(a_isPeriodic(scId)) {
7829 for(MInt ssc = 0; (unsigned)ssc < m_splitChilds[splitId].size(); ssc++) {
7830 MInt splitChildId = m_splitChilds[splitId][ssc];
7831 a_isPeriodic(splitChildId) = true;
7832 }
7833 }
7834 }
7835
7837}

◆ setCellWeights()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setCellWeights ( MFloat solverCellWeight)
overridevirtual
Author
Lennart Schneiders

Reimplemented from Solver.

Definition at line 23911 of file fvcartesiansolverxd.cpp.

23911 {
23912 TRACE();
23913 ASSERT(isActive(), "solver is not active");
23914
23915 MBool weightOnlyLeafCells = false;
23916 weightOnlyLeafCells =
23917 Context::getSolverProperty<MBool>("weightOnlyLeafCellsFv", m_solverId, AT_, &weightOnlyLeafCells);
23918
23919 const MInt noCellsGrid = grid().raw().treeb().size();
23920 const MInt offset = noCellsGrid * solverId();
23921
23922#ifdef _OPENMP
23923#pragma omp parallel for
23924#endif
23925 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
23926 assertValidGridCellId(cellId);
23927 const MInt gridCellId = grid().tree().solver2grid(cellId);
23928 const MInt id = gridCellId + offset;
23929
23930 solverCellWeight[id] = (c_isLeafCell(cellId) || !weightOnlyLeafCells) ? 1.0 : 0.0;
23931 }
23932}

◆ setCombustionGequPvVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setCombustionGequPvVariables
Author
Stephan Schlimpert
Date
12.12.2010, 17.06.2011

< Diffusion time (D) equals convection time (lambda) (mu=lambda)

Definition at line 5849 of file fvcartesiansolverxd.cpp.

5849 {
5850 TRACE();
5851
5852 MFloat pressureLoss = F0;
5853
5854 m_log << "TbTu = " << m_burntUnburntTemperatureRatio << endl;
5855 // compute the flame strouhal number for forced cases
5857 const MFloat slOverU = m_flameSpeed / m_MaFlameTube;
5858 const MFloat Lf = m_realRadiusFlameTube * tan(acos(slOverU)); // nominal flame length (measured: 1.57)
5860 // for slot burner with strouhal number based on length one!!! (otherwise neutral markstein lengths not comparable)
5861 if(m_neutralFlameStrouhal > 0) {
5863 }
5864 } else {
5865 m_flameStrouhal = F0;
5866 }
5867 // nondimensilization of strouhal to stagnation point
5870
5871 // compute theorethical marksetin length
5873
5874 m_log << "neutral markstein length (theory) = " << m_marksteinLengthTh << endl << endl;
5875
5876 // initialize flame tube variables as infinity variables (used also for simulations without plenum, than the flame
5877 // tube variables are the same as the infinity variables)
5879 // m_jetTemperature = m_burntUnburntTemperatureRatio;
5880
5882 // m_jetPressure = m_PInfinity;
5883
5885
5887 // m_jetDensity = m_rhoInfinity*m_targetDensityFactor;
5888
5889 if(!(m_initialCondition == 1991 || m_initialCondition == 19911)) {
5891
5893 }
5894 // needed for DL instability, updated in boundary conditions 17517, 1752
5896
5897 m_log << "CFL number: " << m_cfl << endl;
5898 m_log << "smallest Cell distance according to max refinement Level: " << c_cellLengthAtLevel(maxRefinementLevel())
5899 << endl;
5900
5901 // update needed for computing the correct burnt and unburnt density values for DL instability growth rate computation
5902 if(m_restart && (m_initialCondition == 1991 || m_initialCondition == 19911)) {
5903 // correct burnt unburnt temperature ratio only for restart
5904 m_log << "corrected m_rhoUnburnt = " << m_rhoUnburnt << endl;
5905 m_log << "corrected TbTu = " << m_burntUnburntTemperatureRatio << endl;
5906
5908 m_log << "corrected m_rhoBurnt = " << m_rhoBurnt << endl;
5909
5910
5911 // correct thermal diffusivity
5912 m_DthInfinity = sysEqn().m_muInfinity / (m_rhoUnburnt * m_Pr);
5913 m_log << "corrected DthInfinity = " << m_DthInfinity << endl;
5914
5916
5917 m_log << "corrected neutral markstein length (theory) = " << m_marksteinLengthTh << endl;
5918 m_log << "perturbation amplitude = " << m_perturbationAmplitude << endl;
5919 // don't correct rho infinity because it shouldn't be changed for the sponge layer!!!
5920 }
5921
5922 // update needed for computing the correct burnt and unburnt density values for DL instability neutral Markstein
5923 // length computation
5924 if(m_restart && (m_initialCondition == 1990 || m_initialCondition == 19901)) {
5925 // correct burnt unburnt temperature ratio only for restart
5926 m_log << "corrected m_rhoUnburnt (should be set by your properties file) = " << m_rhoUnburnt << endl;
5927 m_log << "corrected TbTu (should be set by your properties file) = " << m_burntUnburntTemperatureRatio << endl;
5929 m_log << "corrected m_rhoBurnt = " << m_rhoBurnt << endl;
5930
5931 // correct thermal diffusivity
5932 m_DthInfinity = sysEqn().m_muInfinity / (m_rhoUnburnt * m_Pr);
5933 m_log << "corrected DthInfinity = " << m_DthInfinity << endl;
5934
5936
5937 m_log << "corrected neutral markstein length (theory) = " << m_marksteinLengthTh << endl;
5938 m_log << "CFL number: " << m_cfl << endl;
5939 m_log << "smallest Cell distance according to max refinement Level: " << c_cellLengthAtLevel(maxRefinementLevel())
5940 << endl;
5941
5942 // calculate actual markstein length
5943 m_log << "actual used markstein length (should be set by your properties file)" << m_marksteinLength << endl;
5944 }
5945
5946 if(m_confinedFlame) {
5948 // nondimensionalization of the mean velocity which is caluclated based on the Ma not on VInf
5949 m_meanVelocity *= sqrt(m_TInfinity);
5950
5953 m_log << "mean velocity " << m_meanVelocity << endl;
5954 m_log << "mean velocity outlet" << m_meanVelocityOutlet << endl;
5955
5957 m_log << "friction deltaP tube " << m_deltaPL << endl;
5960 m_log << "friction deltaP total " << m_deltaPL << endl;
5961
5962 MFloat pressureLossFlame = m_rhoInfinity * (m_burntUnburntTemperatureRatio - F1);
5963 if(m_pressureLossFlameSpeed != 0) {
5964 pressureLossFlame *= POW2(m_flameSpeed);
5965 } else {
5966 pressureLossFlame *= POW2(m_VInfinity);
5967 }
5969 pressureLossFlame -= m_rhoFlameTube * POW2(m_meanVelocity);
5970 m_log << "pressureLoss" << pressureLossFlame << endl;
5971 m_deltaPL += pressureLossFlame;
5972 m_log << "deltaP total = friction deltaP + pressureLoss " << m_deltaPL << endl;
5974 m_log << "deltaP total = friction deltaP + pressureLoss + pressureLossCorrection " << m_deltaPL << endl;
5975 m_log << " pressure forced at inlet p = pInf + totaldeltaP " << m_PInfinity + m_deltaPL << endl;
5977 m_log << "mean pressure is initialized according to the inlet pressure" << endl;
5978 m_log << " pressure forced at outlet p = pInf " << m_PInfinity << endl;
5979 }
5980
5981 // for flame testcase the reference values are set to the flame tube variables if there is a plenum
5982 if(m_plenum && !m_confinedFlame) {
5983 // compute primitive variables of flame tube
5984 m_temperatureFlameTube = sysEqn().temperature_IR(m_MaFlameTube);
5985
5987
5989 // compute conservative variables
5991
5992 // velocity of the outlet needed for target pressure calculation, see spongeLayerLayout 17513, if a plenum and no
5993 // slip walls are used at the outlet sides
5994 if(m_combustion && m_plenumWall) {
5997 }
5999 sysEqn().m_muInfinity = SUTHERLANDLAW(m_temperatureFlameTube);
6000 // heat release model (progress variable) assumption of unity Lewis number Le=1 -> lambda(T)=D(T), see Dissertation
6001 // D.Hartmann page 13
6002 m_DInfinity = sysEqn().m_muInfinity;
6003 sysEqn().m_Re0 = m_Re * sysEqn().m_muInfinity / (m_rhoFlameTube * m_MaFlameTube * sqrt(m_temperatureFlameTube));
6004 m_rRe0 = 1. / sysEqn().m_Re0;
6005 // - - assuming m_TInfinity is the temperature of the unburnt gas
6006 // - - Dth = mue^u / ( rho^u *Pr )
6007 m_DthInfinity = sysEqn().m_muInfinity / (m_rhoFlameTube * m_Pr);
6008
6010
6011 // pressure loss inlet -> tube
6012 pressureLoss = m_rhoInfinity * POW2(m_VInfinity) * (m_inletTubeAreaRatio - F1);
6013
6014 m_log << "***************************************************************************" << endl;
6015 m_log << "Plenum - Computation:" << endl;
6016 m_log << "Initial Condition summary referred to the averaged values of the flame tube" << endl;
6017 m_log << "***************************************************************************" << endl;
6018 m_log << "Re = " << m_Re << endl;
6019 m_log << "Re0 (used in code) = " << sysEqn().m_Re0 << endl;
6020 m_log << "Ma_fl (used in code) = " << m_MaFlameTube << endl;
6021 m_log << "T_fl = " << m_temperatureFlameTube << endl;
6022 m_log << "V_fl = " << m_velocityFlameTube << endl;
6023 m_log << "P_fl = " << m_pressureFlameTube << endl;
6024 m_log << "rho_fl (used in code) = " << m_rhoFlameTube << endl;
6025 m_log << "rhoEInfinity (used in code) = " << m_rhoEInfinity << endl;
6026 m_log << "mu_Infinity (used in code) = " << sysEqn().m_muInfinity << endl;
6027 m_log << "D_Infinity (used in code) = " << m_DInfinity << endl;
6028 m_log << "Dth_Infinity (used in code) = " << m_DthInfinity << endl << endl;
6029 m_log << "Tb/Tu (used in code) = " << m_burntUnburntTemperatureRatio << endl << endl;
6030
6031 if(m_plenumWall) {
6032 m_log << "******************************************************************" << endl;
6033 m_log << "Plenum + Wall - Computation:" << endl;
6034 m_log << "Additional information for the use of no slip walls at the outlet:" << endl;
6035 m_log << "******************************************************************" << endl;
6036 m_log << "inletOutletAreaRatio = " << m_inletOutletAreaRatio << endl;
6037 m_log << "inletTubeAreaRatio = " << m_inletTubeAreaRatio << endl;
6038 m_log << "flameOutletAreaRatio = " << m_flameOutletAreaRatio << endl;
6039 m_log << "averaged velocity outlet = " << m_velocityOutlet << endl;
6040 m_log << "Calculating additional pressure loss ... " << pressureLoss << endl;
6041
6042 pressureLoss += m_rhoFlameTube * m_targetDensityFactor
6044 }
6045 // pressure loss = pressure loss (inlet -> tube) + pressure loss (tube -> outlet )
6046 m_log << "pressure loss = " << pressureLoss << endl;
6047 }
6048
6049 if(m_confinedFlame) {
6050 m_log << "******************************************************************" << endl;
6051 m_log << "Confined flame - Computation:" << endl;
6052 m_log << "Additional information for the use of no slip walls at the outlet:" << endl;
6053 m_log << "******************************************************************" << endl;
6054 m_log << "inletOutletAreaRatio = " << m_inletOutletAreaRatio << endl;
6055 m_log << "flameOutletAreaRatio = " << m_flameOutletAreaRatio << endl;
6056 m_log << "averaged velocity outlet = " << m_velocityOutlet << endl;
6057 m_log << "Calculating additional pressure loss ... " << pressureLoss << endl;
6058
6059 // pressureLoss +=
6060 // m_rhoFlameTube * m_targetDensityFactor * (POW2(m_velocityOutlet) - POW2(m_flameSpeed) *
6061 // m_flameOutletAreaRatio);
6062 }
6063
6064
6065 IF_CONSTEXPR(nDim == 3) {
6066 // turb flame speed contribution Pitsch et al. 2005
6067 MFloat FDL = 1 / m_DthInfinity;
6068 MFloat DL = m_DthInfinity;
6069 MFloat b3T = 1.0;
6070 MFloat b1T = 2.0;
6071 // MFloat m_ScT = 0.4; // Pitsch et al. 2005 and 2000 (0.5) -> a constant value can be used
6072 // MFloat m_NuT = 0.0017169;// max value determined from cold jet with grid refinement r11 at y=-0.5
6073
6074 MFloat Dt = m_NuT / m_ScT;
6075 // lam. flame speed
6076 MFloat flameSpeed = m_flameSpeed;
6077
6078 MFloat delta = c_cellLengthAtLevel(maxLevel()); // LES filter width equals grid siz
6079 MFloat uAmpl = pow(m_integralAmplitude, 3); // filtered velocity
6080 uAmpl *= delta;
6081 uAmpl /= m_integralLengthScale;
6082 uAmpl = pow(uAmpl, F1B3); // filtered velocity Pitsch et al. 2005
6083 m_Da = flameSpeed * delta / (uAmpl * m_laminarFlameThickness); // Eq. 2 in Pitsch et al. 2002
6084
6085 MFloat bFactor = pow(b3T, 2) / (F2 * b1T * m_ScT);
6086
6087 bFactor *= m_NuT * FDL * m_flameSpeed / uAmpl;
6088
6089 MFloat b3Factor = pow(b3T, 2) * m_NuT;
6090 b3Factor /= (m_ScT * DL);
6091
6092 // -bFactor + sqrt(bFactor + b3Factor)
6093 MFloat turbFlameSpeed = -bFactor;
6094 turbFlameSpeed += sqrt(pow(bFactor, 2) + b3Factor);
6095 turbFlameSpeed *= m_flameSpeed;
6096
6097 m_turbFlameSpeed = turbFlameSpeed;
6098 m_log << "Da = " << m_Da << endl;
6099 MFloat Ka = sqrt(pow((uAmpl / m_flameSpeed), 3) * m_laminarFlameThickness / delta);
6100 m_log << "Ka = " << Ka << endl;
6101
6102 m_log << "turbulent flame speed = " << m_turbFlameSpeed << endl;
6103 m_log << "turbulent flame speed/lam flame speed = " << m_turbFlameSpeed / m_flameSpeed << endl;
6104
6105 MFloat FDa = Dt;
6106 if(m_Da > 1) {
6107 FDa *= F1 / pow(m_Da, 2);
6108 m_log << "Pitsch model for Da > 1 " << endl;
6109 } else {
6110 m_log << "Pitsch model for Da < 1 " << endl;
6111 }
6112 m_log << "turbulent diffusivity D_tk = " << FDa << endl;
6113 m_log << "ratio of integral velocity to flame speed " << m_integralAmplitude / m_flameSpeed << endl;
6114 }
6115}

◆ setConservativeVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setConservativeVariables ( MInt  cellId)
inlinevirtual
Author
Lennart Schneiders

Definition at line 12652 of file fvcartesiansolverxd.cpp.

12652 {
12653 const MFloat* const RESTRICT pvars = &a_pvariable(cellId, 0);
12654 MFloat* const RESTRICT cvars = &a_variable(cellId, 0);
12655 const MFloat* const RESTRICT avars = hasAV ? &a_avariable(cellId, 0) : nullptr;
12656
12657 IF_CONSTEXPR(isDetChem<SysEqn>) setMeanMolarWeight_PV(cellId);
12658
12659 sysEqn().computeConservativeVariables(pvars, cvars, avars);
12660}
void setMeanMolarWeight_PV(MInt cellId)

◆ setConservativeVarsOnAzimuthalRecCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setConservativeVarsOnAzimuthalRecCells ( )

◆ setGlobalSolverVars()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setGlobalSolverVars ( std::vector< MFloat > &  globalFloatVars,
std::vector< MInt > &  globalIdVars 
)
override

Definition at line 10399 of file fvcartesiansolverxd.cpp.

10400 {
10401 TRACE();
10402
10403 // Set variables in the same order as in getGlobalSolverVars()
10404 m_time = globalFloatVars[0];
10405 m_timeStep = globalFloatVars[1];
10406 m_physicalTime = globalFloatVars[2];
10407}

◆ setInfinityState()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setInfinityState ( )
Author
Tim Wegmann

◆ setInputOutputProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setInputOutputProperties ( )

◆ setMeanMolarWeight_CV()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::setMeanMolarWeight_CV ( MInt  cellId)

Definition at line 875 of file fvcartesiansolverxd.cpp.

875 {
876 const MFloat* const cvarsCell = &a_variable(cellId, 0);
877 MFloat* const avarsCell = hasAV ? &a_avariable(cellId, 0) : nullptr;
878
879 sysEqn().computeMeanMolarWeight_CV(cvarsCell, avarsCell);
880}

◆ setMeanMolarWeight_PV()

template<MInt nDim_, class SysEqn >
template<class _ , std::enable_if_t< isDetChem< SysEqn >, _ * > >
void FvCartesianSolverXD< nDim_, SysEqn >::setMeanMolarWeight_PV ( MInt  cellId)

Definition at line 884 of file fvcartesiansolverxd.cpp.

884 {
885 const MFloat* const pvarsCell = &a_pvariable(cellId, 0);
886 MFloat* const avarsCell = hasAV ? &a_avariable(cellId, 0) : nullptr;
887
888 sysEqn().computeMeanMolarWeight_PV(pvarsCell, avarsCell);
889}

◆ setMultilevelPrimary()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setMultilevelPrimary ( const MBool  state = true)
inline

Definition at line 2103 of file fvcartesiansolverxd.h.

2103{ m_isMultilevelPrimary = state; }

◆ setMultilevelSecondary()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setMultilevelSecondary ( const MBool  state = true)
inline

Definition at line 2104 of file fvcartesiansolverxd.h.

2104{ m_isLowestSecondary = state; }

◆ setNghbrInterface()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setNghbrInterface

Definition at line 7547 of file fvcartesiansolverxd.cpp.

7547 {
7548 TRACE();
7549
7550 for(MInt cellId = 0; cellId < a_noCells(); ++cellId) {
7551 if(!a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
7552 continue;
7553 }
7554 if(a_hasProperty(cellId, SolverCell::IsNotGradient)) {
7555 continue;
7556 }
7557 if(a_isBndryGhostCell(cellId)) {
7558 continue;
7559 }
7560 if(a_hasProperty(cellId, SolverCell::IsSplitClone)) {
7561 continue;
7562 }
7563
7564 for(MInt dir = 0; dir < m_noDirs; ++dir) {
7565 if(a_hasNeighbor(cellId, dir) > 0) { // nghbr on same or higher lvl
7566 const MInt nghbrId = c_neighborId(cellId, dir);
7567 if(c_noChildren(nghbrId) > 0) { // finer neighbor
7568 TERMM_IF_COND(a_hasProperty(nghbrId, SolverCell::IsOnCurrentMGLevel),
7569 "Nghbr can't have children & be on curent MG lvl!");
7570 // Ensure that at least one of the children is adjacent to current cell.
7571 // If cell is not bndry cell, it must have IPOW2(nDim-1) nghbrs on higher lvl.
7572 MInt noNghbrChilds = 0;
7573 for(MInt child = 0; child < IPOW2(nDim); child++) {
7574 if(c_childId(nghbrId, child) > -1) {
7575 if(childCodePro[dir] & 1 << child) { // check if adjacent to current cell.
7576 TERMM_IF_NOT_COND(a_hasProperty(c_childId(nghbrId, child), SolverCell::IsOnCurrentMGLevel),
7577 "Unkown situation!");
7578 ++noNghbrChilds;
7579 }
7580 }
7581 }
7582 TERMM_IF_COND(!a_isBndryCell(cellId) && noNghbrChilds != IPOW2(nDim - 1), "");
7583 if(noNghbrChilds > 0) {
7584 // a bndry cell may have less then IPOW2(nDim-1) finer nghbrs
7585 m_cells.nghbrInterface(cellId, dir, 2);
7586 } else { // no neighbor at all
7587 m_cells.nghbrInterface(cellId, dir, 0);
7588 }
7589 } else { // neighbor on same level
7590 m_cells.nghbrInterface(cellId, dir, 1);
7591 }
7592 } else if(c_parentId(cellId) > -1 && a_hasNeighbor(c_parentId(cellId), dir) > 0
7593 && a_hasProperty(c_neighborId(c_parentId(cellId), dir),
7594 SolverCell::IsOnCurrentMGLevel)) { // coarse neighbor
7595 const MInt parentId = c_parentId(cellId);
7596 for(MInt child = 0; child < IPOW2(nDim); child++) {
7597 if(c_childId(parentId, child) == cellId) {
7598 if((childCodePro[m_revDir[dir]] & 1 << child) == (uint_fast8_t)0) {
7599 m_cells.nghbrInterface(cellId, dir, 0);
7600 } else {
7601 m_cells.nghbrInterface(cellId, dir, 3);
7602 }
7603 break;
7604 }
7605 }
7606 } else { // no neighbor at all
7607 m_cells.nghbrInterface(cellId, dir, 0);
7608 }
7609 }
7610
7611 a_hasProperty(cellId, SolverCell::HasCoarseNghbr) = false;
7612 for(MInt d = 0; d < nDim; ++d) {
7613 if(m_cells.nghbrInterface(cellId, 2 * d) == 3 || m_cells.nghbrInterface(cellId, 2 * d + 1) == 3) {
7614 a_hasProperty(cellId, SolverCell::HasCoarseNghbr) = true;
7615 break;
7616 }
7617 }
7618 }
7619}

◆ setNumericalProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setNumericalProperties ( )

◆ setPrimitiveVariables()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setPrimitiveVariables ( MInt  cellId)
Author
Lennart Schneiders, Borja Pedro

Definition at line 20043 of file fvcartesiansolverxd.cpp.

20043 {
20044 const MFloat* const cvarsCell = &a_variable(cellId, 0);
20045 MFloat* const pvarsCell = &a_pvariable(cellId, 0);
20046 const MFloat* const avarsCell = hasAV ? &a_avariable(cellId, 0) : nullptr;
20047
20048 IF_CONSTEXPR(isDetChem<SysEqn>) setMeanMolarWeight_CV(cellId);
20049
20050 sysEqn().computePrimitiveVariables(cvarsCell, pvarsCell, avarsCell);
20051
20052 IF_CONSTEXPR(isEEGas<SysEqn>) {
20053 MBool change = false;
20054 if(m_EEGas.uDLimiter) {
20055 change = uDLimiter(&a_uOtherPhase(cellId, 0), &a_pvariable(cellId, 0));
20056 }
20057 if(change) setConservativeVariables(cellId);
20058 }
20059}
virtual void setConservativeVariables(MInt cellId)
computes conservative from primitive variables for given cell id
void setMeanMolarWeight_CV(MInt cellId)
Computes the mean molar weight at the given cell ID from the primitive variables. The mean molar weig...

◆ setRestartFileOutputTimeStep()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setRestartFileOutputTimeStep
protected

Definition at line 9760 of file fvcartesiansolverxd.cpp.

9760 {
9761 TRACE();
9762 if((m_timeStepMethod == 17511 && nDim == 2) || m_timeStepMethod == 6) {
9763 return;
9764 }
9766}

◆ setRungeKuttaProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setRungeKuttaProperties ( )
Author
Gonzalo Brito Gadeschi
Date
October, 2012

◆ setSamplingProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setSamplingProperties ( )

◆ setSensors()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setSensors ( std::vector< std::vector< MFloat > > &  sensors,
std::vector< MFloat > &  sensorWeight,
std::vector< std::bitset< 64 > > &  sensorCellFlag,
std::vector< MInt > &  sensorSolverId 
)
overridevirtual
Author
Tim Wegmann

Reimplemented from Solver.

Definition at line 23604 of file fvcartesiansolverxd.cpp.

23607 {
23608 TRACE();
23609
23610 MInt noSensors = this->m_noInitialSensors;
23611 if(globalTimeStep > 0) noSensors = this->m_noSensors;
23612
23613 const auto sensorOffset = (signed)sensors.size();
23614 ASSERT(sensorOffset == 0 || grid().raw().treeb().noSolvers() > 1, "");
23615 sensorCellFlag.resize(grid().raw().m_noInternalCells, sensorOffset + noSensors);
23616 sensors.resize(sensorOffset + noSensors, vector<MFloat>(grid().raw().m_noInternalCells, F0));
23617 sensorWeight.resize(sensorOffset + noSensors, -1);
23618 sensorSolverId.resize(sensorOffset + noSensors, solverId());
23619 ASSERT(sensorOffset + noSensors < CartesianGrid<nDim>::m_maxNoSensors, "Increase bitset size!");
23620
23621
23622 // If solver is inactive the sensor arrays need to be set to obtain the correct offsets
23623 if(!isActive()) {
23624 for(MInt sen = 0; sen < noSensors; sen++) {
23625 sensorWeight[sensorOffset + sen] = this->m_sensorWeight[sen];
23626 }
23627 return;
23628 }
23629
23630 // necessary for the outside check at the initial adaptation!
23631 if(grid().allowInterfaceRefinement() && globalTimeStep < 0) {
23632 this->identifyBoundaryCells();
23633 }
23634
23635 if(!this->m_adapts) {
23636 ASSERT(!m_levelSetMb, "Currently not possible to leave the FV-Solver adaptation!");
23637 return;
23638 }
23639
23640 // compute slopes at first adaptation loop
23643 }
23644
23645 if(domainId() == 0) {
23646 cerr << "Setting " << noSensors << " sensors for fv-Solver adaptation." << endl;
23647 }
23648
23649 for(MInt sen = 0; sen < noSensors; sen++) {
23650 (this->*(this->m_sensorFnPtr[sen]))(sensors, sensorCellFlag, sensorWeight, sensorOffset, sen);
23651
23652 // labels:FV jannik: testcase hack, necessary for 2D_forced_cyl_adaptive and 2D_tandem_cylinders_adaptive
23653 // @ansgar_pls_adapt is this always required for 2D?
23654
23655 IF_CONSTEXPR(nDim == 2) {
23656 ScratchSpace<MFloat> distance(a_noCells(), AT_, "distance");
23657 getBoundaryDistance(distance);
23658
23659 ScratchSpace<MFloat> bbox(m_noDirs, AT_, "bbox");
23660 MFloat* p_bbox = bbox.getPointer();
23661 m_geometry->getBoundingBox(p_bbox);
23662
23663#ifdef _OPENMP
23664#pragma omp parallel for
23665#endif
23666 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
23667 if(a_bndryId(cellId) != -1) {
23668 continue;
23669 }
23670 if(a_isBndryGhostCell(cellId)) {
23671 continue;
23672 }
23673 if(c_noChildren(cellId) > 0) {
23674 continue;
23675 }
23676 if(c_isToDelete(cellId)) {
23677 continue;
23678 }
23679
23680 const MInt gridId = this->grid().tree().solver2grid(cellId);
23681
23682 MFloat minDist = c_cellLengthAtLevel(0);
23683 for(MInt i = 0; i < nDim; i++) {
23684 minDist = mMin(minDist, fabs(a_coordinate(cellId, i) - bbox.p[i]));
23685 minDist = mMin(minDist, fabs(a_coordinate(cellId, i) - bbox.p[nDim + i]));
23686 }
23687 MFloat fac = mMin(F1, mMax(F0, (minDist - 5.0) / (10.0 - 5.0)));
23688
23689 const MFloat R0 = 3.0 * m_adaptationDampingDistance;
23690 const MFloat R1 = F1B2 * c_cellLengthAtLevel(0);
23691 const MFloat r = mMax(F0, distance[cellId] - R0) / (R1 - R0);
23692 fac = F1 / (F1 + POW2(F4 * r));
23693
23694 sensors[sensorOffset + sen][gridId] *= fac;
23695 }
23696 }
23697 }
23698
23699 ASSERT(m_freeIndices.empty(), "");
23700 m_freeIndices.clear();
23701
23702 if(!g_multiSolverGrid) {
23703 ASSERT(a_noCells() == c_noCells() && c_noCells() == grid().raw().treeb().size(), "");
23704 }
23705
23706 this->m_adaptationStep++;
23707}
MInt noSolvers
Definition: maiatypes.h:73

◆ setTestcaseProperties()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setTestcaseProperties ( )

◆ setTimeStep()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setTimeStep
virtual

Reimplemented from Solver.

Definition at line 21677 of file fvcartesiansolverxd.cpp.

21677 {
21678 TRACE();
21679
21682 }
21683
21684 m_timeStepUpdated = true;
21685
21686
21687 IF_CONSTEXPR(nDim == 2) {
21688 // TODOs labels:FV
21689 // - since computeSamplingTimeStep overwrites m_timeStep it belongs to timeStepMethods
21690 // - however it expects the previous time-step (before the one being modified)
21691 // to be written to a file. For this reason:
21692 // - m_restartFileOutputTimeStep exists which writes out a different dt than the one used
21693 // - some level set test cases have a timeStep of -1 in their restart files...
21694 // - this seems to be only somehow relevant for 2D level set which means
21695 // 3D flames are using a completely different time-step
21698 if(m_timeStepMethod == 17511) {
21699 computeSamplingTimeStep(); // TODO labels:FV 2d_forced_flame_serial cruft
21700 }
21701 }
21702}

◆ setUpBndryInterpolationStencil()

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::setUpBndryInterpolationStencil ( const MInt  cellId,
MInt interpolationCells,
const MFloat point 
)

Definition at line 22059 of file fvcartesiansolverxd.cpp.

22060 {
22061 TRACE();
22062
22063 MInt count = 0;
22064 const MInt stencilSize = IPOW2(nDim);
22065 if(!a_hasProperty(cellId, SolverCell::IsSplitCell)) {
22066 // add cellId itself and possible bndry-ghost cell
22067 interpolationCells[count++] = cellId;
22068 if(a_isBndryCell(cellId)) {
22069 interpolationCells[count++] = a_bndryGhostCellId(a_bndryId(cellId), 0);
22070 }
22071 } else {
22072 // for split cell: add closest split-child and its bndry-ghost-cell
22073 MInt scId = -1;
22074 for(MInt sc = 0; sc < a_noSplitCells(); sc++) {
22075 const MInt splitCell = m_splitCells[sc];
22076 if(splitCell == cellId) {
22077 scId = sc;
22078 break;
22079 }
22080 }
22081 // fill distance array
22082 MFloatScratchSpace dist(a_noSplitChilds(scId), AT_, "neighborDistance");
22083 for(MInt ssc = 0; ssc < a_noSplitChilds(scId); ssc++) {
22084 const MInt splitChild = a_splitChildId(scId, ssc);
22085 IF_CONSTEXPR(nDim == 2) {
22086 dist(ssc) = sqrt(POW2(point[0] - a_coordinate(splitChild, 0)) + POW2(point[1] - a_coordinate(splitChild, 1)));
22087 }
22088 else {
22089 dist(ssc) = sqrt(POW2(point[0] - a_coordinate(splitChild, 0)) + POW2(point[1] - a_coordinate(splitChild, 1))
22090 + POW2(point[2] - a_coordinate(splitChild, 2)));
22091 }
22092 }
22093 // find child with lowest distance
22094 MInt sscId = -1;
22095 MInt minDist = 99;
22096 for(MInt ssc = 0; ssc < a_noSplitChilds(scId); ssc++) {
22097 if(dist(ssc) < minDist) {
22098 minDist = dist(ssc);
22099 sscId = ssc;
22100 }
22101 }
22102 const MInt splitChildId = a_splitChildId(scId, sscId);
22103 interpolationCells[count++] = splitChildId;
22104 interpolationCells[count++] = a_bndryGhostCellId(a_bndryId(splitChildId), 0);
22105 }
22106
22107#ifndef NDEBUG
22108 MInt debugId = -1;
22109 MInt debugDomainId = -1;
22110
22111 if(cellId == debugId && domainId() == debugDomainId) {
22112 if(count == 1) {
22113 cerr << "Cell has only " << interpolationCells[0] << " s" << count << endl;
22114 } else {
22115 cerr << "Cell has " << interpolationCells[0] << " and bndry-ghost-cell " << interpolationCells[1] << " s" << count
22116 << endl;
22117 }
22118 cerr << "Cell is " << cellId << " " << c_noCells() << a_hasProperty(cellId, SolverCell::IsSplitCell) << endl;
22119 }
22120#endif
22121
22122 // compute distance to all neighbor cells
22123 MFloatScratchSpace neighborDistance(m_noDirs, AT_, "neighborDistance");
22124 for(MInt dir = 0; dir < m_noDirs; dir++) {
22125 if(!checkNeighborActive(cellId, dir) || !a_hasNeighbor(cellId, dir)) {
22126 neighborDistance[dir] = 99.9;
22127 } else {
22128 IF_CONSTEXPR(nDim == 2) {
22129 neighborDistance[dir] = sqrt(POW2(point[0] - a_coordinate(c_neighborId(cellId, dir), 0))
22130 + POW2(point[1] - a_coordinate(c_neighborId(cellId, dir), 1)));
22131 }
22132 else {
22133 neighborDistance[dir] = sqrt(POW2(point[0] - a_coordinate(c_neighborId(cellId, dir), 0))
22134 + POW2(point[1] - a_coordinate(c_neighborId(cellId, dir), 1))
22135 + POW2(point[2] - a_coordinate(c_neighborId(cellId, dir), 2)));
22136 }
22137 }
22138 }
22139
22140#ifndef NDEBUG
22141 if(cellId == debugId && domainId() == debugDomainId) {
22142 for(MInt i = 0; i < m_noDirs; i++) {
22143 const MInt nghbrId = c_neighborId(cellId, i);
22144 MInt ghostCell = -1;
22145 if(nghbrId > -1 && a_isBndryCell(nghbrId)) {
22146 ghostCell = a_bndryGhostCellId(a_bndryId(nghbrId), 0);
22147 }
22148 cerr << "distance " << i << " " << neighborDistance[i] << " neighbor " << nghbrId << " neighbor-ghost "
22149 << ghostCell << " " << a_hasProperty(nghbrId, SolverCell::IsSplitCell) << endl;
22150 }
22151 }
22152#endif
22153
22154 // use first matching neighbors with lowest distance
22155 for(MInt i = 0; i < m_noDirs; i++) {
22156 MInt minId = -1;
22157 MFloat minDistance = 99;
22158 for(MInt dir = 0; dir < m_noDirs; dir++) {
22159 if(neighborDistance[dir] < minDistance) {
22160 minDistance = neighborDistance[dir];
22161 minId = dir;
22162 }
22163 }
22164 if(minId > -1) {
22165 const MInt nghbrId = c_neighborId(cellId, minId);
22166 interpolationCells[count++] = nghbrId;
22167
22168#ifndef NDEBUG
22169 if(cellId == debugId && domainId() == debugDomainId) {
22170 cerr << "Adding " << interpolationCells[count - 1] << " in dir " << minId << " s" << count << endl;
22171 }
22172#endif
22173
22174 if(count < stencilSize && a_isBndryCell(nghbrId) && a_bndryGhostCellId(a_bndryId(nghbrId), 0) > -1) {
22175 // NOTE: bndry-ghost cell can be -1 for a bndry split-cell!
22176 interpolationCells[count++] = a_bndryGhostCellId(a_bndryId(nghbrId), 0);
22177
22178#ifndef NDEBUG
22179 if(cellId == debugId && domainId() == debugDomainId) {
22180 cerr << "Adding ghost-cell" << interpolationCells[count - 1] << " from dir " << minId << " s" << count
22181 << endl;
22182 }
22183#endif
22184 }
22185 neighborDistance[minId] = 99;
22186 }
22187 if(count == stencilSize) {
22188 break;
22189 }
22190 }
22191
22192 return count;
22193}
MInt a_splitChildId(const MInt sc, const MInt ssc)
MInt a_noSplitChilds(const MInt sc) const
const MInt & a_bndryGhostCellId(const MInt bndryId, const MInt srfc) const

◆ setUpwindCoefficient()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::setUpwindCoefficient

Definition at line 7290 of file fvcartesiansolverxd.cpp.

7290 {
7291 TRACE();
7292
7293 MBool flag;
7294 const MInt noSrfcs = a_noSurfaces();
7295 const MInt noDirs = 2 * nDim;
7296
7297 //---
7298 switch(m_upwindMethod) {
7299 default: {
7300 for(MInt s = 0; s < noSrfcs; s++) {
7301 flag = false;
7302 for(MInt side = 0; side < 2; side++) {
7303 for(MInt d = 0; d < noDirs; d++) {
7304 MInt gridcellId = a_surfaceNghbrCellId(s, side);
7305 MInt gridcellId2 = a_surfaceNghbrCellId(s, side);
7306 if(a_hasProperty(gridcellId, SolverCell::IsSplitClone)) {
7307 gridcellId = m_splitChildToSplitCell.find(gridcellId)->second;
7308 }
7309 if(a_hasProperty(gridcellId2, SolverCell::IsSplitClone)) {
7310 gridcellId2 = m_splitChildToSplitCell.find(gridcellId2)->second;
7311 }
7312 if(a_isBndryGhostCell(a_surfaceNghbrCellId(s, side)) || c_parentId(gridcellId) == -1) {
7313 continue;
7314 }
7315 if(a_hasNeighbor(gridcellId, d) > 0) {
7316 continue;
7317 }
7318 if(a_hasNeighbor(c_parentId(gridcellId2), d) == 0) {
7319 continue;
7320 }
7321 if(c_noChildren(c_neighborId(c_parentId(gridcellId2), d)) > 0) {
7322 continue;
7323 }
7324 flag = true;
7325 d = noDirs;
7326 }
7327 }
7328 if(flag) {
7330 } else {
7332 }
7333 }
7334 if(m_combustion && m_jet) {
7335 m_log << "upwinding on coarse level is set to max upwind coefficient 0.5, only valid when the coarse level "
7336 "is not of interest !!!!"
7337 << endl;
7338 for(MInt s = 0; s < noSrfcs; s++) {
7340 continue;
7341 }
7342 if(a_surfaceNghbrCellId(s, 0) == -1 || a_surfaceNghbrCellId(s, 1) == -1) {
7343 continue;
7344 }
7346 continue;
7347 }
7348
7350 }
7351 }
7352
7353 break;
7354 }
7355
7356 // Upwinding at coarse-fine surfaces only
7357 case 1: {
7358 for(MInt s = 0; s < noSrfcs; s++) {
7359 flag = false;
7360 for(MInt side = 0; side < 2; side++) {
7361 MInt gridcellId = a_surfaceNghbrCellId(s, side);
7362 MInt orientation = a_surfaceOrientation(s);
7363 MInt d = 2 * orientation + (1 - side);
7364 TERMM_IF_NOT_COND(gridcellId == a_surfaceNghbrCellId(s, side), "");
7365 if(a_hasProperty(gridcellId, SolverCell::IsSplitClone)) {
7366 gridcellId = m_splitChildToSplitCell.find(gridcellId)->second;
7367 }
7368 if(a_isBndryGhostCell(a_surfaceNghbrCellId(s, side)) || c_parentId(gridcellId) == -1) {
7369 continue;
7370 }
7371 if(a_hasNeighbor(gridcellId, d) > 0) {
7372 continue;
7373 }
7374 if(a_hasNeighbor(c_parentId(gridcellId), d) == 0) {
7375 continue;
7376 }
7377 if(c_noChildren(c_neighborId(c_parentId(gridcellId), d)) > 0) {
7378 continue;
7379 }
7380 flag = true;
7381 }
7382 if(flag) {
7384 } else {
7386 }
7387 }
7388 break;
7389 }
7390
7391 // Upwinding on coarse-fine surface and its opposite surface on fine cell
7392 case 2: {
7393 for(MInt s = 0; s < noSrfcs; s++) {
7394 flag = false;
7395 for(MInt side = 0; side < 2; side++) {
7396 MInt gridcellId = a_surfaceNghbrCellId(s, side);
7397 MInt orientation = a_surfaceOrientation(s);
7398 TERMM_IF_NOT_COND(gridcellId == a_surfaceNghbrCellId(s, side), "");
7399 for(MInt side2 = 0; side2 < 2; ++side2) {
7400 MInt d = 2 * orientation + side2;
7401 if(a_hasProperty(gridcellId, SolverCell::IsSplitClone)) {
7402 gridcellId = m_splitChildToSplitCell.find(gridcellId)->second;
7403 }
7404 if(a_isBndryGhostCell(a_surfaceNghbrCellId(s, side)) || c_parentId(gridcellId) == -1) {
7405 continue;
7406 }
7407 if(a_hasNeighbor(gridcellId, d) > 0) {
7408 continue;
7409 }
7410 if(a_hasNeighbor(c_parentId(gridcellId), d) == 0) {
7411 continue;
7412 }
7413 if(c_noChildren(c_neighborId(c_parentId(gridcellId), d)) > 0) {
7414 continue;
7415 }
7416 flag = true;
7417 break;
7418 }
7419 }
7420 if(flag) {
7422 } else {
7424 }
7425 }
7426 break;
7427 }
7428
7429 // FAN --> Alexej Pogorelov
7430 case 38:
7431 case 36: {
7432 if(m_periodicCells == 1) { // azimuthal periodicity concept
7433
7434 MFloat radius = 0.0;
7435 MInt cellId = -1;
7436
7437 for(MInt s = 0; s < noSrfcs; s++) {
7438 flag = false;
7439 for(MInt side = 0; side < 2; side++) {
7440 for(MInt d = 0; d < noDirs; d++) {
7441 cellId = a_surfaceNghbrCellId(s, side);
7442 if(a_isBndryGhostCell(cellId)) continue;
7443 radius = 0.0;
7444 for(MInt i = 0; i < 2; i++) {
7445 radius += pow(a_coordinate(cellId, i + 1) - m_rotAxisCoord[i], 2.0);
7446 }
7447 radius = sqrt(radius);
7448
7449 const MFloat halfLength = c_cellLengthAtLevel(minLevel() + 1);
7450
7451 if(a_hasProperty(a_surfaceNghbrCellId(s, side), SolverCell::IsPeriodicWithRot)
7452 && radius < 8.0 * halfLength) {
7453 flag = true;
7454 break;
7455 }
7456 MInt gridcellId = a_surfaceNghbrCellId(s, side);
7457 MInt gridcellId2 = a_surfaceNghbrCellId(s, side);
7458 if(a_hasProperty(gridcellId, SolverCell::IsSplitClone)) {
7459 gridcellId = m_splitChildToSplitCell.find(gridcellId)->second;
7460 }
7461 if(a_hasProperty(gridcellId2, SolverCell::IsSplitClone)) {
7462 gridcellId2 = m_splitChildToSplitCell.find(gridcellId2)->second;
7463 }
7464 if(a_hasNeighbor(gridcellId, d) > 0) {
7465 cellId = c_neighborId(gridcellId, d);
7466 radius = 0.0;
7467 for(MInt i = 0; i < 2; i++) {
7468 radius += pow(a_coordinate(cellId, i + 1) - m_rotAxisCoord[i], 2.0);
7469 }
7470 radius = sqrt(radius);
7471
7472
7473 if(a_hasProperty(c_neighborId(gridcellId, d), SolverCell::IsPeriodicWithRot)
7474 && radius < 8.0 * halfLength) {
7475 flag = true;
7476 d = noDirs;
7477 break;
7478 }
7479 }
7480
7481
7482 if(a_hasNeighbor(gridcellId, d) > 0) {
7483 continue;
7484 }
7485 if(c_parentId(gridcellId) == -1) {
7486 continue;
7487 }
7488 if(a_hasNeighbor(c_parentId(gridcellId2), d) == 0) {
7489 continue;
7490 }
7491 if(c_noChildren(c_neighborId(c_parentId(gridcellId2), d)) > 0) {
7492 continue;
7493 }
7494 if(!a_hasProperty(c_neighborId(c_parentId(gridcellId2), d), SolverCell::IsOnCurrentMGLevel)) {
7495 continue;
7496 }
7497 flag = true;
7498 d = noDirs;
7499 }
7500 }
7501
7502
7503 if(flag) {
7505 } else {
7507 }
7508 }
7509 }
7510
7511 } break;
7512
7513 case 1949: {
7514 for(MInt s = 0; s < noSrfcs; s++) {
7515 flag = false;
7516 for(MInt side = 0; side < 2; side++) {
7517 for(MInt d = 0; d < noDirs; d++) {
7518 MInt gridcellId = a_surfaceNghbrCellId(s, side);
7519 if(a_hasProperty(gridcellId, SolverCell::IsSplitClone)) {
7520 gridcellId = m_splitChildToSplitCell.find(gridcellId)->second;
7521 }
7522 if(a_hasNeighbor(gridcellId, d) > 0) {
7523 continue;
7524 }
7525 if(c_parentId(gridcellId) == -1) {
7526 continue;
7527 }
7528 if(a_hasNeighbor(c_parentId(gridcellId), d) == 0) {
7529 continue;
7530 }
7531 flag = true;
7532 d = noDirs;
7533 }
7534 }
7535 if(flag || ABS(a_surfaceCoordinate(s, 1) - 50) < 10) {
7537 } else {
7539 }
7540 }
7541 } break;
7542 }
7543}

◆ smallCellCorrection()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::smallCellCorrection ( const MInt  timerId = -1)
virtual
Author
Lennart Schneiders

◆ smallCellRHSCorrection()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::smallCellRHSCorrection ( const MInt  timerId = -1)
virtual

◆ solutionStep()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::solutionStep
overridevirtual
Author
Thomas Hoesgen

Time-integration (perform one Runge-Kutta step)

RHS computation:

RHS Boundary Condition:

LHS computation:

LHS Boundary Condition:

Reimplemented from Solver.

Definition at line 11118 of file fvcartesiansolverxd.cpp.

11118 {
11119 TRACE();
11120
11121 NEW_TIMER_GROUP_STATIC(tg_solutionStep, "solution step");
11122 NEW_TIMER_STATIC(t_solutionStep, "solution step", tg_solutionStep);
11123 NEW_SUB_TIMER_STATIC(t_timeIntegration, "time integration", t_solutionStep);
11124 NEW_SUB_TIMER_STATIC(t_lhs, "lhs", t_timeIntegration);
11125 NEW_SUB_TIMER_STATIC(t_lhsBnd, "lhsBnd", t_timeIntegration);
11126 NEW_SUB_TIMER_STATIC(t_rhs, "rhs", t_timeIntegration);
11127 NEW_SUB_TIMER_STATIC(t_rhsBnd, "rhsBnd", t_timeIntegration);
11128
11130 RECORD_TIMER_START(t_solutionStep);
11131 RECORD_TIMER_START(t_timeIntegration);
11132
11133 // Split MPI communication: finish MPI exchange if needed and perform
11134 // the left out part from lhsBnd()
11136 RECORD_TIMER_START(t_lhsBnd);
11137 lhsBndFinish();
11138 RECORD_TIMER_STOP(t_lhsBnd);
11139 }
11140 // Receive data in the next substep
11141 m_splitMpiCommRecv = true;
11142
11144 RECORD_TIMER_START(t_rhs);
11145 rhs();
11146 RECORD_TIMER_STOP(t_rhs);
11147
11149 RECORD_TIMER_START(t_rhsBnd);
11150 rhsBnd();
11151 RECORD_TIMER_STOP(t_rhsBnd);
11152
11154 RECORD_TIMER_START(t_lhs);
11155 const MBool timeStepCompleted = solverStep();
11156 RECORD_TIMER_STOP(t_lhs);
11157
11159 RECORD_TIMER_START(t_lhsBnd);
11160 lhsBnd();
11161 RECORD_TIMER_STOP(t_lhsBnd);
11162
11163 RECORD_TIMER_STOP(t_timeIntegration);
11164 RECORD_TIMER_STOP(t_solutionStep);
11165
11166 return timeStepCompleted;
11167}
void lhsBnd()
Apply lhsBnd.

◆ solverStep()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::solverStep

Perform solution step

Author
Sven Berger
Template Parameters
nDim

Definition at line 9903 of file fvcartesiansolverxd.cpp.

9903 {
9904 RECORD_TIMER_START(m_timers[Timers::TimeInt]);
9905 RECORD_TIMER_START(m_timers[Timers::Lhs]);
9906
9907 //-->debug
9908 /* MInt nosplitclones = 0;
9909 for( MInt cellId = 0; cellId < a_noCells(); cellId++ ){
9910 if(a_hasProperty(cellId, SolverCell::IsSplitClone)) nosplitclones++;
9911 }
9912 ASSERT(nosplitclones==0, "ERROR: clone cells in use!");
9913 */
9914
9916 RECORD_TIMER_STOP(m_timers[Timers::Lhs]);
9917 RECORD_TIMER_STOP(m_timers[Timers::TimeInt]);
9918 return true;
9919 }
9920
9921 // If multilevel is activated and this is *not* the finest solver, apply multilevel correction
9922 if(isMultilevel() && !isMultilevelPrimary()) {
9924 }
9925
9926 // Perform one Runge-Kutta substep, returns if time step is completed
9927 const MBool step = rungeKuttaStep();
9928
9929 IF_CONSTEXPR(isDetChem<SysEqn>) { correctMajorSpeciesMassFraction(); }
9930
9932
9933 // update the timeStep after the last rungeKuttaStep (=> new timeStep for next iteration!)
9934 if(step && requiresTimeStepUpdate()) {
9935#if defined(WITH_CANTERA)
9936 IF_CONSTEXPR(isDetChem<SysEqn>) { computeGamma(); }
9937#endif
9938 setTimeStep();
9939 }
9940
9941 RECORD_TIMER_STOP(m_timers[Timers::Lhs]);
9942 RECORD_TIMER_STOP(m_timers[Timers::TimeInt]);
9943 return step;
9944}
MBool requiresTimeStepUpdate() const
Returns true if the time-step should be updated on this step.
virtual void nonReflectingBCAfterTreatmentCutOff()
void applyCoarseLevelCorrection()
Apply coarse-level correction to RHS.
virtual bool rungeKuttaStep()
Dispatches the RungeKutta method for different number of species.

◆ startMpiExchange()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::startMpiExchange
Author
Michael Schlottke-Lakemper (mic) mic@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2016-11-16

First, waits for previous send requests to finish.

Definition at line 6411 of file fvcartesiansolverxd.cpp.

6411 {
6412 TRACE();
6413
6414 // SEND: Wait for old send requests to finish (blocking)
6415 RECORD_TIMER_START(m_tgatherAndSend);
6416 RECORD_TIMER_START(m_tgatherAndSendWait);
6418 MPI_Waitall((MInt)m_maxLvlMpiSendNeighbor.size(), m_mpi_sendRequest, MPI_STATUSES_IGNORE, AT_);
6419 }
6420 RECORD_TIMER_STOP(m_tgatherAndSendWait);
6421
6422 // Start receive requests if not already open
6425 m_mpiRecvRequestsOpen = true;
6426 }
6427
6428 // SEND: Fill send buffer and start sending (non-blocking)
6429 for(MInt i = 0; i < (MInt)m_maxLvlMpiSendNeighbor.size(); i++) {
6430 const MInt completedId = m_maxLvlMpiSendNeighbor[i];
6431 MInt bufferCounter = 0;
6432 for(MInt j = 0; j < m_noMaxLevelWindowCells[completedId]; j++) {
6433 copy_n(&a_pvariable(m_maxLevelWindowCells[completedId][j], 0),
6434 PV->noVariables,
6435 &m_sendBuffersNoBlocking[completedId][bufferCounter]);
6436 bufferCounter += m_dataBlockSize;
6437 }
6438 }
6439
6441
6442 m_mpiSendRequestsOpen = true;
6443
6444 RECORD_TIMER_STOP(m_tgatherAndSend);
6445}

◆ swapCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::swapCells ( const MInt  cellId0,
const MInt  cellId1 
)
overridevirtual
Author
Lennart Schneiders

Reimplemented from Solver.

Definition at line 22857 of file fvcartesiansolverxd.cpp.

22857 {
22858 if(cellId1 == cellId0) return;
22859
22860 const MInt noCVars = CV->noVariables;
22861 const MInt noFVars = FV->noVariables;
22862 const MInt noPVars = PV->noVariables;
22863 const MInt noAVars = AV->noVariables;
22864 for(MInt v = 0; v < noCVars; v++) {
22865 std::swap(a_variable(cellId1, v), a_variable(cellId0, v));
22866 std::swap(a_oldVariable(cellId1, v), a_oldVariable(cellId0, v));
22867 if(m_dualTimeStepping) {
22868 std::swap(a_dt1Variable(cellId1, v), a_dt1Variable(cellId0, v));
22869 std::swap(a_dt2Variable(cellId1, v), a_dt2Variable(cellId0, v));
22870 }
22871 }
22872 for(MInt v = 0; v < noFVars; v++) {
22873 std::swap(a_rightHandSide(cellId1, v), a_rightHandSide(cellId0, v));
22874 }
22875 for(MInt v = 0; v < noPVars; v++) {
22876 std::swap(a_pvariable(cellId1, v), a_pvariable(cellId0, v));
22877 for(MInt i = 0; i < nDim; i++) {
22878 std::swap(a_slope(cellId1, v, i), a_slope(cellId0, v, i));
22879 }
22880 }
22881
22882 if(hasAV) {
22883 for(MInt v = 0; v < noAVars; v++) {
22884 std::swap(a_avariable(cellId1, v), a_avariable(cellId0, v));
22885 }
22886 }
22887
22888 std::swap(a_cellVolume(cellId1), a_cellVolume(cellId0));
22889 std::swap(a_FcellVolume(cellId1), a_FcellVolume(cellId0));
22890
22891 IF_CONSTEXPR(SysEqn::m_noRansEquations == 0) {
22892 if(m_zonal) {
22893 vector<MInt>::iterator findId0 = find(m_LESAverageCells.begin(), m_LESAverageCells.end(), cellId0);
22894 vector<MInt>::iterator findId1 = find(m_LESAverageCells.begin(), m_LESAverageCells.end(), cellId1);
22895
22896 if(findId0 != m_LESAverageCells.end() && findId1 != m_LESAverageCells.end()) {
22897 MInt LESId0 = distance(m_LESAverageCells.begin(), findId0);
22898 MInt LESId1 = distance(m_LESAverageCells.begin(), findId1);
22899 for(MInt v = 0; v < m_LESNoVarAverage; v++) {
22900 std::swap(m_LESVarAverage[v][LESId0], m_LESVarAverage[v][LESId1]);
22901 }
22902 std::swap(m_LESAverageCells[LESId0], m_LESAverageCells[LESId1]);
22903 } else if(findId0 != m_LESAverageCells.end() && findId1 == m_LESAverageCells.end()) {
22904 MInt LESId0 = distance(m_LESAverageCells.begin(), findId0);
22905 m_LESAverageCells[LESId0] = cellId1;
22906 } else if(findId0 == m_LESAverageCells.end() && findId1 != m_LESAverageCells.end()) {
22907 MInt LESId1 = distance(m_LESAverageCells.begin(), findId1);
22908 m_LESAverageCells[LESId1] = cellId0;
22909 }
22910 }
22911 }
22912
22913 std::swap(a_spongeFactor(cellId1), a_spongeFactor(cellId0));
22914 std::swap(a_spongeBndryId(cellId1, 0), a_spongeBndryId(cellId0, 0));
22915 std::swap(a_spongeBndryId(cellId1, 1), a_spongeBndryId(cellId0, 1));
22916 IF_CONSTEXPR(nDim == 3) { std::swap(a_spongeBndryId(cellId1, 2), a_spongeBndryId(cellId0, 2)); }
22917
22918 const MInt bndryId0 = a_bndryId(cellId0);
22919 const MInt bndryId1 = a_bndryId(cellId1);
22920 if(bndryId0 > -1) {
22921 ASSERT(m_fvBndryCnd->m_bndryCells->a[bndryId0].m_cellId == cellId0, "bndryId not expected");
22922 m_fvBndryCnd->m_bndryCells->a[bndryId0].m_cellId = cellId1;
22923 }
22924 if(bndryId1 > -1) {
22925 ASSERT(m_fvBndryCnd->m_bndryCells->a[bndryId1].m_cellId == cellId1, "bndryId not expected");
22926 m_fvBndryCnd->m_bndryCells->a[bndryId1].m_cellId = cellId0;
22927 }
22928 std::swap(a_bndryId(cellId1), a_bndryId(cellId0));
22929
22930 std::swap(m_cells.properties(cellId1), m_cells.properties(cellId0));
22931
22932 if(m_sensorParticle) {
22933 std::swap(a_noPart(cellId1), a_noPart(cellId0));
22934 }
22935}
MInt & a_spongeBndryId(const MInt cellId, const MInt dir)
Returns the spongeBndryId of the cell cellId for direction dir.

◆ swapProxy()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::swapProxy ( const MInt  cellId0,
const MInt  cellId1 
)
overridevirtual
Author
Lennart Schneiders

Reimplemented from Solver.

Definition at line 22945 of file fvcartesiansolverxd.cpp.

22945 {
22946 grid().swapGridIds(cellId0, cellId1);
22947}

◆ sysEqn() [1/2]

template<MInt nDim_, class SysEqn >
SysEqn & FvCartesianSolverXD< nDim_, SysEqn >::sysEqn ( )
inline

Definition at line 332 of file fvcartesiansolverxd.h.

332{ return m_sysEqn; };

◆ sysEqn() [2/2]

template<MInt nDim_, class SysEqn >
SysEqn FvCartesianSolverXD< nDim_, SysEqn >::sysEqn ( ) const
inline

Definition at line 331 of file fvcartesiansolverxd.h.

331{ return m_sysEqn; };

◆ tagCellsNeededForSurfaceFlux()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::tagCellsNeededForSurfaceFlux
protected

Definition at line 8091 of file fvcartesiansolverxd.cpp.

8091 {
8092 TRACE();
8093
8094 const MInt noCells = a_noCells();
8095 const MInt noDirs = 2 * nDim;
8096 const MInt noSurfaces = a_noSurfaces();
8097 //---end of initialization
8098
8099 // reset the property 10 (flux computation)
8100 for(MInt cellId = 0; cellId < noCells; cellId++) {
8101 a_hasProperty(cellId, SolverCell::IsDummy) = false;
8102 a_hasProperty(cellId, SolverCell::IsFlux) = false;
8103 }
8104
8105 // tag those cells which are needed for the surface flux computation
8106 // add two additional layers
8107 for(MInt s = 0; s < noSurfaces; s++) {
8108 ASSERT(a_surfaceNghbrCellId(s, 0) > -1 && a_surfaceNghbrCellId(s, 1) > -1, to_string(s));
8109 a_hasProperty(a_surfaceNghbrCellId(s, 0), SolverCell::IsFlux) = true;
8110 a_hasProperty(a_surfaceNghbrCellId(s, 1), SolverCell::IsFlux) = true;
8111 }
8112
8113 for(MInt addLayer = 0; addLayer < 2; addLayer++) {
8114 for(MInt cellId = 0; cellId < noCells; cellId++) {
8115 if(a_hasProperty(cellId, SolverCell::IsFlux) && !a_isBndryGhostCell(cellId)) {
8116 for(MInt dir = 0; dir < noDirs; dir++) {
8117 MInt gridcellId = cellId;
8118 if(a_hasProperty(cellId, SolverCell::IsSplitClone)) {
8119 gridcellId = m_splitChildToSplitCell.find(cellId)->second;
8120 }
8121 if(a_hasNeighbor(gridcellId, dir) > 0) {
8122 a_hasProperty(c_neighborId(gridcellId, dir), SolverCell::IsDummy) = true;
8123 }
8124 }
8125 }
8126 }
8127 // refresh
8128 for(MInt cellId = 0; cellId < noCells; cellId++) {
8129 if(a_hasProperty(cellId, SolverCell::IsDummy)) {
8130 a_hasProperty(cellId, SolverCell::IsFlux) = true;
8131 }
8132 }
8133 }
8134}

◆ time()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::time
overridevirtual
Author
Thomas Schilden
Date
3.10.2015
Parameters
[out]time

Implements Solver.

Definition at line 8891 of file fvcartesiansolverxd.cpp.

8891 {
8892 return m_time;
8893}

◆ timeStep()

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::timeStep ( MBool  canSolver = false)
inlineprotectednoexcept

Returns the current time-step.

Warning
When using non-blocking time reduction this function will block if the time is not available.

Definition at line 2503 of file fvcartesiansolverxd.h.

2503 {
2504 if(!m_timeStepAvailable) {
2505#ifdef MAIA_FV_LOG_ACCESS_TO_UNAVAILABLE_TIME_STEP
2506 if(!canSolver) {
2507 MInt flag;
2508 MPI_Test(&m_timeStepReq, &flag, MPI_STATUS_IGNORE, AT_);
2509 if(!flag) {
2510 mTerm(1, AT_,
2511 "The time-step was required before it was available;"
2512 "use timeStep(true) if you want the timeStep call to solver communication");
2513 }
2514 }
2515#endif
2516 MPI_Wait(&m_timeStepReq, MPI_STATUS_IGNORE, AT_);
2517 m_timeStepAvailable = true;
2518 m_log << "Computed global time step (method: " << m_timeStepMethod << " ): " << m_timeStep
2519 << " - physical: " << m_timeStep * m_timeRef << std::endl;
2520 }
2521 return m_timeStep;
2522 }
int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status, const MString &name)
same as MPI_Test

◆ tripForceCoefficients()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::tripForceCoefficients ( MFloat modes,
MFloat forceCoef,
MFloat coords,
MInt  noCells,
MInt  noModes 
)

Definition at line 34149 of file fvcartesiansolverxd.cpp.

34150 {
34151 MFloat maxLocalValue = -999999.0;
34152 MFloat minLocalValue = 999999.0;
34153 MFloat* ak = &modes[0];
34154 MFloat* phik = &modes[noModes];
34155
34156 for(MInt k = 0; k < noCells; k++) {
34157 const MFloat z = coords[k];
34158 for(MInt n = 0; n < noModes; n++) {
34159 forceCoef[k] += sin(z * ak[n] + phik[n]);
34160 }
34161
34162 maxLocalValue = mMax(maxLocalValue, forceCoef[k]);
34163 minLocalValue = mMin(minLocalValue, forceCoef[k]);
34164 }
34165
34166 // find out min and max to normalize coefficients to interval [-1,1]
34167 MFloat maxGlobalValue = 0.0;
34168 MFloat minGlobalValue = 0.0;
34169 MPI_Allreduce(&maxLocalValue, &maxGlobalValue, 1, MPI_DOUBLE, MPI_MAX, mpiComm(), AT_, "maxLocalValue",
34170 "maxGlobalValue");
34171 MPI_Allreduce(&minLocalValue, &minGlobalValue, 1, MPI_DOUBLE, MPI_MIN, mpiComm(), AT_, "minLocalValue",
34172 "minGlobalValue");
34173
34174 // normalize the series
34175 for(MInt k = 0; k < noCells; k++) {
34176 forceCoef[k] = 2 * (forceCoef[k] - minGlobalValue) / (maxGlobalValue - minGlobalValue) - 1.0;
34177 }
34178}

◆ tripFourierCoefficients()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::tripFourierCoefficients ( MFloat modes,
MInt  noModes,
MFloat  maxWaveLength,
MFloat  minWaveLength 
)

Definition at line 34181 of file fvcartesiansolverxd.cpp.

34182 {
34183 const MFloat minWavenumber = 2 * PI / maxWaveLength;
34184 const MFloat maxWavenumber = 2 * PI / minWaveLength;
34185
34186 MFloat* ak = &modes[0];
34187 MFloat* phik = &modes[noModes];
34188 if(domainId() == 0) {
34189 for(MInt n = 0; n < noModes; n++) {
34190 ak[n] = (maxWavenumber - minWavenumber) * (rand() / MFloat(RAND_MAX)) + minWavenumber;
34191 phik[n] = 2 * PI * rand() / MFloat(RAND_MAX);
34192 }
34193 }
34194
34195 MPI_Bcast(&ak[0], noModes, MPI_DOUBLE, 0, mpiComm(), AT_, "ak[0]");
34196 MPI_Bcast(&phik[0], noModes, MPI_DOUBLE, 0, mpiComm(), AT_, "phik[0]");
34197}

◆ updateJet()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::updateJet
protectedvirtual

Definition at line 30394 of file fvcartesiansolverxd.cpp.

30394 {
30395 TRACE();
30396
30397 if(m_jet && !m_levelSet) {
30398 switch(m_jetType) {
30399 //---Single Jet------
30400 //-------------------
30401 case 19516: {
30402 IF_CONSTEXPR(nDim == 2) mTerm(-1, "This case is designed for 3D!");
30403
30404 const MInt noCells = a_noCells();
30405 MInt cellId; // nghbrId;
30406 // ------------------Single Jet Forcing-------------------------
30407 //--------------------------------------------------------------
30408 for(cellId = 0; cellId < noCells; cellId++) {
30409 MFloat jet, uy1 = 0, uy11 = 0, ur0 = 0, ur = 0, u = 0, w = 0, radius, angle, swtrad, swtxsgn, swtzsgn;
30410 MFloat dx, dy, dz, angle2;
30411
30412 dx = a_coordinate(cellId, 0);
30413 dy = a_coordinate(cellId, 1);
30414 dz = a_coordinate(cellId, 2);
30415 radius = sqrt(POW2(dy) + POW2(dz));
30416 if(fabs(radius) > 1.5 * m_jetHeight) continue;
30417
30418 swtrad = 0.5 * F1 * (radius - 0.01 + abs(radius - 0.01)) / (abs(radius - 0.01) + 1e-32);
30419 swtxsgn = 0.5 * F1 * (dy + abs(dy)) / (abs(dy) + 1e-32);
30420 swtzsgn = 0.5 * F1 * (dz + abs(dz)) / (abs(dz) + 1e-32);
30421 angle = abs(dy) / (radius + 1e-32) * swtrad;
30422 angle = acos(angle);
30423 angle = angle * swtxsgn * swtzsgn + (PI - angle) * (1 - swtxsgn) * swtzsgn
30424 + (PI + angle) * (1 - swtxsgn) * (1 - swtzsgn) - angle * swtxsgn * (1 - swtzsgn);
30425
30426 // Mean inflow velocity profile
30427 jet = m_Ma * F1B2
30428 * (1
30429 - tanh(m_shearLayerThickness * (((dx) - (m_jetHeight)) / (m_jetHeight))
30430 * (((dx) + (m_jetHeight)) / (m_jetHeight))))
30431 * swtrad;
30432 radius = radius + 0.0000000000000001;
30433 // Vortex ring velocities
30434 uy1 = 2 * 0.5 / radius * (radius - 0.5) / 0.01
30435 * exp(-log(2) * (POW2(dx - 0.49) + POW2(radius - 0.5)) / POW2(0.01)) * jet;
30436 ur0 = -2 * 0.5 / radius * (dx - 0.49) / 0.01
30437 * exp(-log(2) * (POW2(dx - 0.49) + POW2(radius - 0.5)) / POW2(0.01)) * jet;
30438
30439 // Angle 2 and definition of modes
30440 angle2 = atan2(dz, dy);
30441 MFloat az = 0;
30442 // Choose noOfModes=16 for Bogey&Bailly reference.
30443 // Choose forceCoefficient 0.007 for Bogey&Bailly reference.
30444
30445 for(MInt i = 0; i < m_modeNumbers; i++) {
30446 // a[i]= -1.0 + rand()/(RAND_MAX/(1.0- (-1.0)));
30447 // phi[i]= 2*PI*rand()/(RAND_MAX/(1.0- (-1.0)));
30448 // Fluctuated part of the vortex rind
30449 const MFloat a = -1.0 + (float)rand() / ((float)RAND_MAX / (1.0 - (-1.0)));
30450 const MFloat phi = 0.00 + (float)rand() / ((float)RAND_MAX / (2 * acos(-1) - 0.00));
30451
30452 az += a * cos(phi + i * angle2);
30453 }
30454 uy11 = (m_forceCoefficient * az * uy1);
30455 ur = (m_forceCoefficient * az * ur0);
30456 u = ur * cos(angle2);
30457 w = ur * sin(angle2);
30458 a_rightHandSide(cellId, CV->RHO_U) += (a_cellVolume(cellId) * m_rhoInfinity * uy11);
30459 a_rightHandSide(cellId, CV->RHO_V) += (a_cellVolume(cellId) * m_rhoInfinity * u);
30460 a_rightHandSide(cellId, CV->RHO_W) += (a_cellVolume(cellId) * m_rhoInfinity * w);
30461 // cout<<angle<< endl;
30462 }
30463 break;
30464 }
30465 //---Single Jet (updated version; TODO labels:FV,toremove remove/replace 19516)------
30466 case 19517:
30467 case 19518: {
30468 if(!m_jetForcing) {
30469 break;
30470 }
30471 // ------------------Single Jet Forcing-------------------------
30472 // Bogey&Bailly reference:
30473 // noOfModes=16; forceCoefficient=0.007
30474
30475 // Random number generation
30476 std::vector<MFloat> randAng{};
30477 randAng.resize(m_modeNumbers);
30478 std::vector<MFloat> randAmp{};
30479 randAmp.resize(m_modeNumbers);
30480
30481 // Initial seed for deterministic same random number generation on all ranks
30483 if(Context::propertyExists("RNGSeed") || Context::propertyExists("seedRNGWithTime"))
30484 mTerm(1, "Properties RNGSeed or seedRNGWithTime not compatible with jetForcing");
30485 srand(seed); // use initial seed
30486 for(MInt i = 0; i < 10; i++) {
30487 srand(rand()); // re-seed with first random number of previous seed to obtain a seed for the random engine
30488 // below which is not a linear function of the globalTimeStep anymore
30489 }
30490 const MInt randSeed = rand();
30491 // m_log << "DEBUG seed " << seed << " " << randSeed << std::endl;
30492
30493 // Update random engine each timestep
30494 std::default_random_engine gen(randSeed);
30495 std::uniform_real_distribution<MFloat> ampDist(-1., 1.);
30496 std::uniform_real_distribution<MFloat> angDist(0., 2 * PI);
30497
30498 // Accumulate random amplitudes and angles
30499 for(MInt i = 0; i < m_modeNumbers; i++) {
30500 randAmp[i] = ampDist(gen);
30501 randAng[i] = angDist(gen);
30502 }
30503
30504 const MFloat r0 = m_jetHeight;
30505 const MFloat x0 = m_jetForcingPosition;
30506 const MFloat deltaY = c_cellLengthAtLevel(maxLevel());
30507 const MInt noCells = a_noCells();
30508
30509 for(MInt cellId = 0; cellId < noCells; cellId++) {
30510 const MFloat dx = a_coordinate(cellId, 0);
30511 const MFloat dy = a_coordinate(cellId, 1);
30512 const MFloat dz = a_coordinate(cellId, 2);
30513 const MFloat radius = sqrt(POW2(dy) + POW2(dz));
30514
30515 // Mean inflow velocity
30516 const MFloat u0 = m_UInfinity;
30517
30518 // for tanh inflow profile velocity is basically zero out of this range
30519 if(fabs(radius) / r0 <= 1.5) {
30520 MFloat prefac = 2.0 * r0 / (radius * deltaY);
30521 prefac *= exp(-log(2.0) * (POW2(dx - x0) + POW2(radius - r0)) / POW2(deltaY)) * u0;
30522 const MFloat u_ring = prefac * (radius - r0);
30523 const MFloat v_ring = -1.0 * prefac * (dx - x0);
30524 const MFloat angle = atan2(dz, dy);
30525
30526 MFloat randFluct = 0.0;
30527 for(MInt i = 0; i < m_modeNumbers; i++) {
30528 randFluct += randAmp[i] * cos(randAng[i] + i * angle);
30529 }
30530 const MFloat u_ax = (m_forceCoefficient * randFluct * u_ring);
30531 const MFloat u_rad = (m_forceCoefficient * randFluct * v_ring);
30532 const MFloat v = u_rad * cos(angle);
30533 const MFloat w = u_rad * sin(angle);
30534
30535 if(m_jetType == 19517) {
30536 a_rightHandSide(cellId, CV->RHO_U) += (a_cellVolume(cellId) * m_rhoInfinity * u_ax);
30537 a_rightHandSide(cellId, CV->RHO_V) += (a_cellVolume(cellId) * m_rhoInfinity * v);
30538 a_rightHandSide(cellId, CV->RHO_W) += (a_cellVolume(cellId) * m_rhoInfinity * w);
30539 } else {
30540 const MFloat rho = a_variable(cellId, CV->RHO);
30541 // Apply perturbation directly to velocities (see Bogey); jet type 19517 is not useful if the correct
30542 // velocity profile from the paper is used; previously the jet profile was cut of a m_jetHeight which lead
30543 // to a steep velocity gradient in the shear layer in the simulations, thus the negligible influence of
30544 // the jet forcing was not relevant/detected
30545 a_variable(cellId, CV->RHO_U) += (rho * u_ax);
30546 a_variable(cellId, CV->RHO_V) += (rho * v);
30547 a_variable(cellId, CV->RHO_W) += (rho * w);
30548 }
30549 }
30550 }
30551 break;
30552 }
30553 case 1156: {
30554 //---Coaxial Jet------
30555 //-------------------
30556 IF_CONSTEXPR(nDim == 2) mTerm(-1, "This case is designed for 3D!");
30557
30558 const MInt noCells = a_noCells();
30559 MInt cellId; // nghbrId;
30560
30561 // ------------------Coaxial Jet Forcing-------------------------
30562 //--------------------------------------------------------------
30563 for(cellId = 0; cellId < noCells; cellId++) {
30564 MFloat jet, uy1 = 0, uy11 = 0, ur0 = 0, ur = 0, u = 0, w = 0, radius, radius2, angle, swtrad, swtxsgn,
30565 swtzsgn;
30566 MFloat dx, dy, dz, angle2;
30567
30568 dx = a_coordinate(cellId, 0);
30569 dy = a_coordinate(cellId, 1);
30570 dz = a_coordinate(cellId, 2);
30571 radius = sqrt(POW2(dy) + POW2(dz));
30572 swtrad = 0.5 * F1 * (radius - 0.01 + abs(radius - 0.01)) / (abs(radius - 0.01) + 1e-32);
30573 swtxsgn = 0.5 * F1 * (dy + abs(dy)) / (abs(dy) + 1e-32);
30574 swtzsgn = 0.5 * F1 * (dz + abs(dz)) / (abs(dz) + 1e-32);
30575 angle = abs(dy) / (radius + 1e-32) * swtrad;
30576 angle = acos(angle);
30577 angle = angle * swtxsgn * swtzsgn + (PI - angle) * (1 - swtxsgn) * swtzsgn
30578 + (PI + angle) * (1 - swtxsgn) * (1 - swtzsgn) - angle * swtxsgn * (1 - swtzsgn);
30579
30580 //-- Primary JET --
30581 if(radius <= m_primaryJetRadius) {
30582 jet = m_Ma * F1B2
30583 * (1
30584 - tanh(m_shearLayerThickness * (((dx) - (m_jetHeight)) / (m_jetHeight))
30585 * (((dx) + (m_jetHeight)) / (m_jetHeight))))
30586 * swtrad;
30587 radius = radius + 0.0000000000000001;
30588 // Vortex ring velocities
30589 uy1 = 2 * m_primaryJetRadius / radius * (radius - m_primaryJetRadius) / 0.01
30590 * exp(-log(2) * (POW2(dx - 0.49) + POW2(radius - m_primaryJetRadius)) / POW2(0.01)) * jet;
30591 ur0 = -2 * m_primaryJetRadius / radius * (dx - 0.49) / 0.01
30592 * exp(-log(2) * (POW2(dx - 0.49) + POW2(radius - m_primaryJetRadius)) / POW2(0.01)) * jet;
30593
30594 // Angle 2 and definition of modes
30595 angle2 = atan2(dz, dy);
30596 MFloat az = 0;
30597 MFloat* a = new MFloat[m_modeNumbers];
30598 MFloat* phi = new MFloat[m_modeNumbers];
30599 for(MInt i = 0; i < m_modeNumbers; i++) {
30600 a[i] = -1.0 + (float)rand() / ((float)RAND_MAX / (1.0 - (-1.0)));
30601 phi[i] = 0.00 + (float)rand() / ((float)RAND_MAX / (2 * acos(-1) - 0.00));
30602
30603 az += a[i] * cos(phi[i] + i * angle2);
30604 }
30605 uy11 = (m_forceCoefficient * az * uy1);
30606 ur = (m_forceCoefficient * az * ur0);
30607 u = ur * cos(angle2);
30608 w = ur * sin(angle2);
30609 }
30610 //-- Secondary JET --
30611 else if(radius <= m_secondaryJetRadius) {
30612 radius2 = radius - m_primaryJetRadius;
30613 jet = m_Ma * F1B2
30614 * (1
30615 - tanh(m_shearLayerThickness * (((dx) - (m_jetHeight)) / (m_jetHeight))
30616 * (((dx) + (m_jetHeight)) / (m_jetHeight))))
30617 * swtrad;
30618 radius2 = radius2 + 0.0000000000000001;
30619
30620 uy1 = 2 * m_secondaryJetRadius / radius * (radius - m_secondaryJetRadius) / 0.01
30621 * exp(-log(2) * (POW2(dx - 0.49) + POW2(radius - m_secondaryJetRadius)) / POW2(0.01)) * jet;
30622 ur0 = -2 * m_secondaryJetRadius / radius * (dx - 0.49) / 0.01
30623 * exp(-log(2) * (POW2(dx - 0.49) + POW2(radius - m_secondaryJetRadius)) / POW2(0.01)) * jet;
30624
30625 // Angle 2 and definition of modes
30626 angle2 = atan2(dz, dy);
30627 MFloat az = 0;
30628 MFloat a[16];
30629 MFloat phi[16];
30630 for(MInt i = 0; i < 16; i++) {
30631 a[i] = -1.0 + (float)rand() / ((float)RAND_MAX / (1.0 - (-1.0)));
30632 phi[i] = 0.00 + (float)rand() / ((float)RAND_MAX / (2 * acos(-1) - 0.00));
30633 // To get better acoustic results first 4 modes are ommited for the secondary jet!!
30634 a[0] = 0;
30635 a[1] = 0;
30636 a[2] = 0;
30637 a[3] = 0;
30638 phi[0] = 0;
30639 phi[1] = 0;
30640 phi[2] = 0;
30641 phi[3] = 0;
30642 az += a[i] * cos(phi[i] + (i)*angle2);
30643 }
30644 uy11 = (m_forceCoefficient * az * uy1);
30645 ur = (m_forceCoefficient * az * ur0);
30646 u = ur * cos(angle2);
30647 w = ur * sin(angle2);
30648 }
30649 a_rightHandSide(cellId, CV->RHO_U) += (a_cellVolume(cellId) * m_rhoInfinity * uy11);
30650 a_rightHandSide(cellId, CV->RHO_V) += (a_cellVolume(cellId) * m_rhoInfinity * u);
30651 a_rightHandSide(cellId, CV->RHO_W) += (a_cellVolume(cellId) * m_rhoInfinity * w);
30652 }
30653 break;
30654 }
30655 // Dummy jetType, s.th. jet-BC can be used also with inletTurbulence and without the updateJet()-forcing
30656 case -1:
30657 break;
30658
30659 default: {
30660 stringstream errorMessage;
30661 errorMessage << "FvCartesianSolverXD::updateJet() switch variable 'm_jetType' with value " << m_jetType
30662 << " not matching any case." << endl;
30663 mTerm(1, AT_, errorMessage.str());
30664 }
30665 }
30666 }
30667}

◆ updateMaterialNo()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::updateMaterialNo ( )
inlinevirtual

Definition at line 1338 of file fvcartesiansolverxd.h.

1338{};

◆ updateMultiSolverInformation()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::updateMultiSolverInformation ( MBool  fullReset = false)
virtual
Author
Lennart Schneiders

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 23135 of file fvcartesiansolverxd.cpp.

23135 {
23136 if(noNeighborDomains() == 0) {
23137 if(noDomains() > 1) {
23138 mTerm(1, "Unexpected situation in updateMultiSolverInformation!");
23139 }
23140 return;
23141 }
23142
23143
23144 if(fullReset) {
23148 mAlloc(m_fvBndryCnd->m_nearBoundaryWindowCells, noNeighborDomains(), "m_nearBoundaryWindowCells", AT_);
23149 mAlloc(m_fvBndryCnd->m_nearBoundaryHaloCells, noNeighborDomains(), "m_nearBoundaryHaloCells", AT_);
23150 }
23152 mAlloc(m_mpi_request, noNeighborDomains(), "m_mpi_request", AT_);
23153 if(m_nonBlockingComm) {
23156 mAlloc(m_mpi_receiveRequest, noNeighborDomains(), "m_mpi_receiveRequest ", MPI_REQ_NULL, AT_);
23157 mAlloc(m_mpi_sendRequest, noNeighborDomains(), "m_mpi_sendRequest", MPI_REQ_NULL, AT_);
23158 }
23159 }
23160
23161
23162 ScratchSpace<MInt> haloCellsCnt(noNeighborDomains(), AT_, "noHaloCells");
23163 ScratchSpace<MInt> windowCellsCnt(noNeighborDomains(), AT_, "noWindowCells");
23164 for(MInt d = 0; d < noNeighborDomains(); d++) {
23165 haloCellsCnt[d] = noHaloCells(d);
23166 windowCellsCnt[d] = noWindowCells(d);
23167 }
23172 mAlloc(m_maxLevelHaloCells, noNeighborDomains(), &haloCellsCnt[0], "m_maxLevelHaloCells", AT_);
23173 mAlloc(m_maxLevelWindowCells, noNeighborDomains(), &windowCellsCnt[0], "m_maxLevelWindowCells", AT_);
23174 mAlloc(m_noMaxLevelHaloCells, noNeighborDomains(), "m_noMaxLevelHaloCells", 0, AT_);
23175 mAlloc(m_noMaxLevelWindowCells, noNeighborDomains(), "m_noMaxLevelWindowCells", 0, AT_);
23176
23179 mAlloc(m_sendBuffers, noNeighborDomains(), &windowCellsCnt[0], m_dataBlockSize, "m_sendBuffers", AT_);
23180 mAlloc(m_receiveBuffers, noNeighborDomains(), &haloCellsCnt[0], m_dataBlockSize, "m_receiveBuffers", AT_);
23181
23182 if(m_nonBlockingComm) {
23185 mAlloc(m_sendBuffersNoBlocking, noNeighborDomains(), &windowCellsCnt[0], m_dataBlockSize, "m_sendBuffersNoBlocking",
23186 AT_);
23188 "m_receiveBuffersNoBlocking", AT_);
23189 for(MInt i = 0; i < noNeighborDomains(); i++) {
23190 m_mpi_receiveRequest[i] = MPI_REQUEST_NULL;
23191 m_mpi_sendRequest[i] = MPI_REQUEST_NULL;
23192 }
23193 }
23194}

◆ updateSplitParentVariables()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::updateSplitParentVariables ( )
inlinevirtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 1336 of file fvcartesiansolverxd.h.

1336{/*only do something if we are using MB*/};

◆ updateSpongeLayer()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::updateSpongeLayer
virtual

\cartesiansolver Sponge

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 14449 of file fvcartesiansolverxd.cpp.

14449 {
14450 TRACE();
14451 // TODO labels:FV compute sponge factor (linear, tanh)
14452 if(m_spongeLayerThickness > F0) {
14453 std::array<MFloat, 6> values{}; // order is: rho1, p1, rho2, p2, rho3, p3; default are rhoInf and pInf
14454 values = computeTargetValues();
14455
14456 for(MInt c = 0; c < m_noCellsInsideSpongeLayer; c++) {
14458 // update rhs RHO_E, RHO, RHO_V, RHO_U, RHO_W, RHO_Y (NOTE: RHO_Y is not computed by computeSpongeDeltas):
14459 updateSpongeLayerRhs(cellId, computeSpongeDeltas(cellId, values));
14460 }
14461 }
14462}
std::array< MFloat, nDim_+2 > computeSpongeDeltas(MInt cellId, std::array< MFloat, 6 >)
std::array< MFloat, 6 > computeTargetValues()
void updateSpongeLayerRhs(MInt, std::array< MFloat, nDim_+2 >)

◆ updateSpongeLayerRhs()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::updateSpongeLayerRhs ( MInt  cellId,
std::array< MFloat, nDim_+2 >  dPV 
)

Definition at line 16162 of file fvcartesiansolverxd.cpp.

16162 {
16163 TRACE();
16164
16165 // update rhs RHO_E, RHO, RHO_V, RHO_U, RHO_W, RHO_Y
16166 IF_CONSTEXPR(hasE<SysEqn>)
16167 a_rightHandSide(cellId, CV->RHO_E) += a_spongeFactor(cellId) * dPV[PV->P] * a_cellVolume(cellId);
16168 a_rightHandSide(cellId, CV->RHO) += a_spongeFactor(cellId) * dPV[PV->RHO] * a_cellVolume(cellId);
16169 for(MInt d = 0; d < nDim; ++d) {
16170 a_rightHandSide(cellId, CV->RHO_VV[d]) += a_spongeFactor(cellId) * dPV[PV->VV[d]] * a_cellVolume(cellId);
16171 }
16172
16173 // IF_CONSTEXPR(SysEqn::m_noRansEquations > 0){
16174 // for(MInt r = 0; r < m_noRansEquations; ++r) {
16175 // a_rightHandSide(cellId, CV->RHO_NN[r]) +=
16176 // a_spongeFactor(cellId)*dPV[PV->RHO]*a_cellVolume(cellId);
16177 // }
16178 // }
16179
16180 // species
16181 for(MInt s = 0; s < m_noSpecies; s++) {
16182 a_rightHandSide(cellId, CV->RHO_Y[s]) +=
16183 a_spongeFactor(cellId) * dPV[PV->RHO] * a_cellVolume(cellId) * a_pvariable(cellId, PV->Y[s]);
16184 }
16185}

◆ useTimeStepFromRestartFile()

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::useTimeStepFromRestartFile
protected

Should the time step from the restart file be used?

Definition at line 9729 of file fvcartesiansolverxd.cpp.

9729 {
9731 return true;
9732 } else if(m_restart && Context::propertyExists("consistentRestart", m_solverId)
9733 && Context::getSolverProperty<MBool>("consistentRestart", m_solverId, AT_)) {
9734 return true;
9735 }
9736
9737 return false;
9738}

◆ viscousFlux()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::viscousFlux
virtual

Definition at line 19334 of file fvcartesiansolverxd.cpp.

19334 {
19335 TRACE();
19337 viscousFlux_<FIVE_POINT>(sysEqn());
19339 viscousFluxCompact_<THREE_POINT>(sysEqn());
19341 viscousFluxCompact_<FIVE_POINT_STABILIZED>(sysEqn());
19342 }
19343 IF_CONSTEXPR(isEEGas<SysEqn>) {
19344 if(m_EEGas.bubblePathDispersion) bubblePathDispersion();
19345 }
19346}
@ FIVE_POINT_STABILIZED
Definition: enums.h:184
@ FIVE_POINT
Definition: enums.h:184
@ THREE_POINT
Definition: enums.h:184

◆ viscousFlux_()

template<MInt nDim_, class SysEqn >
template<MInt stencil, class F >
void FvCartesianSolverXD< nDim_, SysEqn >::viscousFlux_ ( F &  viscousFluxFct)

TODO labels:FV,toenhance we should switch to a 3-point stencil in the future (the 5-point stencil is unstable).

NOTE: this is an inner-most loop of MAIA (20% of the computation time is spent here) Don't modify it unless you REALLY know what you are doing.

Turned into template function for usage with function pointers, Lennart

Author
: Daniel Hartmann, November 16, 2006

Definition at line 19362 of file fvcartesiansolverxd.cpp.

19362 {
19363 // TRACE();
19364 const MUint noPVars = PV->noVariables;
19365 const MUint noFluxVars = FV->noVariables;
19366 const MUint noSurfaceCoefficients = hasSC ? SC->m_noSurfaceCoefficients : 0;
19367 const MUint surfaceVarMemory = 2 * noPVars;
19368 const MUint noSlopes = nDim * noPVars;
19369 const MUint noSurfaces = a_noSurfaces();
19370
19371#ifdef FV_FREE_SURFACE_BC // See TODO labels:FV below
19372 const MInt* const bndryCndIds RESTRICT = ALIGNED_I(&a_surfaceBndryCndId(0));
19373#endif
19374 const MInt* const RESTRICT orientations = ALIGNED_I(&a_surfaceOrientation(0));
19375 const MInt* const RESTRICT nghbrCellIds = ALIGNED_I(&a_surfaceNghbrCellId(0, 0));
19376 const MFloat* const RESTRICT surfaceVars = ALIGNED_F(&a_surfaceVariable(0, 0, 0));
19377 const MFloat* const RESTRICT surfaceCoefficients = hasSC ? ALIGNED_F(&a_surfaceCoefficient(0, 0)) : nullptr;
19378 const MFloat* const RESTRICT factor = ALIGNED_F(&a_surfaceFactor(0, 0));
19379 const MFloat* const RESTRICT slope = ALIGNED_F(&a_slope(0, 0, 0));
19380 const MFloat* const RESTRICT area = ALIGNED_F(&a_surfaceArea(0));
19381 MFloat* const RESTRICT fluxes = ALIGNED_MF(&a_surfaceFlux(0, 0));
19382
19383#ifdef _OPENMP
19384#pragma omp parallel for
19385#endif
19386 for(MUint srfcId = 0; srfcId < noSurfaces; srfcId++) {
19387 // TODO labels:FV,totest is this really necessary / is this the right place to do this??
19388#ifdef FV_FREE_SURFACE_BC
19389 // correct all free surface viscous boundaries flux to zero, Christoph Siewert
19390 if((MInt)srfcId > m_bndrySurfacesOffset) {
19391 if(bndryCndId[srfcId] == 5000) {
19392 continue;
19393 }
19394 }
19395#endif
19396
19397 const MUint offset = srfcId * surfaceVarMemory;
19398 const MFloat* const RESTRICT vars0 = ALIGNED_F(surfaceVars + offset);
19399 const MFloat* const RESTRICT vars1 = ALIGNED_F(vars0 + noPVars);
19400
19401 const MUint orientation = orientations[srfcId];
19402 const MFloat A = area[srfcId];
19403
19404 const MFloat f0 = factor[srfcId * 2];
19405 const MFloat f1 = factor[srfcId * 2 + 1];
19406 const MUint offset0 = nghbrCellIds[2 * srfcId] * noSlopes;
19407 const MUint offset1 = nghbrCellIds[2 * srfcId + 1] * noSlopes;
19408 const MFloat* const RESTRICT slope0 = ALIGNED_F(slope + offset0);
19409 const MFloat* const RESTRICT slope1 = ALIGNED_F(slope + offset1);
19410
19411 const MUint coefficientOffset = srfcId * noSurfaceCoefficients;
19412 const MFloat* const RESTRICT srfcCoeff = hasSC ? ALIGNED_F(surfaceCoefficients + coefficientOffset) : nullptr;
19413
19414 const MUint fluxOffset = srfcId * noFluxVars;
19415 MFloat* const RESTRICT flux = ALIGNED_MF(fluxes + fluxOffset);
19416
19417 viscousFluxFct.template viscousFlux<stencil>(orientation, A, vars0, vars1, slope0, slope1, srfcCoeff, f0, f1, flux);
19418 }
19419
19420
19421 // correct viscous fluxes on WMLES bndry surfaces
19422 // \author Thomas Luerkens
19423 if(m_wmLES) {
19424 RECORD_TIMER_START(m_timers[Timers::WMSurfaceLoop]);
19425 const MInt noWMSurfaces = m_wmSurfaces.size();
19426#ifdef _OPENMP
19427#pragma omp parallel for
19428#endif
19429 for(MInt wmSrfcId = 0; wmSrfcId < noWMSurfaces; wmSrfcId++) {
19430 const MFloat mue_wm = computeWMViscositySpalding(wmSrfcId);
19431 const MInt bndryCellId = m_wmSurfaces[wmSrfcId].m_bndryCellId;
19432 const MInt bndrySrfcId = m_wmSurfaces[wmSrfcId].m_bndrySrfcId;
19433
19434 for(MInt dim = 0; dim < nDim; dim++) {
19435 const MInt srfcId = m_bndryCells->a[bndryCellId].m_srfcVariables[bndrySrfcId]->m_srfcId[dim];
19436
19437 if(srfcId < 0) continue;
19438
19439 const MUint offset = srfcId * surfaceVarMemory;
19440 const MFloat* const RESTRICT vars0 = ALIGNED_F(surfaceVars + offset);
19441 const MFloat* const RESTRICT vars1 = ALIGNED_F(vars0 + noPVars);
19442
19443 const MUint orientation = orientations[srfcId];
19444 const MFloat A = area[srfcId];
19445
19446 const MFloat f0 = factor[srfcId * 2];
19447 const MFloat f1 = factor[srfcId * 2 + 1];
19448 const MUint offset0 = nghbrCellIds[2 * srfcId] * noSlopes;
19449 const MUint offset1 = nghbrCellIds[2 * srfcId + 1] * noSlopes;
19450 const MFloat* const RESTRICT slope0 = ALIGNED_F(slope + offset0);
19451 const MFloat* const RESTRICT slope1 = ALIGNED_F(slope + offset1);
19452
19453 const MUint fluxOffset = srfcId * noPVars;
19454 MFloat* const RESTRICT flux = ALIGNED_MF(fluxes + fluxOffset);
19455
19456 RECORD_TIMER_START(m_timers[Timers::WMFluxCorrection]);
19457 viscousFluxFct.template wmViscousFluxCorrection<stencil>(orientation, A, vars0, vars1, slope0, slope1, f0, f1,
19458 flux, mue_wm);
19459 RECORD_TIMER_STOP(m_timers[Timers::WMFluxCorrection]);
19460 }
19461 }
19462 RECORD_TIMER_STOP(m_timers[Timers::WMSurfaceLoop]);
19463 }
19464}
MFloat computeWMViscositySpalding(MInt)

◆ viscousFlux_Gequ_Pv()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::viscousFlux_Gequ_Pv
inlineprotectedvirtual
Authors
Daniel Hartmann, Stephan Schlimpert
Date
November 16, 2006, November 2011

last change: using muInfinity gives solution independent from rhoInfinity, which could changes for DL instability computations (TInfinity is kept constant)

Definition at line 32923 of file fvcartesiansolverxd.cpp.

32923 {
32924 IF_CONSTEXPR(nDim == 3) mTerm(1, "Not available in 3D.");
32925 TRACE();
32927 viscousFlux();
32928 return;
32929 }
32930 constexpr MInt index0[2] = {1, 0};
32931 const MInt noPVars = PV->noVariables;
32932 const MInt noData = m_surfaceVarMemory;
32933 const MInt noSurfaces = a_noSurfaces();
32934 const MInt slopeMemory = m_slopeMemory;
32935 const MFloat gammaMinusOne = m_gamma - 1.0;
32936 const MFloat FgammaMinusOne = F1 / gammaMinusOne;
32937 const MFloat gFGMO = m_gamma * FgammaMinusOne;
32938 MInt* nghbrs = (MInt*)(&(a_surfaceNghbrCellId(0, 0)));
32939 MFloatScratchSpace tau(nDim, AT_, "tau");
32940 MFloat* area = &a_surfaceArea(0);
32941 MFloat* slope = (MFloat*)(&(a_slope(0, 0, 0)));
32942 MFloat* var = (MFloat*)(&(a_surfaceVariable(0, 0, 0)));
32943 // --- end of initialization
32944
32945 // assuming m_TInfinity is the temperature of the unburnt gas
32946 // Dth = mue^u / ( rho^u *Pr ) = const, rhoU = m_rhoInfinity (density of the unburnt gas)
32947
32948 // changed: because gives solution independent from rhoInfinity which is useful if rhoInfinity is
32949 // changing at a thermal inlet boundary condition
32950 const MFloat rhoUDth = sysEqn().m_muInfinity * m_rPr; // = m_DthInfinity * m_rhoInfinity;
32951
32952 for(MInt srfcId = 0; srfcId < noSurfaces; srfcId++) {
32953 // calculate the primitve variables on the surface u,v,rho,p
32954 // LR
32955 const MInt i = srfcId * noData;
32956 const MFloat u = F1B2 * (var[i] + var[i + noPVars]);
32957 const MFloat v = F1B2 * (var[i + 1] + var[i + noPVars + 1]);
32958 const MFloat rho = F1B2 * (var[i + 2] + var[i + noPVars + 2]);
32959 const MFloat Frho = F1 / rho;
32960 const MFloat p = F1B2 * (var[i + 3] + var[i + noPVars + 3]);
32961
32962 // compute the temperature on the surface p = rho * T * 1.0/gamma
32963 const MFloat T = sysEqn().temperature_ES(rho, p);
32964
32965 // indices for the orientation
32966 const MInt id0 = a_surfaceOrientation(srfcId);
32967 const MInt id1 = index0[id0];
32968
32969 // Compute A / Re0
32970 const MFloat dAOverRe0 = area[srfcId] * m_rRe0;
32971
32972 // calculate the viscosity with the sutherland law mue = T^3/2 * (1+S/T_0)(T + S/T_0)
32973 const MFloat mue = SUTHERLANDLAW(T);
32974 // calculate the thermal conductivity
32975 const MFloat lambda = m_rPr * mue;
32976
32977 // calculate the heat flux (T_x = gamma*(p_x/rho - p/rho^2 * rho_x))
32978 const MFloat q =
32979 lambda * gFGMO * Frho
32980 * ((a_surfaceFactor(srfcId, 0) * slope[nghbrs[2 * srfcId] * slopeMemory + PV->P * nDim + id0]
32981 + a_surfaceFactor(srfcId, 1) * slope[nghbrs[2 * srfcId + 1] * slopeMemory + PV->P * nDim + id0])
32982 - p * Frho
32983 * (a_surfaceFactor(srfcId, 0) * slope[nghbrs[2 * srfcId] * slopeMemory + PV->RHO * nDim + id0]
32984 + a_surfaceFactor(srfcId, 1) * slope[nghbrs[2 * srfcId + 1] * slopeMemory + PV->RHO * nDim + id0]));
32985
32986 //------------------------------------------------------------------------
32987 // tau_ij:
32988 // (matrix entries
32989 // stored in tau[ ? ]: id0,id1,id2
32990 //
32991 // { 0 1 2 } 0 1 2 -> u*tau[0]+v*tau[1]+w*tau[3]
32992 // { 0 1 2 } 1 2 0 -> u*tau[0]+v*tau[1]+w*tau[2]
32993 // { 0 1 2 } 2 0 1 -> u*tau[0]+v*tau[1]+w*tau[2]
32994
32996 if(a_surfaceCoordinate(srfcId, 1) < 0.0341) {
32997 tau.p[id0] =
32998 mue
32999 * (a_surfaceFactor(srfcId, 0) * (F2 * slope[nghbrs[2 * srfcId] * slopeMemory + id0 * nDim + id0])
33000 + a_surfaceFactor(srfcId, 1) * (F2 * slope[nghbrs[2 * srfcId + 1] * slopeMemory + id0 * nDim + id0]));
33001
33002 tau.p[id1] = mue
33003 * (a_surfaceFactor(srfcId, 0)
33004 * (slope[nghbrs[2 * srfcId] * slopeMemory + id0 * nDim + id1]
33005 + slope[nghbrs[2 * srfcId] * slopeMemory + id1 * nDim + id0])
33006 + a_surfaceFactor(srfcId, 1)
33007 * (slope[nghbrs[2 * srfcId + 1] * slopeMemory + id0 * nDim + id1]
33008 + slope[nghbrs[2 * srfcId + 1] * slopeMemory + id1 * nDim + id0]));
33009
33010 } else {
33011 // Compute the stress terms
33012 tau.p[id0] = mue
33013 * (a_surfaceFactor(srfcId, 0)
33014 * (F4B3 * slope[nghbrs[2 * srfcId] * slopeMemory + id0 * nDim + id0]
33015 - F2B3 * (slope[nghbrs[2 * srfcId] * slopeMemory + id1 * nDim + id1]))
33016 + a_surfaceFactor(srfcId, 1)
33017 * (F4B3 * slope[nghbrs[2 * srfcId + 1] * slopeMemory + id0 * nDim + id0]
33018 - F2B3 * (slope[nghbrs[2 * srfcId + 1] * slopeMemory + id1 * nDim + id1])));
33019
33020 tau.p[id1] = mue
33021 * (a_surfaceFactor(srfcId, 0)
33022 * (slope[nghbrs[2 * srfcId] * slopeMemory + id0 * nDim + id1]
33023 + slope[nghbrs[2 * srfcId] * slopeMemory + id1 * nDim + id0])
33024 + a_surfaceFactor(srfcId, 1)
33025 * (slope[nghbrs[2 * srfcId + 1] * slopeMemory + id0 * nDim + id1]
33026 + slope[nghbrs[2 * srfcId + 1] * slopeMemory + id1 * nDim + id0]));
33027 }
33028 } else {
33029 // Compute the stress terms
33030 tau.p[id0] = mue
33031 * (a_surfaceFactor(srfcId, 0)
33032 * (F4B3 * slope[nghbrs[2 * srfcId] * slopeMemory + id0 * nDim + id0]
33033 - F2B3 * (slope[nghbrs[2 * srfcId] * slopeMemory + id1 * nDim + id1]))
33034 + a_surfaceFactor(srfcId, 1)
33035 * (F4B3 * slope[nghbrs[2 * srfcId + 1] * slopeMemory + id0 * nDim + id0]
33036 - F2B3 * (slope[nghbrs[2 * srfcId + 1] * slopeMemory + id1 * nDim + id1])));
33037
33038 tau.p[id1] = mue
33039 * (a_surfaceFactor(srfcId, 0)
33040 * (slope[nghbrs[2 * srfcId] * slopeMemory + id0 * nDim + id1]
33041 + slope[nghbrs[2 * srfcId] * slopeMemory + id1 * nDim + id0])
33042 + a_surfaceFactor(srfcId, 1)
33043 * (slope[nghbrs[2 * srfcId + 1] * slopeMemory + id0 * nDim + id1]
33044 + slope[nghbrs[2 * srfcId + 1] * slopeMemory + id1 * nDim + id0]));
33045 }
33046 /*
33047 if( !(dAOverRe0 <=0) && !(dAOverRe0 >=0) ) {
33048 cerr << "dAOverRe0" << dAOverRe0 << endl;
33049 saveSolverSolution(1);
33050 mTerm(1, AT_);
33051 }
33052 */
33053
33054 // Compute the fluxes
33055 a_surfaceFlux(srfcId, FV->RHO_U) -= dAOverRe0 * tau.p[0];
33056 a_surfaceFlux(srfcId, FV->RHO_V) -= dAOverRe0 * tau.p[1];
33057 IF_CONSTEXPR(hasE<SysEqn>)
33058 a_surfaceFlux(srfcId, FV->RHO_E) -= dAOverRe0 * (u * tau.p[0] + v * tau.p[1] + q);
33059
33060 // progress variable
33061 IF_CONSTEXPR(hasPV_C<SysEqn>::value)
33062 a_surfaceFlux(srfcId, FV->RHO_C) -=
33063 dAOverRe0 * rhoUDth
33064 * (a_surfaceFactor(srfcId, 0) * slope[nghbrs[2 * srfcId] * slopeMemory + PV->C * nDim + id0]
33065 + a_surfaceFactor(srfcId, 1) * slope[nghbrs[2 * srfcId + 1] * slopeMemory + PV->C * nDim + id0]);
33066 }
33067}

◆ viscousFlux_Gequ_Pv_Plenum()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::viscousFlux_Gequ_Pv_Plenum
inlineprotectedvirtual
Author
Stephan Schlimpert
Date
Februar, 2011

Definition at line 33076 of file fvcartesiansolverxd.cpp.

33076 {
33077 IF_CONSTEXPR(nDim == 3) mTerm(1, "Not available in 3D.");
33078 TRACE();
33079
33080 MInt id0, id1, i;
33081 MInt index0[2] = {1, 0};
33082 const MInt noPVars = PV->noVariables;
33083 const MInt noData = m_surfaceVarMemory;
33084 const MInt noSurfaces = a_noSurfaces();
33085 const MInt slopeMemory = m_slopeMemory;
33086 MFloat T, u, v;
33087 MFloat q, mue, lambda;
33088 MFloat dAOverRe0;
33089 const MFloat gammaMinusOne = m_gamma - 1.0;
33090 const MFloat FgammaMinusOne = F1 / gammaMinusOne;
33091 const MFloat gFGMO = m_gamma * FgammaMinusOne;
33092 MFloat Frho, rho, p;
33093 MFloat rhoUDth;
33094 MInt* nghbrs = (MInt*)(&(a_surfaceNghbrCellId(0, 0)));
33095 MFloatScratchSpace tau(nDim, AT_, "tau");
33096 MFloat* area = &a_surfaceArea(0);
33097 MFloat* slope = (MFloat*)(&(a_slope(0, 0, 0)));
33098 MFloat* var = (MFloat*)(&(a_surfaceVariable(0, 0, 0)));
33099 // --- end of initialization
33100
33101 // assuming m_TInfinity is the temperature of the unburnt gas
33102 // Dth = mue^u / ( rho^u *Pr ) = const, rhoU = m_rhoInfinity (density of the unburnt gas)
33103 rhoUDth = m_DthInfinity * m_rhoFlameTube;
33104
33105 for(MInt srfcId = 0; srfcId < noSurfaces; srfcId++) {
33106 // calculate the primitve variables on the surface u,v,rho,p
33107 // LR
33108 i = srfcId * noData;
33109 u = F1B2 * (var[i] + var[i + noPVars]);
33110 v = F1B2 * (var[i + 1] + var[i + noPVars + 1]);
33111 rho = F1B2 * (var[i + 2] + var[i + noPVars + 2]);
33112 Frho = F1 / rho;
33113 p = F1B2 * (var[i + 3] + var[i + noPVars + 3]);
33114
33115 // compute the temperature on the surface p = rho * T * 1.0/gamma
33116 T = sysEqn().temperature_ES(rho, p);
33117
33118 // indices for the orientation
33119 id0 = a_surfaceOrientation(srfcId);
33120 id1 = index0[id0];
33121
33122 // Compute A / Re0
33123 dAOverRe0 = area[srfcId] * m_rRe0;
33124
33125 // calculate the viscosity with the sutherland law mue = T^3/2 * (1+S/T_0)(T + S/T_0)
33126 mue = SUTHERLANDLAW(T);
33127 // calculate the thermal conductivity
33128 lambda = m_rPr * mue;
33129
33130 // calculate the heat flux (T_x = gamma*(p_x/rho - p/rho^2 * rho_x))
33131 q = lambda * gFGMO * Frho
33132 * ((a_surfaceFactor(srfcId, 0) * slope[nghbrs[2 * srfcId] * slopeMemory + PV->P * nDim + id0]
33133 + a_surfaceFactor(srfcId, 1) * slope[nghbrs[2 * srfcId + 1] * slopeMemory + PV->P * nDim + id0])
33134 - p * Frho
33135 * (a_surfaceFactor(srfcId, 0) * slope[nghbrs[2 * srfcId] * slopeMemory + PV->RHO * nDim + id0]
33136 + a_surfaceFactor(srfcId, 1) * slope[nghbrs[2 * srfcId + 1] * slopeMemory + PV->RHO * nDim + id0]));
33137
33138 //------------------------------------------------------------------------
33139 // tau_ij:
33140 // (matrix entries
33141 // stored in tau[ ? ]: id0,id1,id2
33142 //
33143 // { 0 1 2 } 0 1 2 -> u*tau[0]+v*tau[1]+w*tau[3]
33144 // { 0 1 2 } 1 2 0 -> u*tau[0]+v*tau[1]+w*tau[2]
33145 // { 0 1 2 } 2 0 1 -> u*tau[0]+v*tau[1]+w*tau[2]
33146
33147 // Compute the stress terms
33148 tau.p[id0] = mue
33149 * (a_surfaceFactor(srfcId, 0)
33150 * (F4B3 * slope[nghbrs[2 * srfcId] * slopeMemory + id0 * nDim + id0]
33151 - F2B3 * (slope[nghbrs[2 * srfcId] * slopeMemory + id1 * nDim + id1]))
33152 + a_surfaceFactor(srfcId, 1)
33153 * (F4B3 * slope[nghbrs[2 * srfcId + 1] * slopeMemory + id0 * nDim + id0]
33154 - F2B3 * (slope[nghbrs[2 * srfcId + 1] * slopeMemory + id1 * nDim + id1])));
33155
33156 tau.p[id1] = mue
33157 * (a_surfaceFactor(srfcId, 0)
33158 * (slope[nghbrs[2 * srfcId] * slopeMemory + id0 * nDim + id1]
33159 + slope[nghbrs[2 * srfcId] * slopeMemory + id1 * nDim + id0])
33160 + a_surfaceFactor(srfcId, 1)
33161 * (slope[nghbrs[2 * srfcId + 1] * slopeMemory + id0 * nDim + id1]
33162 + slope[nghbrs[2 * srfcId + 1] * slopeMemory + id1 * nDim + id0]));
33163
33164 // Compute the fluxes
33165 a_surfaceFlux(srfcId, FV->RHO_U) -= dAOverRe0 * tau.p[0];
33166 a_surfaceFlux(srfcId, FV->RHO_V) -= dAOverRe0 * tau.p[1];
33167 IF_CONSTEXPR(hasE<SysEqn>)
33168 a_surfaceFlux(srfcId, FV->RHO_E) -= dAOverRe0 * (u * tau.p[0] + v * tau.p[1] + q);
33169
33170 // progress variable
33171 IF_CONSTEXPR(hasPV_C<SysEqn>::value)
33172 a_surfaceFlux(srfcId, FV->RHO_C) -=
33173 dAOverRe0 * rhoUDth
33174 * (a_surfaceFactor(srfcId, 0) * slope[nghbrs[2 * srfcId] * slopeMemory + PV->C * nDim + id0]
33175 + a_surfaceFactor(srfcId, 1) * slope[nghbrs[2 * srfcId + 1] * slopeMemory + PV->C * nDim + id0]);
33176 }
33177}

◆ viscousFluxCompact_()

template<MInt nDim_, class SysEqn >
template<MInt stencil, class F >
void FvCartesianSolverXD< nDim_, SysEqn >::viscousFluxCompact_ ( F &  viscousFluxFct)
Author
Lennart Schneiders

Definition at line 19476 of file fvcartesiansolverxd.cpp.

19476 {
19477 const MUint noPVars = PV->noVariables;
19478 const MUint noFluxVars = FV->noVariables;
19479 const MUint surfaceVarMemory = 2 * noPVars;
19480 const MUint noSlopes = nDim * noPVars;
19481 const MUint noSurfaces = a_noSurfaces();
19482
19483 const MInt* const RESTRICT orientations = ALIGNED_I(&a_surfaceOrientation(0));
19484 const MInt* const RESTRICT nghbrCellIds = ALIGNED_I(&a_surfaceNghbrCellId(0, 0));
19485 const MFloat* const RESTRICT surfaceVars = ALIGNED_F(&a_surfaceVariable(0, 0, 0));
19486 const MFloat* const RESTRICT scoords = ALIGNED_F(&a_surfaceCoordinate(0, 0));
19487 const MFloat* const RESTRICT factor = ALIGNED_F(&a_surfaceFactor(0, 0));
19488 const MFloat* const RESTRICT slope = ALIGNED_F(&a_slope(0, 0, 0));
19489 const MFloat* const RESTRICT ccoords = ALIGNED_F(&a_coordinate(0, 0));
19490 const MFloat* const RESTRICT area = ALIGNED_F(&a_surfaceArea(0));
19491 const MFloat* const RESTRICT cellvars = ALIGNED_F(&a_pvariable(0, 0));
19492 MFloat* const RESTRICT fluxes = ALIGNED_MF(&a_surfaceFlux(0, 0));
19493
19494#ifdef _OPENMP
19495#pragma omp parallel for
19496#endif
19497 for(MUint srfcId = 0; srfcId < noSurfaces; srfcId++) {
19498 const MUint offset = srfcId * surfaceVarMemory;
19499 const MFloat* const RESTRICT vars0 = ALIGNED_F(surfaceVars + offset);
19500 const MFloat* const RESTRICT vars1 = ALIGNED_F(vars0 + noPVars);
19501
19502 const MFloat f0 = factor[srfcId * 2];
19503 const MFloat f1 = factor[srfcId * 2 + 1];
19504
19505 const MUint orientation = orientations[srfcId];
19506 const MFloat A = area[srfcId];
19507
19508 const MBool isBndry = a_surfaceBndryCndId(srfcId) > -1;
19509
19510 const MUint offsetSurfaceCoord = nDim * srfcId;
19511 const MFloat* const RESTRICT surfaceCoord = ALIGNED_F(scoords + offsetSurfaceCoord);
19512
19513 const MUint off0 = nghbrCellIds[2 * srfcId] * nDim;
19514 const MUint off1 = nghbrCellIds[2 * srfcId + 1] * nDim;
19515 const MFloat* const RESTRICT coord0 = ALIGNED_F(ccoords + off0);
19516 const MFloat* const RESTRICT coord1 = ALIGNED_F(ccoords + off1);
19517
19518 const MUint voff0 = nghbrCellIds[2 * srfcId] * noPVars;
19519 const MUint voff1 = nghbrCellIds[2 * srfcId + 1] * noPVars;
19520 const MFloat* const RESTRICT cellVars0 = ALIGNED_F(cellvars + voff0);
19521 const MFloat* const RESTRICT cellVars1 = ALIGNED_F(cellvars + voff1);
19522
19523 const MUint offset0 = nghbrCellIds[2 * srfcId] * noSlopes;
19524 const MUint offset1 = nghbrCellIds[2 * srfcId + 1] * noSlopes;
19525 const MFloat* const RESTRICT slope0 = ALIGNED_F(slope + offset0);
19526 const MFloat* const RESTRICT slope1 = ALIGNED_F(slope + offset1);
19527
19528 const MUint fluxOffset = srfcId * noFluxVars;
19529 MFloat* const RESTRICT flux = ALIGNED_MF(fluxes + fluxOffset);
19530
19531 viscousFluxFct.template viscousFlux<stencil>(orientation, A, isBndry, surfaceCoord, coord0, coord1, cellVars0,
19532 cellVars1, vars0, vars1, slope0, slope1, f0, f1, flux);
19533 }
19534}

◆ viscousFluxMultiSpecies_()

template<MInt nDim_, class SysEqn >
template<MInt noSpecies>
void FvCartesianSolverXD< nDim_, SysEqn >::viscousFluxMultiSpecies_ ( )

◆ vorticityAtCell()

template<MInt nDim_, class SysEqn >
MFloat & FvCartesianSolverXD< nDim_, SysEqn >::vorticityAtCell ( const MInt  cellId,
const MInt  dir 
)
virtual

Definition at line 8967 of file fvcartesiansolverxd.cpp.

8967 {
8968 ASSERT(m_vorticity != nullptr, "Vorticity not initialized");
8969 return m_vorticity[cellId][dir];
8970}

◆ writeCellData()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::writeCellData ( MInt  c)

Definition at line 8588 of file fvcartesiansolverxd.cpp.

8588 {
8589 TRACE();
8590
8591 cerr << "**********************************************************" << endl;
8592 cerr << "Writing cell data for cell " << c << " at time step " << globalTimeStep << ", " << m_RKStep << "> at level "
8593 << a_level(c) << endl;
8594 cerr << "Primitive cell variables: " << endl;
8595 for(MInt v = 0; v < PV->noVariables; v++) {
8596 cerr << a_pvariable(c, v) << " ";
8597 }
8598 cerr << endl;
8599 cerr << "Conservative cell variables: " << endl;
8600 for(MInt v = 0; v < CV->noVariables; v++) {
8601 cerr << a_variable(c, v) << " ";
8602 }
8603 cerr << "Cell slopes: " << endl;
8604 for(MInt v = 0; v < PV->noVariables; v++) {
8605 for(MInt i = 0; i < 3; i++) {
8606 cerr << a_slope(c, v, i) << " ";
8607 }
8608 cerr << endl;
8609 }
8610 cerr << "**********************************************************" << endl;
8611}

◆ writeCenterLineVel()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::writeCenterLineVel

Definition at line 26264 of file fvcartesiansolverxd.cpp.

26264 {
26265 TRACE();
26266 IF_CONSTEXPR(!hasE<SysEqn>)
26267 mTerm(1, AT_, "Not compatible with SysEqn without RHO_E!");
26268
26269 switch(m_writeOutData) {
26270 case 1: {
26271 // dynamic pressure
26272 MFloat rhoU2 = 0;
26273 for(MInt dimId = 0; dimId < nDim; dimId++)
26274 rhoU2 += POW2(m_VVInfinity[dimId]);
26275 rhoU2 *= F1B2 * m_rhoInfinity;
26276
26277 // write center line data
26278 ofstream ofl;
26279 ofl.open("CenterlineData");
26280
26281 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
26282 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
26283 if(fabs(a_coordinate(cellId, 1) - c_cellLengthAtLevel(a_level(cellId) + 1)) < 0.001
26284 && fabs(a_coordinate(cellId, nDim - 1) - c_cellLengthAtLevel(a_level(cellId) + 1)) < 0.001) {
26285 for(MInt dimId = 0; dimId < nDim; dimId++)
26286 ofl << a_coordinate(cellId, dimId) << " ";
26287 for(MInt dimId = 0; dimId < nDim; dimId++)
26288 ofl << a_variable(cellId, CV->RHO_VV[dimId]) / a_variable(cellId, CV->RHO) << " ";
26289 ofl << a_variable(cellId, CV->RHO) << " ";
26290 ofl << endl;
26291 }
26292 }
26293 }
26294
26295 // write boundary cell data
26296 ofstream ofl2;
26297 MFloat angle;
26298 const MFloat yOffset = 30.0;
26299 const MFloat xOffset = 15.028;
26300 const MFloat radToDeg = 360.0 / (2.0 * PI);
26301 ofl2.open("BoundaryData");
26302
26303 for(MInt bndryId = 0; bndryId < m_fvBndryCnd->m_bndryCells->size(); bndryId++) {
26304 const MInt cellId = m_fvBndryCnd->m_bndryCells->a[bndryId].m_cellId;
26305 if(m_fvBndryCnd->m_bndryCells->a[bndryId].m_srfcs[0]->m_bndryCndId >= 3000
26306 && m_fvBndryCnd->m_bndryCells->a[bndryId].m_srfcs[0]->m_bndryCndId <= 3003) {
26307 if(a_hasProperty(cellId, SolverCell::IsOnCurrentMGLevel)) {
26308 // determine angle
26309 if(a_coordinate(cellId, 1) - yOffset > 0 && a_coordinate(cellId, 0) - xOffset > 0) {
26310 angle = 180 - radToDeg * atan((a_coordinate(cellId, 1) - yOffset) / (a_coordinate(cellId, 0) - xOffset));
26311 } else {
26312 if(a_coordinate(cellId, 1) - yOffset > 0 && a_coordinate(cellId, 0) - xOffset < 0) {
26313 angle = -radToDeg * atan((a_coordinate(cellId, 1) - yOffset) / (a_coordinate(cellId, 0) - xOffset));
26314 } else {
26315 if(a_coordinate(cellId, 1) - yOffset < 0 && a_coordinate(cellId, 0) - xOffset > 0) {
26316 angle = 180.0
26317 - radToDeg * atan((a_coordinate(cellId, 1) - yOffset) / (a_coordinate(cellId, 0) - xOffset));
26318 } else {
26319 angle = 360.0
26320 - radToDeg * atan((a_coordinate(cellId, 1) - yOffset) / (a_coordinate(cellId, 0) - xOffset));
26321 }
26322 }
26323 }
26324
26325 // calculate velocities
26326 MFloat vv[nDim];
26327 MFloat vv2 = 0;
26328 for(MInt dimId = 0; dimId < nDim; dimId++) {
26329 vv[dimId] = a_variable(cellId, CV->RHO_VV[dimId]) / a_variable(cellId, CV->RHO);
26330 vv2 += POW2(vv[dimId]);
26331 }
26332
26333 // pressure
26334 const MFloat p = sysEqn().pressure(a_variable(cellId, CV->RHO), vv2, a_variable(cellId, CV->RHO_E));
26335 const MFloat cp = (p - m_PInfinity) / rhoU2;
26336
26337 // Mach number
26338 const MFloat ma = sqrt(vv2) / sysEqn().speedOfSound(a_variable(cellId, CV->RHO), p);
26339
26340 ofl2 << angle << " ";
26341 for(MInt dimId = 0; dimId < nDim; dimId++)
26342 ofl << vv[dimId] << " ";
26343 ofl2 << cp << " ";
26344 ofl2 << ma << " ";
26345 for(MInt dimId = 0; dimId < nDim; dimId++)
26346 ofl << a_coordinate(cellId, dimId) << " ";
26347 ofl2 << m_fvBndryCnd->m_bndryCells->a[bndryId].m_linkedCellId << " ";
26348 ofl2 << endl;
26349 }
26350 }
26351 }
26352 break;
26353 }
26354 case 2: {
26355 const MInt direction = 1;
26356 IF_CONSTEXPR(direction >= nDim) mTerm(1, AT_, "direction>=nDim");
26357 const MFloat coordinate = 100.0;
26358
26359 fstream ofl;
26360 stringstream file;
26361 file << "PlaneData" << domainId();
26362 ofl.open((file.str()).c_str(), ios::out);
26363
26364 for(MInt c = 0; c < noInternalCells(); c++) {
26365 if(c_noChildren(c) > 0) continue;
26366
26367 if(a_level(c) < 0) continue;
26368
26369 if(a_coordinate(c, direction) < coordinate) continue;
26370
26371 if(a_hasNeighbor(c, 2 * direction) > 0) {
26372 if(a_coordinate(c_neighborId(c, 2 * direction), direction) > coordinate) continue;
26373 } else {
26374 continue;
26375 }
26376
26377 // Write Ascii file
26378 for(MInt i = 0; i < nDim; i++)
26379 ofl << a_coordinate(c, i) << " ";
26380
26381 for(MInt v = 0; v < CV->noVariables; v++)
26382 ofl << a_variable(c, v) << " ";
26383
26384 ofl << endl;
26385 }
26386 ofl.close();
26387
26388 break;
26389 }
26390 default: {
26391 stringstream errorMessage;
26392 errorMessage << "FvCartesianSolverXD::writeCenterLineVel() switch variable 'm_writeOutData' with value "
26393 << m_writeOutData << " not matching any case." << endl;
26394 mTerm(1, AT_, errorMessage.str());
26395 }
26396 }
26397}

◆ writeCutCellsToGridFile()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::writeCutCellsToGridFile
protected
Author
Michael Schlottke (mic) mic@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Lennart Schneiders
Date
2012-11-20, 2013-07-30
Note
substituted cut-faces output by cut-edges to save disk space and simplify the grid reader, Lennart
added output of boundary surface centroids, Lennart

Definition at line 8181 of file fvcartesiansolverxd.cpp.

8181 {
8182 TRACE();
8183
8184 // Open grid file
8185 using namespace maia::parallel_io;
8186 ParallelIo parallelIo(outputDir() + grid().gridInputFileName(), PIO_APPEND, mpiComm());
8187
8188 // Check if cut cell information is already in the grid file - if yes, inform the user
8189 // that modifying that data is not possible and return from the method.
8190 if(parallelIo.hasDataset("cutCellIds", 1)) {
8191 // m_log << "Cannot add cut cell information as it is already in the grid file." << endl;
8192 return;
8193 }
8194
8195 // Collect all necessary information for cut cell visualization
8196 MInt noBndryCells = 0;
8197 for(MInt bndryId = 0; bndryId < m_bndryCells->size(); bndryId++) {
8198 const MInt cellId = m_bndryCells->a[bndryId].m_cellId;
8199 if(!a_isHalo(cellId)) {
8200 noBndryCells++;
8201 }
8202 }
8203
8204 // Save number of cut points for boundary cells
8205 MIntScratchSpace noCutPoints(noBndryCells, FUN_, "noCutPoints");
8206 MInt localNoCutPoints = 0;
8207 MInt bcnt = 0;
8208 for(MInt bndryId = 0; bndryId < m_bndryCells->size(); bndryId++) {
8209 const MInt cellId = m_bndryCells->a[bndryId].m_cellId;
8210 if(a_isHalo(cellId)) continue;
8211 noCutPoints[bcnt] = m_bndryCells->a[bndryId].m_srfcs[0]->m_noCutPoints;
8212 localNoCutPoints += noCutPoints[bcnt];
8213 bcnt++;
8214 }
8215
8216 // Save cut edges and cut point coordinates
8217 MIntScratchSpace cutEdges(localNoCutPoints, FUN_, "cutEdges");
8218 MFloatScratchSpace cutCoordinates(localNoCutPoints, nDim, FUN_, "cutCoordinates");
8219 MInt ccId = 0;
8220 bcnt = 0;
8221 for(MInt bndryId = 0; bndryId < m_bndryCells->size(); bndryId++) {
8222 const MInt cellId = m_bndryCells->a[bndryId].m_cellId;
8223 if(a_isHalo(cellId)) continue;
8224 // Create array to keep track of checked edges
8225 MInt edgeChecked[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
8226 for(MInt cutId = 0; cutId < m_bndryCells->a[bndryId].m_srfcs[0]->m_noCutPoints; cutId++) {
8227 MInt edge;
8228 edge = m_bndryCells->a[bndryId].m_srfcs[0]->m_cutEdge[cutId];
8229
8230 // Skip if edge was already checked
8231 if(edgeChecked[edge]) {
8232 continue;
8233 }
8234
8235 cutEdges[ccId] = edge;
8236 edgeChecked[edge] = 1;
8237
8238 for(MInt dim = 0; dim < nDim; dim++) {
8239 cutCoordinates(ccId, dim) = m_bndryCells->a[bndryId].m_srfcs[0]->m_cutCoordinates[cutId][dim];
8240 }
8241 ccId++;
8242 }
8243 bcnt++;
8244 }
8245
8246
8247 // Save whether original cell vertices are inside or outside the domain
8248 // signStencil is needed for the calculation of the vertex coordinates
8249 const MFloat signStencil[8][3] = {{-F1, -F1, -F1}, {F1, -F1, -F1}, {-F1, F1, -F1}, {F1, F1, -F1},
8250 {-F1, -F1, F1}, {F1, -F1, F1}, {-F1, F1, F1}, {F1, F1, F1}};
8251 // cellLengths holds the length of all cells depending on their refinement level
8252 vector<MFloat> cellLengths(maxRefinementLevel() + 1);
8253 for(vector<MFloat>::size_type i = 0; i < cellLengths.size(); i++) {
8254 cellLengths[i] = c_cellLengthAtLevel(i);
8255 }
8256 // Iterate over all cells, then all points to calculate and store whether the point is inside or not
8257 MIntScratchSpace pointInside(noBndryCells, IPOW2(nDim), FUN_, "pointInside");
8258 bcnt = 0;
8259 for(MInt bndryId = 0; bndryId < m_bndryCells->size(); bndryId++) {
8260 const MInt cellId = m_bndryCells->a[bndryId].m_cellId;
8261 if(a_isHalo(cellId)) continue;
8262 for(MInt pointId = 0; pointId < IPOW2(nDim); pointId++) {
8263 // Here we loop over all directions to calculate the coordinate of the corner point,
8264 // then we check whether it is inside or not
8265 MFloat pointCoordinates[MAX_SPACE_DIMENSIONS];
8266 for(MInt dir = 0; dir < nDim; dir++) {
8267 const MFloat cellCenterCoord = a_coordinate(cellId, dir);
8268 const MFloat cellLength = cellLengths[a_level(cellId)];
8269 pointCoordinates[dir] = cellCenterCoord + signStencil[pointId][dir] * F1B2 * cellLength;
8270 }
8271 pointInside(bcnt, pointId) = m_geometry->pointIsInside2(pointCoordinates);
8272 }
8273 bcnt++;
8274 }
8275
8276 // Determine data offsets for cells, boundary cells, and cut points in the grid file
8277 ParallelIo::size_type cellOffset, bndryCellOffset, cutPointOffset;
8278 ParallelIo::size_type globalNoCells, globalNoBndryCells, globalNoCutPoints;
8279 parallelIo.calcOffset(noInternalCells(), &cellOffset, &globalNoCells, mpiComm());
8280 parallelIo.calcOffset(noBndryCells, &bndryCellOffset, &globalNoBndryCells, mpiComm());
8281 parallelIo.calcOffset(localNoCutPoints, &cutPointOffset, &globalNoCutPoints, mpiComm());
8282
8283 // Add new variables to grid file
8284 parallelIo.defineArray(PIO_INT, "cutCellIds", globalNoCells);
8285 parallelIo.defineArray(PIO_INT, "noCutPoints", globalNoBndryCells);
8286 parallelIo.defineArray(PIO_INT, "cutEdges", globalNoCutPoints);
8287 parallelIo.defineArray(PIO_FLOAT, "cutCoordinates", globalNoCutPoints * nDim);
8288 parallelIo.defineArray(PIO_INT, "pointIsInside", globalNoBndryCells * IPOW2(nDim));
8289
8290 // Write data to file
8291 // This field is used to show whether a cell has cut cell information or not
8292 parallelIo.setOffset(noInternalCells(), cellOffset);
8293 parallelIo.writeArray(&a_bndryId(0), "cutCellIds");
8294
8295 parallelIo.setOffset(noBndryCells, bndryCellOffset);
8296 parallelIo.writeArray(noCutPoints.getPointer(), "noCutPoints");
8297
8298 parallelIo.setOffset(localNoCutPoints, cutPointOffset);
8299 parallelIo.writeArray(cutEdges.getPointer(), "cutEdges");
8300
8301 parallelIo.setOffset(localNoCutPoints * nDim, cutPointOffset * nDim);
8302 parallelIo.writeArray(cutCoordinates.getPointer(), "cutCoordinates");
8303
8304 parallelIo.setOffset(noBndryCells * IPOW2(nDim), bndryCellOffset * IPOW2(nDim));
8305 parallelIo.writeArray(pointInside.getPointer(), "pointIsInside");
8306}

◆ writeListOfActiveFlowCells()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::writeListOfActiveFlowCells
protectedvirtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 7656 of file fvcartesiansolverxd.cpp.

7656 {
7657 TRACE();
7658
7659 // reset
7660 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
7661 a_hasProperty(cellId, SolverCell::IsActive) = a_hasProperty(cellId, SolverCell::IsFlux);
7662 }
7663
7664 // include all cells involved in the reconstruction process
7665 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
7666 if(a_hasProperty(cellId, SolverCell::IsActive)) {
7667 for(MInt c = 0; c < a_noReconstructionNeighbors(cellId); c++) {
7668 a_hasProperty(a_reconstructionNeighborId(cellId, c), SolverCell::IsActive) = true;
7669 }
7670 }
7671 }
7672
7673 m_noActiveCells = 0;
7674 for(MInt cellId = 0; cellId < noInternalCells(); cellId++) {
7675 if(a_hasProperty(cellId, SolverCell::IsActive)) {
7678 }
7679 }
7681 for(MInt cellId = noInternalCells(); cellId < a_noCells(); cellId++) {
7682 if(a_hasProperty(cellId, SolverCell::IsActive)) {
7685 }
7686 }
7687 m_log << "Time step - Active cells: " << globalTimeStep << " " << m_noActiveHaloCellOffset << " " << m_noActiveCells
7688 << endl;
7689}

◆ writeRestartFile() [1/2]

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::writeRestartFile ( const MBool  writeRestart,
const MBool  writeBackup,
const MString  gridFileName,
MInt recalcIdTree 
)
overridevirtual

Reimplemented from Solver.

Definition at line 17035 of file fvcartesiansolverxd.cpp.

17036 {
17037 TRACE();
17038
17039 m_currentGridFileName = gridFileName;
17040
17041 if(m_recalcIds != nullptr) {
17042 for(MInt cellId = 0; cellId < maxNoGridCells(); cellId++) {
17043 m_recalcIds[cellId] = recalcIdTree[cellId];
17044 }
17045 }
17046
17047 if(writeRestart) {
17048 saveRestartFile(writeBackup);
17049 }
17050
17051 if(m_useSandpaperTrip) {
17053 }
17054
17055 if(m_wmLES) {
17057 }
17058
17060}
virtual void saveRestartFile(const MBool)

◆ writeRestartFile() [2/2]

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::writeRestartFile ( MBool  )
inlineoverridevirtual

Reimplemented from Solver.

Definition at line 2862 of file fvcartesiansolverxd.h.

2862{};

◆ writeSpanAvgSrfcProbes()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::writeSpanAvgSrfcProbes
protected

Definition at line 34281 of file fvcartesiansolverxd.cpp.

34281 {
34282 TRACE();
34283
34284 const MInt noVars = 16;
34285
34286 // reset buffer
34287 memset(&(m_saSrfcProbeBuffer[0]), 0.0, m_saNoSrfcProbes * noVars * sizeof(MFloat));
34288
34289 // collect local data
34290 for(MInt p = 0; p < m_saNoSrfcProbes; p++) {
34291 for(MUint s = 0; s < m_saSrfcProbeIds[p].size(); s++) {
34292 const MInt cellId = m_saSrfcProbeIds[p][s];
34293 const MInt srfc = m_saSrfcProbeSrfcs[p][s];
34294 const MInt bCellId = a_bndryId(cellId);
34295 const MInt wmSrfcId = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_wmSrfcId;
34296
34297 MFloat pSrfc = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_primVars[PV->P];
34298 MFloat rhoSrfc = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_primVars[PV->RHO];
34299 MFloat uSrfc = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_primVars[PV->U];
34300 MFloat vSrfc = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_primVars[PV->V];
34301 MFloat wSrfc = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_primVars[PV->W];
34302 MFloat TSrfc = sysEqn().temperature_ES(rhoSrfc, pSrfc);
34303 MFloat mueSrfc = SUTHERLANDLAW(TSrfc);
34304
34305 MFloat nx = m_bndryCells->a[bCellId].m_srfcs[srfc]->m_normalVector[0];
34306 MFloat ny = m_bndryCells->a[bCellId].m_srfcs[srfc]->m_normalVector[1];
34307 MFloat nz = m_bndryCells->a[bCellId].m_srfcs[srfc]->m_normalVector[2];
34308
34309 MFloat dudn = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_normalDeriv[PV->U];
34310 MFloat dvdn = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_normalDeriv[PV->V];
34311 MFloat dwdn = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_normalDeriv[PV->W];
34312
34313 MFloat tau_w = mueSrfc * (dudn * ny - dvdn * nx) / sysEqn().m_Re0;
34314 MFloat mue_wm = F0;
34315 MFloat tau_wm = F0;
34316
34317 if(m_wmLES) {
34318 if(wmSrfcId > -1) {
34319 mue_wm += m_wmSurfaces[wmSrfcId].m_wmMUEWM;
34320 tau_wm += (mueSrfc + mue_wm) * (dudn * ny - dvdn * nx) / sysEqn().m_Re0;
34321 }
34322 }
34323
34324 m_saSrfcProbeBuffer[noVars * p + 0] += m_bndryCells->a[bCellId].m_srfcs[srfc]->m_coordinates[0];
34325 m_saSrfcProbeBuffer[noVars * p + 1] += nx;
34326 m_saSrfcProbeBuffer[noVars * p + 2] += ny;
34327 m_saSrfcProbeBuffer[noVars * p + 3] += nz;
34328 m_saSrfcProbeBuffer[noVars * p + 4] += uSrfc;
34329 m_saSrfcProbeBuffer[noVars * p + 5] += vSrfc;
34330 m_saSrfcProbeBuffer[noVars * p + 6] += wSrfc;
34331 m_saSrfcProbeBuffer[noVars * p + 7] += rhoSrfc;
34332 m_saSrfcProbeBuffer[noVars * p + 8] += pSrfc;
34333 m_saSrfcProbeBuffer[noVars * p + 9] += mueSrfc;
34334 m_saSrfcProbeBuffer[noVars * p + 10] += dudn;
34335 m_saSrfcProbeBuffer[noVars * p + 11] += dvdn;
34336 m_saSrfcProbeBuffer[noVars * p + 12] += dwdn;
34337 m_saSrfcProbeBuffer[noVars * p + 13] += tau_w;
34338 m_saSrfcProbeBuffer[noVars * p + 14] += mue_wm;
34339 m_saSrfcProbeBuffer[noVars * p + 15] += tau_wm;
34340 }
34341 }
34342
34343 if(domainId() == 0) {
34344 MPI_Reduce(MPI_IN_PLACE, &m_saSrfcProbeBuffer[0], noVars * m_saNoSrfcProbes, MPI_DOUBLE, MPI_SUM, 0, mpiComm(), AT_,
34345 "MPI_IN_PLACE", "&m_saSrfcProbeBuffer[0]");
34346 } else {
34347 MPI_Reduce(&m_saSrfcProbeBuffer[0], &m_saSrfcProbeBuffer[0], noVars * m_saNoSrfcProbes, MPI_DOUBLE, MPI_SUM, 0,
34348 mpiComm(), AT_, "&m_saSrfcProbeBuffer[0]", "&m_saSrfcProbeBuffer[0]");
34349 }
34350
34351 if(domainId() == 0) {
34352 for(MInt p = 0; p < m_saNoSrfcProbes; p++) {
34353 // write output
34354 FILE* datei;
34355 stringstream filename;
34356 filename << outputDir() << m_saSrfcProbeDir << "/"
34357 << "spanAvgSrfcProbes_" << p;
34358 datei = fopen(filename.str().c_str(), "a");
34359
34360 // print head
34362 fprintf(datei, "0: globalTimeStep");
34363 fprintf(datei, " 1: x");
34364 fprintf(datei, " 2: nx");
34365 fprintf(datei, " 3: ny");
34366 fprintf(datei, " 4: nz");
34367 fprintf(datei, " 5: u_srfc");
34368 fprintf(datei, " 6: v_srfc");
34369 fprintf(datei, " 7: w_srfc");
34370 fprintf(datei, " 8: rho_srfc");
34371 fprintf(datei, " 9: p_srfc");
34372 fprintf(datei, " 10: mue_srfc");
34373 fprintf(datei, " 11: dudn");
34374 fprintf(datei, " 12: dvdn");
34375 fprintf(datei, " 13: dwdn");
34376 fprintf(datei, " 14: tau_w");
34377 fprintf(datei, " 15: mue_wm");
34378 fprintf(datei, " 16: tau_wm");
34379 fprintf(datei, "\n");
34380 }
34381
34382 fprintf(datei, "%d ", globalTimeStep);
34383
34384 for(MInt v = 0; v < noVars; v++) {
34385 fprintf(datei, "%f ", m_saSrfcProbeBuffer[noVars * p + v] / m_saSrfcProbeNoSamples[p]);
34386 }
34387 fprintf(datei, "\n");
34388 fclose(datei);
34389 }
34390 }
34391}

◆ writeVtkXmlFiles()

template<MInt nDim_, class SysEqn >
virtual void FvCartesianSolverXD< nDim_, SysEqn >::writeVtkXmlFiles ( const  MString,
const  MString,
MBool  ,
MBool   
)
inlinevirtual

Reimplemented in FvMbCartesianSolverXD< nDim, SysEqn >.

Definition at line 2158 of file fvcartesiansolverxd.h.

2158{};

◆ writeWMSurfaceProbes()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::writeWMSurfaceProbes
protected

Definition at line 12451 of file fvcartesiansolverxd.cpp.

12451 {
12452 TRACE();
12453
12454 MInt noVars = 13;
12455
12456 // Computing and Gathering variables:
12457 for(MInt p = 0; p < m_wmLocalNoSrfcProbeIds[domainId()]; p++) {
12460 MInt bCellId = a_bndryId(cellId);
12461 MInt ghostCellId = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_ghostCellId;
12462
12463 MFloat pSurface = F1B2 * (a_pvariable(cellId, PV->P) + a_pvariable(ghostCellId, PV->P));
12464 MFloat rhoSurface = F1B2 * (a_pvariable(cellId, PV->RHO) + a_pvariable(ghostCellId, PV->RHO));
12465 MFloat TSurface = sysEqn().temperature_ES(rhoSurface, pSurface);
12466 MFloat mue = SUTHERLANDLAW(TSurface);
12467
12468 m_wmSrfcProbeSendBuffer[noVars * p + 0] = cellId;
12469 m_wmSrfcProbeSendBuffer[noVars * p + 1] = m_bndryCells->a[bCellId].m_srfcs[srfc]->m_coordinates[0];
12470 m_wmSrfcProbeSendBuffer[noVars * p + 2] = m_bndryCells->a[bCellId].m_srfcs[srfc]->m_coordinates[1];
12471 m_wmSrfcProbeSendBuffer[noVars * p + 3] = m_bndryCells->a[bCellId].m_srfcs[srfc]->m_coordinates[2];
12472 m_wmSrfcProbeSendBuffer[noVars * p + 4] = m_bndryCells->a[bCellId].m_srfcs[srfc]->m_normalVector[0];
12473 m_wmSrfcProbeSendBuffer[noVars * p + 5] = m_bndryCells->a[bCellId].m_srfcs[srfc]->m_normalVector[1];
12474 m_wmSrfcProbeSendBuffer[noVars * p + 6] = m_bndryCells->a[bCellId].m_srfcs[srfc]->m_normalVector[2];
12475 m_wmSrfcProbeSendBuffer[noVars * p + 7] = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_normalDeriv[PV->VV[0]];
12476 m_wmSrfcProbeSendBuffer[noVars * p + 8] = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_normalDeriv[PV->VV[1]];
12477 m_wmSrfcProbeSendBuffer[noVars * p + 9] = m_bndryCells->a[bCellId].m_srfcVariables[srfc]->m_normalDeriv[PV->VV[2]];
12478 m_wmSrfcProbeSendBuffer[noVars * p + 10] = mue;
12479 m_wmSrfcProbeSendBuffer[noVars * p + 11] = m_bndryCells->a[bCellId].m_wmBCVars->m_wmMUEWM;
12480 m_wmSrfcProbeSendBuffer[noVars * p + 12] = m_bndryCells->a[bCellId].m_wmBCVars->m_wmTauW;
12481 }
12482
12483 // Sending variables
12484 MPI_Issend(&m_wmSrfcProbeSendBuffer[0], m_wmLocalNoSrfcProbeIds[domainId()] * noVars, MPI_DOUBLE, 0, 0, mpiComm(),
12485 &m_mpi_wmRequest[0], AT_, "&m_wmSrfcProbeSendBuffer[0]");
12486
12487 // Receiving variables
12488 MPI_Status status;
12489 MInt offset = 0;
12490 if(domainId() == 0) {
12491 for(MInt dom = 0; dom < noDomains(); dom++) {
12492 MPI_Recv(&m_wmSrfcProbeRecvBuffer[offset], m_wmLocalNoSrfcProbeIds[dom] * noVars, MPI_DOUBLE, dom, 0, mpiComm(),
12493 &status, AT_, "&m_wmSrfcProbeRecvBuffer[offset]");
12494 offset += m_wmLocalNoSrfcProbeIds[dom] * noVars;
12495 }
12496
12497 FILE* datei;
12498 stringstream filename;
12499 filename << outputDir() << "wmSurfaceProbes_" << globalTimeStep;
12500 datei = fopen(filename.str().c_str(), "w+");
12501
12502 // print header
12503 fprintf(datei, "cellId");
12504 fprintf(datei, " x");
12505 fprintf(datei, " y");
12506 fprintf(datei, " z");
12507 fprintf(datei, " nx");
12508 fprintf(datei, " ny");
12509 fprintf(datei, " nz");
12510 fprintf(datei, " dudn");
12511 fprintf(datei, " dvdn");
12512 fprintf(datei, " dwdn");
12513 fprintf(datei, " mue");
12514 fprintf(datei, " mue_wm");
12515 fprintf(datei, " tau_wm");
12516 fprintf(datei, "\n");
12517
12518 for(MInt p = 0; p < m_wmGlobalNoSrfcProbeIds; p++) {
12519 for(MInt v = 0; v < noVars; v++) {
12520 fprintf(datei, "%f ", m_wmSrfcProbeRecvBuffer[p * noVars + v]);
12521 }
12522 fprintf(datei, "\n");
12523 }
12524 fclose(datei);
12525 }
12526}

◆ writeWMTimersASCII()

template<MInt nDim_, class SysEqn >
void FvCartesianSolverXD< nDim_, SysEqn >::writeWMTimersASCII
protected

Definition at line 34394 of file fvcartesiansolverxd.cpp.

34394 {
34395 MFloat timerValue[3];
34396 timerValue[0] = RETURN_TIMER_TIME(m_timers[Timers::WMExchange]);
34397 timerValue[1] = RETURN_TIMER_TIME(m_timers[Timers::WMSurfaceLoop]);
34398 timerValue[2] = RETURN_TIMER_TIME(m_timers[Timers::WMFluxCorrection]);
34399
34400 for(MInt i = 0; i < 3; i++) {
34401 if(domainId() == 0) {
34402 MPI_Reduce(MPI_IN_PLACE, &timerValue[i], 1, MPI_DOUBLE, MPI_MAX, 0, mpiComm(), AT_, "MPI_IN_PLACE",
34403 "&timerValue[i]");
34404 } else {
34405 MPI_Reduce(&timerValue[i], &timerValue[i], 1, MPI_DOUBLE, MPI_MAX, 0, mpiComm(), AT_, "&timerValue[i]",
34406 "&timerValue[i]");
34407 }
34408 }
34409
34410 if(domainId() == 0) {
34411 MPI_Reduce(MPI_IN_PLACE, &m_wmIterator, 1, MPI_INT, MPI_MAX, 0, mpiComm(), AT_, "MPI_IN_PLACE", "&m_wmIterator");
34412 } else {
34413 MPI_Reduce(&m_wmIterator, &m_wmIterator, 1, MPI_INT, MPI_MAX, 0, mpiComm(), AT_, "&m_wmIterator", "&m_wmIterator");
34414 }
34415
34416
34417 if(domainId() == 0) {
34418 FILE* datei;
34419 stringstream filename;
34420 filename << outputDir() << "wmTimers";
34421 datei = fopen(filename.str().c_str(), "a");
34422
34423 fprintf(datei, "WMExchange: %f ", timerValue[0]);
34424 fprintf(datei, "WMSurfaceLoop: %f ", timerValue[1]);
34425 fprintf(datei, "WMFluxCorrection: %f ", timerValue[2]);
34426 fprintf(datei, "WMIterator: %d ", m_wmIterator);
34427 fprintf(datei, "\n");
34428
34429 fclose(datei);
34430 }
34431}

Friends And Related Function Documentation

◆ AccessorUnstructured

template<MInt nDim_, class SysEqn >
template<class SolverType >
friend class AccessorUnstructured
friend

Definition at line 213 of file fvcartesiansolverxd.h.

◆ CouplerFvMultilevel

template<MInt nDim_, class SysEqn >
template<MInt nDim, class SysEqn_ >
friend class CouplerFvMultilevel
friend

Definition at line 220 of file fvcartesiansolverxd.h.

◆ CouplerFvMultilevel< nDim_, SysEqn >

template<MInt nDim_, class SysEqn >
friend class CouplerFvMultilevel< nDim_, SysEqn >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ CouplerFvParticle

template<MInt nDim_, class SysEqn >
template<MInt nDim, class SysEqn_ >
friend class CouplerFvParticle
friend

Definition at line 235 of file fvcartesiansolverxd.h.

◆ CouplerLbFv

template<MInt nDim_, class SysEqn >
template<MInt nDim, MInt nDist, class SysEqnLb_ , class SysEqnFv_ >
friend class CouplerLbFv
friend

Definition at line 230 of file fvcartesiansolverxd.h.

◆ CouplerLbFvEEMultiphase

template<MInt nDim_, class SysEqn >
template<MInt nDim, MInt nDist, class SysEqnLb_ , class SysEqnFv_ >
friend class CouplerLbFvEEMultiphase
friend

Definition at line 233 of file fvcartesiansolverxd.h.

◆ CouplingFvMb

template<MInt nDim_, class SysEqn >
template<MInt nDim, class SysEqn_ >
friend class CouplingFvMb
friend

Definition at line 226 of file fvcartesiansolverxd.h.

◆ CouplingLsFv

template<MInt nDim_, class SysEqn >
template<MInt nDim, class SysEqn_ >
friend class CouplingLsFv
friend

Definition at line 224 of file fvcartesiansolverxd.h.

◆ CouplingLsFv< nDim, SysEqn >

template<MInt nDim_, class SysEqn >
friend class CouplingLsFv< nDim, SysEqn >
friend

Definition at line 239 of file fvcartesiansolverxd.h.

◆ FvBndryCndXD

template<MInt nDim_, class SysEqn >
template<MInt nDim, class SysEqn_ >
friend class FvBndryCndXD
friend

Definition at line 218 of file fvcartesiansolverxd.h.

◆ FvCartesianInterpolation< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > >, FvSysEqnNS< nDim > >

template<MInt nDim_, class SysEqn >
friend class FvCartesianInterpolation< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > >, FvSysEqnNS< nDim > >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ FvCartesianInterpolation< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > >, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >

template<MInt nDim_, class SysEqn >
friend class FvCartesianInterpolation< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > >, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ FvZonal< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_FS > > >

template<MInt nDim_, class SysEqn >
friend class FvZonal< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_FS > > >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ FvZonal< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >

template<MInt nDim_, class SysEqn >
friend class FvZonal< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ FvZonalRTV< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_FS > > >

template<MInt nDim_, class SysEqn >
friend class FvZonalRTV< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_FS > > >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ FvZonalRTV< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >

template<MInt nDim_, class SysEqn >
friend class FvZonalRTV< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ FvZonalSTG< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_FS > > >

template<MInt nDim_, class SysEqn >
friend class FvZonalSTG< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_FS > > >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ FvZonalSTG< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >

template<MInt nDim_, class SysEqn >
friend class FvZonalSTG< nDim_, FvSysEqnRANS< nDim, RANSModelConstants< RANS_SA_DV > > >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ LsFvCombustion

template<MInt nDim_, class SysEqn >
template<MInt nDim, class SysEqn_ >
friend class LsFvCombustion
friend

Definition at line 228 of file fvcartesiansolverxd.h.

◆ LsFvCombustion< nDim, SysEqn >

template<MInt nDim_, class SysEqn >
friend class LsFvCombustion< nDim, SysEqn >
friend

Definition at line 239 of file fvcartesiansolverxd.h.

◆ LsFvCombustion< nDim_, SysEqn >

template<MInt nDim_, class SysEqn >
friend class LsFvCombustion< nDim_, SysEqn >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ LsFvMb

template<MInt nDim_, class SysEqn >
template<MInt nDim, class SysEqn_ >
friend class LsFvMb
friend

Definition at line 222 of file fvcartesiansolverxd.h.

◆ LsFvMb< nDim_, SysEqn >

template<MInt nDim_, class SysEqn >
friend class LsFvMb< nDim_, SysEqn >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ maia::CartesianSolver< nDim, FvCartesianSolverXD< nDim, SysEqn > >

template<MInt nDim_, class SysEqn >
friend class maia::CartesianSolver< nDim, FvCartesianSolverXD< nDim, SysEqn > >
friend

Definition at line 239 of file fvcartesiansolverxd.h.

◆ MSTG

template<MInt nDim_, class SysEqn >
template<MInt nDim, SolverType SolverTypeR, SolverType SolverTypeL>
friend class MSTG
friend

Definition at line 216 of file fvcartesiansolverxd.h.

◆ PostProcessing

template<MInt nDim_, class SysEqn >
template<MInt nDim, class ppType >
friend class PostProcessing
friend

Definition at line 237 of file fvcartesiansolverxd.h.

◆ PostProcessingFv

template<MInt nDim_, class SysEqn >
template<MInt nDim, class SysEqn_ >
friend class PostProcessingFv
friend

Definition at line 239 of file fvcartesiansolverxd.h.

◆ VtkIo< nDim_, SysEqn >

template<MInt nDim_, class SysEqn >
friend class VtkIo< nDim_, SysEqn >
friend

Definition at line 2706 of file fvcartesiansolverxd.h.

Member Data Documentation

◆ alphaIn

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::alphaIn

Definition at line 1757 of file fvcartesiansolverxd.h.

◆ alphaInf

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::alphaInf

Definition at line 1756 of file fvcartesiansolverxd.h.

◆ AV

template<MInt nDim_, class SysEqn >
SysEqn::AdditionalVariables* FvCartesianSolverXD< nDim_, SysEqn >::AV {}

Definition at line 2082 of file fvcartesiansolverxd.h.

◆ bubbleDiameter

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::bubbleDiameter

Definition at line 1742 of file fvcartesiansolverxd.h.

◆ bubblePathDispersion

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::bubblePathDispersion

Definition at line 1753 of file fvcartesiansolverxd.h.

◆ CD

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::CD

Definition at line 1743 of file fvcartesiansolverxd.h.

◆ CL

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::CL

Definition at line 1744 of file fvcartesiansolverxd.h.

◆ comm_sponge

template<MInt nDim_, class SysEqn >
MPI_Comm FvCartesianSolverXD< nDim_, SysEqn >::comm_sponge {}

Definition at line 2989 of file fvcartesiansolverxd.h.

◆ const

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::const

Definition at line 2886 of file fvcartesiansolverxd.h.

◆ CV

template<MInt nDim_, class SysEqn >
SysEqn::ConservativeVariables* FvCartesianSolverXD< nDim_, SysEqn >::CV {}

Definition at line 2079 of file fvcartesiansolverxd.h.

◆ depthCorrection

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::depthCorrection

Definition at line 1761 of file fvcartesiansolverxd.h.

◆ depthCorrectionCoefficients

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::depthCorrectionCoefficients

Definition at line 1764 of file fvcartesiansolverxd.h.

◆ dragModel

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::dragModel

Definition at line 1745 of file fvcartesiansolverxd.h.

◆ Eo0

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::Eo0

Definition at line 1741 of file fvcartesiansolverxd.h.

◆ eps

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::eps

Definition at line 1747 of file fvcartesiansolverxd.h.

◆ FV

template<MInt nDim_, class SysEqn >
SysEqn::FluxVariables* FvCartesianSolverXD< nDim_, SysEqn >::FV {}

Definition at line 2080 of file fvcartesiansolverxd.h.

◆ gasSource

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::gasSource

Definition at line 1748 of file fvcartesiansolverxd.h.

◆ gasSourceBox

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::gasSourceBox

Definition at line 1752 of file fvcartesiansolverxd.h.

◆ gasSourceCells

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::gasSourceCells

Definition at line 1750 of file fvcartesiansolverxd.h.

◆ gasSourceMassFlow

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::gasSourceMassFlow

Definition at line 1749 of file fvcartesiansolverxd.h.

◆ gradUOtherPhase

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::gradUOtherPhase = nullptr

Definition at line 1737 of file fvcartesiansolverxd.h.

◆ gravity

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::gravity

Definition at line 1762 of file fvcartesiansolverxd.h.

◆ gravityRefCoords

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::gravityRefCoords

Definition at line 1763 of file fvcartesiansolverxd.h.

◆ hasAV

template<MInt nDim_, class SysEqn >
constexpr MBool FvCartesianSolverXD< nDim_, SysEqn >::hasAV = SysEqn::hasAV
staticconstexpr

Definition at line 2086 of file fvcartesiansolverxd.h.

◆ hasChemicalReaction

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::hasChemicalReaction

Definition at line 1777 of file fvcartesiansolverxd.h.

◆ hasSC

template<MInt nDim_, class SysEqn >
constexpr MBool FvCartesianSolverXD< nDim_, SysEqn >::hasSC = SysEqn::hasSC
staticconstexpr

Definition at line 2087 of file fvcartesiansolverxd.h.

◆ infPhi

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::infPhi

Definition at line 1771 of file fvcartesiansolverxd.h.

◆ infPressure

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::infPressure

Definition at line 1770 of file fvcartesiansolverxd.h.

◆ infSpeciesMassFraction

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::infSpeciesMassFraction

Definition at line 1773 of file fvcartesiansolverxd.h.

◆ infSpeciesName

template<MInt nDim_, class SysEqn >
MString* FvCartesianSolverXD< nDim_, SysEqn >::infSpeciesName

Definition at line 1772 of file fvcartesiansolverxd.h.

◆ infTemperature

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::infTemperature

Definition at line 1769 of file fvcartesiansolverxd.h.

◆ infVelocity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::infVelocity

Definition at line 1774 of file fvcartesiansolverxd.h.

◆ initialAlpha

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::initialAlpha

Definition at line 1755 of file fvcartesiansolverxd.h.

◆ interpolationFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::interpolationFactor

Definition at line 1765 of file fvcartesiansolverxd.h.

◆ laminarFlameSpeedFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::laminarFlameSpeedFactor

Definition at line 1775 of file fvcartesiansolverxd.h.

◆ liquidDensity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::liquidDensity

Definition at line 1746 of file fvcartesiansolverxd.h.

◆ m_2ndOrderWeights

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_2ndOrderWeights
protected

Definition at line 1979 of file fvcartesiansolverxd.h.

◆ m_7901faceNormalDir

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_7901faceNormalDir
protected

Definition at line 1840 of file fvcartesiansolverxd.h.

◆ m_7901periodicDir

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_7901periodicDir
protected

Definition at line 1842 of file fvcartesiansolverxd.h.

◆ m_7901Position

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_7901Position
protected

Definition at line 1839 of file fvcartesiansolverxd.h.

◆ m_7901wallDir

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_7901wallDir
protected

Definition at line 1841 of file fvcartesiansolverxd.h.

◆ m_A

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_A = nullptr
protected

Definition at line 1462 of file fvcartesiansolverxd.h.

◆ m_acousticAnalysis

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_acousticAnalysis
protected

Definition at line 1622 of file fvcartesiansolverxd.h.

◆ m_activeCellIds

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_activeCellIds = nullptr
protected

Definition at line 1443 of file fvcartesiansolverxd.h.

◆ m_activeMeanVars

template<MInt nDim_, class SysEqn >
std::set<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_activeMeanVars {}
protected

Definition at line 2073 of file fvcartesiansolverxd.h.

◆ m_adaptationDampingDistance

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_adaptationDampingDistance
protected

Definition at line 1724 of file fvcartesiansolverxd.h.

◆ m_adaptationLevel

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_adaptationLevel

Definition at line 2981 of file fvcartesiansolverxd.h.

◆ m_adaptationSinceLastRestart

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_adaptationSinceLastRestart
protected

Definition at line 1637 of file fvcartesiansolverxd.h.

◆ m_adaptationSinceLastRestartBackup

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_adaptationSinceLastRestartBackup
protected

Definition at line 1638 of file fvcartesiansolverxd.h.

◆ m_advectiveFluxScheme

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::m_advectiveFluxScheme
protected

Definition at line 2319 of file fvcartesiansolverxd.h.

◆ m_allowInterfaceRefinement

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_allowInterfaceRefinement
protected

Definition at line 1692 of file fvcartesiansolverxd.h.

◆ m_analyticIntegralVelocity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_analyticIntegralVelocity
protected

Definition at line 2338 of file fvcartesiansolverxd.h.

◆ m_angle

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_angle = nullptr
protected

Definition at line 1725 of file fvcartesiansolverxd.h.

◆ m_angularBodyVelocity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_angularBodyVelocity
protected

Definition at line 1496 of file fvcartesiansolverxd.h.

◆ m_associatedBodyIds

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_associatedBodyIds = nullptr
protected

Definition at line 1627 of file fvcartesiansolverxd.h.

◆ m_associatedInternalCells

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_associatedInternalCells
protected

Definition at line 2315 of file fvcartesiansolverxd.h.

◆ m_ATA

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_ATA = nullptr
protected

Definition at line 1463 of file fvcartesiansolverxd.h.

◆ m_ATAi

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_ATAi = nullptr
protected

Definition at line 1464 of file fvcartesiansolverxd.h.

◆ m_averageDir

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_averageDir
protected

Definition at line 1809 of file fvcartesiansolverxd.h.

◆ m_averagePos

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::m_averagePos
protected

Definition at line 1808 of file fvcartesiansolverxd.h.

◆ m_averageReconstructNut

template<MInt nDim_, class SysEqn >
std::vector<MBool> FvCartesianSolverXD< nDim_, SysEqn >::m_averageReconstructNut
protected

Definition at line 1810 of file fvcartesiansolverxd.h.

◆ m_averageSpeedOfSound

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_averageSpeedOfSound = false
protected

Definition at line 2070 of file fvcartesiansolverxd.h.

◆ m_averageStartTimeStep

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_averageStartTimeStep = 0
protected

Definition at line 1815 of file fvcartesiansolverxd.h.

◆ m_averageVorticity

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_averageVorticity = false
protected

Definition at line 2068 of file fvcartesiansolverxd.h.

◆ m_azimuthalAngle

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalAngle
protected

Definition at line 1491 of file fvcartesiansolverxd.h.

◆ m_azimuthalBndrySide

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalBndrySide
protected

Definition at line 1485 of file fvcartesiansolverxd.h.

◆ m_azimuthalCutRecCoord

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalCutRecCoord
protected

Definition at line 1486 of file fvcartesiansolverxd.h.

◆ m_azimuthalHaloActive

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalHaloActive
protected

Definition at line 1488 of file fvcartesiansolverxd.h.

◆ m_azimuthalMaxLevelHaloCells

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalMaxLevelHaloCells
protected

Definition at line 1472 of file fvcartesiansolverxd.h.

◆ m_azimuthalMaxLevelWindowCells

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalMaxLevelWindowCells
protected

Definition at line 1473 of file fvcartesiansolverxd.h.

◆ m_azimuthalMaxLevelWindowMap

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalMaxLevelWindowMap
protected

Definition at line 1487 of file fvcartesiansolverxd.h.

◆ m_azimuthalNearBndryInit

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalNearBndryInit = false
protected

Definition at line 1479 of file fvcartesiansolverxd.h.

◆ m_azimuthalNearBoundaryBackupMaxCount

template<MInt nDim_, class SysEqn >
const MInt FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalNearBoundaryBackupMaxCount
protected
Initial value:
=
8

Definition at line 1489 of file fvcartesiansolverxd.h.

◆ m_azimuthalRecConsts

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalRecConsts
protected

Definition at line 1483 of file fvcartesiansolverxd.h.

◆ m_azimuthalRecConstSet

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalRecConstSet = false
protected

Definition at line 1478 of file fvcartesiansolverxd.h.

◆ m_azimuthalReconstNghbrIds

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalReconstNghbrIds
protected

Definition at line 1484 of file fvcartesiansolverxd.h.

◆ m_azimuthalRemappedHaloCells

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalRemappedHaloCells
protected

Definition at line 1474 of file fvcartesiansolverxd.h.

◆ m_azimuthalRemappedNeighborDomains

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalRemappedNeighborDomains
protected

Definition at line 1476 of file fvcartesiansolverxd.h.

◆ m_azimuthalRemappedNeighborsDomainIndex

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalRemappedNeighborsDomainIndex
protected

Definition at line 1477 of file fvcartesiansolverxd.h.

◆ m_azimuthalRemappedWindowCells

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_azimuthalRemappedWindowCells
protected

Definition at line 1475 of file fvcartesiansolverxd.h.

◆ m_bc7909RANSSolverType

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::m_bc7909RANSSolverType
protected

Definition at line 1822 of file fvcartesiansolverxd.h.

◆ m_bndryCells

template<MInt nDim_, class SysEqn >
Collector<FvBndryCell<nDim, SysEqn> >* FvCartesianSolverXD< nDim_, SysEqn >::m_bndryCells = nullptr
protected

Definition at line 2314 of file fvcartesiansolverxd.h.

◆ m_bndryCellSurfacesOffset

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_bndryCellSurfacesOffset
protected

Definition at line 1693 of file fvcartesiansolverxd.h.

◆ m_bndryGhostCellsOffset

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_bndryGhostCellsOffset
protected

Definition at line 1704 of file fvcartesiansolverxd.h.

◆ m_bndryLevelJumps

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_bndryLevelJumps = false

Definition at line 1373 of file fvcartesiansolverxd.h.

◆ m_bndryRfnJumpInformation

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_bndryRfnJumpInformation = nullptr
protected

Definition at line 1440 of file fvcartesiansolverxd.h.

◆ m_bndryRfnJumpInformation_

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_bndryRfnJumpInformation_ = nullptr
protected

Definition at line 1441 of file fvcartesiansolverxd.h.

◆ m_bndrySurfacesOffset

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_bndrySurfacesOffset
protected

Definition at line 1694 of file fvcartesiansolverxd.h.

◆ m_bodyAcceleration

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_bodyAcceleration = nullptr

Definition at line 2252 of file fvcartesiansolverxd.h.

◆ m_bodyAngularAcceleration

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_bodyAngularAcceleration = nullptr

Definition at line 2254 of file fvcartesiansolverxd.h.

◆ m_bodyAngularVelocity

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_bodyAngularVelocity = nullptr

Definition at line 2253 of file fvcartesiansolverxd.h.

◆ m_bodyCenter

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_bodyCenter = nullptr

Definition at line 2248 of file fvcartesiansolverxd.h.

◆ m_bodyHeatFlux

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_bodyHeatFlux = nullptr

Definition at line 2257 of file fvcartesiansolverxd.h.

◆ m_bodyIdOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_bodyIdOutput
protected

Definition at line 1660 of file fvcartesiansolverxd.h.

◆ m_bodyTemperature

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_bodyTemperature = nullptr

Definition at line 2255 of file fvcartesiansolverxd.h.

◆ m_bodyTemperatureDt1

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_bodyTemperatureDt1 = nullptr

Definition at line 2256 of file fvcartesiansolverxd.h.

◆ m_bodyVelocity

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_bodyVelocity = nullptr

Definition at line 2249 of file fvcartesiansolverxd.h.

◆ m_bodyVelocityDt1

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_bodyVelocityDt1 = nullptr

Definition at line 2250 of file fvcartesiansolverxd.h.

◆ m_bodyVelocityDt2

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_bodyVelocityDt2 = nullptr

Definition at line 2251 of file fvcartesiansolverxd.h.

◆ m_burntUnburntTemperatureRatio

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_burntUnburntTemperatureRatio
protected

Definition at line 1514 of file fvcartesiansolverxd.h.

◆ m_burntUnburntTemperatureRatioEnd

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_burntUnburntTemperatureRatioEnd
protected

Definition at line 1515 of file fvcartesiansolverxd.h.

◆ m_burntUnburntTemperatureRatioStart

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_burntUnburntTemperatureRatioStart
protected

Definition at line 1516 of file fvcartesiansolverxd.h.

◆ m_c0

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_c0
protected

Definition at line 1570 of file fvcartesiansolverxd.h.

◆ m_calcLESAverage

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_calcLESAverage = false
protected

Definition at line 1813 of file fvcartesiansolverxd.h.

◆ m_calcSlopesAfterStep

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_calcSlopesAfterStep = false
protected

Definition at line 2054 of file fvcartesiansolverxd.h.

◆ m_canteraKinetics

template<MInt nDim_, class SysEqn >
std::shared_ptr<Cantera::Kinetics> FvCartesianSolverXD< nDim_, SysEqn >::m_canteraKinetics

Definition at line 1175 of file fvcartesiansolverxd.h.

◆ m_canteraSolution

template<MInt nDim_, class SysEqn >
std::shared_ptr<Cantera::Solution> FvCartesianSolverXD< nDim_, SysEqn >::m_canteraSolution

Definition at line 1173 of file fvcartesiansolverxd.h.

◆ m_canteraThermo

template<MInt nDim_, class SysEqn >
std::shared_ptr<Cantera::ThermoPhase> FvCartesianSolverXD< nDim_, SysEqn >::m_canteraThermo

Definition at line 1174 of file fvcartesiansolverxd.h.

◆ m_canteraTransport

template<MInt nDim_, class SysEqn >
std::shared_ptr<Cantera::Transport> FvCartesianSolverXD< nDim_, SysEqn >::m_canteraTransport

Definition at line 1176 of file fvcartesiansolverxd.h.

◆ m_cellInterpolationIds

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_cellInterpolationIds {}
protected

Definition at line 2977 of file fvcartesiansolverxd.h.

◆ m_cellInterpolationIndex

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_cellInterpolationIndex {}
protected

Definition at line 2975 of file fvcartesiansolverxd.h.

◆ m_cellInterpolationMatrix

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MFloat> > FvCartesianSolverXD< nDim_, SysEqn >::m_cellInterpolationMatrix {}
protected

Definition at line 2976 of file fvcartesiansolverxd.h.

◆ m_cells

template<MInt nDim_, class SysEqn >
maia::fv::collector::FvCellCollector<nDim> FvCartesianSolverXD< nDim_, SysEqn >::m_cells
protected

Definition at line 1421 of file fvcartesiansolverxd.h.

◆ m_cellsInsideSpongeLayer

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_cellsInsideSpongeLayer = nullptr
protected

Definition at line 1446 of file fvcartesiansolverxd.h.

◆ m_cellSurfaceMapping

template<MInt nDim_, class SysEqn >
MInt** FvCartesianSolverXD< nDim_, SysEqn >::m_cellSurfaceMapping = nullptr
protected

Definition at line 2032 of file fvcartesiansolverxd.h.

◆ m_cellToNghbrHood

template<MInt nDim_, class SysEqn >
std::map<MInt, std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_cellToNghbrHood

Definition at line 3005 of file fvcartesiansolverxd.h.

◆ m_cellToRecordData

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_cellToRecordData
protected

Definition at line 1695 of file fvcartesiansolverxd.h.

◆ m_cfl

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_cfl
protected

Definition at line 1980 of file fvcartesiansolverxd.h.

◆ m_cflViscous

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_cflViscous
protected

Definition at line 1981 of file fvcartesiansolverxd.h.

◆ m_changeMa

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_changeMa
protected

Definition at line 2000 of file fvcartesiansolverxd.h.

◆ m_channelVolumeForce

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_channelVolumeForce
protected

Definition at line 1968 of file fvcartesiansolverxd.h.

◆ m_checkCellSurfaces

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_checkCellSurfaces
protected

Definition at line 1688 of file fvcartesiansolverxd.h.

◆ m_chevron

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_chevron = false
protected

Definition at line 1551 of file fvcartesiansolverxd.h.

◆ m_chi

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_chi
protected

Definition at line 1974 of file fvcartesiansolverxd.h.

◆ m_closeGaps

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_closeGaps = false

Definition at line 2283 of file fvcartesiansolverxd.h.

◆ m_combustion

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_combustion = false
protected

Definition at line 1619 of file fvcartesiansolverxd.h.

◆ m_comm_wm

template<MInt nDim_, class SysEqn >
MPI_Comm FvCartesianSolverXD< nDim_, SysEqn >::m_comm_wm
protected

Definition at line 1885 of file fvcartesiansolverxd.h.

◆ m_computeExtVel

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_computeExtVel {}
protected

Definition at line 2323 of file fvcartesiansolverxd.h.

◆ m_computeViscousFlux

template<MInt nDim_, class SysEqn >
void(FvCartesianSolverXD::* FvCartesianSolverXD< nDim_, SysEqn >::m_computeViscousFlux) ()

Definition at line 2939 of file fvcartesiansolverxd.h.

◆ m_computeViscousFluxMultiSpecies

template<MInt nDim_, class SysEqn >
void(FvCartesianSolverXD::* FvCartesianSolverXD< nDim_, SysEqn >::m_computeViscousFluxMultiSpecies) (MInt)

Definition at line 2941 of file fvcartesiansolverxd.h.

◆ m_confinedFlame

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_confinedFlame
protected

Definition at line 2327 of file fvcartesiansolverxd.h.

◆ m_considerRotForces

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_considerRotForces = false
protected

Definition at line 1690 of file fvcartesiansolverxd.h.

◆ m_considerVolumeForces

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_considerVolumeForces
protected

Definition at line 1689 of file fvcartesiansolverxd.h.

◆ m_constantFlameSpeed

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_constantFlameSpeed
protected

Definition at line 2332 of file fvcartesiansolverxd.h.

◆ m_constructGField

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_constructGField {}

Definition at line 1366 of file fvcartesiansolverxd.h.

◆ m_convergenceCriterion

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_convergenceCriterion
protected

Definition at line 1982 of file fvcartesiansolverxd.h.

◆ m_coordSpongeIn

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_coordSpongeIn {}

Definition at line 3001 of file fvcartesiansolverxd.h.

◆ m_coordSpongeOut

template<MInt nDim_, class SysEqn >
MFloat * FvCartesianSolverXD< nDim_, SysEqn >::m_coordSpongeOut {}

Definition at line 3001 of file fvcartesiansolverxd.h.

◆ m_counterCx

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_counterCx
protected

Definition at line 1696 of file fvcartesiansolverxd.h.

◆ m_createSpongeBoundary

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_createSpongeBoundary
protected

Definition at line 2012 of file fvcartesiansolverxd.h.

◆ m_currentGridFileName

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::m_currentGridFileName
protected

Definition at line 1636 of file fvcartesiansolverxd.h.

◆ m_curvatureG

template<MInt nDim_, class SysEqn >
std::vector<MFloat>* FvCartesianSolverXD< nDim_, SysEqn >::m_curvatureG = nullptr
protected

Definition at line 1630 of file fvcartesiansolverxd.h.

◆ m_cutOffInterface

template<MInt nDim_, class SysEqn >
std::set<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_cutOffInterface
protected

Definition at line 1459 of file fvcartesiansolverxd.h.

◆ m_Da

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_Da
protected

Definition at line 2335 of file fvcartesiansolverxd.h.

◆ m_dampFactor

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::m_dampFactor
protected

Definition at line 1505 of file fvcartesiansolverxd.h.

◆ m_dampingDistanceFlameBase

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_dampingDistanceFlameBase
protected

Definition at line 1587 of file fvcartesiansolverxd.h.

◆ m_dampingDistanceFlameBaseExtVel

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_dampingDistanceFlameBaseExtVel
protected

Definition at line 1588 of file fvcartesiansolverxd.h.

◆ m_dataBlockSize

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_dataBlockSize = -1
protected

Definition at line 2221 of file fvcartesiansolverxd.h.

◆ m_deleteNeighbour

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_deleteNeighbour = false

Definition at line 1367 of file fvcartesiansolverxd.h.

◆ m_deltaP

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_deltaP
protected

Definition at line 1983 of file fvcartesiansolverxd.h.

◆ m_deltaPL

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_deltaPL
protected

Definition at line 1984 of file fvcartesiansolverxd.h.

◆ m_deltaXtemperatureProfile

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_deltaXtemperatureProfile
protected

Definition at line 1600 of file fvcartesiansolverxd.h.

◆ m_deltaYtemperatureProfile

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_deltaYtemperatureProfile
protected

Definition at line 1601 of file fvcartesiansolverxd.h.

◆ m_densityRatio

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_densityRatio
protected

Definition at line 1536 of file fvcartesiansolverxd.h.

◆ 

struct { ... } FvCartesianSolverXD< nDim_, SysEqn >::m_detChem

◆ m_detChemExtendedOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_detChemExtendedOutput

Definition at line 1188 of file fvcartesiansolverxd.h.

◆ m_DInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_DInfinity
protected

Definition at line 2467 of file fvcartesiansolverxd.h.

◆ m_divergenceTreatment

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_divergenceTreatment
protected

Definition at line 2330 of file fvcartesiansolverxd.h.

◆ m_domainBoundaries

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_domainBoundaries = nullptr
protected

Definition at line 1612 of file fvcartesiansolverxd.h.

◆ m_domainIdOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_domainIdOutput = false
protected

Definition at line 1663 of file fvcartesiansolverxd.h.

◆ m_dragOutputInterval

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_dragOutputInterval
protected

Definition at line 1697 of file fvcartesiansolverxd.h.

◆ m_DthInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_DthInfinity
protected

Definition at line 2463 of file fvcartesiansolverxd.h.

◆ m_dualTimeStepping

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_dualTimeStepping
protected

Definition at line 1702 of file fvcartesiansolverxd.h.

◆ 

struct { ... } FvCartesianSolverXD< nDim_, SysEqn >::m_EEGas

◆ m_engineSetup

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_engineSetup = false

Definition at line 1384 of file fvcartesiansolverxd.h.

◆ m_enhanceThreePointViscFluxFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_enhanceThreePointViscFluxFactor = 0.1
protected

Definition at line 2320 of file fvcartesiansolverxd.h.

◆ m_eps

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_eps

Definition at line 206 of file fvcartesiansolverxd.h.

◆ m_euler

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_euler
protected

Definition at line 1703 of file fvcartesiansolverxd.h.

◆ m_externalSource

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_externalSource = nullptr
protected

Definition at line 2048 of file fvcartesiansolverxd.h.

◆ m_externalSourceDt1

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_externalSourceDt1 = nullptr
protected

Definition at line 2049 of file fvcartesiansolverxd.h.

◆ m_extractedCells

template<MInt nDim_, class SysEqn >
Collector<PointBasedCell<nDim> >* FvCartesianSolverXD< nDim_, SysEqn >::m_extractedCells = nullptr

[Splitt] The following is part of a first step to splitt CartesianGrid from the inheritance hierarchy:

  • in order to avoid renaming a lot of access to CartesianGrid data members, references are introduced:

    Todo:
    labels:FV,toremove this references will be removed in future commits

Definition at line 1394 of file fvcartesiansolverxd.h.

◆ m_filterFlameTubeEdges

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_filterFlameTubeEdges
protected

Definition at line 2328 of file fvcartesiansolverxd.h.

◆ m_filterFlameTubeEdgesDistance

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_filterFlameTubeEdgesDistance
protected

Definition at line 2329 of file fvcartesiansolverxd.h.

◆ m_firstUseInitializeVtkXmlOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_firstUseInitializeVtkXmlOutput = true
private

Definition at line 2591 of file fvcartesiansolverxd.h.

◆ m_firstUseUpdateSpongeLayerCase51

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_firstUseUpdateSpongeLayerCase51 = true

Definition at line 2988 of file fvcartesiansolverxd.h.

◆ m_firstUseWriteVtuOutputParallelGeom

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_firstUseWriteVtuOutputParallelGeom = true
private

Definition at line 2590 of file fvcartesiansolverxd.h.

◆ m_firstUseWriteVtuOutputParallelQout

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_firstUseWriteVtuOutputParallelQout = true
private

Definition at line 2589 of file fvcartesiansolverxd.h.

◆ m_flameOutletAreaRatio

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_flameOutletAreaRatio
protected

Definition at line 1584 of file fvcartesiansolverxd.h.

◆ m_flameRadiusOffset

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_flameRadiusOffset
protected

Definition at line 1603 of file fvcartesiansolverxd.h.

◆ m_flameSpeed

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_flameSpeed {}
protected

Definition at line 2333 of file fvcartesiansolverxd.h.

◆ m_flameSpeedG

template<MInt nDim_, class SysEqn >
std::vector<MFloat>* FvCartesianSolverXD< nDim_, SysEqn >::m_flameSpeedG = nullptr
protected

Definition at line 1631 of file fvcartesiansolverxd.h.

◆ m_flameStrouhal

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_flameStrouhal
protected

Definition at line 2348 of file fvcartesiansolverxd.h.

◆ m_fMolarMass

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_fMolarMass

Definition at line 1184 of file fvcartesiansolverxd.h.

◆ m_FmolecularWeight

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_FmolecularWeight = nullptr
protected

Definition at line 1518 of file fvcartesiansolverxd.h.

◆ m_force1DFiltering

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_force1DFiltering
protected

Definition at line 1640 of file fvcartesiansolverxd.h.

◆ m_forceAdaptation

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_forceAdaptation = false
private

Definition at line 1359 of file fvcartesiansolverxd.h.

◆ m_forceCoefficient

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_forceCoefficient = 0.0
protected

Definition at line 1535 of file fvcartesiansolverxd.h.

◆ m_forceNoTimeSteps

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_forceNoTimeSteps
protected

Definition at line 1720 of file fvcartesiansolverxd.h.

◆ m_forceRestartGrid

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_forceRestartGrid
protected

Definition at line 1639 of file fvcartesiansolverxd.h.

◆ m_forcing

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_forcing
protected

Definition at line 2356 of file fvcartesiansolverxd.h.

◆ m_forcingAmplitude

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_forcingAmplitude
protected

Definition at line 2357 of file fvcartesiansolverxd.h.

◆ m_formationEnthalpy

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_formationEnthalpy = nullptr
protected

Definition at line 1520 of file fvcartesiansolverxd.h.

◆ m_fvBndryCnd

template<MInt nDim_, class SysEqn >
FvBndryCndXD<nDim_, SysEqn>* FvCartesianSolverXD< nDim_, SysEqn >::m_fvBndryCnd

Definition at line 313 of file fvcartesiansolverxd.h.

◆ m_gamma

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_gamma = NAN
protected

Definition at line 1985 of file fvcartesiansolverxd.h.

◆ m_gapCellId

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_gapCellId

Definition at line 2286 of file fvcartesiansolverxd.h.

◆ m_gapCells

template<MInt nDim_, class SysEqn >
std::vector<FvGapCell> FvCartesianSolverXD< nDim_, SysEqn >::m_gapCells

Definition at line 2287 of file fvcartesiansolverxd.h.

◆ m_gapInitMethod

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_gapInitMethod = 2

Definition at line 2284 of file fvcartesiansolverxd.h.

◆ m_gasConstant

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_gasConstant
protected

Definition at line 1509 of file fvcartesiansolverxd.h.

◆ m_geometry

template<MInt nDim_, class SysEqn >
Geometry<nDim>* FvCartesianSolverXD< nDim_, SysEqn >::m_geometry

Definition at line 205 of file fvcartesiansolverxd.h.

◆ m_globalBcStgLocationsG

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_globalBcStgLocationsG = nullptr
protected

Definition at line 1859 of file fvcartesiansolverxd.h.

◆ m_globalNoPeriodicExchangeCells

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_globalNoPeriodicExchangeCells = nullptr
protected

Definition at line 1855 of file fvcartesiansolverxd.h.

◆ m_globalNoSpongeLocations

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_globalNoSpongeLocations = 0
protected

Definition at line 1854 of file fvcartesiansolverxd.h.

◆ m_globalSpongeLocations

template<MInt nDim_, class SysEqn >
std::vector<std::pair<MFloat, MFloat> > FvCartesianSolverXD< nDim_, SysEqn >::m_globalSpongeLocations
protected

Definition at line 1861 of file fvcartesiansolverxd.h.

◆ m_globalUpwindCoefficient

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_globalUpwindCoefficient
protected

Definition at line 1986 of file fvcartesiansolverxd.h.

◆ m_gridConvergence

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_gridConvergence
protected

Definition at line 1641 of file fvcartesiansolverxd.h.

◆ m_gridInterfaceFilter

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_gridInterfaceFilter
protected

Definition at line 1642 of file fvcartesiansolverxd.h.

◆ m_gridPoints

template<MInt nDim_, class SysEqn >
Collector<CartesianGridPoint<nDim> >* FvCartesianSolverXD< nDim_, SysEqn >::m_gridPoints = nullptr

Definition at line 1395 of file fvcartesiansolverxd.h.

◆ m_hasCellsInSpongeLayer

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_hasCellsInSpongeLayer {}

Definition at line 2999 of file fvcartesiansolverxd.h.

◆ m_hasExternalSource

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_hasExternalSource = false
protected

Definition at line 2051 of file fvcartesiansolverxd.h.

◆ m_heatRelease

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_heatRelease = nullptr
protected

Definition at line 1502 of file fvcartesiansolverxd.h.

◆ m_heatReleaseDamp

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_heatReleaseDamp
protected

Definition at line 1644 of file fvcartesiansolverxd.h.

◆ m_heatReleaseReductionFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_heatReleaseReductionFactor
protected

Definition at line 1512 of file fvcartesiansolverxd.h.

◆ m_hInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_hInfinity
protected

Definition at line 1508 of file fvcartesiansolverxd.h.

◆ m_identNghbrIds

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_identNghbrIds = nullptr
protected

Definition at line 1785 of file fvcartesiansolverxd.h.

◆ m_inflowTemperatureRatio

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_inflowTemperatureRatio
protected

Definition at line 1987 of file fvcartesiansolverxd.h.

◆ m_initialCondition

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_initialCondition
protected

Definition at line 1705 of file fvcartesiansolverxd.h.

◆ m_initialFlameHeight

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_initialFlameHeight
protected

Definition at line 1595 of file fvcartesiansolverxd.h.

◆ m_inletOutletAreaRatio

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_inletOutletAreaRatio
protected

Definition at line 1585 of file fvcartesiansolverxd.h.

◆ m_inletRadius

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_inletRadius = -1.0
protected

Definition at line 1552 of file fvcartesiansolverxd.h.

◆ m_inletTubeAreaRatio

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_inletTubeAreaRatio
protected

Definition at line 1583 of file fvcartesiansolverxd.h.

◆ m_integralAmplitude

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_integralAmplitude
protected

Definition at line 1607 of file fvcartesiansolverxd.h.

◆ m_integralLengthScale

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_integralLengthScale
protected

Definition at line 1608 of file fvcartesiansolverxd.h.

◆ m_integratedHeatReleaseOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_integratedHeatReleaseOutput
protected

Definition at line 1699 of file fvcartesiansolverxd.h.

◆ m_integratedHeatReleaseOutputInterval

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_integratedHeatReleaseOutputInterval
protected

Definition at line 1700 of file fvcartesiansolverxd.h.

◆ m_internalBodyId

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_internalBodyId = nullptr

Definition at line 2262 of file fvcartesiansolverxd.h.

◆ m_interpolationMatrices

template<MInt nDim_, class SysEqn >
std::vector<MFloatTensor> FvCartesianSolverXD< nDim_, SysEqn >::m_interpolationMatrices
protected

Definition at line 1928 of file fvcartesiansolverxd.h.

◆ m_interpolationPosition

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_interpolationPosition
protected

Definition at line 1929 of file fvcartesiansolverxd.h.

◆ m_isActiveOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_isActiveOutput
protected

Definition at line 1662 of file fvcartesiansolverxd.h.

◆ m_isEEGas

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_isEEGas = false
protected

Definition at line 1732 of file fvcartesiansolverxd.h.

◆ m_isInitSamplingVars

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_isInitSamplingVars = false

Definition at line 1191 of file fvcartesiansolverxd.h.

◆ m_isLowestSecondary

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_isLowestSecondary = false
protected

Stores whether this solver is the lowest secondart solver (i.e., is has the coarsest mesh) of a multilevel computation

Definition at line 2061 of file fvcartesiansolverxd.h.

◆ m_isMultilevelPrimary

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_isMultilevelPrimary = false
protected

Definition at line 2058 of file fvcartesiansolverxd.h.

◆ m_jet

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_jet = false
protected

Definition at line 1525 of file fvcartesiansolverxd.h.

◆ m_jetCoflowEndOffset

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_jetCoflowEndOffset
protected

Definition at line 1531 of file fvcartesiansolverxd.h.

◆ m_jetCoflowOffset

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_jetCoflowOffset
protected

Definition at line 1530 of file fvcartesiansolverxd.h.

◆ m_jetConst

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_jetConst = nullptr
protected

Definition at line 1534 of file fvcartesiansolverxd.h.

◆ m_jetDensity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_jetDensity = -1
protected

Definition at line 1540 of file fvcartesiansolverxd.h.

◆ m_jetForcing

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_jetForcing = false
protected

Definition at line 1526 of file fvcartesiansolverxd.h.

◆ m_jetForcingPosition

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_jetForcingPosition
protected

Definition at line 1527 of file fvcartesiansolverxd.h.

◆ m_jetHalfLength

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_jetHalfLength
protected

Definition at line 1532 of file fvcartesiansolverxd.h.

◆ m_jetHalfWidth

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_jetHalfWidth
protected

Definition at line 1529 of file fvcartesiansolverxd.h.

◆ m_jetHeight

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_jetHeight = 0.5
protected

Definition at line 1542 of file fvcartesiansolverxd.h.

◆ m_jetPressure

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_jetPressure = -1
protected

Definition at line 1541 of file fvcartesiansolverxd.h.

◆ m_jetRandomSeed

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_jetRandomSeed
protected

Definition at line 1528 of file fvcartesiansolverxd.h.

◆ m_jetTemperature

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_jetTemperature = -1
protected

Definition at line 1539 of file fvcartesiansolverxd.h.

◆ m_jetType

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_jetType
protected

Definition at line 1548 of file fvcartesiansolverxd.h.

◆ m_kInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_kInfinity
protected

Definition at line 2465 of file fvcartesiansolverxd.h.

◆ m_kInfinityFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_kInfinityFactor
protected

Definition at line 1865 of file fvcartesiansolverxd.h.

◆ m_kronecker

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_kronecker = nullptr
protected

Definition at line 1988 of file fvcartesiansolverxd.h.

◆ m_kurtosis

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_kurtosis {}
protected

Definition at line 2072 of file fvcartesiansolverxd.h.

◆ m_lambdaPerturbation

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_lambdaPerturbation
protected

Definition at line 2360 of file fvcartesiansolverxd.h.

◆ m_laminarFlameThickness

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_laminarFlameThickness
protected

Definition at line 1571 of file fvcartesiansolverxd.h.

◆ m_lastAdapTS

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_lastAdapTS = 0
private

Definition at line 1360 of file fvcartesiansolverxd.h.

◆ m_LESAverageCells

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_LESAverageCells
protected

Definition at line 1806 of file fvcartesiansolverxd.h.

◆ m_LESNoVarAverage

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_LESNoVarAverage = 0
protected

Definition at line 1807 of file fvcartesiansolverxd.h.

◆ m_LESPeriodicAverage

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_LESPeriodicAverage = nullptr
protected

Definition at line 1844 of file fvcartesiansolverxd.h.

◆ m_LESValues

template<MInt nDim_, class SysEqn >
std::vector<MFloat>* FvCartesianSolverXD< nDim_, SysEqn >::m_LESValues = nullptr
protected

Definition at line 1801 of file fvcartesiansolverxd.h.

◆ m_LESVarAverage

template<MInt nDim_, class SysEqn >
std::vector<MFloat>* FvCartesianSolverXD< nDim_, SysEqn >::m_LESVarAverage = nullptr
protected

Definition at line 1804 of file fvcartesiansolverxd.h.

◆ m_LESVarAverageBal

template<MInt nDim_, class SysEqn >
std::vector<MFloat>* FvCartesianSolverXD< nDim_, SysEqn >::m_LESVarAverageBal = nullptr
protected

Definition at line 1805 of file fvcartesiansolverxd.h.

◆ m_levelSet

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_levelSet = false
protected

Definition at line 1615 of file fvcartesiansolverxd.h.

◆ m_levelSetAdaptationScheme

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_levelSetAdaptationScheme = 0

Definition at line 2263 of file fvcartesiansolverxd.h.

◆ m_levelSetMb

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_levelSetMb = false
protected

Definition at line 1616 of file fvcartesiansolverxd.h.

◆ m_levelSetOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_levelSetOutput
protected

Definition at line 1661 of file fvcartesiansolverxd.h.

◆ m_levelSetRans

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_levelSetRans = false
protected

Definition at line 1618 of file fvcartesiansolverxd.h.

◆ m_levelSetValues

template<MInt nDim_, class SysEqn >
std::vector<MFloat>* FvCartesianSolverXD< nDim_, SysEqn >::m_levelSetValues = nullptr
protected

Definition at line 1625 of file fvcartesiansolverxd.h.

◆ m_levelSetValuesMb

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_levelSetValuesMb = nullptr
protected

Definition at line 1626 of file fvcartesiansolverxd.h.

◆ m_limitedSlopesVar

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_limitedSlopesVar = nullptr
protected

Definition at line 2322 of file fvcartesiansolverxd.h.

◆ m_limiter

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_limiter
protected

Definition at line 1706 of file fvcartesiansolverxd.h.

◆ m_limitWeights

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_limitWeights = false
protected

Definition at line 2426 of file fvcartesiansolverxd.h.

◆ m_limPhi

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_limPhi = nullptr
protected

Definition at line 1504 of file fvcartesiansolverxd.h.

◆ m_linerLvlJump

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_linerLvlJump = false

Definition at line 3008 of file fvcartesiansolverxd.h.

◆ m_loadBalancingReinitStage

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_loadBalancingReinitStage = -1
protected

Definition at line 2420 of file fvcartesiansolverxd.h.

◆ m_loadSampleVariables

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_loadSampleVariables = false
protected

Definition at line 2042 of file fvcartesiansolverxd.h.

◆ m_localTS

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_localTS = false

Definition at line 1198 of file fvcartesiansolverxd.h.

◆ m_lsCutCellBaseLevel

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_lsCutCellBaseLevel

Definition at line 1374 of file fvcartesiansolverxd.h.

◆ m_LsRotate

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_LsRotate = false
protected

Definition at line 1617 of file fvcartesiansolverxd.h.

◆ m_LSSolver

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_LSSolver
protected

Definition at line 1621 of file fvcartesiansolverxd.h.

◆ m_MaCg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_MaCg
protected

Definition at line 1431 of file fvcartesiansolverxd.h.

◆ m_MaCoflow

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_MaCoflow
protected

Definition at line 1538 of file fvcartesiansolverxd.h.

◆ m_MaFlameTube

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_MaFlameTube
protected

Definition at line 1575 of file fvcartesiansolverxd.h.

◆ m_MaHg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_MaHg
protected

Definition at line 1424 of file fvcartesiansolverxd.h.

◆ m_maNozzleExit

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_maNozzleExit = -1.0
protected

Definition at line 1555 of file fvcartesiansolverxd.h.

◆ m_maNozzleInlet

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_maNozzleInlet = -1.0
protected

Definition at line 1563 of file fvcartesiansolverxd.h.

◆ m_marksteinLength

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_marksteinLength
protected

Definition at line 2362 of file fvcartesiansolverxd.h.

◆ m_marksteinLengthPercentage

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_marksteinLengthPercentage
protected

Definition at line 2363 of file fvcartesiansolverxd.h.

◆ m_marksteinLengthTh

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_marksteinLengthTh
protected

Definition at line 2365 of file fvcartesiansolverxd.h.

◆ m_maRot

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_maRot = F0
protected

Definition at line 1423 of file fvcartesiansolverxd.h.

◆ m_massConsumption

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_massConsumption
protected

Definition at line 1989 of file fvcartesiansolverxd.h.

◆ m_massFlux

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_massFlux
protected

Definition at line 2324 of file fvcartesiansolverxd.h.

◆ m_masterCellIds

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_masterCellIds = nullptr
protected

Definition at line 1449 of file fvcartesiansolverxd.h.

◆ m_maxIterations

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_maxIterations
protected

Definition at line 1712 of file fvcartesiansolverxd.h.

◆ m_maxLevelBeforeAdaptation

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_maxLevelBeforeAdaptation = -1
protected

Definition at line 2064 of file fvcartesiansolverxd.h.

◆ m_maxLevelHaloCells

template<MInt nDim_, class SysEqn >
MInt** FvCartesianSolverXD< nDim_, SysEqn >::m_maxLevelHaloCells = nullptr
protected

Definition at line 1452 of file fvcartesiansolverxd.h.

◆ m_maxLevelWindowCells

template<MInt nDim_, class SysEqn >
MInt** FvCartesianSolverXD< nDim_, SysEqn >::m_maxLevelWindowCells = nullptr
protected

Definition at line 1450 of file fvcartesiansolverxd.h.

◆ m_maxLsValue

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_maxLsValue = -99

Definition at line 3007 of file fvcartesiansolverxd.h.

◆ m_maxLvlMpiRecvNeighbor

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_maxLvlMpiRecvNeighbor {}

Definition at line 3072 of file fvcartesiansolverxd.h.

◆ m_maxLvlMpiSendNeighbor

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_maxLvlMpiSendNeighbor {}

Definition at line 3071 of file fvcartesiansolverxd.h.

◆ m_maxNearestBodies

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_maxNearestBodies = 20
protected

Definition at line 2693 of file fvcartesiansolverxd.h.

◆ m_maxNoAzimuthalRecConst

template<MInt nDim_, class SysEqn >
const MInt FvCartesianSolverXD< nDim_, SysEqn >::m_maxNoAzimuthalRecConst = 250
protected

Definition at line 1480 of file fvcartesiansolverxd.h.

◆ m_maxNoSurfaces

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_maxNoSurfaces
protected

Definition at line 1708 of file fvcartesiansolverxd.h.

◆ m_maxNoTimeSteps

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_maxNoTimeSteps
protected

Definition at line 1707 of file fvcartesiansolverxd.h.

◆ m_maxReactionRate

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_maxReactionRate
protected

Definition at line 1573 of file fvcartesiansolverxd.h.

◆ m_maxTemp

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_maxTemp
protected

Definition at line 1990 of file fvcartesiansolverxd.h.

◆ m_meanCoord

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_meanCoord[3] {}

Definition at line 2980 of file fvcartesiansolverxd.h.

◆ m_meanPressure

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_meanPressure
protected

Definition at line 1991 of file fvcartesiansolverxd.h.

◆ m_meanVelocity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_meanVelocity
protected

Definition at line 2341 of file fvcartesiansolverxd.h.

◆ m_meanVelocityOutlet

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_meanVelocityOutlet
protected

Definition at line 2342 of file fvcartesiansolverxd.h.

◆ m_meanY

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_meanY
protected

Definition at line 1992 of file fvcartesiansolverxd.h.

◆ m_modelCheck

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_modelCheck
protected

Definition at line 1646 of file fvcartesiansolverxd.h.

◆ m_modeNumbers

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_modeNumbers
protected

Definition at line 1545 of file fvcartesiansolverxd.h.

◆ m_molarFormationEnthalpy

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_molarFormationEnthalpy = nullptr
protected

Definition at line 1519 of file fvcartesiansolverxd.h.

◆ m_molarMass

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_molarMass

Definition at line 1183 of file fvcartesiansolverxd.h.

◆ m_molecularWeight

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_molecularWeight = nullptr
protected

Definition at line 1517 of file fvcartesiansolverxd.h.

◆ m_momentumThickness

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_momentumThickness = 0.0
protected

Definition at line 1547 of file fvcartesiansolverxd.h.

◆ m_movingAvgInterval

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_movingAvgInterval = 0
protected

Definition at line 2069 of file fvcartesiansolverxd.h.

◆ m_mpi_receiveRequest

template<MInt nDim_, class SysEqn >
MPI_Request* FvCartesianSolverXD< nDim_, SysEqn >::m_mpi_receiveRequest = nullptr
protected

Definition at line 2228 of file fvcartesiansolverxd.h.

◆ m_mpi_request

template<MInt nDim_, class SysEqn >
MPI_Request* FvCartesianSolverXD< nDim_, SysEqn >::m_mpi_request = nullptr
protected

Definition at line 2226 of file fvcartesiansolverxd.h.

◆ m_mpi_sendRequest

template<MInt nDim_, class SysEqn >
MPI_Request* FvCartesianSolverXD< nDim_, SysEqn >::m_mpi_sendRequest = nullptr
protected

Definition at line 2227 of file fvcartesiansolverxd.h.

◆ m_mpi_wmRecvReq

template<MInt nDim_, class SysEqn >
MPI_Request* FvCartesianSolverXD< nDim_, SysEqn >::m_mpi_wmRecvReq = nullptr
protected

Definition at line 1897 of file fvcartesiansolverxd.h.

◆ m_mpi_wmRequest

template<MInt nDim_, class SysEqn >
MPI_Request* FvCartesianSolverXD< nDim_, SysEqn >::m_mpi_wmRequest = nullptr
protected

Definition at line 1895 of file fvcartesiansolverxd.h.

◆ m_mpi_wmSendReq

template<MInt nDim_, class SysEqn >
MPI_Request* FvCartesianSolverXD< nDim_, SysEqn >::m_mpi_wmSendReq = nullptr
protected

Definition at line 1896 of file fvcartesiansolverxd.h.

◆ m_mpiRecvRequestsOpen

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_mpiRecvRequestsOpen = false
protected

Definition at line 2230 of file fvcartesiansolverxd.h.

◆ m_mpiSendRequestsOpen

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_mpiSendRequestsOpen = false
protected

Definition at line 2231 of file fvcartesiansolverxd.h.

◆ m_multilevel

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_multilevel = false
protected

Definition at line 2056 of file fvcartesiansolverxd.h.

◆ m_multipleFvSolver

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_multipleFvSolver = false
protected

Definition at line 1664 of file fvcartesiansolverxd.h.

◆ m_neighborPointIds

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_neighborPointIds
protected

Definition at line 1927 of file fvcartesiansolverxd.h.

◆ m_neutralFlameStrouhal

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_neutralFlameStrouhal
protected

Definition at line 2349 of file fvcartesiansolverxd.h.

◆ m_noActiveCells

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noActiveCells
protected

Definition at line 1444 of file fvcartesiansolverxd.h.

◆ m_noActiveHaloCellOffset

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noActiveHaloCellOffset
protected

Definition at line 1445 of file fvcartesiansolverxd.h.

◆ m_noAzimuthalReconstNghbrs

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_noAzimuthalReconstNghbrs
protected

Definition at line 1482 of file fvcartesiansolverxd.h.

◆ m_noCellsInsideSpongeLayer

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noCellsInsideSpongeLayer
protected

Definition at line 1447 of file fvcartesiansolverxd.h.

◆ m_noCorners

template<MInt nDim_, class SysEqn >
constexpr const MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noCorners = nDim == 3 ? 8 : 4
staticconstexpr

Definition at line 202 of file fvcartesiansolverxd.h.

◆ m_noDirs

template<MInt nDim_, class SysEqn >
constexpr const MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noDirs = 2 * nDim
staticconstexpr

Definition at line 200 of file fvcartesiansolverxd.h.

◆ m_noEdges

template<MInt nDim_, class SysEqn >
constexpr const MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noEdges = nDim == 3 ? 12 : 4
staticconstexpr

Definition at line 201 of file fvcartesiansolverxd.h.

◆ m_noEmbeddedBodies

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noEmbeddedBodies

Definition at line 2260 of file fvcartesiansolverxd.h.

◆ m_noForcingCycles

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noForcingCycles
protected

Definition at line 2355 of file fvcartesiansolverxd.h.

◆ m_noGapRegions

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noGapRegions

Definition at line 2285 of file fvcartesiansolverxd.h.

◆ m_noGNodes

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noGNodes
protected

Definition at line 1709 of file fvcartesiansolverxd.h.

◆ m_noJetConst

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noJetConst
protected

Definition at line 1533 of file fvcartesiansolverxd.h.

◆ m_noLESVariables

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noLESVariables = -1
protected

Definition at line 1799 of file fvcartesiansolverxd.h.

◆ m_noLevelSetFieldData

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noLevelSetFieldData
protected

Definition at line 1629 of file fvcartesiansolverxd.h.

◆ m_noLevelSetsUsedForMb

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noLevelSetsUsedForMb {}
protected

Definition at line 1628 of file fvcartesiansolverxd.h.

◆ m_noLimitedSlopesVar

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noLimitedSlopesVar
protected

Definition at line 2321 of file fvcartesiansolverxd.h.

◆ m_noMaxLevelHaloCells

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_noMaxLevelHaloCells = nullptr
protected

Definition at line 1453 of file fvcartesiansolverxd.h.

◆ m_noMaxLevelWindowCells

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_noMaxLevelWindowCells = nullptr
protected

Definition at line 1451 of file fvcartesiansolverxd.h.

◆ m_noMaxLvlMpiRecvNeighbors

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noMaxLvlMpiRecvNeighbors = -1

Definition at line 3070 of file fvcartesiansolverxd.h.

◆ m_noMaxLvlMpiSendNeighbors

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noMaxLvlMpiSendNeighbors = -1

Definition at line 3069 of file fvcartesiansolverxd.h.

◆ m_noMaxSpongeBndryCells

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noMaxSpongeBndryCells
protected

Definition at line 2015 of file fvcartesiansolverxd.h.

◆ m_nonBlockingComm

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_nonBlockingComm = false
protected

Definition at line 2222 of file fvcartesiansolverxd.h.

◆ m_noOuterBndryCells

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noOuterBndryCells = 0

Definition at line 1375 of file fvcartesiansolverxd.h.

◆ m_noParts

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_noParts = nullptr
protected

Definition at line 2050 of file fvcartesiansolverxd.h.

◆ m_noPerCellsToReceive

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_noPerCellsToReceive = nullptr

Definition at line 2294 of file fvcartesiansolverxd.h.

◆ m_noPerCellsToSend

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_noPerCellsToSend = nullptr

Definition at line 2293 of file fvcartesiansolverxd.h.

◆ m_noPeriodicCellData

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noPeriodicCellData

Definition at line 2298 of file fvcartesiansolverxd.h.

◆ m_noPeriodicCellsDom

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_noPeriodicCellsDom = nullptr

Definition at line 2295 of file fvcartesiansolverxd.h.

◆ m_noPeriodicData

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noPeriodicData

Definition at line 2297 of file fvcartesiansolverxd.h.

◆ m_noPeriodicGhostBodies

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noPeriodicGhostBodies

Definition at line 2261 of file fvcartesiansolverxd.h.

◆ m_noRansEquations

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noRansEquations = 0
protected

Definition at line 1792 of file fvcartesiansolverxd.h.

◆ m_noRANSVariables

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noRANSVariables = -1
protected

Definition at line 1798 of file fvcartesiansolverxd.h.

◆ m_noReactionCells

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_noReactionCells
protected

Definition at line 2336 of file fvcartesiansolverxd.h.

◆ m_noRKSteps

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noRKSteps
protected

Definition at line 1710 of file fvcartesiansolverxd.h.

◆ m_normalBcId

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_normalBcId
protected

Definition at line 1911 of file fvcartesiansolverxd.h.

◆ m_normalLength

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_normalLength
protected

Definition at line 1907 of file fvcartesiansolverxd.h.

◆ m_normalNoPoints

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_normalNoPoints
protected

Definition at line 1908 of file fvcartesiansolverxd.h.

◆ m_normalOutputInitCounter

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_normalOutputInitCounter = 0
protected

Definition at line 1910 of file fvcartesiansolverxd.h.

◆ m_normalOutputInterval

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_normalOutputInterval
protected

Definition at line 1909 of file fvcartesiansolverxd.h.

◆ m_normalSamplingCoords

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::m_normalSamplingCoords
protected

Definition at line 1915 of file fvcartesiansolverxd.h.

◆ m_normalSamplingSide

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_normalSamplingSide
protected

Definition at line 1916 of file fvcartesiansolverxd.h.

◆ m_normJetTemperature

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_normJetTemperature = -1.0
protected

Definition at line 1554 of file fvcartesiansolverxd.h.

◆ m_noSamples

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noSamples
protected

Definition at line 1711 of file fvcartesiansolverxd.h.

◆ m_noSamplingCycles

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noSamplingCycles
protected

Definition at line 2353 of file fvcartesiansolverxd.h.

◆ m_noSets

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noSets = 0
protected

Definition at line 1632 of file fvcartesiansolverxd.h.

◆ m_noSpecies

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noSpecies

Definition at line 207 of file fvcartesiansolverxd.h.

◆ m_noSpongeBndryCndIds

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noSpongeBndryCndIds
protected

Definition at line 2014 of file fvcartesiansolverxd.h.

◆ m_noSpongeCells

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noSpongeCells
protected

Definition at line 1853 of file fvcartesiansolverxd.h.

◆ m_noSpongeFactors

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noSpongeFactors
protected

Definition at line 2013 of file fvcartesiansolverxd.h.

◆ m_noSpongeZonesIn

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noSpongeZonesIn {}

Definition at line 2990 of file fvcartesiansolverxd.h.

◆ m_noSpongeZonesOut

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noSpongeZonesOut {}

Definition at line 2991 of file fvcartesiansolverxd.h.

◆ m_noStgSpongePositions

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noStgSpongePositions
protected

Definition at line 1834 of file fvcartesiansolverxd.h.

◆ m_noTimeStepsBetweenSamples

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noTimeStepsBetweenSamples
protected

Definition at line 1719 of file fvcartesiansolverxd.h.

◆ m_noWallNormals

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_noWallNormals = 0
protected

Definition at line 1918 of file fvcartesiansolverxd.h.

◆ m_noWMImgPointsRecv

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_noWMImgPointsRecv = nullptr
protected

Definition at line 1889 of file fvcartesiansolverxd.h.

◆ m_noWMImgPointsSend

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_noWMImgPointsSend = nullptr
protected

Definition at line 1888 of file fvcartesiansolverxd.h.

◆ m_nozzleExitMaJet

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_nozzleExitMaJet = -1.0
protected

Definition at line 1557 of file fvcartesiansolverxd.h.

◆ m_nozzleExitRho

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_nozzleExitRho = -1.0
protected

Definition at line 1560 of file fvcartesiansolverxd.h.

◆ m_nozzleExitTemp

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_nozzleExitTemp = -1.0
protected

Definition at line 1558 of file fvcartesiansolverxd.h.

◆ m_nozzleExitU

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_nozzleExitU = -1.0
protected

Definition at line 1561 of file fvcartesiansolverxd.h.

◆ m_nozzleInletP

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_nozzleInletP = -1.0
protected

Definition at line 1565 of file fvcartesiansolverxd.h.

◆ m_nozzleInletRho

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_nozzleInletRho = -1.0
protected

Definition at line 1566 of file fvcartesiansolverxd.h.

◆ m_nozzleInletTemp

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_nozzleInletTemp = -1.0
protected

Definition at line 1564 of file fvcartesiansolverxd.h.

◆ m_nozzleInletU

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_nozzleInletU = -1.0
protected

Definition at line 1567 of file fvcartesiansolverxd.h.

◆ m_NuT

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_NuT
protected

Definition at line 1606 of file fvcartesiansolverxd.h.

◆ m_nuTildeInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_nuTildeInfinity
protected

Definition at line 2464 of file fvcartesiansolverxd.h.

◆ m_oldMomentOfVorticity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_oldMomentOfVorticity
protected

Definition at line 2038 of file fvcartesiansolverxd.h.

◆ m_oldNegativeMomentOfVorticity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_oldNegativeMomentOfVorticity
protected

Definition at line 2039 of file fvcartesiansolverxd.h.

◆ m_oldPositiveMomentOfVorticity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_oldPositiveMomentOfVorticity
protected

Definition at line 2040 of file fvcartesiansolverxd.h.

◆ m_oldPressure_Gradient

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_oldPressure_Gradient

Definition at line 2300 of file fvcartesiansolverxd.h.

◆ m_oldTimeStep

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_oldTimeStep

Definition at line 2303 of file fvcartesiansolverxd.h.

◆ m_oldUbulk

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_oldUbulk

Definition at line 2301 of file fvcartesiansolverxd.h.

◆ m_omegaInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_omegaInfinity
protected

Definition at line 2466 of file fvcartesiansolverxd.h.

◆ m_omegaInfinityFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_omegaInfinityFactor
protected

Definition at line 1866 of file fvcartesiansolverxd.h.

◆ m_oneDimFlame

template<MInt nDim_, class SysEqn >
std::unique_ptr<OneDFlame> FvCartesianSolverXD< nDim_, SysEqn >::m_oneDimFlame

Definition at line 1179 of file fvcartesiansolverxd.h.

◆ m_onlyMaxLvlMpiRequests

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_onlyMaxLvlMpiRequests = true

Definition at line 3068 of file fvcartesiansolverxd.h.

◆ m_orderOfReconstruction

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_orderOfReconstruction
protected

Definition at line 1713 of file fvcartesiansolverxd.h.

◆ m_outletLength

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_outletLength
protected

Definition at line 2344 of file fvcartesiansolverxd.h.

◆ m_outletRadius

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_outletRadius = -1.0
protected

Definition at line 1553 of file fvcartesiansolverxd.h.

◆ m_outputFormat

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::m_outputFormat
protected

Definition at line 1691 of file fvcartesiansolverxd.h.

◆ m_outputOffset

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_outputOffset
protected

Definition at line 2361 of file fvcartesiansolverxd.h.

◆ m_outputPhysicalTime

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_outputPhysicalTime = false
protected

Definition at line 2028 of file fvcartesiansolverxd.h.

◆ m_particleWidth

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_particleWidth = nullptr
private

Definition at line 3015 of file fvcartesiansolverxd.h.

◆ m_PCg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_PCg
protected

Definition at line 1436 of file fvcartesiansolverxd.h.

◆ m_periodicCellDataDom

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_periodicCellDataDom = nullptr

Definition at line 2296 of file fvcartesiansolverxd.h.

◆ m_periodicCells

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_periodicCells

Definition at line 2290 of file fvcartesiansolverxd.h.

◆ m_periodicDataToReceive

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_periodicDataToReceive = nullptr

Definition at line 2292 of file fvcartesiansolverxd.h.

◆ m_periodicDataToSend

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_periodicDataToSend = nullptr

Definition at line 2291 of file fvcartesiansolverxd.h.

◆ m_perturbationAmplitude

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_perturbationAmplitude
protected

Definition at line 2358 of file fvcartesiansolverxd.h.

◆ m_perturbationAmplitudeCorr

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_perturbationAmplitudeCorr
protected

Definition at line 2359 of file fvcartesiansolverxd.h.

◆ m_PHg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_PHg
protected

Definition at line 1429 of file fvcartesiansolverxd.h.

◆ m_physicalTime

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_physicalTime
protected

Definition at line 1993 of file fvcartesiansolverxd.h.

◆ m_physicalTimeStep

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_physicalTimeStep
protected

Definition at line 1994 of file fvcartesiansolverxd.h.

◆ m_PInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_PInfinity
protected

Definition at line 2461 of file fvcartesiansolverxd.h.

◆ m_pipeRadius

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_pipeRadius = -1

Definition at line 2259 of file fvcartesiansolverxd.h.

◆ m_planeInterp

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_planeInterp = false
protected

Definition at line 1481 of file fvcartesiansolverxd.h.

◆ m_plenum

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_plenum
protected

Definition at line 2326 of file fvcartesiansolverxd.h.

◆ m_plenumWall

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_plenumWall
protected

Definition at line 2325 of file fvcartesiansolverxd.h.

◆ m_postShockCV

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_postShockCV = nullptr
protected

Definition at line 2477 of file fvcartesiansolverxd.h.

◆ m_postShockPV

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_postShockPV = nullptr
protected

Definition at line 2476 of file fvcartesiansolverxd.h.

◆ m_Pr

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_Pr
protected

Definition at line 1995 of file fvcartesiansolverxd.h.

◆ m_preliminarySponge

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_preliminarySponge = false
protected

Definition at line 1837 of file fvcartesiansolverxd.h.

◆ m_pressureFlameTube

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_pressureFlameTube
protected

Definition at line 1581 of file fvcartesiansolverxd.h.

◆ m_pressureLossCorrection

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_pressureLossCorrection
protected

Definition at line 2340 of file fvcartesiansolverxd.h.

◆ m_pressureLossFlameSpeed

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_pressureLossFlameSpeed
protected

Definition at line 2339 of file fvcartesiansolverxd.h.

◆ m_pressureRatioChannel

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_pressureRatioChannel
protected

Definition at line 1825 of file fvcartesiansolverxd.h.

◆ m_pressureRatioEndTimeStep

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_pressureRatioEndTimeStep
protected

Definition at line 1827 of file fvcartesiansolverxd.h.

◆ m_pressureRatioStartTimeStep

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_pressureRatioStartTimeStep
protected

Definition at line 1826 of file fvcartesiansolverxd.h.

◆ m_pressureUnburnt

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_pressureUnburnt
protected

Definition at line 1582 of file fvcartesiansolverxd.h.

◆ m_previousMa

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_previousMa
protected

Definition at line 1999 of file fvcartesiansolverxd.h.

◆ m_primaryJetRadius

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_primaryJetRadius
protected

Definition at line 1543 of file fvcartesiansolverxd.h.

◆ m_qCriterionOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_qCriterionOutput
protected

Definition at line 1670 of file fvcartesiansolverxd.h.

◆ m_radiusFlameTube

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_radiusFlameTube
protected

Definition at line 1593 of file fvcartesiansolverxd.h.

◆ m_radiusFlameTube2

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_radiusFlameTube2
protected

Definition at line 1594 of file fvcartesiansolverxd.h.

◆ m_radiusInjector

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_radiusInjector
protected

Definition at line 1591 of file fvcartesiansolverxd.h.

◆ m_radiusOutlet

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_radiusOutlet
protected

Definition at line 2345 of file fvcartesiansolverxd.h.

◆ m_radiusVelFlameTube

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_radiusVelFlameTube
protected

Definition at line 1590 of file fvcartesiansolverxd.h.

◆ m_randomDeviceSeed

template<MInt nDim_, class SysEqn >
MUlong FvCartesianSolverXD< nDim_, SysEqn >::m_randomDeviceSeed
protected

Definition at line 2034 of file fvcartesiansolverxd.h.

◆ m_rans

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_rans
protected

Definition at line 1791 of file fvcartesiansolverxd.h.

◆ m_ransTransPos

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_ransTransPos
protected

Definition at line 1794 of file fvcartesiansolverxd.h.

◆ m_RANSValues

template<MInt nDim_, class SysEqn >
std::vector<MFloat>* FvCartesianSolverXD< nDim_, SysEqn >::m_RANSValues = nullptr
protected

Definition at line 1800 of file fvcartesiansolverxd.h.

◆ m_reactionScheme

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::m_reactionScheme
protected

Definition at line 1507 of file fvcartesiansolverxd.h.

◆ m_realRadiusFlameTube

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_realRadiusFlameTube
protected

Definition at line 1589 of file fvcartesiansolverxd.h.

◆ m_receiveBuffers

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_receiveBuffers = nullptr
protected

Definition at line 2220 of file fvcartesiansolverxd.h.

◆ m_receiveBuffersNoBlocking

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_receiveBuffersNoBlocking = nullptr
protected

Definition at line 2224 of file fvcartesiansolverxd.h.

◆ m_reComputedBndry

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_reComputedBndry = false
protected

Definition at line 1633 of file fvcartesiansolverxd.h.

◆ m_reconstructionCellIds

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_reconstructionCellIds
protected

Definition at line 1468 of file fvcartesiansolverxd.h.

◆ m_reconstructionConstants

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::m_reconstructionConstants
protected

Definition at line 1467 of file fvcartesiansolverxd.h.

◆ m_reconstructionConstantsPeriodic

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_reconstructionConstantsPeriodic = nullptr
protected

Definition at line 1470 of file fvcartesiansolverxd.h.

◆ m_reconstructionDataPeriodic

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_reconstructionDataPeriodic = nullptr
protected

Definition at line 1465 of file fvcartesiansolverxd.h.

◆ m_reconstructionDataSize

template<MInt nDim_, class SysEqn >
MUint FvCartesianSolverXD< nDim_, SysEqn >::m_reconstructionDataSize
protected

Definition at line 1466 of file fvcartesiansolverxd.h.

◆ m_reconstructionNghbrIds

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_reconstructionNghbrIds
protected

Definition at line 1469 of file fvcartesiansolverxd.h.

◆ m_reconstructSurfaceData

template<MInt nDim_, class SysEqn >
void(FvCartesianSolverXD::* FvCartesianSolverXD< nDim_, SysEqn >::m_reconstructSurfaceData) (MInt)

Definition at line 2938 of file fvcartesiansolverxd.h.

◆ m_reConstSVDWeightMode

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_reConstSVDWeightMode {}
protected

Definition at line 1976 of file fvcartesiansolverxd.h.

◆ m_recordBodyData

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_recordBodyData
protected

Definition at line 1647 of file fvcartesiansolverxd.h.

◆ m_recordFlameFrontPosition

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_recordFlameFrontPosition
protected

Definition at line 1651 of file fvcartesiansolverxd.h.

◆ m_recordLandA

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_recordLandA
protected

Definition at line 1648 of file fvcartesiansolverxd.h.

◆ m_recordPressure

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_recordPressure
protected

Definition at line 1649 of file fvcartesiansolverxd.h.

◆ m_recordWallVorticity

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_recordWallVorticity
protected

Definition at line 1652 of file fvcartesiansolverxd.h.

◆ m_reExcludeBndryDiagonals

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_reExcludeBndryDiagonals
protected

Definition at line 1978 of file fvcartesiansolverxd.h.

◆ m_referenceComposition

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_referenceComposition = nullptr
protected

Definition at line 1521 of file fvcartesiansolverxd.h.

◆ m_referenceDensityTF

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_referenceDensityTF
protected

Definition at line 1511 of file fvcartesiansolverxd.h.

◆ m_referenceLength

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_referenceLength
protected

Definition at line 1998 of file fvcartesiansolverxd.h.

◆ m_referenceTemperature

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_referenceTemperature

Definition at line 2306 of file fvcartesiansolverxd.h.

◆ m_refineDiagonals

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_refineDiagonals = true

Definition at line 1377 of file fvcartesiansolverxd.h.

◆ m_relocateCenter

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_relocateCenter
protected

Definition at line 1977 of file fvcartesiansolverxd.h.

◆ m_resetInitialCondition

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_resetInitialCondition
protected

Definition at line 1790 of file fvcartesiansolverxd.h.

◆ m_restartBackupInterval

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_restartBackupInterval
protected

Definition at line 1714 of file fvcartesiansolverxd.h.

◆ m_restartBc2800

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_restartBc2800
protected

Definition at line 1715 of file fvcartesiansolverxd.h.

◆ m_restartFileOutputTimeStep

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_restartFileOutputTimeStep = -1.
protected

Definition at line 2539 of file fvcartesiansolverxd.h.

◆ m_restartLESAverage

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_restartLESAverage = false
protected

Definition at line 1814 of file fvcartesiansolverxd.h.

◆ m_restartOldVariables

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_restartOldVariables = false
protected

Definition at line 1658 of file fvcartesiansolverxd.h.

◆ m_restartOldVariablesReset

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_restartOldVariablesReset = false
protected

Definition at line 1659 of file fvcartesiansolverxd.h.

◆ m_restartTimeBc2800

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_restartTimeBc2800
protected

Definition at line 1716 of file fvcartesiansolverxd.h.

◆ m_rhoBurnt

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rhoBurnt
protected

Definition at line 1580 of file fvcartesiansolverxd.h.

◆ m_rhoCg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rhoCg
protected

Definition at line 1437 of file fvcartesiansolverxd.h.

◆ m_rhoEInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rhoEInfinity
protected

Definition at line 2473 of file fvcartesiansolverxd.h.

◆ m_rhoFlameTube

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rhoFlameTube
protected

Definition at line 1578 of file fvcartesiansolverxd.h.

◆ m_rhoHg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rhoHg
protected

Definition at line 1430 of file fvcartesiansolverxd.h.

◆ m_rhoInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rhoInfinity
protected

Definition at line 2474 of file fvcartesiansolverxd.h.

◆ m_rhoUInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rhoUInfinity
protected

Definition at line 2470 of file fvcartesiansolverxd.h.

◆ m_rhoUnburnt

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rhoUnburnt
protected

Definition at line 1579 of file fvcartesiansolverxd.h.

◆ m_rhoVInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rhoVInfinity
protected

Definition at line 2471 of file fvcartesiansolverxd.h.

◆ m_rhoVVInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rhoVVInfinity[3]
protected

Definition at line 2475 of file fvcartesiansolverxd.h.

◆ m_rhoWInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rhoWInfinity
protected

Definition at line 2472 of file fvcartesiansolverxd.h.

◆ m_rhs0

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_rhs0 = nullptr
protected

Definition at line 1499 of file fvcartesiansolverxd.h.

◆ m_RKalpha

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_RKalpha = nullptr
protected

Definition at line 1726 of file fvcartesiansolverxd.h.

◆ m_RKStep

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_RKStep
protected

Definition at line 1717 of file fvcartesiansolverxd.h.

◆ m_rntStartTimeStep

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_rntStartTimeStep = 0
protected

Definition at line 1819 of file fvcartesiansolverxd.h.

◆ m_rotAxisCoord

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_rotAxisCoord = nullptr
protected

Definition at line 1501 of file fvcartesiansolverxd.h.

◆ m_rotIndVarsCV

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_rotIndVarsCV
protected

Definition at line 1493 of file fvcartesiansolverxd.h.

◆ m_rotIndVarsPV

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_rotIndVarsPV
protected

Definition at line 1492 of file fvcartesiansolverxd.h.

◆ m_rPr

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rPr
protected

Definition at line 1996 of file fvcartesiansolverxd.h.

◆ m_rRe0

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_rRe0
protected

Definition at line 1997 of file fvcartesiansolverxd.h.

◆ m_rungeKuttaOrder

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_rungeKuttaOrder
protected

Definition at line 1718 of file fvcartesiansolverxd.h.

◆ m_sampleRate

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_sampleRate
protected

Definition at line 2002 of file fvcartesiansolverxd.h.

◆ m_samplesPerCycle

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_samplesPerCycle
protected

Definition at line 2354 of file fvcartesiansolverxd.h.

◆ m_samplingEndCycle

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_samplingEndCycle
protected

Definition at line 2350 of file fvcartesiansolverxd.h.

◆ m_samplingStartCycle

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_samplingStartCycle
protected

Definition at line 2351 of file fvcartesiansolverxd.h.

◆ m_samplingStartIteration

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_samplingStartIteration
protected

Definition at line 2352 of file fvcartesiansolverxd.h.

◆ m_samplingTimeBegin

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_samplingTimeBegin
protected

Definition at line 2003 of file fvcartesiansolverxd.h.

◆ m_samplingTimeEnd

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_samplingTimeEnd
protected

Definition at line 2004 of file fvcartesiansolverxd.h.

◆ m_samplingVariables

template<MInt nDim_, class SysEqn >
std::array<MFloat**, s_maxNoSamplingVariables> FvCartesianSolverXD< nDim_, SysEqn >::m_samplingVariables {nullptr}

Definition at line 1194 of file fvcartesiansolverxd.h.

◆ m_samplingVariablesStatus

template<MInt nDim_, class SysEqn >
std::array<MInt, 2 * s_maxNoSamplingVariables> FvCartesianSolverXD< nDim_, SysEqn >::m_samplingVariablesStatus {}

Definition at line 1196 of file fvcartesiansolverxd.h.

◆ m_saNoSrfcProbes

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_saNoSrfcProbes
protected

Definition at line 1938 of file fvcartesiansolverxd.h.

◆ m_saSrfcProbeBuffer

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_saSrfcProbeBuffer = nullptr
protected

Definition at line 1946 of file fvcartesiansolverxd.h.

◆ m_saSrfcProbeDir

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::m_saSrfcProbeDir
protected

Definition at line 1942 of file fvcartesiansolverxd.h.

◆ m_saSrfcProbeIds

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_saSrfcProbeIds
protected

Definition at line 1943 of file fvcartesiansolverxd.h.

◆ m_saSrfcProbeInterval

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_saSrfcProbeInterval
protected

Definition at line 1939 of file fvcartesiansolverxd.h.

◆ m_saSrfcProbeNoSamples

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_saSrfcProbeNoSamples = nullptr
protected

Definition at line 1947 of file fvcartesiansolverxd.h.

◆ m_saSrfcProbes

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_saSrfcProbes = false
protected

Definition at line 1941 of file fvcartesiansolverxd.h.

◆ m_saSrfcProbeSrfcs

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_saSrfcProbeSrfcs
protected

Definition at line 1944 of file fvcartesiansolverxd.h.

◆ m_saSrfcProbeStart

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_saSrfcProbeStart
protected

Definition at line 1940 of file fvcartesiansolverxd.h.

◆ m_saveVorticityToRestart

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_saveVorticityToRestart = false
protected

Definition at line 1667 of file fvcartesiansolverxd.h.

◆ m_ScT

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_ScT
protected

Definition at line 1605 of file fvcartesiansolverxd.h.

◆ m_secondaryJetRadius

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_secondaryJetRadius
protected

Definition at line 1544 of file fvcartesiansolverxd.h.

◆ m_secondaryReferenceComposition

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_secondaryReferenceComposition = nullptr
protected

Definition at line 1522 of file fvcartesiansolverxd.h.

◆ m_secondBodyId

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_secondBodyId = nullptr
protected

Definition at line 1498 of file fvcartesiansolverxd.h.

◆ m_secondCoordSpongeIn

template<MInt nDim_, class SysEqn >
MFloat * FvCartesianSolverXD< nDim_, SysEqn >::m_secondCoordSpongeIn {}

Definition at line 3001 of file fvcartesiansolverxd.h.

◆ m_secondCoordSpongeOut

template<MInt nDim_, class SysEqn >
MFloat * FvCartesianSolverXD< nDim_, SysEqn >::m_secondCoordSpongeOut {}

Definition at line 3001 of file fvcartesiansolverxd.h.

◆ m_secondSpongeDirectionsIn

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_secondSpongeDirectionsIn[s_maxNoSpongeZones] {}

Definition at line 2995 of file fvcartesiansolverxd.h.

◆ m_secondSpongeDirectionsOut

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_secondSpongeDirectionsOut[s_maxNoSpongeZones] {}

Definition at line 2996 of file fvcartesiansolverxd.h.

◆ m_sendBuffers

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_sendBuffers = nullptr
protected

Definition at line 2219 of file fvcartesiansolverxd.h.

◆ m_sendBuffersNoBlocking

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_sendBuffersNoBlocking = nullptr
protected

Definition at line 2223 of file fvcartesiansolverxd.h.

◆ m_sensorBandRefinement

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_sensorBandRefinement

Definition at line 2838 of file fvcartesiansolverxd.h.

◆ m_sensorBandRefinementAdditionalLayers

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_sensorBandRefinementAdditionalLayers

Definition at line 2839 of file fvcartesiansolverxd.h.

◆ m_setToBodiesTable

template<MInt nDim_, class SysEqn >
MInt** FvCartesianSolverXD< nDim_, SysEqn >::m_setToBodiesTable = nullptr

Definition at line 2247 of file fvcartesiansolverxd.h.

◆ m_shearLayerStrength

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_shearLayerStrength
protected

Definition at line 1604 of file fvcartesiansolverxd.h.

◆ m_shearLayerThickness

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_shearLayerThickness
protected

Definition at line 1537 of file fvcartesiansolverxd.h.

◆ m_sigmaEndSpongeBndryId

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_sigmaEndSpongeBndryId = nullptr
protected

Definition at line 2017 of file fvcartesiansolverxd.h.

◆ m_sigmaSponge

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_sigmaSponge
protected

Definition at line 2006 of file fvcartesiansolverxd.h.

◆ m_sigmaSpongeBndryId

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_sigmaSpongeBndryId = nullptr
protected

Definition at line 2016 of file fvcartesiansolverxd.h.

◆ m_sigmaSpongeInflow

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_sigmaSpongeInflow
protected

Definition at line 2007 of file fvcartesiansolverxd.h.

◆ m_SInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_SInfinity
protected

Definition at line 2468 of file fvcartesiansolverxd.h.

◆ m_skewness

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_skewness {}
protected

Definition at line 2071 of file fvcartesiansolverxd.h.

◆ m_slopeMemory

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_slopeMemory
protected

Definition at line 1454 of file fvcartesiansolverxd.h.

◆ m_smallCellIds

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_smallCellIds = nullptr
protected

Definition at line 1448 of file fvcartesiansolverxd.h.

◆ m_sortedPeriodicCells

template<MInt nDim_, class SysEqn >
List<MInt>* FvCartesianSolverXD< nDim_, SysEqn >::m_sortedPeriodicCells = nullptr

Definition at line 1363 of file fvcartesiansolverxd.h.

◆ m_specialSpongeTreatment

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_specialSpongeTreatment
protected

Definition at line 2331 of file fvcartesiansolverxd.h.

◆ m_speciesName

template<MInt nDim_, class SysEqn >
std::vector<MString> FvCartesianSolverXD< nDim_, SysEqn >::m_speciesName

Definition at line 1181 of file fvcartesiansolverxd.h.

◆ m_splitCells

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_splitCells
protected

Definition at line 1457 of file fvcartesiansolverxd.h.

◆ m_splitChilds

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_splitChilds
protected

Definition at line 1458 of file fvcartesiansolverxd.h.

◆ m_splitChildToSplitCell

template<MInt nDim_, class SysEqn >
std::map<MInt, MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_splitChildToSplitCell
protected

Definition at line 2316 of file fvcartesiansolverxd.h.

◆ m_splitMpiCommRecv

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_splitMpiCommRecv = false
protected

Definition at line 2232 of file fvcartesiansolverxd.h.

◆ m_splitSurfaces

template<MInt nDim_, class SysEqn >
std::set<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_splitSurfaces
protected

Definition at line 1456 of file fvcartesiansolverxd.h.

◆ m_spongeAverageCellId

template<MInt nDim_, class SysEqn >
std::vector<MInt>* FvCartesianSolverXD< nDim_, SysEqn >::m_spongeAverageCellId = nullptr
protected

Definition at line 1856 of file fvcartesiansolverxd.h.

◆ m_spongeAveragingIn

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_spongeAveragingIn[s_maxNoSpongeZones] {}

Definition at line 2997 of file fvcartesiansolverxd.h.

◆ m_spongeAveragingOut

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_spongeAveragingOut[s_maxNoSpongeZones] {}

Definition at line 2998 of file fvcartesiansolverxd.h.

◆ m_spongeBeta

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_spongeBeta
protected

Definition at line 2026 of file fvcartesiansolverxd.h.

◆ m_spongeBndryCndIds

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_spongeBndryCndIds = nullptr
protected

Definition at line 2019 of file fvcartesiansolverxd.h.

◆ m_spongeCells

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_spongeCells
protected

Definition at line 1857 of file fvcartesiansolverxd.h.

◆ m_spongeComm

template<MInt nDim_, class SysEqn >
MPI_Comm FvCartesianSolverXD< nDim_, SysEqn >::m_spongeComm
protected

Definition at line 1849 of file fvcartesiansolverxd.h.

◆ m_spongeCommSize

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_spongeCommSize = -1
protected

Definition at line 1850 of file fvcartesiansolverxd.h.

◆ m_spongeCoord

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_spongeCoord = nullptr
protected

Definition at line 1613 of file fvcartesiansolverxd.h.

◆ m_spongeDirections

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_spongeDirections = nullptr
protected

Definition at line 2018 of file fvcartesiansolverxd.h.

◆ m_spongeDirectionsIn

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_spongeDirectionsIn[s_maxNoSpongeZones] {}

Definition at line 2993 of file fvcartesiansolverxd.h.

◆ m_spongeDirectionsOut

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_spongeDirectionsOut[s_maxNoSpongeZones] {}

Definition at line 2994 of file fvcartesiansolverxd.h.

◆ m_spongeEndIteration

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_spongeEndIteration = nullptr
protected

Definition at line 2021 of file fvcartesiansolverxd.h.

◆ m_spongeFactor

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_spongeFactor = nullptr
protected

Definition at line 2009 of file fvcartesiansolverxd.h.

◆ m_spongeLayerLayout

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_spongeLayerLayout
protected

Definition at line 1611 of file fvcartesiansolverxd.h.

◆ m_spongeLayerThickness

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_spongeLayerThickness
protected

Definition at line 2010 of file fvcartesiansolverxd.h.

◆ m_spongeLayerType

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_spongeLayerType
protected

Definition at line 2005 of file fvcartesiansolverxd.h.

◆ m_spongeLimitFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_spongeLimitFactor = 10000.0
protected

Definition at line 1848 of file fvcartesiansolverxd.h.

◆ m_spongeLocations

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::m_spongeLocations
protected

Definition at line 1858 of file fvcartesiansolverxd.h.

◆ m_spongeRank

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_spongeRank = -1
protected

Definition at line 1851 of file fvcartesiansolverxd.h.

◆ m_spongeReductionFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_spongeReductionFactor
protected

Definition at line 2008 of file fvcartesiansolverxd.h.

◆ m_spongeRoot

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_spongeRoot = -1
protected

Definition at line 1838 of file fvcartesiansolverxd.h.

◆ m_spongeStartIteration

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_spongeStartIteration = nullptr
protected

Definition at line 2020 of file fvcartesiansolverxd.h.

◆ m_spongeTimeDep

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_spongeTimeDep
protected

Definition at line 2023 of file fvcartesiansolverxd.h.

◆ m_spongeTimeDependent

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_spongeTimeDependent = nullptr
protected

Definition at line 2022 of file fvcartesiansolverxd.h.

◆ m_spongeTimeVelocity

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_spongeTimeVelocity
protected

Definition at line 1828 of file fvcartesiansolverxd.h.

◆ m_spongeWeight

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_spongeWeight
protected

Definition at line 2025 of file fvcartesiansolverxd.h.

◆ m_standardHeatFormation

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_standardHeatFormation

Definition at line 1185 of file fvcartesiansolverxd.h.

◆ m_static_advanceSolution_dragCnt

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_advanceSolution_dragCnt = F0
protected

Definition at line 2615 of file fvcartesiansolverxd.h.

◆ m_static_advanceSolution_firstRun

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_advanceSolution_firstRun = true
protected

Definition at line 2616 of file fvcartesiansolverxd.h.

◆ m_static_advanceSolution_meanDrag

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_advanceSolution_meanDrag = F0
protected

Definition at line 2614 of file fvcartesiansolverxd.h.

◆ m_static_advanceSolution_meanDragCoeff

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_advanceSolution_meanDragCoeff = F0
protected

Definition at line 2613 of file fvcartesiansolverxd.h.

◆ m_static_applyBoundaryCondition_ERhoL1

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_applyBoundaryCondition_ERhoL1 = F0
protected

Definition at line 2625 of file fvcartesiansolverxd.h.

◆ m_static_applyBoundaryCondition_ERhoL2

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_applyBoundaryCondition_ERhoL2 = F0
protected

Definition at line 2626 of file fvcartesiansolverxd.h.

◆ m_static_applyBoundaryCondition_ERhoLoo

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_applyBoundaryCondition_ERhoLoo = F0
protected

Definition at line 2627 of file fvcartesiansolverxd.h.

◆ m_static_applyBoundaryCondition_EVelL1

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_applyBoundaryCondition_EVelL1 = F0
protected

Definition at line 2628 of file fvcartesiansolverxd.h.

◆ m_static_applyBoundaryCondition_EVelL2

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_applyBoundaryCondition_EVelL2 = F0
protected

Definition at line 2629 of file fvcartesiansolverxd.h.

◆ m_static_applyBoundaryCondition_EVelLoo

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_applyBoundaryCondition_EVelLoo = F0
protected

Definition at line 2630 of file fvcartesiansolverxd.h.

◆ m_static_applyBoundaryCondition_firstRun

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_applyBoundaryCondition_firstRun = true
protected

Definition at line 2624 of file fvcartesiansolverxd.h.

◆ m_static_applyBoundaryCondition_oldMass

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_applyBoundaryCondition_oldMass
protected

Definition at line 2632 of file fvcartesiansolverxd.h.

◆ m_static_applyBoundaryCondition_oldVol2

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_applyBoundaryCondition_oldVol2
protected

Definition at line 2633 of file fvcartesiansolverxd.h.

◆ m_static_applyBoundaryCondition_refMass

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_applyBoundaryCondition_refMass
protected

Definition at line 2631 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_bodyCntAvg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_bodyCntAvg[s_computeFlowStatistics_noSamples *s_computeFlowStatistics_noReClasses]
protected

Definition at line 2699 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_currentCnt

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_currentCnt = 0
protected

Definition at line 2698 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_currentIndex

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_currentIndex = 0
protected

Definition at line 2669 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_currentIndex2

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_currentIndex2 = 0
protected

Definition at line 2682 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_currentIndex3

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_currentIndex3 = 0
protected

Definition at line 2692 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_currentIndex4

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_currentIndex4 = 0
protected

Definition at line 2697 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_firstBD

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_firstBD = true
protected

Definition at line 2701 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_jointPdfAverage

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_jointPdfAverage[s_computeFlowStatistics_noSamples2 *s_computeFlowStatistics_noJointPdfs *s_computeFlowStatistics_noPdfPoints *s_computeFlowStatistics_noPdfPoints]
protected

Definition at line 2678 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_pdfAverage

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_pdfAverage[s_computeFlowStatistics_noSamples2 *s_computeFlowStatistics_noPdfs *s_computeFlowStatistics_noPdfPoints]
protected

Definition at line 2674 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_pdfAverage2

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_pdfAverage2[s_computeFlowStatistics_noSamples2 *s_computeFlowStatistics_noPdfs *s_computeFlowStatistics_noPdfPoints]
protected

Definition at line 2676 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_sdatAverage

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_sdatAverage[s_computeFlowStatistics_noSamples *s_computeFlowStatistics_noAngles *s_computeFlowStatistics_noAngleDat]
protected

Definition at line 2686 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_sdatAverage2

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_sdatAverage2[s_computeFlowStatistics_noSamples *s_computeFlowStatistics_noAngles *s_computeFlowStatistics_noAngleDat]
protected

Definition at line 2688 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_sdatSum

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_sdatSum[s_computeFlowStatistics_noSamples *s_computeFlowStatistics_noAngles]
protected

Definition at line 2691 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_thetaDensityAverage

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_thetaDensityAverage[s_computeFlowStatistics_noSamples *s_computeFlowStatistics_thetaSize *s_computeFlowStatistics_noDat]
protected

Definition at line 2663 of file fvcartesiansolverxd.h.

◆ m_static_computeFlowStatistics_thetaDensityAverage2

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeFlowStatistics_thetaDensityAverage2[s_computeFlowStatistics_noSamples *s_computeFlowStatistics_thetaSize *s_computeFlowStatistics_noDat]
protected

Definition at line 2666 of file fvcartesiansolverxd.h.

◆ m_static_computeSurfaceValuesLimitedSlopesMan_checkedBndryCndIds

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeSurfaceValuesLimitedSlopesMan_checkedBndryCndIds = false
protected

Definition at line 2602 of file fvcartesiansolverxd.h.

◆ m_static_computeSurfaceValuesLimitedSlopesMan_correctWallBndryFluxes

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_computeSurfaceValuesLimitedSlopesMan_correctWallBndryFluxes = false
protected

Definition at line 2603 of file fvcartesiansolverxd.h.

◆ m_static_constructGFieldPredictor_adaptiveGravity

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_constructGFieldPredictor_adaptiveGravity = false
protected

Definition at line 2611 of file fvcartesiansolverxd.h.

◆ m_static_constructGFieldPredictor_firstRun

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_constructGFieldPredictor_firstRun = true
protected

Definition at line 2610 of file fvcartesiansolverxd.h.

◆ m_static_crankAngle_initialCad

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_crankAngle_initialCad = -99
private

Definition at line 3013 of file fvcartesiansolverxd.h.

◆ m_static_crankAngle_Strouhal

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_crankAngle_Strouhal = -99
private

Definition at line 3012 of file fvcartesiansolverxd.h.

◆ m_static_getDistanceSplitSphere_first

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_getDistanceSplitSphere_first = true
protected

Definition at line 2608 of file fvcartesiansolverxd.h.

◆ m_static_getDistanceSplitSphere_h

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_getDistanceSplitSphere_h = 0
protected

Definition at line 2607 of file fvcartesiansolverxd.h.

◆ m_static_logCell_firstRun

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_logCell_firstRun = true
protected

Definition at line 2596 of file fvcartesiansolverxd.h.

◆ m_static_logCellxd_firstRun

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_logCellxd_firstRun = true
protected

Definition at line 2706 of file fvcartesiansolverxd.h.

◆ m_static_logData_firstRun4

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_firstRun4 = true
protected

Definition at line 2638 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45299_amplitude

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45299_amplitude[s_logData_ic45299_maxNoEmbeddedBodies]
protected

Definition at line 2642 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45299_cutOffAngle

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45299_cutOffAngle
protected

Definition at line 2645 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45299_first

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45299_first = true
protected

Definition at line 2640 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45299_freqFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45299_freqFactor[s_logData_ic45299_maxNoEmbeddedBodies]
protected

Definition at line 2643 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45299_maxA

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45299_maxA
protected

Definition at line 2644 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45299_maxF

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45299_maxF
protected

Definition at line 2644 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45299_xCutOff

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45299_xCutOff
protected

Definition at line 2646 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45301_containingCellIds

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45301_containingCellIds[s_logData_ic45301_maxNoPressurePoints]
protected

Definition at line 2656 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45301_first

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45301_first = true
protected

Definition at line 2648 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45301_freqFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45301_freqFactor[s_logData_ic45301_maxNoEmbeddedBodies]
protected

Definition at line 2652 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45301_maxF

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45301_maxF
protected

Definition at line 2653 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45301_noPressurePoints

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45301_noPressurePoints = 0
protected

Definition at line 2655 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45301_pressurePoints

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45301_pressurePoints[s_logData_ic45301_maxNoPressurePoints *nDim]
protected

Definition at line 2654 of file fvcartesiansolverxd.h.

◆ m_static_logData_ic45301_Strouhal

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_logData_ic45301_Strouhal
protected

Definition at line 2651 of file fvcartesiansolverxd.h.

◆ m_static_redistributeMass_firstRun

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_redistributeMass_firstRun = true
protected

Definition at line 2622 of file fvcartesiansolverxd.h.

◆ m_static_saveSolverSolutionxd_firstRun

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_saveSolverSolutionxd_firstRun = true
protected

Definition at line 2658 of file fvcartesiansolverxd.h.

◆ m_static_smallCellCorrection_first

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_smallCellCorrection_first = true
protected

Definition at line 2598 of file fvcartesiansolverxd.h.

◆ m_static_smallCellCorrection_slipCoordinate

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_static_smallCellCorrection_slipCoordinate
protected

Definition at line 2600 of file fvcartesiansolverxd.h.

◆ m_static_smallCellCorrection_slipDirection

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_static_smallCellCorrection_slipDirection
protected

Definition at line 2599 of file fvcartesiansolverxd.h.

◆ m_static_updateBodyProperties_c453_firstRun

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_updateBodyProperties_c453_firstRun = true
protected

Definition at line 2618 of file fvcartesiansolverxd.h.

◆ m_static_updateBodyProperties_c455_firstRun

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_updateBodyProperties_c455_firstRun = true
protected

Definition at line 2619 of file fvcartesiansolverxd.h.

◆ m_static_updateBodyProperties_firstTime

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_updateBodyProperties_firstTime = true
protected

Definition at line 2620 of file fvcartesiansolverxd.h.

◆ m_static_updateSpongeLayer_first

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_updateSpongeLayer_first = true
protected

Definition at line 2636 of file fvcartesiansolverxd.h.

◆ m_static_updateSpongeLayer_mbSpongeLayer

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_updateSpongeLayer_mbSpongeLayer = false
protected

Definition at line 2635 of file fvcartesiansolverxd.h.

◆ m_static_writeVtkXmlFiles_firstCall

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_writeVtkXmlFiles_firstCall = true
protected

Definition at line 2703 of file fvcartesiansolverxd.h.

◆ m_static_writeVtkXmlFiles_firstCall2

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_static_writeVtkXmlFiles_firstCall2 = true
protected

Definition at line 2704 of file fvcartesiansolverxd.h.

◆ m_statisticCombustionAnalysis

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_statisticCombustionAnalysis {}
protected

Definition at line 2067 of file fvcartesiansolverxd.h.

◆ m_stgEddieCoverage

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_stgEddieCoverage = nullptr
protected

Definition at line 1829 of file fvcartesiansolverxd.h.

◆ m_stgIsActive

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_stgIsActive
protected

Definition at line 1824 of file fvcartesiansolverxd.h.

◆ m_STGSponge

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_STGSponge = false
protected

Definition at line 1835 of file fvcartesiansolverxd.h.

◆ m_STGSpongeFactor

template<MInt nDim_, class SysEqn >
std::vector<MFloat>* FvCartesianSolverXD< nDim_, SysEqn >::m_STGSpongeFactor = nullptr
protected

Definition at line 1843 of file fvcartesiansolverxd.h.

◆ m_stgSpongePositions

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_stgSpongePositions
protected

Definition at line 1833 of file fvcartesiansolverxd.h.

◆ m_stgSpongeTimeStep

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_stgSpongeTimeStep = 0
protected

Definition at line 1832 of file fvcartesiansolverxd.h.

◆ m_stgStartTimeStep

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_stgStartTimeStep = 0
protected

Definition at line 1823 of file fvcartesiansolverxd.h.

◆ m_storeNghbrIds

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_storeNghbrIds = nullptr
protected

Definition at line 1784 of file fvcartesiansolverxd.h.

◆ m_strouhal

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_strouhal = -1.0
protected

Definition at line 2346 of file fvcartesiansolverxd.h.

◆ m_strouhalInit

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_strouhalInit = -1.0
protected

Definition at line 2347 of file fvcartesiansolverxd.h.

◆ m_structuredFlameOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_structuredFlameOutput
protected

Definition at line 1653 of file fvcartesiansolverxd.h.

◆ m_structuredFlameOutputLevel

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_structuredFlameOutputLevel
protected

Definition at line 1721 of file fvcartesiansolverxd.h.

◆ m_subfilterVariance

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_subfilterVariance
protected

Definition at line 1572 of file fvcartesiansolverxd.h.

◆ m_surfaces

template<MInt nDim_, class SysEqn >
FvSurfaceCollector FvCartesianSolverXD< nDim_, SysEqn >::m_surfaces
protected

Definition at line 1416 of file fvcartesiansolverxd.h.

◆ m_surfaceTangentialVelocity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_surfaceTangentialVelocity
protected

Definition at line 1497 of file fvcartesiansolverxd.h.

◆ m_surfaceValueReconstruction

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::m_surfaceValueReconstruction
protected

Definition at line 2317 of file fvcartesiansolverxd.h.

◆ m_surfaceVarMemory

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_surfaceVarMemory
protected

Definition at line 1455 of file fvcartesiansolverxd.h.

◆ m_surfDistCartesian

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_surfDistCartesian
protected

Definition at line 1655 of file fvcartesiansolverxd.h.

◆ m_surfDistParallel

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_surfDistParallel
protected

Definition at line 1654 of file fvcartesiansolverxd.h.

◆ m_sutherlandConstant

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_sutherlandConstant = NAN

Definition at line 2308 of file fvcartesiansolverxd.h.

◆ m_sutherlandConstantThermal

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_sutherlandConstantThermal

Definition at line 2309 of file fvcartesiansolverxd.h.

◆ m_sutherlandPlusOne

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_sutherlandPlusOne = NAN

Definition at line 2310 of file fvcartesiansolverxd.h.

◆ m_sutherlandPlusOneThermal

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_sutherlandPlusOneThermal

Definition at line 2311 of file fvcartesiansolverxd.h.

◆ m_sweepStartFirstCell

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_sweepStartFirstCell
protected

Definition at line 1442 of file fvcartesiansolverxd.h.

◆ m_sweptVolume

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_sweptVolume = nullptr

Definition at line 1381 of file fvcartesiansolverxd.h.

◆ m_sweptVolumeBal

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_sweptVolumeBal = nullptr

Definition at line 1382 of file fvcartesiansolverxd.h.

◆ m_sysEqn

template<MInt nDim_, class SysEqn >
SysEqn FvCartesianSolverXD< nDim_, SysEqn >::m_sysEqn

Definition at line 209 of file fvcartesiansolverxd.h.

◆ m_target_Ubulk

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_target_Ubulk

Definition at line 2302 of file fvcartesiansolverxd.h.

◆ m_targetDensityFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_targetDensityFactor
protected

Definition at line 2027 of file fvcartesiansolverxd.h.

◆ m_targetVelocityFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_targetVelocityFactor
protected

Definition at line 1546 of file fvcartesiansolverxd.h.

◆ m_TCg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_TCg
protected

Definition at line 1432 of file fvcartesiansolverxd.h.

◆ m_tcomm

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tcomm
protected

Definition at line 2446 of file fvcartesiansolverxd.h.

◆ m_temperatureChange

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_temperatureChange
protected

Definition at line 1513 of file fvcartesiansolverxd.h.

◆ m_temperatureFlameTube

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_temperatureFlameTube
protected

Definition at line 1576 of file fvcartesiansolverxd.h.

◆ m_testCaseName

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::m_testCaseName
protected

Definition at line 2045 of file fvcartesiansolverxd.h.

◆ m_texchange

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_texchange
protected

Definition at line 2447 of file fvcartesiansolverxd.h.

◆ m_texchangeDt

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_texchangeDt
protected

Definition at line 2457 of file fvcartesiansolverxd.h.

◆ m_tgather

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tgather
protected

Definition at line 2451 of file fvcartesiansolverxd.h.

◆ m_tgatherAndSend

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tgatherAndSend
protected

Definition at line 2448 of file fvcartesiansolverxd.h.

◆ m_tgatherAndSendWait

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tgatherAndSendWait
protected

Definition at line 2449 of file fvcartesiansolverxd.h.

◆ m_tgfv

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tgfv
protected

Definition at line 2445 of file fvcartesiansolverxd.h.

◆ m_thermalProfileStartFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_thermalProfileStartFactor
protected

Definition at line 1602 of file fvcartesiansolverxd.h.

◆ m_THg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_THg
protected

Definition at line 1425 of file fvcartesiansolverxd.h.

◆ m_thickenedFlame

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_thickenedFlame = false
protected

Definition at line 1623 of file fvcartesiansolverxd.h.

◆ m_thickeningFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_thickeningFactor
protected

Definition at line 1510 of file fvcartesiansolverxd.h.

◆ m_time

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_time
protected

Definition at line 2029 of file fvcartesiansolverxd.h.

◆ m_timeOfMaxPdiff

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_timeOfMaxPdiff {}

Definition at line 3000 of file fvcartesiansolverxd.h.

◆ m_timeRef

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_timeRef
protected

Definition at line 2030 of file fvcartesiansolverxd.h.

◆ m_timerGroup

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_timerGroup = -1
protected

Definition at line 2441 of file fvcartesiansolverxd.h.

◆ m_timers

template<MInt nDim_, class SysEqn >
std::array<MInt, Timers::_count> FvCartesianSolverXD< nDim_, SysEqn >::m_timers {}
protected

Definition at line 2443 of file fvcartesiansolverxd.h.

◆ m_timeStep

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_timeStep = -1.0
protected

Current time-step used to advance the solution

Warning
When using non-blocking time reduction this variable might not contain the correct time "yet", use timeStep() instead.

Definition at line 2490 of file fvcartesiansolverxd.h.

◆ m_timeStepAvailable

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_timeStepAvailable = true
protected

Definition at line 2496 of file fvcartesiansolverxd.h.

◆ m_timeStepComputationInterval

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_timeStepComputationInterval = -1
protected

Definition at line 2526 of file fvcartesiansolverxd.h.

◆ m_timeStepConverged

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_timeStepConverged = false
private

Definition at line 1353 of file fvcartesiansolverxd.h.

◆ m_timeStepConvergenceCriterion

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_timeStepConvergenceCriterion
protected

Definition at line 2046 of file fvcartesiansolverxd.h.

◆ m_timeStepFixedValue

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_timeStepFixedValue = -1.0
protected

Definition at line 2524 of file fvcartesiansolverxd.h.

◆ m_timeStepMethod

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_timeStepMethod = -1
protected

Definition at line 2482 of file fvcartesiansolverxd.h.

◆ m_timeStepNonBlocking

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_timeStepNonBlocking = false
protected

Definition at line 2492 of file fvcartesiansolverxd.h.

◆ m_timeStepReq

template<MInt nDim_, class SysEqn >
MPI_Request FvCartesianSolverXD< nDim_, SysEqn >::m_timeStepReq
protected

Definition at line 2494 of file fvcartesiansolverxd.h.

◆ m_timeStepUpdated

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_timeStepUpdated = true
protected

Definition at line 2498 of file fvcartesiansolverxd.h.

◆ m_timeStepVolumeWeighted

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_timeStepVolumeWeighted = false
protected

Definition at line 2484 of file fvcartesiansolverxd.h.

◆ m_TInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_TInfinity = NAN
protected

Definition at line 2462 of file fvcartesiansolverxd.h.

◆ m_tkeFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_tkeFactor
protected

Definition at line 1864 of file fvcartesiansolverxd.h.

◆ m_totalDamp

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_totalDamp
protected

Definition at line 1643 of file fvcartesiansolverxd.h.

◆ m_totalHeatReleaseRate

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_totalHeatReleaseRate
protected

Definition at line 2031 of file fvcartesiansolverxd.h.

◆ m_totalnoghostcells

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_totalnoghostcells = 0

Definition at line 1365 of file fvcartesiansolverxd.h.

◆ m_totalnosplitchilds

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_totalnosplitchilds = 0

Definition at line 1364 of file fvcartesiansolverxd.h.

◆ m_trackMbEnd

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_trackMbEnd {}
private

Definition at line 1357 of file fvcartesiansolverxd.h.

◆ m_trackMbStart

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_trackMbStart {}
private

Definition at line 1356 of file fvcartesiansolverxd.h.

◆ m_trackMovingBndry

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_trackMovingBndry {}
private

Definition at line 1355 of file fvcartesiansolverxd.h.

◆ m_treceive

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_treceive
protected

Definition at line 2453 of file fvcartesiansolverxd.h.

◆ m_treceiveWait

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_treceiveWait
protected

Definition at line 2456 of file fvcartesiansolverxd.h.

◆ m_treceiving

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_treceiving
protected

Definition at line 2455 of file fvcartesiansolverxd.h.

◆ m_tripAirfoil

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_tripAirfoil

Definition at line 3035 of file fvcartesiansolverxd.h.

◆ m_tripAirfoilAOA

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_tripAirfoilAOA

Definition at line 3037 of file fvcartesiansolverxd.h.

◆ m_tripAirfoilBndryId

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_tripAirfoilBndryId = nullptr

Definition at line 3042 of file fvcartesiansolverxd.h.

◆ m_tripAirfoilChordLength

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_tripAirfoilChordLength

Definition at line 3036 of file fvcartesiansolverxd.h.

◆ m_tripAirfoilChordPos

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripAirfoilChordPos = nullptr

Definition at line 3039 of file fvcartesiansolverxd.h.

◆ m_tripAirfoilForceDir

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripAirfoilForceDir = nullptr

Definition at line 3040 of file fvcartesiansolverxd.h.

◆ m_tripAirfoilNosePos

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripAirfoilNosePos = nullptr

Definition at line 3038 of file fvcartesiansolverxd.h.

◆ m_tripAirfoilOrientation

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_tripAirfoilOrientation = nullptr

Definition at line 3041 of file fvcartesiansolverxd.h.

◆ m_tripAirfoilSide

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_tripAirfoilSide = nullptr

Definition at line 3043 of file fvcartesiansolverxd.h.

◆ m_tripCellIds

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_tripCellIds

Definition at line 3045 of file fvcartesiansolverxd.h.

◆ m_tripCellOffset

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_tripCellOffset = nullptr

Definition at line 3050 of file fvcartesiansolverxd.h.

◆ m_tripCoords

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::m_tripCoords

Definition at line 3046 of file fvcartesiansolverxd.h.

◆ m_tripCutoffZ

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripCutoffZ = nullptr

Definition at line 3056 of file fvcartesiansolverxd.h.

◆ m_tripDelta1

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripDelta1 = nullptr

Definition at line 3051 of file fvcartesiansolverxd.h.

◆ m_tripDeltaTime

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripDeltaTime = nullptr

Definition at line 3059 of file fvcartesiansolverxd.h.

◆ m_tripDomainWidth

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_tripDomainWidth

Definition at line 3033 of file fvcartesiansolverxd.h.

◆ m_tripG

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripG = nullptr

Definition at line 3060 of file fvcartesiansolverxd.h.

◆ m_tripH1

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripH1 = nullptr

Definition at line 3061 of file fvcartesiansolverxd.h.

◆ m_tripH2

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripH2 = nullptr

Definition at line 3062 of file fvcartesiansolverxd.h.

◆ m_tripMaxAmpFluc

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripMaxAmpFluc = nullptr

Definition at line 3058 of file fvcartesiansolverxd.h.

◆ m_tripMaxAmpSteady

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripMaxAmpSteady = nullptr

Definition at line 3057 of file fvcartesiansolverxd.h.

◆ m_tripModesG

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripModesG = nullptr

Definition at line 3063 of file fvcartesiansolverxd.h.

◆ m_tripModesH1

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripModesH1 = nullptr

Definition at line 3064 of file fvcartesiansolverxd.h.

◆ m_tripModesH2

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripModesH2 = nullptr

Definition at line 3065 of file fvcartesiansolverxd.h.

◆ m_tripNoCells

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_tripNoCells = nullptr

Definition at line 3049 of file fvcartesiansolverxd.h.

◆ m_tripNoModes

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tripNoModes

Definition at line 3028 of file fvcartesiansolverxd.h.

◆ m_tripNoTrips

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tripNoTrips

Definition at line 3027 of file fvcartesiansolverxd.h.

◆ m_tripSeed

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tripSeed

Definition at line 3030 of file fvcartesiansolverxd.h.

◆ m_tripTimeStep

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_tripTimeStep = nullptr

Definition at line 3048 of file fvcartesiansolverxd.h.

◆ m_tripTotalNoCells

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tripTotalNoCells

Definition at line 3029 of file fvcartesiansolverxd.h.

◆ m_tripUseRestart

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_tripUseRestart

Definition at line 3032 of file fvcartesiansolverxd.h.

◆ m_tripXLength

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripXLength = nullptr

Definition at line 3053 of file fvcartesiansolverxd.h.

◆ m_tripXOrigin

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripXOrigin = nullptr

Definition at line 3052 of file fvcartesiansolverxd.h.

◆ m_tripYHeight

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripYHeight = nullptr

Definition at line 3055 of file fvcartesiansolverxd.h.

◆ m_tripYOrigin

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_tripYOrigin = nullptr

Definition at line 3054 of file fvcartesiansolverxd.h.

◆ m_tscatter

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tscatter
protected

Definition at line 2454 of file fvcartesiansolverxd.h.

◆ m_tscatterWaitSome

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tscatterWaitSome
protected

Definition at line 2450 of file fvcartesiansolverxd.h.

◆ m_tsend

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_tsend
protected

Definition at line 2452 of file fvcartesiansolverxd.h.

◆ m_tubeLength

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_tubeLength
protected

Definition at line 2343 of file fvcartesiansolverxd.h.

◆ m_turbFlameSpeed

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_turbFlameSpeed
protected

Definition at line 2334 of file fvcartesiansolverxd.h.

◆ m_turbulenceDegree

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_turbulenceDegree
protected

Definition at line 1793 of file fvcartesiansolverxd.h.

◆ m_twoFlames

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_twoFlames
protected

Definition at line 1586 of file fvcartesiansolverxd.h.

◆ m_UCg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_UCg
protected

Definition at line 1433 of file fvcartesiansolverxd.h.

◆ m_UHg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_UHg
protected

Definition at line 1426 of file fvcartesiansolverxd.h.

◆ m_UInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_UInfinity
protected

Definition at line 2458 of file fvcartesiansolverxd.h.

◆ m_uNormal_r

template<MInt nDim_, class SysEqn >
MFloat * FvCartesianSolverXD< nDim_, SysEqn >::m_uNormal_r {}

Definition at line 3001 of file fvcartesiansolverxd.h.

◆ m_upwindMethod

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_upwindMethod
protected

Definition at line 1975 of file fvcartesiansolverxd.h.

◆ m_useCentralDifferencingSlopes

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_useCentralDifferencingSlopes = false
protected

Definition at line 2035 of file fvcartesiansolverxd.h.

◆ m_useChannelForce

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_useChannelForce
protected

Definition at line 1967 of file fvcartesiansolverxd.h.

◆ m_useCorrectedBurningVelocity

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_useCorrectedBurningVelocity
protected

Definition at line 1645 of file fvcartesiansolverxd.h.

◆ m_useCreateCutFaceMGC

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_useCreateCutFaceMGC
protected

Definition at line 2001 of file fvcartesiansolverxd.h.

◆ m_useMpiStartall

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_useMpiStartall = true

Definition at line 3067 of file fvcartesiansolverxd.h.

◆ m_useSandpaperTrip

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_useSandpaperTrip
protected

Definition at line 1966 of file fvcartesiansolverxd.h.

◆ m_useWallNormalInterpolation

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_useWallNormalInterpolation
protected

Definition at line 1913 of file fvcartesiansolverxd.h.

◆ m_uvErr

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_uvErr = nullptr
protected

Definition at line 1845 of file fvcartesiansolverxd.h.

◆ m_uvInt

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_uvInt = nullptr
protected

Definition at line 1847 of file fvcartesiansolverxd.h.

◆ m_uvRans

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_uvRans = nullptr
protected

Definition at line 1846 of file fvcartesiansolverxd.h.

◆ m_vapourData

template<MInt nDim_, class SysEqn >
std::map<MInt, std::vector<MFloat> > FvCartesianSolverXD< nDim_, SysEqn >::m_vapourData
protected

Definition at line 2052 of file fvcartesiansolverxd.h.

◆ m_variablesName

template<MInt nDim_, class SysEqn >
const MChar** FvCartesianSolverXD< nDim_, SysEqn >::m_variablesName
protected

Definition at line 1665 of file fvcartesiansolverxd.h.

◆ m_VCg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_VCg
protected

Definition at line 1434 of file fvcartesiansolverxd.h.

◆ m_velocityFlameTube

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_velocityFlameTube
protected

Definition at line 1577 of file fvcartesiansolverxd.h.

◆ m_velocityOutlet

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_velocityOutlet
protected

Definition at line 2337 of file fvcartesiansolverxd.h.

◆ m_velocitySponge

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_velocitySponge
protected

Definition at line 2024 of file fvcartesiansolverxd.h.

◆ m_VHg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_VHg
protected

Definition at line 1427 of file fvcartesiansolverxd.h.

◆ m_VInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_VInfinity
protected

Definition at line 2459 of file fvcartesiansolverxd.h.

◆ m_viscousFluxScheme

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::m_viscousFluxScheme
protected

Definition at line 2318 of file fvcartesiansolverxd.h.

◆ m_volumeAcceleration

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_volumeAcceleration = nullptr
protected

Definition at line 1500 of file fvcartesiansolverxd.h.

◆ m_volumeForcingDir

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_volumeForcingDir = -1

Definition at line 2258 of file fvcartesiansolverxd.h.

◆ m_volumeThreshold

template<MInt nDim_, class SysEqn >
constexpr MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_volumeThreshold = nDim == 3 ? 1e-16 : 1e-14
staticconstexpr

Definition at line 203 of file fvcartesiansolverxd.h.

◆ m_vorticity

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::m_vorticity = nullptr
protected

Definition at line 2041 of file fvcartesiansolverxd.h.

◆ m_vorticityName

template<MInt nDim_, class SysEqn >
const MChar** FvCartesianSolverXD< nDim_, SysEqn >::m_vorticityName
protected

Definition at line 1666 of file fvcartesiansolverxd.h.

◆ m_vorticityOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vorticityOutput
protected

Definition at line 1668 of file fvcartesiansolverxd.h.

◆ m_vorticitySize

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_vorticitySize
protected

Definition at line 1669 of file fvcartesiansolverxd.h.

◆ m_vtkTest

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtkTest
protected

Definition at line 1650 of file fvcartesiansolverxd.h.

◆ m_vtuCoordinatesThreshold

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_vtuCoordinatesThreshold = nullptr
protected

Definition at line 1687 of file fvcartesiansolverxd.h.

◆ m_vtuCutCellOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuCutCellOutput
protected

Definition at line 1674 of file fvcartesiansolverxd.h.

◆ m_vtuDensityOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuDensityOutput
protected

Definition at line 1678 of file fvcartesiansolverxd.h.

◆ m_vtuDomainIdOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuDomainIdOutput
protected

Definition at line 1677 of file fvcartesiansolverxd.h.

◆ m_vtuGeometryOutput

template<MInt nDim_, class SysEqn >
std::set<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_vtuGeometryOutput
protected

Definition at line 1675 of file fvcartesiansolverxd.h.

◆ m_vtuGeometryOutputExtended

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuGeometryOutputExtended
protected

Definition at line 1684 of file fvcartesiansolverxd.h.

◆ m_vtuGlobalIdOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuGlobalIdOutput
protected

Definition at line 1676 of file fvcartesiansolverxd.h.

◆ m_vtuLambda2Output

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuLambda2Output
protected

Definition at line 1681 of file fvcartesiansolverxd.h.

◆ m_vtuLevelSetOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuLevelSetOutput
protected

Definition at line 1679 of file fvcartesiansolverxd.h.

◆ m_vtuLevelThreshold

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_vtuLevelThreshold
protected

Definition at line 1686 of file fvcartesiansolverxd.h.

◆ m_vtuQCriterionOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuQCriterionOutput
protected

Definition at line 1680 of file fvcartesiansolverxd.h.

◆ m_vtuSaveHeaderTesting

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuSaveHeaderTesting
protected

Definition at line 1685 of file fvcartesiansolverxd.h.

◆ m_vtuVelocityGradientOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuVelocityGradientOutput
protected

Definition at line 1683 of file fvcartesiansolverxd.h.

◆ m_vtuVorticityOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuVorticityOutput
protected

Definition at line 1682 of file fvcartesiansolverxd.h.

◆ m_vtuWriteGeometryFile

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuWriteGeometryFile
protected

Definition at line 1672 of file fvcartesiansolverxd.h.

◆ m_vtuWriteParticleFile

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuWriteParticleFile
protected

Definition at line 1673 of file fvcartesiansolverxd.h.

◆ m_vtuWritePointData

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_vtuWritePointData
protected

Definition at line 1671 of file fvcartesiansolverxd.h.

◆ m_VVInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_VVInfinity[3]
protected

Definition at line 2469 of file fvcartesiansolverxd.h.

◆ m_wallNormalOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_wallNormalOutput
protected

Definition at line 1912 of file fvcartesiansolverxd.h.

◆ m_wallNormalPointCellIDs

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_wallNormalPointCellIDs
protected

Definition at line 1926 of file fvcartesiansolverxd.h.

◆ m_wallNormalPointCoords

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::m_wallNormalPointCoords
protected

Definition at line 1919 of file fvcartesiansolverxd.h.

◆ m_wallNormalPointDomains

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_wallNormalPointDomains
protected

Definition at line 1925 of file fvcartesiansolverxd.h.

◆ m_wallNormalVectors

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::m_wallNormalVectors
protected

Definition at line 1920 of file fvcartesiansolverxd.h.

◆ m_wallSetupOrigin

template<MInt nDim_, class SysEqn >
std::vector<MFloat> FvCartesianSolverXD< nDim_, SysEqn >::m_wallSetupOrigin
protected

Definition at line 1922 of file fvcartesiansolverxd.h.

◆ m_wallSetupOriginSide

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_wallSetupOriginSide
protected

Definition at line 1923 of file fvcartesiansolverxd.h.

◆ m_wasAdapted

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_wasAdapted = false

Definition at line 2982 of file fvcartesiansolverxd.h.

◆ m_wasBalancedZonal

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_wasBalancedZonal = false

Definition at line 2984 of file fvcartesiansolverxd.h.

◆ m_WCg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_WCg
protected

Definition at line 1435 of file fvcartesiansolverxd.h.

◆ m_weightActiveCell

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_weightActiveCell = 0.1
protected

Definition at line 2432 of file fvcartesiansolverxd.h.

◆ m_weightBaseCell

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_weightBaseCell = 0.0
protected

Definition at line 2430 of file fvcartesiansolverxd.h.

◆ m_weightBc1601

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_weightBc1601 = true
protected

Definition at line 2423 of file fvcartesiansolverxd.h.

◆ m_weightBndryCell

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_weightBndryCell = 1.0
protected

Definition at line 2433 of file fvcartesiansolverxd.h.

◆ m_weightBndryCells

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_weightBndryCells = true
protected

Definition at line 2421 of file fvcartesiansolverxd.h.

◆ m_weightCutOffCells

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_weightCutOffCells = true
protected

Definition at line 2422 of file fvcartesiansolverxd.h.

◆ m_weightInactiveCell

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_weightInactiveCell = true
protected

Definition at line 2424 of file fvcartesiansolverxd.h.

◆ m_weightLeafCell

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_weightLeafCell = 0.05
protected

Definition at line 2431 of file fvcartesiansolverxd.h.

◆ m_weightLvlJumps

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_weightLvlJumps = false
protected

Definition at line 2427 of file fvcartesiansolverxd.h.

◆ m_weightMulitSolverFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_weightMulitSolverFactor = 1.0
protected

Definition at line 2435 of file fvcartesiansolverxd.h.

◆ m_weightNearBndryCell

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_weightNearBndryCell = 0.0
protected

Definition at line 2434 of file fvcartesiansolverxd.h.

◆ m_weightNearBndryCells

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_weightNearBndryCells = false
protected

Definition at line 2425 of file fvcartesiansolverxd.h.

◆ m_weightSmallCells

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_weightSmallCells = false
protected

Definition at line 2428 of file fvcartesiansolverxd.h.

◆ m_WHg

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_WHg
protected

Definition at line 1428 of file fvcartesiansolverxd.h.

◆ m_WInfinity

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_WInfinity
protected

Definition at line 2460 of file fvcartesiansolverxd.h.

◆ m_wmDistance

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_wmDistance
protected

Definition at line 1881 of file fvcartesiansolverxd.h.

◆ m_wmDomainId

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_wmDomainId
protected

Definition at line 1875 of file fvcartesiansolverxd.h.

◆ m_wmGlobalNoSrfcProbeIds

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_wmGlobalNoSrfcProbeIds
protected

Definition at line 1874 of file fvcartesiansolverxd.h.

◆ m_wmImgCellIds

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_wmImgCellIds
protected

Definition at line 1899 of file fvcartesiansolverxd.h.

◆ m_wmImgCoords

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MFloat> > FvCartesianSolverXD< nDim_, SysEqn >::m_wmImgCoords
protected

Definition at line 1901 of file fvcartesiansolverxd.h.

◆ m_wmImgRecvBuffer

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_wmImgRecvBuffer = nullptr
protected

Definition at line 1892 of file fvcartesiansolverxd.h.

◆ m_wmImgRecvIdMap

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_wmImgRecvIdMap = nullptr
protected

Definition at line 1890 of file fvcartesiansolverxd.h.

◆ m_wmImgSendBuffer

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_wmImgSendBuffer = nullptr
protected

Definition at line 1891 of file fvcartesiansolverxd.h.

◆ m_wmImgWMSrfcIds

template<MInt nDim_, class SysEqn >
std::vector<std::vector<MInt> > FvCartesianSolverXD< nDim_, SysEqn >::m_wmImgWMSrfcIds
protected

Definition at line 1900 of file fvcartesiansolverxd.h.

◆ m_wmIterator

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_wmIterator = 0
protected

Definition at line 1883 of file fvcartesiansolverxd.h.

◆ m_wmLES

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_wmLES = false
protected

Definition at line 1877 of file fvcartesiansolverxd.h.

◆ m_wmLocalNoSrfcProbeIds

template<MInt nDim_, class SysEqn >
MInt* FvCartesianSolverXD< nDim_, SysEqn >::m_wmLocalNoSrfcProbeIds = nullptr
protected

Definition at line 1887 of file fvcartesiansolverxd.h.

◆ m_wmNoDomains

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_wmNoDomains
protected

Definition at line 1876 of file fvcartesiansolverxd.h.

◆ m_wmOutput

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_wmOutput = false
protected

Definition at line 1878 of file fvcartesiansolverxd.h.

◆ m_wmSrfcProbeRecvBuffer

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_wmSrfcProbeRecvBuffer = nullptr
protected

Definition at line 1894 of file fvcartesiansolverxd.h.

◆ m_wmSrfcProbeSendBuffer

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_wmSrfcProbeSendBuffer = nullptr
protected

Definition at line 1893 of file fvcartesiansolverxd.h.

◆ m_wmSurfaceProbeIds

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_wmSurfaceProbeIds
protected

Definition at line 1903 of file fvcartesiansolverxd.h.

◆ m_wmSurfaceProbeInterval

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_wmSurfaceProbeInterval = 0
protected

Definition at line 1873 of file fvcartesiansolverxd.h.

◆ m_wmSurfaceProbeSrfcs

template<MInt nDim_, class SysEqn >
std::vector<MInt> FvCartesianSolverXD< nDim_, SysEqn >::m_wmSurfaceProbeSrfcs
protected

Definition at line 1904 of file fvcartesiansolverxd.h.

◆ m_wmSurfaces

template<MInt nDim_, class SysEqn >
std::vector<FvWMSurface<nDim> > FvCartesianSolverXD< nDim_, SysEqn >::m_wmSurfaces
protected

Definition at line 1871 of file fvcartesiansolverxd.h.

◆ m_wmTimeFilter

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_wmTimeFilter = false
protected

Definition at line 1879 of file fvcartesiansolverxd.h.

◆ m_wmUseInterpolation

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_wmUseInterpolation = true
protected

Definition at line 1880 of file fvcartesiansolverxd.h.

◆ m_writeCutCellsToGridFile

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_writeCutCellsToGridFile
protected

Definition at line 1657 of file fvcartesiansolverxd.h.

◆ m_writeOutData

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_writeOutData
protected

Definition at line 1656 of file fvcartesiansolverxd.h.

◆ m_xOffsetFlameTube

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_xOffsetFlameTube
protected

Definition at line 1596 of file fvcartesiansolverxd.h.

◆ m_xOffsetFlameTube2

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_xOffsetFlameTube2
protected

Definition at line 1597 of file fvcartesiansolverxd.h.

◆ m_YInfinity

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::m_YInfinity

Definition at line 1186 of file fvcartesiansolverxd.h.

◆ m_yOffsetFlameTube

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_yOffsetFlameTube
protected

Definition at line 1598 of file fvcartesiansolverxd.h.

◆ m_yOffsetFlameTube2

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_yOffsetFlameTube2
protected

Definition at line 1599 of file fvcartesiansolverxd.h.

◆ m_yOffsetInjector

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::m_yOffsetInjector
protected

Definition at line 1592 of file fvcartesiansolverxd.h.

◆ m_zeroLineCorrection

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_zeroLineCorrection
protected

Definition at line 2364 of file fvcartesiansolverxd.h.

◆ m_zonal

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::m_zonal = false
protected

Definition at line 1788 of file fvcartesiansolverxd.h.

◆ m_zonalAveragingTimeStep

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_zonalAveragingTimeStep = 0
protected

Definition at line 1795 of file fvcartesiansolverxd.h.

◆ m_zonalRestartInterpolationSolverId

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_zonalRestartInterpolationSolverId
protected

Definition at line 1789 of file fvcartesiansolverxd.h.

◆ m_zonalTransferInterval

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::m_zonalTransferInterval = 1
protected

Definition at line 1796 of file fvcartesiansolverxd.h.

◆ massSource

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::massSource

Definition at line 1754 of file fvcartesiansolverxd.h.

◆ nDim

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::nDim = nDim_
staticconstexpr

Definition at line 199 of file fvcartesiansolverxd.h.

◆ noGasSourceBoxes

template<MInt nDim_, class SysEqn >
MInt FvCartesianSolverXD< nDim_, SysEqn >::noGasSourceBoxes

Definition at line 1751 of file fvcartesiansolverxd.h.

◆ nuEffOtherPhase

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::nuEffOtherPhase = nullptr

Definition at line 1740 of file fvcartesiansolverxd.h.

◆ nuTOtherPhase

template<MInt nDim_, class SysEqn >
MFloat* FvCartesianSolverXD< nDim_, SysEqn >::nuTOtherPhase = nullptr

Definition at line 1739 of file fvcartesiansolverxd.h.

◆ phaseName

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::phaseName

Definition at line 1779 of file fvcartesiansolverxd.h.

◆ PV

template<MInt nDim_, class SysEqn >
SysEqn::PrimitiveVariables* FvCartesianSolverXD< nDim_, SysEqn >::PV {}

Definition at line 2078 of file fvcartesiansolverxd.h.

◆ reactionMechanism

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::reactionMechanism

Definition at line 1778 of file fvcartesiansolverxd.h.

◆ RKSemiImplicitFactor

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::RKSemiImplicitFactor

Definition at line 1734 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_noAngleDat

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_noAngleDat = 8
staticconstexprprotected

Definition at line 2685 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_noAngles

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_noAngles = 20
staticconstexprprotected

Definition at line 2684 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_noDat

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_noDat = 76
staticconstexprprotected

Definition at line 2662 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_noJointPdfs

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_noJointPdfs = 6
staticconstexprprotected

Definition at line 2672 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_noPdfPoints

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_noPdfPoints = 100
staticconstexprprotected

Definition at line 2670 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_noPdfs

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_noPdfs = 42
staticconstexprprotected

Definition at line 2671 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_noReClasses

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_noReClasses = 6
staticconstexprprotected

Definition at line 2695 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_noSamples

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_noSamples = 1
staticconstexprprotected

Definition at line 2660 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_noSamples2

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_noSamples2 = 1
staticconstexprprotected

Definition at line 2673 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_noSamples3

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_noSamples3 = 1
staticconstexprprotected

Definition at line 2683 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_noSamples4

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_noSamples4 = 1
staticconstexprprotected

Definition at line 2696 of file fvcartesiansolverxd.h.

◆ s_computeFlowStatistics_thetaSize

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_computeFlowStatistics_thetaSize = 100
staticconstexprprotected

Definition at line 2661 of file fvcartesiansolverxd.h.

◆ s_logData_ic45299_maxNoEmbeddedBodies

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_logData_ic45299_maxNoEmbeddedBodies = 20
staticconstexprprotected

Definition at line 2641 of file fvcartesiansolverxd.h.

◆ s_logData_ic45301_maxNoEmbeddedBodies

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_logData_ic45301_maxNoEmbeddedBodies = 20
staticconstexprprotected

Definition at line 2649 of file fvcartesiansolverxd.h.

◆ s_logData_ic45301_maxNoPressurePoints

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_logData_ic45301_maxNoPressurePoints = 20
staticconstexprprotected

Definition at line 2650 of file fvcartesiansolverxd.h.

◆ s_maxNoEmbeddedBodies

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_maxNoEmbeddedBodies = 20
staticconstexpr

Definition at line 3004 of file fvcartesiansolverxd.h.

◆ s_maxNoSamplingVariables

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_maxNoSamplingVariables = 3
staticconstexpr

Definition at line 1192 of file fvcartesiansolverxd.h.

◆ s_maxNoSpongeZones

template<MInt nDim_, class SysEqn >
constexpr MInt FvCartesianSolverXD< nDim_, SysEqn >::s_maxNoSpongeZones = 10
staticconstexpr

Definition at line 2992 of file fvcartesiansolverxd.h.

◆ SC

template<MInt nDim_, class SysEqn >
SysEqn::SurfaceCoefficients* FvCartesianSolverXD< nDim_, SysEqn >::SC {}

Definition at line 2084 of file fvcartesiansolverxd.h.

◆ schmidtNumber

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::schmidtNumber

Definition at line 1758 of file fvcartesiansolverxd.h.

◆ soretEffect

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::soretEffect

Definition at line 1781 of file fvcartesiansolverxd.h.

◆ speciesMap

template<MInt nDim_, class SysEqn >
std::map<std::string, MInt> FvCartesianSolverXD< nDim_, SysEqn >::speciesMap

Definition at line 1182 of file fvcartesiansolverxd.h.

◆ transportModel

template<MInt nDim_, class SysEqn >
MString FvCartesianSolverXD< nDim_, SysEqn >::transportModel

Definition at line 1780 of file fvcartesiansolverxd.h.

◆ UbulkDiff

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::UbulkDiff

Definition at line 2304 of file fvcartesiansolverxd.h.

◆ uDLim

template<MInt nDim_, class SysEqn >
MFloat FvCartesianSolverXD< nDim_, SysEqn >::uDLim

Definition at line 1760 of file fvcartesiansolverxd.h.

◆ uDLimiter

template<MInt nDim_, class SysEqn >
MBool FvCartesianSolverXD< nDim_, SysEqn >::uDLimiter

Definition at line 1759 of file fvcartesiansolverxd.h.

◆ uOtherPhase

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::uOtherPhase = nullptr

Definition at line 1735 of file fvcartesiansolverxd.h.

◆ uOtherPhaseOld

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::uOtherPhaseOld = nullptr

Definition at line 1736 of file fvcartesiansolverxd.h.

◆ vortOtherPhase

template<MInt nDim_, class SysEqn >
MFloat** FvCartesianSolverXD< nDim_, SysEqn >::vortOtherPhase = nullptr

Definition at line 1738 of file fvcartesiansolverxd.h.


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