[Nek5000-users] Mesh-morphing for bend pipe

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Fri Jan 23 12:48:16 CST 2015


Hi Paul,

I see. Many thanks for your help. It all works fine now.

Best regards,

Tony

________________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov <nek5000-users-bounces at lists.mcs.anl.gov> on behalf of nek5000-users-request at lists.mcs.anl.gov <nek5000-users-request at lists.mcs.anl.gov>
Sent: 23 January 2015 18:00
To: nek5000-users at lists.mcs.anl.gov
Subject: Nek5000-users Digest, Vol 71, Issue 12

Send Nek5000-users mailing list submissions to
        nek5000-users at lists.mcs.anl.gov

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
or, via email, send a message with subject or body 'help' to
        nek5000-users-request at lists.mcs.anl.gov

You can reach the person managing the list at
        nek5000-users-owner at lists.mcs.anl.gov

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Nek5000-users digest..."


Today's Topics:

   1. Re: Nek5000-users Digest, Vol 71, Issue 11
      (nek5000-users at lists.mcs.anl.gov)
   2. Re: Nek5000-users Digest, Vol 71, Issue 11
      (nek5000-users at lists.mcs.anl.gov)


----------------------------------------------------------------------

Message: 1
Date: Fri, 23 Jan 2015 02:37:53 +0000
From: nek5000-users at lists.mcs.anl.gov
To: "nek5000-users at lists.mcs.anl.gov"
        <nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Nek5000-users Digest, Vol 71, Issue 11
Message-ID:
        <mailman.13977.1421980699.3424.nek5000-users at lists.mcs.anl.gov>
Content-Type: text/plain; charset="iso-8859-1"

Dear Paul,

Thank you very much for your help. Yes, the problem was the jump in y direction. I wasn't aware of the shift in y direction after bending the pipe. The code works fine now.

Just a quick question, if I want to do a U-bend pipe simulation, should I just change my geometry in usrdat2 subroutine or are there any other ways you would suggest?

Thanks again.

Cheers,

Tony

________________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov <nek5000-users-bounces at lists.mcs.anl.gov> on behalf of nek5000-users-request at lists.mcs.anl.gov <nek5000-users-request at lists.mcs.anl.gov>
Sent: 22 January 2015 18:00
To: nek5000-users at lists.mcs.anl.gov
Subject: Nek5000-users Digest, Vol 71, Issue 11

Send Nek5000-users mailing list submissions to
        nek5000-users at lists.mcs.anl.gov

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
or, via email, send a message with subject or body 'help' to
        nek5000-users-request at lists.mcs.anl.gov

You can reach the person managing the list at
        nek5000-users-owner at lists.mcs.anl.gov

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Nek5000-users digest..."


Today's Topics:

   1. Mesh-morphing for bend pipe (nek5000-users at lists.mcs.anl.gov)
   2. Re: Mesh-morphing for bend pipe (nek5000-users at lists.mcs.anl.gov)


----------------------------------------------------------------------

Message: 1
Date: Wed, 21 Jan 2015 21:53:36 +0000
From: nek5000-users at lists.mcs.anl.gov
To: "nek5000-users at lists.mcs.anl.gov"
        <nek5000-users at lists.mcs.anl.gov>
Subject: [Nek5000-users] Mesh-morphing for bend pipe
Message-ID:
        <mailman.13846.1421877222.3424.nek5000-users at lists.mcs.anl.gov>
Content-Type: text/plain; charset="iso-8859-1"

Dear Neks,


I have been looking at the mesh-morphing for a bend pipe recently. I found the thread https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-June/001398.html on how to bend a straight pipe. The code worked perfectly for bending a straight pipe into a 90 degree bend shape. The problem is I need to bend my pipe at certain section, say I have a pipe with total length of 10 and I want to bend it in the second half, i.e. from 5-10. However, when I tried to do it in this way, the error of 'Vanishing Jacobian near Xth node of element XX' appeared and the simulation couldn't start. I can't see why it doesn't work.


Below is the code I'm using to bend the pipe (from 5-10) into a 90 degree bend. Hope someone could help me on this. Any suggestion would be appreciated. Thank you very much in advance.


Kind regards,


Tony


c-----------------------------------------------------------------------
      subroutine usrdat2()  ! This routine to modify mesh coordinates
      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

      xmin = glmin(xm1,n)
      xmax = glmax(xm1,n)
      ymin = glmin(ym1,n)
      ymax = glmax(ym1,n)
      if (nid==0) print *,xmin,xmax,ymin,ymax            !which are 0, 10, -1, 1
      rad0 = 0.5*(ymax-ymin) ! Radius of initial pipe
      rad1 = 1.0            ! Radius of new pipe
      radm = 2.0            ! Major radius of torus

      do i=1,n
         x     = xm1(i,1,1,1)
         y     = ym1(i,1,1,1)

       if (x .gt. 5.0e0) then
         theta = 0.5*pi*(x-5.0e0)/(xmax-5.0e0)
         rad   = radm + 2.0e0*rad1*(y-ymin)/(ymax-ymin)

         ym1(i,1,1,1) = rad*cos(theta)
         xm1(i,1,1,1) = rad*sin(theta)+5.0e0
       end if

      end do

      return
      end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20150121/e9737b3d/attachment-0001.html>

------------------------------

Message: 2
Date: Wed, 21 Jan 2015 22:51:23 +0000
From: nek5000-users at lists.mcs.anl.gov
To: "nek5000-users at lists.mcs.anl.gov"
        <nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Mesh-morphing for bend pipe
Message-ID:
        <mailman.13855.1421880789.3424.nek5000-users at lists.mcs.anl.gov>
Content-Type: text/plain; charset="iso-8859-1"


Hi Tony,

It appears that you shift y, but only for x > 5, so there is a sudden jump in the y value at x=5.

Another possible thing that I didn't check is to make certain that your Rcos theta and R sin theta
transformation preserves the right-hand-rule.  (Your first rotation to x=axial direction does so.)

Often the fastest way to identify these issues is to run a tiny case on one processor and just
dump out all points (x,y,z) and plot them in matlab or via splot in gnuplot.

hth,

Paul

________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov [nek5000-users-bounces at lists.mcs.anl.gov] on behalf of nek5000-users at lists.mcs.anl.gov [nek5000-users at lists.mcs.anl.gov]
Sent: Wednesday, January 21, 2015 3:53 PM
To: nek5000-users at lists.mcs.anl.gov
Subject: [Nek5000-users] Mesh-morphing for bend pipe


Dear Neks,


I have been looking at the mesh-morphing for a bend pipe recently. I found the thread https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-June/001398.html on how to bend a straight pipe. The code worked perfectly for bending a straight pipe into a 90 degree bend shape. The problem is I need to bend my pipe at certain section, say I have a pipe with total length of 10 and I want to bend it in the second half, i.e. from 5-10. However, when I tried to do it in this way, the error of 'Vanishing Jacobian near Xth node of element XX' appeared and the simulation couldn't start. I can't see why it doesn't work.


Below is the code I'm using to bend the pipe (from 5-10) into a 90 degree bend. Hope someone could help me on this. Any suggestion would be appreciated. Thank you very much in advance.


Kind regards,


Tony


c-----------------------------------------------------------------------
      subroutine usrdat2()  ! This routine to modify mesh coordinates
      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

      xmin = glmin(xm1,n)
      xmax = glmax(xm1,n)
      ymin = glmin(ym1,n)
      ymax = glmax(ym1,n)
      if (nid==0) print *,xmin,xmax,ymin,ymax            !which are 0, 10, -1, 1
      rad0 = 0.5*(ymax-ymin) ! Radius of initial pipe
      rad1 = 1.0            ! Radius of new pipe
      radm = 2.0            ! Major radius of torus

      do i=1,n
         x     = xm1(i,1,1,1)
         y     = ym1(i,1,1,1)

       if (x .gt. 5.0e0) then
         theta = 0.5*pi*(x-5.0e0)/(xmax-5.0e0)
         rad   = radm + 2.0e0*rad1*(y-ymin)/(ymax-ymin)

         ym1(i,1,1,1) = rad*cos(theta)
         xm1(i,1,1,1) = rad*sin(theta)+5.0e0
       end if

      end do

      return
      end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20150121/9e502bea/attachment-0001.html>

------------------------------

_______________________________________________
Nek5000-users mailing list
Nek5000-users at lists.mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users


End of Nek5000-users Digest, Vol 71, Issue 11
*********************************************


------------------------------

Message: 2
Date: Fri, 23 Jan 2015 11:17:13 +0000
From: nek5000-users at lists.mcs.anl.gov
To: "nek5000-users at lists.mcs.anl.gov"
        <nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Nek5000-users Digest, Vol 71, Issue 11
Message-ID:
        <mailman.13981.1422011835.3424.nek5000-users at lists.mcs.anl.gov>
Content-Type: text/plain; charset="us-ascii"


Hi Tony,

Yes -- I would just do this in usrdat2, along the lines that you currently follow.

Best,

Paul

________________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov [nek5000-users-bounces at lists.mcs.anl.gov] on behalf of nek5000-users at lists.mcs.anl.gov [nek5000-users at lists.mcs.anl.gov]
Sent: Thursday, January 22, 2015 8:37 PM
To: nek5000-users at lists.mcs.anl.gov
Subject: Re: [Nek5000-users] Nek5000-users Digest, Vol 71, Issue 11

Dear Paul,

Thank you very much for your help. Yes, the problem was the jump in y direction. I wasn't aware of the shift in y direction after bending the pipe. The code works fine now.

Just a quick question, if I want to do a U-bend pipe simulation, should I just change my geometry in usrdat2 subroutine or are there any other ways you would suggest?

Thanks again.

Cheers,

Tony

________________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov <nek5000-users-bounces at lists.mcs.anl.gov> on behalf of nek5000-users-request at lists.mcs.anl.gov <nek5000-users-request at lists.mcs.anl.gov>
Sent: 22 January 2015 18:00
To: nek5000-users at lists.mcs.anl.gov
Subject: Nek5000-users Digest, Vol 71, Issue 11

Send Nek5000-users mailing list submissions to
        nek5000-users at lists.mcs.anl.gov

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
or, via email, send a message with subject or body 'help' to
        nek5000-users-request at lists.mcs.anl.gov

You can reach the person managing the list at
        nek5000-users-owner at lists.mcs.anl.gov

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Nek5000-users digest..."


Today's Topics:

   1. Mesh-morphing for bend pipe (nek5000-users at lists.mcs.anl.gov)
   2. Re: Mesh-morphing for bend pipe (nek5000-users at lists.mcs.anl.gov)


----------------------------------------------------------------------

Message: 1
Date: Wed, 21 Jan 2015 21:53:36 +0000
From: nek5000-users at lists.mcs.anl.gov
To: "nek5000-users at lists.mcs.anl.gov"
        <nek5000-users at lists.mcs.anl.gov>
Subject: [Nek5000-users] Mesh-morphing for bend pipe
Message-ID:
        <mailman.13846.1421877222.3424.nek5000-users at lists.mcs.anl.gov>
Content-Type: text/plain; charset="iso-8859-1"

Dear Neks,


I have been looking at the mesh-morphing for a bend pipe recently. I found the thread https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-June/001398.html on how to bend a straight pipe. The code worked perfectly for bending a straight pipe into a 90 degree bend shape. The problem is I need to bend my pipe at certain section, say I have a pipe with total length of 10 and I want to bend it in the second half, i.e. from 5-10. However, when I tried to do it in this way, the error of 'Vanishing Jacobian near Xth node of element XX' appeared and the simulation couldn't start. I can't see why it doesn't work.


Below is the code I'm using to bend the pipe (from 5-10) into a 90 degree bend. Hope someone could help me on this. Any suggestion would be appreciated. Thank you very much in advance.


Kind regards,


Tony


c-----------------------------------------------------------------------
      subroutine usrdat2()  ! This routine to modify mesh coordinates
      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

      xmin = glmin(xm1,n)
      xmax = glmax(xm1,n)
      ymin = glmin(ym1,n)
      ymax = glmax(ym1,n)
      if (nid==0) print *,xmin,xmax,ymin,ymax            !which are 0, 10, -1, 1
      rad0 = 0.5*(ymax-ymin) ! Radius of initial pipe
      rad1 = 1.0            ! Radius of new pipe
      radm = 2.0            ! Major radius of torus

      do i=1,n
         x     = xm1(i,1,1,1)
         y     = ym1(i,1,1,1)

       if (x .gt. 5.0e0) then
         theta = 0.5*pi*(x-5.0e0)/(xmax-5.0e0)
         rad   = radm + 2.0e0*rad1*(y-ymin)/(ymax-ymin)

         ym1(i,1,1,1) = rad*cos(theta)
         xm1(i,1,1,1) = rad*sin(theta)+5.0e0
       end if

      end do

      return
      end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20150121/e9737b3d/attachment-0001.html>

------------------------------

Message: 2
Date: Wed, 21 Jan 2015 22:51:23 +0000
From: nek5000-users at lists.mcs.anl.gov
To: "nek5000-users at lists.mcs.anl.gov"
        <nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Mesh-morphing for bend pipe
Message-ID:
        <mailman.13855.1421880789.3424.nek5000-users at lists.mcs.anl.gov>
Content-Type: text/plain; charset="iso-8859-1"


Hi Tony,

It appears that you shift y, but only for x > 5, so there is a sudden jump in the y value at x=5.

Another possible thing that I didn't check is to make certain that your Rcos theta and R sin theta
transformation preserves the right-hand-rule.  (Your first rotation to x=axial direction does so.)

Often the fastest way to identify these issues is to run a tiny case on one processor and just
dump out all points (x,y,z) and plot them in matlab or via splot in gnuplot.

hth,

Paul

________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov [nek5000-users-bounces at lists.mcs.anl.gov] on behalf of nek5000-users at lists.mcs.anl.gov [nek5000-users at lists.mcs.anl.gov]
Sent: Wednesday, January 21, 2015 3:53 PM
To: nek5000-users at lists.mcs.anl.gov
Subject: [Nek5000-users] Mesh-morphing for bend pipe


Dear Neks,


I have been looking at the mesh-morphing for a bend pipe recently. I found the thread https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-June/001398.html on how to bend a straight pipe. The code worked perfectly for bending a straight pipe into a 90 degree bend shape. The problem is I need to bend my pipe at certain section, say I have a pipe with total length of 10 and I want to bend it in the second half, i.e. from 5-10. However, when I tried to do it in this way, the error of 'Vanishing Jacobian near Xth node of element XX' appeared and the simulation couldn't start. I can't see why it doesn't work.


Below is the code I'm using to bend the pipe (from 5-10) into a 90 degree bend. Hope someone could help me on this. Any suggestion would be appreciated. Thank you very much in advance.


Kind regards,


Tony


c-----------------------------------------------------------------------
      subroutine usrdat2()  ! This routine to modify mesh coordinates
      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

      xmin = glmin(xm1,n)
      xmax = glmax(xm1,n)
      ymin = glmin(ym1,n)
      ymax = glmax(ym1,n)
      if (nid==0) print *,xmin,xmax,ymin,ymax            !which are 0, 10, -1, 1
      rad0 = 0.5*(ymax-ymin) ! Radius of initial pipe
      rad1 = 1.0            ! Radius of new pipe
      radm = 2.0            ! Major radius of torus

      do i=1,n
         x     = xm1(i,1,1,1)
         y     = ym1(i,1,1,1)

       if (x .gt. 5.0e0) then
         theta = 0.5*pi*(x-5.0e0)/(xmax-5.0e0)
         rad   = radm + 2.0e0*rad1*(y-ymin)/(ymax-ymin)

         ym1(i,1,1,1) = rad*cos(theta)
         xm1(i,1,1,1) = rad*sin(theta)+5.0e0
       end if

      end do

      return
      end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20150121/9e502bea/attachment-0001.html>

------------------------------

_______________________________________________
Nek5000-users mailing list
Nek5000-users at lists.mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users


End of Nek5000-users Digest, Vol 71, Issue 11
*********************************************
_______________________________________________
Nek5000-users mailing list
Nek5000-users at lists.mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users


------------------------------

_______________________________________________
Nek5000-users mailing list
Nek5000-users at lists.mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users


End of Nek5000-users Digest, Vol 71, Issue 12
*********************************************


More information about the Nek5000-users mailing list