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

Cleanup of common envelope analysis and add compatibility with radiation dumps #541

Merged
merged 10 commits into from
May 6, 2024
Merged
7 changes: 5 additions & 2 deletions src/main/ionization.f90
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,15 @@ end subroutine get_erec_components
! gas particle. Inputs and outputs in code units
!+
!----------------------------------------------------------------
subroutine calc_thermal_energy(particlemass,ieos,xyzh,vxyzu,presi,tempi,ethi)
use part, only:rhoh
subroutine calc_thermal_energy(particlemass,ieos,xyzh,vxyzu,presi,tempi,ethi,radprop)
use dim, only:do_radiation
use part, only:rhoh,iradxi
use eos_idealplusrad, only:get_idealgasplusrad_tempfrompres,get_idealplusrad_enfromtemp
use physcon, only:radconst,Rg
use units, only:unit_density,unit_pressure,unit_ergg,unit_pressure
integer, intent(in) :: ieos
real, intent(in) :: particlemass,presi,tempi,xyzh(4),vxyzu(4)
real, intent(in), optional :: radprop(:)
real, intent(out) :: ethi
real :: hi,densi_cgs,mui

Expand All @@ -357,6 +359,7 @@ subroutine calc_thermal_energy(particlemass,ieos,xyzh,vxyzu,presi,tempi,ethi)
ethi = particlemass * ethi / unit_ergg
case default ! assuming internal energy = thermal energy
ethi = particlemass * vxyzu(4)
if (do_radiation) ethi = ethi + particlemass*radprop(iradxi)
end select

end subroutine calc_thermal_energy
Expand Down
Loading
Loading