OpenFOAM
8
The OpenFOAM Foundation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
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
"
27
#include "
singlePhaseTransportModel.H
"
28
#include "
addToRunTimeSelectionTable.H
"
29
30
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31
32
namespace
Foam
33
{
34
namespace
functionObjects
35
{
36
defineTypeNameAndDebug
(particles, 0);
37
addToRunTimeSelectionTable
38
(
39
functionObject,
40
particles,
41
dictionary
42
);
43
}
44
}
45
46
47
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48
49
Foam::functionObjects::particles::particles
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
),
67
dimensionedVector
(
dimAcceleration
,
Zero
)
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
kinematicCloudName_
96
(
97
dict.
lookupOrDefault
<
word
>(
"kinematicCloud"
,
"kinematicCloud"
)
98
),
99
kinematicCloud_
100
(
101
kinematicCloudName_,
102
rho_,
103
U_,
104
mu_,
105
g_
106
)
107
{}
108
109
110
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
111
112
Foam::functionObjects::particles::~particles
()
113
{}
114
115
116
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
117
118
bool
Foam::functionObjects::particles::read
119
(
120
const
dictionary
& dict
121
)
122
{
123
fvMeshFunctionObject::read
(dict);
124
125
return
true
;
126
}
127
128
129
bool
Foam::functionObjects::particles::execute
()
130
{
131
mu_ = rhoValue_*laminarTransport_.nu();
132
kinematicCloud_.evolve();
133
134
return
true
;
135
}
136
137
138
bool
Foam::functionObjects::particles::write
()
139
{
140
return
true
;
141
}
142
143
144
// ************************************************************************* //
Foam::functionObjects::particles::write
virtual bool write()
Write the cloud.
Definition:
particles.C:138
Foam::functionObjects::particles::read
virtual bool read(const dictionary &)
Read the controls.
Definition:
particles.C:119
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition:
dictionary.H:158
Foam::functionObjects::addToRunTimeSelectionTable
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
Foam::IOobject::READ_IF_PRESENT
Definition:
IOobject.H:114
Foam::dimensionedVector
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Definition:
dimensionedVector.H:48
Foam::IOobject::NO_WRITE
Definition:
IOobject.H:122
Foam::GeometricField< vector, fvPatchField, volMesh >
particles.H
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition:
Time.H:68
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::functionObjects::particles::~particles
virtual ~particles()
Destructor.
Definition:
particles.C:112
Foam::functionObjects::regionFunctionObject::read
virtual bool read(const dictionary &)
Read optional controls.
Definition:
regionFunctionObject.C:133
Foam::dimAcceleration
const dimensionSet dimAcceleration
Foam::word
A class for handling words, derived from string.
Definition:
word.H:59
Foam::Zero
static const zero Zero
Definition:
zero.H:97
Foam::functionObjects::particles::execute
virtual bool execute()
Track the cloud.
Definition:
particles.C:129
Foam::functionObjects::defineTypeNameAndDebug
defineTypeNameAndDebug(Qdot, 0)
Foam::dimDensity
const dimensionSet dimDensity
Foam::dictionary::lookupOrDefault
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Definition:
dictionaryTemplates.C:57
Foam::functionObjects::particles::particles
particles(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
Definition:
particles.C:50
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition:
fvMeshFunctionObject.H:62
Foam::singlePhaseTransportModel
A simple single-phase transport model based on viscosityModel.
Definition:
singlePhaseTransportModel.H:55
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition:
IOobject.H:92
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.H:213
singlePhaseTransportModel.H
src
functionObjects
lagrangian
particles
particles.C
Generated by
1.8.13