LemmertChawla.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 "LemmertChawla.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace wallBoilingModels
35 {
36 namespace nucleationSiteModels
37 {
40  (
44  );
45 }
46 }
47 }
48 
49 
50 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
51 
52 template<class ScalarFieldType>
54 Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla::calculate
55 (
56  const ScalarFieldType& Tsatw,
57  const ScalarFieldType& Tw
58 ) const
59 {
61  auto NRef = coefficient<ScalarFieldType>::value(NRef_);
62  auto deltaTRef = coefficient<ScalarFieldType>::value(deltaTRef_);
63 
64  return Cn*NRef*pow(max((Tw - Tsatw)/deltaTRef, scalar(0)), 1.805);
65 }
66 
67 
68 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
69 
71 (
72  const dictionary& dict
73 )
74 :
76  Cn_(dimensionedScalar::lookupOrDefault("Cn", dict, dimless, 1)),
77  NRef_
78  (
79  dimensionedScalar::lookupOrDefault
80  (
81  "NRef",
82  dict,
84  9.922e5
85  )
86  ),
87  deltaTRef_
88  (
89  dimensionedScalar::lookupOrDefault
90  (
91  "deltaTRef",
92  dict,
94  10
95  )
96  )
97 {}
98 
99 
101 (
102  const LemmertChawla& model
103 )
104 :
106  Cn_(model.Cn_),
107  NRef_(model.NRef_),
108  deltaTRef_(model.deltaTRef_)
109 {}
110 
111 
112 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
113 
115 {}
116 
117 
118 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
119 
123 (
124  const phaseModel& liquid,
125  const phaseModel& vapour,
126  const label patchi,
127  const scalarField& Tl,
128  const scalarField& Tsatw,
129  const scalarField& L,
130  const scalarField& dDep,
131  const scalarField& fDep
132 ) const
133 {
134  const scalarField& Tw =
135  liquid.thermo().T().boundaryField()[patchi];
136 
137  return calculate(Tsatw, Tw);
138 }
139 
140 
144 (
145  const phaseModel& liquid,
146  const phaseModel& vapour,
147  const phaseModel& solid,
148  const volScalarField& Tf,
149  const volScalarField& Tsatw,
150  const volScalarField& L,
151  const volScalarField& dDep,
152  const volScalarField& fDep
153 ) const
154 {
155  return calculate(Tsatw, Tf);
156 }
157 
158 
160 (
161  Ostream& os
162 ) const
163 {
165  writeKeyword(os, "Cn") << Cn_ << token::END_STATEMENT << nl;
166  writeKeyword(os, "NRef") << NRef_ << token::END_STATEMENT << nl;
167  writeKeyword(os, "deltaTRef") << deltaTRef_ << token::END_STATEMENT << nl;
168 }
169 
170 
171 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
Definition: liquid.H:53
A class for managing temporary objects.
Definition: tmp.H:55
@ END_STATEMENT
Definition: token.H:108
Base class for nucleation site density models.
virtual void write(Ostream &os) const
Write to stream.
Lemmert & Chawla function for nucleation site density, correlation by Egorov & Menter.
Definition: LemmertChawla.H:68
virtual tmp< scalarField > nucleationSiteDensity(const phaseModel &liquid, const phaseModel &vapour, const label patchi, const scalarField &Tl, const scalarField &Tsatw, const scalarField &L, const scalarField &dDep, const scalarField &fDep) const
Calculate and return the nucleation-site density.
virtual void write(Ostream &os) const
Write to stream.
LemmertChawla(const dictionary &dict)
Construct from a dictionary.
Definition: LemmertChawla.C:71
label patchi
label calculate(const fvMesh &mesh, const labelHashSet &patchIDs, const scalar minFaceFraction, GeometricField< scalar, PatchField, GeoMesh > &distance)
Calculate distance data from patches.
defineTypeNameAndDebug(KocamustafaogullariIshiiNucleationSite, 0)
addToRunTimeSelectionTable(nucleationSiteModel, KocamustafaogullariIshiiNucleationSite, 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
const dimensionSet dimless
const dimensionSet dimTemperature
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimArea
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
Definition: keyType.C:155
static const char nl
Definition: Ostream.H:266
dictionary dict