AnisothermalPhaseModel.H
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) 2015-2023 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 Class
25  Foam::AnisothermalPhaseModel
26 
27 Description
28  Class which represents a phase for which the temperature (strictly energy)
29  varies. Returns the energy equation and corrects the thermodynamic model.
30 
31 SourceFiles
32  AnisothermalPhaseModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef AnisothermalPhaseModel_H
37 #define AnisothermalPhaseModel_H
38 
39 #include "phaseModel.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Trait for converting the ThermoModel's thermo type to the thermo type needed
50 // for the thermophysical transport model type; i.e., from rho-type thermo to
51 // fluid-type thermo.
52 
53 template<class ThermoModel>
55 
56 template<>
58 {
59  typedef fluidThermo type;
60 };
61 
62 template<>
64 {
66 };
67 
68 
69 /*---------------------------------------------------------------------------*\
70  Class AnisothermalPhaseModel Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 template<class BasePhaseModel>
75 :
76  public BasePhaseModel
77 {
78  // Private Member Data
79 
80  //- Gravitational acceleration
82 
83  //- Thermo type for the thermophysical transport model
84  typedef
86  <
87  typename BasePhaseModel::thermoModel
88  >::type
89  transportThermoModel;
90 
91  //- Thermophysical transport model
92  autoPtr
93  <
95  <
97  transportThermoModel
98  >
99  > thermophysicalTransport_;
100 
101 
102  // Private Member Functions
103 
104  //- Optionally filter the pressure work term as the phase-fraction -> 0
105  tmp<volScalarField> filterPressureWork
106  (
107  const tmp<volScalarField>& pressureWork
108  ) const;
109 
110 
111 public:
112 
113  // Constructors
114 
116  (
117  const phaseSystem& fluid,
118  const word& phaseName,
119  const bool referencePhase,
120  const label index
121  );
122 
123 
124  //- Destructor
125  virtual ~AnisothermalPhaseModel();
126 
127 
128  // Member Functions
129 
130  //- Return whether the phase is isothermal
131  virtual bool isothermal() const;
132 
133  //- Correct the thermodynamics
134  virtual void correctThermo();
135 
136  //- Predict the energy transport e.g. alphat
137  virtual void predictThermophysicalTransport();
138 
139  //- Correct the energy transport e.g. alphat
140  virtual void correctThermophysicalTransport();
141 
142  //- Return the effective thermal conductivity on a patch
143  virtual tmp<scalarField> kappaEff(const label patchi) const;
144 
145  //- Return the source term for the energy equation
146  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
147 
148  //- Return the source term for the given specie mass-fraction
149  // equation
150  virtual tmp<fvScalarMatrix> divj(volScalarField& Yi) const;
151 
152  //- Return the enthalpy equation
153  virtual tmp<fvScalarMatrix> heEqn();
154 
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #ifdef NoRepository
165  #include "AnisothermalPhaseModel.C"
166 #endif
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
Class which represents a phase for which the temperature (strictly energy) varies....
virtual ~AnisothermalPhaseModel()
Destructor.
AnisothermalPhaseModel(const phaseSystem &fluid, const word &phaseName, const bool referencePhase, const label index)
virtual void correctThermo()
Correct the thermodynamics.
virtual void predictThermophysicalTransport()
Predict the energy transport e.g. alphat.
virtual tmp< fvScalarMatrix > divj(volScalarField &Yi) const
Return the source term for the given specie mass-fraction.
virtual void correctThermophysicalTransport()
Correct the energy transport e.g. alphat.
virtual bool isothermal() const
Return whether the phase is isothermal.
virtual tmp< fvScalarMatrix > heEqn()
Return the enthalpy equation.
virtual tmp< scalarField > kappaEff(const label patchi) const
Return the effective thermal conductivity on a patch.
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
Generic GeometricField class.
Templated base class for multiphase thermophysical transport models.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Base-class for multi-component fluid thermodynamic properties.
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:57
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:73
Base-class for multi-component fluid thermodynamic properties based on density.
Base-class for fluid thermodynamic properties based on density.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
label patchi
phaseCompressibleMomentumTransportModel momentumTransportModel
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
thermo he()