ParticleStressModel.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 | Copyright (C) 2013-2015 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 "ParticleStressModel.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32  defineTypeNameAndDebug(ParticleStressModel, 0);
33  defineRunTimeSelectionTable(ParticleStressModel, dictionary);
34 }
35 
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
40 (
41  const dictionary& dict
42 )
43 :
44  alphaPacked_(readScalar(dict.lookup("alphaPacked")))
45 {
46 }
47 
48 
50 (
51  const ParticleStressModel& cm
52 )
53 :
54  alphaPacked_(cm.alphaPacked_)
55 {
56 }
57 
58 
59 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
60 
62 (
63  const dictionary& dict
64 )
65 {
66  word modelType(dict.lookup("type"));
67 
68  Info<< "Selecting particle stress model " << modelType << endl;
69 
70  dictionaryConstructorTable::iterator cstrIter =
71  dictionaryConstructorTablePtr_->find(modelType);
72 
73  if (cstrIter == dictionaryConstructorTablePtr_->end())
74  {
76  << "Unknown particle stress model type " << modelType
77  << ", constructor not in hash table" << nl << nl
78  << " Valid particle stress model types are:" << nl
79  << dictionaryConstructorTablePtr_->sortedToc()
80  << abort(FatalError);
81  }
82 
83  return autoPtr<ParticleStressModel>(cstrIter()(dict));
84 }
85 
86 
87 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
88 
90 {}
91 
92 
93 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94 
96 {
97  return alphaPacked_;
98 }
99 
100 
103 (
106  const FieldField<Field, scalar>& uRms
107 ) const
108 {
110  (
111  new FieldField<Field, scalar>(alpha.size())
112  );
113 
114  forAll(alpha, i)
115  {
116  value->set(i, tau(alpha[i], rho[i], uRms[i]));
117  }
118 
119  return value;
120 }
121 
122 
123 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::FieldField
Generic field type.
Definition: FieldField.H:51
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::ParticleStressModel::~ParticleStressModel
virtual ~ParticleStressModel()
Destructor.
Definition: ParticleStressModel.C:89
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:216
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::ParticleStressModel::alphaPacked_
scalar alphaPacked_
Close pack volume fraction.
Definition: ParticleStressModel.H:66
Foam::ParticleStressModel::tau
virtual tmp< Field< scalar > > tau(const Field< scalar > &alpha, const Field< scalar > &rho, const Field< scalar > &uRms) const =0
Collision stress.
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::ParticleStressModel::alphaPacked
scalar alphaPacked() const
Member Functions.
Definition: ParticleStressModel.C:95
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:131
readScalar
#define readScalar
Definition: doubleScalar.C:38
rho
rho
Definition: pEqn.H:3
Foam::autoPtr< Foam::ParticleStressModel >
Foam::ParticleStressModel::New
static autoPtr< ParticleStressModel > New(const dictionary &dict)
Selector.
Definition: ParticleStressModel.C:62
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::ParticleStressModel
Base class for inter-particle stress models.
Definition: ParticleStressModel.H:51
Foam::ParticleStressModel::ParticleStressModel
ParticleStressModel(const dictionary &dict)
Constructors.
Definition: ParticleStressModel.C:40
ParticleStressModel.H
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)