follow of boundary condition in a file

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Alexandre Guilloux

follow of boundary condition in a file

Post by Alexandre Guilloux »

Hi

I have a question concerning the follow of boundary condition write in the subroutine usclim.f90.

My simulation is a room with a heater.

The temperature of the heater depend on the temperature in a cell volume (which is calculate in the subroutine usproj.f90)

This is my code in the subroutine usclim.f90

Code: Select all

CALL GETFBR('x>=4.9 and x<=5.1 and y>=-2 and y<=0 and z>=0 and z<=1',NLELT,LSTELT) 
   
    !Température de consigne de la pièce 
    TempCon = 25.d0 
   
    If (Temppiece < TempCon) then 
        !Radiateur allume 
      TempRadia = 70.d0 
        Do ilelt = 1, nlelt 
             ifac = lstelt(ilelt) 
             ITYPFB(IFAC,IPHAS)=IPAROI 
          rcodcl(ifac,isca(1),1) = TempRadia 
        enddo 
        etatradia = 1.d0 
     else 
      !     !Radiateur égal à la
température de la pièce 
      Do ilelt = 1, nlelt 
              TempRadia = Temppiece 
              ifac = lstelt(ilelt) 
              ITYPFB(IFAC,IPHAS)=IPAROI 
              rcodcl(ifac,isca(1),1) =
TempRadia 
          enddo 
      etatradia = 0.d0 
    endif
Is it possible to write a file in the subroutine usclim.f90? I want the variable etatradia to each time step.

Best regards
Yvan Fournier

Re: follow of boundary condition in a file

Post by Yvan Fournier »

Hello,
If you simply want a trace of the on/off status, yes, you may easily write a file from usclim. Just be careful to open the file at the first time step only (or to close it and re-open it in append mode), and to open it only on one processor if you are running in parallel (the examples in usproj.f90 may be adapted to what you want to do in usclim.f90).
Best regards,
  Yvan
Alexandre Guilloux

Re: follow of boundary condition in a file

Post by Alexandre Guilloux »

Hi,
Thank for the rapidity of your answer
I forgot the test on one processor, now it's work correctly.
 
Best regards,
Alexandre
Post Reply