Compute the constant to convert the polytropic constant from the units used in \(\texttt{LORENE}\) for the single polytropic \(\mathrm{EOS}\), to the units used in \(\texttt{SPHINCS}\)
FT xx.xx.2020
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
double precision, | intent(in) | :: | gam |
Polytropic exponent |
PURE FUNCTION k_lorene2cu( gam )
!****************************************************************
!
!# Compute the constant to convert the polytropic constant \(K\)
! from the units used in |lorene| for the single polytropic |eos|,
! to the units used in |sphincs|
!
! FT xx.xx.2020
!
!****************************************************************
IMPLICIT NONE
DOUBLE PRECISION, INTENT(IN) :: gam
!! Polytropic exponent \(\gamma\)
DOUBLE PRECISION :: k_lorene2cu
! LORENE's EOS is in terms on number density n = rho/m_nucleon:
! P = K n^Gamma
! to convert to SI units:
! K_SI(n) = K_LORENE rho_nuc c^2 / n_nuc^gamma
! Converting this to be in terms of the mass density rho = n m_nucleon gets
! changes n_nuc to rho_nuc:
! K_SI(rho) = K_LORENE c^2 / rho_nuc^(gamma-1)
! In SI units P has units of M / (L T^2) and rho has units of M/L^3 thus
! K_SI has units of (L^3/M)^Gamma M/(L T^2).
! In Cactus units P and rho have the same units thus K_Cactus is unitless.
! Conversion between K_SI and K_Cactus thus amounts to dividing out the
! units of the SI quantity.
k_lorene2cu= ( (MSun*g2kg)/((MSun_geo*km2m)**3*(1.66D+17)) )**(gam - one)
END FUNCTION k_lorene2cu