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-------------------------------------------------------------------------------
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
26\*---------------------------------------------------------------------------*/
27
28
29#include "Arrhenius.H"
30
31// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
32
33template<class ViscousModel>
36(
37 const volScalarField& field
38) const
39{
40 return exp(-alpha_*(field - Talpha_));
41}
42
43
44// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45
46template<class ViscousModel>
48(
49 const word& name,
50 const dictionary& viscosityProperties,
51 const volVectorField& U,
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
76template<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// ************************************************************************* //
surfaceScalarField & phi
virtual bool read()
Re-read model coefficients if they have changed.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
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
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
void calcNu()
Calculate and return the laminar viscosity.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
A class for managing temporary objects.
Definition: tmp.H:65
Arrhenius type of dependency on a given scalar field name. Most likely temperature....
Definition: Arrhenius.H:62
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
rDeltaTY field()
dynamicFvMesh & mesh
dimensionedScalar exp(const dimensionedScalar &ds)
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:54
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59