XiFluid.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2022-2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "XiFluid.H"
27 #include "localEulerDdtScheme.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace solvers
35 {
38 }
39 }
40 
41 
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43 
45 :
47  (
48  mesh,
50  ),
51 
53 
54  b_(thermo_.Y("b")),
55 
57  (
58  momentumTransport(),
59  thermo_,
60  true
61  ),
62 
63  combustionProperties
64  (
65  IOobject
66  (
67  "combustionProperties",
68  runTime.constant(),
69  mesh,
70  IOobject::MUST_READ_IF_MODIFIED,
71  IOobject::NO_WRITE
72  )
73  ),
74 
75  SuModel_
76  (
77  SuModel::New
78  (
79  combustionProperties,
80  thermo_,
82  )
83  ),
84 
85  XiModel_
86  (
87  XiModel::New
88  (
89  combustionProperties,
90  thermo_,
92  SuModel_->Su()
93  )
94  ),
95 
96  thermo(thermo_),
97  b(b_),
98  Su(SuModel_->Su()),
99  Xi(XiModel_->Xi())
100 {
101  thermo.validate(type(), "ha", "ea");
102 
103  if (thermo_.containsSpecie("ft"))
104  {
105  fields.add(thermo_.Y("ft"));
106  }
107 
108  if (thermo_.containsSpecie("fu"))
109  {
110  fields.add(thermo_.Y("fu"));
111  }
112 
113  if (thermo_.containsSpecie("egr"))
114  {
115  fields.add(thermo_.Y("egr"));
116  }
117 
118  fields.add(b);
119  fields.add(thermo.he());
120  fields.add(thermo.heu());
121 }
122 
123 
124 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
125 
127 {}
128 
129 
130 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
131 
133 {
134  thermophysicalTransport.predict();
135 }
136 
137 
139 {
140  thermophysicalTransport.correct();
141 }
142 
143 
145 {
146  thermo_.reset();
147  SuModel_->reset();
148  XiModel_->reset();
149 }
150 
151 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
Base-class for all Su models used by the b-Xi combustion model.
Definition: SuModel.H:65
Base-class for all Xi models used by the b-Xi combustion model.
Definition: XiModel.H:117
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
void validate(const string &app, const word &) const
Check that the thermodynamics package is consistent.
Definition: basicThermo.C:308
virtual const volScalarField & he() const =0
Enthalpy/Internal energy [J/kg].
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:56
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
Base-class for combustion fluid thermodynamic properties based on compressibility.
virtual const volScalarField & heu() const =0
Unburnt gas enthalpy [J/kg].
virtual PtrList< volScalarField > & Y()=0
Access the mass-fraction fields.
bool containsSpecie(const word &specieName) const
Does the mixture include this specie?
Abstract base class for run-time selectable region solvers.
Definition: solver.H:56
Solver module for compressible premixed/partially-premixed combustion with turbulence modelling.
Definition: XiFluid.H:143
const volScalarField & b
Reference to the combustion regress variable.
Definition: XiFluid.H:253
XiFluid(fvMesh &mesh)
Construct from region mesh.
Definition: XiFluid.C:44
psiuMulticomponentThermo & thermo_
Definition: XiFluid.H:149
virtual ~XiFluid()
Destructor.
Definition: XiFluid.C:126
virtual void thermophysicalTransportCorrector()
Correct the thermophysical transport.
Definition: XiFluid.C:138
const psiuMulticomponentThermo & thermo
Reference to the fluid thermophysical properties.
Definition: XiFluid.H:249
virtual void reset()
Reset b-Xi and thermodynamics to the unburnt state.
Definition: XiFluid.C:144
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Set of fields used for the multivariate convection scheme.
Definition: XiFluid.H:158
virtual void thermophysicalTransportPredictor()
Predict thermophysical transport.
Definition: XiFluid.C:132
Solver module for steady or transient turbulent flow of compressible isothermal fluids with optional ...
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
volScalarField & b
Definition: createFields.H:27
Info<< "Creating thermophysical transport model\n"<< endl;turbulenceThermophysicalTransportModels::unityLewisEddyDiffusivity< RASThermophysicalTransportModel< ThermophysicalTransportModel< compressibleMomentumTransportModel, fluidThermo > >> thermophysicalTransport(turbulence(), thermo, true)
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
Definition: fvcSup.C:44
addToRunTimeSelectionTable(solver, compressibleMultiphaseVoF, fvMesh)
defineTypeNameAndDebug(compressibleMultiphaseVoF, 0)
Namespace for OpenFOAM.
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:134
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
PtrList< volScalarField > & Y
fluidMulticomponentThermo & thermo
Definition: createFields.H:31