cavitationModel.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) 2021 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::twoPhaseChangeModels::cavitationModel
26 
27 Description
28  Abstract base class for cavitation models
29 
30 SourceFiles
31  cavitationModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cavitationModel_H
36 #define cavitationModel_H
37 
38 #include "twoPhaseChangeModel.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace twoPhaseChangeModels
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class cavitationModel
49 \*---------------------------------------------------------------------------*/
50 
51 class cavitationModel
52 :
53  public twoPhaseChangeModel
54 {
55  // Private data
56 
57  //- Saturation vapour pressure
58  dimensionedScalar pSat_;
59 
60 
61 public:
62 
63  //- Runtime type information
64  TypeName("cavitation");
65 
66 
67  // Constructors
68 
69  //- Construct for mixture
71  (
72  const word& type,
73  const compressibleTwoPhaseMixture& mixture
74  );
75 
76 
77  //- Destructor
78  virtual ~cavitationModel()
79  {}
80 
81 
82  // Member Functions
83 
84  //- Return const-access to the saturation vapour pressure
85  const dimensionedScalar& pSat() const
86  {
87  return pSat_;
88  }
89 
90  //- Return the mass condensation and vaporisation rates as a
91  // coefficient to multiply (1 - alphal) for the condensation rate
92  // and a coefficient to multiply alphal for the vaporisation rate
94 
95  //- Return the mass condensation and vaporisation rates as coefficients
96  // to multiply (p - pSat)
97  virtual Pair<tmp<volScalarField::Internal>> mDotP() const = 0;
98 
99  //- Return the cavitation explicit and implicit sources
100  // for the phase-fraction equation
102  (
104  ) const;
105 
106  //- Return the cavitation source matrix
107  // for the p_rgh pressure equation
109  (
110  const volScalarField& rho,
111  const volScalarField& gh,
113  ) const;
114 
115  //- Return the cavitation source matrix for the momentum equation
116  virtual tmp<fvVectorMatrix> SU
117  (
118  const volScalarField& rho,
119  const surfaceScalarField& rhoPhi,
121  ) const;
122 
123  //- Read the phaseProperties dictionary and update
124  virtual bool read();
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace twoPhaseChangeModels
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
volScalarField & p_rgh
U
Definition: pEqn.H:72
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const dimensionedScalar & pSat() const
Return const-access to the saturation vapour pressure.
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: contiguous.H:49
virtual Pair< tmp< volScalarField::Internal > > Salpha(volScalarField &alpha) const
Return the cavitation explicit and implicit sources.
virtual Pair< tmp< volScalarField > > mDotAlphal() const =0
Return the mass condensation and vaporisation rates as a.
TypeName("cavitation")
Runtime type information.
cavitationModel(const word &type, const immiscibleIncompressibleTwoPhaseMixture &mixture)
Construct for mixture.
virtual tmp< fvVectorMatrix > SU(const volScalarField &rho, const surfaceScalarField &rhoPhi, volVectorField &U) const
Return the cavitation source matrix for the momentum equation.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
rhoPhi
Definition: rhoEqn.H:10
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
virtual tmp< fvScalarMatrix > Sp_rgh(const volScalarField &rho, const volScalarField &gh, volScalarField &p_rgh) const
Return the cavitation source matrix.
const volScalarField & gh
A class for managing temporary objects.
Definition: PtrList.H:53
virtual Pair< tmp< volScalarField > > mDotP() const =0
Return the mass condensation and vaporisation rates as coefficients.
Namespace for OpenFOAM.
virtual bool read()
Read the phaseProperties dictionary and update.