|
3D_Twist
|
Previous Top Next |
|
{
} title '3D Twisted Rod' coordinates cartesian3 select ngrid=25 { generate enough mesh cells to resolve the twist } variables Tp definitions long = 20 wide = 1 z1 = -long/2 z2 = long/2 { transformations } twist = 2*pi/long { radians per unit length } c = cos(twist*z) s = sin(twist*z) xt = c*x-s*y yt = s*x+c*y { functional definition of derivatives } dxt(f) = c*dx(f) - s*dy(f) dyt(f) = s*dx(f) + c*dy(f) dzt(f) = twist*[y*dx(f) - x*dy(f)] + dz(f) { Thermal source } Q = 10*exp(-(xt+wide)^2-(yt+wide)^2-z^2) initial values Tp = 0. equations { the heat equation using transformed derivative operators } dxt(dxt(Tp)) + dyt(dyt(Tp)) + dzt(dzt(Tp)) + Q = 0 extrusion z = z1,z2 boundaries surface 1 value(Tp)=0 { fix bottom surface temp } surface 2 value(Tp)=0 { fix top surface temp } Region 1 start(-wide,-wide) { default to insulating sides } line to (wide,-wide) to (wide,wide) to (-wide,wide) to close monitors grid(xt,yt,z) { the twisted shape } plots grid(xt,yt,z) { the twisted shape again } { In the following, recall that x and y are the coordinates which follow the twist. It is not possible at present to construct a cut in the "lab" coordinates. } grid(x,z) on y=0 contour(Tp) on y=0 as "ZX Temp" contour(Tp) on z=0 as "XY Temp" end 37764 |