MomentumTransportModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2020 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::MomentumTransportModel
26 
27 Description
28  Templated abstract base class for turbulence models
29 
30 SourceFiles
31  MomentumTransportModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef MomentumTransportModel_H
36 #define MomentumTransportModel_H
37 
38 #include "momentumTransportModel.H"
39 #include "autoPtr.H"
40 #include "runTimeSelectionTables.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class MomentumTransportModel Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template
52 <
53  class Alpha,
54  class Rho,
55  class BasicMomentumTransportModel,
56  class TransportModel
57 >
59 :
60  public BasicMomentumTransportModel
61 {
62 
63 public:
64 
65  typedef Alpha alphaField;
66  typedef Rho rhoField;
67  typedef TransportModel transportModel;
68 
69 
70 protected:
71 
72  // Protected data
73 
74  const alphaField& alpha_;
75  const transportModel& transport_;
76 
77 
78 public:
79 
80  // Declare run-time constructor selection table
81 
83  (
84  autoPtr,
86  dictionary,
87  (
88  const alphaField& alpha,
89  const rhoField& rho,
90  const volVectorField& U,
91  const surfaceScalarField& alphaRhoPhi,
92  const surfaceScalarField& phi,
93  const transportModel& transport
94  ),
95  (alpha, rho, U, alphaRhoPhi, phi, transport)
96  );
97 
98 
99  // Constructors
100 
101  //- Construct
103  (
104  const alphaField& alpha,
105  const rhoField& rho,
106  const volVectorField& U,
107  const surfaceScalarField& alphaRhoPhi,
108  const surfaceScalarField& phi,
109  const transportModel& transport
110  );
111 
112  //- Disallow default bitwise copy construction
114 
115 
116  // Selectors
117 
118  //- Return a reference to the selected turbulence model
120  (
121  const alphaField& alpha,
122  const rhoField& rho,
123  const volVectorField& U,
124  const surfaceScalarField& alphaRhoPhi,
125  const surfaceScalarField& phi,
126  const transportModel& transport
127  );
128 
129 
130  //- Destructor
131  virtual ~MomentumTransportModel()
132  {}
133 
134 
135  // Member Functions
136 
137  //- Access function to phase fraction
138  const alphaField& alpha() const
139  {
140  return alpha_;
141  }
142 
143  //- Access function to incompressible transport model
144  const transportModel& transport() const
145  {
146  return transport_;
147  }
148 
149 
150  // Member Operators
151 
152  //- Disallow default bitwise assignment
153  void operator=(const MomentumTransportModel&) = delete;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #ifdef NoRepository
164  #include "MomentumTransportModel.C"
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
const transportModel & transport() const
Access function to incompressible transport model.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
const transportModel & transport_
MomentumTransportModel(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport)
Construct.
phi
Definition: pEqn.H:104
static autoPtr< MomentumTransportModel > New(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport)
Return a reference to the selected turbulence model.
const alphaField & alpha() const
Access function to phase fraction.
virtual ~MomentumTransportModel()
Destructor.
U
Definition: pEqn.H:72
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
Templated abstract base class for turbulence models.
declareRunTimeNewSelectionTable(autoPtr, MomentumTransportModel, dictionary,(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport),(alpha, rho, U, alphaRhoPhi, phi, transport))
void operator=(const MomentumTransportModel &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.