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  autoPtr<cavitationModel> cavitation_;
106 
107  //- The name of the VoF phase-fraction
108  word alphaName_;
109 
110 
111 public:
112 
113  //- Runtime type information
114  TypeName("VoFCavitation");
115 
116 
117  // Constructors
118 
119  //- Construct from explicit source name and mesh
121  (
122  const word& sourceName,
123  const word& modelType,
124  const fvMesh& mesh,
125  const dictionary& dict
126  );
127 
128  //- Disallow default bitwise copy construction
130  (
131  const VoFCavitation&
132  ) = delete;
133 
134 
135  // Member Functions
136 
137  //- Return the list of fields for which the option adds source term
138  // to the transport equation
139  virtual wordList addSupFields() const;
140 
141  //- Add implicit/explicit contributions to VoF phase-fraction equation
142  virtual void addSup
143  (
144  fvMatrix<scalar>& eqn,
145  const word& fieldName
146  ) const;
147 
148  //- Add implicit/explicit contributions to p_rgh equation
149  virtual void addSup
150  (
151  const volScalarField& psi,
152  fvMatrix<scalar>& eqn,
153  const word& fieldName
154  ) const;
155 
156  //- Add contribution to U equation
157  virtual void addSup
158  (
159  const volScalarField& rho,
160  fvMatrix<vector>& eqn,
161  const word& fieldName
162  ) const;
163 
164 
165  // Mesh changes
166 
167  //- Update topology using the given map
168  virtual void topoChange(const polyTopoChangeMap&);
169 
170  //- Update from another mesh using the given map
171  virtual void mapMesh(const polyMeshMap&);
172 
173  //- Redistribute or update using the given distribution map
174  virtual void distribute(const polyDistributionMap&);
175 
176  //- Update for mesh motion
177  virtual bool movePoints();
178 
179 
180  //- Correct the cavitation model
181  virtual void correct();
182 
183 
184  // Member Operators
185 
186  //- Disallow default bitwise assignment
187  void operator=(const VoFCavitation&) = delete;
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace fv
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
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: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
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:79
virtual void correct()
Correct the cavitation model.
virtual void addSup(fvMatrix< scalar > &eqn, const word &fieldName) const
Add implicit/explicit contributions to VoF phase-fraction equation.
Definition: VoFCavitation.C:86
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.
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
const volScalarField & psi
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict