ParticleTrap.H
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) 2012-2017 OpenFOAM Foundation
9 Copyright (C) 2020 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
27Class
28 Foam::ParticleTrap
29
30Group
31 grpLagrangianIntermediateFunctionObjects
32
33Description
34 Traps particles within a given phase fraction for multi-phase cases.
35
36 Model is activated using:
37 \verbatim
38 particleTrap1
39 {
40 type particleTrap;
41 alphaName alpha; // name volume fraction field
42 threshold 0.95; // alpha value below which model is active
43 }
44 \endverbatim
45
46
47SourceFiles
48 ParticleTrap.C
49
50\*---------------------------------------------------------------------------*/
51
52#ifndef ParticleTrap_H
53#define ParticleTrap_H
54
55#include "CloudFunctionObject.H"
56#include "volFields.H"
57
58// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59
60namespace Foam
61{
62
63/*---------------------------------------------------------------------------*\
64 Class ParticleTrap Declaration
65\*---------------------------------------------------------------------------*/
66
67template<class CloudType>
68class ParticleTrap
69:
70 public CloudFunctionObject<CloudType>
71{
72 // Private Data
73
74 // Typedefs
75
76 //- Convenience typedef for parcel type
77 typedef typename CloudType::parcelType parcelType;
78
79
80 //- Name of vol fraction field
81 const word alphaName_;
82
83 //- Pointer to the volume fraction field
84 const volScalarField* alphaPtr_;
85
86 //- Gradient of the volume fraction field
87 autoPtr<volVectorField> gradAlphaPtr_;
88
89 //- Threshold beyond which model is active
90 scalar threshold_;
91
92
93public:
94
95 //- Runtime type information
96 TypeName("particleTrap");
97
98
99 // Constructors
100
101 //- Construct from dictionary
103 (
104 const dictionary& dict,
106 const word& modelName
107 );
108
109 //- Construct copy
111
112 //- Construct and return a clone
114 {
116 (
117 new ParticleTrap<CloudType>(*this)
118 );
119 }
120
121
122 //- Destructor
123 virtual ~ParticleTrap() = default;
124
125
126 // Member Functions
127
128 // Evaluation
129
130 //- Pre-evolve hook
131 virtual void preEvolve
132 (
133 const typename parcelType::trackingData& td
134 );
135
136 //- Post-evolve hook
137 virtual void postEvolve
138 (
139 const typename parcelType::trackingData& td
140 );
141
142 //- Post-move hook
143 virtual void postMove
144 (
145 parcelType& p,
146 const scalar dt,
147 const point& position0,
148 bool& keepParticle
149 );
150};
151
152
153// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154
155} // End namespace Foam
156
157// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
159#ifdef NoRepository
160 #include "ParticleTrap.C"
161#endif
162
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165#endif
166
167// ************************************************************************* //
Templated cloud function object base class.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Traps particles within a given phase fraction for multi-phase cases.
Definition: ParticleTrap.H:70
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
Definition: ParticleTrap.H:112
virtual void postMove(parcelType &p, const scalar dt, const point &position0, bool &keepParticle)
Post-move hook.
Definition: ParticleTrap.C:107
virtual ~ParticleTrap()=default
Destructor.
virtual void postEvolve(const typename parcelType::trackingData &td)
Post-evolve hook.
Definition: ParticleTrap.C:97
virtual void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve hook.
Definition: ParticleTrap.C:71
TypeName("particleTrap")
Runtime type information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Class used to pass data into container.
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:107
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73