PatchInteractionModel.C
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-2018 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  "(none 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 itNone:
55  {
56  it = "none";
57  break;
58  }
59  case itRebound:
60  {
61  it = "rebound";
62  break;
63  }
64  case itStick:
65  {
66  it = "stick";
67  break;
68  }
69  case itEscape:
70  {
71  it = "escape";
72  break;
73  }
74  default:
75  {
76  }
77  }
78 
79  return it;
80 }
81 
82 
83 template<class CloudType>
86 (
87  const word& itWord
88 )
89 {
90  if (itWord == "none")
91  {
92  return itNone;
93  }
94  if (itWord == "rebound")
95  {
96  return itRebound;
97  }
98  else if (itWord == "stick")
99  {
100  return itStick;
101  }
102  else if (itWord == "escape")
103  {
104  return itEscape;
105  }
106  else
107  {
108  return itOther;
109  }
110 }
111 
112 
113 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
114 
115 template<class CloudType>
117 (
118  CloudType& owner
119 )
120 :
122  UName_("unknown_U")
123 {}
124 
125 
126 template<class CloudType>
128 (
129  const dictionary& dict,
130  CloudType& owner,
131  const word& type
132 )
133 :
134  CloudSubModelBase<CloudType>(owner, dict, typeName, type),
135  UName_(this->coeffDict().lookupOrDefault("U", word("U")))
136 {}
137 
138 
139 template<class CloudType>
141 (
143 )
144 :
146  UName_(pim.UName_)
147 {}
148 
149 
150 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
151 
152 template<class CloudType>
154 {}
155 
156 
157 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
158 
159 template<class CloudType>
161 {
162  return UName_;
163 }
164 
165 
166 template<class CloudType>
168 {}
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
174 
175 // ************************************************************************* //
PatchInteractionModel(CloudType &owner)
Construct null from owner.
dictionary dict
static word interactionTypeToWord(const interactionType &itEnum)
Convert interaction result to word.
type
Types of root.
Definition: Roots.H:52
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:60
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
const word & UName() const
Return name of velocity field.
virtual void info(Ostream &os)
Write patch interaction info to stream.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69
static interactionType wordToInteractionType(const word &itWord)
Convert word to interaction result.