daughterSizeDistributionModel.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 #include "breakupModel.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace diameterModels
34 {
35  defineTypeNameAndDebug(daughterSizeDistributionModel, 0);
36  defineRunTimeSelectionTable(daughterSizeDistributionModel, dictionary);
37 }
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
42 
45 (
46  const breakupModel& breakup,
47  const dictionary& dict
48 )
49 {
50  word daughterSizeDistributionModelType
51  (
52  dict.lookup("daughterSizeDistributionModel")
53  );
54 
55  dictionaryConstructorTable::iterator cstrIter =
56  dictionaryConstructorTablePtr_->find(daughterSizeDistributionModelType);
57 
58  if (cstrIter == dictionaryConstructorTablePtr_->end())
59  {
61  << "Unknown daughter size distribution model type "
62  << daughterSizeDistributionModelType << endl << endl
63  << "Valid daughter size distribution model types are : " << endl
64  << dictionaryConstructorTablePtr_->sortedToc()
65  << exit(FatalError);
66  }
67 
68  return cstrIter()(breakup, dict);
69 }
70 
71 
72 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
73 
74 
77 (
78  const breakupModel& breakup,
79  const dictionary& dict
80 )
81 :
82  breakup_(breakup),
83  particleNumber_
84  (
85  dimensionedScalar::lookupOrDefault
86  (
87  "particleNumber",
88  dict,
89  dimless,
90  2.0
91  )
92  ),
93  nik_()
94 {}
95 
96 
97 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
98 
101 {}
102 
103 
104 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105 
108 (
109  const label i,
110  const label k
111 ) const
112 {
113  return nik_[k][i];
114 }
115 
116 
118 {
119  if (nik_.size() == 0)
120  {
121  forAll(breakup_.popBal().sizeGroups(), k)
122  {
123  nik_.append(new PtrList<dimensionedScalar>());
124 
125  for (label i = 0; i <= k; i++)
126  {
127  nik_[k].append
128  (
130  (
131  particleNumber_*this->calcNik(i, k))
132  );
133  }
134  }
135  }
136 }
137 
138 
139 // ************************************************************************* //
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
void correct()
Correct field independent expressions.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
label k
Boltzmann constant.
Generic dimensioned Type class.
daughterSizeDistributionModel(const breakupModel &breakup, const dictionary &dict)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
static autoPtr< daughterSizeDistributionModel > New(const breakupModel &breakup, const dictionary &dict)
const dimensionedScalar & nik(const label i, const label k) const
Return contribution to sizeGroup i due to breakup in sizeGroup k.
Namespace for OpenFOAM.