Loading...
Searching...
No Matches
Arrhenius.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-2019 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::viscosityModels::Arrhenius
28
29Description
30 Arrhenius type of dependency on a given scalar field name. Most likely
31 temperature. The expression is as follow:
32 \verbatim
33 mu = exp(-alpha_*(T - Talpha_))
34 \endverbatim
35
36SourceFiles
37 Arrhenius.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef Arrhenius_H
42#define Arrhenius_H
43
44#include "viscosityModel.H"
45#include "dimensionedScalar.H"
46#include "volFields.H"
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52namespace viscosityModels
53{
54
55/*---------------------------------------------------------------------------*\
56 Class Arrhenius Declaration
57\*---------------------------------------------------------------------------*/
58
59template<class ViscousModel>
60class Arrhenius
61:
62 public ViscousModel
63{
64 // Private data
65
66 dictionary ArrheniusCoeffs_;
67
68 // Model coefficients
69 dimensionedScalar alpha_;
70 dimensionedScalar Talpha_;
71
72 //- Field used for as temperature
73 word fieldName_;
74
75 //- Auto pointer for scalar field
77
78 //- Reference to mesh
79 const fvMesh& mesh_;
80
81
82 // Private Member Functions
83
84 //- Calculate and return the laminar viscosity
85 tmp<volScalarField> calcNu(const volScalarField&) const;
86
87
88public:
89
90 //- Runtime type information
91 TypeName("Arrhenius");
92
93
94 // Constructors
95
96 //- Construct from components
98 (
99 const word& name,
101 const volVectorField& U,
103 );
105
106 //- Destructor
107 virtual ~Arrhenius() = default;
108
109
110 // Member Functions
111
112 //- Correct the laminar viscosity
113 virtual void correct()
114 {
115 ViscousModel::correct();
117 const auto* fldPtr = mesh_.findObject<volScalarField>(fieldName_);
118
119 if (fldPtr)
120 {
121 this->nu_ *= calcNu(*fldPtr);
122 }
123 }
125 //- Read transportProperties dictionary
126 virtual bool read(const dictionary& viscosityProperties);
127};
128
129
130// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131
132} // End namespace viscosityModels
133} // End namespace Foam
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137#ifdef NoRepository
138# include "Arrhenius.C"
139#endif
140
141// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142
143#endif
144
145// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A class for managing temporary objects.
Definition tmp.H:75
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition Arrhenius.C:71
virtual ~Arrhenius()=default
Destructor.
Arrhenius(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
Definition Arrhenius.C:41
virtual void correct()
Correct the laminar viscosity.
Definition Arrhenius.H:124
TypeName("Arrhenius")
Runtime type information.
A class for handling words, derived from Foam::string.
Definition word.H:66
U
Definition pEqn.H:72
A namespace for various incompressible viscosityModel implementations.
Definition Arrhenius.H:48
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68