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 fvModels().addsSupToField(alpha1.name());
137  }
138 
139  //- Return the mixture compressibility/density
140  // Not required for incompressible fluids
141  virtual tmp<volScalarField> psiByRho() const
142  {
143  return tmp<volScalarField>(nullptr);
144  }
145 
147  (
148  const surfaceScalarField& phi,
149  const volScalarField& alpha,
151  );
152 
153  //- Adjust the rDeltaT in the vicinity of the interface
154  virtual void setInterfaceRDeltaT(volScalarField& rDeltaT);
155 
156  //- Calculate the alpha equation sources
157  virtual void alphaSuSp
158  (
161  );
162 
163  //- Correct the interface properties following mesh-change
164  // and phase-fraction update
165  virtual void correctInterface();
166 
167  //- Return the interface surface tension force for the momentum equation
169 
170  //- Return the momentum equation stress term
172  {
173  return
174  relativeVelocity->divDevTau()
175  + momentumTransport->divDevTau(U);
176  }
177 
178 
179 public:
180 
181  //- Runtime type information
182  TypeName("incompressibleDriftFlux");
183 
184 
185  // Constructors
186 
187  //- Construct from region mesh
189 
190  //- Disallow default bitwise copy construction
192 
193 
194  //- Destructor
195  virtual ~incompressibleDriftFlux();
196 
197 
198  // Member Functions
199 
200  //- Return the current maximum time-step for stable solution
201  virtual scalar maxDeltaT() const;
202 
203  //- Called at the start of the PIMPLE loop
204  virtual void prePredictor();
205 
206  //- Construct and solve the energy equation,
207  // convert to temperature
208  // and update thermophysical and transport properties
209  virtual void thermophysicalPredictor();
210 
211  //- Construct and solve the pressure equation in the PISO loop
212  virtual void pressureCorrector();
213 
214  //- Correct the momentum and thermophysical transport modelling
215  virtual void postCorrector();
216 
217 
218  // Member Operators
219 
220  //- Disallow default bitwise assignment
221  void operator=(const incompressibleDriftFlux&) = delete;
222 };
223 
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 } // End namespace solvers
228 } // End namespace Foam
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 #endif
233 
234 // ************************************************************************* //
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:160
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
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:85
const fvMesh & mesh
Region mesh.
Definition: solver.H:94
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 void alphaSuSp(tmp< volScalarField::Internal > &Su, tmp< volScalarField::Internal > &Sp)
Calculate the alpha equation sources.
Definition: alphaSuSp.C:49
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 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 for 2 immiscible fluids, with optional mesh motion and mesh topology cha...
volScalarField & alpha1
Reference to the phase1-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.