PatchInteractionFields.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) 2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::PatchInteractionFields
28
29Group
30 grpLagrangianIntermediateFunctionObjects
31
32Description
33 Creates volume fields whose boundaries are used to store patch interaction
34 statistics.
35
36 Current field output per patch face:
37 - <cloud><model>:count - cumulative particle hits
38 - <cloud><model>:mass - cumulative mass of hitting particles
39
40 Fields can be reset according to:
41 - none: fields are not reset
42 - timeStep: reset at each time step
43 - writeTime: reset at each write time
44
45Usage
46
47 \verbatim
48 patchInteractionFields1
49 {
50 type patchInteractionFields;
51 resetMode writeTime;
52 }
53 \endverbatim
54
55SourceFiles
56 PatchInteractionFields.C
57
58\*---------------------------------------------------------------------------*/
59
60#ifndef PatchInteractionFields_H
61#define PatchInteractionFields_H
62
63#include "CloudFunctionObject.H"
64#include "volFields.H"
65#include "Enum.H"
66
67// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68
69namespace Foam
70{
71
72/*---------------------------------------------------------------------------*\
73 Class PatchInteractionFields Declaration
74\*---------------------------------------------------------------------------*/
75
76template<class CloudType>
78:
79 public CloudFunctionObject<CloudType>
80{
81public:
82
83 // Public enumerations
84
85 //- Reset mode
86 enum class resetMode
87 {
88 none,
91 };
94
95
96private:
97
98 // Private Data
99
100 //- Convenience typedef for parcel type
101 typedef typename CloudType::parcelType parcelType;
102
103 //- Parcel mass field
105
106 //- Parcel count field
107 autoPtr<volScalarField> countPtr_;
108
109 //- Reset mode
110 resetMode resetMode_;
111
112
113protected:
114
115 // Protected Member Functions
116
117 //- Create|read|reset the fields
118 void reset();
119
120 //- Write post-processing info
121 virtual void write();
122
123 //- Helper function to clear or reset fields
124 void clearOrReset
125 (
126 autoPtr<volScalarField>& fieldPtr,
127 const word& fieldName,
128 const dimensionSet& dims
129 ) const;
130
131
132public:
133
134 //- Runtime type information
135 TypeName("patchInteractionFields");
136
137
138 // Constructors
139
140 //- Construct from dictionary
142 (
143 const dictionary& dict,
145 const word& modelName
146 );
147
148 //- Construct copy
150
151 //- Construct and return a clone
153 {
155 (
157 );
158 }
159
160
161 //- Destructor
162 virtual ~PatchInteractionFields() = default;
163
164
165 // Member Functions
166
167 // Evaluation
168
169 //- Pre-evolve hook
170 virtual void preEvolve
171 (
172 const typename parcelType::trackingData& td
173 );
174
175 //- Post-patch hook
176 virtual void postPatch
177 (
178 const parcelType& p,
179 const polyPatch& pp,
180 bool& keepParticle
181 );
182};
183
184
185// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186
187} // End namespace Foam
188
189// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190
191#ifdef NoRepository
192 #include "PatchInteractionFields.C"
193#endif
194
195// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196
197#endif
198
199// ************************************************************************* //
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
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
Creates volume fields whose boundaries are used to store patch interaction statistics.
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
virtual ~PatchInteractionFields()=default
Destructor.
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
void clearOrReset(autoPtr< volScalarField > &fieldPtr, const word &fieldName, const dimensionSet &dims) const
Helper function to clear or reset fields.
static const Enum< resetMode > resetModeNames_
virtual void write()
Write post-processing info.
virtual void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve hook.
void reset()
Create|read|reset the fields.
TypeName("patchInteractionFields")
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
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:109
Class used to pass data into container.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
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