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 :
41  PtrList<coalCloud>(),
42  mesh_(rho.mesh())
43 {
44  IOdictionary props
45  (
46  IOobject
47  (
48  "coalCloudList",
49  mesh_.time().constant(),
50  mesh_,
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 
78  }
79 }
80 
81 
82 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
83 
85 {
86  forAll(*this, i)
87  {
88  operator[](i).evolve();
89  }
90 }
91 
92 
93 // ************************************************************************* //
SLGThermo slgThermo(mesh, thermo)
void evolve()
Evolve the cloud collection.
Definition: coalCloudList.C:77
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:360
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:50
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
label size() const noexcept
The number of elements in table.
Definition: HashTable.H:342
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
A class for handling words, derived from Foam::string.
Definition: word.H:63
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
Definition: SLGThermo.H:60
const uniformDimensionedVectorField & g
const word & constant() const noexcept
Return constant name.
Definition: TimePathsI.H:112
void setSize(const label newLen)
Same as resize()
Definition: PtrList.H:337
ReactingMultiphaseCloud< ReactingCloud< ThermoCloud< KinematicCloud< Cloud< coalParcel > > > > > coalCloud
Definition: coalCloud.H:56
U
Definition: pEqn.H:72
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
Cloud class to introduce coal parcels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
coalCloudList(const volScalarField &rho, const volVectorField &U, const dimensionedVector &g, const SLGThermo &slgThermo)
Definition: coalCloudList.C:27
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172