aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiller <miller@54f01db8-623e-4a4a-80be-c8eacd6477fb>1999-12-22 19:27:01 +0000
committermiller <miller@54f01db8-623e-4a4a-80be-c8eacd6477fb>1999-12-22 19:27:01 +0000
commitee648d2eaaba5d88df19fe9223105c178f6950ad (patch)
tree83338f7cc4b8dd92b1fbe8a6e332f16cf6934f24
parentf33073e10b545008dc559ca4d2458790062aca06 (diff)
An thorn implementing the ideal fluid equation of state:
P = (gamma-1)*rho*eps Mark git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEOS/EOS_IdealFluid/trunk@2 54f01db8-623e-4a4a-80be-c8eacd6477fb
-rw-r--r--README7
-rw-r--r--interface.ccl15
-rw-r--r--param.ccl10
-rw-r--r--schedule.ccl9
-rw-r--r--src/EOS_Ideal_Fluid.F154
-rw-r--r--src/EOS_Ideal_Fluid_Startup.F60
-rw-r--r--src/make.code.defn9
7 files changed, 264 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..8d7a09a
--- /dev/null
+++ b/README
@@ -0,0 +1,7 @@
+Cactus Code Thorn EOS_Ideal_Fluid
+Authors : ...
+CVS info : $Header$
+--------------------------------------------------------------------------
+
+Purpose of the thorn:
+
diff --git a/interface.ccl b/interface.ccl
new file mode 100644
index 0000000..e8830c8
--- /dev/null
+++ b/interface.ccl
@@ -0,0 +1,15 @@
+# Interface definition for thorn EOS_Ideal_Fluid
+# $Header$
+
+implements: EOS_Ideal_Fluid
+inherits: EOS_Base
+
+USES INCLUDE: EOS_Base.h
+USES INCLUDE: EOS_Base.inc
+
+private:
+
+# This is here for obsure reasons.
+INT dummy
+
+
diff --git a/param.ccl b/param.ccl
new file mode 100644
index 0000000..f00fdbe
--- /dev/null
+++ b/param.ccl
@@ -0,0 +1,10 @@
+# Parameter definitions for thorn EOS_Ideal_Fluid
+# $Header$
+
+private:
+
+REAL eos_ideal_fluid_gamma "Adiabatic Index for Ideal Fluid"
+{
+ : :: ""
+} 2.0
+
diff --git a/schedule.ccl b/schedule.ccl
new file mode 100644
index 0000000..a81b470
--- /dev/null
+++ b/schedule.ccl
@@ -0,0 +1,9 @@
+# Schedule definitions for thorn EOS_Ideal_Fluid
+# $Header$
+
+SCHEDULE EOS_Ideal_Fluid_Startup AT startup
+{
+ LANG: Fortran
+} "Setup EOS test in Fortran"
+
+
diff --git a/src/EOS_Ideal_Fluid.F b/src/EOS_Ideal_Fluid.F
new file mode 100644
index 0000000..9907d4b
--- /dev/null
+++ b/src/EOS_Ideal_Fluid.F
@@ -0,0 +1,154 @@
+c/*@@
+c @file EOS_Ideal_Fluid.F
+c @date December 1999
+c @author Mark Miller
+c @desc
+c Routines to calculate Ideal Fluid EOS through EOS_Base
+c @enddesc
+c@@*/
+
+#include "cctk.h"
+#include "cctk_parameters.h"
+
+c/*@@
+c @routine EOS_Ideal_Fluid_Pressure
+c @date December 1999
+c @author Mark Miller
+c @desc
+c Calculate the pressure P=(gamma-1)*eps*rho
+c @enddesc
+c @calls
+c @calledby
+c @history
+c
+c @endhistory
+c
+c@@*/
+ CCTK_REAL FUNCTION EOS_Ideal_Fluid_Pressure(rest_mass_density,
+ . specific_internal_energy)
+
+ IMPLICIT NONE
+ DECLARE_CCTK_PARAMETERS
+
+ CCTK_REAL rest_mass_density
+ CCTK_REAL specific_internal_energy
+
+ EOS_Ideal_Fluid_Pressure = (eos_ideal_fluid_gamma - 1.0d0) *
+ . rest_mass_density * specific_internal_energy
+
+ END FUNCTION EOS_Ideal_Fluid_Pressure
+
+c/*@@
+c @routine EOS_Ideal_Fluid_SpecificIE
+c @date December 1999
+c @author Mark Miller
+c @desc
+c Calculate the specific internal energy
+c eps = press / ( (gamma-1)*rho)
+c @enddesc
+c @calls
+c @calledby
+c @history
+c
+c @endhistory
+c
+c@@*/
+ CCTK_REAL FUNCTION EOS_Ideal_Fluid_SpecificIE(rest_mass_density,pressure)
+
+ IMPLICIT NONE
+ DECLARE_CCTK_PARAMETERS
+
+ CCTK_REAL rest_mass_density
+ CCTK_REAL pressure
+
+ EOS_Ideal_Fluid_SpecificIE = pressure / ((eos_ideal_fluid_gamma - 1.0d0)*
+ . rest_mass_density)
+
+ END FUNCTION EOS_Ideal_Fluid_SpecificIE
+
+c/*@@
+c @routine EOS_Ideal_Fluid_RestMassDens
+c @date December 1999
+c @author Mark Miller
+c @desc
+c Calculate the rest mass density
+c rho = pressure / ((gamma-1)*eps)
+c @enddesc
+c @calls
+c @calledby
+c @history
+c
+c @endhistory
+c
+c@@*/
+ CCTK_REAL FUNCTION EOS_Ideal_Fluid_RestMassDens(specific_internal_energy,
+ . pressure)
+
+ IMPLICIT NONE
+ DECLARE_CCTK_PARAMETERS
+
+ CCTK_REAL specific_internal_energy
+ CCTK_REAL pressure
+
+ EOS_Ideal_Fluid_RestMassDens = pressure /
+ . ((eos_ideal_fluid_gamma - 1.0d0)*specific_internal_energy)
+
+ END FUNCTION EOS_Ideal_Fluid_RestMassDens
+
+c/*@@
+c @routine EOS_Ideal_Fluid_DPressByDRho
+c @date December 1999
+c @author Mark Miller
+c @desc
+c Calculate d(pressure)/d(rho), keeping eps fixed:
+c dp/drho = (gamma-1)*eps
+c @enddesc
+c @calls
+c @calledby
+c @history
+c
+c @endhistory
+c
+c@@*/
+ CCTK_REAL FUNCTION EOS_Ideal_Fluid_DPressByDRho(rest_mass_density,
+ . specific_internal_energy)
+
+ IMPLICIT NONE
+ DECLARE_CCTK_PARAMETERS
+
+ CCTK_REAL rest_mass_density
+ CCTK_REAL specific_internal_energy
+
+ EOS_Ideal_Fluid_DPressByDRho = (eos_ideal_fluid_gamma - 1.0d0) *
+ . specific_internal_energy
+
+ END FUNCTION EOS_Ideal_Fluid_DPressByDRho
+
+c/*@@
+c @routine EOS_Ideal_Fluid_DPressByDEps
+c @date December 1999
+c @author Mark Miller
+c @desc
+c Calculate d(pressure)/d(eps), keeping rho fixed
+c dp/deps = (gamma-1)*rho
+c @enddesc
+c @calls
+c @calledby
+c @history
+c
+c @endhistory
+c
+c@@*/
+ CCTK_REAL FUNCTION EOS_Ideal_Fluid_DPressByDEps(rest_mass_density,
+ . specific_internal_energy)
+
+ IMPLICIT NONE
+ DECLARE_CCTK_PARAMETERS
+
+ CCTK_REAL rest_mass_density
+ CCTK_REAL specific_internal_energy
+
+ EOS_Ideal_Fluid_DPressByDEps = (eos_ideal_fluid_gamma - 1.0d0) *
+ . rest_mass_density
+
+ END FUNCTION EOS_Ideal_Fluid_DPressByDEps
diff --git a/src/EOS_Ideal_Fluid_Startup.F b/src/EOS_Ideal_Fluid_Startup.F
new file mode 100644
index 0000000..0410d9b
--- /dev/null
+++ b/src/EOS_Ideal_Fluid_Startup.F
@@ -0,0 +1,60 @@
+
+c/*@@
+c @file EOS_Ideal_Fluid_Startup.F
+c @date December 1999
+c @author Mark Miller
+c @desc
+c Startup for EOS_Ideal_Fluid
+c @enddesc
+c@@*/
+
+#include "cctk.h"
+
+c/*@@
+c @routine EOS_Ideal_Fluid_Startup
+c @date December 1999
+c @author Mark Miller
+c @desc
+c
+c @enddesc
+c @calls EOS_RegisterMethod EOS_RegisterPressure EOS_RegisterSpecificInternalEnergy EOS_RegisterRestMassDens EOS_RegisterDPressByDRho EOS_RegisterDPressByDEps CCTK_WARN
+c @calledby
+c @history
+c
+c @endhistory
+c@@*/
+
+ INTEGER FUNCTION EOS_Ideal_Fluid_Startup()
+ implicit none
+ integer handle,ierr
+ external EOS_Ideal_Fluid_Pressure
+ external EOS_Ideal_Fluid_SpecificIE
+ external EOS_Ideal_Fluid_RestMassDens
+ external EOS_Ideal_Fluid_DPressByDRho
+ external EOS_Ideal_Fluid_DPressByDEps
+
+ call EOS_RegisterMethod(handle,"Ideal_Fluid")
+
+ IF(handle .ge. 0) THEN
+
+ CALL EOS_RegisterPressure(ierr, handle, EOS_Ideal_Fluid_Pressure);
+ CALL EOS_RegisterSpecificIntEnergy(ierr, handle,
+ . EOS_Ideal_Fluid_SpecificIE);
+ CALL EOS_RegisterRestMassDens(ierr, handle,
+ . EOS_Ideal_Fluid_RestMassDens);
+ CALL EOS_RegisterDPressByDRho(ierr, handle,
+ . EOS_Ideal_Fluid_DPressByDRho);
+ CALL EOS_RegisterDPressByDEps(ierr, handle,
+ . EOS_Ideal_Fluid_DPressByDEps);
+
+ ELSE
+
+ call CCTK_WARN(0, "Unable to register an EOS method from fortran 8-(")
+
+ ENDIF
+
+ EOS_Ideal_Fluid_Startup = 0
+
+ end function EOS_Ideal_Fluid_Startup
+
+
diff --git a/src/make.code.defn b/src/make.code.defn
new file mode 100644
index 0000000..1a0c48b
--- /dev/null
+++ b/src/make.code.defn
@@ -0,0 +1,9 @@
+# Main make.code.defn file for thorn EOS_Ideal_Fluid
+# $Header$
+
+# Source files in this directory
+SRCS = EOS_Ideal_Fluid.F EOS_Ideal_Fluid_Startup.F
+
+# Subdirectories containing source files
+SUBDIRS =
+