MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
fvstructuredsolver.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 STRCTBLCK_H
8#define STRCTBLCK_H
9
10#include <sys/stat.h>
11
12#include <cstring>
13#include <functional>
14#include "COMM/mpioverride.h"
15#include "GRID/structuredgrid.h"
17#include "IO/parallelio.h"
18#include "MEMORY/list.h"
21#include "fvstructuredcell.h"
22#include "fvstructuredcomm.h"
27#include "fvstructuredtimers.h"
28#include "fvstructuredzonalbc.h"
29#include "solver.h"
30#include "variables.h"
31
32class ParallelIoHdf5;
33
40template <MInt nDim>
41class FvStructuredSolver : public Solver, public StructuredPostprocessing<nDim, FvStructuredSolver<nDim>> {
42 template <MInt nDim_>
43 friend class StructuredBndryCnd;
44 template <MInt nDim_>
48 template <class SolverType>
49 friend class AccesorStructured; // TODO labels:FV
50
51 public:
53
54 // Add fields used from template base class to avoid calling with 'this->'
69
70 FvStructuredSolver(MInt solverId, StructuredGrid<nDim>*, MBool* propertiesGroups, const MPI_Comm comm);
71 MBool isActive() const { return m_isActive; }
72 void initializeFQField();
73
74 MInt timer(const MInt timerId) const;
75
76 MInt noSolverTimers(const MBool allTimings) override {
77 TERMM_IF_COND(!allTimings, "FIXME: reduced timings mode not yet supported by StructuredFvSolver.");
78 return 16; // Default: load and idle timer
79 }
80
81 virtual void writeHeaderAttributes(ParallelIoHdf5* pio, MString fileType);
82 virtual void writePropertiesAsAttributes(ParallelIoHdf5* pio, MString path);
83 void saveSolverSolution(MBool = false, const MBool = false) override;
84 void saveSolution(MBool);
85 void savePartitions();
86 void saveBoxes();
88 virtual void initPointsToAsciiFile(){};
89 virtual void saveInterpolatedPoints(){};
90 virtual void saveNodalBoxes(){};
91
92 virtual void reIntAfterRestart(MBool){};
93 MBool prepareRestart(MBool, MBool&) override { return false; };
94 void writeRestartFile(MBool) override{};
95 void writeRestartFile(const MBool, const MBool, const MString, MInt*) override{};
96
97 // void reIntAfterRestart(MBool) override {};
98 // MBool prepareRestart(MBool, MBool *) override;
99 // needed for restart
101
102 void loadRestartFile();
104 virtual void loadRestartBC2600(){};
105 virtual void loadRestartBC2601(){};
106 virtual void loadRestartSTG(MBool) { mTerm(-1, AT_, "not implemented in basic solver"); };
113
114 void getSolverTimings(std::vector<std::pair<MString, MFloat>>& solverTimings, const MBool allTimings) override;
115 void getDomainDecompositionInformation(std::vector<std::pair<MString, MInt>>& domainInfo) override;
116
117 virtual MFloat getCellLengthY(MInt, MInt, MInt) { return 0; };
118 virtual MFloat getCellCoordinate(MInt, MInt) { return 0; };
119
120 MInt noInternalCells() const override { return m_noCells; }
121
122 void saveAuxData();
123 void saveForceCoefficient(ParallelIoHdf5* parallelIoHdf5);
124
125 void computeAuxData();
126 void computeAuxDataRoot();
127 virtual void computeDomainWidth(){};
128 void computeForceCoef();
131 virtual ~FvStructuredSolver();
132
133 // SVD stuff
134 MFloat computeRecConstSVD(const MInt ijk, const MInt noNghbrIds, MInt* nghbr, MInt ID, MInt sID,
136 const MInt recDim);
137
139 void initializeFvStructuredSolver(MBool* propertiesGroups);
141 void allocateAuxDataMaps();
146 void setZonalProperties();
147 void allocateVariables();
151 void setPorousProperties();
153 void setSTGProperties();
155 void createMPIGroups();
157
158 // methods:
159 void computePV();
160 MFloat dummy(MInt) const { return 0.0; }
161 MFloat pressure_twoEqRans(MInt cellId) const { return -mMax(m_cells->variables[CV->RANS_VAR[0]][cellId], F0); }
163 return mMax(m_cells->pvariables[PV->RANS_VAR[0]][cellId], F0) * m_cells->pvariables[PV->RHO][cellId];
164 }
166 virtual void computePrimitiveVariables() { mTerm(-1, AT_, "not implemented in general solver"); };
167 virtual void computeConservativeVariables(); //{mTerm(-1,AT_,"not implemented in general solver");};
168 template <MFloat (FvStructuredSolver::*)(MInt) const = &FvStructuredSolver::dummy>
171 virtual void gcFillGhostCells(std::vector<MFloat*>&){};
173 void checkNans();
174 void setVolumeForce();
175 void computeVolumeForces();
176 virtual void computePorousRHS(MBool /*isRans*/) { mTerm(1, "called virtual computePorousRHS()"); };
177 void initPorous();
178 virtual void applyBoundaryCondtition(){};
179 virtual void moveGrid(MInt){};
180 virtual void initMovingGrid(){};
181 virtual void moveGrid(MBool, MBool){};
182 virtual void initBodyForce(){};
183 virtual void applyBodyForce(MBool, MBool){};
184 virtual void computeLambda2Criterion(){};
185 virtual void computeVorticity(){};
186
187
188 void exchange();
189 void exchange(std::vector<std::unique_ptr<StructuredComm<nDim>>>&,
190 std::vector<std::unique_ptr<StructuredComm<nDim>>>&);
191 void send(const MBool, std::vector<std::unique_ptr<StructuredComm<nDim>>>&, std::vector<MPI_Request>&);
192 void receive(const MBool, std::vector<std::unique_ptr<StructuredComm<nDim>>>&, std::vector<MPI_Request>&);
193 virtual void gather(const MBool, std::vector<std::unique_ptr<StructuredComm<nDim>>>&){};
194 virtual void scatter(const MBool, std::vector<std::unique_ptr<StructuredComm<nDim>>>&){};
195 MBool isPeriodicComm(std::unique_ptr<StructuredComm<nDim>>&);
197
198 virtual void zonalExchange(){};
199 virtual void spanwiseAvgZonal(std::vector<MFloat*>&){};
200
201 virtual void waveExchange(){};
202 virtual void spanwiseWaveReorder(){};
203 void setTimeStep();
204 void setLimiterVisc();
206 void exchangeTimeStep();
208 virtual void computeTimeStep(){};
210 MInt getNoCells() { return m_grid->m_noCells; };
211 MInt noVariables() const override { return PV->noVariables; };
212 MInt getNoActiveCells() { return m_grid->m_noActiveCells; };
213 MInt* getActiveCells() { return m_grid->m_nActiveCells; };
215 MInt getNoGhostLayers() { return m_grid->m_noGhostLayers; };
218 MInt* getCellGrid() { return m_grid->m_nCells; };
224
226
227 MFloat getGamma() { return m_gamma; };
229 MFloat getRe0() { return m_Re0; };
230 MFloat getMa() { return m_Ma; };
231 MPI_Comm getCommunicator() { return m_StructuredComm; };
233
234
235 virtual void loadSampleFile(MString){};
236 virtual void getSampleVariables(MInt, MFloat*){};
237 MFloat getPV(MInt var, MInt cellId) { return m_cells->pvariables[var][cellId]; }
238 void setPV(MInt var, MInt cellId, MFloat value) { m_cells->pvariables[var][cellId] = value; }
239 virtual MFloat getSampleVorticity(MInt, MInt) { return 0; };
240 virtual MFloat dvardxyz(MInt, MInt, MFloat*) { return 0; };
241 virtual MFloat dvardx(MInt, MFloat*) { return 0; };
242 virtual void loadAverageRestartFile(const char*, MFloat**, MFloat**, MFloat**, MFloat**) {}
243 virtual void loadAveragedVariables(const char*){};
245 virtual void convertRestartVariablesSTG(MFloat oldMa) {
246 (void)oldMa;
247 mTerm(-1, AT_, "not implemented for 0d,2d");
248 };
249 virtual bool rungeKuttaStep() = 0;
250 virtual void viscousFlux() = 0;
251 virtual void Muscl(MInt = -1) = 0;
252 virtual void applyBoundaryCondition() = 0;
253 virtual void initSolutionStep(MInt) = 0;
254 virtual void initialCondition() = 0;
255
256 void tred2(MFloatScratchSpace& A, MInt dim, MFloat* diag, MFloat* offdiag);
257 void tqli2(MFloat* diag, MFloat* offdiag, MInt dim);
258 void insertSort(MInt dim, MFloat* list);
260
261 void resetRHS();
262 void rhs();
263 void rhsBnd();
264 void lhsBnd();
265 void initSolver() override;
266 virtual MBool maxResidual() { return true; };
267 MBool solutionStep() override;
268 void preTimeStep() override {}
269 void postTimeStep() override;
270 void finalizeInitSolver() override;
271 void cleanUp() override;
272 virtual void updateSpongeLayer() = 0;
273
274 MFloat time() const override { return m_time; }
275 MInt determineRestartTimeStep() const override;
276 MBool hasRestartTimeStep() const override { return true; }
277
278 void init() { m_log << "Called Structured::init without Implementation" << std::endl; }
279
280 inline std::array<MInt, nDim> beginP0() {
281 IF_CONSTEXPR(nDim == 2) { return {0, 0}; }
282 else {
283 return {0, 0, 0};
284 }
285 }
286
287 inline std::array<MInt, nDim> beginP1() {
288 IF_CONSTEXPR(nDim == 2) { return {1, 1}; }
289 else {
290 return {1, 1, 1};
291 }
292 }
293
294 inline std::array<MInt, nDim> beginP2() {
295 IF_CONSTEXPR(nDim == 2) { return {2, 2}; }
296 else {
297 return {2, 2, 2};
298 }
299 }
300
301 inline std::array<MInt, nDim> endM2() {
302 IF_CONSTEXPR(nDim == 2) { return {m_nCells[1] - 2, m_nCells[0] - 2}; }
303 else {
304 return {m_nCells[2] - 2, m_nCells[1] - 2, m_nCells[0] - 2};
305 }
306 }
307
308 inline std::array<MInt, nDim> endM1() {
309 IF_CONSTEXPR(nDim == 2) { return {m_nCells[1] - 1, m_nCells[0] - 1}; }
310 else {
311 return {m_nCells[2] - 1, m_nCells[1] - 1, m_nCells[0] - 1};
312 }
313 }
314
315 inline std::array<MInt, nDim> endM0() {
316 IF_CONSTEXPR(nDim == 2) { return {m_nCells[1], m_nCells[0]}; }
317 else {
318 return {m_nCells[2], m_nCells[1], m_nCells[0]};
319 }
320 }
321
322
323 // if zonal then this communicator is the subworld of each solver
325
329
330 protected:
331 // variables
332 std::unique_ptr<MConservativeVariables<nDim>> CV;
333 std::unique_ptr<MPrimitiveVariables<nDim>> PV;
334
335 // epsilon
337
338 // left/right States
339 MFloat* m_QLeft = nullptr;
340 MFloat* m_QRight = nullptr;
341
342 // moving grids:
390
394
395
396 MFloat* m_rhs = nullptr;
397
399
400 // for IO
407
408 // structure for cell data
412
413 // for debugging only
415 // end debugging
416
418
419 std::unique_ptr<FvStructuredSolverWindowInfo<nDim>> m_windowInfo; // contains info about the window information
420 MInt m_noGhostLayers; // number of GhostLayerst to be added
421 MInt* m_nPoints = nullptr; // stores the maximum dimension of the partition with ghost points
422 MInt* m_nActivePoints = nullptr; // stores the maximum dimension of the partition without ghost points
424 MInt m_noCells; // stores number of structured cells
426 MInt m_noPoints; // gridpoints in the partition
427
429 // MInt m_noActiveSurfaces;
447 MFloat* m_angle = nullptr;
454
455
456 //
459
460 // 2-eq RANS models
462 //
465 MFloat m_I; // turb intensity at inflow
466 MFloat m_epsScale; // either turb length scale or viscosity ratio
468
469 std::unique_ptr<StructuredFQVariables> FQ;
471
474 MFloat* m_forceCoef = nullptr;
477 std::vector<MString> m_forceHeaderNames;
482 MFloat** m_forceData = nullptr;
492
509
512 MInt* m_boxBlock = nullptr;
513 MInt** m_boxOffset = nullptr;
514 MInt** m_boxSize = nullptr;
516
517 std::unique_ptr<StructuredInterpolation<nDim>> m_nodalBoxInterpolation;
535
547 std::unique_ptr<StructuredInterpolation<nDim>> m_pointsToAsciiInterpolation;
548
549 //
555 MFloat* m_RKalpha = nullptr;
567
568 // Timers
569 // Timer group which holds all solver-wide timers
571 // Stores all solver-wide timers
572 std::array<MInt, Timers::_count> m_timers{};
573
574 // constant Timestepping
576
577 // rescaling
580 MPI_Comm m_rescalingCommGrComm = MPI_COMM_NULL;
581
582 // synthetic turbulence generation
583 // for synthetic turbulence generation
584 MPI_Comm m_commStg = MPI_COMM_NULL;
595 MFloat** m_stgEddies = nullptr;
613
614 // global Upwind Coefficient;
616
617 // Sponge Variables
627
628 // Workload
631
632 // Residual
633 // MPI_derived datatypes
634 typedef struct {
637 MInt* maxCellIndex = nullptr;
638 } MRes;
639
640 MRes* m_residualSnd = nullptr;
642
644
650 MPI_Op m_resOp;
651 MPI_Datatype m_mpiStruct;
653
654 // Convergence
657
658 // Restart & initial Condition
663
664 // Strings for Output specification
670
671 MInt* m_nCells = nullptr; // cell array dimension with ghost layer
672 MInt* m_nActiveCells = nullptr; // cell array dimension without ghost layers
676
677 // For Boundary Conditions
678 MInt* m_noWindows = nullptr; // contains the number of windows of each face
679 MInt** m_bndryCndInfo = nullptr; // contains start and length of each window
680 MInt** m_bndryCnd = nullptr; // contains the boundary condition
681
682 // limiter
683 MBool m_limiter; // for limiter choice
684 MString m_limiterMethod; // reads the limiter from the properties
685 MFloat m_venkFactor; // customizable factor for the modified Venkatakrishnan Limiter
688
691
693
694 // zonal
703 std::vector<MFloat*> m_zonalSpanwiseAvgVars;
704
705 MPI_Comm m_commBC2600 = MPI_COMM_NULL;
709
710 MPI_Comm* m_commZonal = nullptr;
715
716
717 // zonal cumulative averaging
721
722
726
727 // parallel
728 std::vector<std::unique_ptr<StructuredComm<nDim>>> m_sndComm;
729 std::vector<std::unique_ptr<StructuredComm<nDim>>> m_rcvComm;
730
732
733 std::vector<std::unique_ptr<StructuredComm<nDim>>> m_waveSndComm;
734 std::vector<std::unique_ptr<StructuredComm<nDim>>> m_waveRcvComm;
735
739 MFloat** m_bufferCellsSndRcv = nullptr; // comunicator cells==>cells to be communicated
740 MFloat** m_bufferPointsSendRcv = nullptr; // comunicator points ==> points to be communicated
741 MInt* m_nghbrFaceId = nullptr;
743 MPI_Request* mpi_sndRequest = nullptr;
744 MPI_Request* mpi_rcvRequest = nullptr;
745 MPI_Status* mpi_sndRcvStatus = nullptr;
746
747 // plenum boundary condition
748 MPI_Comm m_plenumComm = MPI_COMM_NULL;
750
751 // channel boundary condition
752 MPI_Comm m_commChannelIn = MPI_COMM_NULL;
753 MPI_Comm m_commChannelOut = MPI_COMM_NULL;
754 MPI_Comm m_commChannelWorld = MPI_COMM_NULL;
768
769 // for the periodic rotation Boundary
770 MPI_Comm m_commPerRotOne = MPI_COMM_NULL;
771 MPI_Comm m_commPerRotTwo = MPI_COMM_NULL;
772 MPI_Comm m_commPerRotWorld = MPI_COMM_NULL;
775
776 // profile BC 2600
786
787 // effective boundary condition 2601
797
798 // convective solution output
802
803 // timer
804 void initTimers();
805
806 // Initialization status
808
809 // infinity Values
818 MFloat m_VVInfinity[3]; // 3 is the max value!!!!
825
827
828 // for modes:
833
834 // singularity
837
838 // sandpaper tripping
853 MFloat* m_tripG = nullptr;
854 MFloat* m_tripH1 = nullptr;
855 MFloat* m_tripH2 = nullptr;
864
869
870 // Porous stuff
873 // MInt m_porousID;
874 std::vector<MInt> m_porousBlockIds;
876
877 // FSC flow
889 virtual void initFsc();
890 virtual MFloat getFscPressure(MInt cellId);
891 virtual MFloat getFscPressure(MFloat coordX);
892 virtual MFloat getFscEta(MFloat coordX, MFloat coordY);
893 virtual void getFscVelocity(MInt cellId, MFloat* const vel);
894 virtual void getFscVelocity(MFloat coordX, MFloat coordY, MFloat* const vel);
895
896
897 // Blasius boundary layer
906
907 virtual void initBlasius();
908 virtual MFloat getBlasiusEta(MFloat coordX, MFloat coordY);
909 virtual void getBlasiusVelocity(MInt cellId, MFloat* const vel);
910 virtual void getBlasiusVelocity(MFloat coordX, MFloat coordY, MFloat* const vel);
911
912 private:
915
920 }
922};
923
924#endif
Base class of the structured solver.
MInt noSolverTimers(const MBool allTimings) override
void saveSolution(MBool)
Saves the soution to hdf5 file.
std::vector< MInt > m_porousBlockIds
virtual void applyBoundaryCondtition()
virtual MFloat getBlasiusEta(MFloat coordX, MFloat coordY)
void writeRestartFile(MBool) override
MBool isPeriodicComm(std::unique_ptr< StructuredComm< nDim > > &)
void saveDissipation(MString, MFloat *)
Writes the dissipation into a given file.
void setInputOutputProperties()
Reads properties and initializes variables associated with input/output.
std::unique_ptr< FvStructuredSolverWindowInfo< nDim > > m_windowInfo
MInt timer(const MInt timerId) const
std::unique_ptr< StructuredFQVariables > FQ
virtual void initPointsToAsciiFile()
void initializeFvStructuredSolver(MBool *propertiesGroups)
Structured Solver Constructor reads and allocate properties/variables.
virtual void saveNodalBoxes()
void checkNans()
Checks whole domain for NaNs and adds the number of NaNs globally.
MBool prepareRestart(MBool, MBool &) override
Prepare the solvers for a grid-restart.
void preTimeStep() override
MPI_Request * mpi_sndRequest
MFloat ** m_pointsToAsciiCoordinates
virtual void convertRestartVariablesSTG(MFloat oldMa)
virtual void initStructuredPostprocessing()
PostProcessingSolver interface:
void receive(const MBool, std::vector< std::unique_ptr< StructuredComm< nDim > > > &, std::vector< MPI_Request > &)
virtual bool rungeKuttaStep()=0
MInt * m_pointsToAsciiHasPartnerGlobal
virtual void computeTimeStep()
void postTimeStep() override
: Performs the post time step
virtual void initSolutionStep(MInt)=0
void saveSolverSolution(MBool=false, const MBool=false) override
virtual void applyBodyForce(MBool, MBool)
MFloat getPV(MInt var, MInt cellId)
MFloat pythag(MFloat a, MFloat b)
virtual MFloat getCellCoordinate(MInt, MInt)
void send(const MBool, std::vector< std::unique_ptr< StructuredComm< nDim > > > &, std::vector< MPI_Request > &)
void loadRestartFile()
Load Restart File (primitive and conservative output) general formulation.
void saveGradients(MString, MFloat **, MString *)
Writes the gradients into a given file.
virtual void initBlasius()
Init for Blasius boundary layer.
void getDomainDecompositionInformation(std::vector< std::pair< MString, MInt > > &domainInfo) override
Return decomposition information, i.e. number of local elements,...
virtual void initialCondition()=0
void saveForcesToAsciiFile(MBool)
Function to save the force coefficients and power to an ASCII file.
virtual void loadRestartSTG(MBool)
virtual MFloat getCellLengthY(MInt, MInt, MInt)
MFloat computeRecConstSVD(const MInt ijk, const MInt noNghbrIds, MInt *nghbr, MInt ID, MInt sID, MFloatScratchSpace &tmpA, MFloatScratchSpace &tmpC, MFloatScratchSpace &weights, const MInt recDim)
AUX DATA ENDS /////////////////////////////////////////////////////////////.
virtual void gather(const MBool, std::vector< std::unique_ptr< StructuredComm< nDim > > > &)
std::array< MInt, nDim > beginP0()
virtual void initBodyForce()
MBool skipPeriodicDirection(std::unique_ptr< StructuredComm< nDim > > &)
void tred2(MFloatScratchSpace &A, MInt dim, MFloat *diag, MFloat *offdiag)
Householder Reduction according to Numercial Recipies in C: The Art of Scientific Computing.
void setPV(MInt var, MInt cellId, MFloat value)
void getSolverTimings(std::vector< std::pair< MString, MFloat > > &solverTimings, const MBool allTimings) override
Get solver timings.
virtual void loadAverageRestartFile(const char *, MFloat **, MFloat **, MFloat **, MFloat **)
void setBodyForceProperties()
Reads and initializes properties associated with the Moving Grid Methods.
MFloat m_wavePressureOutBeginTransition
std::vector< MString > m_forceHeaderNames
MFloat dummy(MInt) const
MFloat ** m_bc2601ZerothOrderSolution
virtual void moveGrid(MBool, MBool)
void setSamplingProperties()
virtual void loadRestartBC2600()
std::array< MInt, Timers::_count > m_timers
void finalizeInitSolver() override
virtual void saveAverageRestart()
void setMovingGridProperties()
Reads and initializes properties associated with the Moving Grid Methods.
std::vector< std::unique_ptr< StructuredComm< nDim > > > m_sndComm
StructuredGrid< nDim > * m_grid
virtual void spanwiseAvgZonal(std::vector< MFloat * > &)
virtual MFloat dvardx(MInt, MFloat *)
MInt determineRestartTimeStep() const override
Load the restart time step from the restart file (useNonSpecifiedRestartFile enabled)
virtual MBool maxResidual()
virtual void gcFillGhostCells(std::vector< MFloat * > &)
MInt noInternalCells() const override
Return the number of internal cells within this solver.
void writeRestartFile(const MBool, const MBool, const MString, MInt *) override
MPI_Status * mpi_sndRcvStatus
virtual void computeConservativeVariables()
virtual void loadSampleFile(MString)
virtual void scatter(const MBool, std::vector< std::unique_ptr< StructuredComm< nDim > > > &)
void shiftCellValuesRestart(MBool)
virtual void computeFrictionPressureCoef(MBool)=0
MInt noVariables() const override
Return the number of variables.
MBool loadBoxFile(MString, MString, MInt, MInt)
Load Box file general formulation.
virtual void loadRestartBC2601()
std::vector< std::unique_ptr< StructuredComm< nDim > > > m_waveRcvComm
std::array< MInt, nDim > beginP2()
SingularInformation * m_singularity
void convertRestartVariables(MFloat oldMa)
std::array< MInt, nDim > endM1()
std::vector< std::unique_ptr< StructuredComm< nDim > > > m_waveSndComm
void saveAveragedVariables(MString, MInt, MFloat **)
Saves the averaged (mean) variables from postprocessing to an HDF5 file.
std::unique_ptr< StructuredInterpolation< nDim > > m_nodalBoxInterpolation
friend class AccesorStructured
void savePartitions()
Saves the partitioned grid into an HDF5 file. Not used in production use but useful for debugging.
virtual void getBlasiusVelocity(MInt cellId, MFloat *const vel)
Load variables for the specified timeStep.
void saveProductionTerms(MString, MFloat **)
Writes the production terms into a given file.
virtual MFloat getFscEta(MFloat coordX, MFloat coordY)
std::unique_ptr< MPrimitiveVariables< nDim > > PV
void setRungeKuttaProperties()
This function reads the properties required for Runge Kutta time stepping.
void saveForceCoefficient(ParallelIoHdf5 *parallelIoHdf5)
Saves force coefficients to an HDF5 file.
void setZonalProperties()
Set which zones are RANS and which are LES or if full LES or full RANS.
virtual void initFsc()
Init for Falkner-Skan-Cooke flow.
void setTestcaseProperties()
Reads and initializes properties associated with the Testcase.
void computeSamplingInterval()
virtual void getSampleVariables(MInt, MFloat *)
virtual void computePorousRHS(MBool)
void setNumericalProperties()
Reads and initializes properties associated with the numerical method.
virtual void zonalExchange()
virtual void computeLambda2Criterion()
virtual void computeCumulativeAverage(MBool)
std::unique_ptr< MConservativeVariables< nDim > > CV
virtual void computeDomainWidth()
MFloat totalEnergy_twoEqRans(MInt cellId) const
virtual MFloat getFscPressure(MInt cellId)
virtual void updateSpongeLayer()=0
void tqli2(MFloat *diag, MFloat *offdiag, MInt dim)
Compute Eigenvalues with implicit shift according to Numercial Recipies in C: The Art of Scientific C...
void computeForceCoef()
Function to compute the force coefficient cl, split split into the viscous part cLv and the pressure ...
virtual MFloat dvardxyz(MInt, MInt, MFloat *)
std::array< MInt, nDim > beginP1()
virtual MFloat getSampleVorticity(MInt, MInt)
StructuredGrid< nDim > * getGrid()
virtual void writePropertiesAsAttributes(ParallelIoHdf5 *pio, MString path)
Overloaded version of writePropertiesAsAttributes that receives ParallelIoHdf5 object pointer instead...
virtual void waveExchange()
virtual void applyBoundaryCondition()=0
MBool hasRestartTimeStep() const override
MBool m_timeStepConverged
Convergence status of the current time step.
MFloat pressure_twoEqRans(MInt cellId) const
virtual void viscousFlux()=0
virtual void spanwiseWaveReorder()
virtual void saveInterpolatedPoints()
std::unique_ptr< StructuredInterpolation< nDim > > m_pointsToAsciiInterpolation
void initializeFQField()
Counts the number of necessary FQ fields, allocates them and corrects the indexes of the FQ variable ...
void initSolver() override
void exchange()
SVD STUFF ENDS /////////////////////////////////////////////////////////////.
virtual void computePrimitiveVariables()
virtual void moveGrid(MInt)
MBool isActive() const
virtual void savePointsToAsciiFile(MBool)
std::array< MInt, nDim > endM2()
void setPorousProperties()
Set properties for porous blocks.
std::vector< std::unique_ptr< StructuredComm< nDim > > > m_rcvComm
MBool solutionStep() override
std::array< MInt, nDim > endM0()
MFloat ** m_intpPointsVarsGlobal
virtual void reIntAfterRestart(MBool)
virtual void initMovingGrid()
virtual void getFscVelocity(MInt cellId, MFloat *const vel)
Load variables for the specified timeStep.
MFloat ** m_intpPointsCoordinates
virtual void loadAveragedVariables(const char *)
virtual void computeVorticity()
void resetRHS()
Reset the right hand side to zero.
void computeForceCoefRoot()
Function to compute the coefficient, split split into the viscous part cLv and the pressure part cLp ...
std::vector< MFloat * > m_zonalSpanwiseAvgVars
void allocateAuxDataMaps()
AUX DATA //////////////////////////////////////////////////////////////////.
void insertSort(MInt dim, MFloat *list)
Sorting function to sort list in ascending order.
virtual void Muscl(MInt=-1)=0
MPI_Request * mpi_rcvRequest
virtual void writeHeaderAttributes(ParallelIoHdf5 *pio, MString fileType)
Overloaded version of writeHeaderAttributes that receives ParallelIoHdf5 object pointer instead of 'f...
StructuredCell * m_cells
MFloat time() const override
Return the time.
void saveVarToPrimitive(MInt, MInt, MFloat)
This class is a ScratchSpace.
Definition: scratch.h:758
Parent class of all solvers This class is the base for all solvers. I.e. all solver class (e....
Definition: solver.h:29
MInt solverId() const
Return the solverId.
Definition: solver.h:425
MFloat m_Ma
the Mach number
Definition: solver.h:71
Base class of the structured boundary conditions.
MFloat ** variables
MFloat ** pvariables
Structured grid class.
RansMethod
Definition: enums.h:51
@ NORANS
Definition: enums.h:52
void mTerm(const MInt errorCode, const MString &location, const MString &message)
Definition: functions.cpp:29
constexpr T mMax(const T &x, const T &y)
Definition: functions.h:94
InfoOutFile m_log
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52
int64_t MLong
Definition: maiatypes.h:64
bool MBool
Definition: maiatypes.h:58
Definition: contexttypes.h:19