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-2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::dragModel
28 
29 Description
30 
31 SourceFiles
32  dragModel.C
33  newDragModel.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef dragModel_H
38 #define dragModel_H
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 #include "dictionary.H"
43 #include "phaseModel.H"
44 #include "runTimeSelectionTables.H"
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class dragModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class dragModel
54 {
55 protected:
56 
57  // Protected data
58 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("dragModel");
69 
70 
71  // Declare runtime construction
72 
74  (
75  autoPtr,
76  dragModel,
77  dictionary,
78  (
79  const dictionary& interfaceDict,
80  const phaseModel& phase1,
81  const phaseModel& phase2
82  ),
83  (interfaceDict, phase1, phase2)
84  );
85 
86 
87  // Constructors
88 
89  dragModel
90  (
91  const dictionary& interfaceDict,
92  const phaseModel& phase1,
93  const phaseModel& phase2
94  );
95 
96 
97  //- Destructor
98  virtual ~dragModel();
99 
100 
101  // Selectors
102 
103  static autoPtr<dragModel> New
104  (
105  const dictionary& interfaceDict,
106  const phaseModel& phase1,
107  const phaseModel& phase2
108  );
109 
110 
111  // Member Functions
112 
113  const phaseModel& phase1() const
114  {
115  return phase1_;
116  }
117 
118  const phaseModel& phase2() const
119  {
120  return phase2_;
121  }
122 
124  {
125  return residualPhaseFraction_;
126  }
127 
128  const dimensionedScalar& residualSlip() const
129  {
130  return residualSlip_;
131  }
132 
133  //- The drag function K used in the momentum eq.
134  // ddt(alpha1*rho1*U1) + ... = ... alpha1*alpha2*K*(U1-U2)
135  // ddt(alpha2*rho2*U2) + ... = ... alpha1*alpha2*K*(U2-U1)
136  // ********************************** NB! *****************************
137  // for numerical reasons alpha1 and alpha2 has been
138  // extracted from the dragFunction K,
139  // so you MUST divide K by alpha1*alpha2 when implementing the drag
140  // function
141  // ********************************** NB! *****************************
142  virtual tmp<volScalarField> K(const volScalarField& Ur) const = 0;
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:57
Foam::dragModel::phase1
const phaseModel & phase1() const
Definition: dragModel.H:112
Foam::dragModel::residualSlip_
dimensionedScalar residualSlip_
Definition: dragModel.H:62
Foam::tmp< volScalarField >
Foam::dragModel::interfaceDict_
const dictionary & interfaceDict_
Definition: dragModel.H:58
Foam::dragModel::K
virtual tmp< volScalarField > K() const
Return the drag coefficient K.
Definition: dragModel.C:121
Foam::dragModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, dragModel, dictionary,(const dictionary &dict, const phasePair &pair, const bool registerObject),(dict, pair, registerObject))
Foam::dragModel::phase2
const phaseModel & phase2() const
Definition: dragModel.H:117
Foam::dragModel::residualPhaseFraction_
dimensionedScalar residualPhaseFraction_
Definition: dragModel.H:61
Foam::dragModel::TypeName
TypeName("dragModel")
Runtime type information.
Foam::dragModel::New
static autoPtr< dragModel > New(const dictionary &dict, const phasePair &pair)
Definition: newDragModel.C:35
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::dimensioned< scalar >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::dragModel::phase2_
const phaseModel & phase2_
Definition: dragModel.H:60
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::dragModel::residualPhaseFraction
const dimensionedScalar & residualPhaseFraction() const
Definition: dragModel.H:122
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::dragModel::dragModel
dragModel(const phasePair &pair, const bool registerObject)
Definition: dragModel.C:49
Foam::dragModel::residualSlip
const dimensionedScalar & residualSlip() const
Definition: dragModel.H:127
dictionary.H
Foam::dragModel::phase1_
const phaseModel & phase1_
Definition: dragModel.H:59
Foam::dragModel
Definition: dragModel.H:55
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::dragModel::~dragModel
virtual ~dragModel()
Destructor.
Definition: dragModel.C:103