daughterSizeDistributionModel.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) 2017-2018 OpenFOAM Foundation
9  Copyright (C) 2019-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
30 #include "breakupModel.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace diameterModels
37 {
38  defineTypeNameAndDebug(daughterSizeDistributionModel, 0);
39  defineRunTimeSelectionTable(daughterSizeDistributionModel, dictionary);
40 }
41 }
42 
43 
44 // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
45 
48 (
49  const breakupModel& breakup,
50  const dictionary& dict
51 )
52 {
53  const word modelType
54  (
55  dict.get<word>("daughterSizeDistributionModel")
56  );
57 
58  auto* ctorPtr = dictionaryConstructorTable(modelType);
59 
60  if (!ctorPtr)
61  {
63  (
64  dict,
65  "daughterSizeDistributionModel",
66  modelType,
67  *dictionaryConstructorTablePtr_
68  ) << exit(FatalIOError);
69  }
70 
71  return ctorPtr(breakup, dict);
72 }
73 
74 
75 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
76 
77 
80 (
81  const breakupModel& breakup,
82  const dictionary& dict
83 )
84 :
85  breakup_(breakup)
86 {}
87 
88 
89 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
90 
93 {}
94 
95 
96 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
97 
100 nik
101 (
102  const label i,
103  const label k
104 ) const
105 {
106  return nik_[k][i];
107 }
108 
109 
111 {
112  if (nik_.size() == 0)
113  {
114  forAll(breakup_.popBal().sizeGroups(), k)
115  {
116  nik_.append(new PtrList<dimensionedScalar>());
117 
118  for (label i = 0; i <= k; i++)
119  {
120  nik_[k].append(new dimensionedScalar (this->calcNik(i, k)));
121  }
122  }
123  }
124 }
125 
126 
127 // ************************************************************************* //
Foam::diameterModels::daughterSizeDistributionModel::nik
const dimensionedScalar & nik(const label i, const label k) const
Return total number of particles assigned to class i when a particle.
Definition: daughterSizeDistributionModel.C:101
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::diameterModels::daughterSizeDistributionModel::daughterSizeDistributionModel
daughterSizeDistributionModel(const breakupModel &breakup, const dictionary &dict)
Definition: daughterSizeDistributionModel.C:80
Foam::FatalIOError
IOerror FatalIOError
Foam::diameterModels::daughterSizeDistributionModel::~daughterSizeDistributionModel
virtual ~daughterSizeDistributionModel()
Destructor.
Definition: daughterSizeDistributionModel.C:92
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
daughterSizeDistributionModel.H
FatalIOErrorInLookup
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:478
Foam::diameterModels::daughterSizeDistributionModel::New
static autoPtr< daughterSizeDistributionModel > New(const breakupModel &breakup, const dictionary &dict)
Definition: daughterSizeDistributionModel.C:48
Foam::diameterModels::defineTypeNameAndDebug
defineTypeNameAndDebug(constant, 0)
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
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::dimensioned< scalar >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
breakupModel.H
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::autoPtr< Foam::diameterModels::daughterSizeDistributionModel >
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
Foam::diameterModels::defineRunTimeSelectionTable
defineRunTimeSelectionTable(binaryBreakupModel, dictionary)
Foam::diameterModels::breakupModel
Base class for breakup models which give a total breakup rate and a separate daughter size distributi...
Definition: breakupModel.H:55
Foam::diameterModels::daughterSizeDistributionModel::correct
void correct()
Correct field independent expressions.
Definition: daughterSizeDistributionModel.C:110