[Nek5000-users] Dirichlet BC for scalars

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Tue Oct 25 03:07:51 CDT 2016


I found the problem finally. I used P007 (RHOCP) = 0.

Changing to 1 made it work.


/Johan

________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov <nek5000-users-bounces at lists.mcs.anl.gov> on behalf of nek5000-users at lists.mcs.anl.gov <nek5000-users at lists.mcs.anl.gov>
Sent: Monday, October 3, 2016 10:15 AM
To: nek5000-users at lists.mcs.anl.gov
Subject: [Nek5000-users] Dirichlet BC for scalars


I am a new user of Nek, and am learning to possibilities of the program.


I have successfully implemented a lid-driven cavity.

I now want to, in addidtion, solve the problem for a scalar with certain boundary conditions (I did choose the temperature for this).


I use the .box file:


reafile.rea
2
2
#
Box 1
-20 -20
0.0 1.0 1.0
0.0 1.0 1.0
W  ,W  ,W  ,v  ,
t  ,t  ,O  ,I  ,


Thus: the domains is a 2D 1x1 square where:

* The y = 1 boundary is the "lid" whose velocity can be set in the .usr file (Dirichlet BC)

* The vertical walls also have Dirichlet BC

* The bottom wall is an "open boundary" for the temperature

* The top wall is a n "insulator" for the temperature


Given the .rea file generated with this .box file, I set the initial conditions in useric:


      subroutine useric (ix,iy,iz,ieg)
      include 'SIZE'
      include 'TOTAL'
      include 'NEKUSE'
      ux=0.0
      uy=0.0
      uz=0.0
      temp=0
      return
      end


I set the Dirichlet BC in userbc:


      subroutine userbc (ix,iy,iz,iside,ieg)
c     NOTE ::: This subroutine MAY NOT be called by every process
      include 'SIZE'
      include 'TOTAL'
      include 'NEKUSE'

      ux=1
      uy=0.0
      uz=0.0
      temp=x

      return
      end


I expected this to initialize the velocity and temperature to zero in the entire domain, except for:

* Top boundary has velocity 1 in the x-direction

* The right boundary has temperature 1


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".

However, the velocity boundary condition works as I expected, and is set only for the "v" boundaries.


What am I doing wrong here? How may I set up dirichlet BC for  the temperature?






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20161025/9a79be08/attachment.html>


More information about the Nek5000-users mailing list