Setting a pressure inlet

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Stéphane Blanchet

Setting a pressure inlet

Post by Stéphane Blanchet »

Hi everybody,
 
I have some problems to set a pressure inlet for my simulation.

I started my simulation with a velocity inlet, but now, I am more interested about setting a pressure inlet instead. So I changed the usclim.f90 file, and now it seems Code_Saturne only takes into account
the velocity inlet I set for the first time.

Here is my code:

Code: Select all

 iphas=1 
 call getfbr('inlet', nlelt, lstelt) 
   
 do ilelt = 1, nlelt 
   ifac = lstelt(ilelt) 
   iel = ifabor(ifac) 
   
   itypfb(ifac,iphas) = ientre 
   icodcl(ifac,ipr(iphas))=1.d0 
   rcdocl(ifac,ipr(iphas),1)=380.d0 
   icodcl(ifac,iu(iphas)) = 3.d0 
   icodcl(ifac,iv(iphas)) = 3.d0 
   icodcl(ifac,iw(iphas)) = 3.d0 
 enddo 

I really don't know what I am doing wrong, so if you have any idea...
 
Best regards

Stéphane
Stéphane Blanchet

Re: Setting a pressure inlet

Post by Stéphane Blanchet »

Hi,

I changed a little bit the code and copied the usclim.f90 file into the SRC folder (which was maybe a stupid omission from me) and now it works.
 
Thank you anyway.
 
Stéphane
Stéphane Blanchet

Re: Setting a pressure inlet

Post by Stéphane Blanchet »

Hi again,
 
I have another question regarding the pressure inlet. I have seen that the total pressure is calculated as follow: Ptot = Pred + rho0*g*(z-z0) + P0, in my case I set g=0 and the reference value for total pressure (P0?) is 101325, and I need Pred=494. So in the code I use Ptot=494+101325=101819, and after the simulation, I get Pred=519. I'm guessing there is a problem with the reference value for the total pressure, but I don't know where.
 
Thanks in advance,
 
Stephane
Yvan Fournier

Re: Setting a pressure inlet

Post by Yvan Fournier »

Hello,

If you are using usini1.f90, make sure that p0 is set to 101325 Pascals and not just 101300. If you are using the GUI, also check the reference pressure. We have changed this very recently, but the reference pressure was often set at 101300 Pascals instead of 102325, and you have (Pred_expected - Pred_obtained) = (519-494) = 25, which might not be a coincidence.

Best regards,

  Yvan Fournier
Stéphane Blanchet

Re: Setting a pressure inlet

Post by Stéphane Blanchet »

Hello,

Thank you for your answer. I also guessed it was not a coincidence, and indeed p0 was set to 101300 Pa in usini.f90. Now it works just fine!

Best Regards,

Stéphane
Post Reply