Possible to impose Dirichlet condition for velocity and pressure at the same time?

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Tsubasa
Posts: 175
Joined: Fri Nov 20, 2020 4:09 am

Possible to impose Dirichlet condition for velocity and pressure at the same time?

Post by Tsubasa »

Hello,

This might be a stupid question.

Now I am wondering if we can impose the Dirichlet condition for velocity and pressure on the same surface at the same time.
In my simulation, the problem in pressure-driven flow is that it cannot take into account the flow of vertical direction if we use pressure Dirichlet condition at the inlet and outlet. Flow is always normal to the inlet surface.
But I want to give some vertical components for this flow.

So questions are:
- Is it stupid to give Dirichlet for pressure and velocity at the same time on the same surface?
- If not stupid, can we do that in code_saturne?
I tried to give Dirichlet for velocity and pressure, but in code_satune, I could not give them at the same time. Only one of two conditions (velocity or pressure) was imposed, not both.

Best regards,
Hamada
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Possible to impose Dirichlet condition for velocity and pressure at the same time?

Post by Yvan Fournier »

Hello,

As long a the boundary conditions are not over-constrained, I would find it logical to be able to set both a velocity and pressure condition at an inlet, and let the code determine the outlet pressure based on the flow and head loss.

I am not sure this is handled in code_saturne, though, as I do not remember anyone trying to do that...

You have 2 solutions :
- check the source code for this
- experiment on a simple (very small) case.

The second solution is obviously easier/faster.

One related issue I am not sure about is whether pressure BC's take into account the gravity terms or not (I am afraid they do not). Here again, experimenting on a simple case, turning gravity on/off should help.

And finally, even if you cannot prescribe the inlet pressure, you should be able to get an equivalent behavior adapting the reference pressure for the outlet.

Best regards,

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

Re: Possible to impose Dirichlet condition for velocity and pressure at the same time?

Post by Tsubasa »

Hello Yvan,

I tested the following boundary conditions.

For Vx and Vz at the inlet, I gave Dirichlet conditions and for Vy at the inlet I gave Neumann conditions.
The subroutine code is here:

Code: Select all

call getfbr('inlet', nlelt, lstelt)
do ilelt = 1, nlelt
   ifac = lstelt(ilelt)
   itypfb(ifac) = ientre

!Dirichlet B.C for velocity and k and omega:
   icodcl(ifac,iu) = 1
   rcodcl(ifac,iu,1) = iu_narray(ntcabs)

   icodcl(ifac,iw) = 1
   rcodcl(ifac,iw,1) = iw_narray(ntcabs)

!Neumann B.C for velocity:
   icodcl(ifac,iv)= 3
enddo
With this code, I gave "Imposed P outlet" for the outlet.

However, when I check the result, it seems that Vy velocity has a value which I setup in GUI. I hope this value is overwritten with the subroutine.

My code is not correct to gibe these bonditions?
- Vx; Dirichlet
- Vy: Neumann
- Vz" Dirichlet

Best regards,
Tsubasa

Best regards,
Hamada
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Possible to impose Dirichlet condition for velocity and pressure at the same time?

Post by Yvan Fournier »

Hello,

Velocity is solved as a vector, so you should not set different boundary condition types for different components. So you need to use another boundary condition definition, one that works for the whole {Vx, Vy, Vz} vector.

Regards,

Yvan.
Post Reply