Skip to content

Commit

Permalink
new initial model, with dF/dy=-eps, and X=X(y)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonguichandut committed Sep 11, 2023
1 parent c7e7c08 commit 6e9cd2c
Show file tree
Hide file tree
Showing 20 changed files with 12,648 additions and 4,442 deletions.
2 changes: 2 additions & 0 deletions Exec/science/xrb_layered/create_initial_model/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.ipynb_checkpoints/
__pycache__/
plots/
*old*
**.ex
7 changes: 5 additions & 2 deletions Exec/science/xrb_layered/create_initial_model/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

import mesa.py_mesa_reader as mr

import sys
filename = sys.argv[1]

fig,axes = plt.subplots(3,1,figsize=(6,8), sharex=True)
fig.subplots_adjust(hspace=0)

Expand All @@ -27,7 +30,7 @@
axes[2].semilogy(prof.R_cm-12e5, prof.fe56, 'k-',label="fe56")

# toy atm model
all_data = np.loadtxt("toy_atm/toy_atm_3cm.hse", skiprows=26).T
all_data = np.loadtxt(filename, skiprows=26).T
names = ["density","temperature","pressure","hydrogen-1","helium-4","carbon-12","carbon-13","nitrogen-13","nitrogen-14","nitrogen-15","oxygen-14","oxygen-15","oxygen-16","oxygen-17","oxygen-18","fluorine-17","fluorine-18","fluorine-19","neon-18","neon-19","neon-20","magnesium-22","magnesium-24","iron-56"]
data = {name:all_data[i+1] for i,name in enumerate(names)}
z = all_data[0]
Expand All @@ -43,4 +46,4 @@
axes[0].legend(frameon=False, ncol=2, bbox_to_anchor = (0.8,1.15), bbox_transform=axes[0].transAxes)
axes[2].legend(loc=3)

fig.savefig("toy_atm.png", bbox_inches="tight", dpi=500)
fig.savefig(filename.split("/")[-1] + ".png", bbox_inches="tight", dpi=500)
Binary file not shown.

This file was deleted.

62 changes: 13 additions & 49 deletions Exec/science/xrb_layered/create_initial_model/toy_atm/_parameters
Original file line number Diff line number Diff line change
@@ -1,69 +1,33 @@
@namespace: problem

model_prefix character "model"

g_const real -2.450e14

nx integer 640
xmin real 0.0
xmax real 2.e3

dens_base real 2.e6
low_density_cutoff real 1.e-4

T_star real 1.e8
T_base real 5.e8
T_lo real 5.e7

H_rad real 700.e0
F_rad real 1.0e22

H_star real 500.e0
delta real 25.0

H_sig real 1000.e0
alpha_sig real 1.0
beta_sig real 0.0

fuel1_name character "hydrogen-1"
fuel2_name character "helium-4"
fuel3_name character "carbon-12"
fuel4_name character ""
fuel5_name character ""
fuel6_name character ""
fuel7_name character ""

ash1_name character "iron-56"
ash2_name character ""
ash3_name character ""
ash4_name character ""

fuel1_frac real 1.0
fuel2_frac real 0.0
fuel3_frac real 0.0
fuel4_frac real 0.0
fuel5_frac real 0.0
fuel6_frac real 0.0
fuel7_frac real 0.0

ash1_frac real 0.0
ash2_frac real 0.0
ash3_frac real 0.0
ash4_frac real 0.0

xmin real 0.0
xmax real 2.e3
H_rad real 700.e0
F0 real -1

model_prefix character "toy_atm"
X0 real 0.7
Zcno real 0.02
yd real 1.e7
ash_name character "iron-56"

index_base_from_temp integer 0

do_isothermal_instead integer 0

# if do_invsq_grav = .false. we will use g_const for the
# gravitational acceleration. Otherwise, we will compute gravity
# from M_enclosed and the distance from the origin

M_enclosed real 2.e33
g_const real -2.450e14
do_invsq_grav integer 0

low_density_cutoff real 1.e-4

smallx real 1.e-10

small_temp real -1.e200
small_dens real -1.e200
Loading

0 comments on commit 6e9cd2c

Please sign in to comment.