[Commits] [svn:einsteintoolkit] incoming/EOS_Omni/ (Rev. 8)
cott at tapir.caltech.edu
cott at tapir.caltech.edu
Thu Aug 26 14:26:54 CDT 2010
User: cott
Date: 2010/08/26 02:26 PM
Added:
/EOS_Omni/src/
EOS_Omni_SingleVarCalls_harm.F90
Modified:
/EOS_Omni/
interface.ccl
/EOS_Omni/src/
make.code.defn
Log:
* add routines for MHD with Harm-based con2prim
File Changes:
Directory: /EOS_Omni/
=====================
File [modified]: interface.ccl
Delta lines: +54 -0
===================================================================
--- EOS_Omni/interface.ccl 2010-08-18 18:41:07 UTC (rev 7)
+++ EOS_Omni/interface.ccl 2010-08-26 19:26:54 UTC (rev 8)
@@ -97,3 +97,57 @@
CCTK_INT OUT anyerr)
PROVIDES FUNCTION EOS_Omni_RestMassDensityFromEpsPress WITH EOS_Omni_EOS_RestMassDensityFromEpsPress LANGUAGE Fortran
+
+################################################################################
+# the following routines are needed for MHD con2prim based on the Harm Code
+
+void FUNCTION EOS_Omni_press_f_hrho_v2_rhoW(CCTK_INT IN eoskey, \
+ CCTK_INT IN havetemp, \
+ CCTK_REAL IN rf_precision, \
+ CCTK_INT IN npoints, \
+ CCTK_REAL IN ARRAY hrho, \
+ CCTK_REAL IN ARRAY v2, \
+ CCTK_REAL IN ARRAY rhoW, \
+ CCTK_REAL INOUT ARRAY eps, \
+ CCTK_REAL INOUT ARRAY temp, \
+ CCTK_REAL IN ARRAY ye, \
+ CCTK_REAL OUT ARRAY press, \
+ CCTK_INT OUT ARRAY keyerr, \
+ CCTK_INT OUT anyerr)
+
+PROVIDES FUNCTION EOS_Omni_press_f_hrho_v2_rhoW WITH EOS_Omni_EOS_Press_f_hrho_v2_rhoW LANGUAGE Fortran
+
+
+void FUNCTION EOS_Omni_dpdhrho_f_hrho_v2_rhoW(CCTK_INT IN eoskey, \
+ CCTK_INT IN havetemp, \
+ CCTK_REAL IN rf_precision, \
+ CCTK_INT IN npoints, \
+ CCTK_REAL IN ARRAY hrho, \
+ CCTK_REAL IN ARRAY v2, \
+ CCTK_REAL IN ARRAY rhoW, \
+ CCTK_REAL INOUT ARRAY eps, \
+ CCTK_REAL INOUT ARRAY temp, \
+ CCTK_REAL IN ARRAY ye, \
+ CCTK_REAL OUT ARRAY dpdhrho,\
+ CCTK_INT OUT ARRAY keyerr, \
+ CCTK_INT OUT anyerr)
+
+PROVIDES FUNCTION EOS_Omni_dpdhrho_f_hrho_v2_rhoW WITH EOS_Omni_EOS_dpdhrho_f_hrho_v2_rhoW LANGUAGE Fortran
+
+void FUNCTION EOS_Omni_dpdv2_f_hrho_v2_rhoW(CCTK_INT IN eoskey, \
+ CCTK_INT IN havetemp, \
+ CCTK_REAL IN rf_precision, \
+ CCTK_INT IN npoints, \
+ CCTK_REAL IN ARRAY hrho, \
+ CCTK_REAL IN ARRAY v2, \
+ CCTK_REAL IN ARRAY rhoW, \
+ CCTK_REAL INOUT ARRAY eps, \
+ CCTK_REAL INOUT ARRAY temp, \
+ CCTK_REAL IN ARRAY ye, \
+ CCTK_REAL OUT ARRAY dpdv2, \
+ CCTK_INT OUT ARRAY keyerr, \
+ CCTK_INT OUT anyerr)
+
+PROVIDES FUNCTION EOS_Omni_dpdv2_f_hrho_v2_rhoW WITH EOS_Omni_EOS_dpdv2_f_hrho_v2_rhoW LANGUAGE Fortran
+
+################################################################################
Directory: /EOS_Omni/src/
=========================
File [added]: EOS_Omni_SingleVarCalls_harm.F90
Delta lines: +170 -0
===================================================================
--- EOS_Omni/src/EOS_Omni_SingleVarCalls_harm.F90 (rev 0)
+++ EOS_Omni/src/EOS_Omni_SingleVarCalls_harm.F90 2010-08-26 19:26:54 UTC (rev 8)
@@ -0,0 +1,170 @@
+#include "cctk.h"
+#include "cctk_Parameters.h"
+#include "cctk_Arguments.h"
+#include "cctk_Functions.h"
+
+! eoskey:
+! 1 --- polytropic EOS
+! 2 --- gamma-law EOS
+! 3 --- hybrid EOS
+! 4 --- finite-T microphysical NSE EOS
+
+subroutine EOS_Omni_EOS_Press_f_hrho_v2_rhoW(eoskey,keytemp,rf_precision,npoints,&
+ hrho,v2,rhoW,eps,temp,ye,press,keyerr,anyerr)
+
+ use EOS_Omni_Module
+ implicit none
+ DECLARE_CCTK_PARAMETERS
+ DECLARE_CCTK_FUNCTIONS
+
+ CCTK_INT, intent(in) :: eoskey,keytemp,npoints
+ CCTK_INT, intent(out) :: keyerr(npoints)
+ CCTK_INT, intent(out) :: anyerr
+ CCTK_REAL, intent(in) :: rf_precision
+ CCTK_REAL, intent(in) :: hrho(npoints),v2(npoints)
+ CCTK_REAL, intent(in) :: rhoW(npoints),ye(npoints)
+ CCTK_REAL, intent(inout) :: eps(npoints), temp(npoints)
+ CCTK_REAL, intent(out) :: press(npoints)
+
+ ! local vars
+ integer :: i
+ real*8 :: gtmp1,gtmp2
+ character(256) :: warnstring
+ real*8 :: hybrid_local_gamma, hybrid_local_k_cgs, &
+ hybrid_p_poly, hybrid_p_th
+ real*8,parameter :: zero = 0.0d0
+
+ anyerr = 0
+ keyerr(:) = 0
+
+ select case (eoskey)
+ case (1)
+ ! polytropic EOS
+ call CCTK_WARN(0,"Polytropic EOS not implemented for press_f_hro_v2_rhoW")
+ case (2)
+ ! gamma-law EOS
+ if(keytemp.eq.1) then
+ call CCTK_WARN(0,"keytemp.eq.1 not implemented for press_f_hro_v2_rhoW")
+ endif
+ do i=1,npoints
+ gtmp1 = 1.0d0 - v2(i)
+ gtmp2 = rhoW(i)*sqrt(gtmp1)
+ press(i) = (gl_gamma - 1.0d0)/(gl_gamma) * &
+ (hrho(i)*gtmp1 - gtmp2)
+ eps(i) = press(i) / (gl_gamma - 1.0d0) / gtmp2
+ enddo
+ case (3)
+ ! hybrid EOS
+ call CCTK_WARN(0,"Hybrid EOS not implemented for press_f_hro_v2_rhoW")
+
+ case DEFAULT
+ write(warnstring,*) "eoskey ",eoskey," not implemented!"
+ call CCTK_WARN(0,warnstring)
+ end select
+
+end subroutine EOS_Omni_EOS_Press_f_hrho_v2_rhoW
+
+
+subroutine EOS_Omni_EOS_dpdhrho_f_hrho_v2_rhoW(eoskey,keytemp,rf_precision,npoints,&
+ hrho,v2,rhoW,eps,temp,ye,dpdhrho,keyerr,anyerr)
+
+ use EOS_Omni_Module
+ implicit none
+ DECLARE_CCTK_PARAMETERS
+ DECLARE_CCTK_FUNCTIONS
+
+ CCTK_INT, intent(in) :: eoskey,keytemp,npoints
+ CCTK_INT, intent(out) :: keyerr(npoints)
+ CCTK_INT, intent(out) :: anyerr
+ CCTK_REAL, intent(in) :: rf_precision
+ CCTK_REAL, intent(in) :: hrho(npoints),v2(npoints)
+ CCTK_REAL, intent(in) :: rhoW(npoints),ye(npoints)
+ CCTK_REAL, intent(inout) :: eps(npoints), temp(npoints)
+ CCTK_REAL, intent(out) :: dpdhrho(npoints)
+
+ ! local vars
+ integer :: i
+ character(256) :: warnstring
+ real*8 :: hybrid_local_gamma, hybrid_local_k_cgs, &
+ hybrid_p_poly, hybrid_p_th
+ real*8,parameter :: zero = 0.0d0
+
+ anyerr = 0
+ keyerr(:) = 0
+
+ select case (eoskey)
+ case (1)
+ ! polytropic EOS
+ call CCTK_WARN(0,"Polytropic EOS not implemented for press_f_hro_v2_rhoW")
+ case (2)
+ ! gamma-law EOS
+ if(keytemp.eq.1) then
+ call CCTK_WARN(0,"keytemp.eq.1 not implemented for press_f_hro_v2_rhoW")
+ endif
+ do i=1,npoints
+ dpdhrho(i) = (gl_gamma - 1.0d0) * (1.0d0 - v2(i)) / (gl_gamma)
+ enddo
+ case (3)
+ ! hybrid EOS
+ call CCTK_WARN(0,"Hybrid EOS not implemented for press_f_hro_v2_rhoW")
+
+ case DEFAULT
+ write(warnstring,*) "eoskey ",eoskey," not implemented!"
+ call CCTK_WARN(0,warnstring)
+ end select
+
+end subroutine EOS_Omni_EOS_dpdhrho_f_hrho_v2_rhoW
+
+
+subroutine EOS_Omni_EOS_dpdv2_f_hrho_v2_rhoW(eoskey,keytemp,rf_precision,npoints,&
+ hrho,v2,rhoW,eps,temp,ye,dpdv2,keyerr,anyerr)
+
+ use EOS_Omni_Module
+ implicit none
+ DECLARE_CCTK_PARAMETERS
+ DECLARE_CCTK_FUNCTIONS
+
+ CCTK_INT, intent(in) :: eoskey,keytemp,npoints
+ CCTK_INT, intent(out) :: keyerr(npoints)
+ CCTK_INT, intent(out) :: anyerr
+ CCTK_REAL, intent(in) :: rf_precision
+ CCTK_REAL, intent(in) :: hrho(npoints),v2(npoints)
+ CCTK_REAL, intent(in) :: rhoW(npoints),ye(npoints)
+ CCTK_REAL, intent(inout) :: eps(npoints), temp(npoints)
+ CCTK_REAL, intent(out) :: dpdv2(npoints)
+
+ ! local vars
+ integer :: i
+ character(256) :: warnstring
+ real*8 :: hybrid_local_gamma, hybrid_local_k_cgs, &
+ hybrid_p_poly, hybrid_p_th
+ real*8,parameter :: zero = 0.0d0
+
+ anyerr = 0
+ keyerr(:) = 0
+
+ select case (eoskey)
+ case (1)
+ ! polytropic EOS
+ call CCTK_WARN(0,"Polytropic EOS not implemented for press_f_hro_v2_rhoW")
+ case (2)
+ ! gamma-law EOS
+ if(keytemp.eq.1) then
+ call CCTK_WARN(0,"keytemp.eq.1 not implemented for press_f_hro_v2_rhoW")
+ endif
+ do i=1,npoints
+ dpdv2(i) = (gl_gamma - 1.0d0) * (0.5d0 * rhoW(i) &
+ / sqrt(1.0d0 - v2(i)) - hrho(i)) / gl_gamma
+ enddo
+ case (3)
+ ! hybrid EOS
+ call CCTK_WARN(0,"Hybrid EOS not implemented for press_f_hro_v2_rhoW")
+
+ case DEFAULT
+ write(warnstring,*) "eoskey ",eoskey," not implemented!"
+ call CCTK_WARN(0,warnstring)
+ end select
+
+end subroutine EOS_Omni_EOS_dpdv2_f_hrho_v2_rhoW
+
+
File [modified]: make.code.defn
Delta lines: +2 -1
===================================================================
--- EOS_Omni/src/make.code.defn 2010-08-18 18:41:07 UTC (rev 7)
+++ EOS_Omni/src/make.code.defn 2010-08-26 19:26:54 UTC (rev 8)
@@ -1,7 +1,8 @@
# Main make.code.defn file for thorn EOS_Omni
# Source files in this directory
-SRCS = EOS_Omni_Module.F90 EOS_Omni_Startup.F90 EOS_Omni_SingleVarCalls.F90 EOS_Omni_Handles.c
+SRCS = EOS_Omni_Module.F90 EOS_Omni_Startup.F90 EOS_Omni_SingleVarCalls.F90 \
+ EOS_Omni_SingleVarCalls_harm.F90 EOS_Omni_Handles.c
# Subdirectories containing source files
SUBDIRS =
More information about the Commits
mailing list