[Nek5000-users] Re : CYCLIC BC for bend pipe
nek5000-users at lists.mcs.anl.gov
nek5000-users at lists.mcs.anl.gov
Sun Jun 26 13:10:25 CDT 2011
Hi Azad,
Yes - you can do this in usrdat2.
Below is an example that would put a 90 degree semicircular
arc into the x-y plane, which is what you would need. (Note,
I just coded this without testing it..., so you'll need to
verify and obviously modify to get your correct geometry.)
Cheers,
Paul
c-----------------------------------------------------------------------
subroutine usrdat2
include 'SIZE'
include 'TOTAL'
n = nx1*ny1*nz1*nelv
c First, rotate x into axial position
do i=1,n
x_original = xm1(i,1,1,1)
y_original = ym1(i,1,1,1)
z_original = zm1(i,1,1,1)
xm1(i,1,1,1) = z_original
ym1(i,1,1,1) = y_original
zm1(i,1,1,1) = -x_original
enddo
c Second, bend pipe into 90 degree bend (say)
xmin = glmin(xm1,n)
xmax = glmax(xm1,n)
ymin = glmin(ym1,n)
ymax = glmax(ym1,n)
rad0 = .5*(ymax-ymin) ! Radius of initial pipe
rad1 = 0.5 ! Radius of new pipe (say)
radm = 1.5 ! Major radius of torus
do i=1,n
x = xm1(i,1,1,1)
y = ym1(i,1,1,1)
theta = 0.5*pi*(x-xmin)/(xmax-xmin)
rad = radm + rad1*(y-ymin)/(ymax-ymin)
ym1(i,1,1,1) = rad*cos(theta) ! This should be the
xm1(i,1,1,1) = rad*sin(theta) ! correct orientation.
enddo
return
end
c-----------------------------------------------------------------------
On Sun, 26 Jun 2011, nek5000-users at lists.mcs.anl.gov wrote:
>
> Hi Paul;
>
> Since I am using Prenek to generate the base mesh for the pipe in X-Y
> plane, and then extrude it in the Z direction using the n2to3 tool, is
> there any easy way to change the orientation of such a mesh based on
> your suggestion? Or maybe I need to start generating the grid from the
> very beginning in X-Z plane?
>
> Best regards
> Azad
>
>
> PS - be sure that the rotation preserves the right-handed
> coordinates of the original system.
>
>
> On Sun, 26 Jun 2011, nek5000-users at lists.mcs.anl.gov wrote:
>
>>
>> Hi Azad,
>>
>> It's important that the "cyclic" axis be the z-axis.
>>
>> You may need to rotate your geometry into this orientation.
>>
>> In that case, your inlet/out planes would, say, be x-z
>> and y-z planes.
>>
>> Paul
>>
>>
>> On Sun, 26 Jun 2011, nek5000-users at lists.mcs.anl.gov wrote:
>>
>>> Dear Neks;
>>>
>>> I had a question regarding cyclic bc. It works properly for 2D and 3D
>>> curved channel, (arch-like curvature is generated in stream-wise
>>> direction using userdat2 with period bc at the both ends). However, when
>>> I try it for the curved pipe, seems not working at all. I appreciate it
>>> if you could help me by that.
>>>
>>> Many thanks;
>>> Azad
>>>
>>>
>
> _______________________________________________
> Nek5000-users mailing list
> Nek5000-users at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>
More information about the Nek5000-users
mailing list