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

#include <postprocessingfv.h>

Inheritance diagram for PostProcessingFv< nDim, SysEqn >:
[legend]
Collaboration diagram for PostProcessingFv< nDim, SysEqn >:
[legend]

Public Types

using SolverType = FvCartesianSolverXD< nDim, SysEqn >
 
using Base = PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >
 
- Public Types inherited from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >
using PPGrid = CartesianGrid< nDim >
 
using Cell = typename PPGrid::Cell
 
using GridProxy = typename maia::grid::Proxy< nDim >
 
using Data = PostData< nDim >
 

Public Member Functions

 PostProcessingFv (MInt postprocessingId_, PostData< nDim > *data, SolverType *ppSolver_)
 
virtual ~PostProcessingFv ()
 
void initPostProcessing () override
 
SolverTypesolver () const
 
- Public Member Functions inherited from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >
 PostProcessing (MInt postprocessingId_, PostData< nDim > *data)
 
 ~PostProcessing ()
 Destructor for the massive paralle postprocessing solver. More...
 
void initPostProcessing () override
 Reads all required properties in and prepares for postprocessing. More...
 
void postprocessPreSolve () override
 
void postprocessPostSolve () override
 
void postprocessInSolve (MBool finalTimeStep) override
 
void postprocessSolution () override
 
SolvermSolver () const override
 
DatapostData () const
 
- Public Member Functions inherited from PostProcessingInterface
 PostProcessingInterface (const MInt postprocessingId_)
 
virtual ~PostProcessingInterface ()=default
 
 PostProcessingInterface (const PostProcessingInterface &)=delete
 
PostProcessingInterfaceoperator= (const PostProcessingInterface &)=delete
 
virtual void initPostProcessing ()=0
 
virtual void postprocessPreSolve ()=0
 
virtual void postprocessPostSolve ()=0
 
virtual void postprocessInSolve (MBool finalTimeStep)=0
 
virtual void postprocessSolution ()=0
 
virtual SolvermSolver () const =0
 
MInt a_postprocessingId () const
 

Protected Member Functions

void probeLinePeriodicPost () override
 
void probeLinePeriodic () override
 
void initMovingAverage () override
 Initializes properties and allocates memory for moving averaging. More...
 
void initAveragingProperties () override
 Initialize properties relevant for temporal averaging. More...
 
void initPointSamplingData () override
 
void savePointSamplingData () override
 
void initSurfaceSamplingData () override
 
void saveSurfaceSamplingData () override
 
void initVolumeSamplingData () override
 
void saveVolumeSamplingData () override
 
void initSprayData () override
 
void calcVorticity (const MFloatTensor &deriv, MFloat vorticity[nDim *2 - 3]) override
 
void getVorticity (MFloat *const vorticity) override
 
void getVorticityT (MFloat *const vorticity) override
 
void getSampleVarsDerivatives (MInt cellId, const MFloat *&vars)
 
MBool getSampleVarsDerivatives (const MInt cellId, std::vector< MFloat > &vars)
 
MFloatvorticityAtCell (const MInt cellId, const MInt dir) override
 
void getPrimitiveVariables (MInt cellId, MFloat *Xp, MFloat *vars, MInt order) override
 
void computeAcousticSourceTermQe (MFloatScratchSpace &QeI, MFloatScratchSpace &QeIII, MFloatScratchSpace &cSquared, MFloatScratchSpace &drhodt) override
 
void getPrimitiveVarNames (MString *names) const override
 
MFloat getBoundaryHeatFlux (const MInt cellId) const override
 
void vapourPenetration (MFloat spawnCoord[nDim])
 
void vapourMass (const MInt)
 
void advanceDataStep ()
 
void resetDataStep ()
 
- Protected Member Functions inherited from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >
MBool isActive () const
 
void transferSensorWeights ()
 
void initReduceToLevelAvg ()
 Initializes properties for grid level reduction. More...
 
void initTimeStepProperties ()
 Initializes timestep properties for postprocessing. More...
 
void initTimeStepPropertiesSlice ()
 
void initTimeStepPropertiesLine ()
 
virtual void initAveragingProperties ()
 Initialize properties relevant for temporal averaging. More...
 
void initProbePoint ()
 Initializes properties for point probing. More...
 
void initProbeLine ()
 Initializes properties and memory for line probing. More...
 
void initProbeSlice ()
 Initializes properties and memory for slice probing. More...
 
void initSpatialAveraging ()
 
void initProbeArbitraryLine ()
 initializes properties and data for arbitrary line probing More...
 
void initProbeArbitrarySlice ()
 initializes properties and data for arbitrary slice probing More...
 
void initProbeLinePeriodic ()
 
virtual void probeLinePeriodic ()
 
virtual void probeLinePeriodicPost ()
 
virtual void initSprayData ()
 
virtual void computeSprayData ()
 
virtual void writeSprayData ()
 
virtual void initLPTSolutionFile ()
 
virtual void writeLPTSolutionFile ()
 
virtual void initParticleStatistics ()
 
virtual void computeParticleStatistics ()
 
virtual void initPLIsoTurbulenceStatistics ()
 
virtual void computePLIsoTurbulenceStatistics ()
 
virtual void initAverageVariables ()
 allocates memory for averageSolutions() and averageSolutionsInSolve() More...
 
void pp_saveCoarseSolution ()
 
void averageSolutions ()
 Averages solutions. More...
 
virtual void averageSolutionsInSolve ()
 
void computeAndSaveDivergence ()
 
void computeAndSaveMean ()
 
void initAverageSolutionsSlice ()
 Initializes properties for slice averaging. More...
 
void averageSolutionsSlice ()
 
void probeLocation ()
 
void findClosestProbePointsGridCells ()
 
virtual void initPointSamplingData ()
 
virtual void savePointSamplingData ()
 
virtual void initSurfaceSamplingData ()
 
virtual void saveSurfaceSamplingData ()
 
virtual void initVolumeSamplingData ()
 
virtual void saveVolumeSamplingData ()
 
virtual void initIsoTurbulenceStatistics ()
 
virtual void computeIsoTurbulenceStatistics ()
 
void initWritePointData ()
 
void writePointData ()
 
void spatialAveraging ()
 
void spatialAveragingPost ()
 
void createCellToMap1D (std::map< MFloat, MInt, coord_comp_1d_ > &coordinates, std::map< MFloat, MFloat, coord_comp_1d_ > &cell_to_map)
 
void createCellToMap2D (std::map< std::pair< MFloat, MFloat >, MInt, coord_comp_2d_ > &coordinates, std::map< std::pair< MFloat, MFloat >, std::pair< MFloat, MFloat >, coord_comp_2d_ > &cell_to_map)
 
void probeLine ()
 
void probeLinePre ()
 
void probeLinePost ()
 
void probeSlice ()
 
void probeSliceIn ()
 
void probeSlicePre ()
 
void probeSlicePost ()
 
void collectMinLvlCells ()
 
void findContainingCell (const MFloat *coord, MInt &cellId)
 
void probeArbitraryLine ()
 
void probeArbitraryLinePost ()
 
void probeArbitrarySlice ()
 
void probeArbitrarySlicePost ()
 
virtual void initMovingAverage ()
 Initializes properties and allocates memory for moving averaging. More...
 
void movingAverage ()
 
void movingAveragePost ()
 
void initCorrelation ()
 
void initPeriodicSliceAverage ()
 Initializes the periodic averaging on a slice. More...
 
void periodicSliceAverage ()
 
MInt findNearestGridCell (const MFloat *coord)
 
void movePointsToGrid (MFloat *in_points, MInt in_noPoints, MInt in_moveType)
 
void getSampleVariables (MInt cellId, const MFloat *&vars, MBool mode)
 
void getSampleVariables (MInt const cellId, std::vector< MFloat > &vars)
 
void calcSamplingVar (const MInt cellId, const MInt sampleVarId, MFloat *const vars)
 
void saveSliceAiaFileFormat (const MInt step, const MInt noVars, MFloatScratchSpace &vars, const MInt sliceId)
 
MFloat calcDivergence (const MInt cellIdSolver)
 
virtual void calcVorticity (const MFloatTensor &deriv, MFloat vorticity[nDim *2 - 3])
 
virtual void getVorticity (MFloat *const vorticity)
 
virtual void getVorticityT (MFloat *const vorticity)
 
virtual void getPrimitiveVariables (MInt, MFloat *, MFloat *, MInt)
 
virtual void computeAcousticSourceTermQe (MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &)
 
void getSampleVarsDerivatives (const MInt cellId, const MFloat *&vars)
 
MBool getSampleVarsDerivatives (const MInt, std::vector< MFloat > &)
 
virtual MFloatvorticityAtCell (const MInt cellId, const MInt dir)
 
virtual MFloat getBoundaryHeatFlux (const MInt cellId) const
 
virtual void getPrimitiveVarNames (MString *names) const
 
void neededMeanVarsForSourceTerm (const MInt sourceTerm, std::vector< MInt > &meanVars) const
 
MBool isMeanFile ()
 

Protected Attributes

std::unique_ptr< PointData< nDim, SolverType > > m_pointData
 
std::unique_ptr< SurfaceData< nDim, SolverType > > m_surfaceData
 
std::unique_ptr< VolumeData< nDim, SolverType > > m_volumeData
 
- Protected Attributes inherited from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >
MInt m_noPostprocessingOps
 
MStringm_postprocessingOps
 
tvecpost m_postprocessingSolution
 
std::vector< tvecpostm_postprocessingMethods
 
std::vector< std::vector< MString > > m_postprocessingMethodsDesc
 
Datam_postData
 
MInt m_noVariables
 
MBool m_square
 
MBool m_skewness
 
MBool m_kurtosis
 
MBool m_computeAndSaveMean
 
MBool m_twoPass
 
MBool m_useKahan
 
MBool m_correlation
 
std::vector< MInt > * m_cell2globalIndex
 
MIntm_noPeriodicSliceCells
 
MFloat ** m_sliceAverage
 
MInt m_globalnoSlicePositions
 
std::multimap< MFloat, MFloatm_sliceGlobalPositions
 
MBool m_averageVorticity
 
MBool m_averageSpeedOfSound
 
MFloat m_gamma
 
MInt m_movingAverageStartTimestep
 
MInt m_movingAverageStopTimestep
 
MInt m_movingAverageInterval
 
MInt m_movingAverageDataPoints
 
MInt m_movingAverageCounter
 
MFloat ** m_movAvgVariables
 
MInt m_movAvgNoVariables
 
MStringm_movAvgVarNames
 
MInt m_spatialDirection1
 
MInt m_spatialDirection2
 
MFloat m_spatialWeightSinglePoint
 
MFloat m_spatialLvlWeight [20]
 
MIntm_spatialDispls
 
MIntm_spatialVarsDispls
 
MIntm_spatialRecvcnts
 
MIntm_spatialVarsRecvcnts
 
MInt m_spatialCoordSum
 
std::map< MFloat, MInt, coord_comp_1d_m_spatialLineCoordinates
 
std::map< MFloat, MFloat, coord_comp_1d_m_spatialLineCellToMap
 
std::map< MFloat, MInt, coord_comp_1d_m_spatialGlobalLineCoordinates
 
std::map< MFloat, MFloat, coord_comp_1d_m_spatialGlobalLineCellToMap
 
MInt m_spatialLineNoCells
 
MFloatm_spatialLineAllVars
 
MFloatm_spatialLineAllCoord
 
std::map< std::pair< MFloat, MFloat >, MInt, coord_comp_2d_m_spatialPlaneCoordinates
 
std::map< std::pair< MFloat, MFloat >, std::pair< MFloat, MFloat >, coord_comp_2d_m_spatialPlaneCellToMap
 
std::map< std::pair< MFloat, MFloat >, MInt, coord_comp_2d_m_spatialGlobalPlaneCoordinates
 
std::map< std::pair< MFloat, MFloat >, std::pair< MFloat, MFloat >, coord_comp_2d_m_spatialGlobalPlaneCellToMap
 
MInt m_spatialPlaneNoCells
 
MFloatm_spatialPlaneAllVars
 
MFloatm_spatialPlaneAllCoord
 
MInt m_noProbeLines
 
MIntm_probeLineDirection
 
MIntm_probeLinePeriodic
 
MFloat ** m_probeLineCoordinates
 
MInt ** m_probeLineIds
 
MIntm_noProbeLineIds
 
MFloat ** m_probeLinePositions
 
MIntm_globalNoProbeLineIds
 
MIntm_probeLineOffsets
 
MInt ** m_noGlobalProbeLineIds
 
MInt m_probeLineInterval
 
MInt m_probeLineStartTimestep
 
MInt m_probeLineStopTimestep
 
MIntm_correlationDirection
 
MIntm_correlationVariableIndex
 
MFloat ** m_correlationCoordinates
 
MInt m_noCorrelationLines
 
MIntm_noCorrelationIds
 
MInt ** m_correlationIds
 
MInt ** m_globalCorrelationIds
 
MFloat ** m_globalCorrelationPositions
 
MIntm_globalNoCorrelationIds
 
MFloat ** m_correlationPositions
 
MInt ** m_correlationIndexMapping
 
MFloat ** m_correlationExchangeVar
 
MFloat ** m_correlationExchangeVarMean
 
MFloat ** m_correlationExchangeVarRMS
 
MFloat ** m_globalCorrelationExchangeVar
 
MFloat ** m_globalCorrelationExchangeVarMean
 
MFloat ** m_globalCorrelationExchangeVarRMS
 
MIntm_probeLineAverageDirection
 
MFloat ** m_probeLineAverageCoordinates
 
MInt ** m_probeLineAverageCoordinatesSign
 
MInt ** m_noProbeLineAverageIds
 
MFloat *** m_globalProbeLineAverageVars
 
MInt m_noProbeLineAverageSteps
 
MInt ** m_globalNoProbeLineAverageIds
 
MInt *** m_probeLineAverageIds
 
MFloat *** m_probeLineAveragePositions
 
MInt m_noProbeSlices
 
MIntm_probeSliceDir
 
MFloatm_probeSliceCoordinate
 
MInt ** m_probeSliceIds
 
MIntm_noProbeSliceIds
 
MFloat ** m_probeSlicePositions
 
MIntm_globalNoProbeSliceIds
 
MIntm_probeSliceOffsets
 
MInt ** m_noGlobalProbeSliceIds
 
MStringm_probeSliceGridNames
 
MStringm_sliceAxis
 
MFloatm_sliceIntercept
 
MBool m_sliceAiaFileFormat
 
MBool m_optimizedSliceIo
 
MIntm_noProbeSliceNoHilbertIds
 
MIntm_noProbeSliceMaxNoHilbertIds
 
MInt ** m_noProbeSliceHilbertInfo
 
MIntm_noProbeSliceNoContHilbertIds
 
MIntm_noProbeSliceMaxNoContHilbertIds
 
MInt ** m_noProbeSliceContHilbertInfo
 
MInt m_probeSliceInterval
 
MInt m_probeSliceStartTimestep
 
MInt m_probeSliceStopTimestep
 
std::vector< MIntm_sliceVarIds
 List of slice variables. More...
 
std::vector< MIntm_noSliceVars
 Number of variables for each slice variable. More...
 
std::vector< std::vector< MString > > m_sliceVarNames
 List of variable names for each slice variable. More...
 
MInt m_noMinLvlIds
 
MIntm_minLvlIds
 
MInt m_movePointsToGrid
 
MBool m_spatialAveraging
 
MFloatm_arbLinePoints
 
MInt m_noArbLines
 
MIntm_noArbLineIds
 
MFloatm_arbLinePointsDistribution
 
MIntm_arbLineHasNewDistribution
 
MIntm_arbLineFull
 
MIntm_moveLinePointsToGrid
 
MIntm_globalNoArbLineIds
 
MInt ** m_arbLineIds
 
MIntm_arbLineOffsets
 
MFloat ** m_arbLineCoordinates
 
MFloatm_arbSlicePoints
 
MInt m_noArbSlices
 
MIntm_noArbSlicePoints
 
MFloatm_arbSlicePointsDistribution
 
MIntm_globalNoArbSlicePoints
 
MInt ** m_arbSliceIds
 
MIntm_arbSliceOffsets
 
MFloat ** m_arbSliceCoordinates
 
MString m_postprocessFileName
 
MFloat ** m_localVars
 
MBool m_averageRestart
 
MInt m_averageInterval
 
MInt m_averageStartTimestep
 
MInt m_averageStopTimestep
 
MInt m_noAveragedVorticities
 
MInt m_noSpeedOfSoundVars
 
MInt m_noSourceVars
 
MBool m_needVorticity
 
MString m_ReStressesAverageFileName
 
MFloat ** m_probeCoordinates
 
MString m_probePath
 
MIntm_probeCellIds
 
std::ofstream * m_probeFileStreams
 
MInt m_noProbePoints
 
MInt m_probeInterval
 
MInt m_probeWriteInterval
 
MString m_pdFileName
 
MInt m_pdStartTimestep
 
MInt m_pdStopTimestep
 
MInt m_pdRestartInterval
 
std::vector< MFloatm_pdPoints
 
std::vector< MIntm_pdCells
 
std::vector< MFloatm_pdVars
 
MInt m_pdNoPoints
 
MInt m_sprayComputeInterval
 
MInt m_sprayWriteInterval
 
MInt m_sprayDataSize
 
MInt m_sprayDataStep
 
MFloat ** m_particleCV
 
MFloat ** m_particlePen
 
MFloat ** m_sprayStat
 
MFloat ** m_sprayTimes
 
MFloat ** m_injectionData
 
MFloat ** m_vapourCV
 
MFloat ** m_vapourPen
 
MInt m_LPTSolutionInterval
 
MBool m_forceOutput
 
std::vector< MIntm_activeSourceTerms
 
std::array< MString, ST::totalNoSourceTermss_sourceTermNames
 
std::set< MIntm_activeMeanVars
 
- Protected Attributes inherited from PostProcessingInterface
MInt m_postprocessingId
 

Private Attributes

SolverTypem_ppSolver
 

Friends

template<MInt nDim_, class ppType >
class PostProcessing
 

Additional Inherited Members

- Public Attributes inherited from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >
MInt m_noLocalVars
 
MInt m_restartTimeStep
 
MBool m_statisticCombustionAnalysis
 
MBool m_acousticAnalysis
 
- Public Attributes inherited from PostProcessingInterface
MBool m_finalTimeStep = false
 
- Protected Types inherited from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >
typedef void(PostProcessing::* tpost) ()
 
typedef std::vector< tposttvecpost
 

Detailed Description

template<MInt nDim, class SysEqn>
class PostProcessingFv< nDim, SysEqn >

Definition at line 26 of file postprocessingfv.h.

Member Typedef Documentation

◆ Base

template<MInt nDim, class SysEqn >
using PostProcessingFv< nDim, SysEqn >::Base = PostProcessing<nDim, PostProcessingFv<nDim, SysEqn> >

Definition at line 34 of file postprocessingfv.h.

◆ SolverType

template<MInt nDim, class SysEqn >
using PostProcessingFv< nDim, SysEqn >::SolverType = FvCartesianSolverXD<nDim, SysEqn>

Definition at line 32 of file postprocessingfv.h.

Constructor & Destructor Documentation

◆ PostProcessingFv()

template<MInt nDim, class SysEqn >
PostProcessingFv< nDim, SysEqn >::PostProcessingFv ( MInt  postprocessingId_,
PostData< nDim > *  data,
SolverType ppSolver_ 
)

Definition at line 14 of file postprocessingfv.cpp.

17 : PostProcessingInterface(postprocessingId_),
19 m_ppSolver = ppSolver_;
20}
SolverType * m_ppSolver

◆ ~PostProcessingFv()

template<MInt nDim, class SysEqn >
PostProcessingFv< nDim, SysEqn >::~PostProcessingFv
virtual

Definition at line 24 of file postprocessingfv.cpp.

24{}

Member Function Documentation

◆ advanceDataStep()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::advanceDataStep ( )
inlineprotected

◆ calcVorticity()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::calcVorticity ( const MFloatTensor deriv,
MFloat  vorticity[nDim *2 - 3] 
)
inlineoverrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 103 of file postprocessingfv.h.

103 {
104 if constexpr(nDim == 2) {
105 vorticity[0] = 0.5 * (deriv(1, 0) - deriv(0, 1));
106 } else { //(nDim ==3)
107 vorticity[0] = 0.5 * (deriv(2, 1) - deriv(1, 2));
108 vorticity[1] = 0.5 * (deriv(0, 2) - deriv(2, 0));
109 vorticity[2] = 0.5 * (deriv(1, 0) - deriv(0, 1));
110 }
111 }

◆ computeAcousticSourceTermQe()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::computeAcousticSourceTermQe ( MFloatScratchSpace QeI,
MFloatScratchSpace QeIII,
MFloatScratchSpace cSquared,
MFloatScratchSpace drhodt 
)
inlineoverrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 123 of file postprocessingfv.h.

124 {
125 solver().computeAcousticSourceTermQe(QeI, QeIII, cSquared, drhodt);
126 };
void computeAcousticSourceTermQe(MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &)
SolverType & solver() const

◆ getBoundaryHeatFlux()

template<MInt nDim, class SysEqn >
MFloat PostProcessingFv< nDim, SysEqn >::getBoundaryHeatFlux ( const MInt  cellId) const
inlineoverrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 129 of file postprocessingfv.h.

129{ return solver().getBoundaryHeatFlux(cellId); };
virtual MFloat getBoundaryHeatFlux(const MInt cellId) const
calculates heat flux of boundary cells

◆ getPrimitiveVariables()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::getPrimitiveVariables ( MInt  cellId,
MFloat Xp,
MFloat vars,
MInt  order 
)
inlineoverrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 119 of file postprocessingfv.h.

119 {
120 solver().getPrimitiveVariables(cellId, Xp, vars, order);
121 };
void getPrimitiveVariables(MInt, MFloat *, MFloat *, MInt)

◆ getPrimitiveVarNames()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::getPrimitiveVarNames ( MString names) const
inlineoverrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 128 of file postprocessingfv.h.

128{ solver().sysEqn().PV->getPrimitiveVariableNames(names); }

◆ getSampleVarsDerivatives() [1/2]

template<MInt nDim, class SysEqn >
MBool PostProcessingFv< nDim, SysEqn >::getSampleVarsDerivatives ( const MInt  cellId,
std::vector< MFloat > &  vars 
)
inlineprotected

Definition at line 115 of file postprocessingfv.h.

115 {
116 return solver().getSampleVarsDerivatives(cellId, vars);
117 };
virtual void getSampleVarsDerivatives(const MInt cellId, const MFloat *&vars)
Access derivatives of primitive variables of a given cell.

◆ getSampleVarsDerivatives() [2/2]

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::getSampleVarsDerivatives ( MInt  cellId,
const MFloat *&  vars 
)
inlineprotected

Definition at line 114 of file postprocessingfv.h.

114{ solver().getSampleVarsDerivatives(cellId, vars); };

◆ getVorticity()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::getVorticity ( MFloat *const  vorticity)
inlineoverrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 112 of file postprocessingfv.h.

112{ solver().getVorticity(&vorticity[0]); };
virtual void getVorticity(MFloat *const vorticity)
wrapper for vorticity computation

◆ getVorticityT()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::getVorticityT ( MFloat *const  vorticity)
inlineoverrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 113 of file postprocessingfv.h.

113{ solver().getVorticityT(&vorticity[0]); };
virtual void getVorticityT(MFloat *const vorticity)
wrapper for vorticity computation (transposed version)

◆ initAveragingProperties()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::initAveragingProperties
overrideprotectedvirtual

◆ initMovingAverage()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::initMovingAverage
overrideprotectedvirtual
Author
Ansgar Niemoeller
Date
09.07.2014

reads properties pp_movingAvgInterval, pp_movingAvgDataPoints (pp_averageVorticity already read in initAveragingVariables)

Parameters
[in]gridpointer to the grid

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 85 of file postprocessingfv.cpp.

85 {
86 TRACE();
87
89
91}
void initMovingAverage() override
Initializes properties and allocates memory for moving averaging.
MInt m_movingAverageInterval

◆ initPointSamplingData()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::initPointSamplingData
overrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 43 of file postprocessingfv.cpp.

43 {
44 TRACE();
46 m_pointData->setInputOutputProperties();
47 m_pointData->init();
48}
This class is responsible for the point data feature. It records the state of all sampling variables ...
Definition: samplingdata.h:164
std::unique_ptr< PointData< nDim, SolverType > > m_pointData

◆ initPostProcessing()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::initPostProcessing
overridevirtual

Implements PostProcessingInterface.

Reimplemented in PostProcessingFvLPT< nDim, SysEqn >.

Definition at line 27 of file postprocessingfv.cpp.

27 {
28 TRACE();
29
31
35
36 // for(MInt i = 0; i < (signed)this->m_activeMeanVars.size(); i++){
37 // solver().m_activeMeanVars.insert(this->m_activeMeanVars[i]);
38 // }
39}
std::set< MInt > m_activeMeanVars
void initPostProcessing() override
std::set< MInt > m_activeMeanVars
MBool m_skewness
MBool m_kurtosis

◆ initSprayData()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::initSprayData
overrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Reimplemented in PostProcessingFvLPT< nDim, SysEqn >.

Definition at line 394 of file postprocessingfv.cpp.

394 {
395 TRACE();
396
398
399 if(solver().domainId() == 0) {
400 cerr << "Allocating Post-processing Fv data!" << endl;
401 }
402
403 const MInt vapourPenSize = nDim == 3 ? 16 : 12;
404 mAlloc(m_vapourPen, m_sprayDataSize, vapourPenSize, "m_vapourPen", F0, AT_);
405 mAlloc(m_vapourCV, m_sprayDataSize, 5 + 2 * nDim, "m_vapourCV", F0, AT_);
406}
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
void initSprayData() override
MInt m_sprayDataSize
MFloat ** m_vapourCV
MFloat ** m_vapourPen
int32_t MInt
Definition: maiatypes.h:62

◆ initSurfaceSamplingData()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::initSurfaceSamplingData
overrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 57 of file postprocessingfv.cpp.

57 {
58 TRACE();
60 m_surfaceData->setInputOutputProperties();
61 m_surfaceData->init();
62}
std::unique_ptr< SurfaceData< nDim, SolverType > > m_surfaceData
Surface data sampling class. Records all sampling variables on all surface elements and outputs addit...
Definition: samplingdata.h:190

◆ initVolumeSamplingData()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::initVolumeSamplingData
overrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 71 of file postprocessingfv.cpp.

71 {
72 TRACE();
74 m_volumeData->setInputOutputProperties();
75 m_volumeData->init();
76}
std::unique_ptr< VolumeData< nDim, SolverType > > m_volumeData
Class to handle sampling of volume data.
Definition: samplingdata.h:220

◆ probeLinePeriodic()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::probeLinePeriodic
overrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 124 of file postprocessingfv.cpp.

124 {
125 TRACE();
126
127 using namespace maia::parallel_io;
128
129 // check for average timestep or postprocessFileName
132 || globalTimeStep == 0) {
133 MInt noVars = m_noVariables;
134 if(m_postData->isMeanFile()) {
135 noVars = m_postData->fileNoVars();
136 }
137
138 MInt step = (m_postData->isMeanFile()) ? 0 : globalTimeStep;
139 stringstream fileName;
140 fileName << solver().outputDir() << "probeLines_" << step << ParallelIo::fileExt();
141 ParallelIo parallelIo(fileName.str(), maia::parallel_io::PIO_REPLACE, solver().mpiComm());
142
143 // define all arrays in output file
144 for(MInt probeLineId = 0; probeLineId < m_noProbeLines; probeLineId++) {
145 stringstream varNameBase;
146 varNameBase << "line_" << probeLineId;
147 string coordName = varNameBase.str() + "_coordinates";
148
149 parallelIo.defineArray(PIO_FLOAT, coordName, m_globalNoProbeLineIds[probeLineId]);
150 parallelIo.setAttribute(probeLineId, "lineId", coordName);
151
152 varNameBase << "_var_";
153 for(MInt varId = 0; varId < noVars; varId++) {
154 stringstream varName;
155 varName << varNameBase.str() << varId;
156 parallelIo.defineArray(PIO_FLOAT, varName.str(), m_globalNoProbeLineIds[probeLineId]);
157 parallelIo.setAttribute(probeLineId, "lineId", varName.str());
158 }
159 }
160
161 for(MInt probeLineId = 0; probeLineId < m_noProbeLines; probeLineId++) {
162 if(m_probeLineDirection[probeLineId] < 0 || m_probeLineDirection[probeLineId] >= nDim) {
163 continue;
164 }
165
166 m_log << " ^ * probe line timestep " << globalTimeStep << " for line #" << probeLineId << endl;
167
168 MInt noIds = m_noProbeLineIds[probeLineId];
169 if(noIds == 0) {
170 noIds = 1;
171 } // avoid dereferencing array with length 0 in writeArray(...)
172 ScratchSpace<MFloat> vars(noVars * noIds, "vars", FUN_);
173
174 MInt probeId;
175 const MFloat* cellVars = 0;
176
177 // collect local variables
178 for(MInt i = 0; i < m_noProbeLineIds[probeLineId]; i++) {
179 probeId = m_probeLineIds[probeLineId][i];
181 for(MInt varId = 0; varId < noVars; varId++) {
182 vars[i * noVars + varId] = cellVars[varId];
183 }
184 }
185
186 parallelIo.setOffset(m_noProbeLineIds[probeLineId], m_probeLineOffsets[probeLineId]);
187
188 // write to file
189 stringstream varNameBase;
190 varNameBase << "line_" << probeLineId;
191 string coordName = varNameBase.str() + "_coordinates";
192 parallelIo.writeArray(m_probeLinePositions[probeLineId], coordName);
193
194 varNameBase << "_var_";
195 for(MInt varId = 0; varId < noVars; varId++) { // write all variables to file
196 stringstream varName;
197 varName << varNameBase.str() << varId;
198 parallelIo.writeArray(&(vars[varId]), varName.str(), noVars);
199 }
200 }
201 } else {
202 // PROBE_LINE_POST
203 //--------------------------------------------------------------------------
204 //--------------------------------------------------------------------------
205
206 for(MInt probeLineId = 0; probeLineId < m_noProbeLines; probeLineId++) {
207 if(m_probeLineAverageDirection[probeLineId] < 0 || m_probeLineAverageDirection[probeLineId] >= nDim) {
208 continue;
209 }
210
211 MInt probeId;
212
213 if(m_probeLineDirection[probeLineId] == 1 || m_probeLineDirection[probeLineId] == 0) {
214 MInt noVars;
215 if(solver().m_rans) {
216 noVars = m_noVariables + 1; // k
217 } else {
218 noVars = postData().noVariables();
219 }
220
221 MInt noIds = m_globalNoProbeLineIds[probeLineId];
222 if(noIds == 0) {
223 noIds = 1;
224 }
225
226 // ScratchSpace<MFloat> vars( noVars*ids, "vars", FUN_ );
227 ScratchSpace<MFloat> avgVars(noVars * noIds, "avgVars", FUN_);
228 ScratchSpace<MFloat> globalAvgVars(noVars * noIds, "globalAvgVars", FUN_);
229 avgVars.fill(F0);
230 globalAvgVars.fill(F0);
231
232 if(solver().m_rans) {
233 // RANS SOLVER
234 for(MInt p = 0; p < m_globalNoProbeLineIds[probeLineId]; p++) {
235 // collect local variables
236 for(MInt i = 0; i < m_noProbeLineAverageIds[probeLineId][p]; i++) {
237 probeId = m_probeLineAverageIds[probeLineId][p][i];
238 const MFloat* cellVars = 0;
240
241 // RANS Variables
242 for(MInt varId = 0; varId < m_noVariables; varId++) {
243 avgVars[p * noVars + varId] += cellVars[varId];
244 }
245
246 // turbulent kinetic energy
247 MFloat k = F0;
248 const MFloat* cellVarsDeriv1;
249 getSampleVarsDerivatives(probeId, cellVarsDeriv1);
250 const MFloatTensor deriv1(const_cast<MFloat*>(cellVarsDeriv1), m_noVariables, nDim);
251 MFloat SijSij = F0;
252 for(MInt d1 = 0; d1 < nDim; d1++) {
253 for(MInt d2 = 0; d2 < nDim; d2++) {
254 MFloat sij = 0.5 * (deriv1(d1, d2) + deriv1(d2, d1));
255 SijSij += sij * sij;
256 }
257 }
258
259 k = sqrt(2.0 * SijSij / 0.09) * cellVars[5] / solver().sysEqn().m_Re0;
260
261 avgVars[p * noVars + m_noVariables] += k;
262 }
263 }
264 } else {
265 // LES SOLVER
266 for(MInt p = 0; p < m_globalNoProbeLineIds[probeLineId]; p++) {
267 // collect local variables
268 for(MInt i = 0; i < m_noProbeLineAverageIds[probeLineId][p]; i++) {
269 // const MFloat* cellVars = 0;
270 probeId = m_probeLineAverageIds[probeLineId][p][i];
271 // PostProcessingBlock<nDim, Block>::getSampleVariables( probeId, cellVars );
272 MInt dataId = convertIdParent(solver(), postData(), probeId);
273 if(dataId != -1) {
274 for(MInt varId = 0; varId < noVars; varId++) {
275 avgVars[p * noVars + varId] += postData().m_averagedVars[dataId][varId];
276 }
277
278 // SijSij
279 // calculating strain rate tensor Sij = 0.5(dui/dxj + duj/dxi)
280 std::vector<std::vector<MFloat>> du(nDim, std::vector<MFloat>(nDim, F0));
281 const MInt recData = solver().a_reconstructionData(probeId);
282 std::vector<MFloat> u{postData().m_averagedVars[dataId][0], postData().m_averagedVars[dataId][1],
283 postData().m_averagedVars[dataId][2]};
284
285 for(MInt nghbr = 0; nghbr < solver().a_noReconstructionNeighbors(probeId); nghbr++) {
286 const MInt recNghbrId = solver().a_reconstructionNeighborId(probeId, nghbr);
287 if(recNghbrId > -1 && recNghbrId < solver().noInternalCells()) {
288 MInt dataNgbhrId = convertIdParent(solver(), postData(), recNghbrId);
289 if(dataNgbhrId > -1) {
290 // std::ignore = recData;
291 // std::ignore = u;
292 const MFloat recConst_x = solver().m_reconstructionConstants[nDim * (recData + nghbr) + 0];
293 const MFloat recConst_y = solver().m_reconstructionConstants[nDim * (recData + nghbr) + 1];
294 const MFloat recConst_z = solver().m_reconstructionConstants[nDim * (recData + nghbr) + 2];
295 for(MInt dim = 0; dim < nDim; ++dim) {
296 MFloat delta_u = postData().m_averagedVars[dataNgbhrId][dim] - u[dim];
297 du[dim][0] += recConst_x * delta_u;
298 du[dim][1] += recConst_y * delta_u;
299 du[dim][2] += recConst_z * delta_u;
300 }
301 }
302 }
303 }
304 std::vector<std::vector<MFloat>> sij(nDim, std::vector<MFloat>(nDim, F0));
305 MFloat SijSij = F0;
306 for(MInt d1 = 0; d1 < nDim; d1++) {
307 for(MInt d2 = 0; d2 < nDim; d2++) {
308 sij[d1][d2] = 0.5 * (du[d1][d2] + du[d2][d1]);
309 SijSij += sij[d1][d2] * sij[d1][d2];
310 }
311 }
312 avgVars[p * noVars + (noVars - 1)] += SijSij;
313 }
314 }
315 }
316 }
317
318 MPI_Allreduce(&avgVars[0], &globalAvgVars[0], noVars * noIds, MPI_DOUBLE, MPI_SUM, solver().mpiComm(), AT_,
319 "avgVars", "globalAvgVars");
320
321
322 if(solver().domainId() == 0) {
323 // Calculate spanwise average
324 //--------------------------------------------------------------------
325 MInt tempId = 0;
326 for(MInt p = 0; p < m_globalNoProbeLineIds[probeLineId]; p++) {
327 for(MInt varId = 0; varId < noVars; varId++) {
328 m_globalProbeLineAverageVars[probeLineId][p][varId] =
329 globalAvgVars[tempId] / m_globalNoProbeLineAverageIds[probeLineId][p];
330 tempId++;
331 }
332 }
333
334 // vector<MInt> outputIds;
335 // if(solver().m_rans) {
336 // outputIds = {0, 1, 2, 3, 4, 5, 6};
337 // } else {
338 // outputIds = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
339 // }
340 //--------------------------------------------------------------------
341
342
343 // OUTPUT
344 //--------------------------------------------------------------------
345 // Sorting
346 ScratchSpace<MFloat> sorting(m_globalNoProbeLineIds[probeLineId], "sorting", FUN_);
347 vector<int> sortingIndex(m_globalNoProbeLineIds[probeLineId]);
348 for(MInt p = 0; p < m_globalNoProbeLineIds[probeLineId]; p++) {
349 sorting[p] = m_probeLineAverageCoordinates[probeLineId][p];
350 }
351 int x = 0;
352 iota(sortingIndex.begin(), sortingIndex.end(), x++); // Initializing
353 sort(sortingIndex.begin(), sortingIndex.end(), [&](int i, int j) { return sorting[i] < sorting[j]; });
354
355 // Write text file
356 MString dir;
357 if(solver().m_rans) {
358 dir = "#y um vm wm rhom pm num ym k";
359 } else {
360 if(solver().m_solverId == 1) {
361 dir = "#y um vm wm rhom pm num ym u'u' u'v' u'w' v'v' v'w' w'w' p'";
362 } else {
363 dir = "#y um vm wm rhom pm u'u' u'v' u'w' v'v' v'w' w'w' p' SijSij";
364 }
365 }
366 ofstream lineprob;
367 lineprob.precision(8);
368 MString fname = "probeLine" + to_string(solver().m_solverId) + "_" + to_string(probeLineId) + "_"
369 + to_string(globalTimeStep) + ".txt";
370 cerr << "Writing " << fname << endl;
371 lineprob.open(fname);
372 for(MInt p = 0; p < m_globalNoProbeLineIds[probeLineId]; p++) {
373 MInt index = sortingIndex[p];
374 MString line = "";
375 line.append(to_string(m_probeLineAverageCoordinates[probeLineId][index]));
376 if(p == 0) lineprob << dir << endl;
377 for(MInt k = 0; k < noVars; k++) {
378 MInt varId = k; // outputIds[k];
379 line.append(" " + to_string(m_globalProbeLineAverageVars[probeLineId][index][varId]));
380 }
381 lineprob << line << endl;
382 }
383 lineprob.close();
384 //--------------------------------------------------------------------
385 }
386 } else if(m_probeLineDirection[probeLineId] == 2) {
387 //
388 }
389 }
390 }
391}
MInt & a_reconstructionData(const MInt cellId)
Returns reconstruction data offset i of the cell cellId.
MInt & a_reconstructionNeighborId(const MInt cellId, const MInt nghbrNo)
Returns reconstruction neighbor n of the cell cellId.
std::vector< MFloat > m_reconstructionConstants
MInt & a_noReconstructionNeighbors(const MInt cellId)
Returns the noRcnstrctnNghbrIds of the cell cellId.
MInt fileNoVars() const
Definition: postdata.h:178
MBool isMeanFile() const
Definition: postdata.h:177
MFloat ** m_averagedVars
Definition: postdata.h:257
MInt noVariables() const
Return the number of primitive variables.
Definition: postdata.h:165
void getSampleVarsDerivatives(MInt cellId, const MFloat *&vars)
MInt * m_globalNoProbeLineIds
MInt * m_probeLineDirection
MInt m_averageStopTimestep
MInt * m_probeLineOffsets
MInt ** m_noProbeLineAverageIds
MInt ** m_globalNoProbeLineAverageIds
MInt m_noVariables
MInt ** m_probeLineIds
Data & postData() const
MFloat *** m_globalProbeLineAverageVars
MInt * m_probeLineAverageDirection
Data * m_postData
MInt m_averageStartTimestep
MInt m_noProbeLines
MFloat ** m_probeLinePositions
MInt * m_noProbeLineIds
MInt *** m_probeLineAverageIds
MInt m_averageInterval
void getSampleVariables(MInt cellId, const MFloat *&vars, MBool mode)
MFloat ** m_probeLineAverageCoordinates
This class is a ScratchSpace.
Definition: scratch.h:758
MString outputDir() const
Return the directory for output files.
Definition: solver.h:407
MInt convertIdParent(SolverA &solverA, SolverB &solverB, const MInt solverAId)
Conversion from solverA id to the solverB id If no cell on the same level is found,...
Definition: couplingutils.h:46
MInt globalTimeStep
InfoOutFile m_log
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52
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
constexpr std::underlying_type< FcCell >::type p(const FcCell property)
Converts property name to underlying integer value.
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
const MInt PIO_REPLACE
Definition: parallelio.h:36
PARALLELIO_DEFAULT_BACKEND ParallelIo
Definition: parallelio.h:292

◆ probeLinePeriodicPost()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::probeLinePeriodicPost
overrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 105 of file postprocessingfv.cpp.

105 {
106 TRACE();
107
108 if(!solver().grid().isActive()) return;
109
110 if(m_postprocessFileName != "") {
111 m_log << " ^ * probe line for file " << m_postprocessFileName << endl;
112 // TERMM(1, "FIXME untested");
113 IF_CONSTEXPR(SysEqn::m_noRansEquations == 0) postData().loadMeanFile(m_postprocessFileName);
115 } else {
119 }
120 }
121}
void loadSampleVariables(MInt timeStep)
load variables for the specified timeStep
void probeLinePeriodic() override
MBool isActive() const
MString m_postprocessFileName

◆ resetDataStep()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::resetDataStep ( )
inlineprotected

Definition at line 134 of file postprocessingfv.h.

134{ m_sprayDataStep = 0; };

◆ savePointSamplingData()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::savePointSamplingData
overrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 51 of file postprocessingfv.cpp.

51 {
52 if(!isActive()) return;
54}
MBool m_finalTimeStep

◆ saveSurfaceSamplingData()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::saveSurfaceSamplingData
overrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 65 of file postprocessingfv.cpp.

65 {
66 if(!isActive()) return;
68}

◆ saveVolumeSamplingData()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::saveVolumeSamplingData
overrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 79 of file postprocessingfv.cpp.

79 {
80 if(!isActive()) return;
82}

◆ solver()

template<MInt nDim, class SysEqn >
SolverType & PostProcessingFv< nDim, SysEqn >::solver ( ) const
inline

Definition at line 79 of file postprocessingfv.h.

79{ return *m_ppSolver; }

◆ vapourMass()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::vapourMass ( const MInt  speciesId)
protected

Definition at line 409 of file postprocessingfv.cpp.

409 {
410 TRACE();
411
412 // calculate dimensionless vapour information from finite volume solver
413 const MBool hasSpecies = solver().m_noSpecies > 0 ? true : false;
414
415 // reset
416 for(MInt i = 0; i < 5 + 2 * nDim; i++) {
418 }
419
420 if(solver().isActive()) {
421 for(MInt cellId = 0; cellId < solver().noInternalCells(); cellId++) {
422 if(!solver().c_isLeafCell(cellId)) continue;
423 if(solver().a_isInactive(cellId)) continue;
424 const MFloat cellV = 1 / solver().a_FcellVolume(cellId);
425 const MFloat rho = solver().a_variable(cellId, solver().m_sysEqn.CV->RHO);
426 const MFloat rhoY = hasSpecies ? solver().a_variable(cellId, solver().m_sysEqn.CV->RHO_Y[speciesId]) : 0;
427
428 m_vapourCV[m_sprayDataStep][0] += cellV * rhoY;
429 m_vapourCV[m_sprayDataStep][1] += cellV * (rho - rhoY);
430 m_vapourCV[m_sprayDataStep][2] += cellV * solver().a_variable(cellId, solver().m_sysEqn.CV->RHO_E);
431 m_vapourCV[m_sprayDataStep][3] += cellV * solver().a_variable(cellId, solver().m_sysEqn.CV->RHO_U);
432 m_vapourCV[m_sprayDataStep][4] += cellV * solver().a_variable(cellId, solver().m_sysEqn.CV->RHO_V);
433 IF_CONSTEXPR(nDim == 3) {
434 m_vapourCV[m_sprayDataStep][5] += cellV * solver().a_variable(cellId, solver().m_sysEqn.CV->RHO_W);
435 }
436 }
437 if(solver().m_hasExternalSource) {
438 MInt numVars = 2 + nDim;
439 for(MInt i = 0; i < numVars; i++) {
440 MFloat source = (solver().m_vapourData.find(globalTimeStep)->second)[i];
441 m_vapourCV[m_sprayDataStep][3 + nDim + i] = source;
442 }
443 }
444 }
445}
MBool a_isInactive(const MInt cellId) const
MFloat & a_variable(const MInt cellId, const MInt varId)
Returns conservative variable v of the cell cellId for variables varId.
MInt noInternalCells() const override
Return the number of internal cells within this solver.
SysEqn::ConservativeVariables * CV
std::map< MInt, std::vector< MFloat > > m_vapourData
MBool c_isLeafCell(const MInt cellId) const
MFloat & a_FcellVolume(const MInt cellId) override
Returns the inverse cell volume of the cell from the fvcellcollector cellId.
bool MBool
Definition: maiatypes.h:58
void const MInt cellId
Definition: collector.h:239

◆ vapourPenetration()

template<MInt nDim, class SysEqn >
void PostProcessingFv< nDim, SysEqn >::vapourPenetration ( MFloat  spawnCoord[nDim])
protected

Definition at line 448 of file postprocessingfv.cpp.

448 {
449 TRACE();
450
451 const MInt noYLimits = 3;
452 const MInt refLvl = 10;
453 const MFloat yLimitRefLvl = 0.001;
454
455 // concentration limits for differecent penetration lengths
456 array<MFloat, noYLimits> yLimits{};
457 yLimits[0] = 0.001;
458 yLimits[1] = 0.01;
459 yLimits[2] = 0.05;
460
461 // x,y,z, axial penetration and distance
462 array<array<MFloat, noYLimits>, nDim + 1> maxVapPen{};
463 array<MFloat, nDim> maxVapPenRefLvl{};
464 for(MInt n = 0; n < noYLimits; n++) {
465 for(MInt i = 0; i < nDim + 1; i++) {
466 maxVapPen[i][n] = 0.0;
467 }
468 }
469 for(MInt i = 0; i < nDim; i++) {
470 maxVapPenRefLvl[i] = 0.0;
471 }
472
473 auto assignLarger = [&](MFloat& A, MFloat b) {
474 if(b > A) {
475 A = b;
476 }
477 };
478
479 const MBool hasSpecies = solver().m_noSpecies > 0 ? true : false;
480
481 if(solver().isActive() && hasSpecies) {
482 for(MInt cellId = 0; cellId < solver().noInternalCells(); cellId++) {
483 if(solver().a_isInactive(cellId)) continue;
484 if(solver().c_isLeafCell(cellId)) {
485 const MFloat rho = solver().a_variable(cellId, nDim + 1);
486 const MFloat Y = hasSpecies ? solver().a_variable(cellId, nDim + 2) / rho : 0;
487 array<MFloat, nDim> centerCoords{};
488
489 for(MInt n = 0; n < noYLimits; n++) {
490 if(Y > yLimits[n]) {
491 for(MInt i = 0; i < nDim; i++) {
492 centerCoords[i] = solver().a_coordinate(cellId, i);
493 }
494 array<MFloat, nDim + 1> distance{};
495 for(int i = 0; i < nDim; i++) {
496 distance[i] = abs(centerCoords[i] - spawnCoord[i]);
497 }
498 distance[nDim] = maia::math::distance(centerCoords, spawnCoord);
499
500 for(int i = 0; i < nDim + 1; i++) {
501 assignLarger(maxVapPen[i][n], distance[i]);
502 }
503 } else {
504 break;
505 }
506 }
507 } else {
508 if(solver().a_level(cellId) == refLvl) {
509 solver().reduceData(cellId, &solver().a_variable(0, 0), solver().CV->noVariables);
510 const MFloat rho = solver().a_variable(cellId, nDim + 1);
511 const MFloat Y = hasSpecies ? solver().a_variable(cellId, nDim + 2) / rho : 0;
512 if(Y > yLimitRefLvl) {
513 for(MInt i = 0; i < nDim; i++) {
514 assignLarger(maxVapPenRefLvl[i], solver().a_coordinate(cellId, i));
515 }
516 }
517 }
518 }
519 }
520 }
521
522 // save data:
523 MInt it = 0;
524 for(MInt n = 0; n < noYLimits; n++) {
525 // absolute distance
526 m_vapourPen[m_sprayDataStep][it++] = maxVapPen[nDim][n];
527 // x/y/z-distance
528 for(MInt i = 0; i < nDim; i++) {
529 m_vapourPen[m_sprayDataStep][it++] = maxVapPen[i][n];
530 }
531 }
532 for(MInt i = 0; i < nDim; i++) {
533 m_vapourPen[m_sprayDataStep][it++] = maxVapPenRefLvl[i];
534 }
535}
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 & a_coordinate(const MInt cellId, const MInt dir)
Returns the coordinate of the cell from the fvcellcollector cellId for dimension dir.
MInt noVariables() const override
Return the number of primitive variables.
MFloat distance(const MFloat *a, const MFloat *b)
Definition: maiamath.h:249

◆ vorticityAtCell()

template<MInt nDim, class SysEqn >
MFloat & PostProcessingFv< nDim, SysEqn >::vorticityAtCell ( const MInt  cellId,
const MInt  dir 
)
inlineoverrideprotectedvirtual

Reimplemented from PostProcessing< nDim, PostProcessingFv< nDim, SysEqn > >.

Definition at line 118 of file postprocessingfv.h.

118{ return solver().vorticityAtCell(cellId, dir); };
virtual MFloat & vorticityAtCell(const MInt cellId, const MInt dir)

Friends And Related Function Documentation

◆ PostProcessing

template<MInt nDim, class SysEqn >
template<MInt nDim_, class ppType >
friend class PostProcessing
friend

Definition at line 29 of file postprocessingfv.h.

Member Data Documentation

◆ m_pointData

template<MInt nDim, class SysEqn >
std::unique_ptr<PointData<nDim, SolverType> > PostProcessingFv< nDim, SysEqn >::m_pointData
protected

Definition at line 136 of file postprocessingfv.h.

◆ m_ppSolver

template<MInt nDim, class SysEqn >
SolverType* PostProcessingFv< nDim, SysEqn >::m_ppSolver
private

Definition at line 82 of file postprocessingfv.h.

◆ m_surfaceData

template<MInt nDim, class SysEqn >
std::unique_ptr<SurfaceData<nDim, SolverType> > PostProcessingFv< nDim, SysEqn >::m_surfaceData
protected

Definition at line 137 of file postprocessingfv.h.

◆ m_volumeData

template<MInt nDim, class SysEqn >
std::unique_ptr<VolumeData<nDim, SolverType> > PostProcessingFv< nDim, SysEqn >::m_volumeData
protected

Definition at line 138 of file postprocessingfv.h.


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