viscousHeating.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) 2024-2026 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::fv::viscousHeating
26 
27 Description
28  Applies the viscous heating redistribution source
29  to the total energy equation.
30 
31  Note this term does not generate energy it is a conservative redistribution
32  term, the enthalpy or internal energy source from viscous heating is a
33  consequence of the kinetic energy loss, i.e. a transfer of energy from the
34  kinetic energy part of the total energy to the thermal part.
35 
36 Usage
37  Example usage:
38  \verbatim
39  viscousHeating1
40  {
41  type viscousHeating;
42  }
43  \endverbatim
44 
45 SourceFiles
46  viscousHeating.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef viscousHeating_H
51 #define viscousHeating_H
52 
53 #include "fvModel.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 namespace fv
60 {
61 
62 /*---------------------------------------------------------------------------*\
63  Class viscousHeating Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 class viscousHeating
67 :
68  public fvModel
69 {
70  // Private Data
71 
72  //- Optional phase name
73  word phaseName_;
74 
75 
76  // Private Member Functions
77 
78  //- Non-virtual read
79  void readCoeffs(const dictionary& dict);
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("viscousHeating");
86 
87 
88  // Constructors
89 
90  //- Construct from explicit source name and mesh
92  (
93  const word& name,
94  const word& modelType,
95  const fvMesh& mesh,
96  const dictionary& dict
97  );
98 
99  //- Disallow default bitwise copy construction
100  viscousHeating(const viscousHeating&) = delete;
101 
102 
103  // Member Functions
104 
105  // Checks
106 
107  //- Return the list of fields for which the fvModel adds source term
108  // to the transport equation
109  virtual wordList addSupFields() const;
110 
111 
112  // Evaluate
113 
114  //- Add explicit contribution to compressible energy equation
115  virtual void addSup
116  (
117  const volScalarField& rho,
118  const volScalarField& he,
119  fvMatrix<scalar>& eqn
120  ) const;
121 
122  //- Add explicit contribution to phase energy equation
123  virtual void addSup
124  (
125  const volScalarField& alpha,
126  const volScalarField& rho,
127  const volScalarField& he,
128  fvMatrix<scalar>& eqn
129  ) const;
130 
131 
132  // Mesh changes
133 
134  //- Update for mesh motion
135  virtual bool movePoints();
136 
137  //- Update topology using the given map
138  virtual void topoChange(const polyTopoChangeMap&);
139 
140  //- Update from another mesh using the given map
141  virtual void mapMesh(const polyMeshMap&);
142 
143  //- Redistribute or update using the given distribution map
144  virtual void distribute(const polyDistributionMap&);
145 
146 
147  // IO
148 
149  //- Read source dictionary
150  virtual bool read(const dictionary& dict);
151 
152 
153  // Member Operators
154 
155  //- Disallow default bitwise assignment
156  void operator=(const viscousHeating&) = delete;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace fv
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
Generic GeometricField class.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
Finite volume model abstract base class.
Definition: fvModel.H:60
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:69
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:57
Applies the viscous heating redistribution source to the total energy equation.
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read source dictionary.
TypeName("viscousHeating")
Runtime type information.
virtual void addSup(const volScalarField &rho, const volScalarField &he, fvMatrix< scalar > &eqn) const
Add explicit contribution to compressible energy equation.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
viscousHeating(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
void operator=(const viscousHeating &)=delete
Disallow default bitwise assignment.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:63
rho
Definition: pEqn.H:1
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict