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-------------------------------------------------------------------------------
11License
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
34namespace Foam
35{
36namespace diameterModels
37{
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
78Foam::diameterModels::daughterSizeDistributionModel::
79daughterSizeDistributionModel
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
100nik
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// ************************************************************************* //
label k
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Base class for breakup models which give a total breakup rate and a separate daughter size distributi...
Definition: breakupModel.H:56
Base class for daughter size distribution models.
const dimensionedScalar & nik(const label i, const label k) const
Return total number of particles assigned to class i when a particle.
void correct()
Correct field independent expressions.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:478
Namespace for OpenFOAM.
IOerror FatalIOError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333