shapeModel.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) 2019-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 "shapeModel.H"
27 #include "populationBalanceModel.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace populationBalance
34 {
37 }
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 (
45  const populationBalanceModel& popBal
46 )
47 :
48  popBal_(popBal)
49 {}
50 
51 
52 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
53 
56 (
57  const dictionary& dict,
58  const populationBalanceModel& popBal
59 )
60 {
61  const bool haveModelDict = dict.isDict(typeName);
62 
63  word modelType;
64  const dictionary* modelDictPtr = nullptr;
65  if (haveModelDict)
66  {
67  modelDictPtr = &dict.subDict(typeName);
68  modelType = modelDictPtr->lookup<word>("type");
69  }
70  else
71  {
72  modelType = dict.lookup<word>(typeName);
73  modelDictPtr = &dict.optionalTypeDict(modelType);
74  }
75  const dictionary& modelDict = *modelDictPtr;
76 
77  Info<< indentOrNl << "Selecting " << typeName << ' ' << modelType << endl;
78 
79  dictionaryConstructorTable::iterator cstrIter =
80  dictionaryConstructorTablePtr_->find(modelType);
81 
82  if (cstrIter == dictionaryConstructorTablePtr_->end())
83  {
85  << "Unknown " << typeName << " type "
86  << modelType << endl << endl
87  << "Valid " << typeName << " types are : " << endl
88  << dictionaryConstructorTablePtr_->sortedToc()
89  << exit(FatalError);
90  }
91 
92  printDictionary print(modelDict);
93 
94  return cstrIter()(modelDict, popBal);
95 }
96 
97 
98 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
99 
101 {}
102 
103 
104 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
105 
108 {
109  return popBal_;
110 }
111 
112 
114 {}
115 
116 
118 {}
119 
120 
122 (
124  const label i,
125  const label j,
126  const label k
127 )
128 {}
129 
130 
132 (
134  const label i,
135  const label j
136 )
137 {}
138 
139 
141 {}
142 
143 
144 // ************************************************************************* //
label k
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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 modelling the shape of the particles belonging to a size class through alternative dia...
Definition: shapeModel.H:59
static autoPtr< shapeModel > New(const dictionary &dict, const populationBalanceModel &popBal)
Definition: shapeModel.C:56
virtual void correct()
Correct the shape.
Definition: shapeModel.C:117
virtual void addCoalescence(const volScalarField::Internal &Su, const label i, const label j, const label k)
Add coalescence contribution to secondary property source.
Definition: shapeModel.C:122
shapeModel(const populationBalanceModel &popBal)
Construct from a population balance model.
Definition: shapeModel.C:44
const populationBalanceModel & popBal() const
Return reference to the population balance model.
Definition: shapeModel.C:107
virtual void reset()
Reset secondary property source.
Definition: shapeModel.C:140
virtual void addBreakup(const volScalarField::Internal &Su, const label i, const label j)
Add breakup contribution to secondary property source.
Definition: shapeModel.C:132
virtual ~shapeModel()
Destructor.
Definition: shapeModel.C:100
virtual void solve()
Solve equations.
Definition: shapeModel.C:113
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
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
Definition: fvcSup.C:44
defineTypeNameAndDebug(breakupModel, 0)
defineRunTimeSelectionTable(breakupModel, dictionary)
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: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