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-2023 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"
27 #include "viscosityModel.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace functionObjects
35 {
38  (
40  particles,
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_,
64  IOobject::READ_IF_PRESENT,
65  IOobject::NO_WRITE
66  ),
68  ),
69  viscosity_
70  (
71  mesh_.lookupObject<viscosityModel>(physicalProperties::typeName)
72  ),
73  rhoValue_
74  (
75  "rho",
76  dimDensity,
77  viscosity_
78  ),
79  rho_
80  (
81  IOobject
82  (
83  "rho",
84  time_.name(),
85  mesh_
86  ),
87  mesh_,
88  rhoValue_
89  ),
90  mu_("mu", rhoValue_*viscosity_.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_*viscosity_.nu();
135 
136  cloudPtr_->evolve();
137 
138  return true;
139 }
140 
141 
143 {
144  return true;
145 }
146 
147 
148 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Abstract base-class for Time/database functionObjects.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
This functionObject tracks a particle cloud in the specified velocity field of an incompressible flow...
Definition: particles.H:111
virtual ~particles()
Destructor.
Definition: particles.C:115
virtual bool execute()
Track the cloud.
Definition: particles.C:132
virtual bool write()
Write the cloud.
Definition: particles.C:142
particles(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
Definition: particles.C:50
virtual bool read(const dictionary &)
Read the controls.
Definition: particles.C:122
virtual bool read(const dictionary &)
Read optional controls.
Virtual abstract base class for parcel clouds. As parcelCloudBase but with additional virtualisation ...
Definition: parcelCloud.H:57
A base class for physical properties.
An abstract base class for Newtonian viscosity models.
A class for handling words, derived from string.
Definition: word.H:62
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
Namespace for OpenFOAM.
static const zero Zero
Definition: zero.H:97
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
const dimensionSet dimAcceleration
const dimensionSet dimDensity
dictionary dict