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