OpenFOAM: API Guide
v2112
The open source CFD toolbox
CollidingParcel.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) 2011-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 "
CollidingParcel.H
"
29
30
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31
32
template
<
class
ParcelType>
33
Foam::CollidingParcel<ParcelType>::CollidingParcel
34
(
35
const
CollidingParcel<ParcelType>&
p
36
)
37
:
38
ParcelType(
p
),
39
f_(
p
.f_),
40
angularMomentum_(
p
.angularMomentum_),
41
torque_(
p
.torque_),
42
collisionRecords_(
p
.collisionRecords_)
43
{}
44
45
46
template
<
class
ParcelType>
47
Foam::CollidingParcel<ParcelType>::CollidingParcel
48
(
49
const
CollidingParcel<ParcelType>&
p
,
50
const
polyMesh&
mesh
51
)
52
:
53
ParcelType(
p
,
mesh
),
54
f_(
p
.f_),
55
angularMomentum_(
p
.angularMomentum_),
56
torque_(
p
.torque_),
57
collisionRecords_(
p
.collisionRecords_)
58
{}
59
60
61
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62
63
template
<
class
ParcelType>
64
template
<
class
TrackCloudType>
65
bool
Foam::CollidingParcel<ParcelType>::move
66
(
67
TrackCloudType&
cloud
,
68
trackingData
& td,
69
const
scalar trackTime
70
)
71
{
72
typename
TrackCloudType::parcelType&
p
=
73
static_cast<
typename TrackCloudType::parcelType&
>
(*this);
74
75
td.keepParticle =
true
;
76
td.switchProcessor =
false
;
77
78
switch
(td.part())
79
{
80
case
trackingData::tpVelocityHalfStep:
81
{
82
// First and last leapfrog velocity adjust part, required
83
// before and after tracking and force calculation
84
85
p
.U() += 0.5*trackTime*
p
.f()/
p
.mass();
86
87
p
.angularMomentum() += 0.5*trackTime*
p
.torque();
88
89
td.keepParticle =
true
;
90
td.switchProcessor =
false
;
91
92
break
;
93
}
94
95
case
trackingData::tpLinearTrack:
96
{
97
ParcelType::move
(
cloud
, td, trackTime);
98
99
break
;
100
}
101
102
case
trackingData::tpRotationalTrack:
103
{
104
NotImplemented
;
105
106
break
;
107
}
108
109
default
:
110
{
111
FatalErrorInFunction
112
<< td.part() <<
" is an invalid part of the tracking method."
113
<<
abort
(
FatalError
);
114
}
115
}
116
117
return
td.keepParticle;
118
}
119
120
121
template
<
class
ParcelType>
122
void
Foam::CollidingParcel<ParcelType>::transformProperties
(
const
tensor
&
T
)
123
{
124
ParcelType::transformProperties
(
T
);
125
126
f_ =
transform
(
T
, f_);
127
128
angularMomentum_ =
transform
(
T
, angularMomentum_);
129
130
torque_ =
transform
(
T
, torque_);
131
}
132
133
134
template
<
class
ParcelType>
135
void
Foam::CollidingParcel<ParcelType>::transformProperties
136
(
137
const
vector
& separation
138
)
139
{
140
ParcelType::transformProperties
(separation);
141
}
142
143
144
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
145
146
#include "
CollidingParcelIO.C
"
147
148
// ************************************************************************* //
CollidingParcelIO.C
CollidingParcel.H
Foam::CollidingParcel
Wrapper around kinematic parcel types to add collision modelling.
Definition:
CollidingParcel.H:80
Foam::CollidingParcel::transformProperties
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
Definition:
CollidingParcel.C:122
Foam::Tensor< scalar >
Foam::Vector< scalar >
Foam::cloud
A cloud is a registry collection of lagrangian particles.
Definition:
cloud.H:60
Foam::engineMesh::move
virtual void move()=0
Foam::externalPointEdgePoint::trackingData
Class used to pass data into container.
Definition:
externalPointEdgePoint.H:102
Foam::particle::transformProperties
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
Definition:
particle.C:1072
p
volScalarField & p
Definition:
createFieldRefs.H:8
T
const volScalarField & T
Definition:
createFieldRefs.H:2
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:6
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition:
error.H:517
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition:
error.H:453
Foam::transform
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition:
dimensionSet.C:536
Foam::abort
errorManip< error > abort(error &err)
Definition:
errorManip.H:144
Foam::FatalError
error FatalError
src
lagrangian
intermediate
parcels
Templates
CollidingParcel
CollidingParcel.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.