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