Skip to content

Commit

Permalink
Update Diagnostics_Thermal_Equation.F90
Browse files Browse the repository at this point in the history
There was a bug in the heat flux (1433) calculation because tmp1d was allocated, but never initialized to zero. Often it would be zero and so the code would run fine, but occasionally NaNs were output in 1433. The initialization should fix this issue.
  • Loading branch information
illorenzo7 authored Jun 11, 2024
1 parent 21b0a1d commit f315725
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Diagnostics/Diagnostics_Thermal_Equation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,7 @@ Subroutine Compute_Thermal_HeatSource(buffer)
!The "Flux" associated with the volume heating
If (compute_quantity(vol_heat_flux)) Then
! Note that radial_integral_weights give int{f r^2}/int(r^2}
tmp1d(N_R) = 0.0d0 ! Initialize heat flux to zero at lower boundary
Do r = N_R-1, 1,-1
mean_rho = half*(ref%density(r) + ref%density(r+1) )
mean_t = half*(ref%temperature(r) + ref%temperature(r+1))
Expand Down

0 comments on commit f315725

Please sign in to comment.