LocalInteraction.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-2022 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::LocalInteraction
26 
27 Description
28  Patch interaction specified on a patch-by-patch basis
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef LocalInteraction_H
33 #define LocalInteraction_H
34 
35 #include "PatchInteractionModel.H"
36 #include "Switch.H"
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 namespace Foam
41 {
42 /*---------------------------------------------------------------------------*\
43  Class LocalInteraction Declaration
44 \*---------------------------------------------------------------------------*/
45 
46 template<class CloudType>
47 class LocalInteraction
48 :
49  public PatchInteractionModel<CloudType>
50 {
51  // Private Typedefs
52 
53  //- Interaction type enumeration
54  typedef
57 
58 
59  // Private Data
60 
61  // Interactions
62 
63  //- Patch interaction types
64  List<interactionType> patchInteractionTypes_;
65 
66  //- Patch elasticity coefficients (for rebound)
67  List<scalar> patchEs_;
68 
69  //- Patch restitution coefficients (for rebound)
70  List<scalar> patchMus_;
71 
72 
73  // Counters for particle fates
74 
75  //- Number of parcels escaped
76  List<label> nEscape_;
77 
78  //- Mass of parcels escaped
79  List<scalar> massEscape_;
80 
81  //- Number of parcels stuck to patches
82  List<label> nStick_;
83 
84  //- Mass of parcels stuck to patches
85  List<scalar> massStick_;
86 
87 
88  //- Flag to output data as fields
89  Switch writeFields_;
90 
91  //- Mass escape field
92  autoPtr<volScalarField> massEscapePtr_;
93 
94  //- Mass stick field
95  autoPtr<volScalarField> massStickPtr_;
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("localInteraction");
102 
103 
104  // Constructors
105 
106  //- Construct from dictionary
108 
109  //- Construct copy from owner cloud and patch interaction model
111 
112  //- Construct and return a clone using supplied owner cloud
114  {
116  (
117  new LocalInteraction<CloudType>(*this)
118  );
119  }
120 
121 
122  //- Destructor
123  virtual ~LocalInteraction();
124 
125 
126  // Member Functions
127 
128  //- Return access to the massEscape field
130 
131  //- Return access to the massStick field
133 
134  //- Apply velocity correction
135  // Returns true if particle remains in same cell
136  virtual bool correct
137  (
138  typename CloudType::parcelType& p,
139  const polyPatch& pp,
140  bool& keepParticle
141  );
142 
143 
144  // I-O
145 
146  //- Write patch interaction info to stream
147  virtual void info(Ostream& os);
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #ifdef NoRepository
158  #include "LocalInteraction.C"
159 #endif
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:79
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:221
Generic GeometricField class.
Patch interaction specified on a patch-by-patch basis.
virtual autoPtr< PatchInteractionModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
virtual void info(Ostream &os)
Write patch interaction info to stream.
LocalInteraction(const dictionary &dict, CloudType &owner)
Construct from dictionary.
volScalarField & massStick()
Return access to the massStick field.
volScalarField & massEscape()
Return access to the massEscape field.
virtual ~LocalInteraction()
Destructor.
TypeName("localInteraction")
Runtime type information.
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle)
Apply velocity correction.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Templated patch interaction model class.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
Namespace for OpenFOAM.
volScalarField & p