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-2022 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 class swarmCorrection;
50 
51 /*---------------------------------------------------------------------------*\
52  Class dragModel Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class dragModel
56 :
57  public regIOobject
58 {
59 public:
60 
61  //- Runtime type information
62  TypeName("dragModel");
63 
64 
65  // Declare runtime construction
66 
68  (
69  autoPtr,
70  dragModel,
71  dictionary,
72  (
73  const dictionary& dict,
74  const phaseInterface& interface,
75  const bool registerObject
76  ),
77  (dict, interface, registerObject)
78  );
79 
80 
81  // Static Data Members
82 
83  //- Coefficient dimensions
84  static const dimensionSet dimK;
85 
86  //- Does this model require correcting on fixed flux boundaries?
87  static const bool correctFixedFluxBCs = true;
88 
89 
90  // Constructors
91 
92  // Construct from a dictionary and an interface
93  dragModel
94  (
95  const dictionary& dict,
96  const phaseInterface& interface,
97  const bool registerObject
98  );
99 
100 
101  //- Destructor
102  virtual ~dragModel();
103 
104 
105  // Selectors
106 
107  static autoPtr<dragModel> New
108  (
109  const dictionary& dict,
110  const phaseInterface& interface,
111  const bool outer=true,
112  const bool registerObject=true
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 \*---------------------------------------------------------------------------*/
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 
152  (
153  const dictionary& dict,
154  const phaseInterface& interface
155  );
156 
157 
158  // Member Functions
159 
160  //- Return the drag coefficient K
161  tmp<volScalarField> K() const;
162 
163  //- Return the drag coefficient Kf
164  tmp<surfaceScalarField> Kf() const;
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
dictionary dict
declareRunTimeSelectionTable(autoPtr, dragModel, dictionary,(const dictionary &dict, const phaseInterface &interface, const bool registerObject),(dict, interface, registerObject))
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
TypeName("dragModel")
Runtime type information.
dragModel(const dictionary &dict, const phaseInterface &interface, const bool registerObject)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Class to represent an interface between phases. Derivations can further specify the configuration of ...
virtual ~dragModel()
Destructor.
Dimension set for the base types.
Definition: dimensionSet.H:121
bool writeData(Ostream &os) const
Dummy write for regIOobject.
virtual tmp< surfaceScalarField > Kf() const =0
Return the drag coefficient Kf.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
static autoPtr< dragModel > New(const dictionary &dict, const phaseInterface &interface, const bool outer=true, const bool registerObject=true)
static const bool correctFixedFluxBCs
Does this model require correcting on fixed flux boundaries?
Definition: dragModel.H:86
static const dimensionSet dimK
Coefficient dimensions.
Definition: dragModel.H:83
Model for drag between phases.
Definition: dragModel.H:54
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:52
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: PtrList.H:53
bool & registerObject()
Register object created from this IOobject with registry if true.
Definition: IOobject.H:351
Namespace for OpenFOAM.
virtual tmp< volScalarField > K() const =0
Return the drag coefficient K.