packingDispersionModel.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) 2024-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 
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
34 }
35 
36 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37 
39 (
40  const relativeVelocityModel& relativeVelocity
41 )
42 :
43  relativeVelocity_(relativeVelocity),
44  mixture_(relativeVelocity.mixture())
45 {}
46 
47 
48 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
49 
51 (
52  const dictionary& dict,
53  const relativeVelocityModel& relativeVelocity
54 )
55 {
56  if (dict.found(typeName))
57  {
58  const word modelType(dict.lookup(typeName));
59 
61  << "Selecting packing dispersion model " << modelType << endl;
62 
63  dictionaryConstructorTable::iterator cstrIter =
64  dictionaryConstructorTablePtr_->find(modelType);
65 
66  if (cstrIter == dictionaryConstructorTablePtr_->end())
67  {
69  << "Unknown time scale model type " << modelType
70  << ", constructor not in hash table" << nl << nl
71  << " Valid time scale model types are:" << nl
72  << dictionaryConstructorTablePtr_->sortedToc()
73  << abort(FatalIOError);
74  }
75 
77 
78  return
80  (
81  cstrIter()
82  (
83  dict.optionalTypeDict(modelType),
84  relativeVelocity
85  )
86  );
87  }
88  else
89  {
90  return
92  (
93  new packingDispersionModels::none(relativeVelocity)
94  );
95  }
96 }
97 
98 
99 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
100 
102 {}
103 
104 
105 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
106 
109 {
110  const dimensionedScalar& rhod = mixture_.rhod();
111  const dimensionedScalar& rhoc = mixture_.rhoc();
112 
113  return
114  rhod*mixture_.rho()
115  *relativeVelocity_.UdmCoeff()*sigmaPrime()
116  /((rhod - rhoc)*mixture_.alphac()*rhoc);
117 }
118 
119 
120 // ************************************************************************* //
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
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:468
const dictionary & optionalTypeDict(const word &typeName) const
Find and return an optional type sub-dictionary.
Definition: dictionary.C:921
Packing dispersion model.
packingDispersionModel(const relativeVelocityModel &relativeVelocity)
Construct from components.
virtual tmp< volScalarField > Dd() const
Return the diffusion coefficient of the dispersed phase.
virtual ~packingDispersionModel()
Destructor.
static autoPtr< packingDispersionModel > New(const dictionary &dict, const relativeVelocityModel &relativeVelocity)
Enables the printing of a dictionary and subsequently looked-up defaulted entries.
A class for managing temporary objects.
Definition: tmp.H:55
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 FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:346
Namespace for OpenFOAM.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:288
errorManip< error > abort(error &err)
Definition: errorManip.H:131
messageStream Info
defineRunTimeSelectionTable(fvConstraint, dictionary)
IOerror FatalIOError
Ostream & indentOrNl(Ostream &os)
Indent stream or add newline if indent level == 0.
Definition: Ostream.H:250
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
static const char nl
Definition: Ostream.H:297
dictionary dict