linearTsubDiameter.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) 2018-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 
26 #include "linearTsubDiameter.H"
27 #include "phaseSystem.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace diameterModels
35 {
38 }
39 }
40 
41 
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43 
45 (
46  const dictionary& diameterProperties,
47  const phaseModel& phase
48 )
49 :
50  spherical(diameterProperties, phase),
51  liquidPhaseName_(diameterProperties.lookup("liquidPhase")),
52  d2_("d2", dimLength, diameterProperties, 0.0015),
53  Tsub2_("Tsub2", dimTemperature, diameterProperties, 0),
54  d1_("d1", dimLength, diameterProperties, 0.00015),
55  Tsub1_("Tsub1", dimTemperature, diameterProperties, 13.5),
56  saturationModelPtr_
57  (
59  (
60  "saturationTemperature",
61  diameterProperties
62  ).ptr()
63  ),
64  d_
65  (
66  IOobject
67  (
68  IOobject::groupName("d", phase.name()),
69  phase.time().name(),
70  phase.mesh()
71  ),
72  phase.mesh(),
73  d1_
74  )
75 {
76  Info<< " d2: " << d2_.value() << endl
77  << " Tsub2: " << Tsub2_.value() << endl
78  << " d1: " << d1_.value() << endl
79  << " Tsub1: " << Tsub1_.value() << endl;
80 }
81 
82 
83 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
84 
86 {}
87 
88 
89 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
90 
92 {
93  return d_;
94 }
95 
96 
98 {
99  const phaseModel& liquid = phase().fluid().phases()[liquidPhaseName_];
100 
101  const volScalarField Tsub
102  (
103  saturationModelPtr_->Tsat(liquid.fluidThermo().p())
104  - liquid.thermo().T()
105  );
106 
107  const volScalarField f((Tsub - Tsub1_)/(Tsub2_ - Tsub1_));
108 
109  d_ = max(d1_, min(d2_, (1 - f)*d1_ + f*d2_));
110 }
111 
112 
114 (
115  const dictionary& diameterProperties
116 )
117 {
118  diameterProperties.lookup("liquidPhase") >> liquidPhaseName_;
119 
120  d2_.readIfPresent(diameterProperties);
121  Tsub2_.readIfPresent(diameterProperties);
122  d1_.readIfPresent(diameterProperties);
123  Tsub1_.readIfPresent(diameterProperties);
124 
125  saturationModelPtr_.reset
126  (
128  (
129  "saturationTemperature",
130  diameterProperties
131  ).ptr()
132  );
133 
134  return true;
135 }
136 
137 
138 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
Abstract base-class for dispersed-phase particle diameter models.
Definition: diameterModel.H:52
virtual bool read()
Read diameter properties dictionary.
Definition: diameterModel.C:62
linearTsub(const dictionary &diameterProperties, const phaseModel &phase)
Construct from dictionary and phase.
virtual void correct()
Correct the model.
virtual tmp< volScalarField > d() const
Get the diameter field.
Base class for models which represent spherical diameter models, providing a common implementation of...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:669
const Type & value() const
Return const reference to value.
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
Definition: liquid.H:53
Model to describe the dependence of saturation temperature on pressure.
static autoPtr< saturationTemperatureModel > New(const word &name, const dictionary &dict)
Select with name within a dictionary.
A class for managing temporary objects.
Definition: tmp.H:55
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
addToRunTimeSelectionTable(diameterModel, constant, dictionary)
defineTypeNameAndDebug(constant, 0)
const dimensionSet time
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
Definition: units.C:346
Namespace for OpenFOAM.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:288
const dimensionSet & dimLength
Definition: dimensions.C:141
messageStream Info
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
const dimensionSet & dimTemperature
Definition: dimensions.C:143
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
labelList f(nPoints)