VoFCavitation.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::VoFCavitation
26 
27 Description
28  Cavitation fvModel
29 
30 Usage
31  Example usage:
32  \verbatim
33  VoFCavitation
34  {
35  type VoFCavitation;
36 
37  model SchnerrSauer;
38 
39  KunzCoeffs
40  {
41  pSat 2300; // Saturation pressure
42 
43  UInf 20.0;
44  tInf 0.005; // L = 0.1 m
45  Cc 1000;
46  Cv 1000;
47  }
48 
49  MerkleCoeffs
50  {
51  pSat 2300; // Saturation pressure
52 
53  UInf 20.0;
54  tInf 0.005; // L = 0.1 m
55  Cc 80;
56  Cv 1e-03;
57  }
58 
59  SchnerrSauerCoeffs
60  {
61  pSat 2300; // Saturation pressure
62 
63  n 1.6e+13;
64  dNuc 2.0e-06;
65  Cc 1;
66  Cv 1;
67  }
68  }
69  \endverbatim
70 
71 SourceFiles
72  VoFCavitation.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef VoFCavitation_H
77 #define VoFCavitation_H
78 
79 #include "fvModel.H"
80 #include "cavitationModel.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 
87 class incompressibleTwoPhaseVoFMixture;
88 
89 namespace fv
90 {
91 
92 /*---------------------------------------------------------------------------*\
93  Class VoFCavitation Declaration
94 \*---------------------------------------------------------------------------*/
95 
96 class VoFCavitation
97 :
98  public fvModel
99 {
100  // Private Data
101 
102  //- Reference to the mixture properties
103  const incompressibleTwoPhaseVoFMixture& mixture_;
104 
105  //- The cavitation model
106  autoPtr<cavitationModel> cavitation_;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("VoFCavitation");
113 
114 
115  // Constructors
116 
117  //- Construct from explicit source name and mesh
119  (
120  const word& sourceName,
121  const word& modelType,
122  const fvMesh& mesh,
123  const dictionary& dict
124  );
125 
126  //- Disallow default bitwise copy construction
128  (
129  const VoFCavitation&
130  ) = delete;
131 
132 
133  // Member Functions
134 
135  //- Return the list of fields for which the option adds source term
136  // to the transport equation
137  virtual wordList addSupFields() const;
138 
139  //- Add a source to the phase continuity equation
140  virtual void addSup
141  (
142  const volScalarField& alpha,
143  fvMatrix<scalar>& eqn
144  ) const;
145 
146  //- Add a source to the mixture momentum equation
147  virtual void addSup
148  (
149  const volScalarField& rho,
150  const volVectorField& U,
151  fvMatrix<vector>& eqn
152  ) const;
153 
154 
155  // Mesh changes
156 
157  //- Update topology using the given map
158  virtual void topoChange(const polyTopoChangeMap&);
159 
160  //- Update from another mesh using the given map
161  virtual void mapMesh(const polyMeshMap&);
162 
163  //- Redistribute or update using the given distribution map
164  virtual void distribute(const polyDistributionMap&);
165 
166  //- Update for mesh motion
167  virtual bool movePoints();
168 
169 
170  //- Correct the cavitation model
171  virtual void correct();
172 
173 
174  // Member Operators
175 
176  //- Disallow default bitwise assignment
177  void operator=(const VoFCavitation&) = delete;
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace fv
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
Generic GeometricField class.
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
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:99
Finite volume model abstract base class.
Definition: fvModel.H:59
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:53
Cavitation fvModel.
Definition: VoFCavitation.H:98
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the option adds source term.
Definition: VoFCavitation.C:77
virtual void correct()
Correct the cavitation model.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
TypeName("VoFCavitation")
Runtime type information.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual void addSup(const volScalarField &alpha, fvMatrix< scalar > &eqn) const
Add a source to the phase continuity equation.
Definition: VoFCavitation.C:89
void operator=(const VoFCavitation &)=delete
Disallow default bitwise assignment.
VoFCavitation(const word &sourceName, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
Definition: VoFCavitation.C:54
Class to represent a mixture of two constant density phases.
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 handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
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