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-2020 OpenCFD Ltd
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::fv::viscousDissipation
28
29Group
30 grpFvOptionsSources
31
32Description
33 Applies a viscous dissipation energy source to the energy equation.
34
35 Sources applied to either of the below, if exist:
36 \verbatim
37 e | Internal energy [m2/s2]
38 h | Enthalphy [m2/s2]
39 field | User-specified field
40 \endverbatim
41
42 Required fields:
43 \verbatim
44 U | Velocity [m/s]
45 rho | Fluid density (for compressible flows) [kg/m3]
46 \endverbatim
47
48Usage
49 Minimal example by using \c constant/fvOptions:
50 \verbatim
51 viscousDissipation1
52 {
53 // Mandatory entries (unmodifiable)
54 type viscousDissipation;
55
56 // Optional entries (unmodifiable)
57 fields (<fieldName>);
58 U <UName>;
59 rho <rhoName>;
60
61 // Conditional optional entries (unmodifiable)
62
63 // when rho=rhoInf
64 rhoInf 1000;
65
66 // Mandatory/Optional (inherited) entries
67 ...
68 }
69 \endverbatim
70
71 where the entries mean:
72 \table
73 Property | Description | Type | Reqd | Dflt
74 type | Type name: viscousDissipation | word | yes | -
75 fields | Name of operand (energy) field | word | no | -
76 U | Name of operand velocity field | word | no | U
77 rho | Name of operand density field | word | no | none
78 rhoInf | Value of fluid density | scalar | cndtnl | 0
79 \endtable
80
81 The inherited entries are elaborated in:
82 - \link fvOption.H \endlink
83
84Note
85 - The entry \c fields accepts only a single field name.
86 - The sources are applied onto the entire computational domain.
87 - \c rho=rhoInf sets a zero-density for single phase flows.
88 - Not applicable to multiphase flows.
89
90SourceFiles
91 viscousDissipation.C
92
93\*---------------------------------------------------------------------------*/
94
95#ifndef viscousDissipation_H
96#define viscousDissipation_H
97
98#include "fvOption.H"
100
101// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102
103namespace Foam
104{
105namespace fv
106{
107
108/*---------------------------------------------------------------------------*\
109 Class viscousDissipation Declaration
110\*---------------------------------------------------------------------------*/
111
112class viscousDissipation
113:
114 public fv::option
115{
116 // Private Data
117
118 //- Name of velocity field
119 word UName_;
120
121 //- Name of the rho field for incompressible solvers
122 word rhoName_;
123
124 //- Density for single phase flows
126
127
128 // Private Member Functions
129
130 //- Return the viscosity field
131 tmp<volSymmTensorField> devRhoReff() const;
132
133 //- Return rho field
134 tmp<volScalarField> rho() const;
135
136
137public:
138
139 //- Runtime type information
140 TypeName("viscousDissipation");
141
142
143 // Constructors
144
145 //- Construct from explicit source name and mesh
148 const word& sourceName,
149 const word& modelType,
150 const dictionary& dict,
151 const fvMesh& mesh
152 );
153
154 //- No copy construct
155 viscousDissipation(const viscousDissipation&) = delete;
156
157 //- No copy assignment
158 void operator=(const viscousDissipation&) = delete;
159
160
161 //- Destructor
162 virtual ~viscousDissipation() = default;
163
164
165 // Member Functions
166
167 //- Add explicit contribution to compressible energy equation
168 virtual void addSup
169 (
170 const volScalarField& rho,
171 fvMatrix<scalar>& eqn,
172 const label fieldi
173 );
174
176 //- Read source dictionary - no-op
177 virtual bool read(const dictionary& dict)
178 {
179 return true;
180 }
181};
182
183
184// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185
186} // End namespace fv
187} // End namespace Foam
188
189// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191#endif
192
193// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:121
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Base abstract class for handling finite volume options (i.e. fvOption).
Definition: fvOption.H:127
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
Applies a viscous dissipation energy source to the energy equation.
virtual bool read(const dictionary &dict)
Read source dictionary - no-op.
virtual void addSup(const volScalarField &rho, fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to compressible energy equation.
virtual ~viscousDissipation()=default
Destructor.
void operator=(const viscousDissipation &)=delete
No copy assignment.
viscousDissipation(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
TypeName("viscousDissipation")
Runtime type information.
viscousDissipation(const viscousDissipation &)=delete
No copy construct.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
labelList fv(nPoints)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73