<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p><br>
</p>
<p>Dear Juan Pablo,</p>
<p><br>
</p>
<p>Something like this should work in 2D and 3D , which can be put in userchk.</p>
<p><br>
</p>
<p>hth</p>
<p>Paul</p>
<p><br>
</p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">
<span style="font-variant-ligatures: no-common-ligatures"></span><br>
</p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> integer e,f</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> real one(lx1*ly1*lz1*lelt)</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">
<span style="font-variant-ligatures: no-common-ligatures"></span><br>
</p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> n = lx1*ly1*lz1*nelt</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">
<span style="font-variant-ligatures: no-common-ligatures"></span><br>
</p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> call rone(one,n)</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">
<span style="font-variant-ligatures: no-common-ligatures"></span><br>
</p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> vavg = 0.0 ! Numerator</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> davg = 0.0 ! Denominator</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">
<span style="font-variant-ligatures: no-common-ligatures"> </span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> do e=1,nelt</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> do f=1,2*ndim</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> if (cbc(e,f,1).eq.'v ') vavg = vavg + facint_v(vy ,area,f,e)</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> if (cbc(e,f,1).eq.'v ') davg = davg + facint_v(one,area,f,e)</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> enddo</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> enddo</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> vavg = glsum(vavg,1) ! Sum across all processors</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> davg = glsum(davg,1) </span></p>
<p></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">
<span style="font-variant-ligatures: no-common-ligatures"> if (davg.gt.0) vavg = vavg / davg</span></p>
<div><span style="font-variant-ligatures: no-common-ligatures"><br>
</span></div>
</div>
<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> Sunday, September 24, 2017 3:26:32 PM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> [Nek5000-users] Planar average subroutines</font>
<div> </div>
</div>
<div>
<div dir="ltr">Dear Neks, I need to calculate the average UY velocity in the top face of my domain, every timestep. That face is the only one with "v " BC, so I think it is easier to identify the elements.
<div><br>
</div>
<div>Now I need to do it in 2D, but soon I'll have to do it in 3D.</div>
<div><br>
</div>
<div>I've been reading something about planar_average_z subroutine, and also planar_average_xy (for exemple). In navier5 I found only planar_average_z.</div>
<div><br>
</div>
<div>Any idea of how could use this subroutine to calculate the UY average in the top face?</div>
<div><br>
</div>
<div>Thank you.</div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div>Juan Pablo.</div>
</div>
</div>
</body>
</html>