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 | Copyright (C) 2011-2012 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
56 
57 
58  // Counters for particle fates
59 
60  //- Number of parcels escaped
62 
63  //- Mass of parcels escaped
65 
66  //- Number of parcels stuck to patches
68 
69  //- Mass of parcels stuck to patches
71 
72 
73  //- Flag to output data as fields
75 
76  //- Mass escape field
78 
79  //- Mass stick field
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("localInteraction");
87 
88 
89  // Constructors
90 
91  //- Construct from dictionary
92  LocalInteraction(const dictionary& dict, CloudType& owner);
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  const scalar trackFraction,
127  const tetIndices& tetIs
128  );
129 
130 
131  // I-O
132 
133  //- Write patch interaction info to stream
134  virtual void info(Ostream& os);
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #ifdef NoRepository
145 # include "LocalInteraction.C"
146 #endif
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
PatchInteractionModel.H
Foam::LocalInteraction::patchData_
const patchInteractionDataList patchData_
List of participating patches.
Definition: LocalInteraction.H:54
Foam::LocalInteraction::massEscapePtr_
autoPtr< volScalarField > massEscapePtr_
Mass escape field.
Definition: LocalInteraction.H:76
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
p
p
Definition: pEqn.H:62
patchInteractionDataList.H
Foam::LocalInteraction::massStick_
List< scalar > massStick_
Mass of parcels stuck to patches.
Definition: LocalInteraction.H:69
Foam::patchInteractionDataList
List container for patchInteractionData class.
Definition: patchInteractionDataList.H:47
Foam::LocalInteraction::nEscape_
List< label > nEscape_
Number of parcels escaped.
Definition: LocalInteraction.H:60
Foam::LocalInteraction::massStickPtr_
autoPtr< volScalarField > massStickPtr_
Mass stick field.
Definition: LocalInteraction.H:79
Foam::LocalInteraction::LocalInteraction
LocalInteraction(const dictionary &dict, CloudType &owner)
Construct from dictionary.
Definition: LocalInteraction.C:32
Foam::LocalInteraction::writeFields_
Switch writeFields_
Flag to output data as fields.
Definition: LocalInteraction.H:73
Foam::LocalInteraction::clone
virtual autoPtr< PatchInteractionModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
Definition: LocalInteraction.H:97
Foam::PatchInteractionModel
Templated patch interaction model class.
Definition: KinematicCloud.H:82
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Switch.H
Foam::LocalInteraction::TypeName
TypeName("localInteraction")
Runtime type information.
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::LocalInteraction::~LocalInteraction
virtual ~LocalInteraction()
Destructor.
Definition: LocalInteraction.C:105
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::LocalInteraction::info
virtual void info(Ostream &os)
Write patch interaction info to stream.
Definition: LocalInteraction.C:276
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::LocalInteraction
Patch interaction specified on a patch-by-patch basis.
Definition: LocalInteraction.H:47
Foam::tetIndices
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
Definition: tetIndices.H:73
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::LocalInteraction::correct
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle, const scalar trackFraction, const tetIndices &tetIs)
Apply velocity correction.
Definition: LocalInteraction.C:171
Foam::List< label >
LocalInteraction.C
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::LocalInteraction::massEscape_
List< scalar > massEscape_
Mass of parcels escaped.
Definition: LocalInteraction.H:63
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::LocalInteraction::massEscape
volScalarField & massEscape()
Return access to the massEscape field.
Definition: LocalInteraction.C:112
Foam::LocalInteraction::massStick
volScalarField & massStick()
Return access to the massStick field.
Definition: LocalInteraction.C:141
Foam::LocalInteraction::nStick_
List< label > nStick_
Number of parcels stuck to patches.
Definition: LocalInteraction.H:66