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 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef dragModel_H
37 #define dragModel_H
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 #include "dictionary.H"
42 #include "phaseModel.H"
43 #include "runTimeSelectionTables.H"
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class dragModel Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class dragModel
53 {
54 protected:
55 
56  // Protected Data
57 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("dragModel");
68 
69 
70  // Declare runtime construction
71 
73  (
74  autoPtr,
75  dragModel,
76  dictionary,
77  (
78  const dictionary& interfaceDict,
79  const phaseModel& phase1,
80  const phaseModel& phase2
81  ),
82  (interfaceDict, phase1, phase2)
83  );
84 
85 
86  // Constructors
87 
88  dragModel
89  (
90  const dictionary& dict,
91  const phaseModel& phase1,
92  const phaseModel& phase2
93  );
94 
95 
96  //- Destructor
97  virtual ~dragModel() = default;
98 
99 
100  // Selectors
101 
102  static autoPtr<dragModel> New
103  (
104  const dictionary& dict,
105  const phaseModel& phase1,
106  const phaseModel& phase2
107  );
108 
109 
110  // Member Functions
111 
112  const phaseModel& phase1() const
113  {
114  return phase1_;
115  }
116 
117  const phaseModel& phase2() const
118  {
119  return phase2_;
120  }
121 
123  {
124  return residualPhaseFraction_;
125  }
126 
127  const dimensionedScalar& residualSlip() const
128  {
129  return residualSlip_;
130  }
131 
132  //- The drag function K used in the momentum eq.
133  // ddt(alpha1*rho1*U1) + ... = ... alpha1*alpha2*K*(U1-U2)
134  // ddt(alpha2*rho2*U2) + ... = ... alpha1*alpha2*K*(U2-U1)
135  // ********************************** NB! *****************************
136  // for numerical reasons alpha1 and alpha2 has been
137  // extracted from the dragFunction K,
138  // so you MUST divide K by alpha1*alpha2 when implementing the drag
139  // function
140  // ********************************** NB! *****************************
141  virtual tmp<volScalarField> K(const volScalarField& Ur) const = 0;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:54
Foam::dragModel::phase1
const phaseModel & phase1() const
Definition: dragModel.H:111
Foam::dragModel::residualSlip_
dimensionedScalar residualSlip_
Definition: dragModel.H:61
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::dragModel::interfaceDict_
const dictionary & interfaceDict_
Definition: dragModel.H:57
Foam::dragModel::K
virtual tmp< volScalarField > K() const
Return the drag coefficient K.
Definition: dragModel.C:153
Foam::dragModel::phase2
const phaseModel & phase2() const
Definition: dragModel.H:116
Foam::dragModel::residualPhaseFraction_
dimensionedScalar residualPhaseFraction_
Definition: dragModel.H:60
Foam::dragModel::~dragModel
virtual ~dragModel()=default
Destructor.
Definition: dragModel.C:135
Foam::dragModel::TypeName
TypeName("dragModel")
Runtime type information.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dragModel::New
static autoPtr< dragModel > New(const dictionary &dict, const phaseModel &phase1, const phaseModel &phase2)
Definition: dragModel.C:60
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::dimensioned< scalar >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::dragModel::phase2_
const phaseModel & phase2_
Definition: dragModel.H:59
Foam::dragModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, dragModel, dictionary,(const dictionary &interfaceDict, const phaseModel &phase1, const phaseModel &phase2),(interfaceDict, phase1, phase2))
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:121
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::dragModel::residualSlip
const dimensionedScalar & residualSlip() const
Definition: dragModel.H:126
dictionary.H
Foam::dragModel::phase1_
const phaseModel & phase1_
Definition: dragModel.H:58
Foam::dragModel
Definition: dragModel.H:51
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::dragModel::dragModel
dragModel(const dictionary &dict, const phaseModel &phase1, const phaseModel &phase2)
Definition: dragModel.C:43