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 // ************************************************************************* //
Foam::viscosityModels::Arrhenius::Arrhenius
Arrhenius(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
Definition: Arrhenius.C:48
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Arrhenius.H
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:261
Foam::blockMeshTools::read
void read(Istream &, label &val, const dictionary &)
In-place read with dictionary lookup.
Definition: blockMeshTools.C:57
Foam::viscosityModels::Arrhenius
Arrhenius type of dependency on a given scalar field name. Most likely temperature....
Definition: Arrhenius.H:59
Foam::inv
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:73
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:302
field
rDeltaTY field()
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::viscosityModels::Arrhenius::read
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition: Arrhenius.C:78
U
U
Definition: pEqn.H:72
Foam::dimTemperature
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:54
Foam::dictionary::optionalSubDict
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:577
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::GeometricField< vector, fvPatchField, volMesh >