compressibleVoF.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) 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 Class
25  Foam::solvers::compressibleVoF
26 
27 Description
28  Solver module for 2 compressible, non-isothermal immiscible fluids
29  using a VOF (volume of fluid) phase-fraction based interface capturing
30  approach, with optional mesh motion and mesh topology changes including
31  adaptive re-meshing.
32 
33  The momentum and other fluid properties are of the "mixture" and a single
34  momentum equation is solved.
35 
36  Either mixture or two-phase transport modelling may be selected. In the
37  mixture approach a single laminar, RAS or LES model is selected to model the
38  momentum stress. In the Euler-Euler two-phase approach separate laminar,
39  RAS or LES selected models are selected for each of the phases.
40 
41  Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
42  pseudo-transient and steady simulations.
43 
44  Optional fvModels and fvConstraints are provided to enhance the simulation
45  in many ways including adding various sources, Lagrangian
46  particles, surface film etc. and constraining or limiting the solution.
47 
48 SourceFiles
49  compressibleVoF.C
50 
51 See also
52  Foam::solvers::VoFSolver
53  Foam::solvers::twoPhaseVoFSolver
54  Foam::solvers::incompressibleVoF
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef compressibleVoF_H
59 #define compressibleVoF_H
60 
61 #include "twoPhaseVoFSolver.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 namespace solvers
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class compressibleVoF Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 class compressibleVoF
78 :
79  public twoPhaseVoFSolver
80 {
81 
82 protected:
83 
84  // Phase properties
85 
86  //- The compressible two-phase mixture
88 
89 
90  // Thermophysical properties
91 
92  //- Reference to the mixture static pressure field
94 
95  //- Compressibility source
97 
98  //- Compressibility source stabilisation tolerance
99  scalar vDotResidualAlpha;
100 
101 
102  // Pressure reference
103 
104  //- Pressure reference
106 
107 
108  // Kinematic properties
109 
110  // Phase-1 mass-flux
112 
113  // Phase-2 mass-flux
115 
116  //- Kinetic energy field
117  // Used in the energy equation
119 
120 
121  // Momentum transport
122 
123  //- Momentum transport model
125 
126 
127  // Thermophysical transport
128 
129  //- Thermophysical transport model
132 
133 
134  // Cached temporary fields
135 
136  //- Phase-1 continuity error
138 
139  //- Phase-2 continuity error
141 
142 
143  // Protected Member Functions
144 
145  //- Read controls
146  virtual bool read();
147 
148  //- Return the pressure reference
149  virtual const Foam::pressureReference& pressureReference() const
150  {
151  return pressureReference_;
152  }
153 
154  //- The fluid is incompressible if both phases are incompressible
155  virtual bool incompressible() const
156  {
157  return mixture.incompressible();
158  }
159 
160  //- Compressible flow is divergent
161  virtual bool divergent() const
162  {
163  return
164  !incompressible()
167  }
168 
169  //- Return the mixture compressibility/density
170  // Used by CorrectPhi for compressible mixtures following mesh change
171  virtual tmp<volScalarField> psiByRho() const
172  {
173  return mixture.psiByRho();
174  }
175 
176  //- Calculate the alpha equation sources
177  virtual void alphaSuSp
178  (
181  );
182 
183  //- Return the momentum equation stress term
185 
186 public:
187 
188  // Access to the physical state
189 
190  //- The compressible two-phase mixture
192 
193 
194 public:
195 
196  //- Runtime type information
197  TypeName("compressibleVoF");
198 
199 
200  // Constructors
201 
202  //- Construct from region mesh
204 
205  //- Disallow default bitwise copy construction
206  compressibleVoF(const compressibleVoF&) = delete;
207 
208 
209  //- Destructor
210  virtual ~compressibleVoF();
211 
212 
213  // Member Functions
214 
215  //- Called at the start of the PIMPLE loop
216  virtual void prePredictor();
217 
218  //- Predict the momentum transport
219  virtual void momentumTransportPredictor();
220 
221  //- Predict thermophysical transport
222  virtual void thermophysicalTransportPredictor();
223 
224  //- Construct and optionally solve the momentum equation
225  virtual void momentumPredictor();
226 
227  //- Construct and solve the energy equation,
228  // convert to temperature
229  // and update thermophysical and transport properties
230  virtual void thermophysicalPredictor();
231 
232  //- Construct and solve the pressure equation in the PISO loop
233  virtual void pressureCorrector();
234 
235  //- Correct the momentum transport
236  virtual void momentumTransportCorrector();
237 
238  //- Correct the thermophysical transport
239  virtual void thermophysicalTransportCorrector();
240 
241 
242  // Member Operators
243 
244  //- Disallow default bitwise assignment
245  void operator=(const compressibleVoF&) = delete;
246 };
247 
248 
249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250 
251 } // End namespace solvers
252 } // End namespace Foam
253 
254 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
255 
256 #endif
257 
258 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
const word & name() const
Return name.
Definition: IOobject.H:307
Transport model selection class for the compressibleInterFoam family of solvers.
Class to represent a mixture of two rhoFluidThermo-based phases.
const volScalarField & rho1() const
Return the density of phase 1.
const volScalarField & rho2() const
Return the density of phase 2.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
virtual bool addsSupToField(const word &fieldName) const
Return true if an fvModel adds a source term to the given.
Definition: fvModels.C:229
Provides controls for the pressure reference in closed-volume simulations.
Foam::fvModels & fvModels() const
Return the fvModels that are created on demand.
Definition: solver.C:96
const fvMesh & mesh
Region mesh.
Definition: solver.H:101
const volVectorField & U
Reference to the velocity field.
Definition: VoFSolver.H:213
Solver module for 2 compressible, non-isothermal immiscible fluids using a VOF (volume of fluid) phas...
virtual void thermophysicalPredictor()
Construct and solve the energy equation,.
virtual tmp< volScalarField > psiByRho() const
Return the mixture compressibility/density.
virtual const Foam::pressureReference & pressureReference() const
Return the pressure reference.
virtual void momentumTransportCorrector()
Correct the momentum transport.
virtual void prePredictor()
Called at the start of the PIMPLE loop.
virtual bool incompressible() const
The fluid is incompressible if both phases are incompressible.
volScalarField & p
Reference to the mixture static pressure field.
virtual bool divergent() const
Compressible flow is divergent.
virtual void momentumTransportPredictor()
Predict the momentum transport.
tmp< volScalarField::Internal > contErr2
Phase-2 continuity error.
volScalarField::Internal vDot
Compressibility source.
virtual void alphaSuSp(tmp< volScalarField::Internal > &Su, tmp< volScalarField::Internal > &Sp)
Calculate the alpha equation sources.
Definition: alphaSuSp.C:32
const compressibleTwoPhaseVoFMixture & mixture
The compressible two-phase mixture.
volScalarField K
Kinetic energy field.
scalar vDotResidualAlpha
Compressibility source stabilisation tolerance.
virtual void pressureCorrector()
Construct and solve the pressure equation in the PISO loop.
compressibleInterPhaseTransportModel momentumTransport
Momentum transport model.
virtual void momentumPredictor()
Construct and optionally solve the momentum equation.
compressibleTwoPhaseVoFMixture & mixture_
The compressible two-phase mixture.
compressibleVoF(fvMesh &mesh)
Construct from region mesh.
TypeName("compressibleVoF")
Runtime type information.
virtual void thermophysicalTransportCorrector()
Correct the thermophysical transport.
void operator=(const compressibleVoF &)=delete
Disallow default bitwise assignment.
virtual ~compressibleVoF()
Destructor.
tmp< volScalarField::Internal > contErr1
Phase-1 continuity error.
virtual tmp< fvVectorMatrix > divDevTau(volVectorField &U)
Return the momentum equation stress term.
compressibleInterPhaseThermophysicalTransportModel thermophysicalTransport
Thermophysical transport model.
Foam::pressureReference pressureReference_
Pressure reference.
virtual void thermophysicalTransportPredictor()
Predict thermophysical transport.
virtual bool read()
Read controls.
Solver module base-class for 2 immiscible fluids using a VOF (volume of fluid) phase-fraction based i...
A class for managing temporary objects.
Definition: tmp.H:55
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
Definition: fvcSup.C:44
tmp< VolField< Type > > Sp(const volScalarField &sp, const VolField< Type > &vf)
Definition: fvcSup.C:67
Namespace for OpenFOAM.