dragModel.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) 2011-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 Class
25  Foam::dragModel
26 
27 Description
28  Model for drag between phases
29 
30 SourceFiles
31  dragModel.C
32  dragModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef dragModel_H
37 #define dragModel_H
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 #include "volFields.H"
42 #include "dictionary.H"
43 #include "runTimeSelectionTables.H"
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class dragModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class dragModel
54 :
55  public regIOobject
56 {
57 public:
58 
59  //- Runtime type information
60  TypeName("dragModel");
61 
62 
63  // Declare runtime construction
64 
66  (
67  autoPtr,
68  dragModel,
69  dictionary,
70  (
71  const dictionary& dict,
72  const phaseInterface& interface,
73  const bool registerObject
74  ),
75  (dict, interface, registerObject)
76  );
77 
78 
79  // Static Data Members
80 
81  //- Coefficient dimensions
82  static const dimensionSet dimK;
83 
84 
85  // Constructors
86 
87  // Construct from a dictionary and an interface
88  dragModel
89  (
90  const dictionary& dict,
91  const phaseInterface& interface,
92  const bool registerObject
93  );
94 
95 
96  //- Destructor
97  virtual ~dragModel();
98 
99 
100  // Selectors
101 
102  static autoPtr<dragModel> New
103  (
104  const dictionary& dict,
105  const phaseInterface& interface,
106  const bool registerObject = false
107  );
108 
109  static autoPtr<dragModel> New
110  (
111  const UPtrList<const dictionary>& subDicts,
112  const phaseInterface& interface
113  );
114 
115 
116  // Member Functions
117 
118  //- Return the drag coefficient K
119  // used in the momentum equations
120  // ddt(alpha1*rho1*U1) + ... = ... K*(U1-U2)
121  // ddt(alpha2*rho2*U2) + ... = ... K*(U2-U1)
122  virtual tmp<volScalarField> K() const = 0;
123 
124  //- Return the drag coefficient Kf
125  // used in the face-momentum equations
126  virtual tmp<surfaceScalarField> Kf() const = 0;
127 
128  //- Dummy write for regIOobject
129  bool writeData(Ostream& os) const;
130 };
131 
132 
133 /*---------------------------------------------------------------------------*\
134  Class blendedDragModel Declaration
135 \*---------------------------------------------------------------------------*/
136 
137 class blendedDragModel
138 :
139  public BlendedInterfacialModel<dragModel>
140 {
141 public:
142 
143  // Constructors
144 
145  //- Inherit base class constructors
147 
148 
149  // Selectors
150 
151  inline static autoPtr<blendedDragModel> New
152  (
153  const UPtrList<const dictionary>& subDicts,
154  const phaseInterface& interface,
155  const dictionary& blendingDict
156  )
157  {
159  (
160  new blendedDragModel(subDicts, interface, blendingDict)
161  );
162  }
163 
164 
165  // Member Functions
166 
167  //- Return the drag coefficient K
168  tmp<volScalarField> K() const;
169 
170  //- Return the drag coefficient Kf
171  tmp<surfaceScalarField> Kf() const;
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
Wrapper class for interfacial models for which multiple instances of the model are used for different...
const phaseInterface & interface() const
Access the interface.
bool & registerObject()
Register object created from this IOobject with registry if true.
Definition: IOobject.H:343
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: UPtrList.H:66
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
tmp< surfaceScalarField > Kf() const
Return the drag coefficient Kf.
Definition: dragModel.C:85
tmp< volScalarField > K() const
Return the drag coefficient K.
Definition: dragModel.C:79
static autoPtr< blendedDragModel > New(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface, const dictionary &blendingDict)
Definition: dragModel.H:151
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Dimension set for the base types.
Definition: dimensionSet.H:125
Model for drag between phases.
Definition: dragModel.H:55
dragModel(const dictionary &dict, const phaseInterface &interface, const bool registerObject)
Definition: dragModel.C:44
declareRunTimeSelectionTable(autoPtr, dragModel, dictionary,(const dictionary &dict, const phaseInterface &interface, const bool registerObject),(dict, interface, registerObject))
virtual ~dragModel()
Destructor.
Definition: dragModel.C:67
virtual tmp< surfaceScalarField > Kf() const =0
Return the drag coefficient Kf.
bool writeData(Ostream &os) const
Dummy write for regIOobject.
Definition: dragModel.C:73
virtual tmp< volScalarField > K() const =0
Return the drag coefficient K.
TypeName("dragModel")
Runtime type information.
static autoPtr< dragModel > New(const dictionary &dict, const phaseInterface &interface, const bool registerObject=false)
Definition: dragModelNew.C:31
static const dimensionSet dimK
Coefficient dimensions.
Definition: dragModel.H:81
Class to represent an interface between phases. Derivations can further specify the configuration of ...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
const dictionary & blendingDict(const phaseSystem &fluid, const dictionary &dict)
Macros to ease declaration of run-time selection tables.
dictionary dict