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-2023 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 {
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  Info<< "Selecting daughter size distribution model for "
56  << breakup.popBal().name() << ": "
57  << daughterSizeDistributionModelType << endl;
58 
59  dictionaryConstructorTable::iterator cstrIter =
60  dictionaryConstructorTablePtr_->find(daughterSizeDistributionModelType);
61 
62  if (cstrIter == dictionaryConstructorTablePtr_->end())
63  {
65  << "Unknown daughter size distribution model type "
66  << daughterSizeDistributionModelType << endl << endl
67  << "Valid daughter size distribution model types are : " << endl
68  << dictionaryConstructorTablePtr_->sortedToc()
69  << exit(FatalError);
70  }
71 
72  return cstrIter()(breakup, dict);
73 }
74 
75 
76 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
77 
78 
81 (
82  const breakupModel& breakup,
83  const dictionary& dict
84 )
85 :
86  breakup_(breakup),
87  nik_()
88 {}
89 
90 
91 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
92 
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 
102 (
103  const label i,
104  const label k
105 ) const
106 {
107  return nik_[k][i];
108 }
109 
110 
112 {
113  if (nik_.size() == 0)
114  {
115  forAll(breakup_.popBal().sizeGroups(), k)
116  {
117  nik_.append(new PtrList<dimensionedScalar>());
118 
119  for (label i = 0; i <= k; i++)
120  {
121  nik_[k].append
122  (
124  (
125  this->calcNik(i, k)
126  )
127  );
128  }
129  }
130  }
131 }
132 
133 
134 // ************************************************************************* //
label k
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
const word & name() const
Return name.
Definition: IOobject.H:310
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
Base class for breakup models which provide a total breakup rate and a separate daughter size distrib...
Definition: breakupModel.H:56
const populationBalanceModel & popBal() const
Return reference to the populationBalanceModel.
Definition: breakupModel.H:147
Base class for daughter size distribution models. Currently only supports field-independent formulati...
void precompute()
Precompute field independent expressions.
const dimensionedScalar & nik(const label i, const label k) const
Return contribution to sizeGroup i due to breakup in sizeGroup k.
static autoPtr< daughterSizeDistributionModel > New(const breakupModel &breakup, const dictionary &dict)
daughterSizeDistributionModel(const breakupModel &breakup, const dictionary &dict)
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
A class for handling words, derived from string.
Definition: word.H:62
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
defineRunTimeSelectionTable(IATEsource, dictionary)
defineTypeNameAndDebug(constant, 0)
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
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
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:257
messageStream Info
error FatalError
dictionary dict