Page 1 of 1

Inlet pressure boundary condition

Posted: Mon Aug 30, 2021 9:46 am
by lorenzo.iron
Good morning,

I'd like to impose an inlet pressure instead of an inlet flow. I understand that it is required to use a subroutine but I don't know how to do it. So far I just learned to use the GUI.

Even though the analisys could be less stable, it would suite directly my problem and experimental conditions.

Of course, I'll impose also an outlet pressure, easily using the GUI as already implemented.

Can you guide me in arranging this inlet pressure boundary condition subroutine?

Thank you.
Lorenzo

Re: Inlet pressure boundary condition

Posted: Mon Aug 30, 2021 12:48 pm
by Yvan Fournier
Hello,

Did you use the search feature on this form ? If I remember correctly, there is a relatively recent (no more than 2 years) example for this, which you can try to follow (as a general recommendation, avoid examples that are very old, but search for relatively recent examples of similar threads).

Best regards.

Re: Inlet pressure boundary condition

Posted: Mon Aug 30, 2021 5:45 pm
by Tsubasa
Hello,

You should add the following code in "cs_user_boundary_condition.f90" for pressure inlet boundary condition.
This code also include pressure boundaty condition for outlet just in case, but you can do it in GUI as you said.

Code: Select all

!===============================================================================
! Assign boundary conditions to boundary faces here

! For each subset:
! - use selection criteria to filter boundary faces of a given subset
! - loop on faces from a subset
!   - set the boundary condition for each face
!===============================================================================
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 //pressure value you want

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


call getfbr('outlet', nlelt, lstelt)
do ilelt = 1, nlelt
   ifac = lstelt(ilelt)
   itypfb(ifac) = isolib

!Dirichlet B.C for pressure:
   icodcl(ifac,ipr) = 1
   rcodcl(ifac,ipr,1) = 101325.000 //pressure value you want

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

!--------
! Formats
!--------
If your inlet boundary has another name insted of "inlet", which can be set in e.g. Salome when you make a geometry, you should change "inlet" in the code.

Best regards,
Tsubasa