VoidFraction.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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::VoidFraction
26 
27 Description
28  Creates particle void fraction field on carrier phase
29 
30 SourceFiles
31  VoidFraction.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef VoidFraction_H
36 #define VoidFraction_H
37 
38 #include "CloudFunctionObject.H"
39 #include "volFields.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class VoidFraction Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class CloudType>
51 class VoidFraction
52 :
53  public CloudFunctionObject<CloudType>
54 {
55  // Private Data
56 
57  // Typedefs
58 
59  //- Convenience typedef for parcel type
60  typedef typename CloudType::parcelType parcelType;
61 
62 
63  //- Void fraction field
64  autoPtr<volScalarField> thetaPtr_;
65 
66 
67 protected:
68 
69  // Protected Member Functions
70 
71  //- Write post-processing info
72  virtual void write();
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("voidFraction");
79 
80 
81  // Constructors
82 
83  //- Construct from dictionary
85  (
86  const dictionary& dict,
88  const word& modelName
89  );
90 
91  //- Construct copy
93 
94  //- Construct and return a clone
96  {
98  (
99  new VoidFraction<CloudType>(*this)
100  );
101  }
102 
103 
104  //- Destructor
105  virtual ~VoidFraction();
106 
107 
108  // Member Functions
109 
110  // Evaluation
111 
112  //- Pre-evolve hook
113  virtual void preEvolve();
114 
115  //- Post-evolve hook
116  virtual void postEvolve();
117 
118  //- Post-move hook
119  virtual void postMove
120  (
121  parcelType& p,
122  const scalar dt,
123  const point& position0,
124  bool& keepParticle
125  );
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #ifdef NoRepository
136  #include "VoidFraction.C"
137 #endif
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
virtual void postMove(parcelType &p, const scalar dt, const point &position0, bool &keepParticle)
Post-move hook.
Definition: VoidFraction.C:126
Creates particle void fraction field on carrier phase.
Definition: VoidFraction.H:50
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
const CloudType & owner() const
Return const access to the owner cloud.
TypeName("voidFraction")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
virtual ~VoidFraction()
Destructor.
Definition: VoidFraction.C:74
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:221
virtual void preEvolve()
Pre-evolve hook.
Definition: VoidFraction.C:81
virtual void postEvolve()
Post-evolve hook.
Definition: VoidFraction.C:112
virtual void write()
Write post-processing info.
Definition: VoidFraction.C:31
VoidFraction(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: VoidFraction.C:49
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
Definition: VoidFraction.H:94
volScalarField & p
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Templated cloud function object base class.
Namespace for OpenFOAM.