MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
fvcartesiansyseqnns.cpp
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
8
9template <MInt nDim>
10FvSysEqnNS<nDim>::FvSysEqnNS(const MInt solverId, const MInt noSpecies) : m_solverId(solverId) {
11 CV = new ConservativeVariables(noSpecies);
12 PV = new PrimitiveVariables(noSpecies);
13 FV = new FluxVariables(noSpecies);
14
16}
17
18template <MInt nDim>
20 : m_noSpecies(noSpecies), noVariables(nDim + 2 + noSpecies) {
21 if(m_noSpecies > 0) {
22 mAlloc(RHO_Y, m_noSpecies, "FvSysEqnNS::ConservativeVariables::RHO_Y", AT_);
23 for(MUint i = 0; i < m_noSpecies; ++i) {
24 RHO_Y[i] = RHO_C + i;
25 }
26 }
27}
28
29template <MInt nDim>
31
32template <MInt nDim>
34 mDeallocate(RHO_Y);
35}
37template <MInt nDim>
39 : m_noSpecies(noSpecies), noVariables(nDim + 2 + noSpecies) {
40 if(m_noSpecies > 0) {
41 mAlloc(Y, m_noSpecies, "FvSysEqnNS::PrimitiveVariables::Y", AT_);
42 for(MUint i = 0; i < m_noSpecies; ++i) {
43 Y[i] = C + i;
44 }
45 }
46}
47
48template <MInt nDim>
50 mDeallocate(Y);
51}
52
53template <MInt nDim>
55 TRACE();
56
57 for(MInt i = 0; i < noVariables; i++) {
58 names[i] = varNames[i];
59 }
60}
61
62template <MInt nDim>
64 m_gamma = Context::getSolverProperty<MFloat>("gamma", m_solverId, AT_, &m_gamma);
67
68 m_Pr = Context::getSolverProperty<MFloat>("Pr", m_solverId, AT_, &m_Pr);
69 m_F1BPr = 1 / m_Pr;
70
86 Context::getSolverProperty<MFloat>("referenceTemperature", m_solverId, AT_, &m_referenceTemperature);
87
101 Context::getSolverProperty<MFloat>("sutherlandConstant", m_solverId, AT_, &m_sutherlandConstant);
102
103 m_sutherlandConstantThermal = m_sutherlandConstant; // default value assumes a constant Prandtl number
116 Context::getSolverProperty<MFloat>("sutherlandConstantThermal", m_solverId, AT_, &m_sutherlandConstantThermal);
117
122
124
125 // Stencil specific properties
126 m_enhanceThreePointViscFluxFactor = Context::getSolverProperty<MFloat>("enhanceThreePointViscFluxFactor", m_solverId,
128
142 MString m_viscousFluxScheme = "FIVE_POINT";
143 m_viscousFluxScheme = Context::getSolverProperty<MString>("viscousFluxScheme", m_solverId, AT_, &m_viscousFluxScheme);
144
159 if(string2enum(m_viscousFluxScheme) == FIVE_POINT_STABILIZED
160 && Context::propertyExists("enhanceThreePointViscFluxFactor", m_solverId)) {
161 m_enhanceThreePointViscFluxFactor = Context::getSolverProperty<MFloat>(
162 "enhanceThreePointViscFluxFactor", m_solverId, AT_, &m_enhanceThreePointViscFluxFactor);
163 } else {
165 }
166
175
176 m_centralizeSurfaceVariablesFactor = Context::getSolverProperty<MFloat>(
177 "centralizeSurfaceVariablesFactor", m_solverId, AT_, &m_centralizeSurfaceVariablesFactor);
179 m_log << "centralize surface variable factor: " << m_centralizeSurfaceVariablesFactor << std::endl;
180 }
181}
182
183template <>
184constexpr MUint FvSysEqnNS<2>::index0[2]{1, 0};
185template <>
186constexpr MUint FvSysEqnNS<3>::index0[3]{1, 2, 0};
187template <>
188constexpr MUint FvSysEqnNS<2>::index1[2]{};
189template <>
190constexpr MUint FvSysEqnNS<3>::index1[3]{2, 0, 1};
191
192template class FvSysEqnNS<2>;
193template class FvSysEqnNS<3>;
void mAlloc(T *&a, const MLong N, const MString &objectName, MString function)
allocates memory for one-dimensional array 'a' of size N
Definition: alloc.h:173
MBool mDeallocate(T *&a)
deallocates the memory previously allocated for element 'a'
Definition: alloc.h:544
static MBool propertyExists(const MString &name, MInt solver=m_noSolvers)
This function checks if a property exists in general.
Definition: context.cpp:494
MFloat m_sutherlandConstant
ConservativeVariables * CV
MFloat m_sutherlandPlusOneThermal
PrimitiveVariables * PV
MFloat m_sutherlandPlusOne
MFloat m_centralizeSurfaceVariablesFactor
MFloat m_enhanceThreePointViscFluxFactor
FvSysEqnNS(const MInt solverId, const MInt noSpecies)
MFloat m_referenceTemperature
void readProperties()
MFloat m_F1BGammaMinusOne
FluxVariables * FV
MFloat m_sutherlandConstantThermal
MInt string2enum(MString theString)
This global function translates strings in their corresponding enum values (integer values)....
Definition: enums.cpp:20
@ FIVE_POINT_STABILIZED
Definition: enums.h:184
InfoOutFile m_log
int32_t MInt
Definition: maiatypes.h:62
uint32_t MUint
Definition: maiatypes.h:63
std::basic_string< char > MString
Definition: maiatypes.h:55
Static indices for accessing conservative variables in nDim spatial dimensions.
ConservativeVariables(const MInt noSpecies)
Static indices for accessing flux variables in this SysEqn identical to the conservative variables.
FluxVariables(const MInt noSpecies)
Static indices for accessing primitive variables in nDim spatial dimensions.
void getPrimitiveVariableNames(MString *names)
PrimitiveVariables(const MInt noSpecies)