Could you please help me with this question?
Following the heated square cavity tutorial, I used Boussinesq approximation, make density change with temperature. Now I want to make density change with both pressure and temperature, that is the ideal gas law, rho=P/(R*T). I think this may be more accurate than the Boussinesq.
But in the subroutine cs_user_physical_properties.f90, I don't know how to call variable "pressure". The code is shown below, with the part ***Pressure*** that cannot work now and need to be changed.
Code: Select all
if (iscalt.gt.0) then
ivart = isca(iscalt)
call field_get_val_s(ivarfl(ivart), cvar_scalt)
else
write(nfecra,9010) iscalt
call csexit (1)
endif
! --- Pointers to density values
call field_get_val_s(icrom, cpro_rom)
call field_get_val_s(ibrom, bfpro_rom)
call field_get_val_s(iprpfl(ibeta), cpro_beta)
do iel = 1, ncel
xvart = cvar_scalt(iel)
cpro_rom(iel) = ***Pressure***/(287.0d0*xvart)
enddo
Best regards,
Ruonan