<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, Helvetica, EmojiFont, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Dear Hyunduk,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I see several issues with the code you have.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">The first point is that your code will not work properly</p>
<p style="margin-top:0;margin-bottom:0">in parallel, so you need to be careful about parallel treatment</p>
<p style="margin-top:0;margin-bottom:0">of IO if you are running on more than one MPI rank.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Secondly, it's generally not a good idea to test for equality</p>
<p style="margin-top:0;margin-bottom:0">with real numbers -- are you certain that the y values of </p>
<p style="margin-top:0;margin-bottom:0">interest are 0.0000000 ? or are they potentially 1.e-7 (say).</p>
<p style="margin-top:0;margin-bottom:0">Some of the mesh generation tools will have noise and your</p>
<p style="margin-top:0;margin-bottom:0">zero values might not be exactly zero.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">zgm1 is the position of the nodal points on the interval [-1,1]</p>
<p style="margin-top:0;margin-bottom:0">in the reference element</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">area() is the surface area at the top and bottom of each</p>
<p style="margin-top:0;margin-bottom:0">element. (Here, we assume that "top" in z means also</p>
<p style="margin-top:0;margin-bottom:0">top in r-s-t space for the canonical Omega-hat := [-1,1]^3.)</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thus, aa is a linear combination of the area at the top of</p>
<p style="margin-top:0;margin-bottom:0">the given element and bottom of the given element. This</p>
<p style="margin-top:0;margin-bottom:0">way the surface integral can handle tapered elements</p>
<p style="margin-top:0;margin-bottom:0">(but nothing more complex than that).</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">hth,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Paul</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Nek5000-users <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> Tuesday, July 24, 2018 1:34 AM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> [Nek5000-users] Planar average in z-direction problem (image updated)</font>
<div> </div>
</div>
<meta content="text/html; charset=utf-8">
<div>
<div name="x_mp-default" style="font-family:돋움,Dotum; font-size:10pt">
<p><span style="font-family:돋움,Dotum; font-size:10pt">Hi, Neks</span> </p>
<div name="x_mp-default" style="font-family:돋움,Dotum; font-size:10pt">
<p> </p>
<p>I wonder why planar_average_z in navier5.f shows wrong result.</p>
<p>here I attached 2 images.</p>
<p> </p>
<p>1, <a href="https://drive.google.com/file/d/1Kng9HZfQW-TGTFwmFcXzbrcvhRYrQSdc/view?usp=sharing" id="LPlnk678229" class="OWAAutoLink" previewremoved="true">
https://drive.google.com/file/d/1Kng9HZfQW-TGTFwmFcXzbrcvhRYrQSdc/view?usp=sharing</a> </p>
<p>2. <a href="https://drive.google.com/file/d/1FN3i5mE6VSoPeehG5evjC33WrD3J4lB5/view?usp=sharing" id="LPlnk58810" class="OWAAutoLink" previewremoved="true">https://drive.google.com/file/d/1FN3i5mE6VSoPeehG5evjC33WrD3J4lB5/view?usp=sharing</a></p>
<p> </p>
<p> </p>
<p>First image shows the z-directional grids points from zm1</p>
<p>(I wrote a code to extract z coordinate at y = 0 as follows:</p>
<p>======================================================</p>
<p>insnum = nid</p>
<p>insuni = insnum + 1000</p>
<p>WRITE(insnam,98) 'inst_field_', insnum</p>
<p>OPEN(unit=insuni,file=insnam</p>
<p><span style="font-size:13.3333px"> insnum = nid</span></p>
<p><span style="font-size:13.3333px"> insuni = insnum + 1000</span></p>
<p><span style="font-size:13.3333px"> WRITE(insnam,98) 'inst_field_', insnum</span></p>
<p><span style="font-size:13.3333px"> Open(unit=insuni,file=insnam)</span></p>
<p><span style="font-size:13.3333px"> </span></p>
<p><span style="font-size:13.3333px"> do i = 1,n</span></p>
<p><span style="font-size:13.3333px"> if (ym1(i,1,1,1).eq.0.0)then</span></p>
<p><span style="font-size:13.3333px"> WRITE(insuni,5) xm1(i,1,1,1)</span></p>
<p><span style="font-size:13.3333px"> % , zm1(i,1,1,1)</span></p>
<p><span style="font-size:13.3333px"> % , vx(i,1,1,1)</span></p>
<p><span style="font-size:13.3333px"> % , vy(i,1,1,1)</span></p>
<p><span style="font-size:13.3333px"> % , vz(i,1,1,1)</span></p>
<p><span style="font-size:13.3333px"> % , phig(i,1,1,1)</span></p>
<p><span style="font-size:13.3333px"> endif</span></p>
<p><span style="font-size:13.3333px"> </span></p>
<p><span style="font-size:13.3333px"> enddo</span></p>
<p><span style="font-size:13.3333px"> CLOSE(insuni)</span></p>
<p><span style="font-size:13.3333px"></span><span style="font-size:10pt">======================================================</span></p>
<p><span style="font-size:13.3333px"> </span></p>
<p><span style="font-size:13.3333px">Then, I can collect lots of field data from each processor and sort data with ascending order using matlab.</span></p>
<p>So, I got the result as 1st image. </p>
<p><span style="font-size:13.3333px"> </span></p>
<p><span style="font-size:13.3333px">But when I use plannar_average_z </span></p>
<p>I got the result as shown in 2nd image.</p>
<p><span style="font-size:10pt">1. I really want to modify the problems, so could you give me your idea on this problem?</span> </p>
<p>2. Additionally, could you explain 'zgm1' and 'area'?</p>
<p>I noticed that, planar_average_r or s ... in turbChannel case has also 'area' but, those case are used to calculate on <span style="font-size:10pt">different direction.<br>
But they used same input parameters. </span></p>
<p><span style="font-size:10pt"> </span></p>
<p><span style="font-size:10pt">What I understand about area is, surface area of element.</span></p>
<p><span style="font-size:10pt">But I thought that different direction needs different indexing </span></p>
<p><span style="font-size:10pt"> </span></p>
<p>=======================================================</p>
<p><span style="font-size:13.3333px"> subroutine planar_average_z(ua,u,w1,w2)</span></p>
<p><span style="font-size:13.3333px">c</span></p>
<p><span style="font-size:13.3333px">c Compute r-s planar average of quantity u()</span></p>
<p><span style="font-size:13.3333px">c</span></p>
<p><span style="font-size:13.3333px"> include 'SIZE'</span></p>
<p><span style="font-size:13.3333px"> include 'GEOM'</span></p>
<p><span style="font-size:13.3333px"> include 'PARALLEL'</span></p>
<p><span style="font-size:13.3333px"> include 'WZ'</span></p>
<p><span style="font-size:13.3333px"> include 'ZPER'</span></p>
<p><span style="font-size:13.3333px">c</span></p>
<p><span style="font-size:13.3333px"> real ua(lz1,nelz),u(lx1*ly1,lz1,nelv),w1(lz1,nelz),w2(lz1,nelz)</span></p>
<p><span style="font-size:13.3333px"> integer e,eg,ez</span></p>
<p><span style="font-size:13.3333px">c</span></p>
<p><span style="font-size:13.3333px"> melxy = nelx*nely</span></p>
<p><span style="font-size:13.3333px">c</span></p>
<p><span style="font-size:13.3333px"> nz = lz1*nelz</span></p>
<p><span style="font-size:13.3333px"> call rzero(ua,nz)</span></p>
<p><span style="font-size:13.3333px"> call rzero(w1,nz)</span></p>
<p><span style="font-size:13.3333px">c</span></p>
<p><span style="font-size:13.3333px"> do e=1,nelt</span></p>
<p><span style="font-size:13.3333px">c </span><span style="font-size:10pt"> </span></p>
<p><span style="font-size:10pt"> eg = lglel(e)</span></p>
<p><span style="font-size:13.3333px">c ez = 1 + (eg-1)/melxy</span></p>
<p><span style="font-size:13.3333px"> call get_exyz(ex,ey,ez,eg,nelx,nely,nelz)</span></p>
<p><span style="font-size:13.3333px">c</span></p>
<p><span style="font-size:13.3333px"> do k=1,lz1</span></p>
<p><span style="font-size:13.3333px"> do i=1,lx1*ly1</span></p>
<p><span style="font-size:13.3333px"> zz = (1.-zgm1(k,3))/2. ! = 1 for k=1, = 0 for k=lz1</span></p>
<p><span style="font-size:13.3333px"> aa = zz*area(i,1,5,e) + (1-zz)*area(i,1,6,e) ! wgtd jacobian</span></p>
<p><span style="font-size:13.3333px"> w1(k,ez) = w1(k,ez) + aa</span></p>
<p><span style="font-size:13.3333px"> ua(k,ez) = ua(k,ez) + aa*u(i,k,e)</span></p>
<p><span style="font-size:13.3333px"> enddo</span></p>
<p><span style="font-size:13.3333px"> enddo</span></p>
<p><span style="font-size:13.3333px"> enddo</span></p>
<p><span style="font-size:13.3333px">c</span></p>
<p><span style="font-size:13.3333px"> call gop(ua,w2,'+ ',nz)</span></p>
<p><span style="font-size:13.3333px"> call gop(w1,w2,'+ ',nz)</span></p>
<p><span style="font-size:13.3333px">c</span></p>
<p><span style="font-size:13.3333px"> do i=1,nz</span></p>
<p><span style="font-size:13.3333px"> ua(i,1) = ua(i,1) / w1(i,1) ! Normalize</span></p>
<p><span style="font-size:13.3333px"> enddo</span></p>
<p><span style="font-size:13.3333px">c</span></p>
<p><span style="font-size:13.3333px"> return</span></p>
<p><span style="font-size:13.3333px"> end</span></p>
<p><span style="font-size:10pt">======================================================</span></p>
<p><span style="font-size:10pt"> </span></p>
<p><span style="font-size:10pt">Regards,</span></p>
<p><span style="font-size:10pt"> </span></p>
<p><span style="font-size:10pt">Hyunduk.</span></p>
<p><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">------------------------------</span><wbr style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">------------------------------------------------------------------------------------</span></p>
<p><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">Hyunduk Seo (Mr.)</span></p>
<p><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">Integrated Ph.D. course, Schoo</span><wbr style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">l of Mechanical Engineering, </span><wbr style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">Pusan National University</span><span style="font-size:10pt"></span></p>
<p><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">Experimental Thermo-Flui</span><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">ds Mec</span><wbr style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">hanics and Energy Systems (ExT</span><wbr style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">ENsys) Laboratory</span></p>
<p><a href="http://fluid.pusan.ac.kr/" target="_blank" style="color:rgb(17,85,204); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)" id="LPlnk160152" class="OWAAutoLink" previewremoved="true">http://fluid.pusan.ac.kr</a><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)"> </span><br style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">T.: +82-51-510-1536 M.: +82-10</span><wbr style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34); font-family:arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">-2964-0994</span></p>
<p> </p>
</div>
</div>
<img src="http://webmail.pusan.ac.kr/api/notify.php?home=MjAxODA3MjQxNTM0MTR8bmVrNTAwMC11c2Vyc0BsaXN0cy5tY3MuYW5sLmdvdnxoZHNlbzAxMjNAcHVzYW4uYWMua3I="></div>
</div>
</div>
</body>
</html>