consumptionSpeed.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) 2011-2016 OpenFOAM Foundation
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#include "consumptionSpeed.H"
29
30/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
31
32namespace Foam
33{
35}
36
37
38// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39
41(
42 const dictionary& dict
43)
44: omega0_(dict.get<scalar>("omega0")),
45 eta_(dict.get<scalar>("eta")),
46 sigmaExt_(dict.get<scalar>("sigmaExt")),
47 omegaMin_(dict.get<scalar>("omegaMin"))
48{}
49
50
51// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
52
54{}
55
56
57// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
58
59Foam::scalar Foam::consumptionSpeed::omega0Sigma
60(
61 scalar sigma,
62 scalar a
63) const
64{
65 scalar omega0 = 0.0;
66
67 if (sigma < sigmaExt_)
68 {
69 omega0 = max
70 (
71 a*omega0_*(1.0 - exp(eta_*max(sigma, 0.0))),
72 omegaMin_
73 ) ;
74 }
75
76 return omega0;
77}
78
79
80Foam::tmp<Foam::volScalarField> Foam::consumptionSpeed::omega0Sigma
81(
82 const volScalarField& sigma
83)
84{
86 (
88 (
90 (
91 "omega0",
92 sigma.time().timeName(),
93 sigma.db(),
96 ),
97 sigma.mesh(),
98 dimensionedScalar(dimensionSet(1, -2, -1, 0, 0, 0, 0), Zero)
99 )
100 );
101
102 volScalarField& omega0 = tomega0.ref();
103
104 volScalarField::Internal& iomega0 = omega0;
105
106 forAll(iomega0, celli)
107 {
108 iomega0[celli] = omega0Sigma(sigma[celli], 1.0);
109 }
110
111 volScalarField::Boundary& bomega0 = omega0.boundaryFieldRef();
112
113 forAll(bomega0, patchi)
114 {
115 forAll(bomega0[patchi], facei)
116 {
117 bomega0[patchi][facei] =
118 omega0Sigma
119 (
120 sigma.boundaryField()[patchi][facei],
121 1.0
122 );
123 }
124 }
125
126 return tomega0;
127}
128
129
131{
132 dict.readEntry("omega0", omega0_);
133 dict.readEntry("eta", eta_);
134 dict.readEntry("sigmaExt", sigmaExt_);
135 dict.readEntry("omegaMin", omegaMin_);
136}
137
138
139// ************************************************************************* //
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
virtual bool read()
Re-read model coefficients if they have changed.
virtual ~consumptionSpeed()
Destructor.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:109
A class for managing temporary objects.
Definition: tmp.H:65
T & ref() const
Definition: tmpI.H:227
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
Namespace for OpenFOAM.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
dimensionedScalar exp(const dimensionedScalar &ds)
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333