This function defines a archimedes screw in the z-direction from a (constant) starting point, a (constant) length L, a (constant) radius r, a (constant) number or revelations N and a (constant) rotation speed (rev/s)
More...
|
| Screw () |
|
| Screw (Vec3D Start, double L, double R, double N, double omega, double thickness) |
|
virtual Screw * | copy () const |
|
bool | get_distance_and_normal (BaseParticle &P, Mdouble &distance, Vec3D &normal_return) |
|
void | move_time (Mdouble dt) |
| Allows the wall to be moved to a new position (also orthogonal to the normal), and setting the velocity. More...
|
|
void | read (std::istream &is) |
| reads wall More...
|
|
void | print (std::ostream &os) const |
| outputs wall More...
|
|
Vec3D | get_Velocity () const |
| Todo{Implement this function correctly}. More...
|
|
| BaseWall () |
|
| BaseWall (const BaseWall &p) |
|
virtual | ~BaseWall () |
|
virtual void | clear () |
|
virtual void | move (Mdouble position_ UNUSED) |
| Allows the wall to be moved to a new position. More...
|
|
virtual void | move (Vec3D velocity_ UNUSED, Mdouble dt UNUSED) |
| Allows the wall to be moved to a new position (also orthogonal to the normal), and setting the velocity. More...
|
|
virtual bool | get_distance_and_normal (BaseParticle &P UNUSED, Mdouble &distance UNUSED, Vec3D &normal_return UNUSED)=0 |
|
void | set_Velocity (Vec3D new_) |
| access function for velocity More...
|
|
virtual void | read (std::istream &is UNUSED)=0 |
|
virtual void | print (std::ostream &os UNUSED) const =0 |
|
virtual void | moveInHandler (int newPos) |
|
int | getIndSpecies () const |
|
void | setIndSpecies (const int _new) |
|
const Vec3D & | get_Force () const |
|
const Vec3D & | get_Torque () const |
|
void | set_Force (Vec3D _new) |
|
void | set_Torque (Vec3D _new) |
|
void | set_Index (int index) |
|
void | set_Id (int id) |
|
void | add_Force (Vec3D _new) |
|
void | add_Torque (Vec3D _new) |
|
This function defines a archimedes screw in the z-direction from a (constant) starting point, a (constant) length L, a (constant) radius r, a (constant) number or revelations N and a (constant) rotation speed (rev/s)
q is a new coordinate going from 0 to 1 and t is the time x=xs+r*cos(2*pi*(offset+N*q)) y=ys+r*sin(2*pi*(offset+N*q)) z=zs+q*L
Definition at line 41 of file Screw.h.
To find the contact point we have to minimize (with respect to r and q) Distance^2=(x-x0-r*cos(2*Pi*(offset+N*q)))^2+(y-y0-r*sin(2*Pi*(offset+N*q)))^2+(z-z0-q*L)^2 Using polar coordinated (i.e. x-x0=R*cos(alpha), y-y0=R*sin(alpha) and dz=z-z0) Distance^2=R^2+r^2-2*R*r*cos(alpha-2*Pi*(offset+N*q))+(dz-q*L)^2
Differentiation with respect to r and solve for zero: 0=2*r-2*R*cos(alpha-2*Pi*(offset+N*q) r=R*cos(alpha-2*Pi*(offset+N*q))
Substitue back Distance^2=R^2+R^2*cos^2(alpha-2*Pi*(offset+N*q))-2*R^2*cos(alpha-2*Pi*(offset+N*q))*cos(alpha-2*Pi*(offset+N*q))+(dz-q*L)^2 Distance^2=R^2*sin^2(alpha-2*Pi*(offset+N*q))+(dz-q*L)^2
So we have to minimize: Distance^2=R^2*sin^2(alpha-2*Pi*(offset+N*q))^2+(dz-q*L)^2 For this we use the Euler algoritm
The initial guess will be in the minimum of the sin closest to the minimum of the parabolic part Minima of the sin are at alpha-2*Pi*(offset+N*q)=k*Pi (k=integer) q=alpha/(2*Pi*N)-k/(2*N)-offset/N (k=integer)
Definition at line 78 of file Screw.h.
References BaseParticle::get_Position(), BaseParticle::get_WallInteractionRadius(), Vec3D::GetLength(), L, MaxR, N, offset, constants::pi, R, mathsFunc::sign(), constants::sqr_pi, Start, thickness, Vec3D::X, Vec3D::Y, and Vec3D::Z.
128 }
while(fabs(dd/ddd)>1e-14);
146 }
while(fabs(dd/ddd)>1e-14);
181 normal_return/=normal_return.
GetLength();
int sign(T val)
This is a sign function, it returns -1 for negative numbers, 1 for positive numbers and 0 for 0...
Mdouble get_WallInteractionRadius() const
const Vec3D & get_Position() const
Mdouble GetLength() const
Implementation of a 3D vector (by Vitaliy).