multiphaseEulerCavitation.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) 2025 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::multiphaseEulerCavitation
26 
27 Description
28  Model for cavitation phase change between two phases.
29 
30  Example usage:
31  \verbatim
32  cavitation
33  {
34  type multiphaseEuler::cavitation;
35  libs ("libmultiphaseEulerFvModels.so");
36 
37  // Note: Order is important. The liquid should be specified first.
38  phases (liquid gas);
39 
40  energySemiImplicit no;
41 
42  model Kunz;
43 
44  pSat 79995.75943;
45 
46  UInf 5.33;
47  tInf 0.028142589;
48  Cc 100;
49  Cv 100;
50  }
51  \endverbatim
52 
53 SourceFiles
54  multiphaseEulerCavitation.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef multiphaseEulerCavitation_H
59 #define multiphaseEulerCavitation_H
60 
61 #include "phaseChange.H"
62 #include "phaseSystem.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 
69 // Forward declaration of classes
70 namespace compressible
71 {
72  class cavitationModel;
73 }
74 
75 namespace fv
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class multiphaseEulerCavitation Declaration
80 \*---------------------------------------------------------------------------*/
81 
83 :
84  public phaseChange
85 {
86 private:
87 
88  // Private Data
89 
90  //- Reference to the phase system
91  const phaseSystem& fluid_;
92 
93  //- Reference to the liquid phase
94  const phaseModel& liquid_;
95 
96  //- Reference to the vapour phase
97  const phaseModel& vapour_;
98 
99  //- Interface
100  const phaseInterface interface_;
101 
102  //- Reference to the field associated with the pressure equation
103  const volScalarField& p_rgh_;
104 
105  //- Cavitation model
107 
108 
109  // Private Member Functions
110 
111  //- Non-virtual read
112  void readCoeffs(const dictionary& dict);
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("multiphaseEuler::cavitation");
119 
120 
121  // Constructors
122 
123  //- Construct from explicit source name and mesh
125  (
126  const word& name,
127  const word& modelType,
128  const fvMesh& mesh,
129  const dictionary& dict
130  );
131 
132 
133  // Member Functions
134 
135  // Evaluation
136 
137  //- Return the fraction of the latent heat that is transferred into
138  // the second phase
140 
141 
142  // Sources
143 
144  //- Return the mass transfer rate
146 
147  //- Use phaseChange's source functions
148  using phaseChange::addSup;
149 
150  //- Override the pressure equation to add the mass transfer rate
151  // linearised in the pressure
152  void addSup
153  (
154  const volScalarField& alpha,
155  const volScalarField& rho,
156  fvMatrix<scalar>& eqn
157  ) const;
158 
159 
160  // IO
161 
162  //- Read source dictionary
163  virtual bool read(const dictionary& dict);
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace fv
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
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
Abstract base class for cavitation models.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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:96
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:69
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:57
tmp< volScalarField::Internal > rho(const label i) const
Return the density.
Definition: massTransfer.C:92
Model for cavitation phase change between two phases.
virtual tmp< DimensionedField< scalar, volMesh > > Lfraction() const
Return the fraction of the latent heat that is transferred into.
virtual tmp< DimensionedField< scalar, volMesh > > mDot() const
Return the mass transfer rate.
virtual bool read(const dictionary &dict)
Read source dictionary.
void addSup(const volScalarField &alpha, const volScalarField &rho, const volScalarField &heOrYi, fvMatrix< scalar > &eqn) const
Use phaseChange's source functions.
Definition: phaseChange.C:551
TypeName("multiphaseEuler::cavitation")
Runtime type information.
multiphaseEulerCavitation(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
Base class for phase change models.
Definition: phaseChange.H:61
void addSup(const volScalarField &alpha, const volScalarField &rho, const volScalarField &heOrYi, fvMatrix< scalar > &eqn) const
Override the energy equation to add the phase change heat, or.
Definition: phaseChange.C:551
Class to represent an interface between phases. Derivations can further specify the configuration of ...
Class to represent a system of phases.
Definition: phaseSystem.H:74
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