VoidFraction.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  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 Class
28  Foam::VoidFraction
29 
30 Group
31  grpLagrangianIntermediateFunctionObjects
32 
33 Description
34  Creates particle void fraction field on carrier phase
35 
36 SourceFiles
37  VoidFraction.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef VoidFraction_H
42 #define VoidFraction_H
43 
44 #include "CloudFunctionObject.H"
45 #include "volFields.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class VoidFraction Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class CloudType>
57 class VoidFraction
58 :
59  public CloudFunctionObject<CloudType>
60 {
61  // Private Data
62 
63  // Typedefs
64 
65  //- Convenience typedef for parcel type
66  typedef typename CloudType::parcelType parcelType;
67 
68 
69  //- Void fraction field
70  autoPtr<volScalarField> thetaPtr_;
71 
72 
73 protected:
74 
75  // Protected Member Functions
76 
77  //- Write post-processing info
78  virtual void write();
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("voidFraction");
85 
86 
87  // Constructors
88 
89  //- Construct from dictionary
91  (
92  const dictionary& dict,
94  const word& modelName
95  );
96 
97  //- Construct copy
99 
100  //- Construct and return a clone
102  {
104  (
105  new VoidFraction<CloudType>(*this)
106  );
107  }
108 
109 
110  //- Destructor
111  virtual ~VoidFraction() = default;
112 
113 
114  // Member Functions
115 
116  // Evaluation
117 
118  //- Pre-evolve hook
119  virtual void preEvolve
120  (
121  const typename parcelType::trackingData& td
122  );
123 
124  //- Post-evolve hook
125  virtual void postEvolve
126  (
127  const typename parcelType::trackingData& td
128  );
129 
130  //- Post-move hook
131  virtual bool postMove
132  (
133  parcelType& p,
134  const scalar dt,
135  const point& position0,
136  const typename parcelType::trackingData& td
137  );
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #ifdef NoRepository
148  #include "VoidFraction.C"
149 #endif
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
Creates particle void fraction field on carrier phase.
Definition: VoidFraction.H:52
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual bool postMove(parcelType &p, const scalar dt, const point &position0, const typename parcelType::trackingData &td)
Post-move hook.
Definition: VoidFraction.C:121
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:98
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:104
const CloudType & owner() const
Return const access to the owner cloud.
TypeName("voidFraction")
Runtime type information.
virtual void postEvolve(const typename parcelType::trackingData &td)
Post-evolve hook.
Definition: VoidFraction.C:105
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual ~VoidFraction()=default
Destructor.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve hook.
Definition: VoidFraction.C:71
virtual void write()
Write post-processing info.
Definition: VoidFraction.C:27
VoidFraction(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: VoidFraction.C:45
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
Definition: VoidFraction.H:110
volScalarField & p
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
Templated cloud function object base class.
Namespace for OpenFOAM.