From ee648d2eaaba5d88df19fe9223105c178f6950ad Mon Sep 17 00:00:00 2001 From: miller Date: Wed, 22 Dec 1999 19:27:01 +0000 Subject: 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 --- src/EOS_Ideal_Fluid.F | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 src/EOS_Ideal_Fluid.F (limited to 'src/EOS_Ideal_Fluid.F') 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 -- cgit v1.2.3