Boundary conditions related to monitoring point temperature
Posted: Thu May 12, 2022 9:13 am
Dear all,
I am a newbie to code-saturne,recently,I'm learning how to extract the monitoring points I added on the GUI page in the cs_user_boundary_conditions.f90 file. For example, I define a monitoring point on the GUI page, how can I get the temperature of this monitoring point and use it as an input value for the inlet condition?
Can anyone give me some code to call my monitoring point temperature in real time if it is convenient?
Thank you very much for any ideas on this matter
Kind regards
Steven
------------------------------------------------
subroutine cs_f_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 ctincl
use cs_fuel_incl
use mesh
use field
use cs_c_bindings
implicit none
integer nvar , nscal
integer icodcl(nfabor,nvar)
integer itrifb(nfabor), itypfb(nfabor)
integer izfppp(nfabor)
double precision dt(ncelet)
double precision rcodcl(nfabor,nvar,3)
integer ifac, iel, ii
integer ilelt, nlelt
double precision uref2
double precision rhomoy, xdh
double precision xitur
integer, allocatable, dimension(:) :: lstelt
double precision, dimension(:), pointer :: bfpro_rom
allocate(lstelt(nfabor)) ! temporary array for boundary faces selection
call field_get_val_s(ibrom, bfpro_rom)
call getfbr('in', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
iel = ifabor(ifac)
itypfb(ifac) = ientre
rcodcl(ifac,iu,1) = 0.d0
rcodcl(ifac,iv,1) = 0.d0
rcodcl(ifac,iw,1) = 1.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.1d0
rhomoy = bfpro_rom(ifac)
call turbulence_bc_inlet_hyd_diam(ifac, uref2, xdh, rhomoy, viscl0, &
rcodcl)
if (nscal.gt.0) then
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!! in this place, get the tempC of monitor 1, marked as probe_temp, and use the probe_temp to change the inlet temperature ("rcodcl(ifac,isca(ii),1)" ). can you give me some advice how to get the tempC of monitor 1, thanks !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
do ii=1,nscasp
rcodcl(ifac,isca(ii),1) = 90.d0
enddo
endif
enddo
deallocate(lstelt) ! temporary array for boundary faces selection
return
end subroutine cs_f_user_boundary_conditions
I am a newbie to code-saturne,recently,I'm learning how to extract the monitoring points I added on the GUI page in the cs_user_boundary_conditions.f90 file. For example, I define a monitoring point on the GUI page, how can I get the temperature of this monitoring point and use it as an input value for the inlet condition?
Can anyone give me some code to call my monitoring point temperature in real time if it is convenient?
Thank you very much for any ideas on this matter
Kind regards
Steven
------------------------------------------------
subroutine cs_f_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 ctincl
use cs_fuel_incl
use mesh
use field
use cs_c_bindings
implicit none
integer nvar , nscal
integer icodcl(nfabor,nvar)
integer itrifb(nfabor), itypfb(nfabor)
integer izfppp(nfabor)
double precision dt(ncelet)
double precision rcodcl(nfabor,nvar,3)
integer ifac, iel, ii
integer ilelt, nlelt
double precision uref2
double precision rhomoy, xdh
double precision xitur
integer, allocatable, dimension(:) :: lstelt
double precision, dimension(:), pointer :: bfpro_rom
allocate(lstelt(nfabor)) ! temporary array for boundary faces selection
call field_get_val_s(ibrom, bfpro_rom)
call getfbr('in', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
iel = ifabor(ifac)
itypfb(ifac) = ientre
rcodcl(ifac,iu,1) = 0.d0
rcodcl(ifac,iv,1) = 0.d0
rcodcl(ifac,iw,1) = 1.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.1d0
rhomoy = bfpro_rom(ifac)
call turbulence_bc_inlet_hyd_diam(ifac, uref2, xdh, rhomoy, viscl0, &
rcodcl)
if (nscal.gt.0) then
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!! in this place, get the tempC of monitor 1, marked as probe_temp, and use the probe_temp to change the inlet temperature ("rcodcl(ifac,isca(ii),1)" ). can you give me some advice how to get the tempC of monitor 1, thanks !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
do ii=1,nscasp
rcodcl(ifac,isca(ii),1) = 90.d0
enddo
endif
enddo
deallocate(lstelt) ! temporary array for boundary faces selection
return
end subroutine cs_f_user_boundary_conditions