MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
fvcartesiansyseqnrans.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#include "MEMORY/alloc.h"
9
10
11template <>
12std::vector<MString> FvSysEqnRANS<2, RANSModelConstants<RANS_SA_DV>>::PrimitiveVariables::varNames = {"u", "v", "rho",
13 "p", "nu", "c"};
14template <>
15std::vector<MString> FvSysEqnRANS<2, RANSModelConstants<RANS_FS>>::PrimitiveVariables::varNames = {"u", "v", "rho",
16 "p", "nu", "c"};
17template <>
18std::vector<MString> FvSysEqnRANS<2, RANSModelConstants<RANS_KOMEGA>>::PrimitiveVariables::varNames = {
19 "u", "v", "w", "rho", "p", "k", "omega", "c"};
20template <>
21std::vector<MString> FvSysEqnRANS<3, RANSModelConstants<RANS_SA_DV>>::PrimitiveVariables::varNames = {
22 "u", "v", "w", "rho", "p", "nu", "c"};
23template <>
24std::vector<MString> FvSysEqnRANS<3, RANSModelConstants<RANS_FS>>::PrimitiveVariables::varNames = {
25 "u", "v", "w", "rho", "p", "nu", "c"};
26template <>
27std::vector<MString> FvSysEqnRANS<3, RANSModelConstants<RANS_KOMEGA>>::PrimitiveVariables::varNames = {
28 "u", "v", "w", "rho", "p", "k", "omega", "c"};
29
30template <MInt nDim, class RANSModel>
32 : FvSysEqnNS<nDim>(solverId, noSpecies) {
33 CV = new ConservativeVariables(noSpecies);
34 PV = new PrimitiveVariables(noSpecies);
35 FV = new FluxVariables(noSpecies);
36}
37
38template <MInt nDim, class RANSModel>
40 : m_noSpecies(noSpecies), noVariables(nDim + 2 + m_noRansEquations + noSpecies) {
41 if(m_noRansEquations > 0) {
42 mAlloc(RHO_NN, m_noRansEquations, "FvSysEqnRANS::ConservativeVariables::RHO_NN", AT_);
43 for(MInt i = 0; i < m_noRansEquations; ++i) {
44 RHO_NN[i] = RHO_N + i;
45 }
46 }
47 if(m_noSpecies > 0) {
48 mAlloc(RHO_Y, m_noSpecies, "FvSysEqnRANS::ConservativeVariables::RHO_Y", AT_);
49 for(MUint i = 0; i < m_noSpecies; ++i) {
50 RHO_Y[i] = RHO_C + i;
51 }
52 }
53}
54
55template <MInt nDim, class RANSModel>
57 mDeallocate(RHO_NN);
58 mDeallocate(RHO_Y);
59}
60
61template <MInt nDim, class RANSModel>
63
64template <MInt nDim, class RANSModel>
66 : m_noSpecies(noSpecies), noVariables(nDim + 2 + m_noRansEquations + noSpecies) {
67 if(m_noRansEquations > 0) {
68 mAlloc(NN, m_noRansEquations, "FvSysEqnRANS::PrimitiveVariables::NN", AT_);
69 for(MInt i = 0; i < m_noRansEquations; ++i) {
70 NN[i] = N + i;
71 }
72 }
73 if(m_noSpecies > 0) {
74 mAlloc(Y, m_noSpecies, "FvSysEqnRANS::PrimitiveVariables::Y", AT_);
75 for(MUint i = 0; i < m_noSpecies; ++i) {
76 Y[i] = C + i;
77 }
78 }
79}
80
81template <MInt nDim, class RANSModel>
83 mDeallocate(NN);
84 mDeallocate(Y);
85}
86
87template <MInt nDim, class RANSModel>
89 TRACE();
90
91 for(MInt i = 0; i < noVariables; i++) {
92 names[i] = varNames[i];
93 }
94}
95
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
FluxVariables * FV
ConservativeVariables * CV
FvSysEqnRANS(const MInt solverId, const MInt noSpecies)
PrimitiveVariables * PV
static constexpr MInt m_noRansEquations
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 flux variables in this SysEqn identical to the conservative variables.
Static indices for accessing primitive variables in nDim spatial dimensions.
Static indices for accessing conservative variables in nDim spatial dimensions.
FluxVariables(const MInt noSpecies)
void getPrimitiveVariableNames(MString *names)