PhaseCompressibleMomentumTransportModel.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::PhaseCompressibleMomentumTransportModel
26 
27 Description
28  Templated abstract base class for multiphase compressible
29  turbulence models.
30 
31 SourceFiles
32  PhaseCompressibleMomentumTransportModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef PhaseCompressibleMomentumTransportModel_H
37 #define PhaseCompressibleMomentumTransportModel_H
38 
39 #include "MomentumTransportModel.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class PhaseCompressibleMomentumTransportModel Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class TransportModel>
53 :
55  <
56  volScalarField,
57  volScalarField,
58  compressibleMomentumTransportModel,
59  TransportModel
60  >
61 {
62 
63 public:
64 
67  typedef TransportModel transportModel;
69 
70 
71  // Constructors
72 
73  //- Construct
75  (
76  const word& type,
77  const alphaField& alpha,
78  const volScalarField& rho,
79  const volVectorField& U,
81  const surfaceScalarField& phi,
82  const transportModel& transport
83  );
84 
85 
86  // Selectors
87 
88  //- Return a reference to the selected turbulence model
90  (
91  const alphaField& alpha,
92  const volScalarField& rho,
93  const volVectorField& U,
95  const surfaceScalarField& phi,
96  const transportModel& transportModel
97  );
98 
99 
100  //- Destructor
102  {}
103 
104 
105  // Member Functions
106 
107  //- Access function to incompressible transport model
108  virtual const thermoModel& thermo() const
109  {
111  }
112 
113  //- Return the laminar dynamic viscosity
114  virtual tmp<volScalarField> mu() const
115  {
116  return thermo().mu();
117  }
118 
119  //- Return the laminar dynamic viscosity on patch
120  virtual tmp<scalarField> mu(const label patchi) const
121  {
122  return thermo().mu(patchi);
123  }
124 
125  //- Return the laminar viscosity
126  virtual tmp<volScalarField> nu() const
127  {
128  return thermo().mu()/this->rho_;
129  }
130 
131  //- Return the laminar viscosity on patchi
132  virtual tmp<scalarField> nu(const label patchi) const
133  {
134  return thermo().mu(patchi)/this->rho_.boundaryField()[patchi];
135  }
136 
137  //- Return the turbulence dynamic viscosity
138  virtual tmp<volScalarField> mut() const
139  {
140  return this->rho_*this->nut();
141  }
142 
143  //- Return the turbulence dynamic viscosity on patch
144  virtual tmp<scalarField> mut(const label patchi) const
145  {
146  return this->rho_.boundaryField()[patchi]*this->nut(patchi);
147  }
148 
149  //- Return the effective dynamic viscosity
150  virtual tmp<volScalarField> muEff() const
151  {
152  return mut() + mu();
153  }
154 
155  //- Return the effective dynamic viscosity on patch
156  virtual tmp<scalarField> muEff(const label patchi) const
157  {
158  return mut(patchi) + mu(patchi);
159  }
160 
161  //- Return the phase-pressure'
162  // (derivative of phase-pressure w.r.t. phase-fraction)
163  virtual tmp<volScalarField> pPrime() const;
164 
165  //- Return the face-phase-pressure'
166  // (derivative of phase-pressure w.r.t. phase-fraction)
167  virtual tmp<surfaceScalarField> pPrimef() const;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #ifdef NoRepository
179 #endif
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
Templated abstract base class for multiphase compressible turbulence models.
TransportTraits< transportModel >::thermoModel thermoModel
virtual tmp< volScalarField > pPrime() const
Return the phase-pressure&#39;.
const transportModel & transport() const
Access function to incompressible transport model.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const Boundary & boundaryField() const
Return const-reference to the boundary field.
static autoPtr< PhaseCompressibleMomentumTransportModel > New(const alphaField &alpha, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transportModel)
Return a reference to the selected turbulence model.
virtual const thermoModel & thermo() const
Access function to incompressible transport model.
const volScalarField & rho() const
Return the density field.
static const thermoModel & thermo(const TransportType &tt)
virtual tmp< volScalarField > muEff() const
Return the effective dynamic viscosity.
A class for handling words, derived from string.
Definition: word.H:59
virtual tmp< surfaceScalarField > phi() const
Return the volumetric flux field.
PhaseCompressibleMomentumTransportModel(const word &type, const alphaField &alpha, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport)
Construct.
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
virtual tmp< surfaceScalarField > pPrimef() const
Return the face-phase-pressure&#39;.
const volVectorField & U() const
Access function to velocity field.
const surfaceScalarField & alphaRhoPhi() const
Access function to phase flux field.
label patchi
virtual tmp< volScalarField > mu() const
Return the laminar dynamic viscosity.
Base-class for all transport models used by the incompressible turbulence models. ...
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
Templated abstract base class for turbulence models.
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
virtual tmp< volScalarField > mut() const
Return the turbulence dynamic viscosity.
Namespace for OpenFOAM.