Skip to content

Commit

Permalink
Merge pull request #541 from danieljprice/CE-analysis
Browse files Browse the repository at this point in the history
Cleanup of common envelope analysis and add compatibility with radiation dumps
  • Loading branch information
danieljprice authored May 6, 2024
2 parents abfa5c6 + 2669ff9 commit 4ea2888
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 235 deletions.
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

0 comments on commit 4ea2888

Please sign in to comment.