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-------------------------------------------------------------------------------
11License
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 (
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,
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// ************************************************************************* //
const uniformDimensionedVectorField & g
label size() const noexcept
The number of elements in table.
Definition: HashTableI.H:52
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
const coalCloud * set(const label i) const
Definition: PtrList.H:138
void setSize(const label newLen)
Same as resize()
Definition: PtrList.H:151
Templated base class for multiphase reacting cloud.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:67
const word & constant() const
Return constant name.
Definition: TimePathsI.H:96
void evolve()
Evolve the cloud collection.
Definition: coalCloudList.C:84
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:290
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
dynamicFvMesh & mesh
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
SLGThermo slgThermo(mesh, thermo)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333