particles.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) 2016-2020 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 "particles.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace functionObjects
35 {
36  defineTypeNameAndDebug(particles, 0);
38  (
39  functionObject,
40  particles,
41  dictionary
42  );
43 }
44 }
45 
46 
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 
50 (
51  const word& name,
52  const Time& runTime,
53  const dictionary& dict
54 )
55 :
56  fvMeshFunctionObject(name, runTime, dict),
57  g_
58  (
59  IOobject
60  (
61  "g",
62  time_.constant(),
63  mesh_,
66  ),
68  ),
69  laminarTransport_
70  (
71  mesh_.lookupObject<singlePhaseTransportModel>("transportProperties")
72  ),
73  rhoValue_
74  (
75  "rho",
76  dimDensity,
77  laminarTransport_
78  ),
79  rho_
80  (
81  IOobject
82  (
83  "rho",
84  time_.timeName(),
85  mesh_
86  ),
87  mesh_,
88  rhoValue_
89  ),
90  mu_("mu", rhoValue_*laminarTransport_.nu()),
91  U_
92  (
93  mesh_.lookupObject<volVectorField>(dict.lookupOrDefault<word>("U", "U"))
94  ),
95  cloudName_
96  (
97  dict.lookupOrDefault<word>("cloud", "cloud")
98  ),
99  cloudPtr_
100  (
102  (
103  cloudName_,
104  rho_,
105  U_,
106  mu_,
107  g_
108  )
109  )
110 {}
111 
112 
113 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
114 
116 {}
117 
118 
119 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
120 
122 (
123  const dictionary& dict
124 )
125 {
127 
128  return true;
129 }
130 
131 
133 {
134  mu_ = rhoValue_*laminarTransport_.nu();
135 
136  cloudPtr_->evolve();
137 
138  return true;
139 }
140 
141 
143 {
144  return true;
145 }
146 
147 
148 // ************************************************************************* //
virtual bool write()
Write the cloud.
Definition: particles.C:142
static autoPtr< parcelCloud > New(const word &name, const volScalarField &rho, const volVectorField &U, const volScalarField &mu, const dimensionedVector &g)
Selectors.
virtual bool read(const dictionary &)
Read the controls.
Definition: particles.C:122
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
Macros for easy insertion into run-time selection tables.
virtual ~particles()
Destructor.
Definition: particles.C:115
virtual bool read(const dictionary &)
Read optional controls.
const dimensionSet dimAcceleration
A class for handling words, derived from string.
Definition: word.H:59
const dimensionSet dimDensity
static const zero Zero
Definition: zero.H:97
virtual bool execute()
Track the cloud.
Definition: particles.C:132
defineTypeNameAndDebug(Qdot, 0)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
particles(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
Definition: particles.C:50
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
A simple single-phase transport model based on viscosityModel.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.