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 -------------------------------------------------------------------------------
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::viscosityModels::Arrhenius
28 
29 Description
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 
36 SourceFiles
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"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace viscosityModels
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class Arrhenius Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class ViscousModel>
60 class 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 
88 public:
89 
90  //- Runtime type information
91  TypeName("Arrhenius");
92 
93 
94  // Constructors
95 
96  //- Construct from components
97  Arrhenius
98  (
99  const word& name,
100  const dictionary& viscosityProperties,
101  const volVectorField& U,
102  const surfaceScalarField& phi
103  );
104 
105 
106  //- Destructor
107  virtual ~Arrhenius() = default;
108 
109 
110  // Member Functions
111 
112  //- Correct the laminar viscosity
113  virtual void correct()
114  {
116 
117  const auto* fldPtr = mesh_.findObject<volScalarField>(fieldName_);
118 
119  if (fldPtr)
120  {
121  this->nu_ *= calcNu(*fldPtr);
122  }
123  }
124 
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 // ************************************************************************* //
Foam::viscosityModels::Arrhenius::Arrhenius
Arrhenius(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
Definition: Arrhenius.C:48
volFields.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::viscosityModels::Arrhenius::TypeName
TypeName("Arrhenius")
Runtime type information.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Arrhenius.C
Foam::viscosityModels::Arrhenius
Arrhenius type of dependency on a given scalar field name. Most likely temperature....
Definition: Arrhenius.H:59
correct
fvOptions correct(rho)
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::viscosityModels::Arrhenius::~Arrhenius
virtual ~Arrhenius()=default
Destructor.
Foam::viscosityModels::Arrhenius::correct
virtual void correct()
Correct the laminar viscosity.
Definition: Arrhenius.H:112
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::dimensioned< scalar >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::viscosityModels::Arrhenius::read
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition: Arrhenius.C:78
dimensionedScalar.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
Foam::objectRegistry::findObject
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
Definition: objectRegistryTemplates.C:401
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::GeometricField< scalar, fvPatchField, volMesh >