MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
fvzonalstg.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 FVZONALSTG_H_
8#define FVZONALSTG_H_
9
10#include <vector>
14#include "INCLUDE/maiatypes.h"
15#include "MEMORY/scratch.h"
16#include "UTIL/functions.h"
17#include "coupling.h"
18#include "fvzonal.h"
19
20template <MInt nDim, class SysEqn>
21class FvZonal;
22
23/*author Jannik: December 2019
24Coupling class for zonal RANS-LES method
25*/
26template <MInt nDim, class SysEqn>
27class FvZonalSTG : public FvZonal<nDim, SysEqn> {
28 private:
29 friend class FvZonal<nDim, SysEqn>;
30 // friend class FvZonal<nDim, FvSysEqnRANS<nDim, RANSModelConstants<RANS_SA_DV>>>;
31
32 public:
35
36 // Constructor
37 FvZonalSTG(const MInt couplingId, RANS* R, LES* L);
38
47 using Base::LESSolver;
62 using Base::RANSSolver;
63
64 void init();
66 void preCouple(MInt);
67
68 void finalizeAdaptation(const MInt solverId) override;
69 void finalizeBalance(const MInt) override{};
70 void balancePre() override{};
71 void balancePost() override;
72
73 private:
74 // suppressed functions
77 void subCouple(MInt, MInt, std::vector<MBool>&){};
78 void cleanUp(){};
79 void initData(){};
82
83 // void finalizeLESAverage();
87 void transferSolverData();
88 void transferSpongeData();
93
97 void cylinderExchange();
99
100 const MFloat eps = 1e-16;
101 const MFloat epss = 1e-8;
102
103 // MBool m_wasAdapted = false;
104
117
119 std::vector<MInt>* m_periodicSpongeInterpolationIndex = nullptr;
120
121 MFloat* m_uvErr = nullptr;
122 MFloat* m_uvRans = nullptr;
123 MFloat* m_uvInt = nullptr;
124 const MFloat alpha = 10.0;
125 const MFloat beta = 2.0;
126
127 // scale uv of RANS solution
129
132
136 MPI_Comm m_commCyl;
137 MPI_Comm m_commStg;
151 std::vector<MInt>* m_globalCylinderInterpolationIndex = nullptr;
152 std::vector<std::pair<MInt, MFloat>>* m_globalCylinderInterpolationCell = nullptr;
154
155
156 protected:
158 static constexpr const MInt noAvgVars = 11;
159 static constexpr const MInt UM = 0;
160 static constexpr const MInt VM = 1;
161 static constexpr const MInt WM = 2;
162 static constexpr const MInt RHOM = 3;
163 static constexpr const MInt PM = 4;
164 static constexpr const MInt UU = 5;
165 static constexpr const MInt UV = 6;
166 static constexpr const MInt UW = 7;
167 static constexpr const MInt VV = 8;
168 static constexpr const MInt VW = 9;
169 static constexpr const MInt WW = 10;
170 };
171};
172
173
174#endif // ifndef ZONALSTG_H_
MInt noRANSVariables()
Definition: fvzonal.h:49
MBool m_STGSponge
Definition: fvzonal.h:77
void initRANSValues()
Initialize RANSValues for LES Solver.
Definition: fvzonal.cpp:96
LES & LESSolver() const
Definition: fvzonal.h:45
MBool m_restartLESAverage
Definition: fvzonal.h:70
const MInt m_noReconstructNutVars
Definition: fvzonal.h:65
MInt noLESVariables()
Definition: fvzonal.h:48
MInt m_zonalTransferInterval
Definition: fvzonal.h:68
MInt a_noFvCellsLES() const
Definition: fvzonal.h:54
MInt a_noFvCellsRANS() const
Definition: fvzonal.h:56
MInt m_RANSSolverId
Definition: fvzonal.h:62
RANS & RANSSolver() const
Definition: fvzonal.h:44
void initLESValues()
Initialize LESValues for RANS Solver.
Definition: fvzonal.cpp:135
MInt m_zonalAveragingTimeStep
Definition: fvzonal.h:67
MInt m_LESSolverId
Definition: fvzonal.h:63
MInt m_LESNoVarAverage
Definition: fvzonal.h:72
MFloat m_azimuthalAngle
Definition: fvzonal.h:75
MFloat getAveragingFactor()
Definition: fvzonal.h:50
MBool m_cylindricCommunication
Definition: fvzonal.h:74
MInt a_noFvGridCellsRANS() const
Definition: fvzonal.h:57
MInt a_noFvGridCellsLES() const
Definition: fvzonal.h:55
MInt noExchangeVariables()
Definition: fvzonal.h:47
MInt m_averageTimeSteps
Definition: fvzonal.h:69
void finalizeBalance(const MInt) override
Definition: fvzonalstg.h:69
MFloat m_uvRANSFactor
Definition: fvzonalstg.h:128
void initCylinderExchange()
Create mapping for LES cells to equivalent RANS cells.
Definition: fvzonalstg.cpp:525
MInt m_7909periodicDir
Definition: fvzonalstg.h:113
void initSpongeExchange()
MInt m_noRANSExchangeCells
Definition: fvzonalstg.h:143
MInt m_cylinderExchangeIdsOffset
Definition: fvzonalstg.h:149
void finalizeSubCoupleInit(MInt)
Definition: fvzonalstg.h:76
MFloat m_7909Position
Definition: fvzonalstg.h:110
void resetSTGSpongeAfterAdaptation()
Definition: fvzonalstg.h:95
void balancePost() override
Definition: fvzonalstg.cpp:100
const MFloat epss
Definition: fvzonalstg.h:101
MFloat * m_uvInt
Definition: fvzonalstg.h:123
const MFloat alpha
Definition: fvzonalstg.h:124
MFloat * m_globalCylinderLESExchangeValues
Definition: fvzonalstg.h:147
MInt m_averageDir
Definition: fvzonalstg.h:116
MInt m_7909wallDir
Definition: fvzonalstg.h:112
MFloat m_averagePos
Definition: fvzonalstg.h:115
std::vector< MInt > m_globalCylinderInterpolationNumber
Definition: fvzonalstg.h:153
MPI_Comm m_commStg
Definition: fvzonalstg.h:137
MFloat * m_RANSSectors
Definition: fvzonalstg.h:130
void determineZonalPositions()
Definition: fvzonalstg.cpp:124
void readProperties()
Definition: fvzonalstg.h:81
FvZonalSTG(const MInt couplingId, RANS *R, LES *L)
void calcRANSSectorValues()
fill m_globalCylinderRANSExchangeValues with RANS values for exchange with LES Solver
MInt m_7901faceNormalDir
Definition: fvzonalstg.h:107
void resetRANSSolver()
std::vector< MInt > m_periodicSpongeCylinderExchangeIndex
Definition: fvzonalstg.h:118
MInt m_cylRoot
Definition: fvzonalstg.h:135
const MFloat beta
Definition: fvzonalstg.h:125
MInt m_bcId7909
Definition: fvzonalstg.h:114
MInt * m_globalCylinderExchangeIds
Definition: fvzonalstg.h:148
MInt m_7901periodicDir
Definition: fvzonalstg.h:109
MFloat * m_uvErr
Definition: fvzonalstg.h:121
MInt m_commSizeCylExchange
Definition: fvzonalstg.h:134
void preCouple(MInt)
Definition: fvzonalstg.cpp:108
void saveSpongeData()
void subCouple(MInt, MInt, std::vector< MBool > &)
Definition: fvzonalstg.h:77
MInt m_noGlobalRANSExchangeCells
Definition: fvzonalstg.h:144
MFloat * m_globalCylinderExchangeLocations
Definition: fvzonalstg.h:145
std::vector< MInt > * m_globalCylinderInterpolationIndex
Definition: fvzonalstg.h:151
MBool m_cylCommActive
Definition: fvzonalstg.h:133
void calcPeriodicSpongeAverage()
MFloat * m_cylinderInterpolationAngle
Definition: fvzonalstg.h:150
MInt m_noCylindricalGlobalRANSExchangeValues
Definition: fvzonalstg.h:140
void balancePre() override
Load balancing.
Definition: fvzonalstg.h:70
MInt m_7909faceNormalDir
Definition: fvzonalstg.h:111
MInt m_noRANSCylinderExchangeVariables
Definition: fvzonalstg.h:138
void finalizeCouplerInit()
Definition: fvzonalstg.cpp:73
void checkProperties()
Definition: fvzonalstg.h:80
MFloat * m_globalCylinderRANSExchangeValues
Definition: fvzonalstg.h:146
void transferSolverData()
Definition: fvzonalstg.cpp:267
MFloat * m_RANSSectorLimits
Definition: fvzonalstg.h:131
void finalizeAdaptation(const MInt solverId) override
Definition: fvzonalstg.cpp:90
void postCouple(MInt)
Definition: fvzonalstg.h:75
MFloat m_nuTildeInfinity
Definition: fvzonalstg.h:105
void initData()
Definition: fvzonalstg.h:79
void init()
Definition: fvzonalstg.cpp:47
MInt m_noCylindricalGlobalExchangeIds
Definition: fvzonalstg.h:142
void cylinderExchange()
Interpolate RANS sector data to LES domain using mapping created in initCylinderExchange.
MInt m_noCylindricalGlobalExchangeLocations
Definition: fvzonalstg.h:139
void loadSpongeData()
MInt m_noCylindricalGlobalLESExchangeValues
Definition: fvzonalstg.h:141
MInt m_7901wallDir
Definition: fvzonalstg.h:108
void finalizeRANSSolverAfterReset()
void calcLESSectorAverage()
fill m_globalCylinderLESExchangeValues with sector averaged LES values for exchange with RANS Solver
MFloat * m_uvRans
Definition: fvzonalstg.h:122
MPI_Comm m_commCyl
Definition: fvzonalstg.h:136
std::vector< MInt > * m_periodicSpongeInterpolationIndex
Definition: fvzonalstg.h:119
void transferSpongeData()
Definition: fvzonalstg.cpp:384
const MFloat eps
Definition: fvzonalstg.h:100
void cleanUp()
Definition: fvzonalstg.h:78
MFloat m_7901Position
Definition: fvzonalstg.h:106
std::vector< std::pair< MInt, MFloat > > * m_globalCylinderInterpolationCell
Definition: fvzonalstg.h:152
int32_t MInt
Definition: maiatypes.h:62
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58
static constexpr const MInt UW
Definition: fvzonalstg.h:166
static constexpr const MInt UV
Definition: fvzonalstg.h:165
static constexpr const MInt WM
Definition: fvzonalstg.h:161
static constexpr const MInt VM
Definition: fvzonalstg.h:160
static constexpr const MInt UU
Definition: fvzonalstg.h:164
static constexpr const MInt PM
Definition: fvzonalstg.h:163
static constexpr const MInt noAvgVars
Definition: fvzonalstg.h:158
static constexpr const MInt UM
Definition: fvzonalstg.h:159
static constexpr const MInt VV
Definition: fvzonalstg.h:167
static constexpr const MInt RHOM
Definition: fvzonalstg.h:162
static constexpr const MInt VW
Definition: fvzonalstg.h:168
static constexpr const MInt WW
Definition: fvzonalstg.h:169