Cole.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) 2016-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 "Cole.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace wallBoilingModels
35 {
36 namespace departureFrequencyModels
37 {
40  (
42  Cole,
44  );
45 }
46 }
47 }
48 
49 
50 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
51 
52 template<class ScalarFieldType>
54 Foam::wallBoilingModels::departureFrequencyModels::Cole::calculate
55 (
56  const fvMesh& mesh,
57  const ScalarFieldType& dDep,
58  const ScalarFieldType& rhoLiquid,
59  const ScalarFieldType& rhoVapour
60 ) const
61 {
63  (
65  );
66 
67  const dimensionedScalar dRhoMin_(dimDensity, 0.1);
68  auto dRhoMin = coefficient<ScalarFieldType>::value(dRhoMin_);
69 
70  return
71  sqrt
72  (
73  4*mag(g)*max(rhoLiquid - rhoVapour, dRhoMin)/(3*dDep*rhoLiquid)
74  );
75 }
76 
77 
78 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
79 
81 (
82  const dictionary& dict
83 )
84 :
86 {}
87 
88 
90 (
91  const Cole& model
92 )
93 :
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
99 
101 {}
102 
103 
104 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105 
108 (
109  const phaseModel& liquid,
110  const phaseModel& vapour,
111  const label patchi,
112  const scalarField& Tl,
113  const scalarField& Tsatw,
114  const scalarField& L,
115  const scalarField& dDep
116 ) const
117 {
118  return
119  calculate
120  (
121  liquid.mesh(),
122  dDep,
123  liquid.thermo().rho(patchi)(),
124  vapour.thermo().rho(patchi)()
125  );
126 }
127 
128 
131 (
132  const phaseModel& liquid,
133  const phaseModel& vapour,
134  const phaseModel& solid,
135  const volScalarField& Tl,
136  const volScalarField& Tsatw,
137  const volScalarField& L,
138  const volScalarField& dDep
139 ) const
140 {
141  return
142  calculate
143  (
144  liquid.mesh(),
145  dDep,
146  liquid.rho(),
147  vapour.rho()
148  );
149 }
150 
151 
152 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
Definition: liquid.H:53
scalar rho(scalar p, scalar T) const
Liquid density [kg/m^3].
Definition: liquidI.H:26
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type and name.
virtual const rhoThermo & thermo() const =0
Return the thermophysical model.
virtual const volScalarField & rho() const =0
Return the density field.
virtual tmp< volScalarField > rho() const =0
Density [kg/m^3].
A class for managing temporary objects.
Definition: tmp.H:55
Base class for bubble departure frequency models.
Cole correlation for bubble departure frequency.
Definition: Cole.H:63
virtual tmp< scalarField > fDeparture(const phaseModel &liquid, const phaseModel &vapour, const label patchi, const scalarField &Tl, const scalarField &Tsatw, const scalarField &L, const scalarField &dDep) const
Calculate and return the bubble departure frequency.
Definition: Cole.C:108
Cole(const dictionary &dict)
Construct from a dictionary.
Definition: Cole.C:81
label patchi
label calculate(const fvMesh &mesh, const labelHashSet &patchIDs, const scalar minFaceFraction, GeometricField< scalar, PatchField, GeoMesh > &distance)
Calculate distance data from patches.
addToRunTimeSelectionTable(departureFrequencyModel, Cole, dictionary)
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dimensionedScalar sqrt(const dimensionedScalar &ds)
const dimensionSet dimDensity
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dictionary dict