pressure inlet boundary condition

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
jmcabaleiro
Posts: 9
Joined: Tue Aug 05, 2014 2:56 pm

pressure inlet boundary condition

Post by jmcabaleiro »

Bonjour, j'ai un souci lorsque je veux imposer une pression comme condition de bord: mon problème c'est un jet 2D, avec une entrée ou je peux fixer soit la vitesse, soit la pression, puis plusieurs sorties ou j'utilise isolib bc.

Si je fixe la vitesse à l'entrée:

call getfbr('3',nlelt,lstelt)
! ===========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
itypfb(ifac) = ientre
ICODCL(IFAC,IU)= 1
RCODCL(IFAC,IU,1) = 0.0D0
ICODCL(IFAC,IV)= 1
RCODCL(IFAC,IV,1) = 2.0D0
ICODCL(IFAC,IW)= 1
RCODCL(IFAC,IW,1) = 0.0D0
enddo

tout va bien, et j'obtiens une pression de 200 Pa à l'entrée pour une vitesse imposée de 2m/s (j'ai un petit canal ou un écoulement laminaire se développe et c'est dans ce canal que les 200 Pa chutent, la sortie de ce canal est à une enceinte a pression ambient).

Maintenant si j'impose la pression à 200 Pa à l'entrée:
call getfbr('3',nlelt,lstelt)
! ===========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
itypfb(ifac) = ientre
ICODCL(IFAC,IPR)= 1
RCODCL(IFAC,IPR,1) = 200.d0

ICODCL(IFAC,IU)= 3
ICODCL(IFAC,IV)= 3
ICODCL(IFAC,IW)= 3
enddo

j'obtiens une vitesse nulle sur tout le domaine de calcul.

Oú est-ce que je me trompe?
En outre, vaut il mieux utiliser ifrent BC au lieu de isolib bc pour les sorties?
Attachments
cs_user_boundary_conditions.f90
(22.51 KiB) Downloaded 262 times
cs_user_parameters.f90
(90.51 KiB) Downloaded 243 times
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: pressure inlet boundary condition

Post by Yvan Fournier »

Hello,

In an effort to make this forum accessible to a larger audience, and encourage users to search answers in previous posts, we prefer that posts remain in English language.

So please use English for your questions. Do not also forget to follow the general forum recommendations (as regards supplied details), otherwise our first answers are usually more questions.

Regards,

Yvan Fournier
jmcabaleiro
Posts: 9
Joined: Tue Aug 05, 2014 2:56 pm

Re: pressure inlet boundary condition

Post by jmcabaleiro »

Ok sorry, I translate my question:
I would like to impose a dirichlet bc for the pressure: I'm running a 2d case of a jet, with an inlet where I can either impose a velocity or a pressure, and then this channel flow will exit into a chamber (a box with exit bc where I use isolib bc).

if I fix the velocity at the entry by doing:

call getfbr('3',nlelt,lstelt)
! ===========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
itypfb(ifac) = ientre
ICODCL(IFAC,IU)= 1
RCODCL(IFAC,IU,1) = 0.0D0
ICODCL(IFAC,IV)= 1
RCODCL(IFAC,IV,1) = 2.0D0
ICODCL(IFAC,IW)= 1
RCODCL(IFAC,IW,1) = 0.0D0
enddo

Everything works fine, I get a pressure of 200 Pa at the inlet for a 2m/s inlet.

If I run a new calculation imposing a pressure of 200 Pa at the inlet, and homogeneus newmann bc for the velocity:

call getfbr('3',nlelt,lstelt)
! ===========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
itypfb(ifac) = ientre
ICODCL(IFAC,IPR)= 1
RCODCL(IFAC,IPR,1) = 200.d0

ICODCL(IFAC,IU)= 3
ICODCL(IFAC,IV)= 3
ICODCL(IFAC,IW)= 3
enddo

I get zero pressure and zero velocity in all the domain.
What am I doing wrong?

Secondly, is it better to use ifrent BC instead of isolib BC for the exit faces?

Thirdly, when is it advised to use ipucou=1 (reinforded pressure velocity coupling?), is it related to the reference dt (I use dt fixed in time and space)? for larger dtref it seams ipucou=1 produces better results (calculation is slower though).

Thank you and sorry for the previous post in french.
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: pressure inlet boundary condition

Post by Yvan Fournier »

Hello,

If you want to use a pressure drop to drive the flow, you probably need to specify both the inlet and outlet pressures, so as to impose a pressure difference. This is rarely used (to my knowledge) compared to imposing an inlet velocity.

I am not too sure for your second and third questions, so I welcome colleagues (or others) to help me answer... I think the ipucou option has existed since version 1.0, and is designed or improved velocity/pressure coupling, but am not familiar with specific cases where it improves things. It is not surprising that increasing the time step slows the computation (on one of our standard benchmarks, increasing the time step value increases the cost per time step, so using larger time steps may not always bring a significant improvement (we need to improve convergence speed and computational cost for steady flows).

Best regards,

Yvan
jmcabaleiro
Posts: 9
Joined: Tue Aug 05, 2014 2:56 pm

Re: pressure inlet boundary condition

Post by jmcabaleiro »

Thank you Yvan for your answer. I am already imposing pressure (0 Pa) at the outlet also. What I want to know is if one can impose a pressure difference and let the flow adapt to that condition in Code_Saturne. I agree with you it is more common to impose velocity at the inlet, but I want to compare the results to experiments were I impose pressure, not velocity.
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: pressure inlet boundary condition

Post by Yvan Fournier »

Hello,

I am not 100% sure, but it should work. It is recommended to use orthogonal meshes at outlets (at least for Neumann BC's, but it won't do any harm for Dirrchlet), so having an extruded layer at boundaries may help.

In any case, I suggest testing it, at least on a small mesh where you won't lose too much time if it does not work.

Best regards,

Yvan
Post Reply