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-2020 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 
29 SourceFiles
30  dragModel.C
31  dragModelNew.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef dragModel_H
36 #define dragModel_H
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 #include "volFields.H"
41 #include "dictionary.H"
42 #include "runTimeSelectionTables.H"
43 
44 namespace Foam
45 {
46 
47 class phasePair;
48 class swarmCorrection;
49 
50 /*---------------------------------------------------------------------------*\
51  Class dragModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class dragModel
55 :
56  public regIOobject
57 {
58 protected:
59 
60  // Protected data
61 
62  //- Phase pair
63  const phasePair& pair_;
64 
65  //- Swarm correction
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("dragModel");
73 
74 
75  // Declare runtime construction
76 
78  (
79  autoPtr,
80  dragModel,
81  dictionary,
82  (
83  const dictionary& dict,
84  const phasePair& pair,
85  const bool registerObject
86  ),
87  (dict, pair, registerObject)
88  );
89 
90 
91  // Static Data Members
92 
93  //- Coefficient dimensions
94  static const dimensionSet dimK;
95 
96 
97  // Constructors
98 
99  // Construct without residual constants
100  dragModel
101  (
102  const phasePair& pair,
103  const bool registerObject
104  );
105 
106  // Construct with residual constants
107  dragModel
108  (
109  const dictionary& dict,
110  const phasePair& pair,
111  const bool registerObject
112  );
113 
114 
115  //- Destructor
116  virtual ~dragModel();
117 
118 
119  // Selectors
120 
121  static autoPtr<dragModel> New
122  (
123  const dictionary& dict,
124  const phasePair& pair
125  );
126 
127 
128  // Member Functions
129 
130  //- Drag coefficient
131  virtual tmp<volScalarField> CdRe() const = 0;
132 
133  //- Return the phase-intensive drag coefficient Ki
134  // used in the momentum equations
135  // ddt(alpha1*rho1*U1) + ... = ... alphad*K*(U1-U2)
136  // ddt(alpha2*rho2*U2) + ... = ... alphad*K*(U2-U1)
137  virtual tmp<volScalarField> Ki() const;
138 
139  //- Return the drag coefficient K
140  // used in the momentum equations
141  // ddt(alpha1*rho1*U1) + ... = ... K*(U1-U2)
142  // ddt(alpha2*rho2*U2) + ... = ... K*(U2-U1)
143  virtual tmp<volScalarField> K() const;
144 
145  //- Return the drag coefficient Kf
146  // used in the face-momentum equations
147  virtual tmp<surfaceScalarField> Kf() const;
148 
149  //- Dummy write for regIOobject
150  bool writeData(Ostream& os) const;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
TypeName("dragModel")
Runtime type information.
static autoPtr< dragModel > New(const dictionary &dict, const phasePair &pair)
virtual ~dragModel()
Destructor.
virtual tmp< surfaceScalarField > Kf() const
Return the drag coefficient Kf.
virtual tmp< volScalarField > K() const
Return the drag coefficient K.
Dimension set for the base types.
Definition: dimensionSet.H:120
declareRunTimeSelectionTable(autoPtr, dragModel, dictionary,(const dictionary &dict, const phasePair &pair, const bool registerObject),(dict, pair, registerObject))
bool writeData(Ostream &os) const
Dummy write for regIOobject.
dragModel(const phasePair &pair, const bool registerObject)
virtual tmp< volScalarField > Ki() const
Return the phase-intensive drag coefficient Ki.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
const phasePair & pair_
Phase pair.
Definition: dragModel.H:62
static const dimensionSet dimK
Coefficient dimensions.
Definition: dragModel.H:93
autoPtr< swarmCorrection > swarmCorrection_
Swarm correction.
Definition: dragModel.H:65
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
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
virtual tmp< volScalarField > CdRe() const =0
Drag coefficient.
bool & registerObject()
Register object created from this IOobject with registry if true.
Definition: IOobject.H:339
Namespace for OpenFOAM.