breakupModel.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-2026 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 
26 #include "breakupModel.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 namespace populationBalance
33 {
36 }
37 }
38 
39 
40 // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
41 
44 (
45  const populationBalanceModel& popBal,
46  const dictionary& dict
47 )
48 {
49  const bool haveModelDict = dict.isDict(typeName);
50 
51  word modelType;
52  const dictionary* modelDictPtr = nullptr;
53  if (haveModelDict)
54  {
55  modelDictPtr = &dict.subDict(typeName);
56  modelType = modelDictPtr->lookup<word>("type");
57  }
58  else
59  {
60  modelType = dict.lookup<word>(typeName);
61  modelDictPtr = &dict.optionalTypeDict(modelType);
62  }
63  const dictionary& modelDict = *modelDictPtr;
64 
65  Info<< indentOrNl << "Selecting " << typeName << ' ' << modelType << endl;
66 
67  dictionaryConstructorTable::iterator cstrIter =
68  dictionaryConstructorTablePtr_->find(modelType);
69 
70  if (cstrIter == dictionaryConstructorTablePtr_->end())
71  {
73  << "Unknown " << typeName << " type "
74  << modelType << endl << endl
75  << "Valid " << typeName << " types are : " << endl
76  << dictionaryConstructorTablePtr_->sortedToc()
77  << exit(FatalError);
78  }
79 
80  printDictionary print(modelDict);
81 
82  return cstrIter()(popBal, modelDict);
83 }
84 
85 
86 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
87 
89 (
90  const populationBalanceModel& popBal,
91  const dictionary& dict
92 )
93 :
94  popBal_(popBal)
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 
101 {}
102 
103 
104 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:669
Model for tracking the evolution of a dispersed phase size distribution due to coalescence (synonymou...
Base class for breakup models which provide a total breakup rate and a separate daughter size distrib...
Definition: breakupModel.H:56
virtual void precompute()
Pre-compute diameter independent expressions.
Definition: breakupModel.C:100
const populationBalanceModel & popBal() const
Return reference to the populationBalanceModel.
Definition: breakupModel.H:112
breakupModel(const populationBalanceModel &popBal, const dictionary &dict)
Definition: breakupModel.C:89
static autoPtr< breakupModel > New(const populationBalanceModel &popBal, const dictionary &dict)
Definition: breakupModel.C:44
Enables the printing of a dictionary and subsequently looked-up defaulted entries.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
Definition: word.H:63
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
defineTypeNameAndDebug(breakupModel, 0)
defineRunTimeSelectionTable(breakupModel, dictionary)
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:288
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
messageStream Info
Ostream & indentOrNl(Ostream &os)
Indent stream or add newline if indent level == 0.
Definition: Ostream.H:250
error FatalError
dictionary dict