Arrhenius.C
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 -------------------------------------------------------------------------------
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 \*---------------------------------------------------------------------------*/
27 
28 
29 #include "Arrhenius.H"
30 
31 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
32 
33 template<class ViscousModel>
36 (
37  const volScalarField& field
38 ) const
39 {
40  return exp(-alpha_*(field - Talpha_));
41 }
42 
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
46 template<class ViscousModel>
48 (
49  const word& name,
50  const dictionary& viscosityProperties,
51  const volVectorField& U,
52  const surfaceScalarField& phi
53 )
54 :
55  ViscousModel(name, viscosityProperties, U, phi),
56  ArrheniusCoeffs_
57  (
58  viscosityProperties.optionalSubDict(typeName + "Coeffs")
59  ),
60  alpha_("alpha", inv(dimTemperature), ArrheniusCoeffs_),
61  Talpha_("Talpha", dimTemperature, ArrheniusCoeffs_),
62  fieldName_(ArrheniusCoeffs_.getOrDefault<word>("field", "T")),
63  mesh_(U.mesh())
64 {
65  const auto* fldPtr = mesh_.findObject<volScalarField>(fieldName_);
66 
67  if (fldPtr)
68  {
69  this->nu_ *= calcNu(*fldPtr);
70  }
71 }
72 
73 
74 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
75 
76 template<class ViscousModel>
78 (
79  const dictionary& viscosityProperties
80 )
81 {
82  viscosityModel::read(viscosityProperties);
83 
84  ArrheniusCoeffs_ =
85  viscosityProperties.optionalSubDict(typeName + "Coeffs");
86 
87  ArrheniusCoeffs_.readEntry("alpha", alpha_);
88  ArrheniusCoeffs_.readEntry("Talpha", Talpha_);
89 
90  return true;
91 }
92 
93 
94 // ************************************************************************* //
Arrhenius(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
Definition: Arrhenius.C:41
rDeltaTY field()
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect...
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary, otherwise return this dictionary.
Definition: dictionary.C:560
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
dimensionedScalar exp(const dimensionedScalar &ds)
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.
A class for handling words, derived from Foam::string.
Definition: word.H:63
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition: Arrhenius.C:71
U
Definition: pEqn.H:72
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Arrhenius type of dependency on a given scalar field name. Most likely temperature. The expression is as follow:
Definition: Arrhenius.H:55