MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
postprocessingfv.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef POSTPROCESSINGFV_H_
8#define POSTPROCESSINGFV_H_
9
10#include <array>
11#include <map>
12#include <set>
13#include <vector>
14
15#include "globals.h"
16#include "postdata.h"
17#include "postprocessing.h"
18#include "samplingdata.h"
19
21
22template <MInt nDim, class SysEqn>
24
25template <MInt nDim, class SysEqn>
26class PostProcessingFv : public PostProcessing<nDim, PostProcessingFv<nDim, SysEqn>> {
27 private:
28 template <MInt nDim_, class ppType>
29 friend class PostProcessing;
30
31 public:
33
35 using Base::isActive;
54 using Base::m_postData;
68 using Base::m_vapourCV;
70 using Base::postData;
71
72 // Constructor
73 PostProcessingFv(MInt postprocessingId_, PostData<nDim>* data, SolverType* ppSolver_);
74
75 virtual ~PostProcessingFv();
76
77 void initPostProcessing() override;
78
79 SolverType& solver() const { return *m_ppSolver; }
80
81 private:
83
84 protected:
85 void probeLinePeriodicPost() override;
86 void probeLinePeriodic() override;
87 void initMovingAverage() override;
88
89 void initAveragingProperties() override;
90
91 void initPointSamplingData() override;
92 void savePointSamplingData() override;
93
94 void initSurfaceSamplingData() override;
95 void saveSurfaceSamplingData() override;
96
97 void initVolumeSamplingData() override;
98 void saveVolumeSamplingData() override;
99
100 void initSprayData() override;
101
102 // TODO labels:FV Has to be overriden for FV because it calculates vorticity = 0.5 * nabla x u
103 void calcVorticity(const MFloatTensor& deriv, MFloat vorticity[nDim * 2 - 3]) override {
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 }
112 void getVorticity(MFloat* const vorticity) override { solver().getVorticity(&vorticity[0]); };
113 void getVorticityT(MFloat* const vorticity) override { solver().getVorticityT(&vorticity[0]); };
114 void getSampleVarsDerivatives(MInt cellId, const MFloat*& vars) { solver().getSampleVarsDerivatives(cellId, vars); };
115 MBool getSampleVarsDerivatives(const MInt cellId, std::vector<MFloat>& vars) {
116 return solver().getSampleVarsDerivatives(cellId, vars);
117 };
118 MFloat& vorticityAtCell(const MInt cellId, const MInt dir) override { return solver().vorticityAtCell(cellId, dir); };
119 void getPrimitiveVariables(MInt cellId, MFloat* Xp, MFloat* vars, MInt order) override {
120 solver().getPrimitiveVariables(cellId, Xp, vars, order);
121 };
122
124 MFloatScratchSpace& drhodt) override {
125 solver().computeAcousticSourceTermQe(QeI, QeIII, cSquared, drhodt);
126 };
127
128 void getPrimitiveVarNames(MString* names) const override { solver().sysEqn().PV->getPrimitiveVariableNames(names); }
129 MFloat getBoundaryHeatFlux(const MInt cellId) const override { return solver().getBoundaryHeatFlux(cellId); };
130 void vapourPenetration(MFloat spawnCoord[nDim]);
131 void vapourMass(const MInt);
132
135
136 std::unique_ptr<PointData<nDim, SolverType>> m_pointData;
137 std::unique_ptr<SurfaceData<nDim, SolverType>> m_surfaceData;
138 std::unique_ptr<VolumeData<nDim, SolverType>> m_volumeData;
139};
140
141#endif // POSTPROCESSINGFV_H_
virtual MFloat & vorticityAtCell(const MInt cellId, const MInt dir)
virtual MFloat getBoundaryHeatFlux(const MInt cellId) const
calculates heat flux of boundary cells
void getPrimitiveVariables(MInt, MFloat *, MFloat *, MInt)
virtual void getVorticity(MFloat *const vorticity)
wrapper for vorticity computation
void computeAcousticSourceTermQe(MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &)
virtual void getVorticityT(MFloat *const vorticity)
wrapper for vorticity computation (transposed version)
virtual void getSampleVarsDerivatives(const MInt cellId, const MFloat *&vars)
Access derivatives of primitive variables of a given cell.
Definition: postdata.h:23
void calcVorticity(const MFloatTensor &deriv, MFloat vorticity[nDim *2 - 3]) override
void advanceDataStep()
virtual ~PostProcessingFv()
void initSurfaceSamplingData() override
void computeAcousticSourceTermQe(MFloatScratchSpace &QeI, MFloatScratchSpace &QeIII, MFloatScratchSpace &cSquared, MFloatScratchSpace &drhodt) override
SolverType & solver() const
void probeLinePeriodic() override
void savePointSamplingData() override
void getPrimitiveVariables(MInt cellId, MFloat *Xp, MFloat *vars, MInt order) override
MFloat getBoundaryHeatFlux(const MInt cellId) const override
void getSampleVarsDerivatives(MInt cellId, const MFloat *&vars)
void vapourPenetration(MFloat spawnCoord[nDim])
void initVolumeSamplingData() override
void initAveragingProperties() override
Initialize properties relevant for temporal averaging.
void probeLinePeriodicPost() override
void saveVolumeSamplingData() override
SolverType * m_ppSolver
MFloat & vorticityAtCell(const MInt cellId, const MInt dir) override
void initPointSamplingData() override
void saveSurfaceSamplingData() override
void initPostProcessing() override
void getVorticity(MFloat *const vorticity) override
std::unique_ptr< VolumeData< nDim, SolverType > > m_volumeData
void getVorticityT(MFloat *const vorticity) override
void getPrimitiveVarNames(MString *names) const override
MBool getSampleVarsDerivatives(const MInt cellId, std::vector< MFloat > &vars)
void vapourMass(const MInt)
std::unique_ptr< SurfaceData< nDim, SolverType > > m_surfaceData
std::unique_ptr< PointData< nDim, SolverType > > m_pointData
void initSprayData() override
void initMovingAverage() override
Initializes properties and allocates memory for moving averaging.
void resetDataStep()
MBool isActive() const
MInt * m_globalNoProbeLineIds
MInt * m_probeLineDirection
MInt m_averageStopTimestep
MInt * m_probeLineOffsets
MInt ** m_noProbeLineAverageIds
MInt ** m_globalNoProbeLineAverageIds
MInt m_noVariables
MInt ** m_probeLineIds
MBool m_averageVorticity
Data & postData() const
MFloat *** m_globalProbeLineAverageVars
MInt * m_probeLineAverageDirection
Data * m_postData
MInt m_averageStartTimestep
MString * m_movAvgVarNames
MInt m_movAvgNoVariables
MInt m_noProbeLines
MFloat ** m_probeLinePositions
MInt m_movingAverageDataPoints
MInt m_movingAverageInterval
MFloat ** m_movAvgVariables
MInt m_sprayDataStep
MInt m_sprayWriteInterval
MInt m_movingAverageCounter
MInt * m_noProbeLineIds
MInt *** m_probeLineAverageIds
MInt m_sprayComputeInterval
MInt m_averageInterval
MString m_postprocessFileName
MFloat ** m_probeLineAverageCoordinates
MInt m_sprayDataSize
MFloat ** m_vapourCV
MFloat ** m_vapourPen
MBool m_finalTimeStep
MInt m_postprocessingId
This class is a ScratchSpace.
Definition: scratch.h:758
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58