<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:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>I am a new user of Nek, and am learning to possibilities of the program.</p>
<p><br>
</p>
<p>I have successfully implemented a lid-driven cavity.</p>
<p>I now want to, in addidtion, solve the problem for a scalar with certain boundary conditions (I did choose the temperature for this).</p>
<p><br>
</p>
<p>I use the .box file:</p>
<p><br>
</p>
<p>reafile.rea<br>
2<br>
2<br>
#<br>
Box 1<br>
-20 -20<br>
0.0 1.0 1.0<br>
0.0 1.0 1.0<br>
W  ,W  ,W  ,v  ,<br>
t  ,t  ,O  ,I  ,<br>
</p>
<p><br>
</p>
<p>Thus: the domains is a 2D 1x1 square where:</p>
<p>* The y = 1 boundary is the "lid" whose velocity can be set in the .usr file (Dirichlet BC)</p>
<p>* The vertical walls also have Dirichlet BC</p>
<p>* The bottom wall is an "open boundary" for the temperature</p>
<p>* The top wall is a n "insulator" for the temperature</p>
<p><br>
</p>
<p>Given the .rea file generated with this .box file, I set the initial conditions in useric:</p>
<p><br>
</p>
<p><br>
      subroutine useric (ix,iy,iz,ieg)<br>
      include 'SIZE'<br>
      include 'TOTAL'<br>
      include 'NEKUSE'<br>
      ux=0.0<br>
      uy=0.0<br>
      uz=0.0<br>
      temp=0<br>
      return<br>
      end</p>
<p><br>
</p>
<p>I set the Dirichlet BC in userbc:</p>
<p><br>
</p>
<p>      subroutine userbc (ix,iy,iz,iside,ieg)<br>
c     NOTE ::: This subroutine MAY NOT be called by every process<br>
      include 'SIZE'<br>
      include 'TOTAL'<br>
      include 'NEKUSE'<br>
<br>
      ux=1<br>
      uy=0.0<br>
      uz=0.0<br>
      temp=x<br>
<br>
      return<br>
      end<br>
</p>
<p><br>
</p>
<p>I expected this to initialize the velocity and temperature to zero in the entire domain, except for:</p>
<p>* Top boundary has velocity 1 in the x-direction</p>
<p>* The right boundary has temperature 1</p>
<p><br>
</p>
<p>But when I visualize the results of the simulation, I find that the temperature is set to "x" in the entire domain, not only at the boundarys that "should be set".</p>
<p>However, the velocity boundary condition works as I expected, and is set only for the "v" boundaries.<br>
</p>
<p><br>
</p>
<p>What am I doing wrong here? How may I set up dirichlet BC for  the temperature?<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
</div>
</body>
</html>