How to set the pressure inlet boundary conditions in version 4.0?

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
yhuang
Posts: 32
Joined: Tue Mar 27, 2012 2:14 pm

How to set the pressure inlet boundary conditions in version 4.0?

Post by yhuang »

hello,
How to set the pressure inlet boundary conditions in version 4.0?
The case is an incompressible fluid. I want to fix total pressure of the inlet and static pressure of the outlet.
thanks!
yhuang
Posts: 32
Joined: Tue Mar 27, 2012 2:14 pm

Re: How to set the pressure inlet boundary conditions in version 4.0?

Post by yhuang »

I set the outlet as "isolib" and the inlet like this in “cs_user_boundary_conditions.f90” . But it was divergence.
itypfb(ifac)=iindef

icodcl(ifac,ipr) = 1
rcodcl(ifac,ipr,1) = 1.e5

icodcl(ifac,iu) = 3
rcodcl(ifac,iu,3) = 0

icodcl(ifac,iv) = 3
rcodcl(ifac,iv,3) = 0

icodcl(ifac,iw) = 3
rcodcl(ifac,iw,3) = 0
Yvan Fournier
Posts: 4069
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to set the pressure inlet boundary conditions in version 4.0?

Post by Yvan Fournier »

Hello,

I am not sure how this combination would work, relative to the outlet pressure.

If you impose both inlet and outlet pressures, you have more chances of running correctly, but thi is often more tricky to set up than imposing an inlet velocity.

Best regards,

Yvan
Tsubasa
Posts: 175
Joined: Fri Nov 20, 2020 4:09 am

Re: How to set the pressure inlet boundary conditions in version 4.0?

Post by Tsubasa »

Hello yhuang,

In version 6.0.5,
for pressure inlet boundary condition, I can ues this,
_________________________________
call getfbr('inlet', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
itypfb(ifac) = ientre

!Dirichlet B.C for pressure:
icodcl(ifac,ipr) = 1
rcodcl(ifac,ipr,1) = 101325.633

!Neumann B.C for velocity:
icodcl(ifac,iu)= 3
icodcl(ifac,iv)= 3
icodcl(ifac,iw)= 3
enddo
_________________________________

But you should keep in mind that
calculation often become divergent if you use tetra mesh.

Best regards,
Tsubasa
Last edited by Tsubasa on Tue Jul 20, 2021 1:07 am, edited 1 time in total.
Yvan Fournier
Posts: 4069
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to set the pressure inlet boundary conditions in version 4.0?

Post by Yvan Fournier »

Hello,

computations are often less stable on lower quality/less regular meshes, but that does not mean they automatically diverge...

Best regards,

Yvan
Post Reply