coalCloudList.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) 2012 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
29 #include "coalCloudList.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
34 (
35  const volScalarField& rho,
36  const volVectorField& U,
37  const dimensionedVector& g,
38  const SLGThermo& slgThermo
39 )
40 :
42  mesh_(rho.mesh())
43 {
44  IOdictionary props
45  (
46  IOobject
47  (
48  "coalCloudList",
49  mesh_.time().constant(),
50  mesh_,
51  IOobject::MUST_READ
52  )
53  );
54 
55  const wordHashSet cloudNames(props.get<wordList>("clouds"));
56 
57  setSize(cloudNames.size());
58 
59  label i = 0;
60  for (const word& name : cloudNames)
61  {
62  Info<< "creating cloud: " << name << endl;
63 
64  set
65  (
66  i++,
67  new coalCloud
68  (
69  name,
70  rho,
71  U,
72  g,
73  slgThermo
74  )
75  );
76 
77  Info<< endl;
78  }
79 }
80 
81 
82 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
83 
85 {
86  forAll(*this, i)
87  {
88  operator[](i).evolve();
89  }
90 }
91 
92 
93 // ************************************************************************* //
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
setSize
points setSize(newPointi)
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::BitOps::set
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Definition: BitOps.C:37
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::SLGThermo
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:64
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:107
coalCloudList.H
Foam::HashSet< word, Hash< word > >
rho
rho
Definition: readInitialConditions.H:88
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::PtrList< coalCloud >
Foam::dimensioned< vector >
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
U
U
Definition: pEqn.H:72
Foam::coalCloudList::evolve
void evolve()
Evolve the cloud collection.
Definition: coalCloudList.C:84
slgThermo
SLGThermo slgThermo(mesh, thermo)
Foam::List< word >
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::ReactingMultiphaseCloud
Templated base class for multiphase reacting cloud.
Definition: ReactingMultiphaseCloud.H:68
Foam::coalCloudList::coalCloudList
coalCloudList(const volScalarField &rho, const volVectorField &U, const dimensionedVector &g, const SLGThermo &slgThermo)
Definition: coalCloudList.C:34