www.cemf.ir
rotatingAxis.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 #ifndef __rotatingAxis_hpp__
22 #define __rotatingAxis_hpp__
23 
24 #include "timeInterval.hpp"
25 #include "line.hpp"
26 
27 #include "rotatingAxisFwd.hpp"
28 
29 namespace pFlow
30 {
31 
32 class dictionary;
33 
62 :
63  public timeInterval,
64  public line
65 {
66 private:
67 
69  real omega_ = 0;
70 
72  bool rotating_ = false;
73 
74 public:
75 
76  // - Constructor
77 
78  TypeInfoNV("rotatingAxis");
79 
82  rotatingAxis()=default;
83 
86  explicit rotatingAxis(const dictionary& dict);
87 
90  rotatingAxis(const realx3& p1, const realx3& p2, real omega = 0.0);
91 
94  rotatingAxis(const rotatingAxis&) = default;
95 
97  rotatingAxis(rotatingAxis&&) = default;
98 
100  rotatingAxis& operator=(const rotatingAxis&) = default;
101 
103  rotatingAxis& operator=(rotatingAxis&&) = default;
104 
106  ~rotatingAxis()=default;
107 
108 
112 
115  real omega()const
116  {
117  return omega_;
118  }
119 
122  bool isRotating()const
123  {
124  return rotating_;
125  }
126 
129  realx3 linVelocityPoint(const realx3 &p)const;
130 
132  realx3 transferPoint(const realx3 p, real dt)const;
133 
134  // - IO operation
135 
137  FUNCTION_H
138  bool read(const dictionary& dict);
139 
141  FUNCTION_H
142  bool write(dictionary& dict) const;
143 
145  FUNCTION_H
146  bool read(iIstream& is);
147 
149  FUNCTION_H
150  bool write(iOstream& os)const;
151 
152 };
153 
154 inline iOstream& operator <<(iOstream& os, const rotatingAxis& ax)
155 {
156  if(!ax.write(os))
157  {
158  fatalExit;
159  }
160  return os;
161 }
162 
164 {
165  if( !ax.read(is) )
166  {
167  fatalExit;
168  }
169  return is;
170 }
171 
172 }
173 
174 
175 #include "rotatingAxisI.hpp"
176 
177 #endif
timeInterval.hpp
pFlow::rotatingAxis::setOmega
FUNCTION_HD real setOmega(real omega)
Set omega.
Definition: rotatingAxis.cpp:57
pFlow::real
float real
Definition: builtinTypes.hpp:45
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::line
Definition: line.hpp:36
pFlow::rotatingAxis::write
FUNCTION_H bool write(dictionary &dict) const
Write to dictionary.
Definition: rotatingAxis.cpp:83
pFlow::rotatingAxis::rotating_
bool rotating_
is rotating
Definition: rotatingAxis.hpp:72
pFlow::rotatingAxis::isRotating
INLINE_FUNCTION_HD bool isRotating() const
Is rotating.
Definition: rotatingAxis.hpp:122
rotatingAxisI.hpp
pFlow
Definition: demGeometry.hpp:27
pFlow::rotatingAxis::rotatingAxis
FUNCTION_HD rotatingAxis()=default
Empty constructor.
FUNCTION_H
#define FUNCTION_H
Definition: pFlowMacros.hpp:62
pFlow::iIstream
Interface class for any input stream
Definition: iIstream.hpp:37
pFlow::rotatingAxis::omega_
real omega_
rotation speed
Definition: rotatingAxis.hpp:69
pFlow::rotatingAxis
An axis which rotates around itself at specified speed.
Definition: rotatingAxis.hpp:61
pFlow::rotatingAxis::linVelocityPoint
INLINE_FUNCTION_HD realx3 linVelocityPoint(const realx3 &p) const
Linear tangential velocity at point p.
Definition: rotatingAxisI.hpp:23
pFlow::rotatingAxis::transferPoint
INLINE_FUNCTION_HD realx3 transferPoint(const realx3 p, real dt) const
Definition: rotatingAxisI.hpp:33
pFlow::operator>>
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
Definition: AdamsBashforth3.hpp:41
pFlow::rotatingAxis::omega
INLINE_FUNCTION_HD real omega() const
Return omega.
Definition: rotatingAxis.hpp:115
pFlow::timeInterval
Definition: timeInterval.hpp:16
pFlow::operator<<
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
Definition: AdamsBashforth3.hpp:57
FUNCTION_HD
#define FUNCTION_HD
Definition: pFlowMacros.hpp:61
pFlow::rotatingAxis::read
FUNCTION_H bool read(const dictionary &dict)
Read from dictionary.
Definition: rotatingAxis.cpp:67
pFlow::rotatingAxis::~rotatingAxis
~rotatingAxis()=default
destructor
pFlow::rotatingAxis::TypeInfoNV
TypeInfoNV("rotatingAxis")
rotatingAxisFwd.hpp
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:55
pFlow::triple< real >
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
pFlow::rotatingAxis::operator=
rotatingAxis & operator=(const rotatingAxis &)=default
Copy asssignment.
line.hpp
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67