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 | Copyright (C) 2012-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 Class
25  Foam::ParticleTrap
26 
27 Description
28  Traps particles within a given phase fraction for multi-phase cases
29 
30  Model is activated using:
31 
32  particleTrap1
33  {
34  type particleTrap;
35  alphaName alpha; // name volume fraction field
36  threshold 0.95; // alpha value below which model is active
37  }
38 
39 
40 SourceFiles
41  ParticleTrap.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef ParticleTrap_H
46 #define ParticleTrap_H
47 
48 #include "CloudFunctionObject.H"
49 #include "volFields.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class ParticleTrap Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class CloudType>
61 class ParticleTrap
62 :
63  public CloudFunctionObject<CloudType>
64 {
65  // Private Data
66 
67  // Typedefs
68 
69  //- Convenience typedef for parcel type
70  typedef typename CloudType::parcelType parcelType;
71 
72 
73  //- Name of vol fraction field
74  const word alphaName_;
75 
76  //- Pointer to the volume fraction field
78 
79  //- Gradient of the volume fraction field
81 
82  //- Threshold beyond which model is active
83  scalar threshold_;
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("particleTrap");
90 
91 
92  // Constructors
93 
94  //- Construct from dictionary
96  (
97  const dictionary& dict,
99  const word& modelName
100  );
101 
102  //- Construct copy
104 
105  //- Construct and return a clone
107  {
109  (
110  new ParticleTrap<CloudType>(*this)
111  );
112  }
113 
114 
115  //- Destructor
116  virtual ~ParticleTrap();
117 
118 
119  // Member Functions
120 
121  // Evaluation
122 
123  //- Pre-evolve hook
124  virtual void preEvolve();
125 
126  //- Post-evolve hook
127  virtual void postEvolve();
128 
129  //- Post-move hook
130  virtual void postMove
131  (
132  typename CloudType::parcelType& p,
133  const label cellI,
134  const scalar dt,
135  const point& position0,
136  bool& keepParticle
137  );
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #ifdef NoRepository
148 # include "ParticleTrap.C"
149 #endif
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
volFields.H
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::ParticleTrap::TypeName
TypeName("particleTrap")
Runtime type information.
Foam::ParticleTrap::clone
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
Definition: ParticleTrap.H:105
Foam::ParticleTrap
Traps particles within a given phase fraction for multi-phase cases.
Definition: ParticleTrap.H:60
Foam::ParticleTrap::postEvolve
virtual void postEvolve()
Post-evolve hook.
Definition: ParticleTrap.C:97
Foam::CloudSubModelBase::owner
const CloudType & owner() const
Return const access to the owner cloud.
Definition: CloudSubModelBase.C:103
Foam::subModelBase::modelName
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
Foam::ParticleTrap::gradAlphaPtr_
autoPtr< volVectorField > gradAlphaPtr_
Gradient of the volume fraction field.
Definition: ParticleTrap.H:79
CloudFunctionObject.H
Foam::ParticleTrap::~ParticleTrap
virtual ~ParticleTrap()
Destructor.
Definition: ParticleTrap.C:67
Foam::ParticleTrap::parcelType
CloudType::parcelType parcelType
Convenience typedef for parcel type.
Definition: ParticleTrap.H:69
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::subModelBase::dict
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::ParticleTrap::alphaPtr_
const volScalarField * alphaPtr_
Pointer to the volume fraction field.
Definition: ParticleTrap.H:76
Foam::ParticleTrap::postMove
virtual void postMove(typename CloudType::parcelType &p, const label cellI, const scalar dt, const point &position0, bool &keepParticle)
Post-move hook.
Definition: ParticleTrap.C:105
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::Vector< scalar >
Foam::ParticleTrap::alphaName_
const word alphaName_
Name of vol fraction field.
Definition: ParticleTrap.H:73
Foam::CloudFunctionObject
Templated cloud function object base class.
Definition: CloudFunctionObject.H:56
Foam::ParticleTrap::threshold_
scalar threshold_
Threshold beyond which model is active.
Definition: ParticleTrap.H:82
ParticleTrap.C
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::ParticleTrap::preEvolve
virtual void preEvolve()
Pre-evolve hook.
Definition: ParticleTrap.C:74
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::ParticleTrap::ParticleTrap
ParticleTrap(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: ParticleTrap.C:33