Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed bug in initialization of T_c for dimensional anelastic #445

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/Physics/PDE_Coefficients.F90
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ Subroutine Polytropic_Reference()
Integer :: i
Real*8 :: zeta_0, c0, c1, d
Real*8 :: rho_c, P_c, T_c,denom
Real*8 :: thermo_gamma, volume_specific_heat
Real*8 :: thermo_gamma, volume_specific_heat, gas_constant
Real*8 :: beta
Real*8 :: Gravitational_Constant = 6.67d-8 ! cgs units
Real*8, Allocatable :: zeta(:), gravity(:)
Expand Down Expand Up @@ -583,16 +583,17 @@ Subroutine Polytropic_Reference()
denom = (poly_n+1.d0) * d * c1
P_c = Gravitational_Constant * poly_mass * rho_c / denom

T_c = (poly_n+1.d0) * P_c / (Pressure_Specific_Heat * rho_c)
! The following is needed to calculate T_c from the ideal gas law,
! as well as the entropy gradient.
! This assumes a monatomic ideal gas with three translational degrees of freedom
thermo_gamma = 5.0d0/3.0d0
gas_constant = (thermo_gamma - 1.0d0)*Pressure_Specific_Heat/thermo_gamma
T_c = P_c / (gas_constant * rho_c)

!-----------------------------------------------------------
! Initialize reference structure
Gravity = Gravitational_Constant * poly_mass / Radius**2

! The following is needed to calculate the entropy gradient
thermo_gamma = 5.0d0/3.0d0
volume_specific_heat = pressure_specific_heat / thermo_gamma

Ref%Density = rho_c * zeta**poly_n

Ref%dlnrho = - poly_n * c1 * d / (zeta * Radius**2)
Expand All @@ -601,6 +602,7 @@ Subroutine Polytropic_Reference()
Ref%Temperature = T_c * zeta
Ref%dlnT = -(c1*d/Radius**2)/zeta

volume_specific_heat = pressure_specific_heat / thermo_gamma
Ref%dsdr = volume_specific_heat * (Ref%dlnT - (thermo_gamma - 1.0d0) * Ref%dlnrho)

Ref%Buoyancy_Coeff = gravity/Pressure_Specific_Heat*ref%density
Expand Down