wallBoilingPhaseChangeRateFvPatchScalarField.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) 2025-2026 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 
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 
34 const hashedWordList
35 wallBoilingPhaseChangeRateFvPatchScalarField::propertyNames_
36 ({
37  "wetFraction",
38  "dDeparture",
39  "fDeparture",
40  "nucleationSiteDensity",
41  "qQuenching",
42  "qEvaporative"
43 });
44 
46 wallBoilingPhaseChangeRateFvPatchScalarField::propertyPtrs_
47 ({
48  &wallBoilingPhaseChangeRateFvPatchScalarField::wetFraction_,
49  &wallBoilingPhaseChangeRateFvPatchScalarField::dDeparture_,
50  &wallBoilingPhaseChangeRateFvPatchScalarField::fDeparture_,
51  &wallBoilingPhaseChangeRateFvPatchScalarField::nucleationSiteDensity_,
52  &wallBoilingPhaseChangeRateFvPatchScalarField::qQuenching_,
53  &wallBoilingPhaseChangeRateFvPatchScalarField::qEvaporative_
54 });
55 
58 
60 wallBoilingPhaseChangeRateFvPatchScalarField::propertyDimensions_
61 ({
62  &dimless,
63  &dimLength,
64  &dimRate,
65  &dimInvArea,
66  &dimHeatFlux,
68 });
69 
70 }
71 
72 
73 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * /
74 
77 (
78  const fvPatch& p,
80 )
81 :
82  calculatedFvPatchScalarField(p, iF),
83  boiling_(p.size(), scalar(0)),
84  wetFraction_(p.size(), scalar(0)),
85  dDeparture_(p.size(), vGreat),
86  fDeparture_(p.size(), scalar(0)),
87  nucleationSiteDensity_(p.size(), scalar(0)),
88  qQuenching_(p.size(), scalar(0)),
89  qEvaporative_(p.size(), scalar(0)),
90  alphatLiquid_(p.size(), scalar(0)),
91  alphatVapour_(p.size(), scalar(0))
92 {}
93 
94 
97 (
98  const fvPatch& p,
100  const dictionary& dict
101 )
102 :
103  calculatedFvPatchScalarField(p, iF, dict),
104  boiling_("boiling", dimless, dict, p.size()),
105  wetFraction_("wetFraction", dimless, dict, p.size()),
106  dDeparture_("dDeparture", dimLength, dict, p.size()),
107  fDeparture_("fDeparture", dimRate, dict, p.size()),
108  nucleationSiteDensity_("nucleationSiteDensity", dimInvArea, dict, p.size()),
109  qQuenching_("qQuenching", dimHeatFlux, dict, p.size()),
110  qEvaporative_("qEvaporative", dimHeatFlux, dict, p.size()),
111  alphatLiquid_("alphatLiquid", dimMass/dimTime/dimLength, dict, p.size()),
112  alphatVapour_("alphatVapour", dimMass/dimTime/dimLength, dict, p.size())
113 {}
114 
115 
118 (
120  const fvPatch& p,
122  const fieldMapper& mapper
123 )
124 :
125  calculatedFvPatchScalarField(psf, p, iF, mapper),
126  boiling_(mapper(psf.boiling_)),
127  wetFraction_(mapper(psf.wetFraction_)),
128  dDeparture_(mapper(psf.dDeparture_)),
129  fDeparture_(mapper(psf.fDeparture_)),
130  nucleationSiteDensity_(mapper(psf.nucleationSiteDensity_)),
131  qQuenching_(mapper(psf.qQuenching_)),
132  qEvaporative_(mapper(psf.qEvaporative_)),
133  alphatLiquid_(mapper(psf.alphatLiquid_)),
134  alphatVapour_(mapper(psf.alphatVapour_))
135 {}
136 
137 
140 (
143 )
144 :
145  calculatedFvPatchScalarField(psf, iF),
146  boiling_(psf.boiling_),
147  wetFraction_(psf.wetFraction_),
148  dDeparture_(psf.dDeparture_),
149  fDeparture_(psf.fDeparture_),
150  nucleationSiteDensity_(psf.nucleationSiteDensity_),
151  qQuenching_(psf.qQuenching_),
152  qEvaporative_(psf.qEvaporative_),
153  alphatLiquid_(psf.alphatLiquid_),
154  alphatVapour_(psf.alphatVapour_)
155 {}
156 
157 
158 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
159 
160 const Foam::scalarField&
162 (
163  const word& name
164 ) const
165 {
166  return this->*propertyPtrs_[propertyNames_[name]];
167 }
168 
169 
170 const Foam::dimensionSet&
172 (
173  const word& name
174 )
175 {
176  return *propertyDimensions_[propertyNames_[name]];
177 }
178 
179 
180 const Foam::scalarField&
182 {
183  return alphatLiquid_;
184 }
185 
186 
187 const Foam::scalarField&
189 {
190  return alphatVapour_;
191 }
192 
193 
195 (
196  const fvPatchScalarField& ptf,
197  const fieldMapper& mapper
198 )
199 {
200  calculatedFvPatchScalarField::map(ptf, mapper);
201 
203  refCast<const wallBoilingPhaseChangeRateFvPatchScalarField>(ptf);
204 
205  mapper(boiling_, tiptf.boiling_);
206  mapper(wetFraction_, tiptf.wetFraction_);
207  mapper(dDeparture_, tiptf.dDeparture_);
208  mapper(fDeparture_, tiptf.fDeparture_);
209  mapper(nucleationSiteDensity_, tiptf.nucleationSiteDensity_);
210  mapper(qQuenching_, tiptf.qQuenching_);
211  mapper(qEvaporative_, tiptf.qEvaporative_);
212  mapper(alphatLiquid_, tiptf.alphatLiquid_);
213  mapper(alphatVapour_, tiptf.alphatVapour_);
214 }
215 
216 
218 (
219  const fvPatchScalarField& ptf
220 )
221 {
222  calculatedFvPatchScalarField::reset(ptf);
223 
225  refCast<const wallBoilingPhaseChangeRateFvPatchScalarField>(ptf);
226 
227  boiling_.reset(tiptf.boiling_);
228  wetFraction_.reset(tiptf.wetFraction_);
229  dDeparture_.reset(tiptf.dDeparture_);
230  fDeparture_.reset(tiptf.fDeparture_);
231  nucleationSiteDensity_.reset(tiptf.nucleationSiteDensity_);
232  qQuenching_.reset(tiptf.qQuenching_);
233  qEvaporative_.reset(tiptf.qEvaporative_);
234  alphatLiquid_.reset(tiptf.alphatLiquid_);
235  alphatVapour_.reset(tiptf.alphatVapour_);
236 }
237 
238 
240 {
242 }
243 
244 
246 (
247  Ostream& os
248 ) const
249 {
251 
252  writeEntry(os, "boiling", boiling_);
253  writeEntry(os, "wetFraction", wetFraction_);
254  writeEntry(os, "dDeparture", dDeparture_);
255  writeEntry(os, "fDeparture", fDeparture_);
256  writeEntry(os, "nucleationSiteDensity", nucleationSiteDensity_);
257  writeEntry(os, "qQuenching", qQuenching_);
258  writeEntry(os, "qEvaporative", qEvaporative_);
259  writeEntry(os, "alphatLiquid", alphatLiquid_);
260  writeEntry(os, "alphatVapour", alphatVapour_);
261 }
262 
263 
264 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265 
266 namespace Foam
267 {
269  (
272  );
273 }
274 
275 
276 // ************************************************************************* //
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...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Dimension set for the base types.
Definition: dimensionSet.H:125
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:90
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:58
Motion of the mesh specified as a list of pointMeshMovers.
This boundary condition is used for the phase change rate field of the wall boiling fvModel....
const scalarField & alphatVapour() const
Access the vapour turbulent thermal diffusivity.
static const dimensionSet & propertyDimensions(const word &name)
Access one of the property fields' dimensions by name.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
const scalarField & alphatLiquid() const
Access the liquid turbulent thermal diffusivity.
wallBoilingPhaseChangeRateFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, fvMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void map(const fvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
const scalarField & property(const word &name) const
Access one of the property fields by name.
A class for handling words, derived from string.
Definition: word.H:63
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:381
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Namespace for OpenFOAM.
const dimensionSet & dimless
Definition: dimensions.C:138
const dimensionSet & dimMass
Definition: dimensions.C:140
const dimensionSet & dimLength
Definition: dimensions.C:141
makeNullConstructablePatchTypeField(fvPatchVectorField, noSlipFvPatchVectorField)
void inv(pointPatchField< tensor > &, const pointPatchField< tensor > &)
const dimensionSet & dimTime
Definition: dimensions.C:142
const dimensionSet & dimRate
Definition: dimensions.C:152
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet dimHeatFlux(dimEnergy *inv(dimTime *dimArea))
const dimensionSet & dimEnergy
Definition: dimensions.C:160
const dimensionSet dimInvArea(inv(dimArea))
const dimensionSet & dimArea
Definition: dimensions.C:149
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
dictionary dict
volScalarField & p