Loading...
Searching...
No Matches
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"
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
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 * * * * * * * * * * * * * * * //
102
103// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
106{
107 return d_;
108}
109
110
112{
113 // Lookup the fluid model
114 const phaseSystem& fluid =
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:191
Abstract base-class for dispersed-phase particle diameter models.
virtual bool read(const dictionary &phaseProperties)=0
Read phaseProperties dictionary.
const phaseModel & phase() const
Return the phase.
diameterModel(const dictionary &dict, const phaseModel &phase)
const phaseModel & phase_
dictionary diameterProperties_
const dictionary & diameterProperties() const
Return the phase diameter properties dictionary.
linearTsub(const dictionary &diameterProperties, const phaseModel &phase)
Construct from components.
virtual void correct()
Correct the diameter field.
virtual tmp< volScalarField > d() const
Return the diameter field.
virtual bool read(const dictionary &phaseProperties)
Read phaseProperties dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
Definition liquid.H:53
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition phaseModel.H:56
Helper class to manage multi-specie phase properties.
Class to represent a system of phases and model interfacial transfers between them.
Definition phaseSystem.H:72
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition phase.H:53
Lookup type of boundary radiation properties.
Definition lookup.H:60
virtual tmp< volScalarField > Tsat(const volScalarField &p) const =0
Saturation temperature.
A class for managing temporary objects.
Definition tmp.H:75
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
word timeName
Definition getTimeIndex.H:3
Namespace for OpenFOAM.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Definition typeInfo.H:172
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:40
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:26
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127