[Commits] [svn:einsteintoolkit] GRHydro/branches/hot_and_MHD_temp_dev/ (Rev. 182)
cott at tapir.caltech.edu
cott at tapir.caltech.edu
Sat Nov 20 21:46:50 CST 2010
User: cott
Date: 2010/11/20 09:46 PM
Modified:
/branches/hot_and_MHD_temp_dev/
param.ccl, schedule.ccl
/branches/hot_and_MHD_temp_dev/src/
GRHydro_Prim2Con.F90, Utils.F90
Log:
* modify Prim2Con to handle issues on coarse reflevels when using
a hot EOS
* update GRHydro_reflevel before FluxTerms
File Changes:
Directory: /branches/hot_and_MHD_temp_dev/
==========================================
File [modified]: param.ccl
Delta lines: +5 -6
===================================================================
--- branches/hot_and_MHD_temp_dev/param.ccl 2010-11-21 03:29:28 UTC (rev 181)
+++ branches/hot_and_MHD_temp_dev/param.ccl 2010-11-21 03:46:50 UTC (rev 182)
@@ -259,17 +259,11 @@
####################### Other Parameters ##############################
#Parameters controlling conservative <-> primitive change.
-
int GRHydro_c2p_warnlevel "Warnlevel for Con2Prim warnings" STEERABLE=ALWAYS
{
0:1 :: "Either 0 or 1"
} 0
-# This parameter is not used anymore in maintained code: the warnings are produced only for really evolved points.
-int GRHydro_c2p_warn_from_reflevel "Start warning on given refinement level and on higher levels" STEERABLE=ALWAYS
-{
- 0: :: "Greater or equal to 0"
-} 0
boolean c2p_reset_pressure "If the pressure guess is unphysical should we recompute it?"
{
@@ -551,3 +545,8 @@
boolean con2prim_oct_hack "Disregard c2p failures in oct/rotsym90 boundary cells with xyz < 0" STEERABLE=ALWAYS
{
} "no"
+
+int GRHydro_c2p_warn_from_reflevel "Start warning on given refinement level and on higher levels" STEERABLE=ALWAYS
+{
+ 0: :: "Greater or equal to 0"
+} 0
File [modified]: schedule.ccl
Delta lines: +6 -1
===================================================================
--- branches/hot_and_MHD_temp_dev/schedule.ccl 2010-11-21 03:29:28 UTC (rev 181)
+++ branches/hot_and_MHD_temp_dev/schedule.ccl 2010-11-21 03:46:50 UTC (rev 182)
@@ -877,8 +877,13 @@
LANG: Fortran
} "Calculate current refinement level"
+schedule GRHydro_RefinementLevel IN FluxTerms BEFORE Reconstruct
+{
+ LANG: Fortran
+} "Calculate current refinement level"
+
#debug
-###schedule GRHydro_Debug IN ZelmaniLeakChangeYe BEFORE ZelmaniLeak_ye_of_rho
+###schedule GRHydro_Debug IN HydroBase_PostStep
###{
### LANG: Fortran
###} "debug"
Directory: /branches/hot_and_MHD_temp_dev/src/
==============================================
File [modified]: GRHydro_Prim2Con.F90
Delta lines: +39 -12
===================================================================
--- branches/hot_and_MHD_temp_dev/src/GRHydro_Prim2Con.F90 2010-11-21 03:29:28 UTC (rev 181)
+++ branches/hot_and_MHD_temp_dev/src/GRHydro_Prim2Con.F90 2010-11-21 03:46:50 UTC (rev 182)
@@ -112,7 +112,10 @@
! we do not have plus/minus vars for temperature since
! eps is reconstructed. Hence, we do not update the
! variable 'temperature' in prim2con at the interfaces
- xtemp = temperature(i,j,k)
+ ! We will instead use an average temperature as an initial
+ ! guess.
+ xtemp = 0.5d0*(temperature(i,j,k) + &
+ temperature(i-xoffset,j-yoffset,k-zoffset))
call prim2con_hot(GRHydro_eos_handle, GRHydro_reflevel,&
i,j,k,x(i,j,k),y(i,j,k),z(i,j,k),gxxl,gxyl,gxzl,gyyl,&
gyzl,gzzl, &
@@ -126,7 +129,10 @@
! we do not have plus/minus vars for temperature since
! eps is reconstructed. Hence, we do not update the
! variable 'temperature' in prim2con at the interfaces
- xtemp = temperature(i,j,k)
+ ! We will instead use an average temperature as an initial
+ ! guess.
+ xtemp = 0.5d0*(temperature(i,j,k) + &
+ temperature(i+xoffset,j+yoffset,k+zoffset))
call prim2con_hot(GRHydro_eos_handle, GRHydro_reflevel, &
i,j,k,x(i,j,k),y(i,j,k),z(i,j,k),gxxr,gxyr,gxzr,&
gyyr,gyzr,gzzr, &
@@ -238,16 +244,37 @@
drho,deps,temp,ye,dpress,keyerr,anyerr)
! error handling
if(anyerr.ne.0) then
- call CCTK_WARN(1,"EOS error in prim2con_hot")
- write(warnline,"(3i5,1P10E15.6)") ii,jj,kk,x,y,z
- call CCTK_WARN(1,warnline)
- write(warnline,"(1P10E15.6)") drho,deps,temp,ye
- call CCTK_WARN(1,warnline)
- write(warnline,"(A7,i8)") "code: ",keyerr(1)
- call CCTK_WARN(1,warnline)
- write(warnline,"(A10,i5)") "reflevel: ", GRHydro_reflevel
- call CCTK_WARN(1,warnline)
- call CCTK_WARN(0,"Aborting!!!")
+ if(GRHydro_reflevel.lt.GRHydro_c2p_warn_from_reflevel) then
+ ! in this case (coarse grid error that is hopefully restricted
+ ! away), we use the average temperature between cells and call
+ ! the EOS with keytemp=1
+ keytemp=1
+ call EOS_Omni_press(handle,keytemp,GRHydro_eos_rf_prec,n,&
+ drho,deps,temp,ye,dpress,keyerr,anyerr)
+ keytemp=0
+ if(anyerr.ne.0) then
+ call CCTK_WARN(1,"EOS error in prim2con_hot: lev 2")
+ write(warnline,"(3i5,1P10E15.6)") ii,jj,kk,x,y,z
+ call CCTK_WARN(1,warnline)
+ write(warnline,"(1P10E15.6)") drho,deps,temp,ye
+ call CCTK_WARN(1,warnline)
+ write(warnline,"(A7,i8)") "code: ",keyerr(1)
+ call CCTK_WARN(1,warnline)
+ write(warnline,"(A10,i5)") "reflevel: ", GRHydro_reflevel
+ call CCTK_WARN(1,warnline)
+ endif
+ else
+ call CCTK_WARN(1,"EOS error in prim2con_hot")
+ write(warnline,"(3i5,1P10E15.6)") ii,jj,kk,x,y,z
+ call CCTK_WARN(1,warnline)
+ write(warnline,"(1P10E15.6)") drho,deps,temp,ye
+ call CCTK_WARN(1,warnline)
+ write(warnline,"(A7,i8)") "code: ",keyerr(1)
+ call CCTK_WARN(1,warnline)
+ write(warnline,"(A10,i5)") "reflevel: ", GRHydro_reflevel
+ call CCTK_WARN(1,warnline)
+ call CCTK_WARN(0,"Aborting!!!")
+ endif
endif
vlowx = gxx*dvelx + gxy*dvely + gxz*dvelz
File [modified]: Utils.F90
Delta lines: +18 -6
===================================================================
--- branches/hot_and_MHD_temp_dev/src/Utils.F90 2010-11-21 03:29:28 UTC (rev 181)
+++ branches/hot_and_MHD_temp_dev/src/Utils.F90 2010-11-21 03:46:50 UTC (rev 182)
@@ -32,15 +32,27 @@
implicit none
DECLARE_CCTK_ARGUMENTS
integer i,j,k
+ integer nx, ny, nz
GRHydro_reflevel = aint(log10(dble(cctk_levfac(1)))/log10(2.0d0))
+
+ nx = cctk_lsh(1)
+ ny = cctk_lsh(2)
+ nz = cctk_lsh(3)
- i=25
- j=3
- k=3
- write(6,"(i4,1P10E15.6)") GRHydro_reflevel, temperature(i,j,k),temperature(i,j,k),temperature(i,j,k)
- write(6,"(i4,1P10E15.6)") GRHydro_reflevel, rho(i,j,k)
- write(6,"(3i4)") cctk_lsh(1),cctk_lsh(2),cctk_lsh(3)
+ if (GRHydro_reflevel .lt. 3) return
+
+ do i=4,nx
+ do j=4,ny
+ do k=4,4
+ if( r(i,j,k)-4.0d0 .lt. 96.0d0 .and. &
+ r(i,j,k)+4.0d0 .gt. 96.0d0) then
+ write(6,"(4i4,1P10E15.6)") GRHydro_reflevel, i,j,k,&
+ r(i,j,k),rho(i,j,k),eps(i,j,k),y_e(i,j,k),temperature(i,j,k)
+ endif
+ enddo
+ enddo
+ enddo
call flush(6)
! if(GRHydro_reflevel.eq.4.and.temperature(1,1,1).lt.0.1d0) then
More information about the Commits
mailing list