compressibleMomentumTransportModel.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-2021 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::compressibleMomentumTransportModel
26 
27 Description
28  Base class for single-phase compressible turbulence models.
29 
30 SourceFiles
31  compressibleMomentumTransportModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef compressibleMomentumTransportModel_H
36 #define compressibleMomentumTransportModel_H
37 
38 #include "momentumTransportModel.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class compressibleMomentumTransportModel Declaration
47 \*---------------------------------------------------------------------------*/
48 
50 :
52 {
53 
54 public:
55 
57  typedef volScalarField rhoField;
58 
59 
60 protected:
61 
62  // Protected data
63 
64  alphaField alpha_;
65  const rhoField& rho_;
66 
67 
68 public:
69 
70  //- Runtime type information
71  // TypeName("compressibleMomentumTransportModel");
72 
73 
74  // Declare run-time constructor selection table
75 
77  (
78  autoPtr,
80  dictionary,
81  (
82  const alphaField& alpha,
83  const rhoField& rho,
84  const volVectorField& U,
86  const surfaceScalarField& phi,
87  const viscosity& viscosity
88  ),
89  (alpha, rho, U, alphaRhoPhi, phi, viscosity)
90  );
91 
92 
93  // Constructors
94 
95  //- Construct
97  (
98  const word& type,
99  const geometricOneField& alpha,
100  const volScalarField& rho,
101  const volVectorField& U,
102  const surfaceScalarField& alphaRhoPhi,
103  const surfaceScalarField& phi,
104  const viscosity& viscosity
105  );
106 
107 
108  // Selectors
109 
110  //- Return a reference to the selected turbulence model
112  (
113  const volScalarField& rho,
114  const volVectorField& U,
115  const surfaceScalarField& phi,
116  const viscosity& viscosity
117  );
118 
119 
120  //- Destructor
122  {}
123 
124 
125  // Member Functions
126 
127  //- Return the phase fraction field
128  const alphaField& alpha() const
129  {
130  return alpha_;
131  }
132 
133  //- Return the density field
134  const rhoField& rho() const
135  {
136  return rho_;
137  }
138 
139  //- Return the volumetric flux field
140  virtual tmp<surfaceScalarField> phi() const;
141 
142  //- Return the effective stress tensor including the laminar stress
143  virtual tmp<volSymmTensorField> devTau() const = 0;
144 
145  //- Return the source term for the momentum equation
146  virtual tmp<fvVectorMatrix> divDevTau(volVectorField& U) const = 0;
147 };
148 
150 namespace compressible
151 {
153 
154  template<class CompressibleMomentumTransportModel>
156  (
157  const volScalarField& rho,
158  const volVectorField& U,
159  const surfaceScalarField& phi,
160  const viscosity& viscosity
161  );
162 }
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #ifdef NoRepository
173 #endif
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Generic GeometricField class.
virtual tmp< fvVectorMatrix > divDevTau(volVectorField &U) const =0
Return the source term for the momentum equation.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
A class for handling words, derived from string.
Definition: word.H:59
virtual tmp< surfaceScalarField > phi() const
Return the volumetric flux field.
momentumTransportModel(const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity)
Construct from components.
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
Abstract base class for turbulence models (RAS, LES and laminar).
const volVectorField & U() const
Access function to velocity field.
const surfaceScalarField & alphaRhoPhi() const
Access function to phase flux field.
static autoPtr< compressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
Return a reference to the selected turbulence model.
const rhoField & rho() const
Return the density field.
virtual tmp< volSymmTensorField > devTau() const =0
Return the effective stress tensor including the laminar stress.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
compressibleMomentumTransportModel(const word &type, const geometricOneField &alpha, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity)
Construct.
declareRunTimeNewSelectionTable(autoPtr, compressibleMomentumTransportModel, dictionary,(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity),(alpha, rho, U, alphaRhoPhi, phi, viscosity))
Runtime type information.
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
const alphaField & alpha() const
Return the phase fraction field.
Base class for single-phase compressible turbulence models.
Namespace for OpenFOAM.