MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
fvstructuredfqvariables.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 STRUCTUREDFQVARIABLES_H
8#define STRUCTUREDFQVARIABLES_H
9
11 public:
13 // this is the start configuration,
14 // depending on which fq fields are needed
15 // it will be altered later
16 AVG_U = 0;
17 AVG_V = 1;
18 AVG_W = 2;
19 AVG_P = 3;
20 AVG_RHO = 4;
21 NU_T = 5;
22 SPONGE_RHO = 6;
23 SPONGE_RHO_E = 7;
24 PRESSURE = 8;
25 LAMBDA2 = 9;
26 VORTX = 10;
27 VORTY = 11;
28 VORTZ = 12;
29 VORTICITY = new MInt[3];
30 VORTICITY[0] = VORTX;
31 VORTICITY[1] = VORTY;
32 VORTICITY[2] = VORTZ;
33 CELLID = 13;
34 BLOCKID = 14;
35 SPONGE_FACTOR = 15;
36 SLOPEX = 16;
37 SLOPEY = 17;
38 SLOPEZ = 18;
39 SLOPE = new MInt[3];
40 SLOPE[0] = SLOPEX;
41 SLOPE[1] = SLOPEY;
42 SLOPE[2] = SLOPEZ;
43 MU_T = 19;
44 WALLDISTANCE = 20;
45 MU_L = 21;
46 UTAU = 22;
47 // Porous
48 POROSITY = 23;
49 DARCY = 24;
50 FORCH = 25;
51 NORMALX = 26;
52 NORMALY = 27;
53 NORMALZ = 28;
54 NORMAL = new MInt[3];
55 NORMAL[0] = NORMALX;
56 NORMAL[1] = NORMALY;
57 NORMAL[2] = NORMALZ;
58 LIMITERVISC = 29;
60 UTAU2 = 31;
61
62 noFQVariables = 0;
64 noFQBoxOutput = 0;
65 }
66
68 delete[] VORTICITY;
69 delete[] SLOPE;
70 delete[] NORMAL;
71 }
72
108
112
114 MBool* outputFQVariables = nullptr; // write output only for certain FQ variables
117 std::vector<MString> fqNames;
118 std::vector<MBool> fqWriteOutput;
119 std::vector<MBool> fqWriteOutputBoxes;
120
121 void activateFQField(MInt fqIndex, MInt currentPos, MBool writeOutput, MBool writeOutputBoxes) {
122 fqWriteOutput.push_back(writeOutput);
123 fqWriteOutputBoxes.push_back(writeOutputBoxes);
124
125 switch(fqIndex) {
126 case 0:
127 AVG_U = currentPos;
128 fqNames.push_back("avgU");
129 m_log << "FQ-Field: AVG_U activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
130 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
131 break;
132 case 1:
133 AVG_V = currentPos;
134 fqNames.push_back("avgV");
135 m_log << "FQ-Field: AVG_V activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
136 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
137 break;
138 case 2:
139 AVG_W = currentPos;
140 fqNames.push_back("avgW");
141 m_log << "FQ-Field: AVG_P activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
142 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
143 break;
144 case 3:
145 AVG_P = currentPos;
146 fqNames.push_back("avgP");
147 m_log << "FQ-Field: AVG_P activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
148 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
149 break;
150 case 4:
151 AVG_RHO = currentPos;
152 fqNames.push_back("avgRho");
153 m_log << "FQ-Field: AVG_RHO activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
154 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
155 break;
156 case 5:
157 NU_T = currentPos;
158 fqNames.push_back("nu_t");
159 m_log << "FQ-Field: NU_T activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
160 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
161 break;
162 case 6:
163 SPONGE_RHO = currentPos;
164 fqNames.push_back("spongeRho");
165 m_log << "FQ-Field: SPONGE_RHO activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
166 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
167 break;
168 case 7:
169 SPONGE_RHO_E = currentPos;
170 fqNames.push_back("spongeRhoE");
171 m_log << "FQ-Field: SPONGE_RHO_E activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
172 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
173 break;
174 case 8:
175 PRESSURE = currentPos;
176 fqNames.push_back("pressure");
177 m_log << "FQ-Field: PRESSURE activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
178 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
179 break;
180 case 9:
181 LAMBDA2 = currentPos;
182 fqNames.push_back("lambda2");
183 m_log << "FQ-Field: LAMBDA_2 activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
184 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
185 break;
186 case 10:
187 VORTX = currentPos;
188 VORTICITY[0] = currentPos;
189 fqNames.push_back("vortX");
190 m_log << "FQ-Field: x-Vorticity activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
191 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
192 break;
193 case 11:
194 VORTY = currentPos;
195 VORTICITY[1] = currentPos;
196 fqNames.push_back("vortY");
197 m_log << "FQ-Field: y-Vorticity activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
198 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
199 break;
200 case 12:
201 VORTZ = currentPos;
202 VORTICITY[2] = currentPos;
203 fqNames.push_back("vortZ");
204 m_log << "FQ-Field: z-Vorticity activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
205 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
206 break;
207 case 13:
208 CELLID = currentPos;
209 fqNames.push_back("cellId");
210 m_log << "FQ-Field: cellId activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
211 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
212 break;
213 case 14:
214 BLOCKID = currentPos;
215 fqNames.push_back("blockId");
216 m_log << "FQ-Field: solverId activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
217 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
218 break;
219 case 15:
220 SPONGE_FACTOR = currentPos;
221 fqNames.push_back("spongeFactor");
222 m_log << "FQ-Field: SPONGE_FACTOR activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
223 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
224 break;
225 case 16:
226 SLOPEX = currentPos;
227 SLOPE[0] = currentPos;
228 fqNames.push_back("slopeX");
229 m_log << "FQ-Field: x-Slope activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
230 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
231 break;
232 case 17:
233 SLOPEY = currentPos;
234 SLOPE[1] = currentPos;
235 fqNames.push_back("slopeY");
236 m_log << "FQ-Field: y-Slope activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
237 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
238 break;
239 case 18:
240 SLOPEZ = currentPos;
241 SLOPE[2] = currentPos;
242 fqNames.push_back("slopeZ");
243 m_log << "FQ-Field: z-Slope activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
244 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
245 break;
246 case 19:
247 MU_T = currentPos;
248 fqNames.push_back("mu_t");
249 m_log << "FQ-Field: mu_t activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
250 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
251 break;
252 case 20:
253 WALLDISTANCE = currentPos;
254 fqNames.push_back("wallDistance");
255 m_log << "FQ-Field: wallDistance activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
256 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
257 break;
258 case 21:
259 MU_L = currentPos;
260 fqNames.push_back("mu_l");
261 m_log << "FQ-Field: mu_l activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
262 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
263 break;
264 case 22:
265 UTAU = currentPos;
266 fqNames.push_back("utau");
267 m_log << "FQ-Field: UTAU activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
268 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
269 break;
270 case 23:
271 POROSITY = currentPos;
272 fqNames.push_back("porosity");
273 m_log << "FQ-Field: POROSITY activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
274 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
275 break;
276 case 24:
277 DARCY = currentPos;
278 fqNames.push_back("darcy");
279 m_log << "FQ-Field: DARCY activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
280 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
281 break;
282 case 25:
283 FORCH = currentPos;
284 fqNames.push_back("forch");
285 m_log << "FQ-Field: FORCH activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
286 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
287 break;
288 case 26:
289 NORMALX = currentPos;
290 NORMAL[0] = currentPos;
291 fqNames.push_back("normalx");
292 m_log << "FQ-Field: x-NORMAL activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
293 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
294 break;
295 case 27:
296 NORMALY = currentPos;
297 NORMAL[1] = currentPos;
298 fqNames.push_back("normaly");
299 m_log << "FQ-Field: y-NORMAL activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
300 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
301 break;
302 case 28:
303 NORMALZ = currentPos;
304 NORMAL[2] = currentPos;
305 fqNames.push_back("normalz");
306 m_log << "FQ-Field: z-NORMAL activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
307 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
308 break;
309 case 29:
310 LIMITERVISC = currentPos;
311 fqNames.push_back("limitervisc");
312 m_log << "FQ-Field: LIMITERVISC activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
313 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
314 break;
315 case 30:
316 POROUS_INDICATOR = currentPos;
317 fqNames.push_back("porous_indicator");
318 m_log << "FQ-Field: POROUS_INDICATOR activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
319 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
320 break;
321 case 31:
322 UTAU2 = currentPos;
323 fqNames.push_back("utau2");
324 m_log << "FQ-Field: UTAU2 activated - Write Output: " << fqWriteOutput[fqWriteOutput.size() - 1]
325 << " , write BoxOutput: " << fqWriteOutputBoxes[fqWriteOutputBoxes.size() - 1] << std::endl;
326 break;
327 default:
328 mTerm(1, AT_, "Can't find the FQ field!");
329 break;
330 }
331 }
332};
333
334#endif
void activateFQField(MInt fqIndex, MInt currentPos, MBool writeOutput, MBool writeOutputBoxes)
std::vector< MBool > fqWriteOutputBoxes
std::vector< MString > fqNames
std::vector< MBool > fqWriteOutput
void mTerm(const MInt errorCode, const MString &location, const MString &message)
Definition: functions.cpp:29
InfoOutFile m_log
int32_t MInt
Definition: maiatypes.h:62
bool MBool
Definition: maiatypes.h:58