spiral mesh in gmsh
Hello,
I would like to create a spiral in gmsh with a structured mesh for transversal section. Is this possible?
How can a spiral be defined? Is there any tutorial showing this?
What I want to achieve is something like this:
The cross-sectional area is a 5x5mm square.
Edit:
I have been able to generate the profile and the spiral with:
// SetFactory("Built-in");
SetFactory("OpenCASCADE");
// Profile Dimensions
l = 0.005;
angle = 5;
dx = Atan(angle*Pi/180)*l;
// Mesh
Point(1) = {-l/2, -l/2, 0, 1.0};
Point(2) = {l/2, -l/2, 0, 1.0};
Point(3) = {-l/2 -dx, l/2, 0, 1.0};
Point(4) = {l/2 +dx, l/2, 0, 1.0};
Point(5) = {0, 0, 0, 1.0};
Line(1) = {3, 4}; Line(2) = {4, 2};
Line(3) = {2, 1}; Line(4) = {1, 3};
// Spiral information
initial_radius = 0.015;
n_turns = 4;
final_radius = 0.1;
b = (final_radius - initial_radius)/(2*Pi*n_turns);
start_theta = Pi/2 ;
end_theta = 2*Pi*n_turns;
N = 100;
x_first = 0;
z_first = 0;
For i In {0:N}
s = start_theta + i*(end_theta-start_theta)/N;
x = (initial_radius + b*s)*Cos(s);
y = 0;
z = (initial_radius + b*s)*Sin(s);
pi = newp;
Point(pi) = {x, y, z, 1.0};
If (i == 0)
x_first = x;
z_first = z;
EndIf
EndFor
Rotate {{0, 1, 0}, {0, 0, 0}, Pi/2} {
Line{1:4}; Point{5};
}
Translate {0, 0, z_first} {
Line{1:4}; Point{5};
}
Curve Loop(1) = {4, 1, 2, 3};
Plane Surface(1) = {1};
Transfinite Curve {1, 4, 3, 2} = 10 Using Progression 1;
Transfinite Surface {1};
Recombine Surface {1};
li = newc;
Spline(li) = {6:N+6};
wi = newreg;
Wire(wi) = {li};
Extrude { Surface{1}; } Using Wire {wi}
However the profile is not correct and I cannot extrude the mesh. Can anyone help me with this?
Best Regards
Edited by Ghost User