dragModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2018 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::dragModel
29 
30 Description
31 
32 SourceFiles
33  dragModel.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef dragModel_H
38 #define dragModel_H
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 #include "volFields.H"
43 #include "dictionary.H"
44 #include "runTimeSelectionTables.H"
45 
46 namespace Foam
47 {
48 
49 // Forward Declarations
50 class phasePair;
51 class swarmCorrection;
52 
53 /*---------------------------------------------------------------------------*\
54  Class dragModel Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class dragModel
58 :
59  public regIOobject
60 {
61 protected:
62 
63  // Protected Data
64 
65  //- Phase pair
66  const phasePair& pair_;
67 
68  //- Swarm correction
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("dragModel");
76 
77 
78  // Declare runtime construction
79 
81  (
82  autoPtr,
83  dragModel,
84  dictionary,
85  (
86  const dictionary& dict,
87  const phasePair& pair,
88  const bool registerObject
89  ),
90  (dict, pair, registerObject)
91  );
92 
93 
94  // Static Data Members
95 
96  //- Coefficient dimensions
97  static const dimensionSet dimK;
98 
99 
100  // Constructors
101 
102  // Construct without residual constants
103  dragModel
104  (
105  const phasePair& pair,
106  const bool registerObject
107  );
108 
109  // Construct with residual constants
110  dragModel
111  (
112  const dictionary& dict,
113  const phasePair& pair,
114  const bool registerObject
115  );
116 
117 
118  //- Destructor
119  virtual ~dragModel();
120 
121 
122  // Selectors
123 
124  static autoPtr<dragModel> New
125  (
126  const dictionary& dict,
127  const phasePair& pair
128  );
129 
130 
131  // Member Functions
132 
133  //- Drag coefficient
134  virtual tmp<volScalarField> CdRe() const = 0;
135 
136  //- Return the phase-intensive drag coefficient Ki
137  // used in the momentum equations
138  // ddt(alpha1*rho1*U1) + ... = ... alphad*K*(U1-U2)
139  // ddt(alpha2*rho2*U2) + ... = ... alphad*K*(U2-U1)
140  virtual tmp<volScalarField> Ki() const;
141 
142  //- Return the drag coefficient K
143  // used in the momentum equations
144  // ddt(alpha1*rho1*U1) + ... = ... K*(U1-U2)
145  // ddt(alpha2*rho2*U2) + ... = ... K*(U2-U1)
146  virtual tmp<volScalarField> K() const;
147 
148  //- Return the drag coefficient Kf
149  // used in the face-momentum equations
150  virtual tmp<surfaceScalarField> Kf() const;
151 
152  //- Dummy write for regIOobject
153  bool writeData(Ostream& os) const;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
TypeName("dragModel")
Runtime type information.
static const dimensionSet dimK
Coefficient dimensions.
Definition: dragModel.H:100
const phasePair & pair_
Phase pair.
Definition: dragModel.H:63
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:105
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.
Definition: dragModel.C:163
virtual tmp< volScalarField > K() const
Return the drag coefficient K.
Definition: dragModel.C:146
dragModel(const phasePair &pair, const bool registerObject)
Definition: dragModel.C:43
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:66
bool registerObject() const noexcept
Should objects created with this IOobject be registered?
virtual ~dragModel()
Destructor.
Definition: dragModel.C:128
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual tmp< surfaceScalarField > Kf() const
Return the drag coefficient Kf.
Definition: dragModel.C:152
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
autoPtr< swarmCorrection > swarmCorrection_
Swarm correction.
Definition: dragModel.H:68
virtual tmp< volScalarField > CdRe() const =0
Drag coefficient.
static autoPtr< dragModel > New(const dictionary &dict, const phasePair &pair)
Definition: dragModel.C:99
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:49
virtual tmp< volScalarField > Ki() const
Return the phase-intensive drag coefficient Ki.
Definition: dragModel.C:134
Namespace for OpenFOAM.