IATE.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) 2013-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 "IATE.H"
27 #include "IATEsource.H"
28 #include "fvmDdt.H"
29 #include "fvmDiv.H"
30 #include "fvmSup.H"
31 #include "fvcDdt.H"
32 #include "fvcDiv.H"
33 #include "fvcAverage.H"
34 #include "fvModels.H"
35 #include "fvConstraints.H"
36 #include "mathematicalConstants.H"
37 #include "fundamentalConstants.H"
39 
40 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace diameterModels
45 {
48 }
49 }
50 
51 
52 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
53 
54 Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATE::dsm() const
55 {
56  return max(6/max(kappai_, 6/dMax_), dMin_);
57 }
58 
59 
60 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
61 
63 (
64  const dictionary& diameterProperties,
65  const phaseModel& phase
66 )
67 :
68  diameterModel(diameterProperties, phase),
69  kappai_
70  (
71  IOobject
72  (
73  IOobject::groupName("kappai", phase.name()),
74  phase.time().name(),
75  phase.mesh(),
76  IOobject::MUST_READ,
77  IOobject::AUTO_WRITE
78  ),
79  phase.mesh(),
80  inv(dimensions::length)
81  ),
82  dMax_("dMax", dimLength, diameterProperties),
83  dMin_("dMin", dimLength, diameterProperties),
84  residualAlpha_("residualAlpha", dimless, diameterProperties),
85  d_
86  (
87  IOobject
88  (
89  IOobject::groupName("d", phase.name()),
90  phase.time().name(),
91  phase.mesh(),
92  IOobject::NO_READ,
93  IOobject::AUTO_WRITE
94  ),
95  dsm()
96  ),
97  sources_(diameterProperties.lookup("sources"), IATEsource::iNew(*this))
98 {}
99 
100 
101 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
102 
104 {}
105 
106 
107 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
108 
110 {
111  return d_;
112 }
113 
114 
116 {
117  return phase()*kappai_;
118 }
119 
120 
122 {
123  const volScalarField& alpha = phase();
124  const volScalarField& rho = phase().rho();
125 
126  volScalarField alphaAv
127  (
128  max
129  (
130  0.5*fvc::average(alpha + alpha.oldTime()),
131  residualAlpha_
132  )
133  );
134 
135  // Initialise the accumulated source term to the dilatation effect
137  (
138  -fvm::SuSp
139  (
140  ((1.0/3.0)/alphaAv)
141  *(
142  (fvc::ddt(alpha) + fvc::div(phase().alphaPhi()))
143  - (fvc::ddt(alpha, rho) + fvc::div(phase().alphaRhoPhi()))/rho
144  ),
145  kappai_
146  )
147  );
148 
149  // Accumulate the run-time selectable sources
150  forAll(sources_, j)
151  {
152  R += sources_[j].R(kappai_);
153  }
154 
155  const Foam::fvModels& fvModels =
156  Foam::fvModels::New(phase().mesh());
158  Foam::fvConstraints::New(phase().mesh());
159 
160  // Construct the interfacial curvature equation
161  fvScalarMatrix kappaiEqn
162  (
163  fvm::ddt(kappai_) + fvm::div(phase().phi(), kappai_)
164  - fvm::Sp(fvc::div(phase().phi()), kappai_)
165  ==
166  R
167  + fvModels.source(alpha, rho, kappai_)/(alphaAv*rho)
168  );
169 
170  kappaiEqn.relax();
171 
172  fvConstraints.constrain(kappaiEqn);
173 
174  kappaiEqn.solve();
175 
176  // Update the Sauter-mean diameter
177  d_ = dsm();
178 }
179 
180 
181 bool Foam::diameterModels::IATE::read(const dictionary& diameterProperties)
182 {
183  dMax_.read(diameterProperties);
184  dMin_.read(diameterProperties);
185 
186  residualAlpha_.read(diameterProperties);
187 
188  // Re-create all the sources updating number, type and coefficients
190  (
191  diameterProperties.lookup("sources"),
192  IATEsource::iNew(*this)
193  ).transfer(sources_);
194 
195  return true;
196 }
197 
198 
199 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:449
Macros for easy insertion into run-time selection tables.
static fvModels & New(const word &name, const fvMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
void transfer(PtrList< T > &)
Transfer the contents of the argument PtrList into this PtrList.
Definition: PtrList.C:213
Abstract base-class for dispersed-phase particle diameter models.
Definition: diameterModel.H:52
virtual bool read()
Read diameter properties dictionary.
Definition: diameterModel.C:62
IATE (Interfacial Area Transport Equation) bubble diameter model.
Definition: IATE.H:69
virtual ~IATE()
Destructor.
Definition: IATE.C:103
virtual void correct()
Correct the model.
Definition: IATE.C:121
virtual tmp< volScalarField > d() const
Get the diameter field.
Definition: IATE.C:109
virtual tmp< volScalarField > Av() const
Get the surface area per unit volume field.
Definition: IATE.C:115
IATE(const dictionary &diameterProperties, const phaseModel &phase)
Construct from dictionary and phase.
Definition: IATE.C:63
Class used for the read-construction of.
Definition: IATEsource.H:88
IATE (Interfacial Area Transport Equation) bubble diameter model run-time selectable sources.
Definition: IATEsource.H:54
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
Finite volume constraints.
Definition: fvConstraints.H:68
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
Definition: fvMatrix.C:602
SolverPerformance< Type > solve(const dictionary &)
Solve segregated or coupled returning the solution statistics.
Definition: fvMatrixSolve.C:58
Finite volume models.
Definition: fvModels.H:69
tmp< fvMatrix< Type > > source(const VolField< Type > &field) const
Return source for an equation.
A class for managing temporary objects.
Definition: tmp.H:55
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Fundamental dimensioned constants.
Area-weighted average a surfaceField creating a volField.
Calculate the first temporal derivative.
Calculate the divergence of the given field.
Calculate the matrix for the first temporal derivative.
Calculate the matrix for the divergence of the given field and flux.
Calculate the matrix for implicit and explicit sources.
rho
Definition: pEqn.H:1
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
addToRunTimeSelectionTable(diameterModel, constant, dictionary)
defineTypeNameAndDebug(constant, 0)
const dimensionSet dimless
const dimensionSet time
const dimensionSet length
tmp< VolField< Type > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
tmp< VolField< Type > > average(const SurfaceField< Type > &ssf)
Area-weighted average a surfaceField creating a volField.
Definition: fvcAverage.C:46
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
Definition: fvcDiv.C:47
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const VolField< Type > &vf, const word &name)
Definition: fvmDiv.C:48
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const VolField< Type > &)
tmp< fvMatrix< Type > > SuSp(const volScalarField::Internal &, const VolField< Type > &)
tmp< fvMatrix< Type > > ddt(const VolField< Type > &vf)
Definition: fvmDdt.C:46
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
Definition: units.C:346
Namespace for OpenFOAM.
const dimensionSet & dimLength
Definition: dimensions.C:276
void inv(pointPatchField< tensor > &, const pointPatchField< tensor > &)
static scalar R(const scalar a, const scalar x)
Definition: invIncGamma.C:102
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)