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-------------------------------------------------------------------------------
10License
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
32template<class ParcelType>
34(
35 const MPPICParcel<ParcelType>& p
36)
37:
38 ParcelType(p),
39 UCorrect_(p.UCorrect_)
40{}
41
42
43template<class ParcelType>
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
57template<class ParcelType>
58template<class TrackCloudType>
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// ************************************************************************* //
Wrapper around kinematic parcel types to add MPPIC modelling.
Definition: MPPICParcel.H:80
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:60
virtual void move()=0
U
Definition: pEqn.H:72
volScalarField & p
dynamicFvMesh & mesh
labelList f(nPoints)