MultiInteraction.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-2016 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::MultiInteraction
26 
27 Description
28  Runs multiple patch interaction models in turn. Takes dictionary
29  where all the subdictionaries are the interaction models.
30 
31  // Exit upon first successful interaction or continue doing other
32  // models. Returned nteraction status will be true if there has been any
33  // interaction (so logical or)
34  oneInteractionOnly true;
35 
36  model1
37  {
38  patchInteractionModel coincidentBaffleInteraction;
39  coincidentBaffleInteractionCoeffs
40  {
41  coincidentPatches
42  (
43  (pipetteWall_A pipetteCyclic_half0)
44  (pipetteWall_B pipetteCyclic_half1)
45  );
46  }
47  }
48  model2
49  {
50  patchInteractionModel localInteraction;
51  localInteractionCoeffs
52  {
53  patches
54  (
55  cWall
56  {
57  type rebound;
58  }
59  pipetteWall_A
60  {
61  type rebound;
62  }
63  pipetteWall_B
64  {
65  type rebound;
66  }
67  );
68  }
69  }
70 
71 
72 \*---------------------------------------------------------------------------*/
73 
74 #ifndef MultiInteraction_H
75 #define MultiInteraction_H
76 
77 #include "PatchInteractionModel.H"
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
81 namespace Foam
82 {
83 /*---------------------------------------------------------------------------*\
84  Class MultiInteraction Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 template<class CloudType>
88 class MultiInteraction
89 :
90  public PatchInteractionModel<CloudType>
91 {
92  // Private data
93 
94  Switch oneInteractionOnly_;
95 
96  //- Submodels
98 
99 
100  // Private Member Functions
101 
102  //- Read settings
103  bool read(const dictionary&);
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("multiInteraction");
109 
110 
111  // Constructors
112 
113  //- Construct from dictionary
115 
116  //- Construct copy from owner cloud and patch interaction model
118 
119  //- Construct and return a clone using supplied owner cloud
121  {
123  (
124  new MultiInteraction<CloudType>(*this)
125  );
126  }
127 
128 
129  //- Destructor
130  virtual ~MultiInteraction();
131 
132 
133  // Member Functions
134 
135  //- Flag to indicate whether model activates patch interaction model
136  virtual bool active() const;
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  const scalar trackFraction,
146  const tetIndices& tetIs
147  );
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #ifdef NoRepository
158  #include "MultiInteraction.C"
159 #endif
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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.
Definition: Switch.H:60
TypeName("multiInteraction")
Runtime type information.
Runs multiple patch interaction models in turn. Takes dictionary where all the subdictionaries are th...
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
Templated patch interaction model class.
virtual autoPtr< PatchInteractionModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle, const scalar trackFraction, const tetIndices &tetIs)
Apply velocity correction.
A cloud is a collection of lagrangian particles.
Definition: cloud.H:51
virtual ~MultiInteraction()
Destructor.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
Definition: tetIndices.H:81
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:218
MultiInteraction(const dictionary &dict, CloudType &cloud)
Construct from dictionary.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:63
virtual bool active() const
Flag to indicate whether model activates patch interaction model.
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
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69
Namespace for OpenFOAM.