SurfaceFilmModel.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) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
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 Class
27  Foam::SurfaceFilmModel
28 
29 Group
30  grpLagrangianIntermediateSurfaceFilmSubModels
31 
32 Description
33  Templated wall surface film model class.
34 
35 SourceFiles
36  SurfaceFilmModel.C
37  SurfaceFilmModelNew.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef SurfaceFilmModel_H
42 #define SurfaceFilmModel_H
43 
44 #include "IOdictionary.H"
45 #include "autoPtr.H"
46 #include "runTimeSelectionTables.H"
47 #include "CloudSubModelBase.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 // Forward declaration of classes
55 namespace regionModels
56 {
57  namespace surfaceFilmModels
58  {
60  }
61 }
62 
63 /*---------------------------------------------------------------------------*\
64  Class SurfaceFilmModel Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 template<class CloudType>
68 class SurfaceFilmModel
69 :
70  public CloudSubModelBase<CloudType>
71 {
72 protected:
73 
74  // Protected data
75 
76  //- Convenience typedef to the cloud's parcel type
77  typedef typename CloudType::parcelType parcelType;
78 
79  //- Gravitational acceleration constant
80  const dimensionedVector& g_;
81 
82  //- Ejected parcel type label - id assigned to identify parcel for
83  // post-processing. If not specified, defaults to originating cloud
84  // type
85  label ejectedParcelType_;
86 
87 
88  // Cached injector fields per film patch
89 
90  //- Parcel mass / patch face
92 
93  //- Parcel diameter / patch face
95 
96  //- Film velocity / patch face
98 
99  //- Film density / patch face
101 
102  //- Film height of all film patches / patch face
104 
105 
106  // Counters
107 
108  //- Number of parcels transferred to the film model
109  label nParcelsTransferred_;
110 
111  //- Number of parcels injected from the film model
112  label nParcelsInjected_;
113 
114 
115  // Protected functions
116 
117  //- Cache the film fields in preparation for injection
118  virtual void cacheFilmFields
119  (
120  const label filmPatchi,
121  const label primaryPatchi,
123  );
124 
125  //- Set the individual parcel properties
126  virtual void setParcelProperties
127  (
128  parcelType& p,
129  const label filmFacei
130  ) const;
131 
132 
133 public:
134 
135  //- Runtime type information
136  TypeName("surfaceFilmModel");
137 
138  //- Declare runtime constructor selection table
140  (
141  autoPtr,
143  dictionary,
144  (
145  const dictionary& dict,
146  CloudType& owner
147  ),
148  (dict, owner)
149  );
150 
151 
152  // Constructors
153 
154  //- Construct null from owner
155  SurfaceFilmModel(CloudType& owner);
156 
157  //- Construct from components
159  (
160  const dictionary& dict,
161  CloudType& owner,
162  const word& type
163  );
164 
165  //- Construct copy
167 
168  //- Construct and return a clone
169  virtual autoPtr<SurfaceFilmModel<CloudType>> clone() const = 0;
170 
171 
172  //- Destructor
173  virtual ~SurfaceFilmModel();
174 
175 
176  //- Selector
178  (
179  const dictionary& dict,
180  CloudType& owner
181  );
182 
183 
184  // Member Functions
185 
186  // Access
187 
188  //- Return gravitational acceleration constant
189  inline const dimensionedVector& g() const;
190 
191  //- Return const access to the number of parcels transferred to the
192  // film model
193  inline label nParcelsTransferred() const;
194 
195  //- Return non-const access to the number of parcels transferred to
196  // the film model
197  inline label& nParcelsTransferred();
198 
199  //- Return const access to the number of parcels injected from the
200  // film model
201  inline label nParcelsInjected() const;
202 
203  //- Return non-const access to the number of parcels injected from
204  // the film model
205  inline label& nParcelsInjected();
206 
207 
208  // Member Functions
209 
210  //- Transfer parcel from cloud to surface film
211  // Returns true if parcel is to be transferred
212  virtual bool transferParcel
213  (
214  parcelType& p,
215  const polyPatch& pp,
216  bool& keepParticle
217  ) = 0;
218 
219  //- Inject parcels into the cloud
220  template<class TrackCloudType>
221  void inject(TrackCloudType& cloud);
222 
223 
224  // I-O
225 
226  //- Write surface film info to stream
227  virtual void info(Ostream& os);
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace Foam
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #define makeSurfaceFilmModel(CloudType) \
238  \
239  typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
240  defineNamedTemplateTypeNameAndDebug \
241  ( \
242  Foam::SurfaceFilmModel<kinematicCloudType>, \
243  0 \
244  ); \
245  namespace Foam \
246  { \
247  defineTemplateRunTimeSelectionTable \
248  ( \
249  SurfaceFilmModel<kinematicCloudType>, \
250  dictionary \
251  ); \
252  }
253 
254 
255 #define makeSurfaceFilmModelType(SS, CloudType) \
256  \
257  typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
258  defineNamedTemplateTypeNameAndDebug(Foam::SS<kinematicCloudType>, 0); \
259  \
260  Foam::SurfaceFilmModel<kinematicCloudType>:: \
261  adddictionaryConstructorToTable<Foam::SS<kinematicCloudType>> \
262  add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
263 
264 
265 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
266 
267 #include "SurfaceFilmModelI.H"
268 
269 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
270 
271 #ifdef NoRepository
272  #include "SurfaceFilmModel.C"
273 #endif
274 
275 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
276 
277 #endif
278 
279 // ************************************************************************* //
Foam::SurfaceFilmModel::cacheFilmFields
virtual void cacheFilmFields(const label filmPatchi, const label primaryPatchi, const regionModels::surfaceFilmModels::surfaceFilmRegionModel &)
Cache the film fields in preparation for injection.
Definition: SurfaceFilmModel.C:193
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::SurfaceFilmModel::g_
const dimensionedVector & g_
Gravitational acceleration constant.
Definition: SurfaceFilmModel.H:79
Foam::SurfaceFilmModel::deltaFilmPatch_
scalarListList deltaFilmPatch_
Film height of all film patches / patch face.
Definition: SurfaceFilmModel.H:102
SurfaceFilmModelI.H
SurfaceFilmModel.C
Foam::SurfaceFilmModel::massParcelPatch_
scalarList massParcelPatch_
Parcel mass / patch face.
Definition: SurfaceFilmModel.H:90
Foam::CloudSubModelBase
Base class for cloud sub-models.
Definition: CloudSubModelBase.H:51
Foam::SurfaceFilmModel::nParcelsTransferred_
label nParcelsTransferred_
Number of parcels transferred to the film model.
Definition: SurfaceFilmModel.H:108
Foam::SurfaceFilmModel::TypeName
TypeName("surfaceFilmModel")
Runtime type information.
Foam::SurfaceFilmModel::~SurfaceFilmModel
virtual ~SurfaceFilmModel()
Destructor.
Definition: SurfaceFilmModel.C:99
Foam::SurfaceFilmModel::nParcelsInjected_
label nParcelsInjected_
Number of parcels injected from the film model.
Definition: SurfaceFilmModel.H:111
Foam::SurfaceFilmModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, SurfaceFilmModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
Foam::SurfaceFilmModel::transferParcel
virtual bool transferParcel(parcelType &p, const polyPatch &pp, bool &keepParticle)=0
Transfer parcel from cloud to surface film.
Foam::SurfaceFilmModel::nParcelsInjected
label nParcelsInjected() const
Return const access to the number of parcels injected from the.
Definition: SurfaceFilmModelI.H:61
Foam::SurfaceFilmModel::parcelType
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
Definition: SurfaceFilmModel.H:76
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel
Base class for surface film models.
Definition: surfaceFilmRegionModel.H:55
Foam::SurfaceFilmModel
Templated wall surface film model class.
Definition: KinematicCloud.H:92
CloudSubModelBase.H
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::SurfaceFilmModel::inject
void inject(TrackCloudType &cloud)
Inject parcels into the cloud.
Definition: SurfaceFilmModel.C:107
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::SurfaceFilmModel::diameterParcelPatch_
scalarList diameterParcelPatch_
Parcel diameter / patch face.
Definition: SurfaceFilmModel.H:93
Foam::dimensioned< vector >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::SurfaceFilmModel::nParcelsTransferred
label nParcelsTransferred() const
Return const access to the number of parcels transferred to the.
Definition: SurfaceFilmModelI.H:47
Foam::SurfaceFilmModel::g
const dimensionedVector & g() const
Return gravitational acceleration constant.
Definition: SurfaceFilmModelI.H:33
Foam::SurfaceFilmModel::setParcelProperties
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Set the individual parcel properties.
Definition: SurfaceFilmModel.C:220
Foam::SurfaceFilmModel::rhoFilmPatch_
scalarList rhoFilmPatch_
Film density / patch face.
Definition: SurfaceFilmModel.H:99
IOdictionary.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::cloud
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:57
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::List< scalar >
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::SurfaceFilmModel::info
virtual void info(Ostream &os)
Write surface film info to stream.
Definition: SurfaceFilmModel.C:241
Foam::SurfaceFilmModel::ejectedParcelType_
label ejectedParcelType_
Ejected parcel type label - id assigned to identify parcel for.
Definition: SurfaceFilmModel.H:84
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::SurfaceFilmModel::UFilmPatch_
List< vector > UFilmPatch_
Film velocity / patch face.
Definition: SurfaceFilmModel.H:96
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::SurfaceFilmModel::SurfaceFilmModel
SurfaceFilmModel(CloudType &owner)
Construct null from owner.
Definition: SurfaceFilmModel.C:38
Foam::SurfaceFilmModel::New
static autoPtr< SurfaceFilmModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: SurfaceFilmModelNew.C:36
Foam::SurfaceFilmModel::clone
virtual autoPtr< SurfaceFilmModel< CloudType > > clone() const =0
Construct and return a clone.
autoPtr.H