problem with changing the source term of energy equation
Posted: Mon Mar 19, 2012 5:15 pm
Hello every,
Now I am working with coupled problem between natural convection and radiation. For the radiation part I have a code written in fortran which can deal real gas(coefficient of absorption change with position). So I just need to change the source term of energy equation with adding -div(Qr),which is divergence of radiative flux and calculated in code of "radiation.f90".
in the subroutine "ustssc.f90", I add the following:
!*************************************************
if (iscal.eq.1) then
do iel = 1, ncel
crvimp(iel) = 0
enddo
do j=1,jmax
do i=1,imax
iel=(jmax-j)*imax+i
crvexp(iel) = -volume(iel)*divQr(i,j) !(1)
!crvexp(iel) = -volume(iel)*divQr(i,j)/1017.24d0 !(2)
enddo
enddo
endif
!****************************************************
I'm working on the 2D square geometry, i,j are the cordinates of the cell center. imax*jmax=ncel, the total cell number."1017.24d0" is the thermal capicity Cp.
If I select the (1) I find the result of Code_saturne couldn't converge. If I seclet the second one, the radiation seems no influence to the convection. There are not problems with the transfer of varibles between Code_Saturne and code of radiation.
If somebody could give me some suggestion?
Thanks
Now I am working with coupled problem between natural convection and radiation. For the radiation part I have a code written in fortran which can deal real gas(coefficient of absorption change with position). So I just need to change the source term of energy equation with adding -div(Qr),which is divergence of radiative flux and calculated in code of "radiation.f90".
in the subroutine "ustssc.f90", I add the following:
!*************************************************
if (iscal.eq.1) then
do iel = 1, ncel
crvimp(iel) = 0
enddo
do j=1,jmax
do i=1,imax
iel=(jmax-j)*imax+i
crvexp(iel) = -volume(iel)*divQr(i,j) !(1)
!crvexp(iel) = -volume(iel)*divQr(i,j)/1017.24d0 !(2)
enddo
enddo
endif
!****************************************************
I'm working on the 2D square geometry, i,j are the cordinates of the cell center. imax*jmax=ncel, the total cell number."1017.24d0" is the thermal capicity Cp.
If I select the (1) I find the result of Code_saturne couldn't converge. If I seclet the second one, the radiation seems no influence to the convection. There are not problems with the transfer of varibles between Code_Saturne and code of radiation.
If somebody could give me some suggestion?
Thanks