interfaceTurbulenceDamping.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-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::fv::interfaceTurbulenceDamping
26 
27 Description
28  Free-surface phase turbulence damping function
29 
30  Adds an extra source term to the mixture or phase epsilon or omega
31  equation to reduce turbulence generated near a free-surface. The
32  implementation is based on
33 
34  Reference:
35  \verbatim
36  Frederix, E. M. A., Mathur, A., Dovizio, D., Geurts, B. J.,
37  & Komen, E. M. J. (2018).
38  Reynolds-averaged modeling of turbulence damping
39  near a large-scale interface in two-phase flow.
40  Nuclear engineering and design, 333, 122-130.
41  \endverbatim
42 
43  but with an improved formulation for the coefficient \c A appropriate for
44  unstructured meshes including those with split-cell refinement patterns.
45  However the dimensioned length-scale coefficient \c delta remains and must
46  be set appropriately for the case by performing test runs and comparing with
47  known results. Clearly this model is far from general and more research is
48  needed in order that \c delta can be obtained directly from the interface
49  flow and turbulence conditions.
50 
51 Usage
52  Example usage:
53  \verbatim
54  interfaceTurbulenceDamping
55  {
56  type interfaceTurbulenceDamping;
57 
58  libs ("libmultiphaseEulerFoamFvModels.so");
59 
60  phase water;
61 
62  // Interface turbulence damping length scale
63  // This is a required input as described in section 3.3 of the paper
64  delta 1e-4;
65  }
66  \endverbatim
67 
68 SourceFiles
69  interfaceTurbulenceDamping.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef interfaceTurbulenceDamping_H
74 #define interfaceTurbulenceDamping_H
75 
76 #include "fvModel.H"
77 #include "phaseSystem.H"
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 namespace Foam
83 {
84 namespace fv
85 {
86 
87 /*---------------------------------------------------------------------------*\
88  Class interfaceTurbulenceDamping Declaration
89 \*---------------------------------------------------------------------------*/
90 
92 :
93  public fvModel
94 {
95  // Private Data
96 
97  //- The name of the phase
98  word phaseName_;
99 
100  //- Field name
101  word fieldName_;
102 
103  //- Interface turbulence damping length scale
104  // This is a required input as described in section 3.3 of the paper
105  dimensionedScalar delta_;
106 
107  //- Reference to the phase
108  const phaseModel& phase_;
109 
110  //- Reference to the mixture turbulence model
112 
113  // Turbulence model coefficients
114 
115  dimensionedScalar C2_;
116  dimensionedScalar betaStar_;
117  dimensionedScalar beta_;
118 
119 
120  // Private Member Functions
121 
122  //- Interface fraction in a cell
123  tmp<volScalarField::Internal> interfaceFraction
124  (
125  const volScalarField& alpha
126  ) const;
127 
128  //- Add explicit contribution to incompressible or compressible
129  // mixture epsilon or omega equation
130  template<class RhoType>
131  void addRhoSup
132  (
133  const RhoType& rho,
134  fvMatrix<scalar>& eqn,
135  const word& fieldName
136  ) const;
137 
138 
139 public:
140 
141  //- Runtime type information
142  TypeName("interfaceTurbulenceDamping");
143 
144 
145  // Constructors
146 
147  //- Construct from explicit source name and mesh
149  (
150  const word& sourceName,
151  const word& modelType,
152  const fvMesh& mesh,
153  const dictionary& dict
154  );
155 
156  //- Disallow default bitwise copy construction
158  (
160  ) = delete;
161 
162 
163  // Member Functions
164 
165  //- Return the list of fields for which the option adds source term
166  // to the transport equation
167  virtual wordList addSupFields() const;
168 
169  //- Add explicit contribution to mixture epsilon or omega equation
170  virtual void addSup
171  (
172  fvMatrix<scalar>& eqn,
173  const word& fieldName
174  ) const;
175 
176  //- Add explicit contribution to compressible
177  // mixture epsilon or omega equation
178  virtual void addSup
179  (
180  const volScalarField& rho,
181  fvMatrix<scalar>& eqn,
182  const word& fieldName
183  ) const;
184 
185  //- Add explicit contribution to phase epsilon or omega equation
186  virtual void addSup
187  (
188  const volScalarField& alpha,
189  const volScalarField& rho,
190  fvMatrix<scalar>& eqn,
191  const word& fieldName
192  ) const;
193 
194 
195  // Mesh changes
196 
197  //- Update topology using the given map
198  virtual void topoChange(const polyTopoChangeMap&);
199 
200  //- Update from another mesh using the given map
201  virtual void mapMesh(const polyMeshMap&);
202 
203  //- Redistribute or update using the given distribution map
204  virtual void distribute(const polyDistributionMap&);
205 
206  //- Update for mesh motion
207  virtual bool movePoints();
208 
209 
210  // Member Operators
211 
212  //- Disallow default bitwise assignment
213  void operator=(const interfaceTurbulenceDamping&) = delete;
214 };
215 
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 } // End namespace fv
220 } // End namespace Foam
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
Generic GeometricField class.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Finite volume model abstract base class.
Definition: fvModel.H:59
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
Free-surface phase turbulence damping function.
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the option adds source term.
void operator=(const interfaceTurbulenceDamping &)=delete
Disallow default bitwise assignment.
virtual void addSup(fvMatrix< scalar > &eqn, const word &fieldName) const
Add explicit contribution to mixture epsilon or omega equation.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
TypeName("interfaceTurbulenceDamping")
Runtime type information.
interfaceTurbulenceDamping(const word &sourceName, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
Templated abstract base class for multiphase compressible turbulence models.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict