<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style><style type="text/css" id="owaParaStyle"></style>
</head>
<body dir="ltr" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div><br>
</div>
Hi Tony,
<div><br>
</div>
<div>It appears that you shift y, but only for x > 5, so there is a sudden jump in the y value at x=5.</div>
<div><br>
</div>
<div>Another possible thing that I didn't check is to make certain that your Rcos theta and R sin theta</div>
<div>transformation preserves the right-hand-rule. (Your first rotation to x=axial direction does so.)</div>
<div><br>
</div>
<div>Often the fastest way to identify these issues is to run a tiny case on one processor and just</div>
<div>dump out all points (x,y,z) and plot them in matlab or via splot in gnuplot.</div>
<div><br>
</div>
<div>hth,</div>
<div><br>
</div>
<div>Paul</div>
<div><br>
</div>
<div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF973121" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> nek5000-users-bounces@lists.mcs.anl.gov [nek5000-users-bounces@lists.mcs.anl.gov] on behalf of nek5000-users@lists.mcs.anl.gov [nek5000-users@lists.mcs.anl.gov]<br>
<b>Sent:</b> Wednesday, January 21, 2015 3:53 PM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> [Nek5000-users] Mesh-morphing for bend pipe<br>
</font><br>
</div>
<div></div>
<div>
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Dear Neks,</p>
<p><br>
</p>
<p>I have been looking at the mesh-morphing for a bend pipe recently. I found the thread
<a id="LPlnk588114" href="https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-June/001398.html" target="_blank">
https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-June/001398.html</a> 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.<br>
</p>
<p><br>
</p>
<p>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.</p>
<p><br>
</p>
<p>Kind regards,<br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
Tony<br>
<br>
<br>
c-----------------------------------------------------------------------<br>
subroutine usrdat2() ! This routine to modify mesh coordinates<br>
include 'SIZE'<br>
include 'TOTAL'<br>
<br>
n = nx1*ny1*nz1*nelv<br>
<br>
c First, rotate x into axial position<br>
do i=1,n<br>
x_original = xm1(i,1,1,1)<br>
y_original = ym1(i,1,1,1)<br>
z_original = zm1(i,1,1,1)<br>
<br>
xm1(i,1,1,1) = z_original<br>
ym1(i,1,1,1) = y_original<br>
zm1(i,1,1,1) = -x_original<br>
enddo<br>
<br>
c Second, bend pipe into 90 degree bend<br>
<br>
xmin = glmin(xm1,n)<br>
xmax = glmax(xm1,n)<br>
ymin = glmin(ym1,n)<br>
ymax = glmax(ym1,n)<br>
if (nid==0) print *,xmin,xmax,ymin,ymax !which are 0, 10, -1, 1<br>
rad0 = 0.5*(ymax-ymin) ! Radius of initial pipe<br>
rad1 = 1.0 ! Radius of new pipe<br>
radm = 2.0 ! Major radius of torus<br>
<br>
do i=1,n<br>
x = xm1(i,1,1,1)<br>
y = ym1(i,1,1,1)<br>
<br>
if (x .gt. 5.0e0) then<br>
theta = 0.5*pi*(x-5.0e0)/(xmax-5.0e0)<br>
rad = radm + 2.0e0*rad1*(y-ymin)/(ymax-ymin)<br>
<br>
ym1(i,1,1,1) = rad*cos(theta)<br>
xm1(i,1,1,1) = rad*sin(theta)+5.0e0<br>
end if<br>
<br>
end do<br>
<br>
return<br>
end<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>