Try setting this up as a rotating boundary rather than a rotating internal surface:
I believe there is an error in the computation of rotation for internal surfaces. File get_stl_data.f, lines 1597-1605:
IS_WALL_ANGLE(IS_ID,:) = IS_WALL_ANGLE(IS_ID,:) + IS_WALL_OMEGA(IS_ID,:)*DTSOLID
! OMEGA_CONV_FACT converts the angle to radians.
! The routines building the rotation matrices needs degrees.
Theta_deg(:) = IS_WALL_ANGLE(IS_ID,:) * OMEGA_CONV_FACT * 180.0/PI
CALL BUILD_X_ROTATION_MATRIX(Theta_deg(1), Rx)
CALL BUILD_Y_ROTATION_MATRIX(Theta_deg(2), Ry)
CALL BUILD_Z_ROTATION_MATRIX(Theta_deg(3), Rz)
R = MATMUL(Rz,MATMUL(Ry,Rx))
This is accumulating the Euler angles independently and computing a product matrix. The problem is that Rx and Ry do not commute so this is not actually rotation about a fixed axis! (The composition of two independently-growing Euler angles traces a path on SO(3) that curves away from the one-parameter subgroup exp(t[ω]×). You can see it’s wrong at a specific point: take t such that θx = 90°. Then Rx maps the y-axis to z. Ry has meanwhile rotated by −2.615/29.886·90 ≈ −7.9°. The product rotates points in a way whose equivalent single axis is no longer (0.9962, −0.0872, 0) — the tilt has effectively migrated out of the x–y plane because Rx carried the y-component up toward z.)
However the rotating-BC code at line 1647 of the same file seems to do this correctly:
OP = CENTER(:) - BC_WALL_ROT_CENTER(BC_ID, :)
AVG_VEL(:) = BC_WALL_VEL(BC_ID, :) + CROSS(OMEGA, OP)
AVG_VEL = v + ω × OP is correct, R = Rz·Ry·Rx is broken.
Your cylinder should probably be a BC rather than IC, but if you really need a rotating IC you can patch the code:
Copy get_stl_data.f to the project directory for editing and replace lines 1601-1605 with:
! omega in rad/s
omega(:) = IS_WALL_OMEGA(IS_ID,:) * OMEGA_CONV_FACT
! total angle since start, about the FIXED axis omega
! (accumulate the scalar angle, or use omega*time)
theta = sqrt(dot_product(omega,omega)) * <accumulated time>
if (theta > 0) then
n(:) = omega(:) / sqrt(dot_product(omega,omega))
R = build_rodrigues(n, theta) ! I + sin θ [n]_x + (1-cos θ)[n]_x^2
else
R = identity
end if
After I get a chance to test it, this fix will be included in the next MFiX release.
– Charles