LocalInteraction.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) 2018-2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::LocalInteraction
29
30Group
31 grpLagrangianIntermediatePatchInteractionSubModels
32
33Description
34 Patch interaction specified on a patch-by-patch basis
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef LocalInteraction_H
39#define LocalInteraction_H
40
43#include "Switch.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class LocalInteraction Declaration
52\*---------------------------------------------------------------------------*/
53
54template<class CloudType>
56:
57 public PatchInteractionModel<CloudType>
58{
59 // Private data
60
61 //- List of participating patches
62 const patchInteractionDataList patchData_;
63
64
65 // Bookkeeping for particle fates
66
67 //- Number of parcels escaped
68 List<List<label>> nEscape_;
69
70 //- Mass of parcels escaped
71 List<List<scalar>> massEscape_;
72
73 //- Number of parcels stuck to patches
74 List<List<label>> nStick_;
75
76 //- Mass of parcels stuck to patches
77 List<List<scalar>> massStick_;
78
79
80 //- Flag to output data as fields
81 bool writeFields_;
82
83 //- InjectorId to index map, when outputting escaped/stick/...
84 // particles sorted by injectorID
85 Map<label> injIdToIndex_;
86
87 //- Mass escape field
88 autoPtr<volScalarField> massEscapePtr_;
89
90 //- Mass stick field
91 autoPtr<volScalarField> massStickPtr_;
92
93
94protected:
95
96 // Protected Member Functions
97
98 //- Output file header information
99 virtual void writeFileHeader(Ostream& os);
100
101
102public:
103
104 //- Runtime type information
105 TypeName("localInteraction");
106
107
108 // Constructors
109
110 //- Construct from dictionary
112
113 //- Construct copy from owner cloud and patch interaction model
115
116 //- Construct and return a clone using supplied owner cloud
118 {
120 (
122 );
123 }
124
125
126 //- Destructor
127 virtual ~LocalInteraction() = default;
128
129
130 // Member Functions
131
132 //- Return access to the massEscape field
134
135 //- Return access to the massStick field
137
138 //- Apply velocity correction
139 // Returns true if particle remains in same cell
140 virtual bool correct
141 (
142 typename CloudType::parcelType& p,
143 const polyPatch& pp,
144 bool& keepParticle
145 );
146
147
148 //- Write patch interaction info to stream
149 virtual void info(Ostream& os);
150};
151
152
153// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154
155} // End namespace Foam
156
157// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
159#ifdef NoRepository
160 #include "LocalInteraction.C"
161#endif
162
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165#endif
166
167// ************************************************************************* //
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
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
Patch interaction specified on a patch-by-patch basis.
virtual void info(Ostream &os)
Write patch interaction info to stream.
virtual autoPtr< PatchInteractionModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
volScalarField & massStick()
Return access to the massStick field.
volScalarField & massEscape()
Return access to the massEscape field.
TypeName("localInteraction")
Runtime type information.
virtual ~LocalInteraction()=default
Destructor.
virtual void writeFileHeader(Ostream &os)
Output file header information.
A HashTable to objects of type <T> with a label key.
Definition: Map.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Templated patch interaction model class.
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
List container for patchInteractionData class.
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
volScalarField & p
thermo correct()
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73