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 namespace pFlow
28 {
29 
30 class dictionary;
31 class rotatingAxis;
32 
33 #include "rotatingAxisFwd.hpp"
34 
63 :
64  public timeInterval,
65  public line
66 {
67 protected:
68 
70  real omega_ = 0;
71 
73  bool rotating_ = false;
74 
75 public:
76 
77  // - Constructor
78 
82 
85  rotatingAxis(const dictionary& dict);
86 
89  rotatingAxis(const realx3& p1, const realx3& p2, real omega = 0.0);
90 
93  rotatingAxis(const rotatingAxis&) = default;
94 
96  rotatingAxis& operator=(const rotatingAxis&) = default;
97 
101 
104  real omega()const
105  {
106  return omega_;
107  }
108 
111  bool isRotating()const
112  {
113  return rotating_;
114  }
115 
119 
120  // - IO operation
121 
123  FUNCTION_H
124  bool read(const dictionary& dict);
125 
127  FUNCTION_H
128  bool write(dictionary& dict) const;
129 
131  FUNCTION_H
132  bool read(iIstream& is);
133 
135  FUNCTION_H
136  bool write(iOstream& os)const;
137 
138 };
139 
140 inline iOstream& operator <<(iOstream& os, const rotatingAxis& ax)
141 {
142  if(!ax.write(os))
143  {
144  fatalExit;
145  }
146  return os;
147 }
148 
150 {
151  if( !ax.read(is) )
152  {
153  fatalExit;
154  }
155  return is;
156 }
157 
158 }
159 
160 
161 #include "rotatingAxisI.hpp"
162 
163 #endif
timeInterval.hpp
pFlow::rotatingAxis::setOmega
FUNCTION_HD real setOmega(real omega)
Set omega.
Definition: rotatingAxis.cpp:58
pFlow::real
float real
Definition: builtinTypes.hpp:46
fatalExit
#define fatalExit
Definition: error.hpp:57
pFlow::line
Definition: line.hpp:36
pFlow::rotatingAxis::write
FUNCTION_H bool write(dictionary &dict) const
Write to dictionary.
Definition: rotatingAxis.cpp:84
pFlow::rotatingAxis::rotating_
bool rotating_
is rotating
Definition: rotatingAxis.hpp:73
pFlow::rotatingAxis::isRotating
INLINE_FUNCTION_HD bool isRotating() const
Is rotating.
Definition: rotatingAxis.hpp:111
rotatingAxisI.hpp
pFlow
Definition: demComponent.hpp:28
FUNCTION_H
#define FUNCTION_H
Definition: pFlowMacros.hpp:58
pFlow::iIstream
Definition: iIstream.hpp:33
pFlow::rotatingAxis::omega_
real omega_
rotation speed
Definition: rotatingAxis.hpp:70
pFlow::rotatingAxis
An axis which rotates around itself at specified speed.
Definition: rotatingAxis.hpp:62
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:104
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:57
pFlow::rotatingAxis::read
FUNCTION_H bool read(const dictionary &dict)
Read from dictionary.
Definition: rotatingAxis.cpp:68
rotatingAxisFwd.hpp
pFlow::rotatingAxis::linTangentialVelocityPoint
INLINE_FUNCTION_HD realx3 linTangentialVelocityPoint(const realx3 &p) const
Linear tangential velocity at point p.
Definition: rotatingAxisI.hpp:22
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:51
pFlow::triple< real >
pFlow::iOstream
Definition: iOstream.hpp:53
pFlow::rotatingAxis::operator=
rotatingAxis & operator=(const rotatingAxis &)=default
Copy asssignment.
line.hpp
pFlow::rotatingAxis::rotatingAxis
FUNCTION_HD rotatingAxis()
Empty constructor.
Definition: rotatingAxis.hpp:81
pFlow::dictionary
Definition: dictionary.hpp:38