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 | Copyright (C) 2011-2015 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  newDragModel.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
bool writeData(Ostream &os) const
Dummy write for regIOobject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
TypeName("dragModel")
Runtime type information.
static const dimensionSet dimK
Coefficient dimensions.
Definition: dragModel.H:93
const phasePair & pair_
Phase pair.
Definition: dragModel.H:62
virtual ~dragModel()
Destructor.
Dimension set for the base types.
Definition: dimensionSet.H:118
declareRunTimeSelectionTable(autoPtr, dragModel, dictionary,(const dictionary &interfaceDict, const phaseModel &phase1, const phaseModel &phase2),(interfaceDict, phase1, phase2))
static autoPtr< dragModel > New(const dictionary &interfaceDict, const phaseModel &phase1, const phaseModel &phase2)
virtual tmp< volScalarField > K() const
Return the drag coefficient K.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
dragModel(const dictionary &interfaceDict, const phaseModel &phase1, const phaseModel &phase2)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: PtrList.H:54
autoPtr< swarmCorrection > swarmCorrection_
Swarm correction.
Definition: dragModel.H:65
virtual tmp< volScalarField > CdRe() const =0
Drag coefficient.
virtual tmp< volScalarField > Ki() const
Return the phase-intensive drag coefficient Ki.
bool & registerObject()
Register object created from this IOobject with registry if true.
Definition: IOobject.H:290
virtual tmp< surfaceScalarField > Kf() const
Return the drag coefficient Kf.
Namespace for OpenFOAM.