coalCloudList.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) 2012-2018 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 "coalCloudList.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
31 (
32  const volScalarField& rho,
33  const volVectorField& U,
34  const dimensionedVector& g,
35  const SLGThermo& slgThermo
36 )
37 :
39  mesh_(rho.mesh())
40 {
41  IOdictionary props
42  (
43  IOobject
44  (
45  "coalCloudList",
46  mesh_.time().constant(),
47  mesh_,
48  IOobject::MUST_READ
49  )
50  );
51 
52  const wordHashSet cloudNames(wordList(props.lookup("clouds")));
53 
54  setSize(cloudNames.size());
55 
56  label i = 0;
57  forAllConstIter(wordHashSet, cloudNames, iter)
58  {
59  const word& name = iter.key();
60 
61  Info<< "creating cloud: " << name << endl;
62 
63  set
64  (
65  i++,
66  new coalCloud
67  (
68  name,
69  rho,
70  U,
71  g,
72  slgThermo
73  )
74  );
75 
76  Info<< endl;
77  }
78 }
79 
80 
81 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
82 
84 {
85  forAll(*this, i)
86  {
87  operator[](i).evolve();
88  }
89 }
90 
91 
92 // ************************************************************************* //
A HashTable with keys but without contents.
Definition: HashSet.H:59
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
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
void evolve()
Evolve the cloud collection.
Definition: coalCloudList.C:83
const T & operator[](const label) const
Return element const reference.
Definition: UPtrListI.H:103
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
label size() const
Return number of elements in table.
Definition: HashTableI.H:65
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:52
points setSize(newPointi)
A class for handling words, derived from string.
Definition: word.H:59
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
Definition: SLGThermo.H:62
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:29
const Mesh & mesh() const
Return mesh.
ReactingMultiphaseCloud< ReactingCloud< ThermoCloud< KinematicCloud< Cloud< coalParcel > > > > > coalCloud
Definition: coalCloud.H:60
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
List< word > wordList
A List of words.
Definition: fileName.H:54
messageStream Info
coalCloudList(const volScalarField &rho, const volVectorField &U, const dimensionedVector &g, const SLGThermo &slgThermo)
Definition: coalCloudList.C:31
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:576