Skip to content

Commit b90a21f

Browse files
authored
Merge pull request #615 from MESAHub/remove_HELM_floor
Remove HELM floor, fall back to ideal instead
2 parents 79aa5d8 + a38371a commit b90a21f

File tree

8 files changed

+29
-9
lines changed

8 files changed

+29
-9
lines changed

docs/source/changelog.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pressure with respect to other variables.
2424
run_star_extras
2525
~~~~~~~~~~~~~~~
2626

27-
Previously we had logic to determine if a extra history value should be saved
27+
Previously we had logic to determine if an extra history value should be saved
2828
as an int or a float (users can only provide data as a float). This was error
2929
prone, so now we save extra history values as floats.
3030

@@ -96,7 +96,7 @@ The phase diagram for O/Ne separation comes from
9696
`Blouin & Daligault (2021b) <https://ui.adsabs.harvard.edu/abs/2021ApJ...919...87B/abstract>`_.
9797

9898
Massive Star test_suite Updates
99-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100100

101101
The ``12Msun_pre_ms_to_core_collapse``, ``20Msun_pre_ms_to_core_collapse``, and ``zams_to_cc_80``
102102
test_suites have each been updated and now fully evolve models at solar metallicities to core
@@ -123,6 +123,12 @@ The ``fixed_Teff``, ``fixed_Tsurf``, ``fixed_Psurf``, and ``fixed_Psurf_and_Tsu
123123
atmosphere options were removed in r15140. We have reimplemented them although we
124124
caution users that their implementation could conflict with ``mlt_option = 'TDC'``.
125125

126+
The EOS coverage regions have been updated to fall back to ideal gas in a region
127+
previously covered by HELM where it returned unphysical floor values of ``1e-20``
128+
for pressure, energy, and entropy. The most up-to-date EOS coverage plots can
129+
be found in the EOS documentation: :ref:`eos/overview:Overview of eos module`.
130+
131+
126132
Changes in r23.05.1
127133
===================
128134

1.98 KB
Loading
1.91 KB
Loading

eos/plotter/plotter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def parse(fname):
4343
cbar_max = None
4444

4545
pcol = ax.pcolormesh(Xran, Yran, eosDT[...,2], shading='nearest', cmap=cmap, vmin=cbar_min, vmax=cbar_max)
46-
pcol.set_edgecolor('face')
4746
cax = fig.colorbar(pcol, extend='both')
4847
cax.set_label('')
4948

eos/plotter/regions.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,22 @@ def parse(fname):
2626
# overwrite with fancier labels
2727
xlabel = r'$\log(\rho/{\rm g\,cm^{-3}})$'
2828
ylabel = r'$\log(T/{\rm K})$'
29-
title = r'MESA EOS Regions ($X=0.7$, $Z=0.02$)'
3029

3130
eosDT, Yran, Xran = parse('eos_plotter.dat')
3231

3332
apjcolwidth=3.38
3433
# set up plot and labels
3534
#fig, ax = plt.subplots(figsize=(apjcolwidth,apjcolwidth*4./5.)) # for paper figures
3635
fig, ax = plt.subplots(figsize=(5,4)) # for website pngs
36+
37+
## for solar composition plot
38+
title = r'MESA EOS Regions ($X=0.7$, $Z=0.02$)'
39+
ax.text(4.0,2.3,'no coverage',fontsize='small')
40+
41+
## for Z = 1 plot
42+
#title = r'MESA EOS Regions ($X=0.0$, $Z=1.0$)'
43+
#ax.text(4.8,2.3,'no coverage',fontsize='small')
44+
3745
ax.set_title(title)
3846
ax.set_xlabel(xlabel)
3947
ax.set_ylabel(ylabel)
@@ -48,9 +56,9 @@ def parse(fname):
4856
cmap = colors.ListedColormap(my_colors)
4957
bounds = [-0.5, 0.5, 1.5, 2.5, 3.5, 5.5, 7.5]
5058
norm = colors.BoundaryNorm(bounds, cmap.N)
59+
cmap.set_under('white')
5160

5261
pcol = ax.pcolormesh(Xran, Yran, eosDT[...,2], shading='nearest', cmap=cmap, norm=norm, rasterized=True)
53-
pcol.set_edgecolor('face')
5462
cax = fig.colorbar(pcol, ticks=[0, 1, 2, 3, 4.5, 6.5])
5563
cax.set_label('')
5664
cax.ax.tick_params(labelsize='x-small')

eos/private/helm.f90

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ subroutine helmeos2aux( &
257257
return
258258
end if
259259

260+
! error out for very low pgas,egas,sgas (previously just set hard floor at this value)
261+
if(pgas < 1d-20 .or. egas < 1d-20 .or. sgas < 1d-20) then
262+
ierr = 1
263+
if (dbg) write(*,*) 'failed in helm, sums too small'
264+
return
265+
end if
266+
260267
!..compute the derivative quantities (cv, gamma1 ...etc)
261268
include 'helm_gammas.dek'
262269
if (ierr /= 0) then

eos/private/helm_sum_totals.dek

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pgas = max(pion + pele + ppos + pcoul, 1d-20)
1+
pgas = pion + pele + ppos + pcoul
22

33
dpgasdd = dpiondd + dpepdd + dpcouldd
44
dpgasdt = dpiondt + dpepdt + dpcouldt
@@ -15,7 +15,7 @@
1515
dpgasdaz = dpiondaz + dpepdaz + dpcouldaz
1616
dpgasdzz = dpiondzz + dpepdzz + dpcouldzz
1717

18-
egas = max(eion + eele + epos + ecoul, 1d-20)
18+
egas = eion + eele + epos + ecoul
1919

2020
if (.false.) then
2121
write(*,'(a6,e15.5)') 'egas', egas
@@ -41,7 +41,7 @@
4141
degasdaz = deiondaz + deepdaz + decouldaz
4242
degasdzz = deiondzz + deepdzz + decouldzz
4343

44-
sgas = max(sion + sele + spos + scoul, 1d-20)
44+
sgas = sion + sele + spos + scoul
4545

4646
dsgasdd = dsiondd + dsepdd + dscouldd
4747
dsgasdt = dsiondt + dsepdt + dscouldt

eos/private/ideal.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ subroutine ideal_eos( &
183183
phase, latent_ddlnT, latent_ddlnRho, res, d_dlnd, d_dlnT, ierr)
184184
if(ierr/=0) return
185185

186-
res(i_mu) = 1d0 ! ideal assumes neutral matter, whereas pack_for_export assumes ionized matter. So we patch it up here.
186+
res(i_mu) = abar ! ideal assumes neutral matter, whereas pack_for_export assumes ionized matter. So we patch it up here.
187187

188188
end subroutine ideal_eos
189189

0 commit comments

Comments
 (0)