Merkle.C
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) 2011-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 \*---------------------------------------------------------------------------*/
25 
26 #include "Merkle.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace compressible
34 {
35 namespace cavitationModels
36 {
39 }
40 }
41 }
42 
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
47 (
48  const dictionary& dict,
49  const compressibleTwoPhases& phases
50 )
51 :
52  cavitationModel(dict, phases),
53 
54  UInf_("UInf", dimVelocity, dict),
55  tInf_("tInf", dimTime, dict),
56  Cv_("Cv", dimless, dict),
57  Cc_("Cc", dimless, dict),
58 
59  p0_("0", dimPressure, 0),
60 
61  mcCoeff_(Cc_/(0.5*sqr(UInf_)*tInf_))
62 {
63  correct();
64 }
65 
66 
67 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
68 
70 Foam::compressible::cavitationModels::Merkle::mvCoeff() const
71 {
72  return Cv_*rhol()/(0.5*sqr(UInf_)*tInf_*rhov());
73 }
74 
75 
78 {
79  const volScalarField::Internal& p = thermol().p();
80 
82  (
83  mcCoeff_*max(p - pSatv(), p0_),
84  -mvCoeff()*min(p - pSatl(), p0_)
85  );
86 }
87 
88 
91 {
92  const volScalarField::Internal& p = thermol().p();
93 
94  const volScalarField::Internal alphav
95  (
96  min(max(this->alphav(), scalar(0)), scalar(1))
97  );
98 
99  const volScalarField::Internal alphal
100  (
101  min(max(this->alphal(), scalar(0)), scalar(1))
102  );
103 
105  (
106  mcCoeff_*alphav*pos0(p - pSatv()),
107  -mvCoeff()*alphal*neg(p - pSatl())
108  );
109 }
110 
111 
113 {}
114 
115 
117 (
118  const dictionary& dict
119 )
120 {
122  {
123  dict.lookup("UInf") >> UInf_;
124  dict.lookup("tInf") >> tInf_;
125  dict.lookup("Cv") >> Cv_;
126  dict.lookup("Cc") >> Cc_;
127 
128  return true;
129  }
130  else
131  {
132  return false;
133  }
134 }
135 
136 
137 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: Pair.H:65
virtual bool read(const dictionary &dict)=0
Read the dictionary and update.
virtual Pair< tmp< volScalarField::Internal > > mDotcvAlphal() const
Return the mass condensation and vaporisation rates as a.
Definition: Merkle.C:77
virtual void correct()
Correct the Merkle phaseChange model.
Definition: Merkle.C:112
virtual bool read(const dictionary &dict)
Read the dictionary and update.
Definition: Merkle.C:117
Merkle(const dictionary &dict, const compressibleTwoPhases &phases)
Construct for phases.
Definition: Merkle.C:47
virtual Pair< tmp< volScalarField::Internal > > mDotcvP() const
Return the mass condensation and vaporisation rates as coefficients.
Definition: Merkle.C:90
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A class for managing temporary objects.
Definition: tmp.H:55
addToRunTimeSelectionTable(cavitationModel, Kunz, dictionary)
Namespace for OpenFOAM.
dimensionedScalar pos0(const dimensionedScalar &ds)
const dimensionSet dimPressure
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimless
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimTime
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar neg(const dimensionedScalar &ds)
const dimensionSet dimVelocity
dictionary dict
volScalarField & p