OpenFOAM: API Guide
v2112
The open source CFD toolbox
MPPICParcel.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) 2013-2017 OpenFOAM Foundation
9
-------------------------------------------------------------------------------
10
License
11
This file is part of OpenFOAM.
12
13
OpenFOAM is free software: you can redistribute it and/or modify it
14
under the terms of the GNU General Public License as published by
15
the Free Software Foundation, either version 3 of the License, or
16
(at your option) any later version.
17
18
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21
for more details.
22
23
You should have received a copy of the GNU General Public License
24
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26
\*---------------------------------------------------------------------------*/
27
28
#include "
MPPICParcel.H
"
29
30
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31
32
template
<
class
ParcelType>
33
Foam::MPPICParcel<ParcelType>::MPPICParcel
34
(
35
const
MPPICParcel<ParcelType>&
p
36
)
37
:
38
ParcelType(
p
),
39
UCorrect_(
p
.UCorrect_)
40
{}
41
42
43
template
<
class
ParcelType>
44
Foam::MPPICParcel<ParcelType>::MPPICParcel
45
(
46
const
MPPICParcel<ParcelType>&
p
,
47
const
polyMesh&
mesh
48
)
49
:
50
ParcelType(
p
,
mesh
),
51
UCorrect_(
p
.UCorrect_)
52
{}
53
54
55
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
56
57
template
<
class
ParcelType>
58
template
<
class
TrackCloudType>
59
bool
Foam::MPPICParcel<ParcelType>::move
60
(
61
TrackCloudType&
cloud
,
62
trackingData
& td,
63
const
scalar trackTime
64
)
65
{
66
typename
TrackCloudType::parcelType&
p
=
67
static_cast<
typename TrackCloudType::parcelType&
>
(*this);
68
69
td.switchProcessor =
false
;
70
71
switch
(td.
part
())
72
{
73
case
trackingData::tpLinearTrack:
74
{
75
ParcelType::move(
cloud
, td, trackTime);
76
77
break
;
78
}
79
case
trackingData::tpDampingNoTrack:
80
{
81
p
.UCorrect() =
82
cloud
.dampingModel().velocityCorrection(
p
, trackTime);
83
84
td.keepParticle =
true
;
85
td.switchProcessor =
false
;
86
87
break
;
88
}
89
case
trackingData::tpPackingNoTrack:
90
{
91
p
.UCorrect() =
92
cloud
.packingModel().velocityCorrection(
p
, trackTime);
93
94
td.keepParticle =
true
;
95
td.switchProcessor =
false
;
96
97
break
;
98
}
99
case
trackingData::tpCorrectTrack:
100
{
101
vector
U
=
p
.U();
102
103
scalar
f
=
p
.stepFraction();
104
105
scalar a =
p
.age();
106
107
p
.U() = (1.0 -
f
)*
p
.UCorrect();
108
109
ParcelType::move(
cloud
, td, trackTime);
110
111
p
.U() =
U
+ (
p
.stepFraction() -
f
)*
p
.UCorrect();
112
113
p
.age() = a;
114
115
break
;
116
}
117
}
118
119
return
td.keepParticle;
120
}
121
122
123
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
124
125
#include "
MPPICParcelIO.C
"
126
127
// ************************************************************************* //
p
volScalarField & p
Definition:
createFieldRefs.H:8
Foam::KinematicParcel::U
const vector & U() const
Return const access to velocity.
Definition:
KinematicParcelI.H:231
Foam::MPPICParcel::trackingData::part
trackPart part() const
Access.
Definition:
MPPICParcelTrackingDataI.H:249
Foam::MPPICParcel::trackingData
Definition:
MPPICParcel.H:87
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:6
Foam::KinematicParcel::UCorrect_
vector UCorrect_
Velocity correction due to collisions MPPIC [m/s].
Definition:
KinematicParcel.H:336
MPPICParcel.H
Foam::MPPICParcel::move
bool move(TrackCloudType &cloud, trackingData &td, const scalar trackTime)
Move the parcel.
Definition:
MPPICParcel.C:60
Foam::cloud
A cloud is a registry collection of lagrangian particles.
Definition:
cloud.H:57
U
U
Definition:
pEqn.H:72
MPPICParcelIO.C
f
labelList f(nPoints)
Foam::KinematicParcel::trackingData::tpLinearTrack
Definition:
KinematicParcel.H:172
Foam::Vector< scalar >
Foam::MPPICParcel::MPPICParcel
MPPICParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, coordinates and topology.
Definition:
MPPICParcelI.H:32
src
lagrangian
intermediate
parcels
Templates
MPPICParcel
MPPICParcel.C
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.