viscousDissipation.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) 2017 OpenCFD Ltd
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::fv::viscousDissipation
28 
29 Group
30  grpFvOptionsSources
31 
32 Description
33  Calculates and applies the viscous dissipation energy source to the energy
34  equation.
35 
36 Usage
37  Example usage:
38  \verbatim
39  fields (h); // Name of energy field
40  \endverbatim
41 
42 SourceFiles
43  viscousDissipation.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef viscousDissipation_H
48 #define viscousDissipation_H
49 
50 #include "fvOption.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace fv
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class viscousDissipation Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 :
66  public option
67 {
68  // Private data
69 
70  //- Name of velocity field; default = U
71  word UName_;
72 
73  //- Name of the rho field for incompressible solvers
74  word rhoName_;
75 
76  //- Density for single phase flows
77  dimensionedScalar rho_;
78 
79 
80  // Private Member Functions
81 
82  //- Return the viscosity field
83  tmp<volSymmTensorField> devRhoReff() const;
84 
85  //- No copy construct
86  viscousDissipation(const viscousDissipation&) = delete;
87 
88  //- No copy assignment
89  void operator=(const viscousDissipation&) = delete;
90 
91 private:
92 
93  // Private member functions
94 
95 
96  //- Return rho field
97  tmp<volScalarField> rho() const;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("viscousDissipation");
104 
105 
106  // Constructors
107 
108  //- Construct from explicit source name and mesh
110  (
111  const word& sourceName,
112  const word& modelType,
113  const dictionary& dict,
114  const fvMesh& mesh
115  );
116 
117 
118  // Member Functions
119 
120  //- Add explicit contribution to compressible energy equation
121  virtual void addSup
122  (
123  const volScalarField& rho,
124  fvMatrix<scalar>& eqn,
125  const label fieldi
126  );
127 
128  //- Read source dictionary
129  virtual bool read(const dictionary& dict)
130  {
131  return true;
132  }
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace fv
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::fv::viscousDissipation::read
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: viscousDissipation.H:128
rho
rho
Definition: readInitialConditions.H:88
Foam::fv::viscousDissipation::TypeName
TypeName("viscousDissipation")
Runtime type information.
Foam::fv::option
Finite volume options abstract base class. Provides a base set of controls, e.g.:
Definition: fvOption.H:69
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::dimensioned< scalar >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fv
labelList fv(nPoints)
uniformDimensionedFields.H
fvOption.H
Foam::fv::viscousDissipation::addSup
virtual void addSup(const volScalarField &rho, fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to compressible energy equation.
Definition: viscousDissipation.C:175
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:36
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:76
Foam::fv::viscousDissipation
Calculates and applies the viscous dissipation energy source to the energy equation.
Definition: viscousDissipation.H:63
Foam::GeometricField< scalar, fvPatchField, volMesh >