I am doing a simulation about a flue gases duct in which two fans are taking flow from a common header. It occurred to me that this could be simulated on code-saturne by identifying both fans as two negative inlets (using user subroutines) where the boundary conditions are established.
The geometry selected to perform the simulation consists of a pipeline that is composed by two outlets (defined as two negative inlets on code-saturne) and one upper inlet (defines as a free inlet/outlet on code-saturne), as shown in the following picture.

As regard to the boundary conditions, they have been defined by means of an user function as follows:
Code: Select all
subroutine cs_user_boundary_conditions &
( nvar , nscal , &
icodcl , itrifb , itypfb , izfppp , &
dt , &
rcodcl )
use paramx
use numvar
use optcal
use cstphy
use cstnum
use entsor
use parall
use period
use ihmpre
use ppppar
use ppthch
use coincl
use cpincl
use ppincl
use ppcpfu
use atincl
use atsoil
use ctincl
use elincl
use cs_fuel_incl
use mesh
use field
use turbomachinery
use iso_c_binding
use cs_c_bindings
implicit none
integer nvar , nscal
integer icodcl(nfabor,nvarcl)
integer itrifb(nfabor), itypfb(nfabor)
integer izfppp(nfabor)
double precision dt(ncelet)
double precision rcodcl(nfabor,nvarcl,3)
integer ifac, iel, ii, ivar
integer izone
integer ilelt, nlelt
double precision uref2, d2s3
double precision rhomoy, xdh, xustar2
double precision xitur
double precision xkent, xeent
integer, allocatable, dimension(:) :: lstelt
double precision, dimension(:), pointer :: bfpro_rom
allocate(lstelt(nfabor))
call field_get_val_s(ibrom, bfpro_rom)
!--------------------------------------------------------------------------------------------------------
call getfbr('CC_IN1', nlelt, lstelt)
do ilelt=1, nlelt
ifac=lstelt(ilelt)
itypfb(ifac)=ientre
rcodcl(ifac,ipr,3)=0.0d0
rcodcl(ifac,iu,1)= -8.97d0
rcodcl(ifac,iv,1)= 0.0d0
rcodcl(ifac,iw,1)= 0.0d0
uref2 = rcodcl(ifac,iu,1)**2 + rcodcl(ifac,iv,1)**2 + rcodcl(ifac,iw,1)**2
uref2 = max(uref2,1.d-12)
xdh = 0.9d0
rhomoy = bfpro_rom(ifac)
call keendb( uref2, xdh, rhomoy, viscl0, cmu, xkappa, xustar2, xkent, xeent )
rcodcl(ifac,ik,1) = xkent
rcodcl(ifac,iep,1) = xeent
enddo
!------------------------------------------------------------------------------------------------------
call getfbr('CC_IN2', nlelt, lstelt)
do ilelt=1, nlelt
ifac=lstelt(ilelt)
itypfb(ifac)=ientre
rcodcl(ifac,ipr,3)=0.0d0
rcodcl(ifac,iu,1)= 0.0d0
rcodcl(ifac,iv,1)= 9.54d0
rcodcl(ifac,iw,1)= 0.0d0
uref2 = rcodcl(ifac,iu,1)**2 + rcodcl(ifac,iv,1)**2 + rcodcl(ifac,iw,1)**2
uref2 = max(uref2,1.d-12)
xdh = 0.9d0
rhomoy = bfpro_rom(ifac)
call keendb( uref2, xdh, rhomoy, viscl0, cmu, xkappa, xustar2, xkent, xeent )
rcodcl(ifac,ik,1) = xkent
rcodcl(ifac,iep,1) = xeent
enddo
!---------------------------------------------------------------------------------------------------------
call getfbr('CC_FREEIN',nlelt,lstelt)
do ilelt=1,nlelt
ifac=lstelt(ilelt)
itypfb(ifac)=ifrent
enddo
deallocate(lstelt) ! temporary array for boundary faces selection
return
end subroutine cs_user_boundary_conditions
The simulation parameters are represented on the attached xml.
Greetings and thanks in advance.