Windkessel outlet boundary condition

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Saturne_User2021
Posts: 6
Joined: Sun Apr 18, 2021 4:44 pm

Re: Windkessel outlet boundary condition

Post by Saturne_User2021 »

Hello Yvan

I am still making progress in the development of the BC. However, I figurd out that the flow given by the UDF makes no physical sense. The code (cs_user_BC.f90) is as follows :

Code: Select all

s_tot = 0.d0
sumpre = 0.d0
call getfbr('outlet', nlelt, lstelt)
do ilelt = 1, nlelt
  
  ifac   = lstelt(ilelt)
  volden = bmasfl(ifac) / bpro_rho(ifac) * surfbn(ifac) ! flow = massflux/density*S
  sumpre = sumpre+volden
  s_tot  = s_tot+surfbn(ifac)

enddo

print *, 'flow out', sumpre 
print *, 'flow out', s_tot
here, sumpre is expected to be volumetric flow rate at the outlet and s_tot, the total surface area. However, the flow rate I get is quite small (E-13 m3/s) and the surface area is larger than the expected value.
Is there a good way to find what I am doing wrong here?
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Windkessel outlet boundary condition

Post by Yvan Fournier »

Hello,

Are you running in parallel or on a single processor ? You have no parallel sum, so in parallel, what you print is only the sum local to a given partition.

If the surface is too large, did you check the units for your mesh (min/max coords in the logs will help you check that).

Finally, fo volden, be careful that the mass flux stored in bmasfl is an extensive value (already multiplied by the face surface).

Best regards,

Yvan
Post Reply