incompressibleDriftFlux.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) 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::solvers::incompressibleDriftFlux
26 
27 Description
28  Solver module for 2 incompressible fluids using the mixture approach with
29  the drift-flux approximation for relative motion of the phases, with
30  optional mesh motion and mesh topology changes including adaptive
31  re-meshing.
32 
33  The momentum and other fluid properties are of the "mixture" and a single
34  momentum equation is solved with mixture transport modelling in which a
35  single laminar, RAS or LES model is selected to model the momentum stress.
36 
37  Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
38  pseudo-transient and steady simulations.
39 
40  Optional fvModels and fvConstraints are provided to enhance the simulation
41  in many ways including adding various sources, Lagrangian
42  particles, surface film etc. and constraining or limiting the solution.
43 
44 SourceFiles
45  incompressibleDriftFlux.C
46 
47 See also
48  Foam::solvers::VoFSolver
49  Foam::solvers::twoPhaseSolver
50  Foam::solvers::compressibleVoF
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef incompressibleDriftFlux_H
55 #define incompressibleDriftFlux_H
56 
57 #include "twoPhaseSolver.H"
59 #include "relativeVelocityModel.H"
60 #include "momentumTransportModel.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace solvers
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class incompressibleDriftFlux Declaration
72 \*---------------------------------------------------------------------------*/
73 
75 :
76  public twoPhaseSolver
77 {
78 
79 protected:
80 
81  // Phase properties
82 
83  //- The compressible two-phase mixture
85 
86 
87  // Thermophysical properties
88 
89  //- Static pressure field
91 
92 
93  // Pressure reference
94 
95  //- Pressure reference
97 
98 
99  // Momentum transport
100 
101  //- Pointer to the dispersed phase relative velocity model
103 
104  //- Pointer to the momentum transport model
106 
107 
108 private:
109 
110  // Private Member Functions
111 
112  //- Correct the cached Courant numbers
113  virtual void correctCoNum();
114 
115 
116 protected:
117 
118  // Protected Member Functions
119 
120  //- Return the pressure reference
121  virtual const Foam::pressureReference& pressureReference() const
122  {
123  return pressureReference_;
124  }
125 
126  //- The flow is incompressible
127  virtual bool incompressible() const
128  {
129  return true;
130  }
131 
132  //- Is the flow divergent?
133  // i.e. includes phase-fraction sources
134  virtual bool divergent() const
135  {
136  return
139  }
140 
141  //- Return the mixture compressibility/density
142  // Not required for incompressible fluids
143  virtual tmp<volScalarField> psiByRho() const
144  {
145  return tmp<volScalarField>(nullptr);
146  }
147 
149  (
150  const surfaceScalarField& phi,
151  const volScalarField& alpha,
153  );
154 
155  //- Adjust the rDeltaT in the vicinity of the interface
156  virtual void setInterfaceRDeltaT(volScalarField& rDeltaT);
157 
158  //- Calculate the alpha equation sources
159  virtual void alphaSuSp
160  (
164  );
165 
166  //- Correct the interface properties following mesh-change
167  // and phase-fraction update
168  virtual void correctInterface();
169 
170  //- Return the interface surface tension force for the momentum equation
172 
173  //- Return the momentum equation stress term
175  {
176  return
177  relativeVelocity->divDevTau()
178  + momentumTransport->divDevTau(U);
179  }
180 
181 
182 public:
183 
184  //- Runtime type information
185  TypeName("incompressibleDriftFlux");
186 
187 
188  // Constructors
189 
190  //- Construct from region mesh
192 
193  //- Disallow default bitwise copy construction
195 
196 
197  //- Destructor
198  virtual ~incompressibleDriftFlux();
199 
200 
201  // Member Functions
202 
203  //- Return the current maximum time-step for stable solution
204  virtual scalar maxDeltaT() const;
205 
206  //- Called at the start of the PIMPLE loop
207  virtual void prePredictor();
208 
209  //- Construct and solve the energy equation,
210  // convert to temperature
211  // and update thermophysical and transport properties
212  virtual void thermophysicalPredictor();
213 
214  //- Construct and solve the pressure equation in the PISO loop
215  virtual void pressureCorrector();
216 
217  //- Correct the momentum and thermophysical transport modelling
218  virtual void postCorrector();
219 
220 
221  // Member Operators
222 
223  //- Disallow default bitwise assignment
224  void operator=(const incompressibleDriftFlux&) = delete;
225 };
226 
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 } // End namespace solvers
231 } // End namespace Foam
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 #endif
236 
237 // ************************************************************************* //
const dictionary & alphaControls
Definition: alphaControls.H:1
Generic GeometricField class.
const word & name() const
Return name.
Definition: IOobject.H:310
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
virtual bool addsSupToField(const word &fieldName) const
Return true if an fvModel adds a source term to the given.
Definition: fvModels.C:229
Class to represent a mixture of two constant density phases.
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 surfaceScalarField & phi
Reference to the mass-flux field.
Definition: VoFSolver.H:212
const volVectorField & U
Reference to the velocity field.
Definition: VoFSolver.H:209
Solver module for 2 incompressible fluids using the mixture approach with the drift-flux approximatio...
virtual void thermophysicalPredictor()
Construct and solve the energy equation,.
virtual tmp< volScalarField > psiByRho() const
Return the mixture compressibility/density.
virtual tmp< surfaceScalarField > surfaceTensionForce() const
Return the interface surface tension force for the momentum equation.
virtual const Foam::pressureReference & pressureReference() const
Return the pressure reference.
virtual void prePredictor()
Called at the start of the PIMPLE loop.
virtual bool incompressible() const
The flow is incompressible.
virtual bool divergent() const
Is the flow divergent?
incompressibleDriftFlux(fvMesh &mesh)
Construct from region mesh.
virtual scalar maxDeltaT() const
Return the current maximum time-step for stable solution.
autoPtr< relativeVelocityModel > relativeVelocity
Pointer to the dispersed phase relative velocity model.
TypeName("incompressibleDriftFlux")
Runtime type information.
incompressibleDriftFluxMixture & mixture
The compressible two-phase mixture.
virtual void pressureCorrector()
Construct and solve the pressure equation in the PISO loop.
virtual void postCorrector()
Correct the momentum and thermophysical transport modelling.
virtual void setInterfaceRDeltaT(volScalarField &rDeltaT)
Adjust the rDeltaT in the vicinity of the interface.
void operator=(const incompressibleDriftFlux &)=delete
Disallow default bitwise assignment.
virtual void alphaSuSp(tmp< volScalarField::Internal > &Su, tmp< volScalarField::Internal > &Sp, const dictionary &alphaControls)
Calculate the alpha equation sources.
Definition: alphaSuSp.C:50
virtual tmp< surfaceScalarField > alphaPhi(const surfaceScalarField &phi, const volScalarField &alpha, const dictionary &alphaControls)
Definition: alphaSuSp.C:34
virtual void correctInterface()
Correct the interface properties following mesh-change.
Foam::pressureReference pressureReference_
Pressure reference.
volScalarField p
Static pressure field.
virtual tmp< fvVectorMatrix > divDevTau(volVectorField &U)
Return the momentum equation stress term.
autoPtr< compressible::momentumTransportModel > momentumTransport
Pointer to the momentum transport model.
Solver module base-class for 2 immiscible fluids, with optional mesh motion and mesh topology changes...
volScalarField & alpha1
Reference to the phase1-fraction.
volScalarField & alpha2
Reference to the phase2-fraction.
A class for managing temporary objects.
Definition: tmp.H:55
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
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.