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 -------------------------------------------------------------------------------
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 #include "consumptionSpeed.H"
29 
30 /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
31 
32 namespace Foam
33 {
35 }
36 
37 
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 
40 Foam::consumptionSpeed::consumptionSpeed
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 
59 Foam::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 
80 Foam::tmp<Foam::volScalarField> Foam::consumptionSpeed::omega0Sigma
81 (
82  const volScalarField& sigma
83 )
84 {
85  tmp<volScalarField> tomega0
86  (
87  new volScalarField
88  (
89  IOobject
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 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::consumptionSpeed::~consumptionSpeed
virtual ~consumptionSpeed()
Destructor.
Definition: consumptionSpeed.C:53
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:261
Foam::dimensionSet
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:108
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:227
consumptionSpeed
Correlation function for laminar consumption speed obtained from flamelet solution at increasing stra...
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:302
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
consumptionSpeed.H
Foam::GeometricField::boundaryFieldRef
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Definition: GeometricField.C:783
Foam::consumptionSpeed::read
void read(const dictionary &dict)
Update properties.
Definition: consumptionSpeed.C:130
sigma
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:188
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54