PatchInteractionModel.C
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 \*---------------------------------------------------------------------------*/
25 
26 #include "PatchInteractionModel.H"
27 #include "fvMesh.H"
28 #include "Time.H"
29 #include "volFields.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 template<class CloudType>
35 (
36  IStringStream
37  (
38  "(rebound stick escape)"
39  )()
40 );
41 
42 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
43 
44 template<class CloudType>
46 (
47  const interactionType& itEnum
48 )
49 {
50  word it = "other";
51 
52  switch (itEnum)
53  {
54  case itRebound:
55  {
56  it = "rebound";
57  break;
58  }
59  case itStick:
60  {
61  it = "stick";
62  break;
63  }
64  case itEscape:
65  {
66  it = "escape";
67  break;
68  }
69  default:
70  {
71  }
72  }
73 
74  return it;
75 }
76 
77 
78 template<class CloudType>
81 (
82  const word& itWord
83 )
84 {
85  if (itWord == "rebound")
86  {
87  return itRebound;
88  }
89  else if (itWord == "stick")
90  {
91  return itStick;
92  }
93  else if (itWord == "escape")
94  {
95  return itEscape;
96  }
97  else
98  {
99  return itOther;
100  }
101 }
102 
103 
104 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
105 
106 template<class CloudType>
108 (
109  CloudType& owner
110 )
111 :
113  UName_("unknown_U")
114 {}
115 
116 
117 template<class CloudType>
119 (
120  const dictionary& dict,
121  CloudType& owner,
122  const word& type
123 )
124 :
125  CloudSubModelBase<CloudType>(owner, dict, typeName, type),
126  UName_(this->coeffDict().lookupOrDefault("U", word("U")))
127 {}
128 
129 
130 template<class CloudType>
132 (
134 )
135 :
137  UName_(pim.UName_)
138 {}
139 
140 
141 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
142 
143 template<class CloudType>
145 {}
146 
147 
148 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
149 
150 template<class CloudType>
152 {
153  return UName_;
154 }
155 
156 
157 template<class CloudType>
159 {
160  // do nothing
161 }
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
167 
168 // ************************************************************************* //
PatchInteractionModel(CloudType &owner)
Construct null from owner.
const word & UName() const
Return name of velocity field.
dictionary dict
static word interactionTypeToWord(const interactionType &itEnum)
Convert interaction result to word.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
virtual ~PatchInteractionModel()
Destructor.
Base class for cloud sub-models.
Templated patch interaction model class.
A class for handling words, derived from string.
Definition: word.H:59
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:461
virtual void info(Ostream &os)
Write patch interaction info to stream.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
static interactionType wordToInteractionType(const word &itWord)
Convert word to interaction result.