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-2018 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 {}
84 
85 
86 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
87 
90 {}
91 
92 
93 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94 
97 nik
98 (
99  const label i,
100  const label k
101 ) const
102 {
103  return nik_[k][i];
104 }
105 
106 
108 {
109  if (nik_.size() == 0)
110  {
111  forAll(breakup_.popBal().sizeGroups(), k)
112  {
113  nik_.append(new PtrList<dimensionedScalar>());
114 
115  for (label i = 0; i <= k; i++)
116  {
117  nik_[k].append(new dimensionedScalar (this->calcNik(i, k)));
118  }
119  }
120  }
121 }
122 
123 
124 // ************************************************************************* //
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
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:256
label k
Boltzmann constant.
Generic dimensioned Type class.
daughterSizeDistributionModel(const breakupModel &breakup, const dictionary &dict)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
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 total number of particles assigned to class i when a particle.
Namespace for OpenFOAM.