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-2024 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 "parcelCloudList.H"
28 #include "viscosityModel.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace functionObjects
36 {
39  (
41  particles,
43  );
44 }
45 }
46 
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
51 (
52  const word& name,
53  const Time& runTime,
54  const dictionary& dict
55 )
56 :
57  fvMeshFunctionObject(name, runTime, dict),
58  g_
59  (
60  IOobject
61  (
62  "g",
63  time_.constant(),
64  mesh_,
65  IOobject::READ_IF_PRESENT,
66  IOobject::NO_WRITE
67  ),
69  ),
70  viscosity_
71  (
72  mesh_.lookupObject<viscosityModel>(physicalProperties::typeName)
73  ),
74  rhoValue_
75  (
76  "rho",
77  dimDensity,
78  viscosity_
79  ),
80  rho_
81  (
82  IOobject
83  (
84  "rho",
85  time_.name(),
86  mesh_
87  ),
88  mesh_,
89  rhoValue_
90  ),
91  mu_("mu", rhoValue_*viscosity_.nu()),
92  U_
93  (
94  mesh_.lookupObject<volVectorField>(dict.lookupOrDefault<word>("U", "U"))
95  ),
96  cloudName_
97  (
98  dict.lookupOrDefault<word>("cloud", parcelCloudList::defaultCloudName)
99  ),
100  cloudPtr_
101  (
103  (
104  cloudName_,
105  rho_,
106  U_,
107  mu_,
108  g_
109  )
110  )
111 {}
112 
113 
114 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
115 
117 {}
118 
119 
120 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
121 
123 (
124  const dictionary& dict
125 )
126 {
128 
129  return true;
130 }
131 
132 
134 {
135  mu_ = rhoValue_*viscosity_.nu();
136 
137  cloudPtr_->evolve();
138 
139  return true;
140 }
141 
142 
144 {
145  return true;
146 }
147 
148 
149 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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...
virtual bool read(const dictionary &)
Read optional controls.
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:116
virtual bool execute()
Track the cloud.
Definition: particles.C:133
virtual bool write()
Write the cloud.
Definition: particles.C:143
particles(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
Definition: particles.C:51
virtual bool read(const dictionary &)
Read the controls.
Definition: particles.C:123
List of parcel clouds, with the same interface as an individual parcel cloud. This is the object that...
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
const dimensionSet dimAcceleration
const dimensionSet dimDensity
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
dictionary dict