linearTsubDiameter.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) 2018-2019 OpenFOAM Foundation
9 Copyright (C) 2020-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "linearTsubDiameter.H"
30#include "phaseSystem.H"
31#include "saturationModel.H"
33
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35
36namespace Foam
37{
38namespace diameterModels
39{
41
43 (
47 );
48}
49}
50
51
52// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
53
55(
56 const dictionary& diameterProperties,
57 const phaseModel& phase
58)
59:
60 diameterModel(diameterProperties, phase),
61 liquidPhaseName_(diameterProperties.lookup("liquidPhase")),
62 d2_("d2", dimLength, diameterProperties.getOrDefault("d2", 0.0015)),
63 Tsub2_
64 (
65 "Tsub2",
67 diameterProperties.getOrDefault("Tsub2", 0)
68 ),
69 d1_
70 (
71 "d1",
73 diameterProperties.getOrDefault("d1", 0.00015)
74 ),
75 Tsub1_
76 (
77 "Tsub1",
79 diameterProperties.getOrDefault("Tsub1", 13.5)
80 ),
81 d_
82 (
84 (
85 IOobject::groupName("d", phase.name()),
86 phase_.time().timeName(),
87 phase_.mesh(),
88 IOobject::NO_READ,
89 IOobject::AUTO_WRITE
90 ),
91 phase_.mesh(),
92 d1_
93 )
94{}
95
96
97// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
98
100{}
101
102
103// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
104
106{
107 return d_;
108}
109
110
112{
113 // Lookup the fluid model
114 const phaseSystem& fluid =
115 refCast<const phaseSystem>
116 (
117 phase_.mesh().lookupObject<phaseSystem>("phaseProperties")
118 );
119
120 const phaseModel& liquid(fluid.phases()[liquidPhaseName_]);
121
122 if (phase_.mesh().foundObject<saturationModel>("saturationModel"))
123 {
124 const saturationModel& satModel =
125 phase_.mesh().lookupObject<saturationModel>("saturationModel");
126
127 const volScalarField Tsub
128 (
129 satModel.Tsat(liquid.thermo().p()) - liquid.thermo().T()
130 );
131
132 d_ = max
133 (
134 d1_,
135 min
136 (
137 d2_,
138 (d1_*(Tsub - Tsub2_) - d2_*(Tsub - Tsub1_))/(Tsub1_ - Tsub2_)
139 )
140 );
141 }
142}
143
144
146{
148 diameterProperties_.readEntry("liquidPhase", liquidPhaseName_);
149 diameterProperties_.readEntry("d2", d2_);
150 diameterProperties_.readEntry("Tsub2", Tsub2_);
151 diameterProperties_.readEntry("d1", d1_);
152 diameterProperties_.readEntry("Tsub1", Tsub1_);
153
154 return true;
155}
156
157
158// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
twoPhaseSystem & fluid
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
virtual bool read()
Re-read model coefficients if they have changed.
Abstract base-class for dispersed-phase particle diameter models.
Definition: diameterModel.H:54
virtual void correct()
Correct the diameter field.
virtual tmp< volScalarField > d() const
Return the diameter field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
Definition: liquid.H:57
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:61
Helper class to manage multi-specie phase properties.
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:76
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:57
Lookup type of boundary radiation properties.
Definition: lookup.H:66
virtual tmp< volScalarField > Tsat(const volScalarField &p) const =0
Saturation temperature.
A class for managing temporary objects.
Definition: tmp.H:65
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
dynamicFvMesh & mesh
word timeName
Definition: getTimeIndex.H:3
Namespace for OpenFOAM.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:54
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59