IATEsource.H
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-2023 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 Class
25  Foam::diameterModels::IATEsource
26 
27 Description
28  IATE (Interfacial Area Transport Equation) bubble diameter model
29  run-time selectable sources.
30 
31 SourceFiles
32  IATEsource.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef IATEsource_H
37 #define IATEsource_H
38 
39 #include "IATE.H"
40 #include "phaseSystem.H"
41 #include "mathematicalConstants.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 namespace diameterModels
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class IATEsource Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class IATEsource
55 {
56 
57 protected:
58 
59  // Protected data
60 
61  //- Reference to the IATE this source applies to
62  const IATE& iate_;
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("IATEsource");
69 
70 
71  // Declare run-time constructor selection table
72 
74  (
75  autoPtr,
76  IATEsource,
77  dictionary,
78  (
79  const IATE& iate,
80  const dictionary& dict
81  ),
82  (iate, dict)
83  );
84 
85 
86  //- Class used for the read-construction of
87  // PtrLists of IATE sources
88  class iNew
89  {
90  const IATE& iate_;
91 
92  public:
93 
94  iNew(const IATE& iate)
95  :
96  iate_(iate)
97  {}
98 
100  {
101  word type(is);
102  dictionary dict(is);
103  return IATEsource::New(type, iate_, dict);
104  }
105  };
106 
107 
108  // Constructors
109 
110  IATEsource(const IATE& iate)
111  :
112  iate_(iate)
113  {}
114 
115  autoPtr<IATEsource> clone() const
116  {
118  return autoPtr<IATEsource>(nullptr);
119  }
120 
121 
122  // Selectors
123 
124  static autoPtr<IATEsource> New
125  (
126  const word& type,
127  const IATE& iate,
128  const dictionary& dict
129  );
130 
131 
132  //- Destructor
133  virtual ~IATEsource()
134  {}
135 
136 
137  // Member Functions
138 
139  const phaseModel& phase() const
140  {
141  return iate_.phase();
142  }
143 
144  const phaseSystem& fluid() const
145  {
146  return iate_.phase().fluid();
147  }
148 
149  const phaseModel& otherPhase() const
150  {
151  return fluid().otherPhase(phase());
152  }
153 
154  scalar phi() const
155  {
156  return 1.0/(36*constant::mathematical::pi);
157  }
158 
159  //- Return the bubble surface tension coefficient
160  tmp<volScalarField> sigma() const
161  {
162  return fluid().sigma(phaseInterface(phase(), otherPhase()));
163  }
164 
165  //- Return the bubble relative velocity
166  tmp<volScalarField> Ur() const;
167 
168  //- Return the bubble turbulent velocity
169  tmp<volScalarField> Ut() const;
170 
171  //- Return the bubble Reynolds number
172  tmp<volScalarField> Re() const;
173 
174  //- Return the bubble drag coefficient
175  tmp<volScalarField> CD() const;
176 
177  //- Return the bubble Morton number
178  tmp<volScalarField> Mo() const;
179 
180  //- Return the bubble Eotvos number
181  tmp<volScalarField> Eo() const;
182 
183  //- Return the bubble turbulent Weber number
184  tmp<volScalarField> We() const;
185 
186  virtual tmp<fvScalarMatrix> R
187  (
188  const volScalarField& alphai,
189  volScalarField& kappai
190  ) const = 0;
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace diameterModels
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
const phaseModel & phase() const
Return the phase.
IATE (Interfacial Area Transport Equation) bubble diameter model.
Definition: IATE.H:69
Class used for the read-construction of.
Definition: IATEsource.H:88
autoPtr< IATEsource > operator()(Istream &is) const
Definition: IATEsource.H:98
IATE (Interfacial Area Transport Equation) bubble diameter model run-time selectable sources.
Definition: IATEsource.H:54
tmp< volScalarField > CD() const
Return the bubble drag coefficient.
Definition: IATEsource.C:98
virtual tmp< fvScalarMatrix > R(const volScalarField &alphai, volScalarField &kappai) const =0
autoPtr< IATEsource > clone() const
Definition: IATEsource.H:114
const IATE & iate_
Reference to the IATE this source applies to.
Definition: IATEsource.H:61
TypeName("IATEsource")
Runtime type information.
tmp< volScalarField > Eo() const
Return the bubble Eotvos number.
Definition: IATEsource.C:126
tmp< volScalarField > Mo() const
Return the bubble Morton number.
Definition: IATEsource.C:115
tmp< volScalarField > We() const
Return the bubble turbulent Weber number.
Definition: IATEsource.C:137
const phaseModel & phase() const
Definition: IATEsource.H:138
const phaseModel & otherPhase() const
Definition: IATEsource.H:148
tmp< volScalarField > sigma() const
Return the bubble surface tension coefficient.
Definition: IATEsource.H:159
declareRunTimeSelectionTable(autoPtr, IATEsource, dictionary,(const IATE &iate, const dictionary &dict),(iate, dict))
const phaseSystem & fluid() const
Definition: IATEsource.H:143
tmp< volScalarField > Ur() const
Return the bubble relative velocity.
Definition: IATEsource.C:72
virtual ~IATEsource()
Destructor.
Definition: IATEsource.H:132
tmp< volScalarField > Re() const
Return the bubble Reynolds number.
Definition: IATEsource.C:93
static autoPtr< IATEsource > New(const word &type, const IATE &iate, const dictionary &dict)
Definition: IATEsource.C:47
tmp< volScalarField > Ut() const
Return the bubble turbulent velocity.
Definition: IATEsource.C:88
IATEsource(const IATE &iate)
Definition: IATEsource.H:109
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Class to represent an interface between phases. Derivations can further specify the configuration of ...
const phaseSystem & fluid() const
Return the system to which this phase belongs.
Definition: phaseModel.C:163
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:73
const phaseModel & otherPhase(const phaseModel &phase) const
Return the phase not given as an argument in a two-phase system.
Definition: phaseSystemI.H:172
tmp< volScalarField > sigma(const phaseInterfaceKey &key) const
Return the surface tension coefficient for an interface.
Definition: phaseSystem.C:399
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:381
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
dictionary dict