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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::MultiInteraction
28 
29 Group
30  grpLagrangianIntermediatePatchInteractionSubModels
31 
32 Description
33  Runs multiple patch interaction models in turn. Takes dictionary
34  where all the subdictionaries are the interaction models.
35 
36  // Exit upon first successful interaction or continue doing other
37  // models. Returned interaction status will be true if there has been
38  // any interaction (so logical or)
39  oneInteractionOnly true;
40 
41  model1
42  {
43  patchInteractionModel coincidentBaffleInteraction;
44  coincidentBaffleInteractionCoeffs
45  {
46  coincidentPatches
47  (
48  (pipetteWall_A pipetteCyclic_half0)
49  (pipetteWall_B pipetteCyclic_half1)
50  );
51  }
52  }
53  model2
54  {
55  patchInteractionModel localInteraction;
56  localInteractionCoeffs
57  {
58  patches
59  (
60  cWall
61  {
62  type rebound;
63  }
64  pipetteWall_A
65  {
66  type rebound;
67  }
68  pipetteWall_B
69  {
70  type rebound;
71  }
72  );
73  }
74  }
75 
76 
77 \*---------------------------------------------------------------------------*/
78 
79 #ifndef MultiInteraction_H
80 #define MultiInteraction_H
81 
82 #include "PatchInteractionModel.H"
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 namespace Foam
87 {
88 /*---------------------------------------------------------------------------*\
89  Class MultiInteraction Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 template<class CloudType>
93 class MultiInteraction
94 :
95  public PatchInteractionModel<CloudType>
96 {
97  // Private data
98 
99  bool oneInteractionOnly_;
100 
101  //- Submodels
103 
104 
105  // Private Member Functions
106 
107  //- Read settings
108  bool read(const dictionary&);
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("multiInteraction");
114 
115 
116  // Constructors
117 
118  //- Construct from dictionary
120 
121  //- Construct copy from owner cloud and patch interaction model
123 
124  //- Construct and return a clone using supplied owner cloud
126  {
128  (
129  new MultiInteraction<CloudType>(*this)
130  );
131  }
132 
133 
134  //- Destructor
135  virtual ~MultiInteraction() = default;
136 
137 
138  // Member Functions
139 
140  //- Flag to indicate whether model activates patch interaction model
141  virtual bool active() const;
142 
143  //- Apply velocity correction
144  // Returns true if particle remains in same cell
145  virtual bool correct
146  (
147  typename CloudType::parcelType& p,
148  const polyPatch& pp,
149  bool& keepParticle
150  );
151 
152  //- Post-evolve hook
153  virtual void postEvolve();
154 
155  //- Write patch interaction info to stream
156  virtual void info(Ostream& os);
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #ifdef NoRepository
167  #include "MultiInteraction.C"
168 #endif
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
PatchInteractionModel.H
Foam::MultiInteraction::active
virtual bool active() const
Flag to indicate whether model activates patch interaction model.
Definition: MultiInteraction.C:116
Foam::MultiInteraction::TypeName
TypeName("multiInteraction")
Runtime type information.
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::MultiInteraction::correct
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle)
Apply velocity correction.
Definition: MultiInteraction.C:131
Foam::MultiInteraction::MultiInteraction
MultiInteraction(const dictionary &dict, CloudType &cloud)
Construct from dictionary.
Definition: MultiInteraction.C:90
Foam::MultiInteraction
Runs multiple patch interaction models in turn. Takes dictionary where all the subdictionaries are th...
Definition: MultiInteraction.H:92
Foam::MultiInteraction::info
virtual void info(Ostream &os)
Write patch interaction info to stream.
Definition: MultiInteraction.C:190
Foam::PatchInteractionModel
Templated patch interaction model class.
Definition: KinematicCloud.H:89
Foam::MultiInteraction::postEvolve
virtual void postEvolve()
Post-evolve hook.
Definition: MultiInteraction.C:180
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::MultiInteraction::clone
virtual autoPtr< PatchInteractionModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
Definition: MultiInteraction.H:124
os
OBJstream os(runTime.globalPath()/outputName)
Foam::MultiInteraction::~MultiInteraction
virtual ~MultiInteraction()=default
Destructor.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::cloud
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:57
MultiInteraction.C
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56