MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
fvstructuredpostprocessing.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 STRUCTUREDPOSTPROCESSING_H
8#define STRUCTUREDPOSTPROCESSING_H
9
10#include <map>
11#include <vector>
12#include "INCLUDE/maiatypes.h"
13
15#include "UTIL/functions.h"
16
17// Forard declarations
18class StructuredCell;
19
20template <MInt nDim, class SolverType>
23
24 public:
27
28 void postprocessPreInit();
31 void postprocessInSolve();
32
33 protected:
35 void initAverageIn();
38 void initMovingAverage();
42 void averageSolutions();
43 void addAveragingSample();
44 void addTempWaveSample();
49 void subtractMean();
50 void movingAverage();
51 void movingAveragePost();
54 void decomposeCf();
55 void decomposeCfDouble();
56 void writeGradients();
58
59 void saveAverageRestart();
60
61 void loadMeanFile(const MChar* fileName);
62 void getSampleVariables(MInt cellId, const MFloat*& vars);
66
70
77
78 // this vector holds all the functions to be called
79 // it is initialized with three entries (each position of postprocessing)
80 typedef void (StructuredPostprocessing::*tpost)();
81 typedef std::vector<tpost> tvecpost;
82 std::vector<tvecpost> m_postprocessingMethods;
83 std::vector<std::vector<MString>> m_postprocessingMethodsDesc;
84
85 public:
87
88 protected:
89 // Number of variables of the corresponding solver
91
92 // Averaging variables
93 MFloat** m_summedVars = nullptr;
94 MFloat** m_square = nullptr;
95 MFloat** m_cube = nullptr;
96 MFloat** m_fourth = nullptr;
98 MFloat** m_favre = nullptr;
99
100 // Kahan summation
102 MFloat** m_cSum = nullptr;
103 MFloat** m_ySum = nullptr;
104 MFloat** m_tSum = nullptr;
105 MFloat** m_cSquare = nullptr;
106 MFloat** m_ySquare = nullptr;
107 MFloat** m_tSquare = nullptr;
108 MFloat** m_cCube = nullptr;
109 MFloat** m_yCube = nullptr;
110 MFloat** m_tCube = nullptr;
111 MFloat** m_cFourth = nullptr;
112 MFloat** m_yFourth = nullptr;
113 MFloat** m_tFourth = nullptr;
114
120 MFloat** m_production = nullptr;
126
133
134 // periodic flucs
136
137 // averaging
144
145 // moving Grid
147
148 static const MInt xsd = 0;
149 static const MInt ysd = 1;
150 static const MInt zsd = 2;
151
154
156
159
160 private:
162 SolverType* ppsolver() { return static_cast<SolverType*>(this); }
163};
164#endif
void loadMeanFile(const MChar *fileName)
void initAverageVariables()
allocates memory for averageSolutions() and averageSolutionsInSolve()
void computeAverageSkinFriction()
Computes skin friction of an averaged field.
MInt getNoPPSquareVars()
Returns number of pp Square variables.
std::vector< tvecpost > m_postprocessingMethods
void loadAveragedSolution()
Loads an averaged file again.
void(StructuredPostprocessing::* tpost)()
std::vector< std::vector< MString > > m_postprocessingMethodsDesc
void computeAveragedSolution()
Computes the mean variables from summed vars.
void initTimeStepProperties()
Initializes timestep properties for postprocessing.
void initAverageIn()
Initializes properties for averaging during solver run.
MInt getNoPPVars()
Returns number of postprocessing variables.
void computeProductionTerms()
Computes the production terms from an averaged field.
void getSampleVariables(MInt cellId, const MFloat *&vars)
void addAveragingSample()
Adds one sample to the summedVars.
StructuredPostprocessing()
Constructor for the postprocessing solver.
void computeDissipationTerms()
Computes the production terms from an averaged field.
void addTempWaveSample()
Adds for the travelling wave setups.
~StructuredPostprocessing()
Destructor for the postprocessing solver.
SolverType
Definition: enums.h:22
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
char MChar
Definition: maiatypes.h:56