48 template <
class SolverType>
77 TERMM_IF_COND(!allTimings,
"FIXME: reduced timings mode not yet supported by StructuredFvSolver.");
114 void getSolverTimings(std::vector<std::pair<MString, MFloat>>& solverTimings,
const MBool allTimings)
override;
168 template <MFloat (FvStructuredSolver::*)(MInt) const = &FvStructuredSolver::dummy>
247 mTerm(-1, AT_,
"not implemented for 0d,2d");
278 void init() {
m_log <<
"Called Structured::init without Implementation" << std::endl; }
281 IF_CONSTEXPR(nDim == 2) {
return {0, 0}; }
288 IF_CONSTEXPR(nDim == 2) {
return {1, 1}; }
295 IF_CONSTEXPR(nDim == 2) {
return {2, 2}; }
301 inline std::array<MInt, nDim>
endM2() {
308 inline std::array<MInt, nDim>
endM1() {
315 inline std::array<MInt, nDim>
endM0() {
332 std::unique_ptr<MConservativeVariables<nDim>>
CV;
333 std::unique_ptr<MPrimitiveVariables<nDim>>
PV;
469 std::unique_ptr<StructuredFQVariables>
FQ;
728 std::vector<std::unique_ptr<StructuredComm<nDim>>>
m_sndComm;
729 std::vector<std::unique_ptr<StructuredComm<nDim>>>
m_rcvComm;
Base class of the structured solver.
MFloat m_waveEndTransition
MInt noSolverTimers(const MBool allTimings) override
void saveSolution(MBool)
Saves the soution to hdf5 file.
std::vector< MInt > m_porousBlockIds
MFloat m_wavePressureOutEndTransition
MInt m_pointsToAsciiVarId
virtual void applyBoundaryCondtition()
MFloat m_waveGradientSuction
MBool m_stgInitialStartup
MFloat ** m_nodalBoxVariables
MFloat m_firstAvrgResidual
virtual MFloat getBlasiusEta(MFloat coordX, MFloat coordY)
void writeRestartFile(MBool) override
MFloat m_targetDensityFactor
MBool isPeriodicComm(std::unique_ptr< StructuredComm< nDim > > &)
MPI_Comm getCommunicator()
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()
MInt m_rescalingCommGrRootGlobal
void initializeFvStructuredSolver(MBool *propertiesGroups)
Structured Solver Constructor reads and allocate properties/variables.
virtual void saveNodalBoxes()
MFloat * m_formationEnthalpy
MBool m_movingGridSaveGrid
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.
MInt * m_intpPointsOffsets
void preTimeStep() override
MPI_Request * mpi_sndRequest
MInt m_intpPointsNoPointsTotal
MFloat m_waveYBeginTransition
void readAndSetAuxDataMap()
MBool m_auxDataCoordinateLimits
MPI_Comm m_rescalingCommGrComm
MFloat ** m_pointsToAsciiCoordinates
MFloat m_referenceTemperature
MFloat m_wavePressureBeginTransition
virtual void convertRestartVariablesSTG(MFloat oldMa)
MInt m_periodicConnection
MFloat m_referenceEnthalpy
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
MInt m_movingGridStepOffset
MInt m_lastOutputTimeStep
MInt * m_bc2601noActiveCells
MInt m_waveCellsPerWaveLength
MFloat * m_referenceComposition
MBool m_streamwiseTravelingWave
virtual void computeTimeStep()
void postTimeStep() override
: Performs the post time step
virtual void initSolutionStep(MInt)=0
MBool m_useNonSpecifiedRestartFile
MInt m_forceAsciiOutputInterval
MFloat m_convergenceCriterion
MBool m_mgExchangeCoordinates
MInt ** m_nodalBoxLocalOffset
void saveSolverSolution(MBool=false, const MBool=false) override
MInt * m_intpPointsNoPoints2D
virtual void applyBodyForce(MBool, MBool)
MInt * m_bc2600noOffsetCells
MFloat getPV(MInt var, MInt cellId)
MFloat m_stgEddieDistribution
MFloat pythag(MFloat a, MFloat b)
MInt * m_bc2600noActiveCells
MInt * m_noNghbrDomainBufferSize
virtual MFloat getCellCoordinate(MInt, MInt)
MFloat m_waveBeginTransition
void send(const MBool, std::vector< std::unique_ptr< StructuredComm< nDim > > > &, std::vector< MPI_Request > &)
MString m_nodalBoxOutputDir
void loadRestartFile()
Load Restart File (primitive and conservative output) general formulation.
void saveGradients(MString, MFloat **, MString *)
Writes the gradients into a given file.
MInt m_volumeForceUpdateInterval
MFloat * m_airfoilNormalVec
MString * m_variableNames
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
MInt m_pointsToAsciiNoPoints
MFloat ** m_bc2601Variables
void saveForcesToAsciiFile(MBool)
Function to save the force coefficients and power to an ASCII file.
MFloat * m_waveForceField
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 /////////////////////////////////////////////////////////////.
MBool m_savePartitionOutput
virtual void gather(const MBool, std::vector< std::unique_ptr< StructuredComm< nDim > > > &)
MInt * m_commZonalRootGlobal
std::array< MInt, nDim > beginP0()
MInt m_residualOutputInterval
virtual void initBodyForce()
MBool m_stgEddieLengthScales
MBool skipPeriodicDirection(std::unique_ptr< StructuredComm< nDim > > &)
MInt getGridMovingMethod()
MInt m_intpPointsNoLines2D
MFloat ** m_intpPointsDelta2D
MBool m_residualFileExist
MFloat * m_adiabaticTemperature
MFloat ** m_intpPointsStart
MFloat m_physicalTimeStep
MInt m_nodalBoxTotalLocalSize
MFloat m_waveAmplitudeSuction
MInt m_forceAsciiComputeInterval
MInt m_timeStepComputationInterval
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 **)
MInt m_waveTimeStepComputed
void setBodyForceProperties()
Reads and initializes properties associated with the Moving Grid Methods.
MFloat m_wavePressureOutBeginTransition
std::vector< MString > m_forceHeaderNames
MFloat * m_tripMaxAmpSteady
MInt * m_nodalBoxLocalSize
MFloat m_inflowTemperatureRatio
MInt m_commBC2600RootGlobal
MFloat ** m_bc2601ZerothOrderSolution
virtual void moveGrid(MBool, MBool)
MFloat m_waveTemporalTransition
MBool m_bForceLineAverage
virtual ~FvStructuredSolver()
void setSamplingProperties()
virtual void loadRestartBC2600()
std::array< MInt, Timers::_count > m_timers
void finalizeInitSolver() override
MInt m_useAdiabaticRestartTemperature
MInt m_pointsToAsciiOutputInterval
MInt m_rescalingCommGrRoot
virtual void saveAverageRestart()
MFloat m_restartTimeBc2800
MFloat m_channelInflowPlaneCoordinate
MFloat ** m_bc2600Variables
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)
MFloat m_wavePressureEndTransition
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
MFloat m_convectiveUnitInterval
MPI_Comm m_commPerRotWorld
MPI_Status * mpi_sndRcvStatus
MInt ** m_nodalBoxLocalDomainOffset
virtual void computeConservativeVariables()
virtual void loadSampleFile(MString)
MInt m_nodalBoxOutputInterval
MBool m_setLocalWallDistance
MFloat m_rhoVVInfinity[3]
virtual void scatter(const MBool, std::vector< std::unique_ptr< StructuredComm< nDim > > > &)
void fixTimeStepTravelingWave()
MString m_waveForceFieldFile
void shiftCellValuesRestart(MBool)
virtual void computeFrictionPressureCoef(MBool)=0
MFloat m_firstMaxResidual
MInt noVariables() const override
Return the number of variables.
MBool m_computeSpongeFactor
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
MBool m_boxWriteCoordinates
void convertRestartVariables(MFloat oldMa)
std::array< MInt, nDim > endM1()
MInt m_outputIterationNumber
std::vector< std::unique_ptr< StructuredComm< nDim > > > m_waveSndComm
MInt getWaveAvrgInterval()
MBool m_zonalExponentialAveraging
void saveAveragedVariables(MString, MInt, MFloat **)
Saves the averaged (mean) variables from postprocessing to an HDF5 file.
MInt m_intpPointsOutputInterval
MFloat m_physicalReferenceLength
std::unique_ptr< StructuredInterpolation< nDim > > m_nodalBoxInterpolation
MFloat ** pointProperties
friend class AccesorStructured
void initializeRungeKutta()
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.
MFloat ** m_intpPointsVarsLocal
MFloat * m_airfoilWallDist
MFloat m_channelPresOutlet
MString * m_pvariableNames
MFloat m_waveOutEndTransition
MInt ** m_nodalBoxLocalPoints
MInt m_stgNoEddieProperties
MInt m_lastForceComputationTimeStep
void saveProductionTerms(MString, MFloat **)
Writes the production terms into a given file.
MFloat m_wavePenetrationHeight
MBool m_sampleSolutionFiles
virtual MFloat getFscEta(MFloat coordX, MFloat coordY)
MBool m_stgCreateNewEddies
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.
MBool m_waveRestartFadeIn
MFloat ** m_pointsToAsciiVars
MFloat * m_spongeLayerThickness
void setTestcaseProperties()
Reads and initializes properties associated with the Testcase.
void computeSamplingInterval()
MFloat m_movingGridTimeOffset
virtual void getSampleVariables(MInt, MFloat *)
virtual void computePorousRHS(MBool)
MInt m_pointsToAsciiCounter
void setNumericalProperties()
Reads and initializes properties associated with the numerical method.
MFloat m_stgDelta99Inflow
MInt getBodyForceMethod()
virtual void zonalExchange()
MFloat m_zonalAveragingFactor
virtual void computeLambda2Criterion()
MInt * m_intpPointsHasPartnerGlobal
virtual void computeCumulativeAverage(MBool)
std::unique_ptr< MConservativeVariables< nDim > > CV
MBool m_restartInterpolation
MInt * m_nodalBoxTotalLocalOffset
virtual void computeDomainWidth()
MInt m_forceOutputInterval
MFloat totalEnergy_twoEqRans(MInt cellId) const
MPI_Comm m_StructuredComm
virtual MFloat getFscPressure(MInt cellId)
MString m_intpPointsOutputDir
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...
MInt * m_intpPointsNoPoints
void computeForceCoef()
Function to compute the force coefficient cl, split split into the viscous part cLv and the pressure ...
MFloat m_rhoNuTildeInfinty
virtual MFloat dvardxyz(MInt, MInt, MFloat *)
MFloat m_sutherlandPlusOne
std::array< MInt, nDim > beginP1()
MFloat * m_stgLengthFactors
MInt * m_pointsToAsciiHasPartnerLocal
MInt m_pointsToAsciiLastComputationStep
MPI_Comm m_commChannelWorld
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
void computeAuxDataRoot()
MBool m_timeStepConverged
Convergence status of the current time step.
MFloat m_waveYEndTransition
MFloat m_waveGradientPressure
MFloat pressure_twoEqRans(MInt cellId) const
virtual void viscousFlux()=0
MInt * m_bc2601noOffsetCells
MBool isStreamwiseTravelingWave()
MBool m_synchronizedMGOutput
MInt m_lastForceOutputTimeStep
virtual void spanwiseWaveReorder()
void allocateAndInitBlockMemory()
virtual void saveInterpolatedPoints()
std::unique_ptr< StructuredInterpolation< nDim > > m_pointsToAsciiInterpolation
MBool m_nodalBoxInitialized
void initializeFQField()
Counts the number of necessary FQ fields, allocates them and corrects the indexes of the FQ variable ...
MFloat m_waveAmplitudePressure
void initSolver() override
void exchange()
SVD STUFF ENDS /////////////////////////////////////////////////////////////.
MInt m_waveNoStepsPerCell
virtual void computePrimitiveVariables()
MFloat m_waveOutBeginTransition
virtual void moveGrid(MInt)
MFloat * m_tripMaxAmpFluc
MFloat m_sutherlandConstant
MPI_Comm m_commChannelOut
virtual void savePointsToAsciiFile(MBool)
MBool m_useConvectiveUnitWrite
MFloat m_channelPresInlet
MInt * m_intpPointsHasPartnerLocal
void readAndSetSpongeLayerProperties()
MInt m_orderOfReconstruction
MBool m_considerVolumeForces
MInt m_currentPeriodicDirection
std::array< MInt, nDim > endM2()
void setPorousProperties()
Set properties for porous blocks.
MFloat ** m_nodalBoxCoordinates
MFloat getSutherlandConstant()
std::vector< std::unique_ptr< StructuredComm< nDim > > > m_rcvComm
MString m_solutionFileName
MBool solutionStep() override
MBool m_bc2601InitialStartup
void computeConservativeVariables_()
MBool m_nodalBoxWriteCoordinates
std::array< MInt, nDim > endM0()
MFloat ** m_intpPointsVarsGlobal
MInt m_noSpongeDomainInfos
MBool m_movingGridInitialStart
MFloat ** m_intpPointsDelta
virtual void reIntAfterRestart(MBool)
void setProfileBCProperties()
MFloat ** m_bufferCellsSndRcv
MBool m_bc2600InitialStartup
virtual void initMovingGrid()
virtual void getFscVelocity(MInt cellId, MFloat *const vel)
Load variables for the specified timeStep.
MFloat ** m_intpPointsCoordinates
MFloat m_waveAmplitudePlus
virtual void loadAveragedVariables(const char *)
virtual void computeVorticity()
void resetRHS()
Reset the right hand side to zero.
MInt m_pointsToAsciiLastOutputStep
void computeForceCoefRoot()
Function to compute the coefficient, split split into the viscous part cLv and the pressure part cLp ...
MFloat ** m_bufferPointsSendRcv
std::vector< MFloat * > m_zonalSpanwiseAvgVars
MInt * m_spongeBcWindowInfo
MInt m_zonalExchangeInterval
MInt m_airfoilNoWallPoints
MInt m_noConvectiveOutputs
void allocateAuxDataMaps()
AUX DATA //////////////////////////////////////////////////////////////////.
MInt m_pointsToAsciiComputeInterval
MFloat m_bc2601GammaEpsilon
MInt * m_nodalBoxPartnerLocal
MFloat m_workloadIncrement
void insertSort(MInt dim, MFloat *list)
Sorting function to sort list in ascending order.
virtual void Muscl(MInt=-1)=0
void computeVolumeForces()
MPI_Request * mpi_rcvRequest
MFloat m_globalDomainWidth
virtual void writeHeaderAttributes(ParallelIoHdf5 *pio, MString fileType)
Overloaded version of writeHeaderAttributes that receives ParallelIoHdf5 object pointer instead of 'f...
MFloat time() const override
Return the time.
MBool m_channelFullyPeriodic
void saveVarToPrimitive(MInt, MInt, MFloat)
This class is a ScratchSpace.
Parent class of all solvers This class is the base for all solvers. I.e. all solver class (e....
MInt solverId() const
Return the solverId.
MFloat m_Ma
the Mach number
Base class of the structured boundary conditions.
MFloat ** m_tempWaveSample
MString * m_avgVariableNames
MInt m_averageStartTimestep
MString * m_avgFavreNames
MInt m_averageStopTimestep
void mTerm(const MInt errorCode, const MString &location, const MString &message)
constexpr T mMax(const T &x, const T &y)
std::basic_string< char > MString