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 | Copyright (C) 2013-2014 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 "MPPICParcel.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class ParcelType>
32 (
33  const MPPICParcel<ParcelType>& p
34 )
35 :
36  ParcelType(p),
37  UCorrect_(p.UCorrect_)
38 {}
39 
40 
41 template<class ParcelType>
43 (
44  const MPPICParcel<ParcelType>& p,
45  const polyMesh& mesh
46 )
47 :
48  ParcelType(p, mesh),
50 {}
51 
52 
53 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
54 
55 template<class ParcelType>
56 template<class TrackData>
58 (
59  TrackData& td,
60  const scalar trackTime
61 )
62 {
63  typename TrackData::cloudType::parcelType& p =
64  static_cast<typename TrackData::cloudType::parcelType&>(*this);
65 
66  switch (td.part())
67  {
68  case TrackData::tpLinearTrack:
69  {
70  ParcelType::move(td, trackTime);
71 
72  break;
73  }
74  case TrackData::tpDampingNoTrack:
75  {
76  p.UCorrect() =
77  td.cloud().dampingModel().velocityCorrection(p, trackTime);
78 
79  td.keepParticle = true;
80 
81  break;
82  }
83  case TrackData::tpPackingNoTrack:
84  {
85  p.UCorrect() =
86  td.cloud().packingModel().velocityCorrection(p, trackTime);
87 
88  td.keepParticle = true;
89 
90  break;
91  }
92  case TrackData::tpCorrectTrack:
93  {
94  vector U = p.U();
95 
96  scalar f = p.stepFraction();
97 
98  scalar a = p.age();
99 
100  p.U() = (1.0 - f)*p.UCorrect();
101 
102  ParcelType::move(td, trackTime);
103 
104  p.U() = U + (p.stepFraction() - f)*p.UCorrect();
105 
106  p.age() = a;
107 
108  break;
109  }
110  }
111 
112  return td.keepParticle;
113 }
114 
115 
116 // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
117 
118 #include "MPPICParcelIO.C"
119 
120 // ************************************************************************* //
labelList f(nPoints)
MPPICParcel(const polyMesh &mesh, const vector &position, const label cellI, const label tetFaceI, const label tetPtI)
Construct from owner, position, and cloud owner.
Definition: MPPICParcelI.H:30
dynamicFvMesh & mesh
bool move(TrackData &td, const scalar trackTime)
Move the parcel.
Definition: MPPICParcel.C:58
volScalarField & p
Definition: createFields.H:51
vector UCorrect_
Velocity correction due to collisions [m/s].
Definition: MPPICParcel.H:163
U
Definition: pEqn.H:82