<div dir="ltr"><br><div>You need to have the discontinuous heat flux be  prescribed in a discontinuous way.</div><div>This can be done by having element boundaries at precisely the start and stop points</div><div>of the top hat region and then using a check to see if the element in question is</div><div>within that region.</div><div><br></div><div>Below is a sample userbc routine that should work if the top hat region is on (0,4)</div><div>and that you have prescribed "f  " BCs for temperature along the walls (or a mixture</div><div>of "f   " and "I   ").    Note that "f   " with zero flux behaves the same as "I  " (insulated).</div><div><br></div><div>hth, Paul</div><div><br></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier">c-----------------------------------------------------------------------</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>subroutine userbc(i,j,k,f,eg) ! set up boundary conditions</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier">c <span class="gmail-Apple-converted-space">    </span>NOTE:<span class="gmail-Apple-converted-space">  </span>This subroutine is not guaranteed to be called by each rank.</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>include 'SIZE'</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>include 'TOTAL'</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>include 'NEKUSE'</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>integer e,f,eg</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;min-height:16px"><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>ux <span class="gmail-Apple-converted-space">  </span>= 0.0</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>uy <span class="gmail-Apple-converted-space">  </span>= 0.0</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>uz <span class="gmail-Apple-converted-space">  </span>= 1-4*(x*x+y*y) <span class="gmail-Apple-converted-space">            </span>! Parabolic inflow for radius=0.5</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>temp = 1.0 <span class="gmail-Apple-converted-space">                      </span>! Temperature at inlet</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;min-height:16px"><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>e<span class="gmail-Apple-converted-space">  </span>= gllel(eg)</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>zi = zm1(1,1,2,e)<span class="gmail-Apple-converted-space">                </span>! Interior z location</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;min-height:16px"><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>flux = 0.0 <span class="gmail-Apple-converted-space">                      </span>! Zero flux</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>if (0.lt.zi.and.zi.lt.4) flux=1<span class="gmail-Apple-converted-space">  </span>! Flux only on interior region</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;min-height:16px"><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>return</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><span class="gmail-Apple-converted-space">      </span>end</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier">c-----------------------------------------------------------------------</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier"><br></p></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 30, 2018 at 7:04 AM nek5000-users--- via Nek5000-users <<a href="mailto:nek5000-users@lists.mcs.anl.gov">nek5000-users@lists.mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">

<p style="margin-bottom:0in;line-height:108%"><span style="font-size:11pt">Hi Neks,</span></p>
<p style="margin-bottom:0in;line-height:108%"><a name="m_3793964603257801781__GoBack"></a><span style="font-size:11pt"></span><br style="font-size:11pt">
<span style="font-size:11pt"></span></p>
<p style="margin-bottom:0in;line-height:108%"><span style="font-size:11pt">i am calculating a laminar pipe flow. The temperature boundary conditions are a fixed fluid temperature at the entrance and a constant wall heat flux over a short section in the
 middle oft the pipe. The remaining pipe wall is adiabatic. For the velocity field I assume periodic BCs.</span></p>
<p style="margin-bottom:0in;line-height:108%"><span style="font-size:11pt">Because the given heat flux contour over the axial coordinate should be an ideal hat-function, I expected the temperature gradient to have the same contour.</span></p>
<p style="margin-bottom:0in;line-height:108%"><span style="font-size:11pt">But when calculating the temperature gradient at the wall, the resulting temperature gradient contour doesn´t represent an ideal hat-function but a more rounded down contour.</span></p>
<p style="margin-bottom:0in;line-height:108%"><span style="font-size:11pt">Now I am wondering, if Nek can not implement the given heat flux BC correctly. Did anybody have similar experiences?
</span></p>
<p style="margin-bottom:0in;line-height:108%"><span style="font-size:11pt"><br>
</span></p>
<p style="margin-bottom:0in;line-height:108%"><span style="font-size:11pt">Thank you!</span></p>
<p style="margin-bottom:0in;line-height:108%"><span style="font-size:11pt">Theresa</span></p>
<p><br>
</p>
</div>

_______________________________________________<br>
Nek5000-users mailing list<br>
<a href="mailto:Nek5000-users@lists.mcs.anl.gov" target="_blank">Nek5000-users@lists.mcs.anl.gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users</a><br>
</blockquote></div>