constantFilmThermo.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "constantFilmThermo.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace regionModels
37 {
38 namespace surfaceFilmModels
39 {
40 
41 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
42 
43 defineTypeNameAndDebug(constantFilmThermo, 0);
44 
46 (
47  filmThermoModel,
48  constantFilmThermo,
49  dictionary
50 );
51 
52 
53 void constantFilmThermo::init(thermoData& td)
54 {
55  if (coeffDict_.readIfPresent(td.name_, td.value_))
56  {
57  td.set_ = true;
58  }
59 }
60 
61 
62 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
63 
64 constantFilmThermo::constantFilmThermo
65 (
67  const dictionary& dict
68 )
69 :
70  filmThermoModel(typeName, film, dict),
71  name_(coeffDict_.lookup("specie")),
72  rho0_("rho0"),
73  mu0_("mu0"),
74  sigma0_("sigma0"),
75  Cp0_("Cp0"),
76  kappa0_("kappa0"),
77  D0_("D0"),
78  hl0_("hl0"),
79  pv0_("pv0"),
80  W0_("W0"),
81  Tb0_("Tb0")
82 {
83  init(rho0_);
84  init(mu0_);
85  init(sigma0_);
86  init(Cp0_);
87  init(kappa0_);
88  init(D0_);
89  init(hl0_);
90  init(pv0_);
91  init(W0_);
92  init(Tb0_);
93 }
94 
95 
96 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
97 
99 {}
100 
101 
102 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
103 
105 {
106  return name_;
107 }
108 
109 
111 (
112  const scalar p,
113  const scalar T
114 ) const
115 {
116  if (!rho0_.set_)
117  {
118  coeffDict_.readEntry(rho0_.name_, rho0_.value_);
119  rho0_.set_ = true;
120  }
121 
122  return rho0_.value_;
123 }
124 
125 
127 (
128  const scalar p,
129  const scalar T
130 ) const
131 {
132  if (!mu0_.set_)
133  {
134  coeffDict_.readEntry(mu0_.name_, mu0_.value_);
135  mu0_.set_ = true;
136  }
137 
138  return mu0_.value_;
139 }
140 
141 
143 (
144  const scalar p,
145  const scalar T
146 ) const
147 {
148  if (!sigma0_.set_)
149  {
150  coeffDict_.readEntry(sigma0_.name_, sigma0_.value_);
151  sigma0_.set_ = true;
152  }
153 
154  return sigma0_.value_;
155 }
156 
157 
159 (
160  const scalar p,
161  const scalar T
162 ) const
163 {
164  if (!Cp0_.set_)
165  {
166  coeffDict_.readEntry(Cp0_.name_, Cp0_.value_);
167  Cp0_.set_ = true;
168  }
169 
170  return Cp0_.value_;
171 }
172 
173 
175 (
176  const scalar p,
177  const scalar T
178 ) const
179 {
180  if (!kappa0_.set_)
181  {
182  coeffDict_.readEntry(kappa0_.name_, kappa0_.value_);
183  kappa0_.set_ = true;
184  }
185 
186  return kappa0_.value_;
187 }
188 
189 
191 (
192  const scalar p,
193  const scalar T
194 ) const
195 {
196  if (!D0_.set_)
197  {
198  coeffDict_.readEntry(D0_.name_, D0_.value_);
199  D0_.set_ = true;
200  }
201 
202  return D0_.value_;
203 }
204 
205 
207 (
208  const scalar p,
209  const scalar T
210 ) const
211 {
212  if (!hl0_.set_)
213  {
214  coeffDict_.readEntry(hl0_.name_, hl0_.value_);
215  hl0_.set_ = true;
216  }
217 
218  return hl0_.value_;
219 }
220 
221 
223 (
224  const scalar p,
225  const scalar T
226 ) const
227 {
228  if (!pv0_.set_)
229  {
230  coeffDict_.readEntry(pv0_.name_, pv0_.value_);
231  pv0_.set_ = true;
232  }
233 
234  return pv0_.value_;
235 }
236 
237 
238 scalar constantFilmThermo::W() const
239 {
240  if (!W0_.set_)
241  {
242  coeffDict_.readEntry(W0_.name_, W0_.value_);
243  W0_.set_ = true;
244  }
245 
246  return W0_.value_;
247 }
248 
249 
250 scalar constantFilmThermo::Tb(const scalar p) const
251 {
252  if (!Tb0_.set_)
253  {
254  coeffDict_.readEntry(Tb0_.name_, Tb0_.value_);
255  Tb0_.set_ = true;
256  }
257 
258  return Tb0_.value_;
259 }
260 
261 
263 {
265  (
266  new volScalarField
267  (
268  IOobject
269  (
270  type() + ':' + rho0_.name_,
271  film().time().timeName(),
272  film().regionMesh(),
275  ),
276  film().regionMesh(),
278  extrapolatedCalculatedFvPatchScalarField::typeName
279  )
280  );
281 
282  trho.ref().primitiveFieldRef() = this->rho(0, 0);
283  trho.ref().correctBoundaryConditions();
284 
285  return trho;
286 }
287 
288 
290 {
292  (
293  new volScalarField
294  (
295  IOobject
296  (
297  type() + ':' + mu0_.name_,
298  film().time().timeName(),
299  film().regionMesh(),
302  ),
303  film().regionMesh(),
305  extrapolatedCalculatedFvPatchScalarField::typeName
306  )
307  );
308 
309  tmu.ref().primitiveFieldRef() = this->mu(0, 0);
310  tmu.ref().correctBoundaryConditions();
311 
312  return tmu;
313 }
314 
315 
317 {
318  tmp<volScalarField> tsigma
319  (
320  new volScalarField
321  (
322  IOobject
323  (
324  type() + ':' + sigma0_.name_,
325  film().time().timeName(),
326  film().regionMesh(),
329  ),
330  film().regionMesh(),
332  extrapolatedCalculatedFvPatchScalarField::typeName
333  )
334  );
335 
336  tsigma.ref().primitiveFieldRef() = this->sigma(0, 0);
337  tsigma.ref().correctBoundaryConditions();
338 
339  return tsigma;
340 }
341 
342 
344 {
346  (
347  new volScalarField
348  (
349  IOobject
350  (
351  type() + ':' + Cp0_.name_,
352  film().time().timeName(),
353  film().regionMesh(),
356  ),
357  film().regionMesh(),
359  extrapolatedCalculatedFvPatchScalarField::typeName
360  )
361  );
362 
363  tCp.ref().primitiveFieldRef() = this->Cp(0, 0);
364  tCp.ref().correctBoundaryConditions();
365 
366  return tCp;
367 }
368 
369 
371 {
372  tmp<volScalarField> tkappa
373  (
374  new volScalarField
375  (
376  IOobject
377  (
378  type() + ':' + kappa0_.name_,
379  film().time().timeName(),
380  film().regionMesh(),
383  ),
384  film().regionMesh(),
386  extrapolatedCalculatedFvPatchScalarField::typeName
387  )
388  );
389 
390  tkappa.ref().primitiveFieldRef() = this->kappa(0, 0);
391  tkappa.ref().correctBoundaryConditions();
392 
393  return tkappa;
394 }
395 
396 
397 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
398 
399 } // End namespace surfaceFilmModels
400 } // End namespace regionModels
401 } // End namespace Foam
402 
403 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::dimPressure
const dimensionSet dimPressure
constantFilmThermo.H
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::regionModels::surfaceFilmModels::constantFilmThermo::thermoData::name_
word name_
Definition: constantFilmThermo.H:63
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::regionModels::surfaceFilmModels::constantFilmThermo::mu
virtual tmp< volScalarField > mu() const
Return dynamic viscosity [Pa.s].
Definition: constantFilmThermo.C:289
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::dimEnergy
const dimensionSet dimEnergy
Foam::regionModels::surfaceFilmModels::constantFilmThermo::rho
virtual tmp< volScalarField > rho() const
Return density [kg/m3].
Definition: constantFilmThermo.C:262
Foam::dimDensity
const dimensionSet dimDensity
Foam::regionModels::surfaceFilmModels::constantFilmThermo::Cp
virtual tmp< volScalarField > Cp() const
Return specific heat capacity [J/kg/K].
Definition: constantFilmThermo.C:343
Foam::subModelBase::coeffDict_
const dictionary coeffDict_
Coefficients dictionary.
Definition: subModelBase.H:82
tCp
const tmp< volScalarField > & tCp
Definition: EEqn.H:4
Foam::regionModels::surfaceFilmModels::filmSubModelBase::film
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
Definition: filmSubModelBaseI.H:39
Foam::regionModels::surfaceFilmModels::constantFilmThermo::thermoData::value_
scalar value_
Definition: constantFilmThermo.H:64
Foam::regionModels::surfaceFilmModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
trho
tmp< volScalarField > trho
Definition: setRegionSolidFields.H:4
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:227
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel
Base class for surface film models.
Definition: surfaceFilmRegionModel.H:55
Foam::regionModels::surfaceFilmModels::constantFilmThermo::thermoData::set_
bool set_
Definition: constantFilmThermo.H:65
Foam::regionModels::surfaceFilmModels::constantFilmThermo::pv
virtual scalar pv(const scalar p, const scalar T) const
Return vapour pressure [Pa].
Definition: constantFilmThermo.C:223
Foam::regionModels::surfaceFilmModels::constantFilmThermo::D
virtual scalar D(const scalar p, const scalar T) const
Return diffusivity [m2/s].
Definition: constantFilmThermo.C:191
init
mesh init(true)
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:302
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::regionModels::surfaceFilmModels::constantFilmThermo::W
virtual scalar W() const
Return molecular weight [kg/kmol].
Definition: constantFilmThermo.C:238
Foam::dimPower
const dimensionSet dimPower
timeName
word timeName
Definition: getTimeIndex.H:3
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::dimMass
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:51
Foam::regionModels::surfaceFilmModels::defineTypeNameAndDebug
defineTypeNameAndDebug(kinematicSingleLayer, 0)
Foam::regionModels::surfaceFilmModels::filmThermoModel
Base class for film thermo models.
Definition: filmThermoModel.H:56
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::regionModels::surfaceFilmModels::constantFilmThermo::sigma
virtual tmp< volScalarField > sigma() const
Return surface tension [kg/s2].
Definition: constantFilmThermo.C:316
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::regionModels::surfaceFilmModels::constantFilmThermo::hl
virtual scalar hl(const scalar p, const scalar T) const
Return latent heat [J/kg].
Definition: constantFilmThermo.C:207
Foam::regionModels::surfaceFilmModels::constantFilmThermo::Tb
virtual scalar Tb(const scalar p) const
Return boiling temperature [K].
Definition: constantFilmThermo.C:250
Foam::dimTemperature
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:54
Foam::regionModels::surfaceFilmModels::constantFilmThermo::kappa
virtual tmp< volScalarField > kappa() const
Return thermal conductivity [W/m/K].
Definition: constantFilmThermo.C:370
Foam::regionModels::surfaceFilmModels::constantFilmThermo::~constantFilmThermo
virtual ~constantFilmThermo()
Destructor.
Definition: constantFilmThermo.C:98
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:188
Foam::regionModels::surfaceFilmModels::constantFilmThermo::name
virtual const word & name() const
Return the specie name.
Definition: constantFilmThermo.C:104
Foam::dictionary::readIfPresent
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:405
extrapolatedCalculatedFvPatchFields.H