Rebound.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 Copyright (C) 2016 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "Rebound.H"
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
33template<class CloudType>
35(
36 const dictionary& dict,
38)
39:
41 UFactor_(this->coeffDict().getScalar("UFactor"))
42{}
43
44
45template<class CloudType>
47:
49 UFactor_(pim.UFactor_)
50{}
51
52
53// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
54
55template<class CloudType>
57(
58 typename CloudType::parcelType& p,
59 const polyPatch& pp,
60 bool& keepParticle
61)
62{
63 vector& U = p.U();
64
65 keepParticle = true;
66 p.active(true);
67
68 vector nw;
69 vector Up;
70
71 this->owner().patchData(p, pp, nw, Up);
72
73 // Calculate motion relative to patch velocity
74 U -= Up;
75
76 scalar Un = U & nw;
77
78 if (Un > 0.0)
79 {
80 U -= UFactor_*2.0*Un*nw;
81 }
82
83 // Return velocity to global space
84 U += Up;
85
86 return true;
87}
88
89
90// ************************************************************************* //
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Templated patch interaction model class.
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Simple rebound patch interaction model.
Definition: Rebound.H:53
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:60
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
U
Definition: pEqn.H:72
volScalarField & p
dictionary dict