diff --git a/star/defaults/controls.defaults b/star/defaults/controls.defaults index 62f3ca929..07cdcc2a1 100644 --- a/star/defaults/controls.defaults +++ b/star/defaults/controls.defaults @@ -4594,6 +4594,20 @@ Tsurf_factor = 1 + ! use_RSP_L_eqn_outer_BC + ! ~~~~~~~~~~~~~~~~~~~~~~ + + ! use RSP2 luminosity equation + ! as the outer boundary condition on L rather than the + ! default atmospheric BC for temperature. + ! solves L1 - s% RSP2_Lsurf_factor*4*pi*r^2*c*a*T1^4 = 0 + ! uses dev control s% RSP2_Lsurf_factor = 0.5 (default), + ! see controls_dev.defaults.list + + ! :: + + use_RSP_L_eqn_outer_BC = .false. + ! irradiation_flux ! ~~~~~~~~~~~~~~~~ ! column_depth_for_irradiation @@ -5880,11 +5894,15 @@ ! max_surface_cell_dq ! ~~~~~~~~~~~~~~~~~~~ + ! min_surface_cell_dq + ! ~~~~~~~~~~~~~~~~~~~ + ! Largest allowed dq at surface. ! :: max_surface_cell_dq = 1d-12 + min_surface_cell_dq = 1d-99 ! max_num_subcells @@ -5899,12 +5917,15 @@ ! max_num_merge_cells ! ~~~~~~~~~~~~~~~~~~~ + ! max_num_merge_surface_cells + ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! Limits number of old cells to merge into 1 new one. ! :: max_num_merge_cells = 2 + max_num_merge_surface_cells = 2 ! mesh_adjust_get_T_from_E @@ -6492,6 +6513,28 @@ merge_amr_k_for_ignore_surface_cells = 2 + ! merge_amr_ignore_core_cells + ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ! merge_amr_logT_for_ignore_core_cells + ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ! split_amr_ignore_core_cells + ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ! split_amr_logT_for_ignore_core_cells + ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + ! For pulsation calulations, splitting and merging core cells can cause problems. + ! If merge_amr_ignore_core_cells or split_amr_ignore_surface_cells is true, + ! then the innermost cells above merge_amr_logT_for_ignore_core_cells or + ! split_amr_logT_for_ignore_core_cells cells are ignored for split/merge. + + ! :: + + merge_amr_ignore_core_cells = .false. + merge_amr_logT_for_ignore_core_cells = 1d99 + split_amr_ignore_core_cells = .false. + split_amr_logT_for_ignore_core_cells = 1d99 + + ! split_merge_amr_avoid_repeated_remesh ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/star/defaults/controls_dev.defaults b/star/defaults/controls_dev.defaults index 3a32245a2..1d25f3e37 100644 --- a/star/defaults/controls_dev.defaults +++ b/star/defaults/controls_dev.defaults @@ -162,7 +162,7 @@ ! split burn -! ================ +! ========== ! op_split_burn_min_T_for_variable_T_solver @@ -174,3 +174,95 @@ ! :: op_split_burn_min_T_for_variable_T_solver = 1d99 + + +! TDC +! === + + + ! alpha_TDC_DAMPM + ! ~~~~~~~~~~~~~~~ + ! TDC_use_density_form_for_eddy_viscosity + ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + ! If alpha_TDC_DAMPM >0, then include eddy viscous damping in TDC alpha_TDC_DAMPM + ! This control is analogous to `RSP_alfam`, where the default is `RSP_alfam` = 0.25d0. + + ! If hydrostatic (v_flag, u_flag = .false. , v = 0 ) there are no velocity gradients, + ! and thus no shear to drive turbulence. Without shear, the eddy viscosity term becomes zero. + + ! If u_flag = .true. or TDC_use_density_form_for_eddy_viscosity = .true., use density + ! derivative from newton solver to form d(v/r)/dr, used to compute Eq and Uq. + + ! :: + + alpha_TDC_DAMPM = 0.25d0 + TDC_use_density_form_for_eddy_viscosity = .false. + + + + ! TDC_num_innermost_cells_forced_nonturbulent + ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + ! Forces innermost TDC_num_innermost_cells_forced_nonturbulent cells + ! to be nonturbulent, and sets gradT = gradr in these cells. + ! Useful for pulsation models in TDC. + + ! :: + + TDC_num_innermost_cells_forced_nonturbulent = 0 + + + ! include_mlt_corr_to_TDC + ! ~~~~~~~~~~~~~~~~~~~~~~~ + + ! If include_mlt_corr_to_TDC = .true. , mlt correction to TDC follows MESA VI (Jermyn et a. 2023) + ! in which we correct TDC on long timescales with Y_face ~ Y*Gamma/(1+Gamma). If .false., abandon + ! mlt limit of tdc and adopt original form of (Kuhfuß 1986) convection model in the local limit. + + ! :: + + include_mlt_corr_to_TDC = .true. + + + ! include_mlt_Pturb_in_thermodynamic_gradients + ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + ! If mlt_Pturb_factor > 0, includes the effect of turbulent pressure Pturb + ! on thermodynamic gradients gradr, grada, and hence gradT. The correction + ! is approximated as correction = Prad + Pgas / Ptotal, where Ptotal = Prad + Pgas + Pturb. + ! Not supported by other_alpha_mlt or starspots + + ! :: + + include_mlt_Pturb_in_thermodynamic_gradients = .false. + + + ! make_mlt_hydrodynamic + ! ~~~~~~~~~~~~~~~~~~~~~ + + + ! If make_mlt_hydrodynamic = .true., adopt geff = g - dv/dt from newton solver. + ! gradr and scale_height are modified by this flag to hydro form. + ! If .false. default to QHSE form, where g = GM/r^2 + ! rotation, semiconvection, and use_mass_corrections ignore this flag, see star_utils. + ! not supported by RSP or RSP2. + + ! :: + + make_mlt_hydrodynamic = .false. + + + ! remesh_for_TDC_pulsations_log_core_zoning + ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + ! If remesh_for_TDC_pulsations, .true. will rezone below RSP2_Tanchor with logarithmic + ! spacing in mass. If .false., remeshing scheme will do a bisection root find such + ! that each zone increases in mass inward following a power law. + + ! :: + + remesh_for_TDC_pulsations_log_core_zoning = .false. + + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/README.rst b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/README.rst new file mode 100644 index 000000000..a25931921 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/README.rst @@ -0,0 +1,21 @@ +.. _ppisn: + +***** +ppisn +***** + +This test case evolves a very massive helium star from the He-ZAMS +up to the ocurrence of a pulsational pair-instability event (see |Marchant2019|). + +.. |Marchant2019| replace:: `Marchant et al. 2019 `__ + +Initialization of the model +=========================== +The initial mass of the helium star is set in ``inlist_extra`` + +.. literalinclude:: ../../../star/test_suite/ppisn/inlist_extra + +In this case we use a :math:`72 M_\odot` + +Last-Updated: 2019-11-12 (mesa r12413) by Pablo Marchant + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/ck b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/ck new file mode 100755 index 000000000..ac08f15c6 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/ck @@ -0,0 +1,7 @@ +#!/bin/bash + +# this provides the definition of check_one +# check_one +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +check_one diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/clean b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/clean new file mode 100755 index 000000000..95545a5c1 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/clean @@ -0,0 +1,4 @@ +#!/bin/bash + +cd make +make clean diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/gyre.in b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/gyre.in new file mode 100644 index 000000000..10381b567 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/gyre.in @@ -0,0 +1,34 @@ +&model + add_center = .FALSE. +/ + +&mode + l = 0 +/ + +&osc + inner_bound = 'ZERO_R' ! for envelopes + nonadiabatic = .TRUE. +/ + +&rot +/ + +&num + diff_scheme = 'MAGNUS_GL2'!'COLLOC_GL2' +/ + +&scan + grid_type = 'LINEAR' + freq_min = 0.5!1d-4 + freq_max = 5.0!10.0 + freq_min_units = 'ACOUSTIC_DELTA' + freq_max_units = 'ACOUSTIC_DELTA' + n_freq = 50 +/ + +&grid + w_osc = 10 + w_exp = 2 + w_ctr = 10 +/ diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/he_dep.mod b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/he_dep.mod new file mode 100644 index 000000000..510041114 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/he_dep.mod @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfeecd146db7e0aba70241df0484a35517997e5ec0e1b1f8b80c8982338b6148 +size 834110 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/history_columns.list b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/history_columns.list new file mode 100644 index 000000000..fc6f9fc25 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/history_columns.list @@ -0,0 +1,1073 @@ +! history_columns.list -- determines the contents of star history logs +! you can use a non-standard version by setting history_columns_file in your inlist + +! units are cgs unless otherwise noted. + +! reorder the following names as desired to reorder columns. +! comment out the name to omit a column (fewer columns => less IO => faster running). +! remove '!' to restore a column. + +! if you have a situation where you want a non-standard set of columns, +! make a copy of this file, edit as desired, and give the new filename in your inlist +! as history_columns_file. if you are just adding columns, you can 'include' this file, +! and just list the additions in your file. note: to include the standard default +! version, use include '' -- the 0 length string means include the default file. + +! blank lines and comments can be used freely. +! if a column name appears more than once in the list, only the first occurrence is used. + +! if you need to have something added to the list of options, let me know.... + + +! the first few lines of the log file contain a few items: + + ! version_number -- for the version of mesa being used + ! burn_min1 -- 1st limit for reported burning, in erg/g/s + ! burn_min2 -- 2nd limit for reported burning, in erg/g/s + + +!# other files + +! note: you can include another list by doing +! include 'filename' +! include '' means include the default standard list file + +! the following lines of the log file contain info about 1 model per row + +!---------------------------------------------------------------------------------------------- + +!# general info about the model + + model_number ! counting from the start of the run + num_zones ! number of zones in the model + + !## age + + star_age ! elapsed simulated time in years since the start of the run + !star_age_sec ! elapsed simulated time in seconds since the start of the run + !star_age_min ! elapsed simulated time in minutes since the start of the run + !star_age_hr ! elapsed simulated time in hours since the start of the run + !star_age_day ! elapsed simulated time in days since the start of the run + day ! elapsed simulated time in days since the start of the run + + log_star_age + log_star_age_sec + + !## timestep + + time_step ! timestep in years since previous model + time_step_sec ! timestep in seconds since previous model + time_step_days + log_dt ! log10 time_step in years + log_dt_sec ! log10 time_step in seconds + !log_dt_days ! log10 time_step in days + + !## mass + + star_mass ! in Msun units + !log_star_mass + + !star_gravitational_mass ! star_mass is baryonic mass + !star_mass_grav_div_mass + + !delta_mass ! star_mass - initial_mass in Msun units + log_xmstar ! log10 mass exterior to M_center (grams) + + !## mass change + + star_mdot ! d(star_mass)/dt (in msolar per year) + log_abs_mdot ! log10(abs(star_mdot)) (in msolar per year) + + !## imposed surface conditions + !Tsurf_factor + !tau_factor + !tau_surface + + !## imposed center conditions + !m_center + !m_center_gm + !r_center + !r_center_cm + !r_center_km + !L_center + !log_L_center + !log_L_center_ergs_s + !v_center + !v_center_kms + + !logt_max + +!---------------------------------------------------------------------------------------------- + +!# mixing and convection + + !max_conv_vel_div_csound + !max_gradT_div_grada + !max_gradT_sub_grada + !min_log_mlt_Gamma + + + !## mixing regions + + mass_conv_core ! (Msun) mass coord of top of convective core. 0 if core is not convective + + ! mx1 refers to the largest (by mass) convective region. + ! mx2 is the 2nd largest. + + ! conv_mx1_top and conv_mx1_bot are the region where mixing_type == convective_mixing. + ! mx1_top and mx1_bot are the extent of all kinds of mixing, convective and other. + + ! values are m/Mstar + conv_mx1_top + conv_mx1_bot + conv_mx2_top + conv_mx2_bot + mx1_top + mx1_bot + mx2_top + mx2_bot + + ! radius -- values are radii in Rsun units + !conv_mx1_top_r + !conv_mx1_bot_r + !conv_mx2_top_r + !conv_mx2_bot_r + !mx1_top_r + !mx1_bot_r + !mx2_top_r + !mx2_bot_r + + ! you might want to get a more complete list of mixing regions by using the following + + !mixing_regions ! note: this includes regions where the mixing type is no_mixing. + + ! the is the number of regions to report + ! there will be 2* columns for this in the log file, 2 for each region. + ! the first column for a region gives the mixing type as defined in const/public/const_def.f90. + + ! the second column for a region gives the m/mstar location of the top of the region + ! entries for extra columns after the last region in the star will have an invalid mixing_type value of -1. + ! mstar is the total mass of the star, so these locations range from 0 to 1 + ! all regions are include starting from the center, so the bottom of one region + ! is the top of the previous one. since we start at the center, the bottom of the 1st region is 0. + + ! the columns in the log file will have names like 'mix_type_1' and 'mix_qtop_1' + + ! if the star has too many regions to report them all, + ! the smallest regions will be merged with neighbors for reporting purposes only. + + + !mix_relr_regions + ! same as above, but locations given as r/rstar instead of m/mstar. + ! the columns in the log file will have names like 'mix_relr_type_1' and 'mix_relr_top_1' + + + !## conditions at base of largest convection zone (by mass) + !cz_bot_mass ! mass coordinate of base (Msun) + !cz_mass ! mass coordinate of base (Msun) -- same as cz_bot_mass + !cz_log_xmass ! mass exterior to base (g) + !cz_log_xmsun ! mass exterior to base (Msun) + !cz_xm ! mass exterior to base (Msun) + !cz_logT + !cz_logRho + !cz_logP + !cz_bot_radius ! Rsun + !cz_log_column_depth + !cz_log_radial_depth + !cz_luminosity ! Lsun + !cz_opacity + !cz_log_tau + !cz_eta + !cz_log_eps_nuc ! log10(ergs/g/s) + !cz_t_heat ! Cp*T/eps_nuc (seconds) + + !cz_csound + !cz_scale_height + !cz_grav + + !cz_omega + !cz_omega_div_omega_crit + + !cz_zone + + ! mass fractions at base of largest convection zone (by mass) + !cz_log_xa h1 + !cz_log_xa he4 + + !## conditions at top of largest convection zone (by mass) + !cz_top_mass ! mass coordinate of top (Msun) + !cz_top_log_xmass ! mass exterior to top (g) + !cz_top_log_xmsun ! mass exterior to top (Msun) + !cz_top_xm ! mass exterior to top (Msun) + !cz_top_logT + !cz_top_logRho + !cz_top_logP + !cz_top_radius ! Rsun + !cz_top_log_column_depth + !cz_top_log_radial_depth + !cz_top_luminosity ! Lsun + !cz_top_opacity + !cz_top_log_tau + !cz_top_eta + !cz_top_log_eps_nuc ! log10(ergs/g/s) + !cz_top_t_heat ! Cp*T/eps_nuc (seconds) + + !cz_top_csound + !cz_top_scale_height + !cz_top_grav + + !cz_top_omega + !cz_top_omega_div_omega_crit + + !cz_top_zone + !cz_top_zone_logdq + + ! mass fractions at top of largest convection zone (by mass) + !cz_top_log_xa h1 + !cz_top_log_xa he4 + +!---------------------------------------------------------------------------------------------- + +!# nuclear reactions + + !## integrated quantities + + !power_h_burn ! total thermal power from PP and CNO, excluding neutrinos (in Lsun units) + !power_he_burn ! total thermal power from triple-alpha, excluding neutrinos (in Lsun units) + !power_photo + !power_z_burn + !log_power_nuc_burn ! total thermal power from all burning, excluding photodisintegrations + log_LH ! log10 power_h_burn + log_LHe ! log10 power_he_burn + log_LZ ! log10 total burning power including LC, but excluding LH and LHe and photodisintegrations + log_Lnuc ! log(LH + LHe + LZ) + !log_Lnuc_ergs_s + !log_Lnuc_sub_log_L + !lnuc_photo + + !extra_L ! integral of extra_heat in Lsun units + !log_extra_L ! log10 extra_L + + !## neutrino losses + log_Lneu ! log10 power emitted in neutrinos, nuclear and thermal (in Lsun units) + !log_Lneu_nuc ! log10 power emitted in neutrinos, nuclear sources only (in Lsun units) + !log_Lneu_nonnuc ! log10 power emitted in neutrinos, thermal sources only (in Lsun units) + + !mass_loc_of_max_eps_nuc ! (in Msun units) + !mass_ext_to_max_eps_nuc ! (in Msun units) + !eps_grav_integral ! (in Lsun units) + !log_abs_Lgrav ! log10 abs(eps_grav_integral) (in Lsun units) + + !## information about reactions (by category) + + ! log10 total luminosity for reaction categories (Lsun units) + + pp + cno + tri_alpha + !c_alpha + !n_alpha + !o_alpha + !ne_alpha + !na_alpha + !mg_alpha + !si_alpha + !s_alpha + !ar_alpha + !ca_alpha + !ti_alpha + !fe_co_ni + !c12_c12 + !c12_o16 + !o16_o16 + !photo + !pnhe4 + !other + + !## information about individual reactions + + ! adds columns for all of the reactions that are in the current net + ! Note that if using op_split_burn=.true. then zones which have been split will report 0 for thier rates + !add_raw_rates ! raw reaction rates, reactions/second + !add_screened_rates ! screened reaction rates reactions/second + !add_eps_nuc_rates ! Nuclear energy (minus neutrino losses) released erg/s + !add_eps_neu_rates ! Neutrino losses erg/s + + ! individual reactions (as many as desired) + ! use list_net_reactions = .true. in star_job to list all reactions in the current net + ! reactions/second + !raw_rate r_h1_h1_ec_h2 + !raw_rate r_h1_h1_wk_h2 + + + + !## nuclear reactions at center + + ! center log10 burn erg/g/s for reaction categories + + !c_log_eps_burn cno + !c_log_eps_burn tri_alfa + + ! center d_eps_nuc_dlnd for reaction categories + + !c_d_eps_dlnd cno + !c_d_eps_dlnd tri_alfa + + ! center d_eps_nuc_dlnT for reaction categories + + !c_d_eps_dlnT cno + !c_d_eps_dlnT tri_alfa + + !## regions of strong nuclear burning + + ! 2 zones where eps_nuc > burn_min1 erg/g/s + ! for each zone have 4 numbers: start1, start2, end2, end1 + ! start1 is mass of inner edge where first goes > burn_min1 (or -20 if none such) + ! start2 is mass of inner edge where first zone reaches burn_min2 erg/g/sec (or -20 if none such) + ! end2 is mass of outer edge where first zone drops back below burn_min2 erg/g/s + ! end1 is mass of outer edge where first zone ends (i.e. eps_nuc < burn_min1) + ! similar for the second zone + + epsnuc_M_1 ! start1 for 1st zone + epsnuc_M_2 ! start2 + epsnuc_M_3 ! end2 + epsnuc_M_4 ! end1 + + epsnuc_M_5 ! start1 for 2nd zone + epsnuc_M_6 ! start2 + epsnuc_M_7 ! end2 + epsnuc_M_8 ! end1 + + + ! you might want to get a more complete list of burning regions by using the following + + !burning_regions + ! the is the number of regions to report + ! there will be 2* columns for this in the log file, 2 for each region. + ! the first column for a region gives int(sign(val)*log10(max(1,abs(val)))) + ! where val = ergs/gm/sec nuclear energy minus all neutrino losses. + ! the second column for a region gives the q location of the top of the region + ! entries for extra columns after the last region in the star will have a value of -9999 + ! all regions are included starting from the center, so the bottom of one region + ! is the top of the previous one. + ! since we start at the center, the bottom of the 1st region is q=0 and top of last is q=1. + + ! the columns in the log file will have names like 'burn_type_1' and 'burn_qtop_1' + + !burn_relr_regions + ! same as above, but locations given as r/rstar instead of m/mstar. + ! the columns in the log file will have names like 'burn_relr_type_1' and 'burn_relr_top_1' + + + ! if the star has too many regions to report them all, + ! the smallest regions will be merged with neighbors for reporting purposes only. + +!---------------------------------------------------------------------------------------------- + +!# information about core and envelope + + !## helium core + he_core_mass + he_core_radius + !he_core_lgT + !he_core_lgRho + !he_core_L + !he_core_v + !he_core_omega + !he_core_omega_div_omega_crit + !he_core_k + + !## CO core + co_core_mass + !CO_core + co_core_radius + !co_core_lgT + !co_core_lgRho + !co_core_L + !co_core_v + !co_core_omega + !co_core_omega_div_omega_crit + !co_core_k + + !## ONe core + one_core_mass + !one_core_radius + !one_core_lgT + !one_core_lgRho + !one_core_L + !one_core_v + !one_core_omega + !one_core_omega_div_omega_crit + !one_core_k + + !## iron core + fe_core_mass + !fe_core_radius + !fe_core_lgT + !fe_core_lgRho + !fe_core_L + !fe_core_v + !fe_core_omega + !fe_core_omega_div_omega_crit + !fe_core_k + + !## neuton rich core + neutron_rich_core_mass + !neutron_rich_core_radius + !neutron_rich_core_lgT + !neutron_rich_core_lgRho + !neutron_rich_core_L + !neutron_rich_core_v + !neutron_rich_core_omega + !neutron_rich_core_omega_div_omega_crit + !neutron_rich_core_k + + !## envelope + + !envelope_mass ! = star_mass - he_core_mass + !envelope_fraction_left ! = envelope_mass / (initial_mass - he_core_mass) + + !h_rich_layer_mass ! = star_mass - he_core_mass + !he_rich_layer_mass ! = he_core_mass - c_core_mass + !co_rich_layer_mass + +!---------------------------------------------------------------------------------------------- + +!# timescales + + !dynamic_timescale ! dynamic timescale (seconds) -- estimated by 2*pi*sqrt(r^3/(G*m)) + !kh_timescale ! kelvin-helmholtz timescale (years) + !mdot_timescale ! star_mass/abs(star_mdot) (years) + !kh_div_mdot_timescales ! kh_timescale/mdot_timescale + !nuc_timescale ! nuclear timescale (years) -- proportional to mass divided by luminosity + + !dt_cell_collapse ! min time for any cell to collapse at current velocities + !dt_div_dt_cell_collapse + + !dt_div_max_tau_conv ! dt/ maximum conv timescale + !dt_div_min_tau_conv ! dt/ minimum conv timescale + + + !min_dr_div_cs ! min over all cells of dr/csound (seconds) + !min_dr_div_cs_k ! location of min + !log_min_dr_div_cs ! log10 min dr_div_csound (seconds) + !min_dr_div_cs_yr ! min over all cells of dr/csound (years) + !log_min_dr_div_cs_yr ! log10 min dr_div_csound (years) + !dt_div_min_dr_div_cs + !log_dt_div_min_dr_div_cs + + !min_t_eddy ! minimum value of scale_height/conv_velocity + +!---------------------------------------------------------------------------------------------- + +!# conditions at or near the surface of the model + + !## conditions at the photosphere + !effective_T + !Teff + log_Teff ! log10 effective temperature + ! Teff is calculated using Stefan-Boltzmann relation L = 4 pi R^2 sigma Teff^4, + ! where L and R are evaluated at the photosphere (tau_factor < 1) + ! or surface of the model (tau_factor >= 1) when photosphere is not inside the model. + + !photosphere_black_body_T + !photosphere_cell_T ! temperature at model location closest to the photosphere, not necessarily Teff + !photosphere_cell_log_T + !photosphere_cell_density + !photosphere_cell_log_density + !photosphere_cell_opacity + !photosphere_cell_log_opacity + !photosphere_L ! Lsun units + !photosphere_log_L ! Lsun units + !photosphere_r ! Rsun units + !photosphere_log_r ! Rsun units + !photosphere_m ! Msun units + !photosphere_v_km_s + !photosphere_cell_k + !photosphere_column_density + !photosphere_csound + !photosphere_log_column_density + !photosphere_opacity + !photosphere_v_div_cs + !photosphere_xm + !photosphere_cell_free_e + !photosphere_cell_log_free_e + !photosphere_logg + !photosphere_T + + !## conditions at or near the surface of the model (outer edge of outer cell) + + luminosity ! luminosity in Lsun units + !luminosity_ergs_s ! luminosity in cgs units + log_L ! log10 luminosity in Lsun units + !log_L_ergs_s ! log10 luminosity in cgs units + radius ! Rsun + log_R ! log10 radius in Rsun units + !radius_cm + !log_R_cm + + log_g ! log10 gravity + gravity + log_Ledd + log_L_div_Ledd ! log10(L/Leddington) + lum_div_Ledd + !log_surf_optical_depth + !surface_optical_depth + + !log_surf_cell_opacity ! old name was log_surf_opacity + !log_surf_cell_P ! old name was log_surf_P + !log_surf_cell_pressure ! old name was log_surf_pressure + !log_surf_cell_density ! old name was log_surf_density + !log_surf_cell_temperature ! old name was log_surf_temperature + !surface_cell_temperature ! old name was surface_temperature + !log_surf_cell_z ! old name was log_surf_z + !surface_cell_entropy ! in units of kerg per baryon + ! old name was surface_entropy + + v_surf ! (cm/s) + v_surf_km_s ! (km/s) + v_div_csound_surf ! velocity divided by sound speed at outermost grid point + !v_div_csound_max ! max value of velocity divided by sound speed at face + !v_div_vesc + !v_phot_km_s + !v_surf_div_escape_v + + !v_surf_div_v_kh ! v_surf/(photosphere_r/kh_timescale) + + !surf_avg_j_rot + !surf_avg_omega + !surf_avg_omega_crit + !surf_avg_omega_div_omega_crit + !surf_avg_v_rot ! km/sec rotational velocity at equator + !surf_avg_v_crit ! critical rotational velocity at equator + !surf_avg_v_div_v_crit + !surf_avg_Lrad_div_Ledd + !surf_avg_logT + !surf_avg_logRho + !surf_avg_opacity + + ! Gravity Darkening, reports the surface averaged L/Lsun and Teff (K) caused by + ! gravity darkening in rotating stars. Based on the model of Espinosa Lara & Rieutord (2011) + ! 'polar' refers to the line of sight being directed along the rotation axis of the star + ! 'equatorial' refers to the line of sight coincident with the stellar equator + !grav_dark_L_polar !Lsun + !grav_dark_Teff_polar !K + !grav_dark_L_equatorial !Lsun + !grav_dark_Teff_equatorial !K + + !surf_escape_v ! cm/s + + !v_wind_Km_per_s ! Km/s + ! = 1d-5*s% opacity(1)*max(0d0,-s% mstar_dot)/ & + ! (4*pi*s% photosphere_r*Rsun*s% tau_base) + ! Lars says: + ! wind_mdot = 4*pi*R^2*rho*v_wind + ! tau = integral(opacity*rho*dr) from R to infinity + ! so tau = opacity*wind_mdot/(4*pi*R*v_wind) at photosphere + ! or v_wind = opacity*wind_mdot/(4*pi*R*tau) at photosphere + + !rotational_mdot_boost ! factor for increase in mass loss mdot due to rotation + !log_rotational_mdot_boost ! log factor for increase in mass loss mdot due to rotation + !surf_r_equatorial_div_r_polar + !surf_r_equatorial_div_r + !surf_r_polar_div_r + +!---------------------------------------------------------------------------------------------- + +!# conditions near center + + log_center_T ! temperature + log_center_Rho ! density + log_center_P ! pressure + + ! shorter names for above + log_cntr_P + log_cntr_Rho + log_cntr_T + + !center_T ! temperature + !center_Rho ! density + !center_P ! pressure + + !center_degeneracy ! the electron chemical potential in units of k*T + !center_gamma ! plasma interaction parameter + center_mu + center_ye + center_abar + !center_zbar + + !center_eps_grav + + !center_non_nuc_neu + !center_eps_nuc + !d_center_eps_nuc_dlnT + !d_center_eps_nuc_dlnd + !log_center_eps_nuc + + !center_entropy ! in units of kerg per baryon + !max_entropy ! in units of kerg per baryon + !fe_core_infall + !non_fe_core_infall + !non_fe_core_rebound + !max_infall_speed + + !compactness_parameter ! (m/Msun)/(R(m)/1000km) for m = 2.5 Msun + !compactness + !m4 ! Mass co-ordinate where entropy=4 + ! mu4 is sensitive to the choice of how much dm/dr you average over, thus we average dm and dr over M(entropy=4) and M(entropy=4)+0.3Msun + !mu4 ! dM(Msun)/dr(1000km) where entropy=4 + + + !center_omega + !center_omega_div_omega_crit + +!---------------------------------------------------------------------------------------------- + +!# abundances + + !species ! size of net + + !## mass fractions near center + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_center_abundances + !add_log_center_abundances + + ! individual central mass fractions (as many as desired) + center h1 + center he4 + center c12 + center o16 + + ! individual log10 central mass fractions (as many as desired) + !log_center h1 + !log_center he4 + ! etc. + + + !## mass fractions near surface + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_surface_abundances + !add_log_surface_abundances + + ! individual surface mass fractions (as many as desired) + !surface h1 + !surface he4 + surface c12 + surface o16 + ! etc. + + ! individual log10 surface mass fractions (as many as desired) + + !log_surface h1 + !log_surface he4 + + + !## mass fractions for entire star + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_average_abundances + !add_log_average_abundances + + ! individual average mass fractions (as many as desired) + !average h1 + !average he4 + ! etc. + + ! individual log10 average mass fractions (as many as desired) + !log_average h1 + !log_average he4 + ! etc. + + + !## mass totals for entire star (in Msun units) + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_total_mass + !add_log_total_mass + + ! individual mass totals for entire star (as many as desired) + total_mass h1 + total_mass he4 + ! etc. + + ! individial log10 mass totals for entire star (in Msun units) + !log_total_mass h1 + !log_total_mass he4 + ! etc. + +!---------------------------------------------------------------------------------------------- + +!# info at specific locations + + !## info at location of max temperature + !max_T + !log_max_T + + +!---------------------------------------------------------------------------------------------- + +!# information about shocks + + !## info about outermost outward moving shock + ! excluding locations with q > max_q_for_outer_mach1_location + ! returns values at location of max velocity + !shock_mass ! baryonic (Msun) + !shock_mass_gm ! baryonic (grams) + !shock_q + !shock_radius ! (Rsun) + !shock_radius_cm ! (cm) + !shock_velocity + !shock_csound + !shock_v_div_cs + !shock_lgT + !shock_lgRho + !shock_lgP + !shock_gamma1 + !shock_entropy + !shock_tau + !shock_k + !shock_pre_lgRho + +!---------------------------------------------------------------------------------------------- + +!# asteroseismology + + delta_nu ! large frequency separation for p-modes (microHz) + ! 1e6/(seconds for sound to cross diameter of star) + delta_Pg ! g-mode period spacing for l=1 (seconds) + ! sqrt(2) pi^2/(integral of brunt_N/r dr) + !log_delta_Pg + nu_max ! estimate from scaling relation (microHz) + ! nu_max = nu_max_sun * M/Msun / ((R/Rsun)^2 (Teff/Teff_sun)^0.5) + ! with nu_max_sun = 3100 microHz, Teff_sun = 5777 + !nu_max_3_4th_div_delta_nu ! nu_max^0.75/delta_nu + acoustic_cutoff ! 0.5*g*sqrt(gamma1*rho/P) at surface + acoustic_radius ! integral of dr/csound (seconds) + !ng_for_nu_max ! = 1 / (nu_max*delta_Pg) + ! period for g-mode with frequency nu_max = nu_max_ng*delta_Pg + !gs_per_delta_nu ! delta_nu / (nu_max**2*delta_Pg) + ! number of g-modes per delta_nu at nu_max + + !int_k_r_dr_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=1 + !int_k_r_dr_2pt0_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=1 + !int_k_r_dr_0pt5_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=1 + !int_k_r_dr_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=2 + !int_k_r_dr_2pt0_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=2 + !int_k_r_dr_0pt5_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=2 + !int_k_r_dr_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=3 + !int_k_r_dr_2pt0_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=3 + !int_k_r_dr_0pt5_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=3 + +!---------------------------------------------------------------------------------------------- + +!# energy information + + !total_energy ! at end of step + !log_total_energy ! log(abs(total_energy)) + !total_energy_after_adjust_mass ! after mass adjustments + + ! shorter versions of above + !tot_E + !log_tot_E + + + !total_gravitational_energy + !log_total_gravitational_energy ! log(abs(total_gravitational_energy)) + !total_gravitational_energy_after_adjust_mass + + ! shorter versions of above + !tot_PE + !log_tot_PE + + !total_internal_energy + !log_total_internal_energy + !total_internal_energy_after_adjust_mass + + ! shorter versions of above + !tot_IE + !log_tot_IE + + !total_radial_kinetic_energy + !log_total_radial_kinetic_energy + !total_radial_kinetic_energy_after_adjust_mass + + ! shorter versions of above (does not include rot KE) + !tot_KE + !log_tot_KE + + !total_turbulent_energy + !log_total_turbulent_energy + !total_turbulent_energy_after_adjust_mass + !tot_Et + !log_tot_Et + + !total_energy_foe + + !tot_IE_div_IE_plus_KE + !total_IE_div_IE_plus_KE + + !total_entropy + !total_eps_grav + + !total_energy_sources_and_sinks ! for this step + !total_nuclear_heating + !total_non_nuc_neu_cooling + !total_irradiation_heating + !total_extra_heating ! extra heat integrated over the model times dt (erg) + !total_WD_sedimentation_heating + + !rel_run_E_err + + !rel_E_err + !abs_rel_E_err + !log_rel_E_err + + !tot_e_equ_err + !tot_e_err + + + !error_in_energy_conservation ! for this step + ! = total_energy - (total_energy_start + total_energy_sources_and_sinks) + !cumulative_energy_error ! = sum over all steps of abs(error_in_energy_conservation) + !rel_cumulative_energy_error ! = cumulative_energy_error/total_energy + log_rel_cumulative_energy_error ! = log10 of rel_cumulative_energy_error + log_rel_run_E_err ! shorter name for rel_cumulative_energy_error + + !rel_error_in_energy_conservation ! = error_in_energy_conservation/total_energy + log_rel_error_in_energy_conservation + + !virial_thm_P_avg + !virial_thm_rel_err + !work_inward_at_center + !work_outward_at_surface + + +!---------------------------------------------------------------------------------------------- + + !# rotation + + !total_angular_momentum + log_total_angular_momentum + !i_rot_total ! moment of inertia + + !total_rotational_kinetic_energy + !log_total_rotational_kinetic_energy + !total_rotational_kinetic_energy_after_adjust_mass + +!---------------------------------------------------------------------------------------------- + +!# velocities + + !avg_abs_v_div_cs + !log_avg_abs_v_div_cs + !max_abs_v_div_cs + !log_max_abs_v_div_cs + + !avg_abs_v + !log_avg_abs_v + !max_abs_v + !log_max_abs_v + + !u_surf + !u_surf_km_s + !u_div_csound_surf + !u_div_csound_max + + !infall_div_cs + +!---------------------------------------------------------------------------------------------- + +!# misc + + !e_thermal ! sum over all zones of Cp*T*dm + + !## eos + !logQ_max ! logQ = logRho - 2*logT + 12 + !logQ_min + !gamma1_min + + !## core mixing + !mass_semiconv_core + + !## H-He boundary + + !diffusion_time_H_He_bdy + !temperature_H_He_bdy + + + !## optical depth and opacity + + !one_div_yphot + !log_one_div_yphot + + !log_min_opacity + !min_opacity + + !log_tau_center + + !log_max_tau_conv + !max_tau_conv + !log_min_tau_conv + !min_tau_conv + + !tau_qhse_yrs + + !## other + + !Lsurf_m + !dlnR_dlnM + !h1_czb_mass ! location (in Msun units) of base of 1st convection zone above he core + !kh_mdot_limit + !log_cntr_dr_cm + !min_Pgas_div_P + !surf_c12_minus_o16 ! this is useful for seeing effects of dredge up on AGB + !surf_num_c12_div_num_o16 + + !phase_of_evolution ! Integer mapping to the type of evolution see star_data/public/star_data_def.inc for definitions + + !## MLT++ + !gradT_excess_alpha + !gradT_excess_min_beta + !gradT_excess_max_lambda + + !max_L_rad_div_Ledd + !max_L_rad_div_Ledd_div_phi_Joss + + + !## RTI + !rti_regions + + !## Ni & Co + !total_ni_co_56 + + + !## internal structure constants + + ! this is evaluated assuming a spherical star and does not account for rotation + !apsidal_constant_k2 + + +!---------------------------------------------------------------------------------------------- + +!# accretion + + !k_below_const_q + !q_below_const_q + !logxq_below_const_q + + !k_const_mass + !q_const_mass + !logxq_const_mass + + !k_below_just_added + !q_below_just_added + !logxq_below_just_added + + !k_for_test_CpT_absMdot_div_L + !q_for_test_CpT_absMdot_div_L + !logxq_for_test_CpT_absMdot_div_L + +!---------------------------------------------------------------------------------------------- + +!# Color output + + ! Outputs the bolometric correction (bc) for the star in filter band ``filter'' (case sensitive) + !bc filter + + ! Outputs the absolute magnitude for the star in filter band ``filter'' (case sensitive) + !abs_mag filter + + ! Adds all the bc's to the output + add_bc + + ! Adds all the absolute magnitudes to the output + add_abs_mag + + ! Outputs luminosity in filter band ``filter'' (erg s^-1) (case sensitive) + !lum_band filter + + ! Adds all the filter band luminosities to the output (erg s^-1) + add_lum_band + + ! Outputs log luminosity in filter band ``filter'' (log erg s^-1) (case sensitive) + !log_lum_band filter + + ! Adds all the filter band luminosities to the output (log erg s^-1) + add_log_lum_band + +!---------------------------------------------------------------------------------------------- + +!# RSP + + !rsp_DeltaMag ! absolute magnitude difference between minimum and maximum light (mag) + !rsp_DeltaR ! R_max - R_min difference in the max and min radius (Rsun) + !rsp_GREKM ! fractional growth of the kinetic energy per pulsation period ("nonlinear growth rate") - see equation 5 in MESA5 + !rsp_num_periods ! Count of the number of pulsation cycles completed + !rsp_period_in_days ! Running period, ie., period between two consecutive values of R_max (days) + !rsp_phase ! Running pulsation phase for a cycle + +!---------------------------------------------------------------------------------------------- +!# debugging + + !## retries + num_retries ! total during the run + + !## solver iterations + + num_iters ! same as num_solver_iterations + !num_solver_iterations ! iterations at this step + !total_num_solver_iterations ! total iterations during the run + !avg_num_solver_iters + + !rotation_solver_steps + + !diffusion_solver_steps + !diffusion_solver_iters + + !avg_setvars_per_step + !avg_skipped_setvars_per_step + !avg_solver_setvars_per_step + + !burn_solver_maxsteps + + !total_num_solver_calls_converged + !total_num_solver_calls_failed + !total_num_solver_calls_made + !total_num_solver_relax_calls_converged + !total_num_solver_relax_calls_failed + !total_num_solver_relax_calls_made + !total_num_solver_relax_iterations + + !total_step_attempts + !total_step_redos + !total_step_retries + !total_steps_finished + !total_steps_taken + + !TDC_num_cells + + !## Relaxation steps + !total_relax_step_attempts + !total_relax_step_redos + !total_relax_step_retries + !total_relax_steps_finished + !total_relax_steps_taken + + !## conservation during mesh adjust + !log_mesh_adjust_IE_conservation + !log_mesh_adjust_KE_conservation + !log_mesh_adjust_PE_conservation + + !## amr + !num_hydro_merges + !num_hydro_splits + + !## timing + !elapsed_time ! time since start of run (seconds) + + !## Extras + burning_regions 40 + mixing_regions 40 + mix_relr_regions 40 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_common b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_common new file mode 100644 index 000000000..65ca32567 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_common @@ -0,0 +1,255 @@ + +&kap + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_extra' +/ + +&eos + + +/ ! end of eos namelist + +&star_job + + set_initial_cumulative_energy_error = .true. + new_cumulative_energy_error = 0d0 + + change_rotation_flag = .true. + new_rotation_flag = .false. + change_w_div_wc_flag = .true. + new_w_div_wc_flag = .false. + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_extra' + + pgstar_flag = .true. + save_pgstar_files_when_terminate = .true. + + num_special_rate_factors = 2 + reaction_for_special_factor(1) = 'r_c12_ag_o16' + special_rate_factor(1) = 1 + filename_of_special_rate(1) = 'c12ag_deboer_sigma_0p0_2000_Tgrid.dat' + + reaction_for_special_factor(2) = 'r_he4_he4_he4_to_c12' + special_rate_factor(2) = 1 + filename_of_special_rate(2) = 'r_he4_he4_he4_to_c12_cf88.txt' + + +/ !end of star_job namelist + + +&controls + + ! in principle this is the only thing that needs changing + ! it is set in inlist_extra + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_extra' + +! GYRE output controls + !write_pulse_data_with_profile = .true. + pulse_data_format = 'GYRE' + + x_logical_ctrl(37) = .true. ! if true, then run GYRE + + x_integer_ctrl(1) = 1000 ! output GYRE info at this step interval + x_logical_ctrl(1) = .false. ! save GYRE info whenever save profile + + x_integer_ctrl(2) = 3 ! max number of modes to output per call + x_logical_ctrl(2) = .false. ! output eigenfunction files + + x_integer_ctrl(3) = 0 ! mode l (e.g. 0 for p modes, 1 for g modes) + ! should match gyre.in mode l + x_integer_ctrl(4) = 1 ! order + x_ctrl(1) = 0.158d-05 ! freq ~ this (Hz) + x_ctrl(2) = 0.33d+03 ! growth < this (days) + + + okay_to_remove_mixing_singleton = .false. + + + + limit_for_rel_error_in_energy_conservation = 1d1 + hard_limit_for_rel_error_in_energy_conservation = 1d2 + + + + ! adjustments to the newton solver + solver_max_tries_before_reject = 30 + max_tries_for_retry = 30 + max_tries_after_5_retries = 40 + max_tries_after_10_retries = 40 + max_tries_after_20_retries = 40 + corr_coeff_limit = 1d-2 + + + use_gold_tolerances = .true. + use_gold2_tolerances = .true. + gold_iter_for_resid_tol2 = 10 + gold_iter_for_resid_tol3 = 10 + gold_tol_residual_norm3 = 1d-6 + gold_tol_max_residual3 = 1d-3 + gold_solver_iters_timestep_limit = 20 + solver_iters_timestep_limit = 50 + ignore_too_large_correction = .true. + scale_max_correction = 0.1d0 + !corr_coeff_limit = 0.2d0 + ignore_min_corr_coeff_for_scale_max_correction = .true. + ignore_species_in_max_correction = .true. + + + mlt_make_surface_no_mixing = .false. + !convergence_ignore_equL_residuals = .false., see other inlists + make_gradr_sticky_in_solver_iters = .false. + xa_scale = 1d-5 + iter_for_resid_tol2 = 10 + + + + ! during pulses very small cells near the surface can sometimes exceed + ! the speed of light. This has no impact in the behaviour of the bulk + ! of the star so we don't want to have a retry if that happens + retry_for_v_above_clight = .false. + + + relax_max_number_retries = 99999999!1000 + max_number_retries = 99999999 !500 ! RECOMMENDED 5000 + + ! During hydro we can use es scattering opacity on the very outermost cell + use_other_kap = .false. + + ! convection controls + MLT_option = 'TDC' + alpha_TDC_DAMP = 1d0 + alpha_TDC_DAMPR = 0d0 + alpha_TDC_PtdVdt = 0d0 + alpha_TDC_DAMPM = 0.25d0 + steps_before_use_TDC = 0 + + use_ledoux_criterion = .true. + alpha_semiconvection = 1d0 + thermohaline_coeff = 0d0 + num_cells_for_smooth_gradL_composition_term = 0 + + energy_eqn_option = 'dedt' + + + ! surface controls, probably uncessary + scale_max_correction_for_negative_surf_lum = .true. + max_frac_for_negative_surf_lum = 0.8 + + + ! overshoot controls + ! we only include a bit of exponential overshooting to smooth things out + + overshoot_scheme(1) = 'none' + overshoot_zone_type(1) = 'any' + overshoot_zone_loc(1) = 'shell' + overshoot_bdy_loc(1) = 'any' + overshoot_f(1) = 0.001 + overshoot_f0(1) = 0.0005 + + overshoot_scheme(2) = 'exponential' + overshoot_zone_type(2) = 'any' + overshoot_zone_loc(2) = 'core' + overshoot_bdy_loc(2) = 'any' + overshoot_f(2) = 0.01 + overshoot_f0(2) = 0.005 + + overshoot_D_min = 1d-8 + + + ! timestep options + varcontrol_target = 1d-3!5d-4 + max_timestep_factor = 1.2d0 + min_timestep_factor = 0.8d0 + dX_nuc_drop_limit = 5d-2 + dX_nuc_drop_limit_at_high_T = 1d-2 ! for center logT > 9.45 + delta_Ye_highT_limit = 1d-3 + dX_nuc_drop_max_A_limit = 52 + dX_nuc_drop_min_X_limit = 1d-4 + dX_nuc_drop_hard_limit = 1d99 + delta_lgTeff_limit = 1d0 + + delta_lgL_hard_limit = -1!1d200 + delta_lgR_limit = 1d-2!0.025d0 + delta_lgR_hard_limit = -1!0.05d0 + delta_lgR_limit_min_lgR = 3d0 ! 3d0 for >1000 Rsun + delta_lgL_He_limit = -1d0 + lgL_nuc_burn_min = 4d0 + retry_hold = 0 + + ! limit for changes in central abundances, RECOMMENDED 0.001d0 for all + delta_XH_cntr_limit = 0.01d0 + delta_XHe_cntr_limit = 0.01d0 + delta_XC_cntr_limit = 0.01d0 + delta_XO_cntr_limit = 0.01d0 + + ! extra controls for timestep + delta_lg_star_mass_limit = 2d-3 ! RECOMMENDED 2d-3 + delta_lgRho_cntr_limit = 0.005d0 ! RECOMMENDED 0.0025d0 + delta_lgRho_cntr_hard_limit = 0.1d0 ! RECOMMENDED 0.005d0 + + min_timestep_limit = 1d-20 ! (seconds) + relax_hard_limits_after_retry = .false. + + ! mesh controls + !max_dq = 1d-3 ! RECOMMENDED 1d-3 + + ! rotational mixing coeffs + !am_nu_ST_factor = 1.0 + !D_visc_factor = 0.0 + !am_nu_SH_factor = 0.0 + !D_ST_factor = 0.0 + !D_SH_factor = 0.0 + !D_GSF_factor = 1.0 + !D_ES_factor = 1.0 + !D_SSI_factor = 1.0 + !D_DSI_factor = 1.0 + !am_D_mix_factor = 0.0333333d0 + !am_gradmu_factor = 0.1d0 + !num_cells_for_smooth_gradL_composition_term = 2 + + ! use implicit wind close to critical + max_tries_for_implicit_wind = 10 + surf_avg_tau_min = 0 + surf_avg_tau = 10 + !max_mdot_redo_cnt = 200 ! this is set in inlist_hydro_on and inlist_hydro_off + min_years_dt_for_redo_mdot = 0 + surf_omega_div_omega_crit_limit = 0.98d0 + surf_omega_div_omega_crit_tol = 0.02d0 + rotational_mdot_boost_fac = 1d10 + rotational_mdot_kh_fac = 1d10 + mdot_revise_factor = 1.1 + implicit_mdot_boost = 0.05 + ! this needs to be relaxed just to avoid a crash when hydro Riemann is turned on + angular_momentum_error_retry = 1d99 + angular_momentum_error_warn = 1d-10 + + ! Fixing the position of the Lagrangian region of the mesh helps + ! convergence near the Eddington limit + !max_logT_for_k_below_const_q = 100 + !max_q_for_k_below_const_q = 0.99 + !min_q_for_k_below_const_q = 0.99 + !max_logT_for_k_const_mass = 100 + !max_q_for_k_const_mass = 0.98 + !min_q_for_k_const_mass = 0.98 + + + photo_digits = 8 + photo_interval = 1000 + profile_interval = 200!50 + history_interval = 1!10 + terminal_interval = 10!10 + max_num_profile_models = 10000 ! 100 ! RECOMMENDED 10000 + + + num_trace_history_values = 2 + trace_history_value_name(1) = 'log_rel_run_E_err' + trace_history_value_name(2) = 'rel_E_err' + warn_when_large_rel_run_E_err = 1d-2 +/ ! end of controls namelist + +&pgstar + +/ diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_extra b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_extra new file mode 100644 index 000000000..a9899a066 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_extra @@ -0,0 +1,27 @@ + +&star_job +!new_Z = 1.42d-2 +!new_omega_div_omega_crit = 0.10d0 + initial_zfracs = 6 ! Added by eb + +/ ! end of controls namelist + +&kap +kap_file_prefix = 'a09' ! 'gs98' 'a09' 'OP_a09' 'OP_gs98' +kap_CO_prefix = 'a09_co' ! 'gs98_co' 'a09_co' +Zbase = 0.003d0 !0.0142d0 +kap_lowT_prefix = 'lowT_fa05_a09p' +!AESOPUS_filename = 'AESOPUS_AGSS09.h5' ! used only if kap_lowT_prefix = 'AESOPUS' +use_Type2_opacities = .true. + +!cubic_interpolation_in_X = .true. +!cubic_interpolation_in_Z = .true. + +/ ! end of kap namelist + +&controls +initial_mass = 15d0 +initial_Y = 0.267d0 !0.2703 !0.99858d0 +initial_Z = 0.003d0 !0.0142d0 +!initial_he3 = 0d0 +/ ! end of controls namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_pgstar b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_pgstar new file mode 100644 index 000000000..bf9e53bd9 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_pgstar @@ -0,0 +1,751 @@ + +&pgstar + +!pause = .true. + +pgstar_interval = 50 ! making this too small slows the model down. +pgstar_show_age_in_years = .true. +pgstar_show_age_in_seconds = .false. +pgstar_sleep = 0.0 + +! some global grid plot settings at end + +pgstar_show_model_number = .false. +pgstar_show_age = .false. + +!------------------------------------------------------------------------------------ + +Grid1_win_flag = .true. +Grid1_win_width = 12 +Grid1_win_aspect_ratio = 0.666 + +! file output +Grid1_file_flag = .true. +Grid1_file_dir = 'png' +Grid1_file_prefix = 'Grid1_' +Grid1_file_interval = 10 ! output when mod(model_number,Grid1_file_interval)==0 +Grid1_file_width = 27 ! (inches) negative means use same value as for window +Grid1_file_aspect_ratio = -1 ! negative means use same value as for window + +! reset the defaults + +Grid1_plot_name(:) = '' +Grid1_plot_row(:) = 1 ! number from 1 at top +Grid1_plot_rowspan(:) = 1 ! plot spans this number of rows +Grid1_plot_col(:) = 1 ! number from 1 at left +Grid1_plot_colspan(:) = 1 ! plot spans this number of columns +Grid1_plot_pad_left(:) = 0.0 ! fraction of full window width for padding on left +Grid1_plot_pad_right(:) = 0.0 ! fraction of full window width for padding on right +Grid1_plot_pad_top(:) = 0.0 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(:) = 0.0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(:) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_title = '' + +Grid1_num_cols = 3 ! divide plotting region into this many equal width cols +Grid1_num_rows = 5 ! divide plotting region into this many equal height rows +Grid1_num_plots = 6 ! <= 10 + + +Grid1_plot_name(1) = 'Text_Summary1' +Grid1_plot_row(1) = 1 ! number from 1 at top +Grid1_plot_rowspan(1) = 1 ! plot spans this number of rows +Grid1_plot_col(1) = 1 ! number from 1 at left +Grid1_plot_colspan(1) = 3 ! plot spans this number of columns + +Grid1_plot_pad_left(1) = -0.03 ! fraction of full window width for padding on left +Grid1_plot_pad_right(1) = 0.0 ! fraction of full window width for padding on right +Grid1_plot_pad_top(1) = -0.06 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(1) = 0.07 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(1) = 1 ! 0.8 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(3) = 'HR' +Grid1_plot_row(3) = 2 ! number from 1 at top +Grid1_plot_rowspan(3) = 1 ! plot spans this number of rows +Grid1_plot_col(3) = 1 ! number from 1 at left +Grid1_plot_colspan(3) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(3) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(3) = 0.08 ! fraction of full window width for padding on right +Grid1_plot_pad_top(3) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(3) = 0.01 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(3) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(5) = 'Profile_Panels1' +Grid1_plot_row(5) = 3 ! number from 1 at top +Grid1_plot_rowspan(5) = 3 ! plot spans this number of rows +Grid1_plot_col(5) = 1 ! number from 1 at left +Grid1_plot_colspan(5) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(5) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(5) = 0.10 ! fraction of full window width for padding on right +Grid1_plot_pad_top(5) = 0.05 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(5) = 0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(5) = 0.6 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(2) = 'TRho_Profile' +Grid1_plot_row(2) = 2 ! number from 1 at top +Grid1_plot_rowspan(2) = 1 ! plot spans this number of rows +Grid1_plot_col(2) = 2 ! number from 1 at left +Grid1_plot_colspan(2) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(2) = -0.01 ! fraction of full window width for padding on left +Grid1_plot_pad_right(2) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(2) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(2) = 0.01 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(2) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(4) = 'History_Panels1' +Grid1_plot_row(4) = 3 ! number from 1 at top +Grid1_plot_rowspan(4) = 3 ! plot spans this number of rows +Grid1_plot_col(4) = 2 ! number from 1 at left +Grid1_plot_colspan(4) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(4) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(4) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(4) = 0.05 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(4) = 0.0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(4) = 0.6 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(6) = 'Profile_Panels3' +Grid1_plot_row(6) = 2 ! number from 1 at top +Grid1_plot_rowspan(6) = 4 ! plot spans this number of rows +Grid1_plot_col(6) = 3 ! Number from 1 at left +Grid1_plot_colspan(6) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(6) = 0.04 ! fraction of full window width for padding on left +Grid1_plot_pad_right(6) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(6) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(6) = 0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(6) = 0.6 ! multiply txt_scale for subplot by this + + +!------------------------------------------------------------------------------------ + +Profile_Panels3_win_flag = .false. + +Profile_Panels3_title = '' + +Profile_Panels3_num_panels = 5 + +Profile_Panels3_yaxis_name(1) = 'Abundance' + +Profile_Panels3_yaxis_name(2) = 'Power' + +Profile_Panels3_yaxis_name(3) = 'Mixing' +Mixing_legend_txt_scale_factor = 0.9 + +Profile_Panels3_yaxis_name(4) = 'conv_vel_div_csound'!'conv_vel'!'logRho' +Profile_Panels3_other_yaxis_name(4) = 'v_div_cs' ! 'vel_km_per_s' ! 'entropy' +Profile_Panels3_other_dymin(4) = 0.14 + +Profile_Panels3_yaxis_name(5) = 'v_div_vesc'!'lum_div_Ledd'!'log_csound'!'logT' +Profile_Panels3_other_yaxis_name(5) = 'vel_km_per_s'!'burn_num_iters' + Profile_Panels3_yaxis_log(5) = .false. + +! x-axis limits and properties +Profile_Panels3_xaxis_name = 'logtau'!'zone'!'radius' +Profile_Panels3_xmin = -101d0 +Profile_Panels3_xmax = -101d0 !1700! -101d0 ! 2.2 +Profile_Panels3_xaxis_reversed = .true. + + +Profile_Panels3_txt_scale = 0.7 + +!Profile_Panels3_xaxis_name = 'zone' +!Profile_Panels3_xmin = 800 +!Profile_Panels3_xmax = 1100 +!Profile_Panels3_xaxis_reversed = .true. + +!Profile_Panels3_show_grid = .true. +Profile_Panels3_show_mix_regions_on_xaxis = .true. + +!------------------------------------------------------------------------------------ + +!Profile_Panels1_win_flag = .true. +!Profile_Panels1_file_flag = .true. + Profile_Panels1_file_dir = 'png' + Profile_Panels1_file_prefix = 'profile_panels1_' + Profile_Panels1_file_interval = 1 + Profile_Panels1_file_width = -1 + Profile_Panels1_file_aspect_ratio = -1 + +Profile_Panels1_title = '' + +Profile_Panels1_txt_scale = 0.7 +Profile_Panels1_num_panels = 4 + +Profile_Panels1_yaxis_name(1) = 'vel_km_per_s' +!Profile_Panels1_dymin(1) = 0.14 +Profile_Panels1_other_yaxis_name(1) = 'Lc_div_L' +!Profile_Panels1_other_dymin(1) = 0.14 + +Profile_Panels1_yaxis_name(2) = 'logT'!'logdq'!'radius'!'entropy' +Profile_Panels1_other_yaxis_name(2) = 'logRho'! 'Lc_div_L'!'log_dt_cs_div_dr'!'pgas_div_p' +Profile_Panels1_other_yaxis_log(2) = .false. + +!Profile_Panels1_ymax(2) = 2 +!Profile_Panels1_other_ymax(2) = 2 + +Profile_Panels1_yaxis_name(3) = 'mlt_Y_face'!'gradT' +Profile_Panels1_other_yaxis_name(3) = 'conv_vel'!'lum_div_Ledd'!'grada' +Profile_Panels1_same_yaxis_range(3) = .false. +Profile_Panels1_other_dymin(3) = 0.08 +!Profile_Panels1_yaxis_log(3) = .false. +Profile_Panels1_ymax(3) =-101d0 + +Profile_Panels1_yaxis_name(4) = 'log_opacity' +!Profile_Panels1_ymin(4) = 0 +Profile_Panels1_dymin(4) = 0.14 +Profile_Panels1_other_yaxis_name(4) = 'gradr' +Profile_Panels1_other_dymin(4) = 0.14 + +! x-axis limits and properties +Profile_Panels1_xaxis_name = 'zone'!'zone' +Profile_Panels1_xmin = -101d0!-101d0 +Profile_Panels1_xmax = -101d0!9d0 !-101d0 !8.1 +Profile_Panels1_xaxis_reversed = .true. + +!Profile_Panels1_xaxis_name = 'zone' +!Profile_Panels1_xmin = 15 +!Profile_Panels1_xmax = 270 +!Profile_Panels1_xaxis_reversed = .true. + +!Profile_Panels1_show_grid = .true. +Profile_Panels1_show_mix_regions_on_xaxis = .true. + +!------------------------------------------------------------------------------------ + + +!TRho_Profile_win_flag = .true. +TRho_Profile_win_width = 8 +TRho_Profile_win_aspect_ratio = 0.75 ! aspect_ratio = height/width + +! file output +!TRho_Profile_file_flag = .true. +TRho_Profile_file_dir = 'TRho' +TRho_Profile_file_prefix = 'trho_' +TRho_Profile_file_interval = 10 ! output when `mod(model_number,TRho_Profile_file_interval)==0` +TRho_Profile_file_width = -1 ! (inches) negative means use same value as for window +TRho_Profile_file_aspect_ratio = -1 ! negative means use same value as for window + +TRho_Profile_xleft = 0.15 +TRho_Profile_xright = 0.85 +TRho_Profile_ybot = 0.15 +TRho_Profile_ytop = 0.85 +TRho_Profile_txt_scale = 0.7 +TRho_Profile_title = ' ' + +TRho_switch_to_Column_Depth = .false. +TRho_switch_to_mass = .false. + +show_TRho_Profile_legend = .false. + TRho_Profile_legend_coord = 0.07 + TRho_Profile_legend_fjust = 0.0 + TRho_Profile_legend_disp1 = -2.0 + TRho_Profile_legend_del_disp = -1.3 + TRho_Profile_legend_txt_scale = 1.1 + + +show_TRho_Profile_text_info = .false. + TRho_Profile_text_info_xfac = 0.77 ! controls x location + TRho_Profile_text_info_dxfac = 0.02 ! controls x spacing to value from text + TRho_Profile_text_info_yfac = 0.6 ! controls y location of 1st line + TRho_Profile_text_info_dyfac = -0.04 ! controls line spacing + +show_TRho_Profile_mass_locs = .false. +show_TRho_accretion_mesh_borders = .false. +show_TRho_Profile_kap_regions = .false. +show_TRho_Profile_gamma1_4_3rd = .true. +show_TRho_Profile_eos_regions = .false. +show_TRho_Profile_degeneracy_line = .true. +show_TRho_Profile_Pgas_Prad_line = .true. +show_TRho_Profile_burn_lines = .true. +show_TRho_Profile_burn_labels = .true. + +! axis limits +TRho_Profile_xmin = -20.0 +TRho_Profile_xmax = 0!5d0!10.0 +TRho_Profile_ymin = 2.5 +TRho_Profile_ymax = 7.5!8.5d0!10.0 + +! these are shown if show_TRho_Profile_mass_locs = .true. +! set all the entries +profile_mass_point_q = -1 +profile_mass_point_color_index = 1 +profile_mass_point_symbol = -6 +profile_mass_point_symbol_scale = 1.7 +profile_mass_point_str = '' +profile_mass_point_str_clr = 1 +profile_mass_point_str_scale = 1.0 + +! set defaults +num_profile_mass_points = 3 ! max is defined in star_def (max_num_profile_mass_points) + +profile_mass_point_q(1) = 0.5 +profile_mass_point_color_index(1) = 1 +profile_mass_point_symbol(1) = -6 +profile_mass_point_str(1) = ' 0.5 M\d\(0844)\u' +profile_mass_point_str_clr(1) = 1 + +profile_mass_point_q(2) = 0.95 +profile_mass_point_color_index(2) = 1 +profile_mass_point_symbol(2) = -6 +profile_mass_point_str(2) = ' 0.95 M\d\(0844)\u' +profile_mass_point_str_clr(3) = 1 + +profile_mass_point_q(3) = 0.999 +profile_mass_point_color_index(3) = 1 +profile_mass_point_symbol(3) = -6 +profile_mass_point_str(3) = ' 0.999 M\d\(0844)\u' +profile_mass_point_str_clr(3) = 1 + +!------------------------------------------------------------------------------------ + + +! Text_Summary windows + +Text_Summary1_win_flag = .false. +Text_Summary1_win_width = 10 +Text_Summary1_win_aspect_ratio = 0.15 + +Text_Summary1_xleft = 0.01 +Text_Summary1_xright = 0.99 +Text_Summary1_ybot = 0.0 +Text_Summary1_ytop = 1.0 +Text_Summary1_txt_scale = 0.95 +Text_Summary1_title = '' + +Text_Summary1_num_rows = 6 ! <= 20 +Text_Summary1_num_cols = 5 ! <= 20 +Text_Summary1_name(:,:) = '' + + +Text_Summary1_name(1,1) = 'model_number' +Text_Summary1_name(1,2) = 'log_dt' +Text_Summary1_name(1,3) = 'Mass' +Text_Summary1_name(1,4) = 'H_cntr' +Text_Summary1_name(1,5) = 'H_rich' + +Text_Summary1_name(2,1) = 'non_fe_core_infall' +Text_Summary1_name(2,2) = 'star_age' +Text_Summary1_name(2,3) = 'lg_Mdot' +Text_Summary1_name(2,4) = 'He_cntr' +Text_Summary1_name(2,5) = 'He_core' + +Text_Summary1_name(3,1) = 'growth' +Text_Summary1_name(3,2) = 'gamma1_min' +Text_Summary1_name(3,3) = 'eta_cntr' +Text_Summary1_name(3,4) = 'C_cntr' +Text_Summary1_name(3,5) = 'CO_core' + +Text_Summary1_name(4,1) = 'period'!'log_max_T' +Text_Summary1_name(4,2) = 'log_LH' +Text_Summary1_name(4,3) = 'lg_Lnuc_tot' +Text_Summary1_name(4,4) = 'O_cntr' +Text_Summary1_name(4,5) = 'radius' + +Text_Summary1_name(5,1) = 'num_periods' +Text_Summary1_name(5,2) = 'log_LHe' +Text_Summary1_name(5,3) = 'lg_Lneu' +Text_Summary1_name(5,4) = 'Ne_cntr' +Text_Summary1_name(5,5) = 'zones' + +Text_Summary1_name(6,1) = 'log_cntr_Rho' +Text_Summary1_name(6,2) = 'log_LZ' +Text_Summary1_name(6,3) = 'lg_Lphoto' +Text_Summary1_name(6,4) = 'retries' +Text_Summary1_name(6,5) = 'log_cntr_T' + + +!------------------------------------------------------------------------------------ + +! Abundance profile plot + +Abundance_win_flag = .false. + +! window properties +Abundance_win_width = 10 +Abundance_win_aspect_ratio = 0.75 + +Abundance_xleft = 0.15 +Abundance_xright = 0.85 +Abundance_ybot = 0.15 +Abundance_ytop = 0.85 +Abundance_txt_scale = 1.1 +Abundance_title = '' + +! isotopes to plot + +Abundance_num_isos_to_show = 20 + +Abundance_which_isos_to_show(1) = 'h1' +Abundance_which_isos_to_show(2) = 'he3' +Abundance_which_isos_to_show(3) = 'he4' +Abundance_which_isos_to_show(4) = 'c12' +Abundance_which_isos_to_show(5) = 'n14' +Abundance_which_isos_to_show(6) = 'o16' +Abundance_which_isos_to_show(7) = 'ne20' +Abundance_which_isos_to_show(8) = 'mg24' +Abundance_which_isos_to_show(9) = 'si28' +Abundance_which_isos_to_show(10) = 's32' +Abundance_which_isos_to_show(11) = 'ar36' +Abundance_which_isos_to_show(12) = 'ca40' +Abundance_which_isos_to_show(13) = 'ti44' +Abundance_which_isos_to_show(14) = 'cr48' +Abundance_which_isos_to_show(15) = 'cr56' +Abundance_which_isos_to_show(16) = 'fe52' +Abundance_which_isos_to_show(17) = 'fe54' +Abundance_which_isos_to_show(18) = 'fe56' +Abundance_which_isos_to_show(19) = 'ni56' +Abundance_which_isos_to_show(20) = 'neut' +!Abundance_which_isos_to_show(22) = 'ne22' + + + +! number and size of isotope labels along curves +num_abundance_line_labels = 4 +Abundance_line_txt_scale_factor = 1.1 + + +! number and size of isotopes on legend +Abundance_legend_max_cnt = 10 +Abundance_legend_txt_scale_factor = 1.3 + +! yaxis limits +Abundance_log_mass_frac_min = -4!-6.4 ! -3.5 +Abundance_log_mass_frac_max = 0.3 + +! file output +Abundance_file_flag = .false. +Abundance_file_dir = 'Abundance' +Abundance_file_prefix = 'abund_' +Abundance_file_width = -1 ! (inches) negative means use same value as for window +Abundance_file_aspect_ratio = -1 ! negative means use same value as for window + + +!------------------------------------------------------------------------------------ + +! power plot + +Power_win_flag = .false. +Power_win_width = 10 +Power_win_aspect_ratio = 0.75 +Power_title = '' + +Power_xleft = 0.15 +Power_xright = 0.85 +Power_ybot = 0.15 +Power_ytop = 0.85 +Power_txt_scale = 1.1 +Power_title = ' ' + +Power_legend_max_cnt = 10 +Power_legend_txt_scale_factor = 1.3 ! relative to other text + +! power yaxis limits -- to override system default selections +Power_ymin = -5.0 ! -101d0 ! only used if /= -101d0 +Power_ymax = 25.0 ! -101d0 ! only used if /= -101d0 + +! file output +Power_file_flag = .false. +Power_file_dir = 'png' +Power_file_prefix = 'power_' +Power_file_interval = 5 ! output when mod(model_number,Power_file_interval)==0 +Power_file_width = -1 ! (inches) negative means use same value as for window +Power_file_aspect_ratio = -1 ! negative means use same value as for window + + +!------------------------------------------------------------------------------------ + +! mixing plot + +Mixing_xmin = 0.0 +Mixing_xmax = 1.6 ! -101d0 +Mixing_legend_txt_scale_factor = 1.4 ! relative to other text + +Mixing_show_rotation_details = .false. + +!Mixing_win_flag = .true. +!Mixing_file_flag = .true. +Mixing_file_dir = 'png' +Mixing_file_prefix = 'mixing_' +Mixing_file_interval = 1 ! output when `mod(model_number,Mixing_file_interval)==0` +Mixing_file_width = -1 ! (inches) negative means use same value as for window +Mixing_file_aspect_ratio = -1 ! negative means use same value as for window + + +!----------------------------------------------------------------------- + +! TRho window + ! history of central temperature vs. density + + TRho_txt_scale = 0.7 + TRho_title = '' + + TRho_logT_min = -101d0 + TRho_logT_max = -101d0 + TRho_logRho_min = -101d0 + TRho_logRho_max = -101d0 + show_TRho_degeneracy_line = .true. + + + +!----------------------------------------------------------------------- + + !# HR window + ! history of `lg_L` vs. `lg_Teff` + + HR_win_flag = .true. + + HR_win_width = 12 + HR_win_aspect_ratio = 0.75 ! aspect_ratio = height/width + + HR_xleft = 0.15 + HR_xright = 0.85 + HR_ybot = 0.15 + HR_ytop = 0.85 + HR_txt_scale = 0.7 !1.0 + HR_title = '' + + ! axis limits -- to override system default selections + ! HR_logT_min = -101d0 ! only used if /= -101d0 + ! HR_logT_max = -101d0 ! only used if /= -101d0 + ! HR_logL_min = -101d0 ! only used if /= -101d0 + ! HR_logL_max = -101d0 ! only used if /= -101d0 + + + + History_Panels1_xaxis_name = 'yr_since_coll' + + + ! axis limits -- to override system default selections + HR_logT_min = -101d0!3.3 !-101d0 ! only used if /= -101d0 + HR_logT_max = -101d0!3.9!-101d0 ! only used if /= -101d0 + HR_logL_min = -101d0!4.4!-101d0 ! only used if /= -101d0 + HR_logL_max = -101d0!5.5!-101d0 ! only used if /= -101d0 + + ! axis limits -- to override system default selections + HR_logT_min = -101d0 ! only used if /= -101d0 + HR_logT_max = -101d0 ! only used if /= -101d0 + HR_logL_min = -101d0 ! only used if /= -101d0 + HR_logL_max = -101d0 ! only used if /= -101d0 + + HR_logL_margin = 0.1 + HR_logT_margin = 0.1 + HR_dlogT_min = -1 + HR_dlogL_min = -1 + + HR_step_min = -1 ! only plot models with model number >= this + HR_step_max = -1 ! only plot models with model number <= this + + show_HR_classical_instability_strip = .true. + show_HR_Mira_instability_region = .false. + show_HR_WD_instabilities = .false. + + show_HR_target_box = .false. + HR_target_n_sigma = -3 ! -n means show sig 1..n + HR_target_logL = 0 + HR_target_logL_sigma = 0 + HR_target_logT = 0 + HR_target_logT_sigma = 0 + + show_HR_annotation1 = .false. + show_HR_annotation2 = .false. + show_HR_annotation3 = .false. + + HR_fname = '' ! file name for extra HR data + + ! Enables calling a subroutine to add extra information to a plot + ! see `$MESA_DIR/star/other/pgstar_decorator.f90` + HR_use_decorator = .false. + + + ! file output + HR_file_flag = .true. + HR_file_dir = 'hr_png' + HR_file_prefix = 'hr_' + HR_file_interval = 10 ! output when `mod(model_number,HR_file_interval)==0` + HR_file_width = 27 ! (inches) negative means use same value as for window + HR_file_aspect_ratio = -1 ! negative means use same value as for window + +!----------------------------------------------------------------------- + + History_Panels1_title = '' + + History_Panels1_xaxis_name = 'day'!'model_number' + History_Panels1_max_width = 200! 10000 + + !History_Panels1_xaxis_name = 'star_age' + !History_Panels1_max_width = 10 + + History_Panels1_txt_scale = 0.75 + History_Panels1_xmin = -101d0!1300!200!500 + History_Panels1_xmax = -101d0 + History_Panels1_dxmin = -1 + History_Panels1_xaxis_reversed = .false. + History_Panels1_xaxis_log = .false. + History_Panels1_xmargin = 0.0 + + ! :: + + History_Panels1_num_panels = 4 + + ! :: + + History_Panels1_yaxis_name(1) = 'log_L' + History_Panels1_yaxis_reversed(1) = .false. + History_Panels1_ymin(1) = -101d0 + History_Panels1_ymax(1) = -101d0 + History_Panels1_dymin(1) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(1) = 'log_Teff' + History_Panels1_other_yaxis_reversed(1) = .false. + History_Panels1_other_ymin(1) = -101d0 + History_Panels1_other_ymax(1) = -101d0 + History_Panels1_other_dymin(1) = 0.14 + + ! :: + + History_Panels1_yaxis_name(2) = 'growth'!'lum_div_Ledd' + History_Panels1_yaxis_reversed(2) = .false. + History_Panels1_ymin(2) = -101d0 + History_Panels1_ymax(2) = -101d0 + !History_Panels1_dymin(2) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(2) = 'luminosity'!'log_max_T' ! 'v_surf_km_s' + History_Panels1_other_yaxis_reversed(2) = .false. + History_Panels1_other_ymin(2) = -101d0 + History_Panels1_other_ymax(2) = -101d0 + History_Panels1_other_dymin(2) = 0.14 + + ! :: + + History_Panels1_yaxis_name(3) = 'radius' + History_Panels1_yaxis_reversed(3) = .false. + History_Panels1_ymin(3) = -101d0 + History_Panels1_ymax(3) = -101d0 + History_Panels1_dymin(3) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(3) = 'v_surf_km_s'!'log_cntr_Rho' + History_Panels1_other_yaxis_reversed(3) = .false. + History_Panels1_other_ymin(3) = -101d0 + History_Panels1_other_ymax(3) = -101d0 + History_Panels1_other_dymin(3) = 0.14 + ! :: + + History_Panels1_yaxis_name(4) = 'log_dt' + History_Panels1_yaxis_reversed(4) = .false. + History_Panels1_ymin(4) = -101d0 + History_Panels1_ymax(4) = -101d0 + History_Panels1_dymin(4) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(4) = 'time_step_sec' + History_Panels1_other_yaxis_reversed(4) = .false. + History_Panels1_other_ymin(4) = -101d0 + History_Panels1_other_ymax(4) = -101d0 + History_Panels1_other_dymin(4) = 0.14 + + +!----------------------------------------------------------------------- + +! some global grid plot settings + +pgstar_grid_show_title = .true. +pgstar_grid_title_scale = 1.0 +pgstar_grid_title_lw = 3 +pgstar_grid_title_disp = 2.5 ! 1.8 +pgstar_grid_title_coord = 0.5 +pgstar_grid_title_fjust = 0.5 + +pgstar_age_scale = 0.8 +pgstar_age_disp = 3.0 +pgstar_age_coord = 0.0 +pgstar_age_fjust = 0.0 + +pgstar_xaxis_label_scale = 1.3 +pgstar_left_yaxis_label_scale = 1.3 +pgstar_xaxis_label_disp = 2.2 +pgstar_left_yaxis_label_disp = 3.1 +pgstar_right_yaxis_label_disp = 4.1 + +pgstar_model_scale = 0.8 +pgstar_model_disp = 3.0 +pgstar_model_coord = 1.0 +pgstar_model_fjust = 1.0 + +! white_on_black flags -- true means white foreground color on black background +file_white_on_black_flag = .true. +file_device = 'png' ! options 'png' and 'vcps' for png and postscript respectively + + +!file_white_on_black_flag = .false. +!file_device = 'vcps' ! options 'png' and 'vcps' for png and postscript respectively + + +kipp_win_flag=.false. +kipp_file_flag=.false. +Kipp_mix_interval = 1 +Kipp_show_luminosities = .true. + + + +! history tracks for pulsations + + +! history tracks + History_Track1_file_flag = .true. + History_Track2_file_flag = .true. + + +History_Track1_win_flag = .true. +History_Track1_file_interval = 50 +History_Track1_win_width = 12 +History_Track1_win_aspect_ratio = 0.75 + +History_Track1_xname = 'v_surf_km_s' +History_Track1_yname = 'log_L' +History_Track1_xaxis_label = 'Vsurf' +History_Track1_yaxis_label = 'log L/L\d\(2281)' +History_Track1_reverse_xaxis = .false. + + +!History_Track1_xmin = -50d0 +!History_Track1_xmax = 50d0 +!History_Track1_ymin = 3.50d0 +!History_Track1_ymax = 3.98d0 + + +History_Track2_win_flag = .true. +History_Track2_file_interval = 50 + +History_Track2_win_width = 12 +History_Track2_win_aspect_ratio = 0.75 + +History_Track2_xname = 'radius' !'v_surf_km_s' +History_Track2_yname = 'log_L' +History_Track2_xaxis_label = 'Radius' +History_Track2_yaxis_label = 'log L/L\d\(2281)' +History_Track2_reverse_xaxis = .false. + +!History_Track2_xmin = 72d0 +!History_Track2_xmax = 96d0 +!History_Track2_ymin = 3.50d0 +!History_Track2_ymax = 3.98d0 + +/ ! end of pgstar namelist + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_pulses b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_pulses new file mode 100644 index 000000000..75142cc15 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_pulses @@ -0,0 +1,299 @@ +&kap + use_Type2_opacities = .false. ! if cutting out core. +cubic_interpolation_in_X = .false. +cubic_interpolation_in_Z = .false. +/ + +&eos +/ + +&star_job + + save_model_when_terminate = .true. + save_model_filename = 'final.mod' + !required_termination_code_string = 'Successful test: evolved 100 days past first relax' + + load_saved_model = .true. + load_model_filename = 'he_dep.mod' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_common' + + color_num_files=2 + color_file_names(2)='blackbody_johnson.dat' + color_num_colors(2)=5 + + !change_initial_v_flag = .true. + !new_v_flag = .false. + + change_v_flag = .true. + new_v_flag = .true. + + change_u_flag = .true. + new_u_flag = .false. + + + + relax_to_this_tau_factor = 1d-3!-1 + dlogtau_factor = 0.1d0 + relax_tau_factor = .true. + + + ! if restarting from .mod file, need high initial dt for relaxing. + set_initial_dt = .true. + years_for_initial_dt = -1 + seconds_for_initial_dt = 1d7!-1 + + set_initial_age = .true. + initial_age = 0 + + set_initial_model_number = .true. + initial_model_number = 0 + + ! on first pass. + remove_center_by_temperature = 2d6 ! need an initial flag for this. + +/ !end of star_job namelist + + +&controls + + + ! probably not necessary + !remove_small_D_limit = 1d-16 + !remove_mixing_glitches = .false. !.true. ! If true, then okay to remove gaps and singletons. + mlt_make_surface_no_mixing = .false. + + + + ! controls for analyzing pulsations + x_integer_ctrl(1) = 1000 ! gyre interval to check + + x_logical_ctrl(7) = .true. ! doing pulses + x_integer_ctrl(7) = -1 ! 3 ! which period to check (<= 0 means don't check any) + x_ctrl(7) = 17d0 ! expected period (in days) +! x_ctrl(8) = 1.0 ! min_deltaR_for_periods (Rsun) + x_ctrl(9) = 1d0 !0.5 ! KE_growth_avg_abs_frac_new ! for averaging growth rates across steps. + x_ctrl(10) = 0.3 ! min_period_div_target + + + ! new rsp style meshing, thanks to Bill P. + RSP2_use_mass_interp_face_values = .true. + RSP2_nz = 500 + RSP2_nz_outer = 250 + RSP2_T_anchor = 15d3 + RSP2_dq_1_factor = 2d0 + remesh_for_TDC_pulsations_log_core_zoning = .false. ! .false means do rsp style core + + + ! old star meshing to achieve rsp style models. + okay_to_remesh = .false. + + ! control for excising core upon loading .mod file. + x_logical_ctrl(25) = .false. ! set true to remove core, or use starjob option above. + x_ctrl(14) = 2d6 ! desired core temperature to make cut at + + ! remeshing flag for if we are doing an envelope model or full stellar model. + x_logical_ctrl(23) = .true. ! .true. = envelope model, .false. = full stellar model ! depracated + x_logical_ctrl(24) = .true. ! if true turn off remesh at the following model number + x_ctrl(12) = 200! model number to turn off remesh ( only if if okay_to_remesh = .true.) + + ! timestep + x_ctrl(13) = 100! model number to drop timestep + + ! TDC Pulsation timestepping. + x_ctrl(17) = 2d3 ! dt before pulse, seconds + x_ctrl(18) = 2d3 ! After a pulse begins, limit the timestep to this (in seconds). + +! GYRE set starting velocities, kick! +! kick when true and not restarting. + x_logical_ctrl(5) = .true. ! to turn on gyre kick + x_ctrl(11) = 200! kick model at this model number + + x_ctrl(4) = 0d0 ! fraction_1st_overtone (order 2) + x_ctrl(5) = 0d0 ! fraction_2nd_overtone (order 3) + x_ctrl(6) = 5d0 ! initial vsurf (kms) + + +! turn off burning and mixing, if evolving envelope model + eps_nuc_factor = 0 + non_nuc_neu_factor = 0 + dxdt_nuc_factor = 0 + mix_factor = 0 + + ! turn of wind during Pulsation + use_other_wind = .false. + + ! can optionally use QHSE form of dp/dm or dprad/dm form below. + use_dPrad_dm_form_of_T_gradient_eqn = .false. ! if false use QHSE form. + min_kap_for_dPrad_dm_eqn = 1d-5 + +! timesteps for saturation + + !dt_div_min_dr_div_cs_limit = 2d0 + dt_div_min_dr_div_cs_hard_limit = 100d0! i don't like hard limits ~ EbF + min_abs_u_div_cs_for_dt_div_min_dr_div_cs_limit = 0.8d0 + + ! have used these values to do run to saturation, but may not be necessary ~ Bill P. + dt_div_min_dr_div_cs_limit = 2d0!5d0!10d0 + min_q_for_dt_div_min_dr_div_cs_limit = 0.5d0 + max_q_for_dt_div_min_dr_div_cs_limit = 1d0 + min_k_for_dt_div_min_dr_div_cs_limit = 1 + min_abs_du_div_cs_for_dt_div_min_dr_div_cs_limit = 0.001d0 + + ! artificial viscosity if necessary, v_flag only + use_Pvsc_art_visc = .true. + Pvsc_cq = 4.0d0 + Pvsc_zsh = 0.1d0 + + ! velocity time centering for v_flag only. + steps_before_use_velocity_time_centering = 300 ! no v centering when commented + use_P_d_1_div_rho_form_of_work_when_time_centering_velocity = .true. + + include_P_in_velocity_time_centering = .true. ! set to false for u_flag + P_theta_for_velocity_time_centering = 0.5d0 + + include_L_in_velocity_time_centering = .true. + L_theta_for_velocity_time_centering = 0.5d0 + + set_rho_to_dm_div_dV = .false. ! only applies to v_flag + + + convergence_ignore_equL_residuals = .false. ! include T-gradient eqn in newton + + ! OUTER BC for TDC Pulsations + use_RSP_L_eqn_outer_BC = .true. + RSP2_Lsurf_factor = 0.5d0 + use_zero_Pgas_outer_BC = .true. + + ! for u_flag, can optionally use these. + use_compression_outer_BC = .false. + use_momentum_outer_BC = .false. + + ! Convection model + MLT_option = 'TDC' + mixing_length_alpha = 1.5d0 + alpha_TDC_DAMP = 1d0 + alpha_TDC_DAMPR = 0d0 + alpha_TDC_PtdVdt = 0d0 + alpha_TDC_DAMPM = 0.25d0 + steps_before_use_TDC = 0 + mlt_Pturb_factor = 0d0 + alt_scale_height_flag = .true. ! ignore eggleton + TDC_num_innermost_cells_forced_nonturbulent = 0 !2 + + ! dev feature, modify g -> geff (with hydro corr) + make_mlt_hydrodynamic = .false. + + TDC_use_density_form_for_eddy_viscosity = .false. ! always true for u_flag. + + ! controls for shock capturing, relaxed for pulsations + ! main purpose is to force radiative in shock face + max_abs_du_div_cs_for_convection = 1d0 !1d-1 !0.03d0 + max_v_div_cs_for_convection = 1d2 + max_v_for_convection = 1d4 + + x_logical_ctrl(22) = .true. ! flag for in inlist_pulses + + + ! output + log_directory = 'LOGS_pulsation' + + + + + +! everything below is old and from testing. + + +!max_num_merge_cells = 2 +!max_num_merge_surface_cells = 5 ! necessary for surface + +!min_dq = 1d-7 +!max_center_cell_dq = 1d-1!1d-5!1d-7 +!max_surface_cell_dq = 1d-4 +!mesh_max_allowed_ratio = 2.5d0 !default +!min_surface_cell_dq = 5d-6!2d-6 ! 1d-6 might be safer. any higher and you risk touching the convective shell during a pulsation cycle which will make the surface go haywire. + +!mesh_delta_coeff_factor_smooth_iters = 3!20!50 ! 3 +!T_function1_weight = 40!110 +!P_function_weight = 10!50 ! need custom P function weight for logT < 4.5 +!log_tau_function_weight = 10!100 + +!max_dq = 5d-2 + +!xa_function_species(1) = 'he4' +!xa_function_weight(1) = 0 +!xa_function_param(1) = 1d-2 +!use_other_mesh_functions = .true. + + + +! if split merge amr hydro + ! restore_mesh_on_retry = .true. + ! num_steps_to_hold_mesh_after_retry = 5 +! if hydro use momentum bc? + + use_split_merge_amr = .false. +split_merge_amr_okay_to_split_1 = .false. + merge_amr_ignore_core_cells = .true. + merge_amr_logT_for_ignore_core_cells = 5d0 !1d99 + split_amr_ignore_core_cells = .true. + split_amr_logT_for_ignore_core_cells = 5d0 !1d99 + + mesh_delta_coeff = 1d0!0.8d0 ! RECOMMENDED 0.8d0 + !! this one is turned on in run_star_extras + ! true in pulses use_split_merge_amr = .false. + !split_merge_amr_log_zoning = .true. + split_merge_amr_logtau_zoning = .true. + !split_merge_amr_flipped_hybrid_zoning = .true. + !split_merge_amr_hybrid_zoning = .true. + + split_merge_amr_r_core_cm = 1d8 +split_merge_amr_nz_r_core = 1000!10000 + + + split_merge_amr_nz_baseline = 1000!6000 ! RECOMMENDED 6000 + split_merge_amr_MaxLong = 1.5d0!1.25d0 + split_merge_amr_MaxShort = 1.5d0!2.5d0 + + +! equal_split_density_amr = .false. + +! deprecated? trace_split_merge_amr = .false. + + + split_merge_amr_max_iters = 1000 ! setting this too high will smear pulsations. must restrict? + split_merge_amr_okay_to_split_nz = .false. +split_merge_amr_mesh_delta_coeff = 1.0!0.3 + + merge_amr_ignore_surface_cells = .false. + merge_amr_k_for_ignore_surface_cells = 20!1500!100 + + merge_amr_max_abs_du_div_cs = 0.03d0!0.5d0!5d-1!3d-2!0.03!0.05d0 + merge_amr_du_div_cs_limit_only_for_compression = .true. + split_merge_amr_avoid_repeated_remesh = .true. + merge_amr_inhibit_at_jumps =.false. ! reduce udnersize ratio for large jumps + + + + +report_solver_progress = .true. +report_ierr = .true. ! if true, produce terminal output when have some internal error + +/ ! end of controls namelist + +&pgstar + +Grid1_file_dir = 'png_pulsation' + + + ! axis limits -- to override system default selections + !HR_logT_min = 3.6 !-101d0 ! only used if /= -101d0 + !HR_logT_max = 3.75!-101d0 ! only used if /= -101d0 + !HR_logL_min = 3.85!-101d0 ! only used if /= -101d0 + !HR_logL_max = 3.6!-101d0 ! only used if /= -101d0 + + HR_file_interval = 50 ! output when `mod(model_number,HR_file_interval)==0` + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_pulses_header b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_pulses_header new file mode 100644 index 000000000..1bd50a6d1 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_pulses_header @@ -0,0 +1,56 @@ + +&star_job + + + read_extra_star_job_inlist(2) = .true. + extra_star_job_inlist_name(2) = 'inlist_pulses' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_common' + +/ ! end of star_job namelist + + +&eos + + read_extra_eos_inlist(2) = .true. + extra_eos_inlist_name(2) = 'inlist_pulses' + + read_extra_eos_inlist(1) = .true. + extra_eos_inlist_name(1) = 'inlist_common' + +/ ! end of eos namelist + + +&kap + + read_extra_kap_inlist(2) = .true. + extra_kap_inlist_name(2) = 'inlist_pulses' + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_common' + +/ ! end of kap namelist + + + +&controls + + read_extra_controls_inlist(2) = .true. + extra_controls_inlist_name(2)= 'inlist_pulses' + + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_common' + +/ ! end of controls namelist + + +&pgstar + + read_extra_pgstar_inlist(2) = .true. + extra_pgstar_inlist_name(2)= 'inlist_pulses' + + read_extra_pgstar_inlist(1) = .true. + extra_pgstar_inlist_name(1)= 'inlist_pgstar' + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_to_he_dep b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_to_he_dep new file mode 100644 index 000000000..09ac80edb --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_to_he_dep @@ -0,0 +1,88 @@ + +&star_job + + create_pre_main_sequence_model = .true. + + save_model_when_terminate = .true. + save_model_filename = 'he_dep.mod' + required_termination_code_string = '' + + ! evolve model with hydrodynamics on from pre-ms + change_initial_v_flag = .true. + new_v_flag = .true. + + relax_to_this_tau_factor = 1d-3!-1 + dlogtau_factor = 0.1d0 + relax_tau_factor = .true. + +/ !end of star_job namelist + +&kap + +/ + +&eos + +/ + + +&controls + +! Convection model + mixing_length_alpha = 1.5d0 + +! stop when the center mass fraction of h1 drops below this limit +! xa_central_lower_limit_species(1) = 'he4' +! xa_central_lower_limit(1) = 1d-1 +!max_model_number = 1970 +! see run_star_extras for stopping condition +when_to_stop_rtol = 1d-3 +when_to_stop_atol = 1d-3 + + x_logical_ctrl(22) = .false. ! not in inlist_pulses + x_logical_ctrl(7) = .false. + + ! our wind implementation follows Brott+ 2011 + use_other_wind = .true. + +! wind model section: + cool_wind_full_on_T = 9.99d9 + hot_wind_full_on_T = 1d10 + cool_wind_RGB_scheme = 'Reimers' + cool_wind_AGB_scheme = 'Blocker' + RGB_to_AGB_wind_switch = 1d-4 + Reimers_scaling_factor = 0d0 ! 0.1 + Blocker_scaling_factor = 0d0 ! 0.5 crank up to 1.0 when the mass loss stops and/or timestep crashes + + +! solver controls + convergence_ignore_equL_residuals = .true. ! for pre-ms +! use_gold2_tolerances = .false. ! if you need to get through the he_flash + + + +! output +log_directory = 'LOGS_evolution' + +/ ! end of controls namelist + +&pgstar + +Grid1_file_dir = 'png_evolution' +History_Track1_file_flag = .false. +History_Track2_file_flag = .false. + + pgstar_interval = 10 + + History_Panels1_xaxis_name = 'model_number' + History_Panels1_max_width = -1 + + Profile_Panels3_xaxis_name = 'mass' + Profile_Panels3_xaxis_reversed = .false. + + TRho_Profile_xmin = -12.0 + TRho_Profile_xmax = 7d0!5d0!10.0 + TRho_Profile_ymin = 2.5 + TRho_Profile_ymax = 9d0!8.5d0!10.0 + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_to_he_dep_header b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_to_he_dep_header new file mode 100644 index 000000000..21ebfb933 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/inlist_to_he_dep_header @@ -0,0 +1,55 @@ + +&star_job + + + read_extra_star_job_inlist(2) = .true. + extra_star_job_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_common' + +/ ! end of star_job namelist + + +&eos + + read_extra_eos_inlist(2) = .true. + extra_eos_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_eos_inlist(1) = .true. + extra_eos_inlist_name(1) = 'inlist_common' +/ ! end of eos namelist + + +&kap + + read_extra_kap_inlist(2) = .true. + extra_kap_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_common' + +/ ! end of kap namelist + + + +&controls + + read_extra_controls_inlist(2) = .true. + extra_controls_inlist_name(2)= 'inlist_to_he_dep' + + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_common' + +/ ! end of controls namelist + + +&pgstar + + read_extra_pgstar_inlist(2) = .true. + extra_pgstar_inlist_name(2)= 'inlist_to_he_dep' + + read_extra_pgstar_inlist(1) = .true. + extra_pgstar_inlist_name(1)= 'inlist_pgstar' + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/make/makefile b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/make/makefile new file mode 100644 index 000000000..f2017faed --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/make/makefile @@ -0,0 +1,5 @@ + + +STAR = star + +include $(MESA_DIR)/star/work_standard_makefile diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/mk b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/mk new file mode 100755 index 000000000..aec7a5195 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/mk @@ -0,0 +1,13 @@ +#!/bin/bash + +function check_okay { + if [ $? -ne 0 ] + then + echo + echo "FAILED" + echo + exit 1 + fi +} + +cd make; make; check_okay diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/profile_columns.list b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/profile_columns.list new file mode 100644 index 000000000..f4356f273 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/profile_columns.list @@ -0,0 +1,962 @@ +! profile_columns.list -- determines the contents of star model profiles +! you can use a non-standard version by setting profile_columns_file in your inlist + +! units are cgs unless otherwise noted. + +! reorder the following names as desired to reorder columns. +! comment out the name to omit a column (fewer columns => less IO => faster running). +! remove '!' to restore a column. + +! if you have a situation where you want a non-standard set of columns, +! make a copy of this file, edit as desired, and give the new filename in your inlist +! as profile_columns_file. if you are just adding columns, you can 'include' this file, +! and just list the additions in your file. note: to include the standard default +! version, use include '' -- the 0 length string means include the default file. + +! if you need to have something added to the list of options, let me know.... + +! the first few lines of the profile contain general info about the model. +! for completeness, those items are described at the end of this file. + + +! note: you can include another list by doing +! include 'filename' +! include '' means include the default standard list file + + +! the following lines of the profile contain info for 1 zone per row, surface to center. + +! minimal set of enabled columns: + + zone ! numbers start with 1 at the surface + mass ! m/Msun. mass coordinate of outer boundary of cell. + logR ! log10(radius/Rsun) at outer boundary of zone + logT ! log10(temperature) at center of zone + logRho ! log10(density) at center of zone + logP ! log10(pressure) at center of zone + x_mass_fraction_H + y_mass_fraction_He + z_mass_fraction_metals + + +! everything below this line is deactivated + + +!# Structure + !logM ! log10(m/Msun) + !log_mass + !dm ! cell mass (grams) + !dm_bar ! boundary mass (grams) average of adjacent dm's + logdq ! log10(dq) + !log_dq + dq_ratio ! dq(k-1)/dq(k) + q ! fraction of star mass interior to outer boundary of this zone + log_q ! log10(q) + !xq + + !grav ! gravitational acceleration (cm sec^2) + !log_g ! log10 gravitational acceleration (cm sec^2) + !g_div_r ! grav/radius (sec^2) + !r_div_g ! radius/grav (sec^-2) + !cgrav_factor ! = cgrav(k)/standard_cgrav + vel_km_per_s ! velocity at outer boundary of zone (km/s) -- 0 if no velocity variable + + radius ! radius at outer boundary of zone (in Rsun units) + !radius_cm ! radius at outer boundary of zone (in centimeters) + !radius_km ! radius at outer boundary of zone (in kilometers) + !logR_cm ! log10 radius at outer boundary of zone (in centimeters) + !rmid ! radius at center by mass of zone (in Rsun units) + !r_div_R ! fraction of total radius + + velocity ! velocity at outer boundary of zone (cm/s) -- 0 if no velocity variable + !v_div_r ! velocity divided by radius + !v_times_t_div_r + !rho_times_r3 ! at face + !log_rho_times_r3 ! at face + !scale_height ! in Rsun units + pressure_scale_height ! in Rsun units + + !m_div_r ! gm/cm + !dmbar_m_div_r + !log_dmbar_m_div_r + !mass_grams ! mass coordinate of outer boundary of cell in grams + !mmid ! mass at midpoint of cell (average of mass coords of the cell boundaries) Msun units. + + !m_grav ! total enclosed gravitational mass. Msun units. + !m_grav_div_m_baryonic ! mass_gravitational/mass at cell boundary + !mass_correction_factor ! dm_gravitational/dm (dm is baryonic mass of cell) + + !xm ! mass exterior to point (Msun units) + dq ! mass of zone as a fraction of total star mass + !logxq ! log10(1-q) + !logxm ! log10(xm) + + !xr ! radial distance from point to surface (Rsun) + !xr_cm ! radial distance from point to surface (cm) + !xr_div_R ! radial distance from point to surface in units of star radius + !log_xr ! log10 radial distance from point to surface (Rsun) + !log_xr_cm ! log10 radial distance from point to surface (cm) + !log_xr_div_R ! log10 radial distance from point to surface in units of star radius + + !dr ! r(outer edge) - r(inner edge); radial extent of cell in cm. + !log_dr ! log10 cell width (cm) + !dv ! v(inner edge) - v(outer edge); rate at which delta_r is shrinking (cm/sec). + + dt_dv_div_dr ! dt*dv/dr; need to have this << 1 for every cell + !dr_div_R ! cell width divided by star R + !log_dr_div_R ! log10 cell width divided by star R + !dr_div_rmid ! cell width divided by rmid + !log_dr_div_rmid ! log(dr_div_rmid) + + !dr_div_cs ! cell sound crossing time (sec) + !log_dr_div_cs ! log10 cell sound crossing time (sec) + dr_div_cs_yr ! cell sound crossing time (years) + !log_dr_div_cs_yr ! log10 cell sound crossing time (years) + + !acoustic_radius ! sound time from center to outer cell boundary (sec) + !log_acoustic_radius ! log10(acoustic_radius) (sec) + !acoustic_depth ! sound time from surface to outer cell boundary (sec) + !log_acoustic_depth ! log10(acoustic_depth) (sec) + !acoustic_r_div_R_phot + + !cell_collapse_time ! only set if doing explicit hydro + ! time (seconds) for cell inner edge to catch cell outer edge at current velocities + ! 0 if distance between inner and outer is increasing + !log_cell_collapse_time ! log of cell_collapse_time + + !compression_gradient + + + +!# Thermodynamics + !temperature ! temperature at center of zone + !logT_face ! log10(temperature) at outer boundary of zone + !logT_bb ! log10(black body temperature) at outer boundary of zone + !logT_face_div_logT_bb + + energy ! internal energy (ergs/g) + !logE ! log10(specific internal energy) at center of zone + !rho ! density + !density ! rho + + entropy ! specific entropy divided by (avo*kerg) + !logS ! log10(specific entropy) + !logS_per_baryon ! log10(specific entropy per baryon / kerg) + + !pressure ! total pressure at center of zone (pgas + prad) + !prad ! radiation pressure at center of zone + !pgas ! gas pressure at center of zone (electrons and ions) + logPgas ! log10(pgas) + pgas_div_ptotal ! pgas/pressure + + eta ! electron degeneracy parameter (eta >> 1 for significant degeneracy) + mu ! mean molecular weight per gas particle (ions + free electrons) + + grada ! dlnT_dlnP at constant S + !dE_dRho ! at constant T + !cv ! specific heat at constant volume + !cp ! specific heat at constant total pressure + + !log_CpT + gamma1 ! dlnP_dlnRho at constant S + !gamma3 ! gamma3 - 1 = dlnT_dlnRho at constant S + !gam ! plasma interaction parameter (> 160 or so means starting crystallization) + free_e ! free_e is mean number of free electrons per nucleon + !logfree_e ! log10(free_e), free_e is mean number of free electrons per nucleon + !chiRho ! dlnP_dlnRho at constant T + !chiT ! dlnP_dlnT at constant Rho + + csound ! sound speed + log_csound + !csound_face ! sound speed (was previously called csound_at_face) + !cs_at_cell_bdy ! sound speed at cell boundary (csound is at cell center) + !v_div_cs ! velocity divided by sound speed + v_div_csound ! velocity divided by sound speed + !div_v + + !thermal_time_to_surface ! in seconds + !log_thermal_time_to_surface + !t_rad + !log_t_rad + !log_t_sound + !log_t_thermal + + !eos_phase + !eos_frac_OPAL_SCVH + !eos_frac_HELM + !eos_frac_Skye + !eos_frac_PC + !eos_frac_FreeEOS + !eos_frac_CMS + !eos_frac_ideal + + !pgas_div_p + !prad_div_pgas + !prad_div_pgas_div_L_div_Ledd + !pressure_scale_height_cm + + !eps_grav_composition_term + eps_grav_plus_eps_mdot + + !chiRho_for_partials + !chiT_for_partials + !rel_diff_chiRho_for_partials + !rel_diff_chiT_for_partials + + !latent_ddlnRho + !latent_ddlnT + + !log_P_face + !log_Ptrb + !log_cp_T_div_t_sound + + !QQ + + +!# Mass accretion + eps_grav ! -T*ds/dt (negative for expansion) + !log_abs_eps_grav_dm_div_L + !log_abs_v ! log10(abs(velocity)) (cm/s) + !log_mdot_cs + !log_mdot_v + eps_mdot + !env_eps_grav + !xm_div_delta_m + !log_xm_div_delta_m + + +!# Nuclear energy generation + !signed_log_eps_grav ! sign(eps_grav)*log10(max(1,abs(eps_grav))) + !signed_log_eps_nuc + net_nuclear_energy ! erg/gm/s from nuclear reactions minus all neutrino losses + ! The value plotted is net_nuclear_energy = sign(val)*log10(max(1,abs(val))) + ! where val = net nuclear energy minus all neutrino losses. + net_energy ! net_energy + eps_grav. + ! The value plotted is net_energy = sign(val)*log10(max(1,abs(val))) + ! where val = net nuclear energy plus eps_grav minus all neutrino losses. + eps_nuc_plus_nuc_neu + !eps_nuc_minus_non_nuc_neu + !eps_nuc_start + + eps_nuc ! ergs/g/sec from nuclear reactions (including losses to reaction neutrinos) + !log_abs_eps_nuc + !d_lnepsnuc_dlnd + !d_epsnuc_dlnd + !deps_dlnd_face + ! (was previously called deps_dlnd_at_face) + !d_lnepsnuc_dlnT + !d_epsnuc_dlnT + !deps_dlnT_face + ! (was previously called deps_dlnT_at_face) + !eps_nuc_neu_total ! erg/gm/sec as neutrinos from nuclear reactions + + non_nuc_neu ! non-nuclear-reaction neutrino losses + !nonnucneu_plas ! plasmon neutrinos (for collective reactions like gamma_plasmon => nu_e + nubar_e) + !nonnucneu_brem ! bremsstrahlung (for reactions like e- + (z,a) => e- + (z,a) + nu + nubar) + !nonnucneu_phot ! photon neutrinos (for reactions like e- + gamma => e- + nu_e + nubar_e) + !nonnucneu_pair ! pair production (for reactions like e+ + e- => nu_e + nubar_e) + !nonnucneu_reco ! recombination neutrinos (for reactions like e- (continuum) => e- (bound) + nu_e + nubar_e) + + ! ergs/g/sec for reaction categories + add_reaction_categories ! this adds all the reaction categories + ! NOTE: you can list specific categories by giving their names (from chem_def) + pp + cno + tri_alpha + !c_alpha + !n_alpha + !o_alpha + !ne_alpha + !na_alpha + !mg_alpha + !si_alpha + !s_alpha + !ar_alpha + !ca_alpha + !ti_alpha + !fe_co_ni + !c12_c12 + !c12_o16 + !o16_o16 + !photo + !pnhe4 + !other + + ! adds columns for all of the reactions that are in the current net + ! Note that if using op_split_burn=.true. then zones which have been split will report 0 for thier rates + !add_raw_rates ! raw reaction rates, reactions/second + !add_screened_rates ! screened reaction rates reactions/second + !add_eps_nuc_rates ! Nuclear energy (minus neutrino losses) released erg/s + !add_eps_neu_rates ! Neutrino losses erg/s + + ! individual reactions (as many as desired) + ! use list_net_reactions = .true. in star_job to list all reactions in the current net + ! reactions/second + !raw_rate r_h1_h1_ec_h2 + !raw_rate r_h1_h1_wk_h2 + + !burn_num_iters ! Number of split_burn iterations taken + !burn_avg_epsnuc + !log_burn_avg_epsnuc + +!# Composition + !x_mass_fraction_H + !y_mass_fraction_He + !z_mass_fraction_metals + abar ! average atomic weight (g/mole) + !zbar ! average charge + !z2bar ! average charge^2 + ye ! average charge per baryon = proton fraction + + x ! hydrogen mass fraction + !log_x + y ! helium mass fraction + !log_y + z ! metallicity + !log_z ! metallicity + + add_abundances ! this adds all of the isos that are in the current net + ! NOTE: you can list specific isotopes by giving their names (from chem_def) + !h1 + !he3 + !he4 + !c12 + !n14 + !o16 + + !add_log_abundances ! this adds log10 of all of the isos that are in the current net + ! NOTE: you can list specific isotopes by giving their names (from chem_def) + !log h1 + !log he3 + !log he4 + !log c12 + !log n14 + !log o16 + + ! log concentration of species + ! concentration = number density / number density of electrons + ! Ci = (Xi/Ai) / sum(Zi*Xi/Ai) [see Thoul et al, ApJ 421:828-842, 1994] + !log_concentration h1 + !log_concentration he4 + + + ! typical charge for given species + ! (used by diffusion) + !typical_charge he4 + !typical_charge c12 + !typical_charge fe52 + + ! ionization state for given species + ! (same as typical charge, except that it's unsmoothed) + !ionization he4 + !ionization c12 + !ionization fe52 + + !cno_div_z ! abundance of c12, n14, and o16 as a fraction of total z + + + + +!# Opacity + !opacity ! opacity measured at center of zone + log_opacity ! log10(opacity) + !dkap_dlnrho_face ! partial derivative of opacity wrt. ln rho (at T=const) at outer edge of cell + ! (was previously called dkap_dlnrho_at_face) + !dkap_dlnT_face ! partial derivative of opacity wrt. ln T (at rho=const) at outer edge of cell + ! (was previously called dkap_dlnT_at_face) + !kap_frac_lowT ! fraction of opacity from lowT tables + !kap_frac_highT ! fraction of opacity from highT tables + !kap_frac_Type2 ! fraction of opacity from Type2 tables + !kap_frac_Compton ! fraction of opacity from Compton_Opacity + !kap_frac_op_mono ! fraction of opacity from OP mono + + !log_kap + !log_kap_times_factor + + !log_c_div_tau + !xtau + !xlogtau + !logtau_sub_xlogtau + +!# Luminosity + luminosity ! luminosity at outer boundary of zone (in Lsun units) + !logL ! log10(max(1d-2,L/Lsun)) + !log_Lrad + log_Ledd ! log10(Leddington/Lsun) -- local Ledd, 4 pi clight G m / kap + !log_L_div_Ledd ! log10(max(1d-12,L/Leddington)) + log_Lrad_div_Ledd + !log_Lrad_div_L + !signed_log_power ! sign(L)*log10(max(1,abs(L))) + + !lum_adv + lum_conv + !lum_conv_MLT + lum_div_Ledd + !lum_erg_s + !lum_plus_lum_adv + lum_rad + + !log_L_div_CpTMdot + !log_abs_lum_erg_s + + !L + !Lc + Lc_div_L + !Lr + !Lr_div_L + !Lt + !Lt_div_L + +!# Energetics + !total_energy ! specific total energy of cell (ergs/g). internal+potential+kinetic+rotation. + !cell_specific_IE + !cell_specific_KE + !cell_IE_div_IE_plus_KE + !cell_KE_div_IE_plus_KE + + !cell_ie_div_star_ie + !cell_internal_energy_fraction + !cell_internal_energy_fraction_start + !cell_specific_PE + + !log_cell_ie_div_star_ie + !log_cell_specific_IE + + ergs_eps_grav_plus_eps_mdot + ergs_error + !ergs_error_integral + ergs_mdot + !ergs_rel_error_integral + !dm_eps_grav + + !dE + + !etrb + log_etrb + !extra_grav + log_rel_E_err + + !total_energy_sign + +!# Convection + !mlt_mixing_length ! mixing length for mlt (cm) + mlt_mixing_type ! value returned by mlt + mlt_Pturb + !alpha_mlt + + conv_vel ! convection velocity (cm/sec) + log_conv_vel ! log10 convection velocity (cm/sec) + + !conv_L_div_L + log_conv_L_div_L + !lum_conv_div_lum_rad + !lum_rad_div_L_Edd + !lum_conv_div_lum_Edd + lum_conv_div_L + lum_rad_div_L + !lum_rad_div_L_Edd_sub_fourPrad_div_PchiT ! density increases outward if this is > 0 + ! see Joss, Salpeter, and Ostriker, "Critical Luminosity", ApJ 181:429-438, 1973. + + gradT ! mlt value for required temperature gradient dlnT/dlnP + + gradr ! dlnT/dlnP required for purely radiative transport + !grad_temperature ! smoothed dlnT/dlnP at cell boundary + !grad_density ! smoothed dlnRho/dlnP at cell boundary + + gradL ! gradient for Ledoux criterion for convection + !sch_stable ! 1 if grada > gradr, 0 otherwise + !ledoux_stable ! 1 if gradL > gradr, 0 otherwise + + !grada_sub_gradT + gradT_sub_grada ! gradT-grada at cell boundary + gradT_div_grada ! gradT/grada at cell boundary + + !gradr_sub_gradT + !gradT_sub_gradr ! gradT-gradr at cell boundary + !gradT_div_gradr ! gradT/gradr at cell boundary + + !log_gradT_div_gradr ! log10 gradT/gradr at cell boundary + log_mlt_Gamma ! convective efficiency + conv_vel_div_csound ! convection velocity divided by sound speed + !conv_vel_div_L_vel ! L_vel is velocity needed to carry L by convection; L = 4*pi*r^2*rho*vel**3 + log_mlt_D_mix ! log10 diffusion coefficient for mixing from mlt (cm^2/sec) + + !gradr_div_grada ! gradr/grada_face; > 1 => Schwarzschild unstable for convection + !gradr_sub_grada ! gradr - grada_face; > 0 => Schwarzschild unstable for convection + + !gradL_sub_gradr + !gradP_div_rho + !gradT_excess_effect + !gradT_rel_err + !gradT_sub_a + !grada_face + !grada_sub_gradr + !diff_grads + !log_diff_grads + + !mlt_D + !mlt_Gamma + mlt_Y_face + !mlt_Zeta + !mlt_gradT + !mlt_log_abs_Y + !mlt_vc + !log_mlt_vc + !dvc_dt_TDC_div_g + + !superad_reduction_factor + !conv_vel_div_mlt_vc + + !log_Lconv + !log_Lconv_div_L + +!# Mixing + mixing_type ! mixing types are defined in mesa/const/public/const_def + log_D_mix ! log10 diffusion coefficient for mixing in units of cm^2/second (Eulerian) + !log_D_mix_non_rotation + !log_D_mix_rotation + + log_D_conv ! D_mix for regions where mix_type = convective_mixing + !log_D_leftover ! D_mix for regions where mix_type = leftover_convective_mixing + log_D_semi ! D_mix for regions where mix_type = semiconvective_mixing + log_D_ovr ! D_mix for regions where mix_type = overshoot_mixing + log_D_thrm ! D_mix for regions where mix_type = thermohaline_mixing + !log_D_minimum ! D_mix for regions where mix_type = minimum_mixing + !log_D_rayleigh_taylor ! D_mix for regions where mix_type = rayleigh_taylor_mixing + !log_D_anon ! D_mix for regions where mix_type = anonymous_mixing + !log_D_omega + + !log_sig_mix ! sig(k) is mixing flow across face k in (gm sec^1) + ! sig(k) = D_mix*(4*pi*r(k)**2*rho_face)**2/dmavg + + !dominant_isoA_for_thermohaline + !dominant_isoZ_for_thermohaline + !gradL_composition_term + + !mix_type + + + +!# Optical Depth + tau ! optical depth + !log_column_depth ! log10 column depth, exterior mass / area (g cm^-2) + !log_radial_depth ! log10 radial distance to surface (cm) + !logtau ! log10(optical depth) at cell face + !tau_eff ! tau that gives the local P == P_atm if this location at surface + ! tau_eff = kap*(P/g - Pextra_factor*(L/M)/(6*pi*clight*cgrav)) + !tau_eff_div_tau + + + +!# Rotation + omega ! angular velocity = j_rot/i_rot + !log_omega + log_j_rot + !log_J_div_M53 ! J is j*1e-15 integrated from center; M53 is m^(5/3) + log_J_inside ! J_inside is j_rot integrated from center + !shear ! -dlnomega/dlnR + !log_abs_shear ! log10(abs(dlnomega/dlnR)) + !richardson_number + i_rot ! specific moment of inertia at cell boundary + !j_rot ! specific angular momentum at cell boundary + !v_rot ! rotation velocity at cell boundary (km/sec) + !w_div_w_crit_roche !ratio of rotational velocity to keplerian at the equator + !without the contribution from the Eddington factor + fp_rot ! rotation factor for pressure + ft_rot ! rotation factor for temperature + !ft_rot_div_fp_rot ! gradr factor + + !log_am_nu_non_rot ! log10(am_nu_non_rot) + !log_am_nu_rot ! log10(am_nu_rot) + log_am_nu ! log10(am_nu_non_rot + am_nu_rot) + + !r_polar ! (Rsun) + !log_r_polar ! log10 (Rsun) + !r_equatorial ! (Rsun) + !log_r_equatorial ! log10 (Rsun) + !r_e_div_r_p ! equatorial/r_polar + !omega_crit ! breakup angular velocity = sqrt(G M / equatorial^3) + !omega_div_omega_crit + + !am_log_nu_omega ! for diffusion of omega + !am_log_nu_j ! for diffusion of angular momentum + + !am_log_nu_rot ! diffusion of angular momentum driven by rotation + !am_log_nu_non_rot ! diffusion driven by other sources, e.g. convection + + !am_log_sig_omega ! for diffusion of omega + !am_log_sig_j ! for diffusion of angular momentum + !am_log_sig ! == am_log_sig_omega + + !am_log_D_visc ! diffusion coeff for kinematic viscosity + !am_log_D_DSI ! diffusion coeff for dynamical shear instability + !am_log_D_SH ! diffusion coeff for Solberg-Hoiland instability + !am_log_D_SSI ! diffusion coeff for secular shear instability + !am_log_D_ES ! diffusion coeff for Eddington-Sweet circulation + !am_log_D_GSF ! diffusion coeff for Goldreich-Schubert-Fricke instability + !am_log_D_ST ! Spruit dynamo mixing diffusivity + !am_log_nu_ST ! Spruit dynamo effective viscosity + + !dynamo_log_B_r ! (Gauss) + !dynamo_log_B_phi ! (Gauss) + + !am_domega_dlnR + !log_abs_dlnR_domega + + !w_div_w_crit_roche2 + + +!# Diffusion + ! electric field from element diffusion calculation + !e_field + !log_e_field + + ! gravitational field from element diffusion calculation + !g_field_element_diffusion + !log_g_field_element_diffusion + + !eE_div_mg_element_diffusion + !log_eE_div_mg_element_diffusion + + ! element diffusion velocity for species + !edv h1 + !edv he4 + !edv o16 + + ! Energy generated by Ne22 sedimentation. + !eps_WD_sedimentation + !log_eps_WD_sedimentation + + !eps_diffusion + !log_eps_diffusion + + !diffusion_D h1 ! self diffusion coeff + !diffusion_dX h1 ! change in h1 mass fraction from diffusion + !diffusion_dX he4 ! change in he4 mass fraction from diffusion + !diffusion_dX n20 ! change in n20 mass fraction from diffusion + + !v_rad h1 ! velocity from radiative levitation + !v_rad he4 ! velocity from radiative levitation + !v_rad ne20 ! velocity from radiative levitation + + !log_g_rad h1 ! log10 acceleration from radiative levitation + !log_g_rad he4 ! log10 acceleration from radiative levitation + !log_g_rad ne20 ! log10 acceleration from radiative levitation + +!# Phase Separation + !eps_phase_separation + +!# Oscillations + brunt_N2 ! brunt-vaisala frequency squared + brunt_N2_structure_term + brunt_N2_composition_term + !log_brunt_N2_structure_term + !log_brunt_N2_composition_term + !brunt_A ! = N^2*r/g + !brunt_A_div_x2 ! x = r(k)/r(1) + !brunt_N2_dimensionless ! N2 in units of 3GM/R^3 + !brunt_N_dimensionless ! N in units of sqrt(3GM/R^3) + !brunt_frequency ! cycles per day + !brunt_N ! sqrt(abs(brunt_N2)) + !log_brunt_N ! log10(brunt_N) + !log_brunt_N2 ! log10(brunt_N2) + !log_brunt_N2_dimensionless ! log10(brunt_N2_dimensionless) + + !brunt_B ! smoothed numerical difference + !brunt_nonB ! = grada - gradT + !log_brunt_B ! smoothed numerical difference + !log_brunt_nonB ! = grada - gradT + + !sign_brunt_N2 ! sign of brunt_N2 (+1 for Ledoux stable; -1 for Ledoux unstable) + !brunt_nu ! brunt_frequency in microHz + !log_brunt_nu ! brunt_frequency in microHz + + !lamb_S ! lamb frequency for l=1: S = sqrt(2)*csound/r (rad/s) + !lamb_S2 ! squared lamb frequency for l=1: S2 = 2*(csound/r)^2 (rad^2/s^2) + + !lamb_Sl1 ! lamb frequency for l=1; = sqrt(2)*csound/r (microHz) + !lamb_Sl2 ! lamb frequency for l=2; = sqrt(6)*csound/r (microHz) + !lamb_Sl3 ! lamb frequency for l=3; = sqrt(12)*csound/r (microHz) + !lamb_Sl10 ! lamb frequency for l=10; = sqrt(110)*csound/r (microHz) + + !log_lamb_Sl1 ! log10(lamb_Sl1) + !log_lamb_Sl2 ! log10(lamb_Sl2) + !log_lamb_Sl3 ! log10(lamb_Sl3) + !log_lamb_Sl10 ! log10(lamb_Sl10) + + !brunt_N_div_r_integral ! integral from center of N*dr/r + !k_r_integral ! integral from center of k_r*dr + !brunt_N2_sub_omega2 + !sl2_sub_omega2 + + +!# RSP + + !rsp_Chi ! dlnP_dlnRho + !rsp_Et ! Specific turbulent energy + !rsp_logEt ! Log specific turbulent energy + !rsp_erad ! Specific internal (radiative) energy + !rsp_log_erad ! Log specific internal (radiative) energy + !rsp_Hp_face ! Pressure scale height at cell face + !rsp_Lc ! Convective luminosity + !rsp_Lc_div_L ! Convective luminosity div total luminosity + !rsp_Lr ! Radiative luminosity + !rsp_Lr_div_L ! Radiative luminosity div total luminosity + !rsp_Lt ! Turbulent luminosity + !rsp_Lt_div_L ! Turbulent luminosity div total luminosity + !rsp_Pt ! Turbulent pressure, p_t, see Table 1 in MESA5 + !rsp_Uq ! Viscous momentum transfer rate, U_q, see Table 1 in MESA5 + !rsp_Eq ! Viscous energy transfer rate, epsilon_q, see Table 1 in MESA5 + !rsp_Pvsc ! Artificial viscosity, p_av, see Table 1 in MESA5 + !rsp_gradT ! Temperature gradient + !rsp_Y_face ! Superadiabatic gradient at cell face, Y_sag, see Table 1 in MESA5 + !rsp_damp ! Turbulent dissipation, D, see Table 1 in MESA5 + !rsp_dampR ! Radiative cooling, D_r, see Table 1 in MESA5 + !rsp_sink ! Sum of turbulent dissipation and radiative cooling terms + !rsp_src ! Source function, S, see Table 1 in MESA5 + !rsp_src_snk ! Convective coupling, C, see Table 1 in MESA5 + !rsp_heat_exchange_timescale ! 1d0/(clight * opacity * density) + !rsp_log_heat_exchange_timescale + !rsp_log_dt_div_heat_exchange_timescale ! Ratio of time step to heat exchange timescale + !w + !log_w + + !COUPL + !DAMP + !DAMPR + !SOURCE + !Chi + !Eq + !Hp_face + !PII_face + !Ptrb + !Pvsc + !Uq + !Y_face + +!# RTI + + !RTI_du_diffusion_kick + !alpha_RTI + !boost_for_eta_RTI + !dedt_RTI + !dudt_RTI + !eta_RTI + !log_alpha_RTI + !log_boost_for_eta_RTI + !log_eta_RTI + !log_etamid_RTI + !log_lambda_RTI_div_Hrho + !log_sig_RTI + !log_sigmid_RTI + !log_source_RTI + !log_source_minus_alpha_RTI + !log_source_plus_alpha_RTI + !source_minus_alpha_RTI + !source_plus_alpha_RTI + !lambda_RTI + +!# Hydrodynamics + + + !v + !v_div_v_escape + !v_div_vesc + !v_kms + !log_v_escape + + !u + !u_face + + !P_face + + +!# Extras + !extra_heat + !extra_L ! extra_heat integrated from center (Lsun) + !log_extra_L ! log10 integrated from center (Lsun) + !log_irradiation_heat + + !extra_jdot ! set in other_torque routine + !extra_omegadot ! set in other_torque routine + + !extra_opacity_factor ! set in other_opacity_factor routine + + ! diffusion factor profile for species, set in other_diffusion_factor routine + !extra_diffusion_factor h1 + !extra_diffusion_factor he4 + !extra_diffusion_factor o16 + + + +!# Miscellaneous + + !dlog_h1_dlogP ! (log(h1(k)) - log(h1(k-1)))/(log(P(k)) - log(P(k-1))) + !dlog_he3_dlogP + !dlog_he4_dlogP + !dlog_c12_dlogP + !dlog_c13_dlogP + !dlog_n14_dlogP + !dlog_o16_dlogP + !dlog_ne20_dlogP + !dlog_mg24_dlogP + !dlog_si28_dlogP + + !dlog_pp_dlogP + !dlog_cno_dlogP + !dlog_3alf_dlogP + + !dlog_burn_c_dlogP + !dlog_burn_n_dlogP + !dlog_burn_o_dlogP + + !dlog_burn_ne_dlogP + !dlog_burn_na_dlogP + !dlog_burn_mg_dlogP + + !dlog_cc_dlogP + !dlog_co_dlogP + !dlog_oo_dlogP + + !dlog_burn_si_dlogP + !dlog_burn_s_dlogP + !dlog_burn_ar_dlogP + !dlog_burn_ca_dlogP + !dlog_burn_ti_dlogP + !dlog_burn_cr_dlogP + !dlog_burn_fe_dlogP + + !dlog_pnhe4_dlogP + !dlog_photo_dlogP + !dlog_other_dlogP + + !logR_kap ! logR = logRho - 3*logT + 18 ; used in kap tables + !logW ! logW = logPgas - 4*logT + !logQ ! logQ = logRho - 2*logT + 12 + !logV ! logV = logRho - 0.7*logE + 20 + + !log_CpT_absMdot_div_L ! log10(s% Cp(k)*s% T(k)*abs(s% mstar_dot)/s% L(k)) + + !delta_r ! r - r_start, change during step + !delta_L ! L - L_start, change during step + !delta_cell_vol ! cell_vol - cell_vol_start, change during step + !delta_entropy ! entropy - entropy_start, change during step (does not include effects of diffusion) + !delta_T ! T - T_start, change during step + !delta_rho ! rho - rho_start, change during step + !delta_eps_nuc ! eps_nuc - eps_nuc_start, change during step + !delta_mu ! mu - mu_start, change during step + + !zFe ! mass fraction of "Fe" = Fe+Co+Ni + !log_zFe + !dPdr_dRhodr_info + !log_sig_raw_mix + + !d_u_div_rmid + !d_u_div_rmid_start + !d_v_div_r_dm + !d_v_div_r_dr + + !dlnP_dlnR + !dlnRho_dlnR + !dlnRho_dr + !dlnX_dr + !dlnY_dr + !dlogR + !dPdr_div_grav + !dPdr_info + !dRhodr_info + !dRstar_div_dr + !dr_ratio + !dm_eps_grav + !dr_ratio + !dt_cs_div_dr + !dt_div_tau_conv + !dt_times_conv_vel_div_mixing_length + log_dt_cs_div_dr + !log_dt_div_tau_conv + !log_dt_times_conv_vel_div_mixing_length + !log_du_kick_div_du + !du + !dvdt_dPdm + !dvdt_grav + + !tau_conv + !tau_cool + !tau_epsnuc + !tau_qhse + + !max_abs_xa_corr + + !tdc_num_iters + + !k + + +! the first few lines of the profile contain general info about the model. +! for completeness, those items are described here. + + ! initial mass and Z + ! initial_mass + ! initial_z + ! general properties of the current state + ! model_number + ! num_zones + ! star_age + ! time_step + ! properties at the photosphere + ! Teff + ! photosphere_L + ! photosphere_r + ! properties at the outermost zone of the model + ! log_surface_L + ! log_surface_radius + ! log_surface_temp + ! properties near the center of the model + ! log_center_temp + ! log_center_density + ! log_center_P + ! center_eta + ! abundances near the center + ! center_h1 + ! center_he3 + ! center_he4 + ! center_c12 + ! center_n14 + ! center_o16 + ! center_ne20 + ! information about total mass + ! star_mass + ! star_mdot + ! star_mass_h1 + ! star_mass_he3 + ! star_mass_he4 + ! star_mass_c12 + ! star_mass_n14 + ! star_mass_o16 + ! star_mass_ne20 + ! locations of abundance transitions + ! he_core_mass + ! c_core_mass + ! o_core_mass + ! si_core_mass + ! fe_core_mass + ! location of optical depths 10 and 100 + ! tau10_mass + ! tau10_radius + ! tau100_mass + ! tau100_radius + ! time scales + ! dynamic_time + ! kh_timescale + ! nuc_timescale + ! various kinds of total power + ! power_nuc_burn + ! power_h_burn + ! power_he_burn + ! power_neu + ! a few control parameter values + ! h1_boundary_limit + ! he4_boundary_limit + ! c12_boundary_limit + ! burn_min1 + ! burn_min2 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re new file mode 100755 index 000000000..c9ef26f96 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re @@ -0,0 +1,33 @@ +#!/bin/bash + +shopt -u expand_aliases + +photo_directory=photos + +function most_recent_photo { + ls -tp "$photo_directory" | grep -v / | head -1 +} + +if [ $# -eq 0 ] +then + photo=$(most_recent_photo) +else + photo=$1 +fi + +if [ -z "$photo" ] || ! [ -f "$photo_directory/$photo" ] +then + echo "specified photo ($photo) does not exist" + exit 1 +fi + +echo "restart from $photo" +if ! cp "$photo_directory/$photo" restart_photo +then + echo "failed to copy photo ($photo)" + exit 1 +fi + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re_all b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re_all new file mode 100755 index 000000000..7dd54054f --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re_all @@ -0,0 +1,2 @@ +./re_nomodfiles x00002610 inlist_to_he_dep_header +./re_nomodfiles . inlist_pulses_header diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re_mid_pulse b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re_mid_pulse new file mode 100755 index 000000000..64186e0d5 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re_mid_pulse @@ -0,0 +1 @@ +./re_nomodfiles x00073000 inlist_pulses_header diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re_nomodfiles b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re_nomodfiles new file mode 100755 index 000000000..565b74208 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/re_nomodfiles @@ -0,0 +1,41 @@ +#!/bin/bash + +#echo $# +#echo $1 +#echo $2 + +photo_directory=photos + +function most_recent_photo { + ls -t "$photo_directory" | head -1 +} + +if [ "$#" -ne 2 ] +then + echo "must pass two arguments, photo string and inlist name" + exit 1 +fi + +if [ $1 = "." ] +then + photo=$(most_recent_photo) +else + photo=$1 +fi + +if [ -z "$photo" ] || ! [ -f "$photo_directory/$photo" ] +then + echo "specified photo does not exist" + exit 1 +fi + +echo "restart from $photo" +if ! cp "$photo_directory/$photo" restart_photo +then + echo "failed to copy photo" + exit 1 +fi + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star $2 +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn new file mode 100755 index 000000000..417b21378 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn @@ -0,0 +1,25 @@ +#!/bin/bash + +# uncomment the following line to skip the optional inlists +# MESA_SKIP_OPTIONAL=t + +# this provides the definition of do_one (run one part of test) +# do_one [inlist] [output model] [LOGS directory] +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +# check if can skip building starting model +#if [ -n "$MESA_SKIP_OPTIONAL" ]; then +# cp standard_he_dep.mod he_dep.mod +#else + do_one inlist_to_he_dep_header he_dep.mod + cp he_dep.mod standard_he_dep.mod +#fi + +do_one inlist_pulses_header final.mod + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +echo 'finished' + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn1 b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn1 new file mode 100755 index 000000000..25590040a --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn1 @@ -0,0 +1,7 @@ +#!/bin/bash + +rm -f restart_photo + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn_nomodfiles b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn_nomodfiles new file mode 100755 index 000000000..35bd84f4c --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn_nomodfiles @@ -0,0 +1,7 @@ +#!/bin/bash +rm -f restart_photo +echo $1 + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star $1 +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn_pulse b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn_pulse new file mode 100755 index 000000000..14c5878ce --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/rn_pulse @@ -0,0 +1,25 @@ +#!/bin/bash + +# uncomment the following line to skip the optional inlists +# MESA_SKIP_OPTIONAL=t + +# this provides the definition of do_one (run one part of test) +# do_one [inlist] [output model] [LOGS directory] +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +# check if can skip building starting model +#if [ -n "$MESA_SKIP_OPTIONAL" ]; then +# cp standard_he_dep.mod he_dep.mod +#else +# do_one inlist_to_he_dep_header he_dep.mod +# cp he_dep.mod standard_he_dep.mod +#fi + +do_one inlist_pulses_header final.mod + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +echo 'finished' + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/run_all b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/run_all new file mode 100755 index 000000000..3c4429ac3 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/run_all @@ -0,0 +1,2 @@ +./rn_nomodfiles inlist_to_he_dep_header +./re_nomodfiles . inlist_pulses_header diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run.f90 b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run.f90 new file mode 100644 index 000000000..112660f7c --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run.f90 @@ -0,0 +1,15 @@ +program run + use run_star_support, only: do_read_star_job + use run_star, only: do_run_star + + implicit none + + integer :: ierr + + ierr = 0 + call do_read_star_job('inlist', ierr) + if (ierr /= 0) stop 1 + + call do_run_star + +end program diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run_star_extras.f90 b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run_star_extras.f90 new file mode 100644 index 000000000..840974278 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run_star_extras.f90 @@ -0,0 +1,735 @@ +! *********************************************************************** +! +! Copyright (C) 2010-2019 The MESA Team +! +! this file is part of mesa. +! +! mesa is free software; you can redistribute it and/or modify +! it under the terms of the gnu general library public license as published +! by the free software foundation; either version 2 of the license, or +! (at your option) any later version. +! +! mesa is distributed in the hope that it will be useful, +! but without any warranty; without even the implied warranty of +! merchantability or fitness for a particular purpose. see the +! gnu library general public license for more details. +! +! you should have received a copy of the gnu library general public license +! along with this software; if not, write to the free software +! foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa +! +! *********************************************************************** + + module run_star_extras + + use star_lib + use star_def + use const_def + use math_lib + use auto_diff + use chem_def + use utils_lib + use rates_def, only: i_rate + use gyre_mesa_m + + + use interp_1d_def, only: pm_work_size + use interp_1d_lib, only: interp_pm, interp_values, interp_value + + implicit none + + include "test_suite_extras_def.inc" + include 'run_star_extras_TDC_pulsation_defs.inc' + + logical :: dbg = .false. + + !!!!!!!!!!!!!!!!!!!!!!!!! + ! These variables are loaded up from x_ctrl, x_integer_ctrl and x_logical_ctrl + ! values specified on inlist_common, inlist_pulses + !!!!!!!!!!!!!!!!!!!!!!!!! + + + logical :: in_inlist_pulses, remesh_for_envelope_model, turn_off_remesh, remove_core + integer :: kick_model_number, timestep_drop_model_number, turn_off_remesh_model_number + integer :: initial_model_number + real(dp) :: max_dt_before_pulse, max_dt_during_pulse, core_T_for_cut + + contains + + include "test_suite_extras.inc" + include 'run_star_extras_TDC_pulsation.inc' + + + subroutine extras_controls(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + s% extras_startup => extras_startup + s% extras_start_step => extras_start_step + s% extras_check_model => extras_check_model + s% extras_finish_step => extras_finish_step + s% extras_after_evolve => extras_after_evolve + s% how_many_extra_history_columns => how_many_extra_history_columns + s% data_for_extra_history_columns => data_for_extra_history_columns + s% how_many_extra_profile_columns => how_many_extra_profile_columns + s% data_for_extra_profile_columns => data_for_extra_profile_columns + + ! pulsation info + s% other_photo_write => photo_write + s% other_photo_read => photo_read + + s% how_many_other_mesh_fcns => how_many_other_mesh_fcns + s% other_mesh_fcn_data => RSP_mesh + + ! this is optional + s% other_wind => brott_wind + s% other_adjust_mdot => my_adjust_mdot + s% other_before_struct_burn_mix => my_before_struct_burn_mix + s% other_kap_get => my_other_kap_get + + ! store user provided options from the inlist + + in_inlist_pulses = s% x_logical_ctrl(22) + max_dt_before_pulse = s% x_ctrl(17) + max_dt_during_pulse = s% x_ctrl(18) + remesh_for_envelope_model = s% x_logical_ctrl(23) + turn_off_remesh = s% x_logical_ctrl(24) + kick_model_number = s% x_ctrl(11) + timestep_drop_model_number = s% x_ctrl(13) + turn_off_remesh_model_number = s% x_ctrl(12) + remove_core = s% x_logical_ctrl(25) + core_T_for_cut = s% x_ctrl(14) + end subroutine extras_controls + + subroutine brott_wind(id, Lsurf, Msurf, Rsurf, Tsurf, X, Y, Z, w, ierr) + use star_def + integer, intent(in) :: id + real(dp), intent(in) :: Lsurf, Msurf, Rsurf, Tsurf, X, Y, Z ! surface values (cgs) + ! NOTE: surface is outermost cell. not necessarily at photosphere. + ! NOTE: don't assume that vars are set at this point. + ! so if you want values other than those given as args, + ! you should use values from s% xh(:,:) and s% xa(:,:) only. + ! rather than things like s% Teff or s% lnT(:) which have not been set yet. + real(dp), intent(out) :: w ! wind in units of Msun/year (value is >= 0) + integer, intent(out) :: ierr + + integer :: h1, he4 + real(dp) :: Xs, Ys, Z_div_Z_solar, Teff_jump, alfa, L1, M1, R1, T1, & + vink_wind, nieu_wind, hamann_wind + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + L1 = Lsurf + M1 = Msurf + R1 = Rsurf + T1 = Tsurf + + h1 = s% net_iso(ih1) + he4 = s% net_iso(ihe4) + Xs = s% xa(h1,1) + Ys = s% xa(he4,1) + ! Z=0.0142 is Z from Asplund et al. 2009 + Z_div_Z_solar = s% kap_rq% Zbase/0.0142d0 + ! use Vink et al 2001, eqns 14 and 15 to set "jump" temperature + Teff_jump = 1d3*(61.2d0 + 2.59d0*(-13.636d0 + 0.889d0*log10(Z_div_Z_solar))) + + vink_wind = 0d0 + nieu_wind = 0d0 + hamann_wind = 0d0 + w = 0 + + call eval_Vink_wind(vink_wind) + call eval_Nieuwenhuijzen_wind(nieu_wind) + call eval_Hamann_wind(hamann_wind) + + ! use 1/10 hamann + hamann_wind = hamann_wind/10d0 + + if (T1 < Teff_jump) then + ! low T wind + w = max(vink_wind, nieu_wind) + else + ! high T wind + alfa = 0d0 + if (Xs > 0.7d0) then + alfa = 1d0 + else if (Xs > 0.4d0 .and. Xs < 0.7d0) then + alfa = (Xs - 0.4d0)/0.3d0 + end if + w = alfa * vink_wind + (1d0-alfa) * hamann_wind + end if + + ierr = 0 + + contains + + subroutine eval_Vink_wind(w) + real(dp), intent(inout) :: w + real(dp) :: alfa, w1, w2, logMdot, dT, vinf_div_vesc + + ! alfa = 1 for hot side, = 0 for cool side + if (T1 > 27500d0) then + alfa = 1 + else if (T1 < 22500d0) then + alfa = 0 + else + dT = 100d0 + if (T1 > Teff_jump + dT) then + alfa = 1 + else if (T1 < Teff_jump - dT) then + alfa = 0 + else + alfa = (T1 - (Teff_jump - dT)) / (2*dT) + end if + end if + + if (alfa > 0) then ! eval hot side wind (eqn 24) + vinf_div_vesc = 2.6d0 ! this is the hot side galactic value + vinf_div_vesc = vinf_div_vesc*pow(Z_div_Z_solar,0.13d0) ! corrected for Z + logMdot = & + - 6.697d0 & + + 2.194d0*log10(L1/Lsun/1d5) & + - 1.313d0*log10(M1/Msun/30) & + - 1.226d0*log10(vinf_div_vesc/2d0) & + + 0.933d0*log10(T1/4d4) & + - 10.92d0*pow2(log10(T1/4d4)) & + + 0.85d0*log10(Z_div_Z_solar) + w1 = exp10(logMdot) + else + w1 = 0 + end if + + if (alfa < 1) then ! eval cool side wind (eqn 25) + vinf_div_vesc = 1.3d0 ! this is the cool side galactic value + vinf_div_vesc = vinf_div_vesc*pow(Z_div_Z_solar,0.13d0) ! corrected for Z + logMdot = & + - 6.688d0 & + + 2.210d0*log10(L1/Lsun/1d5) & + - 1.339d0*log10(M1/Msun/30) & + - 1.601d0*log10(vinf_div_vesc/2d0) & + + 1.07d0*log10(T1/2d4) & + + 0.85d0*log10(Z_div_Z_solar) + w2 = exp10(logMdot) + else + w2 = 0 + end if + + w = alfa*w1 + (1 - alfa)*w2 + + end subroutine eval_Vink_wind + + subroutine eval_Nieuwenhuijzen_wind(w) + ! Nieuwenhuijzen, H.; de Jager, C. 1990, A&A, 231, 134 (eqn 2) + real(dp), intent(out) :: w + real(dp) :: log10w + include 'formats' + log10w = -14.02d0 & + +1.24d0*log10(L1/Lsun) & + +0.16d0*log10(M1/Msun) & + +0.81d0*log10(R1/Rsun) & + +0.85d0*log10(Z_div_Z_solar) + w = exp10(log10w) + end subroutine eval_Nieuwenhuijzen_wind + + subroutine eval_Hamann_wind(w) + ! Hamann, W.-R.; Koesterke, L.; Wessolowski, U. 1995, A&A, 299, 151 + real(dp), intent(out) :: w + real(dp) :: log10w + include 'formats' + log10w = -11.95d0 & + +1.5d0*log10(L1/Lsun) & + -2.85d0*Xs & + + 0.85d0*log10(Z_div_Z_solar) + w = exp10(log10w) + end subroutine eval_Hamann_wind + + end subroutine brott_wind + + subroutine my_adjust_mdot(id, ierr) + use star_def + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + real(dp) :: Lrad_div_Ledd + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + if (s% generations > 2) then + write(*,*) "check mdots", s% mstar_dot, s% mstar_dot_old + if (abs(s% mstar_dot) > 1.05d0*abs(s% mstar_dot_old)) then + s% mstar_dot = 1.05d0*s% mstar_dot_old + else if (abs(s% mstar_dot) < 0.95d0*abs(s% mstar_dot_old)) then + s% mstar_dot = 0.95d0*s% mstar_dot_old + end if + end if + end subroutine my_adjust_mdot + + + subroutine my_other_kap_get( & + id, k, handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, & + lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + + use kap_def, only: num_kap_fracs + use kap_lib + + ! INPUT + integer, intent(in) :: id ! star id if available; 0 otherwise + integer, intent(in) :: k ! cell number or 0 if not for a particular cell + integer, intent(in) :: handle ! from alloc_kap_handle + integer, intent(in) :: species + integer, pointer :: chem_id(:) ! maps species to chem id + ! index from 1 to species + ! value is between 1 and num_chem_isos + integer, pointer :: net_iso(:) ! maps chem id to species number + ! index from 1 to num_chem_isos (defined in chem_def) + ! value is 0 if the iso is not in the current net + ! else is value between 1 and number of species in current net + real(dp), intent(in) :: xa(:) ! mass fractions + real(dp), intent(in) :: log10_rho ! density + real(dp), intent(in) :: log10_T ! temperature + real(dp), intent(in) :: lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT + ! free_e := total combined number per nucleon of free electrons and positrons + real(dp), intent(in) :: eta, d_eta_dlnRho, d_eta_dlnT + ! eta := electron degeneracy parameter + + ! OUTPUT + real(dp), intent(out) :: kap_fracs(num_kap_fracs) + real(dp), intent(out) :: kap ! opacity + real(dp), intent(out) :: dln_kap_dlnRho ! partial derivative at constant T + real(dp), intent(out) :: dln_kap_dlnT ! partial derivative at constant Rho + real(dp), intent(out) :: dln_kap_dxa(:) ! partial derivative w.r.t. to species + integer, intent(out) :: ierr ! 0 means AOK. + + type (star_info), pointer :: s + real(dp) :: velocity + real(dp) :: radius, logR + real(dp) :: logT_alt, inv_diff + real(dp) :: log_kap, alpha + + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + kap = 0; dln_kap_dlnRho = 0; dln_kap_dlnT = 0; dln_kap_dxa = 0 + velocity = 0 + radius = 0 + + !if (k==1 .and. s% u_flag .and. .not. is_nan(s% lnR_start(1))) then !very surface cell can go mad, things are more stable if we fix opacity + ! if (s% xh_start(s% i_u,1)>sqrt(2*s% cgrav(1)*s% m(1)/exp(s% lnR_start(1)))) then + if (k==1 .and. s% u_flag) then !very surface cell can go mad, things are more stable if we fix opacity + ! this is to support restarts, as xh_start and r_start are + ! not properly set when model loads + if (s% solver_iter > 0) then + velocity = s% xh_start(s% i_u,1) + radius = s% r_start(1) + else + velocity = s% xh(s% i_u,1) + radius = s% r(1) + end if + if (velocity>sqrt(2*s% cgrav(1)*s% m(1)/radius)) then + kap = 0.2d0*(1 + s% X(1)) + dln_kap_dlnRho = 0d0 + dln_kap_dlnT = 0d0 + return + else + call kap_get( & + s% kap_handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + end if + else + call kap_get( & + s% kap_handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + end if + + + end subroutine my_other_kap_get + + subroutine extras_startup(id, restart, ierr) + integer, intent(in) :: id + logical, intent(in) :: restart + integer, intent(out) :: ierr + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call test_suite_startup(s, restart, ierr) + call TDC_pulsation_extras_startup(id, restart, ierr) + + ! interestingly, if you do this instead of remove_center_by_temperature + ! in the starjob section of the inlist, then the tau relaxation happens + ! before the cut. Not sure which is better, but leaving like this for now + if (.not. restart .and. in_inlist_pulses .and. remove_core) then + call star_remove_center_by_temperature(id, core_T_for_cut, ierr) + end if + + ! Initialize GYRE + + call init('gyre.in') + + ! Set constants + + call set_constant('G_GRAVITY', standard_cgrav) + call set_constant('C_LIGHT', clight) + call set_constant('A_RADIATION', crad) + + call set_constant('M_SUN', Msun) + call set_constant('R_SUN', Rsun) + call set_constant('L_SUN', Lsun) + + call set_constant('GYRE_DIR', TRIM(mesa_dir)//'/gyre/gyre') + + !if (.not. restart .and. in_inlist_pulses) then + ! initial_model_number = s% model_number + !end if + initial_model_number = 0 ! since we are setting model # to 0 in inlist_pulses + + + ! for rsp style mesh + if (.not. restart .and. in_inlist_pulses .and. remesh_for_envelope_model) then + call remesh_for_TDC_pulsation(id, ierr) + end if + end subroutine extras_startup + + + subroutine extras_after_evolve(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + real(dp) :: dt + character (len=strlen) :: test + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call test_suite_after_evolve(s, ierr) + + if (.not. s% x_logical_ctrl(37)) return + call final() + end subroutine extras_after_evolve + + + ! returns either keep_going, retry, or terminate. + integer function extras_check_model(id) + integer, intent(in) :: id + integer :: ierr, k + real(dp) :: max_v + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + extras_check_model = keep_going + + + end function extras_check_model + + + integer function how_many_extra_history_columns(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + how_many_extra_history_columns = TDC_pulsation_how_many_extra_history_columns(id) + end function how_many_extra_history_columns + + + subroutine data_for_extra_history_columns(id, n, names, vals, ierr) + integer, intent(in) :: id, n + character (len=maxlen_history_column_name) :: names(n) + real(dp) :: vals(n), v_esc + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k, k0 + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call TDC_pulsation_data_for_extra_history_columns(id, n, names, vals, ierr) + end subroutine data_for_extra_history_columns + + + integer function how_many_extra_profile_columns(id) + use star_def, only: star_info + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + how_many_extra_profile_columns = TDC_pulsation_how_many_extra_profile_columns(id) + + end function how_many_extra_profile_columns + + + subroutine data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + use star_def, only: star_info, maxlen_profile_column_name + use const_def, only: dp + integer, intent(in) :: id, n, nz + character (len=maxlen_profile_column_name) :: names(n) + real(dp) :: vals(nz,n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call TDC_pulsation_data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + + end subroutine data_for_extra_profile_columns + + + integer function extras_start_step(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + include 'formats' + extras_start_step = terminate + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + !this is used to ensure we read the right inlist options + s% use_other_before_struct_burn_mix = .true. + + ! we want to ignore T gradient equation for a few steps after remesh + if (s% model_number < initial_model_number + 10 .and. in_inlist_pulses) then + s% convergence_ignore_equL_residuals = .true. + else if (in_inlist_pulses) then + s% convergence_ignore_equL_residuals = .false. + end if + + if (s% model_number == kick_model_number .and. in_inlist_pulses & + .and. s% x_logical_ctrl(5))then + + ! if v= 0, turn on v so we can kick + if (.not. s% v_flag .or. .not. s% u_flag) then + call star_set_v_flag(id, .true., ierr) + end if + + call gyre_in_mesa_extras_set_velocities(s,.false.,ierr) + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + + end if + + call my_before_struct_burn_mix(s% id, s% dt, extras_start_step) + + ! add stopping condition for testing. + if ((.not. in_inlist_pulses) .and. s% center_he4 < 2d-1) then + s% Teff_lower_limit = exp10(3.75d0) + else + s% Teff_lower_limit = -1d99 + end if + + extras_start_step = keep_going + end function extras_start_step + + subroutine my_before_struct_burn_mix(id, dt, res) + use const_def, only: dp + use star_def + integer, intent(in) :: id + real(dp), intent(in) :: dt + integer, intent(out) :: res ! keep_going, redo, retry, terminate + real(dp) :: power_photo, v_esc + integer :: ierr, k + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + +! !s% use_atm_PT_at_center_of_surface_cell = .false. +! s% use_momentum_outer_BC = .false. ! offset_P_to_center_cell = .true. +! s% use_compression_outer_BC = .false. ! offset_P_to_center_cell = .true. +! s% use_zero_Pgas_outer_BC = .true. +! s% atm_option = 'T_tau' +! s% atm_T_tau_relation = 'Eddington' +! s% atm_T_tau_opacity = 'fixed' +! s% tau_factor = 1d-3 +! s% Pextra_factor = 1d0 +! s% force_tau_factor = 1d-3 +! s% delta_lgL_limit = 0.25d0 +! !s% delta_lgTeff_limit = 1d-2!0.25d0 +! s% delta_lgL_limit_L_min = 1d99!-100 +! s% delta_lgL_limit_L_min = 1d99!-100 +! +! !s% atm_T_tau_errtol = 1d-12 +! !s% atm_T_tau_max_iters = 500 + + if (in_inlist_pulses) then + if (s% model_number > timestep_drop_model_number )then + s% max_timestep = max_dt_during_pulse + else + s% max_timestep = max_dt_before_pulse + end if + + ! time step control on pulsations + if (period > 0d0 .and. period/s% max_timestep < 600 .and. & + s% model_number > timestep_drop_model_number) then + s% max_timestep = period/600d0 + end if + + if (s% model_number > turn_off_remesh_model_number .and. turn_off_remesh )then + s% okay_to_remesh = .false. + ! if ((s% model_number == turn_off_remesh_model_number + 1) & + ! .and. .not. remesh_for_envelope_model )then + ! do k =1,s%nz + ! if (s%lnT(k) >= log(2d6)) then + ! exit + ! end if + ! end do + ! s% mesh_min_k_old_for_split = k + ! end if + ! write (*,*) 's% mesh_min_k_old_for_split', s% mesh_min_k_old_for_split + end if + end if + + ! reading inlists can turn this flag off for some reason + s% use_other_before_struct_burn_mix = .true. + + res = keep_going + end subroutine my_before_struct_burn_mix + + subroutine null_binary_controls(id, binary_id, ierr) + integer, intent(in) :: id, binary_id + integer, intent(out) :: ierr + ierr = 0 + end subroutine null_binary_controls + + ! returns either keep_going or terminate. + integer function extras_finish_step(id) + use run_star_support + use math_lib + integer, intent(in) :: id + integer :: ierr,k + real(dp) :: max_vel_inside, vesc_for_cell, vesc_surf !check_avg_v_div_vesc + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + extras_finish_step = keep_going + extras_finish_step = TDC_pulsation_extras_finish_step(id) + +! if (.not. s% x_logical_ctrl(37)) return +! extras_finish_step = gyre_in_mesa_extras_finish_step(id) + + if (extras_finish_step == terminate) s% termination_code = t_extras_finish_step + + end function extras_finish_step + + + + + ! here is an example that adds a mesh function for log(opacity) + subroutine how_many_other_mesh_fcns(id, n) + integer, intent(in) :: id + integer, intent(out) :: n + n = 1 + end subroutine how_many_other_mesh_fcns + + + subroutine RSP_mesh( & + id, nfcns, names, gval_is_xa_function, vals1, ierr) + use star_def + use math_lib + use const_def + integer, intent(in) :: id + integer, intent(in) :: nfcns + character(len=*) :: names(:) + logical, intent(out) :: gval_is_xa_function(:) ! (nfcns) + real(dp), pointer :: vals1(:) ! =(nz, nfcns) + integer, intent(out) :: ierr + integer :: nz, k + real(dp), pointer :: vals(:, :) + real(dp) :: weight1 = 1d6!1d4 + real(dp) :: weight2 = 8d5!1d4 + real(dp) :: weight3 = 0d0 + real(dp) :: logT_anchor1, logT_anchor2, logT_anchor3, lmid, delta, ell + integer :: k_anchor1, k_anchor2 + + type(star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + names(1) = 'RSP_function' + gval_is_xa_function(1) = .false. + nz = s%nz + vals(1:nz, 1:nfcns) => vals1(1:nz*nfcns) + + logT_anchor1 = log(11d3)!log(11d3) + logT_anchor2 = log(20d3)!log(11d3) + logT_anchor3 = log(30d3) + + lmid = 0.5d0*(logT_anchor2+logT_anchor3) + delta = (logT_anchor3 - logT_anchor2) + + k_anchor1 = 0 + k_anchor2 = 0 + + ! do k = 1, nz + ! if (s% lnT(k) < logT_anchor1) then + ! vals(k, 1) = weight1*(s% m(1) - s% m(k))/Msun + ! k_anchor = k + ! !write (*,*) "k", k ,"dm", vals(k, 1) + ! else if (s% lnT(k) < logT_anchor2 .and. s% lnT(k) >= logT_anchor1) then + ! vals(k, 1) = weight2*(s% m(k_anchor) - s% m(k))/Msun + ! !write (*,*) "k", k ,"dm", vals(k, 1) + ! else + ! vals(k, 1) = weight3*(s% m(1)/Msun - s% m(k)/Msun) + ! end if + ! end do + + + do k = 1, nz + ell = s%lnT(k) + if (s% lnT(k) <= logT_anchor1) then + vals(k,1) = weight1*(s%m(1) - s%m(k))/Msun + k_anchor1 = k + else if (s% lnT(k) <= logT_anchor2 .and. s% lnT(k) >= logT_anchor1) then + vals(k,1) = weight2*(s%m(1) - s%m(k))/Msun + k_anchor2 = k + else if (s% lnT(k) < logT_anchor3) then + ! smooth taper doqn to 0. +! vals(k,1) = vals(k-1,1)/2d0 + vals(k,1) = (0.5d0*weight2*(1d0 - tanh( (ell - lmid)/delta )) & + ) * ( (s%m(k_anchor2) - s%m(k)) / Msun ) + end if + end do + + end subroutine RSP_mesh + + + subroutine photo_write(id, iounit) + integer, intent(in) :: id, iounit + call TDC_pulsation_photo_write(id, iounit) + end subroutine photo_write + + + subroutine photo_read(id, iounit, ierr) + integer, intent(in) :: id, iounit + integer, intent(out) :: ierr + call TDC_pulsation_photo_read(id, iounit, ierr) + end subroutine photo_read + + end module run_star_extras + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run_star_extras_TDC_pulsation.inc b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run_star_extras_TDC_pulsation.inc new file mode 100644 index 000000000..e3254cb2a --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run_star_extras_TDC_pulsation.inc @@ -0,0 +1,383 @@ + + + subroutine TDC_pulsation_photo_write(id, iounit) + integer, intent(in) :: id, iounit + write(iounit) num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev, & + period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag, & + time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max, & + best_period, best_model_number, best_order, best_cycles_to_double + end subroutine TDC_pulsation_photo_write + + + subroutine TDC_pulsation_photo_read(id, iounit, ierr) + integer, intent(in) :: id, iounit + integer, intent(out) :: ierr + ierr = 0 + read(iounit, iostat=ierr) num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev, & + period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag, & + time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max, & + best_period, best_model_number, best_order, best_cycles_to_double + end subroutine TDC_pulsation_photo_read + + + subroutine TDC_pulsation_extras_startup(id, restart, ierr) + integer, intent(in) :: id + logical, intent(in) :: restart + integer, intent(out) :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + if (.not. restart) then + num_periods = 0 + run_num_steps_end_prev = 0 + run_num_iters_end_prev = 0 + run_num_retries_end_prev = 0 + period = 0 + KE_growth = 0 + KE_growth_avg = 0 + prev_KE_max = 0 + delta_R_growth = 0 + delta_R_growth_avg = 0 + prev_delta_R = 0 + period_max_v_div_cs = 0 + period_max_v_div_vesc = 0 + period_delta_R = 0 + period_delta_Teff = 0 + period_delta_logTeff = 0 + period_delta_logL = 0 + period_delta_Mag = 0 + time_started = 0 + v_div_cs_max = 0 + v_div_vesc_max = 0 + KE_min = 0 + KE_max = 0 + R_min = 0 + R_max = 0 + L_min = 0 + L_max = 0 + T_min = 0 + T_max = 0 + best_period = 0 + best_model_number = 0 + best_order = 0 + best_cycles_to_double = 0 + end if + end subroutine TDC_pulsation_extras_startup + + + integer function TDC_pulsation_extras_finish_step(id) + use chem_def + integer, intent(in) :: id + type (star_info), pointer :: s + integer :: ierr, gyre_interval, test_period + real(dp) :: target_period + logical :: doing_pulses + include 'formats' + + TDC_pulsation_extras_finish_step = terminate + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_extras_finish_step = keep_going + + gyre_interval = s% x_integer_ctrl(1) + if (gyre_interval > 0) then + if (MOD(s% model_number, gyre_interval) == 0) & + call get_gyre_info_for_this_step + if (TDC_pulsation_extras_finish_step == terminate) & + s% termination_code = t_extras_finish_step + if (TDC_pulsation_extras_finish_step /= keep_going) return + end if + + doing_pulses = s% x_logical_ctrl(7) + if (.not. doing_pulses) return + target_period = s% x_ctrl(7) + if (target_period <= 0d0) return + if (.not. get_period_info()) return + + test_period = s% x_integer_ctrl(7) + if (num_periods < test_period .or. test_period <= 0) return + + ! have finished test run + call report_test_results + TDC_pulsation_extras_finish_step = terminate + + contains + + subroutine get_gyre_info_for_this_step + integer :: i + TDC_pulsation_extras_finish_step = gyre_in_mesa_extras_finish_step(id) + if (s% ixtra3_array(1) > 0) then ! unpack the GYRE results + do i=1,s% ixtra3_array(1) + if (s% xtra1_array(i) == 0d0 .or. & + (s% ixtra1_array(i) /= s% x_integer_ctrl(4) .and. s% x_integer_ctrl(4) > 0)) cycle + if (s% xtra3_array(i) > 0d0 .and. & + (best_cycles_to_double == 0d0 .or. s% xtra3_array(i) < best_cycles_to_double)) then + !best_growth = s% xtra1_array(i) + best_period = 1d0/s% xtra2_array(i) ! xtra2_array = freq (s^-1) + best_period = best_period/(24*3600) ! change to days + best_cycles_to_double = s% xtra3_array(i) + best_order = s% ixtra1_array(i) + best_model_number = s% model_number + end if + end do + end if + end subroutine get_gyre_info_for_this_step + + logical function get_period_info() + real(dp) :: v_surf, v_surf_start, KE, min_period, time_ended, & + delta_R, min_deltaR_for_periods, growth_avg_frac_new, & + min_period_div_target, cs, vesc + include 'formats' + get_period_info = .false. + + if (s% r(1) < R_min) R_min = s% r(1) + if (s% r(1) > R_max) R_max = s% r(1) + if (s% L(1) < L_min) L_min = s% L(1) + if (s% L(1) > L_max) L_max = s% L(1) + if (s% Teff < T_min) T_min = s% Teff + if (s% Teff > T_max) T_max = s% Teff + KE = s% total_radial_kinetic_energy_end + if (KE > KE_max) KE_max = KE + if (KE < KE_min) KE_min = KE + + if (s% v_flag) then + v_surf = s% v(1) + v_surf_start = s% v_start(1) + else if (s% u_flag) then + v_surf = s% u_face_val(1) + v_surf_start = s% u_face_start(1) + else ! + v_surf = 0d0 + v_surf_start = 0d0 + !stop 'TDC_pulsation_extras_finish_step: both v_flag and u_flag are false' + end if + cs = s% csound(1) + if (v_surf > v_div_cs_max*cs) v_div_cs_max = v_surf/cs + vesc = sqrt(2*s% cgrav(1)*s% m(1)/(s% r(1))) + if (v_surf > v_div_vesc_max*vesc) v_div_vesc_max = v_surf/vesc + + ! period is completed when v_surf goes from positive to negative during step + if (v_surf > 0d0 .or. v_surf_start < 0d0) return + + if (time_started == 0) then ! start of 1st cycle + time_started = s% time + run_num_steps_end_prev = s% model_number + run_num_iters_end_prev = s% total_num_solver_iterations + run_num_retries_end_prev = s% num_retries + prev_KE_max = 0d0 + call init_min_max_info + write(*,*) 'first maximum radius, period calculations starting at model, day', & + s% model_number, s% time/(24*3600) + return + end if + + delta_R = R_max - R_min + min_deltaR_for_periods = s% x_ctrl(8)*Rsun + if (min_deltaR_for_periods > 0d0) then + if (delta_R < min_deltaR_for_periods) return ! filter out glitches + end if + + time_ended = s% time + if (abs(v_surf - v_surf_start) > 1d-10) & ! tweak the end time to match when v_surf == 0 + time_ended = s% time - v_surf*s% dt/(v_surf - v_surf_start) + min_period_div_target = s% x_ctrl(10) + min_period = target_period*(24*3600)*min_period_div_target + if (min_period > 0d0 .and. & + time_ended - time_started < min_period) return ! filter out glitches + + period = time_ended - time_started + num_periods = num_periods + 1 + + if (num_periods > 1) then + growth_avg_frac_new = s% x_ctrl(9) + KE_growth = (KE_max - prev_KE_max)/prev_KE_max + KE_growth_avg = growth_avg_frac_new*KE_growth + & + (1d0 - growth_avg_frac_new)*KE_growth_avg + delta_R_growth = (delta_R - prev_delta_R)/prev_delta_R + delta_R_growth_avg = growth_avg_frac_new*delta_R_growth + & + (1d0 - growth_avg_frac_new)*delta_R_growth_avg + end if + + period_delta_Teff = T_max - T_min + period_delta_logTeff = log10(T_max/T_min) + period_delta_R = R_max - R_min + period_delta_logL = log10(L_max/L_min) + period_delta_Mag = 2.5d0*period_delta_logL + period_max_v_div_cs = v_div_cs_max + period_max_v_div_vesc = v_div_vesc_max + prev_KE_max = KE_max + prev_delta_R = period_delta_R + ! 1 2 3 4 5 6 7 8 9 + write(*,'(i4,a14,i6,a13,f8.3,a13,f9.3,a9,f9.4,a15,f10.4,a13,f9.4,a13,f10.4,a11,f9.4,a13,f9.4)') & + num_periods, & + 'steps/cycle', s% model_number - run_num_steps_end_prev, & ! 1 a14,i6 + 'iters/step', & + dble(s% total_num_solver_iterations - run_num_iters_end_prev)/ & + dble(s% model_number - run_num_steps_end_prev), & ! 2 a13,f8.3 + 'period (d)', period/(24*3600), & ! 3 a13,f9.3 + 'growth', delta_R_growth_avg, & ! 4 a9,f9.4 + 'delta R/Rsun', period_delta_R/Rsun, & ! 5 a15,f10.4 + 'delta logL', period_delta_logL, & ! 6 a13,f9.4 + 'delta Teff', period_delta_Teff, & ! 7 a13,f10.4 + 'max v/cs', period_max_v_div_cs, & ! 8 a11,f9.4 + 'max v/vesc', period_max_v_div_vesc ! 9 a13,f9.4 + + time_started = time_ended + run_num_steps_end_prev = s% model_number + run_num_iters_end_prev = s% total_num_solver_iterations + run_num_retries_end_prev = s% num_retries + call init_min_max_info + get_period_info = .true. + + end function get_period_info + + subroutine init_min_max_info + v_div_cs_max = 0d0 + v_div_vesc_max = 0d0 + KE_min = 1d99 + KE_max = -1d99 + R_min = 1d99 + R_max = -1d99 + L_min = 1d99 + L_max = -1d99 + T_min = 1d99 + T_max = -1d99 + end subroutine init_min_max_info + + subroutine report_test_results + real(dp) :: rel_run_E_err + write(*,*) + write(*,*) + write(*,*) + rel_run_E_err = s% cumulative_energy_error/s% total_energy + write(*,*) 'rel_run_E_err', rel_run_E_err + if (s% total_energy /= 0d0 .and. abs(rel_run_E_err) > 1d-5) then + write(*,*) '*** BAD rel_run_E_error ***', & + s% cumulative_energy_error/s% total_energy + else if (abs(period/(24*3600) - target_period) > 1d-2) then + write(*,*) '*** BAD period ***', period/(24*3600) - target_period, & + period/(24*3600), target_period + else + write(*,*) 'good match for period', & + period/(24*3600), target_period + end if + write(*,*) + write(*,*) + write(*,*) + end subroutine report_test_results + + end function TDC_pulsation_extras_finish_step + + + include 'gyre_in_mesa_extras_finish_step.inc' + + + subroutine TDC_pulsation_extras_after_evolve(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + ierr = 0 + call final() + end subroutine TDC_pulsation_extras_after_evolve + + + integer function TDC_pulsation_how_many_extra_history_columns(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_how_many_extra_history_columns = 11 + end function TDC_pulsation_how_many_extra_history_columns + + + subroutine TDC_pulsation_data_for_extra_history_columns(id, n, names, vals, ierr) + integer, intent(in) :: id, n + character (len=maxlen_history_column_name) :: names(n) + real(dp) :: vals(n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: i + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + i = 1 + names(i) = 'num_periods'; vals(i) = num_periods; i=i+1 + names(i) = 'period'; vals(i) = period/(24*3600); i=i+1 + names(i) = 'growth'; vals(i) = delta_R_growth_avg; i=i+1 + names(i) = 'max_v_div_cs'; vals(i) = period_max_v_div_cs; i=i+1 + names(i) = 'max_v_div_vesc'; vals(i) = period_max_v_div_vesc; i=i+1 + names(i) = 'delta_R'; vals(i) = period_delta_R/Rsun; i=i+1 + names(i) = 'delta_Teff'; vals(i) = period_delta_Teff; i=i+1 + names(i) = 'delta_logTeff'; vals(i) = period_delta_logTeff; i=i+1 + names(i) = 'delta_logL'; vals(i) = period_delta_logL; i=i+1 + names(i) = 'delta_Mag'; vals(i) = period_delta_Mag; i=i+1 + names(i) = 'KE_growth_avg'; vals(i) = KE_growth_avg; i = i+1 + + end subroutine TDC_pulsation_data_for_extra_history_columns + + + integer function TDC_pulsation_how_many_extra_profile_columns(id) + use star_def, only: star_info + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_how_many_extra_profile_columns = 0 ! 6 + end function TDC_pulsation_how_many_extra_profile_columns + + + subroutine TDC_pulsation_data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + use star_def, only: star_info, maxlen_profile_column_name + use const_def, only: dp + integer, intent(in) :: id, n, nz + character (len=maxlen_profile_column_name) :: names(n) + real(dp) :: vals(nz,n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k + ierr = 0 + return + + + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + names(1) = 'xtra1' + names(2) = 'xtra2' + names(3) = 'xtra3' + names(4) = 'xtra4' + names(5) = 'xtra5' + names(6) = 'xtra6' + + do k=1,nz + vals(k,1) = s% xtra1_array(k) + vals(k,2) = s% xtra2_array(k) + vals(k,3) = s% xtra3_array(k) + vals(k,4) = s% xtra4_array(k) + vals(k,5) = s% xtra5_array(k) + vals(k,6) = s% xtra6_array(k) + end do + + end subroutine TDC_pulsation_data_for_extra_profile_columns + + + include 'gyre_in_mesa_extras_set_velocities.inc' + + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run_star_extras_TDC_pulsation_defs.inc b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run_star_extras_TDC_pulsation_defs.inc new file mode 100644 index 000000000..b7b6e47b6 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_15M_u_flag/src/run_star_extras_TDC_pulsation_defs.inc @@ -0,0 +1,16 @@ + + ! GYRE "best" info + real(dp) :: best_period, best_cycles_to_double + integer :: best_model_number, best_order + + ! summary info at time of recently completely period + integer :: num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev + real(dp) :: period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag + ! info for period in progress + real(dp) :: time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/README.rst b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/README.rst new file mode 100644 index 000000000..a25931921 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/README.rst @@ -0,0 +1,21 @@ +.. _ppisn: + +***** +ppisn +***** + +This test case evolves a very massive helium star from the He-ZAMS +up to the ocurrence of a pulsational pair-instability event (see |Marchant2019|). + +.. |Marchant2019| replace:: `Marchant et al. 2019 `__ + +Initialization of the model +=========================== +The initial mass of the helium star is set in ``inlist_extra`` + +.. literalinclude:: ../../../star/test_suite/ppisn/inlist_extra + +In this case we use a :math:`72 M_\odot` + +Last-Updated: 2019-11-12 (mesa r12413) by Pablo Marchant + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/ck b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/ck new file mode 100755 index 000000000..ac08f15c6 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/ck @@ -0,0 +1,7 @@ +#!/bin/bash + +# this provides the definition of check_one +# check_one +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +check_one diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/clean b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/clean new file mode 100755 index 000000000..95545a5c1 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/clean @@ -0,0 +1,4 @@ +#!/bin/bash + +cd make +make clean diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/gyre.in b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/gyre.in new file mode 100644 index 000000000..10381b567 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/gyre.in @@ -0,0 +1,34 @@ +&model + add_center = .FALSE. +/ + +&mode + l = 0 +/ + +&osc + inner_bound = 'ZERO_R' ! for envelopes + nonadiabatic = .TRUE. +/ + +&rot +/ + +&num + diff_scheme = 'MAGNUS_GL2'!'COLLOC_GL2' +/ + +&scan + grid_type = 'LINEAR' + freq_min = 0.5!1d-4 + freq_max = 5.0!10.0 + freq_min_units = 'ACOUSTIC_DELTA' + freq_max_units = 'ACOUSTIC_DELTA' + n_freq = 50 +/ + +&grid + w_osc = 10 + w_exp = 2 + w_ctr = 10 +/ diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/he_dep.mod b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/he_dep.mod new file mode 100644 index 000000000..5ca3ecb05 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/he_dep.mod @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c978df6f7409a68f159431f320e6be00ee8a6c6fe0bb7ccf86ca878532c6576a +size 771380 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/history_columns.list b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/history_columns.list new file mode 100644 index 000000000..fc6f9fc25 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/history_columns.list @@ -0,0 +1,1073 @@ +! history_columns.list -- determines the contents of star history logs +! you can use a non-standard version by setting history_columns_file in your inlist + +! units are cgs unless otherwise noted. + +! reorder the following names as desired to reorder columns. +! comment out the name to omit a column (fewer columns => less IO => faster running). +! remove '!' to restore a column. + +! if you have a situation where you want a non-standard set of columns, +! make a copy of this file, edit as desired, and give the new filename in your inlist +! as history_columns_file. if you are just adding columns, you can 'include' this file, +! and just list the additions in your file. note: to include the standard default +! version, use include '' -- the 0 length string means include the default file. + +! blank lines and comments can be used freely. +! if a column name appears more than once in the list, only the first occurrence is used. + +! if you need to have something added to the list of options, let me know.... + + +! the first few lines of the log file contain a few items: + + ! version_number -- for the version of mesa being used + ! burn_min1 -- 1st limit for reported burning, in erg/g/s + ! burn_min2 -- 2nd limit for reported burning, in erg/g/s + + +!# other files + +! note: you can include another list by doing +! include 'filename' +! include '' means include the default standard list file + +! the following lines of the log file contain info about 1 model per row + +!---------------------------------------------------------------------------------------------- + +!# general info about the model + + model_number ! counting from the start of the run + num_zones ! number of zones in the model + + !## age + + star_age ! elapsed simulated time in years since the start of the run + !star_age_sec ! elapsed simulated time in seconds since the start of the run + !star_age_min ! elapsed simulated time in minutes since the start of the run + !star_age_hr ! elapsed simulated time in hours since the start of the run + !star_age_day ! elapsed simulated time in days since the start of the run + day ! elapsed simulated time in days since the start of the run + + log_star_age + log_star_age_sec + + !## timestep + + time_step ! timestep in years since previous model + time_step_sec ! timestep in seconds since previous model + time_step_days + log_dt ! log10 time_step in years + log_dt_sec ! log10 time_step in seconds + !log_dt_days ! log10 time_step in days + + !## mass + + star_mass ! in Msun units + !log_star_mass + + !star_gravitational_mass ! star_mass is baryonic mass + !star_mass_grav_div_mass + + !delta_mass ! star_mass - initial_mass in Msun units + log_xmstar ! log10 mass exterior to M_center (grams) + + !## mass change + + star_mdot ! d(star_mass)/dt (in msolar per year) + log_abs_mdot ! log10(abs(star_mdot)) (in msolar per year) + + !## imposed surface conditions + !Tsurf_factor + !tau_factor + !tau_surface + + !## imposed center conditions + !m_center + !m_center_gm + !r_center + !r_center_cm + !r_center_km + !L_center + !log_L_center + !log_L_center_ergs_s + !v_center + !v_center_kms + + !logt_max + +!---------------------------------------------------------------------------------------------- + +!# mixing and convection + + !max_conv_vel_div_csound + !max_gradT_div_grada + !max_gradT_sub_grada + !min_log_mlt_Gamma + + + !## mixing regions + + mass_conv_core ! (Msun) mass coord of top of convective core. 0 if core is not convective + + ! mx1 refers to the largest (by mass) convective region. + ! mx2 is the 2nd largest. + + ! conv_mx1_top and conv_mx1_bot are the region where mixing_type == convective_mixing. + ! mx1_top and mx1_bot are the extent of all kinds of mixing, convective and other. + + ! values are m/Mstar + conv_mx1_top + conv_mx1_bot + conv_mx2_top + conv_mx2_bot + mx1_top + mx1_bot + mx2_top + mx2_bot + + ! radius -- values are radii in Rsun units + !conv_mx1_top_r + !conv_mx1_bot_r + !conv_mx2_top_r + !conv_mx2_bot_r + !mx1_top_r + !mx1_bot_r + !mx2_top_r + !mx2_bot_r + + ! you might want to get a more complete list of mixing regions by using the following + + !mixing_regions ! note: this includes regions where the mixing type is no_mixing. + + ! the is the number of regions to report + ! there will be 2* columns for this in the log file, 2 for each region. + ! the first column for a region gives the mixing type as defined in const/public/const_def.f90. + + ! the second column for a region gives the m/mstar location of the top of the region + ! entries for extra columns after the last region in the star will have an invalid mixing_type value of -1. + ! mstar is the total mass of the star, so these locations range from 0 to 1 + ! all regions are include starting from the center, so the bottom of one region + ! is the top of the previous one. since we start at the center, the bottom of the 1st region is 0. + + ! the columns in the log file will have names like 'mix_type_1' and 'mix_qtop_1' + + ! if the star has too many regions to report them all, + ! the smallest regions will be merged with neighbors for reporting purposes only. + + + !mix_relr_regions + ! same as above, but locations given as r/rstar instead of m/mstar. + ! the columns in the log file will have names like 'mix_relr_type_1' and 'mix_relr_top_1' + + + !## conditions at base of largest convection zone (by mass) + !cz_bot_mass ! mass coordinate of base (Msun) + !cz_mass ! mass coordinate of base (Msun) -- same as cz_bot_mass + !cz_log_xmass ! mass exterior to base (g) + !cz_log_xmsun ! mass exterior to base (Msun) + !cz_xm ! mass exterior to base (Msun) + !cz_logT + !cz_logRho + !cz_logP + !cz_bot_radius ! Rsun + !cz_log_column_depth + !cz_log_radial_depth + !cz_luminosity ! Lsun + !cz_opacity + !cz_log_tau + !cz_eta + !cz_log_eps_nuc ! log10(ergs/g/s) + !cz_t_heat ! Cp*T/eps_nuc (seconds) + + !cz_csound + !cz_scale_height + !cz_grav + + !cz_omega + !cz_omega_div_omega_crit + + !cz_zone + + ! mass fractions at base of largest convection zone (by mass) + !cz_log_xa h1 + !cz_log_xa he4 + + !## conditions at top of largest convection zone (by mass) + !cz_top_mass ! mass coordinate of top (Msun) + !cz_top_log_xmass ! mass exterior to top (g) + !cz_top_log_xmsun ! mass exterior to top (Msun) + !cz_top_xm ! mass exterior to top (Msun) + !cz_top_logT + !cz_top_logRho + !cz_top_logP + !cz_top_radius ! Rsun + !cz_top_log_column_depth + !cz_top_log_radial_depth + !cz_top_luminosity ! Lsun + !cz_top_opacity + !cz_top_log_tau + !cz_top_eta + !cz_top_log_eps_nuc ! log10(ergs/g/s) + !cz_top_t_heat ! Cp*T/eps_nuc (seconds) + + !cz_top_csound + !cz_top_scale_height + !cz_top_grav + + !cz_top_omega + !cz_top_omega_div_omega_crit + + !cz_top_zone + !cz_top_zone_logdq + + ! mass fractions at top of largest convection zone (by mass) + !cz_top_log_xa h1 + !cz_top_log_xa he4 + +!---------------------------------------------------------------------------------------------- + +!# nuclear reactions + + !## integrated quantities + + !power_h_burn ! total thermal power from PP and CNO, excluding neutrinos (in Lsun units) + !power_he_burn ! total thermal power from triple-alpha, excluding neutrinos (in Lsun units) + !power_photo + !power_z_burn + !log_power_nuc_burn ! total thermal power from all burning, excluding photodisintegrations + log_LH ! log10 power_h_burn + log_LHe ! log10 power_he_burn + log_LZ ! log10 total burning power including LC, but excluding LH and LHe and photodisintegrations + log_Lnuc ! log(LH + LHe + LZ) + !log_Lnuc_ergs_s + !log_Lnuc_sub_log_L + !lnuc_photo + + !extra_L ! integral of extra_heat in Lsun units + !log_extra_L ! log10 extra_L + + !## neutrino losses + log_Lneu ! log10 power emitted in neutrinos, nuclear and thermal (in Lsun units) + !log_Lneu_nuc ! log10 power emitted in neutrinos, nuclear sources only (in Lsun units) + !log_Lneu_nonnuc ! log10 power emitted in neutrinos, thermal sources only (in Lsun units) + + !mass_loc_of_max_eps_nuc ! (in Msun units) + !mass_ext_to_max_eps_nuc ! (in Msun units) + !eps_grav_integral ! (in Lsun units) + !log_abs_Lgrav ! log10 abs(eps_grav_integral) (in Lsun units) + + !## information about reactions (by category) + + ! log10 total luminosity for reaction categories (Lsun units) + + pp + cno + tri_alpha + !c_alpha + !n_alpha + !o_alpha + !ne_alpha + !na_alpha + !mg_alpha + !si_alpha + !s_alpha + !ar_alpha + !ca_alpha + !ti_alpha + !fe_co_ni + !c12_c12 + !c12_o16 + !o16_o16 + !photo + !pnhe4 + !other + + !## information about individual reactions + + ! adds columns for all of the reactions that are in the current net + ! Note that if using op_split_burn=.true. then zones which have been split will report 0 for thier rates + !add_raw_rates ! raw reaction rates, reactions/second + !add_screened_rates ! screened reaction rates reactions/second + !add_eps_nuc_rates ! Nuclear energy (minus neutrino losses) released erg/s + !add_eps_neu_rates ! Neutrino losses erg/s + + ! individual reactions (as many as desired) + ! use list_net_reactions = .true. in star_job to list all reactions in the current net + ! reactions/second + !raw_rate r_h1_h1_ec_h2 + !raw_rate r_h1_h1_wk_h2 + + + + !## nuclear reactions at center + + ! center log10 burn erg/g/s for reaction categories + + !c_log_eps_burn cno + !c_log_eps_burn tri_alfa + + ! center d_eps_nuc_dlnd for reaction categories + + !c_d_eps_dlnd cno + !c_d_eps_dlnd tri_alfa + + ! center d_eps_nuc_dlnT for reaction categories + + !c_d_eps_dlnT cno + !c_d_eps_dlnT tri_alfa + + !## regions of strong nuclear burning + + ! 2 zones where eps_nuc > burn_min1 erg/g/s + ! for each zone have 4 numbers: start1, start2, end2, end1 + ! start1 is mass of inner edge where first goes > burn_min1 (or -20 if none such) + ! start2 is mass of inner edge where first zone reaches burn_min2 erg/g/sec (or -20 if none such) + ! end2 is mass of outer edge where first zone drops back below burn_min2 erg/g/s + ! end1 is mass of outer edge where first zone ends (i.e. eps_nuc < burn_min1) + ! similar for the second zone + + epsnuc_M_1 ! start1 for 1st zone + epsnuc_M_2 ! start2 + epsnuc_M_3 ! end2 + epsnuc_M_4 ! end1 + + epsnuc_M_5 ! start1 for 2nd zone + epsnuc_M_6 ! start2 + epsnuc_M_7 ! end2 + epsnuc_M_8 ! end1 + + + ! you might want to get a more complete list of burning regions by using the following + + !burning_regions + ! the is the number of regions to report + ! there will be 2* columns for this in the log file, 2 for each region. + ! the first column for a region gives int(sign(val)*log10(max(1,abs(val)))) + ! where val = ergs/gm/sec nuclear energy minus all neutrino losses. + ! the second column for a region gives the q location of the top of the region + ! entries for extra columns after the last region in the star will have a value of -9999 + ! all regions are included starting from the center, so the bottom of one region + ! is the top of the previous one. + ! since we start at the center, the bottom of the 1st region is q=0 and top of last is q=1. + + ! the columns in the log file will have names like 'burn_type_1' and 'burn_qtop_1' + + !burn_relr_regions + ! same as above, but locations given as r/rstar instead of m/mstar. + ! the columns in the log file will have names like 'burn_relr_type_1' and 'burn_relr_top_1' + + + ! if the star has too many regions to report them all, + ! the smallest regions will be merged with neighbors for reporting purposes only. + +!---------------------------------------------------------------------------------------------- + +!# information about core and envelope + + !## helium core + he_core_mass + he_core_radius + !he_core_lgT + !he_core_lgRho + !he_core_L + !he_core_v + !he_core_omega + !he_core_omega_div_omega_crit + !he_core_k + + !## CO core + co_core_mass + !CO_core + co_core_radius + !co_core_lgT + !co_core_lgRho + !co_core_L + !co_core_v + !co_core_omega + !co_core_omega_div_omega_crit + !co_core_k + + !## ONe core + one_core_mass + !one_core_radius + !one_core_lgT + !one_core_lgRho + !one_core_L + !one_core_v + !one_core_omega + !one_core_omega_div_omega_crit + !one_core_k + + !## iron core + fe_core_mass + !fe_core_radius + !fe_core_lgT + !fe_core_lgRho + !fe_core_L + !fe_core_v + !fe_core_omega + !fe_core_omega_div_omega_crit + !fe_core_k + + !## neuton rich core + neutron_rich_core_mass + !neutron_rich_core_radius + !neutron_rich_core_lgT + !neutron_rich_core_lgRho + !neutron_rich_core_L + !neutron_rich_core_v + !neutron_rich_core_omega + !neutron_rich_core_omega_div_omega_crit + !neutron_rich_core_k + + !## envelope + + !envelope_mass ! = star_mass - he_core_mass + !envelope_fraction_left ! = envelope_mass / (initial_mass - he_core_mass) + + !h_rich_layer_mass ! = star_mass - he_core_mass + !he_rich_layer_mass ! = he_core_mass - c_core_mass + !co_rich_layer_mass + +!---------------------------------------------------------------------------------------------- + +!# timescales + + !dynamic_timescale ! dynamic timescale (seconds) -- estimated by 2*pi*sqrt(r^3/(G*m)) + !kh_timescale ! kelvin-helmholtz timescale (years) + !mdot_timescale ! star_mass/abs(star_mdot) (years) + !kh_div_mdot_timescales ! kh_timescale/mdot_timescale + !nuc_timescale ! nuclear timescale (years) -- proportional to mass divided by luminosity + + !dt_cell_collapse ! min time for any cell to collapse at current velocities + !dt_div_dt_cell_collapse + + !dt_div_max_tau_conv ! dt/ maximum conv timescale + !dt_div_min_tau_conv ! dt/ minimum conv timescale + + + !min_dr_div_cs ! min over all cells of dr/csound (seconds) + !min_dr_div_cs_k ! location of min + !log_min_dr_div_cs ! log10 min dr_div_csound (seconds) + !min_dr_div_cs_yr ! min over all cells of dr/csound (years) + !log_min_dr_div_cs_yr ! log10 min dr_div_csound (years) + !dt_div_min_dr_div_cs + !log_dt_div_min_dr_div_cs + + !min_t_eddy ! minimum value of scale_height/conv_velocity + +!---------------------------------------------------------------------------------------------- + +!# conditions at or near the surface of the model + + !## conditions at the photosphere + !effective_T + !Teff + log_Teff ! log10 effective temperature + ! Teff is calculated using Stefan-Boltzmann relation L = 4 pi R^2 sigma Teff^4, + ! where L and R are evaluated at the photosphere (tau_factor < 1) + ! or surface of the model (tau_factor >= 1) when photosphere is not inside the model. + + !photosphere_black_body_T + !photosphere_cell_T ! temperature at model location closest to the photosphere, not necessarily Teff + !photosphere_cell_log_T + !photosphere_cell_density + !photosphere_cell_log_density + !photosphere_cell_opacity + !photosphere_cell_log_opacity + !photosphere_L ! Lsun units + !photosphere_log_L ! Lsun units + !photosphere_r ! Rsun units + !photosphere_log_r ! Rsun units + !photosphere_m ! Msun units + !photosphere_v_km_s + !photosphere_cell_k + !photosphere_column_density + !photosphere_csound + !photosphere_log_column_density + !photosphere_opacity + !photosphere_v_div_cs + !photosphere_xm + !photosphere_cell_free_e + !photosphere_cell_log_free_e + !photosphere_logg + !photosphere_T + + !## conditions at or near the surface of the model (outer edge of outer cell) + + luminosity ! luminosity in Lsun units + !luminosity_ergs_s ! luminosity in cgs units + log_L ! log10 luminosity in Lsun units + !log_L_ergs_s ! log10 luminosity in cgs units + radius ! Rsun + log_R ! log10 radius in Rsun units + !radius_cm + !log_R_cm + + log_g ! log10 gravity + gravity + log_Ledd + log_L_div_Ledd ! log10(L/Leddington) + lum_div_Ledd + !log_surf_optical_depth + !surface_optical_depth + + !log_surf_cell_opacity ! old name was log_surf_opacity + !log_surf_cell_P ! old name was log_surf_P + !log_surf_cell_pressure ! old name was log_surf_pressure + !log_surf_cell_density ! old name was log_surf_density + !log_surf_cell_temperature ! old name was log_surf_temperature + !surface_cell_temperature ! old name was surface_temperature + !log_surf_cell_z ! old name was log_surf_z + !surface_cell_entropy ! in units of kerg per baryon + ! old name was surface_entropy + + v_surf ! (cm/s) + v_surf_km_s ! (km/s) + v_div_csound_surf ! velocity divided by sound speed at outermost grid point + !v_div_csound_max ! max value of velocity divided by sound speed at face + !v_div_vesc + !v_phot_km_s + !v_surf_div_escape_v + + !v_surf_div_v_kh ! v_surf/(photosphere_r/kh_timescale) + + !surf_avg_j_rot + !surf_avg_omega + !surf_avg_omega_crit + !surf_avg_omega_div_omega_crit + !surf_avg_v_rot ! km/sec rotational velocity at equator + !surf_avg_v_crit ! critical rotational velocity at equator + !surf_avg_v_div_v_crit + !surf_avg_Lrad_div_Ledd + !surf_avg_logT + !surf_avg_logRho + !surf_avg_opacity + + ! Gravity Darkening, reports the surface averaged L/Lsun and Teff (K) caused by + ! gravity darkening in rotating stars. Based on the model of Espinosa Lara & Rieutord (2011) + ! 'polar' refers to the line of sight being directed along the rotation axis of the star + ! 'equatorial' refers to the line of sight coincident with the stellar equator + !grav_dark_L_polar !Lsun + !grav_dark_Teff_polar !K + !grav_dark_L_equatorial !Lsun + !grav_dark_Teff_equatorial !K + + !surf_escape_v ! cm/s + + !v_wind_Km_per_s ! Km/s + ! = 1d-5*s% opacity(1)*max(0d0,-s% mstar_dot)/ & + ! (4*pi*s% photosphere_r*Rsun*s% tau_base) + ! Lars says: + ! wind_mdot = 4*pi*R^2*rho*v_wind + ! tau = integral(opacity*rho*dr) from R to infinity + ! so tau = opacity*wind_mdot/(4*pi*R*v_wind) at photosphere + ! or v_wind = opacity*wind_mdot/(4*pi*R*tau) at photosphere + + !rotational_mdot_boost ! factor for increase in mass loss mdot due to rotation + !log_rotational_mdot_boost ! log factor for increase in mass loss mdot due to rotation + !surf_r_equatorial_div_r_polar + !surf_r_equatorial_div_r + !surf_r_polar_div_r + +!---------------------------------------------------------------------------------------------- + +!# conditions near center + + log_center_T ! temperature + log_center_Rho ! density + log_center_P ! pressure + + ! shorter names for above + log_cntr_P + log_cntr_Rho + log_cntr_T + + !center_T ! temperature + !center_Rho ! density + !center_P ! pressure + + !center_degeneracy ! the electron chemical potential in units of k*T + !center_gamma ! plasma interaction parameter + center_mu + center_ye + center_abar + !center_zbar + + !center_eps_grav + + !center_non_nuc_neu + !center_eps_nuc + !d_center_eps_nuc_dlnT + !d_center_eps_nuc_dlnd + !log_center_eps_nuc + + !center_entropy ! in units of kerg per baryon + !max_entropy ! in units of kerg per baryon + !fe_core_infall + !non_fe_core_infall + !non_fe_core_rebound + !max_infall_speed + + !compactness_parameter ! (m/Msun)/(R(m)/1000km) for m = 2.5 Msun + !compactness + !m4 ! Mass co-ordinate where entropy=4 + ! mu4 is sensitive to the choice of how much dm/dr you average over, thus we average dm and dr over M(entropy=4) and M(entropy=4)+0.3Msun + !mu4 ! dM(Msun)/dr(1000km) where entropy=4 + + + !center_omega + !center_omega_div_omega_crit + +!---------------------------------------------------------------------------------------------- + +!# abundances + + !species ! size of net + + !## mass fractions near center + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_center_abundances + !add_log_center_abundances + + ! individual central mass fractions (as many as desired) + center h1 + center he4 + center c12 + center o16 + + ! individual log10 central mass fractions (as many as desired) + !log_center h1 + !log_center he4 + ! etc. + + + !## mass fractions near surface + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_surface_abundances + !add_log_surface_abundances + + ! individual surface mass fractions (as many as desired) + !surface h1 + !surface he4 + surface c12 + surface o16 + ! etc. + + ! individual log10 surface mass fractions (as many as desired) + + !log_surface h1 + !log_surface he4 + + + !## mass fractions for entire star + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_average_abundances + !add_log_average_abundances + + ! individual average mass fractions (as many as desired) + !average h1 + !average he4 + ! etc. + + ! individual log10 average mass fractions (as many as desired) + !log_average h1 + !log_average he4 + ! etc. + + + !## mass totals for entire star (in Msun units) + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_total_mass + !add_log_total_mass + + ! individual mass totals for entire star (as many as desired) + total_mass h1 + total_mass he4 + ! etc. + + ! individial log10 mass totals for entire star (in Msun units) + !log_total_mass h1 + !log_total_mass he4 + ! etc. + +!---------------------------------------------------------------------------------------------- + +!# info at specific locations + + !## info at location of max temperature + !max_T + !log_max_T + + +!---------------------------------------------------------------------------------------------- + +!# information about shocks + + !## info about outermost outward moving shock + ! excluding locations with q > max_q_for_outer_mach1_location + ! returns values at location of max velocity + !shock_mass ! baryonic (Msun) + !shock_mass_gm ! baryonic (grams) + !shock_q + !shock_radius ! (Rsun) + !shock_radius_cm ! (cm) + !shock_velocity + !shock_csound + !shock_v_div_cs + !shock_lgT + !shock_lgRho + !shock_lgP + !shock_gamma1 + !shock_entropy + !shock_tau + !shock_k + !shock_pre_lgRho + +!---------------------------------------------------------------------------------------------- + +!# asteroseismology + + delta_nu ! large frequency separation for p-modes (microHz) + ! 1e6/(seconds for sound to cross diameter of star) + delta_Pg ! g-mode period spacing for l=1 (seconds) + ! sqrt(2) pi^2/(integral of brunt_N/r dr) + !log_delta_Pg + nu_max ! estimate from scaling relation (microHz) + ! nu_max = nu_max_sun * M/Msun / ((R/Rsun)^2 (Teff/Teff_sun)^0.5) + ! with nu_max_sun = 3100 microHz, Teff_sun = 5777 + !nu_max_3_4th_div_delta_nu ! nu_max^0.75/delta_nu + acoustic_cutoff ! 0.5*g*sqrt(gamma1*rho/P) at surface + acoustic_radius ! integral of dr/csound (seconds) + !ng_for_nu_max ! = 1 / (nu_max*delta_Pg) + ! period for g-mode with frequency nu_max = nu_max_ng*delta_Pg + !gs_per_delta_nu ! delta_nu / (nu_max**2*delta_Pg) + ! number of g-modes per delta_nu at nu_max + + !int_k_r_dr_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=1 + !int_k_r_dr_2pt0_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=1 + !int_k_r_dr_0pt5_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=1 + !int_k_r_dr_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=2 + !int_k_r_dr_2pt0_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=2 + !int_k_r_dr_0pt5_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=2 + !int_k_r_dr_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=3 + !int_k_r_dr_2pt0_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=3 + !int_k_r_dr_0pt5_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=3 + +!---------------------------------------------------------------------------------------------- + +!# energy information + + !total_energy ! at end of step + !log_total_energy ! log(abs(total_energy)) + !total_energy_after_adjust_mass ! after mass adjustments + + ! shorter versions of above + !tot_E + !log_tot_E + + + !total_gravitational_energy + !log_total_gravitational_energy ! log(abs(total_gravitational_energy)) + !total_gravitational_energy_after_adjust_mass + + ! shorter versions of above + !tot_PE + !log_tot_PE + + !total_internal_energy + !log_total_internal_energy + !total_internal_energy_after_adjust_mass + + ! shorter versions of above + !tot_IE + !log_tot_IE + + !total_radial_kinetic_energy + !log_total_radial_kinetic_energy + !total_radial_kinetic_energy_after_adjust_mass + + ! shorter versions of above (does not include rot KE) + !tot_KE + !log_tot_KE + + !total_turbulent_energy + !log_total_turbulent_energy + !total_turbulent_energy_after_adjust_mass + !tot_Et + !log_tot_Et + + !total_energy_foe + + !tot_IE_div_IE_plus_KE + !total_IE_div_IE_plus_KE + + !total_entropy + !total_eps_grav + + !total_energy_sources_and_sinks ! for this step + !total_nuclear_heating + !total_non_nuc_neu_cooling + !total_irradiation_heating + !total_extra_heating ! extra heat integrated over the model times dt (erg) + !total_WD_sedimentation_heating + + !rel_run_E_err + + !rel_E_err + !abs_rel_E_err + !log_rel_E_err + + !tot_e_equ_err + !tot_e_err + + + !error_in_energy_conservation ! for this step + ! = total_energy - (total_energy_start + total_energy_sources_and_sinks) + !cumulative_energy_error ! = sum over all steps of abs(error_in_energy_conservation) + !rel_cumulative_energy_error ! = cumulative_energy_error/total_energy + log_rel_cumulative_energy_error ! = log10 of rel_cumulative_energy_error + log_rel_run_E_err ! shorter name for rel_cumulative_energy_error + + !rel_error_in_energy_conservation ! = error_in_energy_conservation/total_energy + log_rel_error_in_energy_conservation + + !virial_thm_P_avg + !virial_thm_rel_err + !work_inward_at_center + !work_outward_at_surface + + +!---------------------------------------------------------------------------------------------- + + !# rotation + + !total_angular_momentum + log_total_angular_momentum + !i_rot_total ! moment of inertia + + !total_rotational_kinetic_energy + !log_total_rotational_kinetic_energy + !total_rotational_kinetic_energy_after_adjust_mass + +!---------------------------------------------------------------------------------------------- + +!# velocities + + !avg_abs_v_div_cs + !log_avg_abs_v_div_cs + !max_abs_v_div_cs + !log_max_abs_v_div_cs + + !avg_abs_v + !log_avg_abs_v + !max_abs_v + !log_max_abs_v + + !u_surf + !u_surf_km_s + !u_div_csound_surf + !u_div_csound_max + + !infall_div_cs + +!---------------------------------------------------------------------------------------------- + +!# misc + + !e_thermal ! sum over all zones of Cp*T*dm + + !## eos + !logQ_max ! logQ = logRho - 2*logT + 12 + !logQ_min + !gamma1_min + + !## core mixing + !mass_semiconv_core + + !## H-He boundary + + !diffusion_time_H_He_bdy + !temperature_H_He_bdy + + + !## optical depth and opacity + + !one_div_yphot + !log_one_div_yphot + + !log_min_opacity + !min_opacity + + !log_tau_center + + !log_max_tau_conv + !max_tau_conv + !log_min_tau_conv + !min_tau_conv + + !tau_qhse_yrs + + !## other + + !Lsurf_m + !dlnR_dlnM + !h1_czb_mass ! location (in Msun units) of base of 1st convection zone above he core + !kh_mdot_limit + !log_cntr_dr_cm + !min_Pgas_div_P + !surf_c12_minus_o16 ! this is useful for seeing effects of dredge up on AGB + !surf_num_c12_div_num_o16 + + !phase_of_evolution ! Integer mapping to the type of evolution see star_data/public/star_data_def.inc for definitions + + !## MLT++ + !gradT_excess_alpha + !gradT_excess_min_beta + !gradT_excess_max_lambda + + !max_L_rad_div_Ledd + !max_L_rad_div_Ledd_div_phi_Joss + + + !## RTI + !rti_regions + + !## Ni & Co + !total_ni_co_56 + + + !## internal structure constants + + ! this is evaluated assuming a spherical star and does not account for rotation + !apsidal_constant_k2 + + +!---------------------------------------------------------------------------------------------- + +!# accretion + + !k_below_const_q + !q_below_const_q + !logxq_below_const_q + + !k_const_mass + !q_const_mass + !logxq_const_mass + + !k_below_just_added + !q_below_just_added + !logxq_below_just_added + + !k_for_test_CpT_absMdot_div_L + !q_for_test_CpT_absMdot_div_L + !logxq_for_test_CpT_absMdot_div_L + +!---------------------------------------------------------------------------------------------- + +!# Color output + + ! Outputs the bolometric correction (bc) for the star in filter band ``filter'' (case sensitive) + !bc filter + + ! Outputs the absolute magnitude for the star in filter band ``filter'' (case sensitive) + !abs_mag filter + + ! Adds all the bc's to the output + add_bc + + ! Adds all the absolute magnitudes to the output + add_abs_mag + + ! Outputs luminosity in filter band ``filter'' (erg s^-1) (case sensitive) + !lum_band filter + + ! Adds all the filter band luminosities to the output (erg s^-1) + add_lum_band + + ! Outputs log luminosity in filter band ``filter'' (log erg s^-1) (case sensitive) + !log_lum_band filter + + ! Adds all the filter band luminosities to the output (log erg s^-1) + add_log_lum_band + +!---------------------------------------------------------------------------------------------- + +!# RSP + + !rsp_DeltaMag ! absolute magnitude difference between minimum and maximum light (mag) + !rsp_DeltaR ! R_max - R_min difference in the max and min radius (Rsun) + !rsp_GREKM ! fractional growth of the kinetic energy per pulsation period ("nonlinear growth rate") - see equation 5 in MESA5 + !rsp_num_periods ! Count of the number of pulsation cycles completed + !rsp_period_in_days ! Running period, ie., period between two consecutive values of R_max (days) + !rsp_phase ! Running pulsation phase for a cycle + +!---------------------------------------------------------------------------------------------- +!# debugging + + !## retries + num_retries ! total during the run + + !## solver iterations + + num_iters ! same as num_solver_iterations + !num_solver_iterations ! iterations at this step + !total_num_solver_iterations ! total iterations during the run + !avg_num_solver_iters + + !rotation_solver_steps + + !diffusion_solver_steps + !diffusion_solver_iters + + !avg_setvars_per_step + !avg_skipped_setvars_per_step + !avg_solver_setvars_per_step + + !burn_solver_maxsteps + + !total_num_solver_calls_converged + !total_num_solver_calls_failed + !total_num_solver_calls_made + !total_num_solver_relax_calls_converged + !total_num_solver_relax_calls_failed + !total_num_solver_relax_calls_made + !total_num_solver_relax_iterations + + !total_step_attempts + !total_step_redos + !total_step_retries + !total_steps_finished + !total_steps_taken + + !TDC_num_cells + + !## Relaxation steps + !total_relax_step_attempts + !total_relax_step_redos + !total_relax_step_retries + !total_relax_steps_finished + !total_relax_steps_taken + + !## conservation during mesh adjust + !log_mesh_adjust_IE_conservation + !log_mesh_adjust_KE_conservation + !log_mesh_adjust_PE_conservation + + !## amr + !num_hydro_merges + !num_hydro_splits + + !## timing + !elapsed_time ! time since start of run (seconds) + + !## Extras + burning_regions 40 + mixing_regions 40 + mix_relr_regions 40 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_common b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_common new file mode 100644 index 000000000..f10938bda --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_common @@ -0,0 +1,263 @@ + +&kap + +kap_file_prefix = 'a09' ! 'gs98' 'a09' 'OP_a09' 'OP_gs98' +kap_CO_prefix = 'a09_co' ! 'gs98_co' 'a09_co' +Zbase = 0.003d0 !0.0142d0 +kap_lowT_prefix = 'lowT_fa05_a09p' +!AESOPUS_filename = 'AESOPUS_AGSS09.h5' ! used only if kap_lowT_prefix = 'AESOPUS' +use_Type2_opacities = .true. + +!cubic_interpolation_in_X = .true. +!cubic_interpolation_in_Z = .true. + +/ + +&eos + + +/ ! end of eos namelist + +&star_job + + set_initial_cumulative_energy_error = .true. + new_cumulative_energy_error = 0d0 + + change_rotation_flag = .true. + new_rotation_flag = .false. + change_w_div_wc_flag = .true. + new_w_div_wc_flag = .false. + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_extra' + + pgstar_flag = .true. + save_pgstar_files_when_terminate = .true. + + num_special_rate_factors = 2 + reaction_for_special_factor(1) = 'r_c12_ag_o16' + special_rate_factor(1) = 1 + filename_of_special_rate(1) = 'c12ag_deboer_sigma_0p0_2000_Tgrid.dat' + + reaction_for_special_factor(2) = 'r_he4_he4_he4_to_c12' + special_rate_factor(2) = 1 + filename_of_special_rate(2) = 'r_he4_he4_he4_to_c12_cf88.txt' + + +/ !end of star_job namelist + + +&controls + + ! in principle this is the only thing that needs changing + ! it is set in inlist_extra + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_extra' + +! GYRE output controls + !write_pulse_data_with_profile = .true. + pulse_data_format = 'GYRE' + + x_logical_ctrl(37) = .true. ! if true, then run GYRE + + x_integer_ctrl(1) = 1000 ! output GYRE info at this step interval + x_logical_ctrl(1) = .false. ! save GYRE info whenever save profile + + x_integer_ctrl(2) = 3 ! max number of modes to output per call + x_logical_ctrl(2) = .false. ! output eigenfunction files + + x_integer_ctrl(3) = 0 ! mode l (e.g. 0 for p modes, 1 for g modes) + ! should match gyre.in mode l + x_integer_ctrl(4) = 1 ! order + x_ctrl(1) = 0.158d-05 ! freq ~ this (Hz) + x_ctrl(2) = 0.33d+03 ! growth < this (days) + + + okay_to_remove_mixing_singleton = .false. + + + + limit_for_rel_error_in_energy_conservation = 1d1 + hard_limit_for_rel_error_in_energy_conservation = 1d2 + + + + ! adjustments to the newton solver + solver_max_tries_before_reject = 30 + max_tries_for_retry = 30 + max_tries_after_5_retries = 40 + max_tries_after_10_retries = 40 + max_tries_after_20_retries = 40 + corr_coeff_limit = 1d-2 + + + use_gold_tolerances = .true. + use_gold2_tolerances = .true. + gold_iter_for_resid_tol2 = 10 + gold_iter_for_resid_tol3 = 10 + gold_tol_residual_norm3 = 1d-6 + gold_tol_max_residual3 = 1d-3 + gold_solver_iters_timestep_limit = 20 + solver_iters_timestep_limit = 50 + ignore_too_large_correction = .true. + scale_max_correction = 0.1d0 + !corr_coeff_limit = 0.2d0 + ignore_min_corr_coeff_for_scale_max_correction = .true. + ignore_species_in_max_correction = .true. + + + mlt_make_surface_no_mixing = .false. + !convergence_ignore_equL_residuals = .false., see other inlists + make_gradr_sticky_in_solver_iters = .false. + xa_scale = 1d-5 + iter_for_resid_tol2 = 10 + + + + ! during pulses very small cells near the surface can sometimes exceed + ! the speed of light. This has no impact in the behaviour of the bulk + ! of the star so we don't want to have a retry if that happens + retry_for_v_above_clight = .false. + + + relax_max_number_retries = 99999999!1000 + max_number_retries = 99999999 !500 ! RECOMMENDED 5000 + + ! During hydro we can use es scattering opacity on the very outermost cell + use_other_kap = .false. + + ! convection controls + MLT_option = 'TDC' + alpha_TDC_DAMP = 1d0 + alpha_TDC_DAMPR = 0d0 + alpha_TDC_PtdVdt = 0d0 + alpha_TDC_DAMPM = 0.25d0 + steps_before_use_TDC = 0 + + use_ledoux_criterion = .true. + alpha_semiconvection = 1d0 + thermohaline_coeff = 0d0 + num_cells_for_smooth_gradL_composition_term = 0 + + energy_eqn_option = 'dedt' + + + ! surface controls, probably uncessary + scale_max_correction_for_negative_surf_lum = .true. + max_frac_for_negative_surf_lum = 0.8 + + + ! overshoot controls + ! we only include a bit of exponential overshooting to smooth things out + + overshoot_scheme(1) = 'none' + overshoot_zone_type(1) = 'any' + overshoot_zone_loc(1) = 'shell' + overshoot_bdy_loc(1) = 'any' + overshoot_f(1) = 0.001 + overshoot_f0(1) = 0.0005 + + overshoot_scheme(2) = 'exponential' + overshoot_zone_type(2) = 'any' + overshoot_zone_loc(2) = 'core' + overshoot_bdy_loc(2) = 'any' + overshoot_f(2) = 0.01 + overshoot_f0(2) = 0.005 + + overshoot_D_min = 1d-8 + + + ! timestep options + varcontrol_target = 1d-3!5d-4 + max_timestep_factor = 1.2d0 + min_timestep_factor = 0.8d0 + dX_nuc_drop_limit = 5d-2 + dX_nuc_drop_limit_at_high_T = 1d-2 ! for center logT > 9.45 + delta_Ye_highT_limit = 1d-3 + dX_nuc_drop_max_A_limit = 52 + dX_nuc_drop_min_X_limit = 1d-4 + dX_nuc_drop_hard_limit = 1d99 + delta_lgTeff_limit = 1d0 + + delta_lgL_hard_limit = -1!1d200 + delta_lgR_limit = 1d-2!0.025d0 + delta_lgR_hard_limit = -1!0.05d0 + delta_lgR_limit_min_lgR = 3d0 ! 3d0 for >1000 Rsun + delta_lgL_He_limit = -1d0 + lgL_nuc_burn_min = 4d0 + retry_hold = 0 + + ! limit for changes in central abundances, RECOMMENDED 0.001d0 for all + delta_XH_cntr_limit = 0.01d0 + delta_XHe_cntr_limit = 0.01d0 + delta_XC_cntr_limit = 0.01d0 + delta_XO_cntr_limit = 0.01d0 + + ! extra controls for timestep + delta_lg_star_mass_limit = 2d-3 ! RECOMMENDED 2d-3 + delta_lgRho_cntr_limit = 0.005d0 ! RECOMMENDED 0.0025d0 + delta_lgRho_cntr_hard_limit = 0.1d0 ! RECOMMENDED 0.005d0 + + min_timestep_limit = 1d-20 ! (seconds) + relax_hard_limits_after_retry = .false. + + ! mesh controls + !max_dq = 1d-3 ! RECOMMENDED 1d-3 + + ! rotational mixing coeffs + !am_nu_ST_factor = 1.0 + !D_visc_factor = 0.0 + !am_nu_SH_factor = 0.0 + !D_ST_factor = 0.0 + !D_SH_factor = 0.0 + !D_GSF_factor = 1.0 + !D_ES_factor = 1.0 + !D_SSI_factor = 1.0 + !D_DSI_factor = 1.0 + !am_D_mix_factor = 0.0333333d0 + !am_gradmu_factor = 0.1d0 + !num_cells_for_smooth_gradL_composition_term = 2 + + ! use implicit wind close to critical + max_tries_for_implicit_wind = 10 + surf_avg_tau_min = 0 + surf_avg_tau = 10 + !max_mdot_redo_cnt = 200 ! this is set in inlist_hydro_on and inlist_hydro_off + min_years_dt_for_redo_mdot = 0 + surf_omega_div_omega_crit_limit = 0.98d0 + surf_omega_div_omega_crit_tol = 0.02d0 + rotational_mdot_boost_fac = 1d10 + rotational_mdot_kh_fac = 1d10 + mdot_revise_factor = 1.1 + implicit_mdot_boost = 0.05 + ! this needs to be relaxed just to avoid a crash when hydro Riemann is turned on + angular_momentum_error_retry = 1d99 + angular_momentum_error_warn = 1d-10 + + ! Fixing the position of the Lagrangian region of the mesh helps + ! convergence near the Eddington limit + !max_logT_for_k_below_const_q = 100 + !max_q_for_k_below_const_q = 0.99 + !min_q_for_k_below_const_q = 0.99 + !max_logT_for_k_const_mass = 100 + !max_q_for_k_const_mass = 0.98 + !min_q_for_k_const_mass = 0.98 + + + photo_digits = 8 + photo_interval = 1000 + profile_interval = 200 + history_interval = 1 + terminal_interval = 10 + max_num_profile_models = 1000000 ! 100 ! RECOMMENDED 10000 + + + num_trace_history_values = 2 + trace_history_value_name(1) = 'log_rel_run_E_err' + trace_history_value_name(2) = 'rel_E_err' + warn_when_large_rel_run_E_err = 1d-2 +/ ! end of controls namelist + +&pgstar + +/ diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_extra b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_extra new file mode 100644 index 000000000..bba6bed5c --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_extra @@ -0,0 +1,14 @@ + +&star_job +!new_Z = 1.42d-2 +!new_omega_div_omega_crit = 0.10d0 + initial_zfracs = 6 ! Added by eb + +/ ! end of controls namelist + +&controls +initial_mass = 6d0 +initial_Y = 0.267d0 !0.2703 !0.99858d0 +initial_Z = 0.003d0 !0.0142d0 +!initial_he3 = 0d0 +/ ! end of controls namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_pgstar b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_pgstar new file mode 100644 index 000000000..305f0b082 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_pgstar @@ -0,0 +1,751 @@ + +&pgstar + +!pause = .true. + +pgstar_interval = 50 ! making this too small slows the model down. +pgstar_show_age_in_years = .true. +pgstar_show_age_in_seconds = .false. +pgstar_sleep = 0.0 + +! some global grid plot settings at end + +pgstar_show_model_number = .false. +pgstar_show_age = .false. + +!------------------------------------------------------------------------------------ + +Grid1_win_flag = .true. +Grid1_win_width = 12 +Grid1_win_aspect_ratio = 0.666 + +! file output +Grid1_file_flag = .true. +Grid1_file_dir = 'png' +Grid1_file_prefix = 'Grid1_' +Grid1_file_interval = 10 ! output when mod(model_number,Grid1_file_interval)==0 +Grid1_file_width = 27 ! (inches) negative means use same value as for window +Grid1_file_aspect_ratio = -1 ! negative means use same value as for window + +! reset the defaults + +Grid1_plot_name(:) = '' +Grid1_plot_row(:) = 1 ! number from 1 at top +Grid1_plot_rowspan(:) = 1 ! plot spans this number of rows +Grid1_plot_col(:) = 1 ! number from 1 at left +Grid1_plot_colspan(:) = 1 ! plot spans this number of columns +Grid1_plot_pad_left(:) = 0.0 ! fraction of full window width for padding on left +Grid1_plot_pad_right(:) = 0.0 ! fraction of full window width for padding on right +Grid1_plot_pad_top(:) = 0.0 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(:) = 0.0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(:) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_title = '' + +Grid1_num_cols = 3 ! divide plotting region into this many equal width cols +Grid1_num_rows = 5 ! divide plotting region into this many equal height rows +Grid1_num_plots = 6 ! <= 10 + + +Grid1_plot_name(1) = 'Text_Summary1' +Grid1_plot_row(1) = 1 ! number from 1 at top +Grid1_plot_rowspan(1) = 1 ! plot spans this number of rows +Grid1_plot_col(1) = 1 ! number from 1 at left +Grid1_plot_colspan(1) = 3 ! plot spans this number of columns + +Grid1_plot_pad_left(1) = -0.03 ! fraction of full window width for padding on left +Grid1_plot_pad_right(1) = 0.0 ! fraction of full window width for padding on right +Grid1_plot_pad_top(1) = -0.06 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(1) = 0.07 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(1) = 1 ! 0.8 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(3) = 'HR' +Grid1_plot_row(3) = 2 ! number from 1 at top +Grid1_plot_rowspan(3) = 1 ! plot spans this number of rows +Grid1_plot_col(3) = 1 ! number from 1 at left +Grid1_plot_colspan(3) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(3) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(3) = 0.08 ! fraction of full window width for padding on right +Grid1_plot_pad_top(3) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(3) = 0.01 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(3) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(5) = 'Profile_Panels1' +Grid1_plot_row(5) = 3 ! number from 1 at top +Grid1_plot_rowspan(5) = 3 ! plot spans this number of rows +Grid1_plot_col(5) = 1 ! number from 1 at left +Grid1_plot_colspan(5) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(5) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(5) = 0.10 ! fraction of full window width for padding on right +Grid1_plot_pad_top(5) = 0.05 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(5) = 0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(5) = 0.6 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(2) = 'TRho_Profile' +Grid1_plot_row(2) = 2 ! number from 1 at top +Grid1_plot_rowspan(2) = 1 ! plot spans this number of rows +Grid1_plot_col(2) = 2 ! number from 1 at left +Grid1_plot_colspan(2) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(2) = -0.01 ! fraction of full window width for padding on left +Grid1_plot_pad_right(2) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(2) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(2) = 0.01 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(2) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(4) = 'History_Panels1' +Grid1_plot_row(4) = 3 ! number from 1 at top +Grid1_plot_rowspan(4) = 3 ! plot spans this number of rows +Grid1_plot_col(4) = 2 ! number from 1 at left +Grid1_plot_colspan(4) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(4) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(4) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(4) = 0.05 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(4) = 0.0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(4) = 0.6 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(6) = 'Profile_Panels3' +Grid1_plot_row(6) = 2 ! number from 1 at top +Grid1_plot_rowspan(6) = 4 ! plot spans this number of rows +Grid1_plot_col(6) = 3 ! Number from 1 at left +Grid1_plot_colspan(6) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(6) = 0.04 ! fraction of full window width for padding on left +Grid1_plot_pad_right(6) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(6) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(6) = 0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(6) = 0.6 ! multiply txt_scale for subplot by this + + +!------------------------------------------------------------------------------------ + +Profile_Panels3_win_flag = .false. + +Profile_Panels3_title = '' + +Profile_Panels3_num_panels = 5 + +Profile_Panels3_yaxis_name(1) = 'Abundance' + +Profile_Panels3_yaxis_name(2) = 'Power' + +Profile_Panels3_yaxis_name(3) = 'Mixing' +Mixing_legend_txt_scale_factor = 0.9 + +Profile_Panels3_yaxis_name(4) = 'conv_vel_div_csound'!'conv_vel'!'logRho' +Profile_Panels3_other_yaxis_name(4) = 'v_div_cs' ! 'vel_km_per_s' ! 'entropy' +Profile_Panels3_other_dymin(4) = 0.14 + +Profile_Panels3_yaxis_name(5) = 'v_div_vesc'!'lum_div_Ledd'!'log_csound'!'logT' +Profile_Panels3_other_yaxis_name(5) = 'vel_km_per_s'!'burn_num_iters' + Profile_Panels3_yaxis_log(5) = .false. + +! x-axis limits and properties +Profile_Panels3_xaxis_name = 'logtau'!'zone'!'radius' +Profile_Panels3_xmin = -101d0 +Profile_Panels3_xmax = -101d0 !1700! -101d0 ! 2.2 +Profile_Panels3_xaxis_reversed = .true. + + +Profile_Panels3_txt_scale = 0.7 + +!Profile_Panels3_xaxis_name = 'zone' +!Profile_Panels3_xmin = 800 +!Profile_Panels3_xmax = 1100 +!Profile_Panels3_xaxis_reversed = .true. + +!Profile_Panels3_show_grid = .true. +Profile_Panels3_show_mix_regions_on_xaxis = .true. + +!------------------------------------------------------------------------------------ + +!Profile_Panels1_win_flag = .true. +!Profile_Panels1_file_flag = .true. + Profile_Panels1_file_dir = 'png' + Profile_Panels1_file_prefix = 'profile_panels1_' + Profile_Panels1_file_interval = 1 + Profile_Panels1_file_width = -1 + Profile_Panels1_file_aspect_ratio = -1 + +Profile_Panels1_title = '' + +Profile_Panels1_txt_scale = 0.7 +Profile_Panels1_num_panels = 4 + +Profile_Panels1_yaxis_name(1) = 'Lc_div_L' +!Profile_Panels1_dymin(1) = 0.14 +Profile_Panels1_other_yaxis_name(1) = 'Frad_div_cUrad'!'lum_conv' +!Profile_Panels1_other_dymin(1) = 0.14 + +Profile_Panels1_yaxis_name(2) = 'logT'!'logdq'!'radius'!'entropy' +Profile_Panels1_other_yaxis_name(2) = 'mlt_Y_face'! 'Lc_div_L'!'log_dt_cs_div_dr'!'pgas_div_p' +Profile_Panels1_other_yaxis_log(2) = .false. + +!Profile_Panels1_ymax(2) = 210 +!Profile_Panels1_ymin(2) = 160 + +Profile_Panels1_yaxis_name(3) = 'Lc_div_L'!'gradT' +Profile_Panels1_other_yaxis_name(3) = 'conv_vel'!'lum_div_Ledd'!'grada' +Profile_Panels1_same_yaxis_range(3) = .false. +Profile_Panels1_other_dymin(3) = 0.08 +!Profile_Panels1_yaxis_log(3) = .false. +Profile_Panels1_ymax(3) =-101d0 + +Profile_Panels1_yaxis_name(4) = 'log_opacity' +Profile_Panels1_ymin(4) = 0 +Profile_Panels1_dymin(4) = 0.14 +Profile_Panels1_other_yaxis_name(4) = 'gradr' +Profile_Panels1_other_dymin(4) = 0.14 + +! x-axis limits and properties +Profile_Panels1_xaxis_name = 'logtau'!'zone' +Profile_Panels1_xmin = -101d0!-101d0 +Profile_Panels1_xmax = 5.5d0!-101d0!9d0 !-101d0 !8.1 +Profile_Panels1_xaxis_reversed = .true. + +!Profile_Panels1_xaxis_name = 'zone' +!Profile_Panels1_xmin = 15 +!Profile_Panels1_xmax = 270 +!Profile_Panels1_xaxis_reversed = .true. + +!Profile_Panels1_show_grid = .true. +Profile_Panels1_show_mix_regions_on_xaxis = .true. + +!------------------------------------------------------------------------------------ + + +!TRho_Profile_win_flag = .true. +TRho_Profile_win_width = 8 +TRho_Profile_win_aspect_ratio = 0.75 ! aspect_ratio = height/width + +! file output +!TRho_Profile_file_flag = .true. +TRho_Profile_file_dir = 'TRho' +TRho_Profile_file_prefix = 'trho_' +TRho_Profile_file_interval = 10 ! output when `mod(model_number,TRho_Profile_file_interval)==0` +TRho_Profile_file_width = -1 ! (inches) negative means use same value as for window +TRho_Profile_file_aspect_ratio = -1 ! negative means use same value as for window + +TRho_Profile_xleft = 0.15 +TRho_Profile_xright = 0.85 +TRho_Profile_ybot = 0.15 +TRho_Profile_ytop = 0.85 +TRho_Profile_txt_scale = 0.7 +TRho_Profile_title = ' ' + +TRho_switch_to_Column_Depth = .false. +TRho_switch_to_mass = .false. + +show_TRho_Profile_legend = .false. + TRho_Profile_legend_coord = 0.07 + TRho_Profile_legend_fjust = 0.0 + TRho_Profile_legend_disp1 = -2.0 + TRho_Profile_legend_del_disp = -1.3 + TRho_Profile_legend_txt_scale = 1.1 + + +show_TRho_Profile_text_info = .false. + TRho_Profile_text_info_xfac = 0.77 ! controls x location + TRho_Profile_text_info_dxfac = 0.02 ! controls x spacing to value from text + TRho_Profile_text_info_yfac = 0.6 ! controls y location of 1st line + TRho_Profile_text_info_dyfac = -0.04 ! controls line spacing + +show_TRho_Profile_mass_locs = .true. +show_TRho_accretion_mesh_borders = .false. +show_TRho_Profile_kap_regions = .false. +show_TRho_Profile_gamma1_4_3rd = .true. +show_TRho_Profile_eos_regions = .true. +show_TRho_Profile_degeneracy_line = .true. +show_TRho_Profile_Pgas_Prad_line = .true. +show_TRho_Profile_burn_lines = .true. +show_TRho_Profile_burn_labels = .true. + +! axis limits +TRho_Profile_xmin = -15.0 +TRho_Profile_xmax = 0!5d0!10.0 +TRho_Profile_ymin = 2.5 +TRho_Profile_ymax = 7.5!8.5d0!10.0 + +! these are shown if show_TRho_Profile_mass_locs = .true. +! set all the entries +profile_mass_point_q = -1 +profile_mass_point_color_index = 1 +profile_mass_point_symbol = -6 +profile_mass_point_symbol_scale = 1.7 +profile_mass_point_str = '' +profile_mass_point_str_clr = 1 +profile_mass_point_str_scale = 1.0 + +! set defaults +num_profile_mass_points = 3 ! max is defined in star_def (max_num_profile_mass_points) + +profile_mass_point_q(1) = 0.5 +profile_mass_point_color_index(1) = 1 +profile_mass_point_symbol(1) = -6 +profile_mass_point_str(1) = ' 0.5 M\d\(0844)\u' +profile_mass_point_str_clr(1) = 1 + +profile_mass_point_q(2) = 0.95 +profile_mass_point_color_index(2) = 1 +profile_mass_point_symbol(2) = -6 +profile_mass_point_str(2) = ' 0.95 M\d\(0844)\u' +profile_mass_point_str_clr(3) = 1 + +profile_mass_point_q(3) = 0.999 +profile_mass_point_color_index(3) = 1 +profile_mass_point_symbol(3) = -6 +profile_mass_point_str(3) = ' 0.999 M\d\(0844)\u' +profile_mass_point_str_clr(3) = 1 + +!------------------------------------------------------------------------------------ + + +! Text_Summary windows + +Text_Summary1_win_flag = .false. +Text_Summary1_win_width = 10 +Text_Summary1_win_aspect_ratio = 0.15 + +Text_Summary1_xleft = 0.01 +Text_Summary1_xright = 0.99 +Text_Summary1_ybot = 0.0 +Text_Summary1_ytop = 1.0 +Text_Summary1_txt_scale = 0.95 +Text_Summary1_title = '' + +Text_Summary1_num_rows = 6 ! <= 20 +Text_Summary1_num_cols = 5 ! <= 20 +Text_Summary1_name(:,:) = '' + + +Text_Summary1_name(1,1) = 'model_number' +Text_Summary1_name(1,2) = 'log_dt' +Text_Summary1_name(1,3) = 'Mass' +Text_Summary1_name(1,4) = 'H_cntr' +Text_Summary1_name(1,5) = 'H_rich' + +Text_Summary1_name(2,1) = 'non_fe_core_infall' +Text_Summary1_name(2,2) = 'star_age' +Text_Summary1_name(2,3) = 'lg_Mdot' +Text_Summary1_name(2,4) = 'He_cntr' +Text_Summary1_name(2,5) = 'He_core' + +Text_Summary1_name(3,1) = 'KE_growth_avg' +Text_Summary1_name(3,2) = 'growth' +Text_Summary1_name(3,3) = 'eta_cntr' +Text_Summary1_name(3,4) = 'C_cntr' +Text_Summary1_name(3,5) = 'CO_core' + +Text_Summary1_name(4,1) = 'period'!'log_max_T' +Text_Summary1_name(4,2) = 'log_LH' +Text_Summary1_name(4,3) = 'lg_Lnuc_tot' +Text_Summary1_name(4,4) = 'O_cntr' +Text_Summary1_name(4,5) = 'radius' + +Text_Summary1_name(5,1) = 'num_periods' +Text_Summary1_name(5,2) = 'log_LHe' +Text_Summary1_name(5,3) = 'lg_Lneu' +Text_Summary1_name(5,4) = 'Ne_cntr' +Text_Summary1_name(5,5) = 'zones' + +Text_Summary1_name(6,1) = 'log_cntr_Rho' +Text_Summary1_name(6,2) = 'log_LZ' +Text_Summary1_name(6,3) = 'lg_Lphoto' +Text_Summary1_name(6,4) = 'retries' +Text_Summary1_name(6,5) = 'log_cntr_T' + + +!------------------------------------------------------------------------------------ + +! Abundance profile plot + +Abundance_win_flag = .false. + +! window properties +Abundance_win_width = 10 +Abundance_win_aspect_ratio = 0.75 + +Abundance_xleft = 0.15 +Abundance_xright = 0.85 +Abundance_ybot = 0.15 +Abundance_ytop = 0.85 +Abundance_txt_scale = 1.1 +Abundance_title = '' + +! isotopes to plot + +Abundance_num_isos_to_show = 20 + +Abundance_which_isos_to_show(1) = 'h1' +Abundance_which_isos_to_show(2) = 'he3' +Abundance_which_isos_to_show(3) = 'he4' +Abundance_which_isos_to_show(4) = 'c12' +Abundance_which_isos_to_show(5) = 'n14' +Abundance_which_isos_to_show(6) = 'o16' +Abundance_which_isos_to_show(7) = 'ne20' +Abundance_which_isos_to_show(8) = 'mg24' +Abundance_which_isos_to_show(9) = 'si28' +Abundance_which_isos_to_show(10) = 's32' +Abundance_which_isos_to_show(11) = 'ar36' +Abundance_which_isos_to_show(12) = 'ca40' +Abundance_which_isos_to_show(13) = 'ti44' +Abundance_which_isos_to_show(14) = 'cr48' +Abundance_which_isos_to_show(15) = 'cr56' +Abundance_which_isos_to_show(16) = 'fe52' +Abundance_which_isos_to_show(17) = 'fe54' +Abundance_which_isos_to_show(18) = 'fe56' +Abundance_which_isos_to_show(19) = 'ni56' +Abundance_which_isos_to_show(20) = 'neut' +!Abundance_which_isos_to_show(22) = 'ne22' + + + +! number and size of isotope labels along curves +num_abundance_line_labels = 4 +Abundance_line_txt_scale_factor = 1.1 + + +! number and size of isotopes on legend +Abundance_legend_max_cnt = 10 +Abundance_legend_txt_scale_factor = 1.3 + +! yaxis limits +Abundance_log_mass_frac_min = -4!-6.4 ! -3.5 +Abundance_log_mass_frac_max = 0.3 + +! file output +Abundance_file_flag = .false. +Abundance_file_dir = 'Abundance' +Abundance_file_prefix = 'abund_' +Abundance_file_width = -1 ! (inches) negative means use same value as for window +Abundance_file_aspect_ratio = -1 ! negative means use same value as for window + + +!------------------------------------------------------------------------------------ + +! power plot + +Power_win_flag = .false. +Power_win_width = 10 +Power_win_aspect_ratio = 0.75 +Power_title = '' + +Power_xleft = 0.15 +Power_xright = 0.85 +Power_ybot = 0.15 +Power_ytop = 0.85 +Power_txt_scale = 1.1 +Power_title = ' ' + +Power_legend_max_cnt = 10 +Power_legend_txt_scale_factor = 1.3 ! relative to other text + +! power yaxis limits -- to override system default selections +Power_ymin = -5.0 ! -101d0 ! only used if /= -101d0 +Power_ymax = 25.0 ! -101d0 ! only used if /= -101d0 + +! file output +Power_file_flag = .false. +Power_file_dir = 'png' +Power_file_prefix = 'power_' +Power_file_interval = 5 ! output when mod(model_number,Power_file_interval)==0 +Power_file_width = -1 ! (inches) negative means use same value as for window +Power_file_aspect_ratio = -1 ! negative means use same value as for window + + +!------------------------------------------------------------------------------------ + +! mixing plot + +Mixing_xmin = 0.0 +Mixing_xmax = 1.6 ! -101d0 +Mixing_legend_txt_scale_factor = 1.4 ! relative to other text + +Mixing_show_rotation_details = .false. + +!Mixing_win_flag = .true. +!Mixing_file_flag = .true. +Mixing_file_dir = 'png' +Mixing_file_prefix = 'mixing_' +Mixing_file_interval = 1 ! output when `mod(model_number,Mixing_file_interval)==0` +Mixing_file_width = -1 ! (inches) negative means use same value as for window +Mixing_file_aspect_ratio = -1 ! negative means use same value as for window + + +!----------------------------------------------------------------------- + +! TRho window + ! history of central temperature vs. density + + TRho_txt_scale = 0.7 + TRho_title = '' + + TRho_logT_min = -101d0 + TRho_logT_max = -101d0 + TRho_logRho_min = -101d0 + TRho_logRho_max = -101d0 + show_TRho_degeneracy_line = .true. + + + +!----------------------------------------------------------------------- + + !# HR window + ! history of `lg_L` vs. `lg_Teff` + + HR_win_flag = .true. + + HR_win_width = 12 + HR_win_aspect_ratio = 0.75 ! aspect_ratio = height/width + + HR_xleft = 0.15 + HR_xright = 0.85 + HR_ybot = 0.15 + HR_ytop = 0.85 + HR_txt_scale = 0.7 !1.0 + HR_title = '' + + ! axis limits -- to override system default selections + ! HR_logT_min = -101d0 ! only used if /= -101d0 + ! HR_logT_max = -101d0 ! only used if /= -101d0 + ! HR_logL_min = -101d0 ! only used if /= -101d0 + ! HR_logL_max = -101d0 ! only used if /= -101d0 + + + + History_Panels1_xaxis_name = 'yr_since_coll' + + + ! axis limits -- to override system default selections + HR_logT_min = -101d0!3.3 !-101d0 ! only used if /= -101d0 + HR_logT_max = -101d0!3.9!-101d0 ! only used if /= -101d0 + HR_logL_min = -101d0!4.4!-101d0 ! only used if /= -101d0 + HR_logL_max = -101d0!5.5!-101d0 ! only used if /= -101d0 + + ! axis limits -- to override system default selections + HR_logT_min = -101d0 ! only used if /= -101d0 + HR_logT_max = -101d0 ! only used if /= -101d0 + HR_logL_min = -101d0 ! only used if /= -101d0 + HR_logL_max = -101d0 ! only used if /= -101d0 + + HR_logL_margin = 0.1 + HR_logT_margin = 0.1 + HR_dlogT_min = -1 + HR_dlogL_min = -1 + + HR_step_min = -1 ! only plot models with model number >= this + HR_step_max = -1 ! only plot models with model number <= this + + show_HR_classical_instability_strip = .true. + show_HR_Mira_instability_region = .false. + show_HR_WD_instabilities = .false. + + show_HR_target_box = .false. + HR_target_n_sigma = -3 ! -n means show sig 1..n + HR_target_logL = 0 + HR_target_logL_sigma = 0 + HR_target_logT = 0 + HR_target_logT_sigma = 0 + + show_HR_annotation1 = .false. + show_HR_annotation2 = .false. + show_HR_annotation3 = .false. + + HR_fname = '' ! file name for extra HR data + + ! Enables calling a subroutine to add extra information to a plot + ! see `$MESA_DIR/star/other/pgstar_decorator.f90` + HR_use_decorator = .false. + + + ! file output + HR_file_flag = .false. + HR_file_dir = 'hr_png' + HR_file_prefix = 'hr_' + HR_file_interval = 10 ! output when `mod(model_number,HR_file_interval)==0` + HR_file_width = 27 ! (inches) negative means use same value as for window + HR_file_aspect_ratio = -1 ! negative means use same value as for window + +!----------------------------------------------------------------------- + + History_Panels1_title = '' + + History_Panels1_xaxis_name = 'day'!'model_number' + History_Panels1_max_width = 50! 10000 + + !History_Panels1_xaxis_name = 'star_age' + !History_Panels1_max_width = 10 + + History_Panels1_txt_scale = 0.75 + History_Panels1_xmin = -101d0!1300!200!500 + History_Panels1_xmax = -101d0 + History_Panels1_dxmin = -1 + History_Panels1_xaxis_reversed = .false. + History_Panels1_xaxis_log = .false. + History_Panels1_xmargin = 0.0 + + ! :: + + History_Panels1_num_panels = 4 + + ! :: + + History_Panels1_yaxis_name(1) = 'log_L' + History_Panels1_yaxis_reversed(1) = .false. + History_Panels1_ymin(1) = -101d0 + History_Panels1_ymax(1) = -101d0 + History_Panels1_dymin(1) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(1) = 'log_Teff' + History_Panels1_other_yaxis_reversed(1) = .false. + History_Panels1_other_ymin(1) = -101d0 + History_Panels1_other_ymax(1) = -101d0 + History_Panels1_other_dymin(1) = 0.14 + + ! :: + + History_Panels1_yaxis_name(2) = 'growth'!'lum_div_Ledd' + History_Panels1_yaxis_reversed(2) = .false. + History_Panels1_ymin(2) = -101d0 + History_Panels1_ymax(2) = -101d0 + !History_Panels1_dymin(2) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(2) = 'luminosity'!'log_max_T' ! 'v_surf_km_s' + History_Panels1_other_yaxis_reversed(2) = .false. + History_Panels1_other_ymin(2) = -101d0 + History_Panels1_other_ymax(2) = -101d0 + History_Panels1_other_dymin(2) = 0.14 + + ! :: + + History_Panels1_yaxis_name(3) = 'radius' + History_Panels1_yaxis_reversed(3) = .false. + History_Panels1_ymin(3) = -101d0 + History_Panels1_ymax(3) = -101d0 + History_Panels1_dymin(3) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(3) = 'v_surf_km_s'!'log_cntr_Rho' + History_Panels1_other_yaxis_reversed(3) = .false. + History_Panels1_other_ymin(3) = -101d0 + History_Panels1_other_ymax(3) = -101d0 + History_Panels1_other_dymin(3) = 0.14 + ! :: + + History_Panels1_yaxis_name(4) = 'KE_growth_avg'!'log_dt' + History_Panels1_yaxis_reversed(4) = .false. + History_Panels1_ymin(4) = -101d0 + History_Panels1_ymax(4) = -101d0 + !History_Panels1_dymin(4) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(4) = 'time_step_sec' + History_Panels1_other_yaxis_reversed(4) = .false. + History_Panels1_other_ymin(4) = -101d0 + History_Panels1_other_ymax(4) = -101d0 + History_Panels1_other_dymin(4) = 0.14 + + +!----------------------------------------------------------------------- + +! some global grid plot settings + +pgstar_grid_show_title = .true. +pgstar_grid_title_scale = 1.0 +pgstar_grid_title_lw = 3 +pgstar_grid_title_disp = 2.5 ! 1.8 +pgstar_grid_title_coord = 0.5 +pgstar_grid_title_fjust = 0.5 + +pgstar_age_scale = 0.8 +pgstar_age_disp = 3.0 +pgstar_age_coord = 0.0 +pgstar_age_fjust = 0.0 + +pgstar_xaxis_label_scale = 1.3 +pgstar_left_yaxis_label_scale = 1.3 +pgstar_xaxis_label_disp = 2.2 +pgstar_left_yaxis_label_disp = 3.1 +pgstar_right_yaxis_label_disp = 4.1 + +pgstar_model_scale = 0.8 +pgstar_model_disp = 3.0 +pgstar_model_coord = 1.0 +pgstar_model_fjust = 1.0 + +! white_on_black flags -- true means white foreground color on black background +file_white_on_black_flag = .true. +file_device = 'png' ! options 'png' and 'vcps' for png and postscript respectively + + +!file_white_on_black_flag = .false. +!file_device = 'vcps' ! options 'png' and 'vcps' for png and postscript respectively + + +kipp_win_flag=.false. +kipp_file_flag=.false. +Kipp_mix_interval = 1 +Kipp_show_luminosities = .true. + + + +! history tracks for pulsations + + +! history tracks + History_Track1_file_flag = .false. + History_Track2_file_flag = .false. + + +History_Track1_win_flag = .true. +History_Track1_file_interval = 50 +History_Track1_win_width = 12 +History_Track1_win_aspect_ratio = 0.75 + +History_Track1_xname = 'v_surf_km_s' +History_Track1_yname = 'log_L' +History_Track1_xaxis_label = 'Vsurf' +History_Track1_yaxis_label = 'log L/L\d\(2281)' +History_Track1_reverse_xaxis = .false. + + +!History_Track1_xmin = -50d0 +!History_Track1_xmax = 50d0 +!History_Track1_ymin = 3.50d0 +!History_Track1_ymax = 3.98d0 + + +History_Track2_win_flag = .true. +History_Track2_file_interval = 50 + +History_Track2_win_width = 12 +History_Track2_win_aspect_ratio = 0.75 + +History_Track2_xname = 'radius' !'v_surf_km_s' +History_Track2_yname = 'log_L' +History_Track2_xaxis_label = 'Radius' +History_Track2_yaxis_label = 'log L/L\d\(2281)' +History_Track2_reverse_xaxis = .false. + +!History_Track2_xmin = 72d0 +!History_Track2_xmax = 96d0 +!History_Track2_ymin = 3.50d0 +!History_Track2_ymax = 3.98d0 + +/ ! end of pgstar namelist + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_pulses b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_pulses new file mode 100644 index 000000000..cba490552 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_pulses @@ -0,0 +1,303 @@ +&kap + use_Type2_opacities = .false. ! if cutting out core. +cubic_interpolation_in_X = .false. +cubic_interpolation_in_Z = .false. +/ + +&eos +/ + +&star_job + + save_model_when_terminate = .true. + save_model_filename = 'final.mod' + !required_termination_code_string = 'Successful test: evolved 100 days past first relax' + + load_saved_model = .true. + load_model_filename = 'he_dep.mod' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_common' + + color_num_files=2 + color_file_names(2)='blackbody_johnson.dat' + color_num_colors(2)=5 + + !change_initial_v_flag = .true. + !new_v_flag = .false. + + change_v_flag = .true. + new_v_flag = .true. + + change_u_flag = .true. + new_u_flag = .false. + + + + relax_to_this_tau_factor = 1d-3!-1 + dlogtau_factor = 0.1d0 + relax_tau_factor = .true. + + ! if restarting from .mod file, need high initial dt for relaxing. + set_initial_dt = .true. + years_for_initial_dt = -1 + seconds_for_initial_dt = 1d7!-1 + + set_initial_cumulative_energy_error = .true. + new_cumulative_energy_error = 0d0 + + set_initial_age = .true. + initial_age = 0 + + set_initial_model_number = .true. + initial_model_number = 0 + + ! on first pass. + remove_center_by_temperature = 2d6 ! need an initial flag for this. + + !change_RSP2_flag = .true. + !new_RSP2_flag = .true. +/ !end of star_job namelist + + +&controls + + + ! probably not necessary + !remove_small_D_limit = 1d-16 + !remove_mixing_glitches = .false. !.true. ! If true, then okay to remove gaps and singletons. + mlt_make_surface_no_mixing = .false. + + + + ! controls for analyzing pulsations + x_integer_ctrl(1) = 1000 ! gyre interval to check + + x_logical_ctrl(7) = .true. ! doing pulses + x_integer_ctrl(7) = -1 ! 3 ! which period to check (<= 0 means don't check any) + x_ctrl(7) = 17d0 ! expected period (in days) +! x_ctrl(8) = 1.0 ! min_deltaR_for_periods (Rsun) + x_ctrl(9) = 1d0 !0.5 ! KE_growth_avg_abs_frac_new ! for averaging growth rates across steps. + x_ctrl(10) = 0.3 ! min_period_div_target + + + ! new rsp style meshing, thanks to Bill P. + x_logical_ctrl(23) = .true. ! .true. = Remesh for TDC + RSP2_use_mass_interp_face_values = .true. + RSP2_nz = 600 !150 + RSP2_nz_outer = 240 !40 + RSP2_T_anchor = 11d3 + RSP2_dq_1_factor = 2d0 + remesh_for_TDC_pulsations_log_core_zoning = .false. ! .false means do rsp style core + + + okay_to_remesh = .false. ! freeze mesh after initial remesh. + + ! control for excising core upon loading .mod file. + x_logical_ctrl(25) = .false. ! set true to remove core, or use starjob option above. + x_ctrl(14) = 2d6 ! desired core temperature to make cut at + + x_logical_ctrl(24) = .true. ! if true turn off remesh at the following model number + x_ctrl(12) = 200! model number to turn off remesh ( only if if okay_to_remesh = .true.) + + ! timestep + x_ctrl(13) = 100! model number to drop timestep + + ! TDC Pulsation timestepping. + x_ctrl(17) = 2d3 ! dt before pulse, seconds + x_ctrl(18) = 2d3 ! After a pulse begins, limit the timestep to this (in seconds). + +! GYRE set starting velocities, kick! +! kick when true and not restarting. + x_logical_ctrl(5) = .true. ! to turn on gyre kick + x_ctrl(11) = 200! kick model at this model number + + x_ctrl(4) = 0d0 ! fraction_1st_overtone (order 2) + x_ctrl(5) = 0d0 ! fraction_2nd_overtone (order 3) + x_ctrl(6) = 5d0 ! initial vsurf (kms) + + +! turn off burning and mixing, if evolving envelope model + eps_nuc_factor = 0 + non_nuc_neu_factor = 0 + dxdt_nuc_factor = 0 + mix_factor = 0 + + ! turn of wind during Pulsation + use_other_wind = .false. + + ! can optionally use QHSE form of dp/dm or dprad/dm form below. + use_dPrad_dm_form_of_T_gradient_eqn = .false. ! if false use QHSE form. + min_kap_for_dPrad_dm_eqn = 1d-5 + +! timesteps for saturation + + !dt_div_min_dr_div_cs_limit = 2d0 + dt_div_min_dr_div_cs_hard_limit = 100d0! i don't like hard limits ~ EbF + min_abs_u_div_cs_for_dt_div_min_dr_div_cs_limit = 0.8d0 + + ! have used these values to do run to saturation, but may not be necessary ~ Bill P. + dt_div_min_dr_div_cs_limit = 4d0!5d0!10d0 + min_q_for_dt_div_min_dr_div_cs_limit = 0.5d0 + max_q_for_dt_div_min_dr_div_cs_limit = 1d0 + min_k_for_dt_div_min_dr_div_cs_limit = 1 + min_abs_du_div_cs_for_dt_div_min_dr_div_cs_limit = 0.001d0 + + ! artificial viscosity if necessary, v_flag only + use_Pvsc_art_visc = .true. + Pvsc_cq = 4.0d0 + Pvsc_zsh = 0.1d0 + + ! velocity time centering for v_flag only. + steps_before_use_velocity_time_centering = 300 ! no v centering when commented + use_P_d_1_div_rho_form_of_work_when_time_centering_velocity = .true. + + include_P_in_velocity_time_centering = .true. ! set to false for u_flag + P_theta_for_velocity_time_centering = 0.5d0 + + include_L_in_velocity_time_centering = .true. + L_theta_for_velocity_time_centering = 0.5d0 + + set_rho_to_dm_div_dV = .false. ! only applies to v_flag + + + convergence_ignore_equL_residuals = .false. ! include T-gradient eqn in newton + + ! OUTER BC for TDC Pulsations + use_RSP_L_eqn_outer_BC = .true. + RSP2_Lsurf_factor = 0.5d0 + use_zero_Pgas_outer_BC = .true. + + ! for u_flag, can optionally use these. + use_compression_outer_BC = .false. + use_momentum_outer_BC = .false. + + ! Convection model + MLT_option = 'TDC' + include_mlt_corr_to_TDC = .false. ! true K. 1986 model, no mlt limiting + mixing_length_alpha = 1.5d0 + alpha_TDC_DAMP = 1d0 + alpha_TDC_DAMPR = 0d0 + alpha_TDC_PtdVdt = 0d0 + alpha_TDC_DAMPM = 0.25d0 + steps_before_use_TDC = 0 + mlt_Pturb_factor = 0d0 + alt_scale_height_flag = .false. ! ignore eggleton + TDC_num_innermost_cells_forced_nonturbulent = 2 + + + ! dev feature, modify g -> geff (with hydro corr) + make_mlt_hydrodynamic = .false. + + TDC_use_density_form_for_eddy_viscosity = .false. ! always true for u_flag. + + ! controls for shock capturing, relaxed for pulsations + ! main purpose is to force radiative in shock face + max_abs_du_div_cs_for_convection = 1d0 !1d-1 !0.03d0 + max_v_div_cs_for_convection = 1d2 + max_v_for_convection = 1d4 + + x_logical_ctrl(22) = .true. ! flag for in inlist_pulses + + + ! output + log_directory = 'LOGS_pulsation' + + + + + +! everything below is old and from testing. + + +!max_num_merge_cells = 2 +!max_num_merge_surface_cells = 5 ! necessary for surface + +!min_dq = 1d-7 +!max_center_cell_dq = 1d-1!1d-5!1d-7 +!max_surface_cell_dq = 1d-4 +!mesh_max_allowed_ratio = 2.5d0 !default +!min_surface_cell_dq = 5d-6!2d-6 ! 1d-6 might be safer. any higher and you risk touching the convective shell during a pulsation cycle which will make the surface go haywire. + +!mesh_delta_coeff_factor_smooth_iters = 3!20!50 ! 3 +!T_function1_weight = 40!110 +!P_function_weight = 10!50 ! need custom P function weight for logT < 4.5 +!log_tau_function_weight = 10!100 + +!max_dq = 5d-2 + +!xa_function_species(1) = 'he4' +!xa_function_weight(1) = 0 +!xa_function_param(1) = 1d-2 +!use_other_mesh_functions = .true. + + + +! if split merge amr hydro + ! restore_mesh_on_retry = .true. + ! num_steps_to_hold_mesh_after_retry = 5 +! if hydro use momentum bc? + + use_split_merge_amr = .false. +split_merge_amr_okay_to_split_1 = .false. + merge_amr_ignore_core_cells = .true. + merge_amr_logT_for_ignore_core_cells = 5d0 !1d99 + split_amr_ignore_core_cells = .true. + split_amr_logT_for_ignore_core_cells = 5d0 !1d99 + + mesh_delta_coeff = 1d0!0.8d0 ! RECOMMENDED 0.8d0 + !! this one is turned on in run_star_extras + ! true in pulses use_split_merge_amr = .false. + !split_merge_amr_log_zoning = .true. + split_merge_amr_logtau_zoning = .true. + !split_merge_amr_flipped_hybrid_zoning = .true. + !split_merge_amr_hybrid_zoning = .true. + + split_merge_amr_r_core_cm = 1d8 +split_merge_amr_nz_r_core = 1000!10000 + + + split_merge_amr_nz_baseline = 1000!6000 ! RECOMMENDED 6000 + split_merge_amr_MaxLong = 1.5d0!1.25d0 + split_merge_amr_MaxShort = 1.5d0!2.5d0 + + +! equal_split_density_amr = .false. + +! deprecated? trace_split_merge_amr = .false. + + + split_merge_amr_max_iters = 1000 ! setting this too high will smear pulsations. must restrict? + split_merge_amr_okay_to_split_nz = .false. +split_merge_amr_mesh_delta_coeff = 1.0!0.3 + + merge_amr_ignore_surface_cells = .false. + merge_amr_k_for_ignore_surface_cells = 20!1500!100 + + merge_amr_max_abs_du_div_cs = 0.03d0!0.5d0!5d-1!3d-2!0.03!0.05d0 + merge_amr_du_div_cs_limit_only_for_compression = .true. + split_merge_amr_avoid_repeated_remesh = .true. + merge_amr_inhibit_at_jumps =.false. ! reduce udnersize ratio for large jumps + + + + +report_solver_progress = .false. +report_ierr = .true. ! if true, produce terminal output when have some internal error + +/ ! end of controls namelist + +&pgstar + +Grid1_file_dir = 'png_pulsation' + + + ! axis limits -- to override system default selections + !HR_logT_min = 3.6 !-101d0 ! only used if /= -101d0 + !HR_logT_max = 3.75!-101d0 ! only used if /= -101d0 + !HR_logL_min = 3.85!-101d0 ! only used if /= -101d0 + !HR_logL_max = 3.6!-101d0 ! only used if /= -101d0 + + HR_file_interval = 50 ! output when `mod(model_number,HR_file_interval)==0` + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_pulses_header b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_pulses_header new file mode 100644 index 000000000..1bd50a6d1 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_pulses_header @@ -0,0 +1,56 @@ + +&star_job + + + read_extra_star_job_inlist(2) = .true. + extra_star_job_inlist_name(2) = 'inlist_pulses' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_common' + +/ ! end of star_job namelist + + +&eos + + read_extra_eos_inlist(2) = .true. + extra_eos_inlist_name(2) = 'inlist_pulses' + + read_extra_eos_inlist(1) = .true. + extra_eos_inlist_name(1) = 'inlist_common' + +/ ! end of eos namelist + + +&kap + + read_extra_kap_inlist(2) = .true. + extra_kap_inlist_name(2) = 'inlist_pulses' + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_common' + +/ ! end of kap namelist + + + +&controls + + read_extra_controls_inlist(2) = .true. + extra_controls_inlist_name(2)= 'inlist_pulses' + + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_common' + +/ ! end of controls namelist + + +&pgstar + + read_extra_pgstar_inlist(2) = .true. + extra_pgstar_inlist_name(2)= 'inlist_pulses' + + read_extra_pgstar_inlist(1) = .true. + extra_pgstar_inlist_name(1)= 'inlist_pgstar' + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_to_he_dep b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_to_he_dep new file mode 100644 index 000000000..4201d6dd8 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_to_he_dep @@ -0,0 +1,88 @@ + +&star_job + + create_pre_main_sequence_model = .true. + + save_model_when_terminate = .true. + save_model_filename = 'he_dep.mod' + required_termination_code_string = '' + + ! evolve model with hydrodynamics on from pre-ms + change_initial_v_flag = .true. + new_v_flag = .true. + + relax_to_this_tau_factor = 1d-3!-1 + dlogtau_factor = 0.1d0 + relax_tau_factor = .true. + +/ !end of star_job namelist + +&kap + +/ + +&eos + +/ + + +&controls + +! Convection model + mixing_length_alpha = 1.5d0 + +! stop when the center mass fraction of h1 drops below this limit +! xa_central_lower_limit_species(1) = 'he4' +! xa_central_lower_limit(1) = 1d-1 +!max_model_number = 1970 +! see run_star_extras for stopping condition +when_to_stop_rtol = 1d-3 +when_to_stop_atol = 1d-3 + + x_logical_ctrl(22) = .false. ! not in inlist_pulses + x_logical_ctrl(7) = .false. + + ! our wind implementation follows Brott+ 2011 + use_other_wind = .false. + +! wind model section: + cool_wind_full_on_T = 9.99d9 + hot_wind_full_on_T = 1d10 + cool_wind_RGB_scheme = 'Reimers' + cool_wind_AGB_scheme = 'Blocker' + RGB_to_AGB_wind_switch = 1d-4 + Reimers_scaling_factor = 0.5 ! 0.1 + Blocker_scaling_factor = 0.1 ! 0.5 crank up to 1.0 when the mass loss stops and/or timestep crashes + + +! solver controls + convergence_ignore_equL_residuals = .true. ! for pre-ms +! use_gold2_tolerances = .false. ! if you need to get through the he_flash + + + +! output +log_directory = 'LOGS_evolution' + +/ ! end of controls namelist + +&pgstar + +Grid1_file_dir = 'png_evolution' +History_Track1_file_flag = .false. +History_Track2_file_flag = .false. + + pgstar_interval = 10 + + History_Panels1_xaxis_name = 'model_number' + History_Panels1_max_width = -1 + + Profile_Panels3_xaxis_name = 'mass' + Profile_Panels3_xaxis_reversed = .false. + + TRho_Profile_xmin = -12.0 + TRho_Profile_xmax = 7d0!5d0!10.0 + TRho_Profile_ymin = 2.5 + TRho_Profile_ymax = 9d0!8.5d0!10.0 + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_to_he_dep_header b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_to_he_dep_header new file mode 100644 index 000000000..21ebfb933 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/inlist_to_he_dep_header @@ -0,0 +1,55 @@ + +&star_job + + + read_extra_star_job_inlist(2) = .true. + extra_star_job_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_common' + +/ ! end of star_job namelist + + +&eos + + read_extra_eos_inlist(2) = .true. + extra_eos_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_eos_inlist(1) = .true. + extra_eos_inlist_name(1) = 'inlist_common' +/ ! end of eos namelist + + +&kap + + read_extra_kap_inlist(2) = .true. + extra_kap_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_common' + +/ ! end of kap namelist + + + +&controls + + read_extra_controls_inlist(2) = .true. + extra_controls_inlist_name(2)= 'inlist_to_he_dep' + + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_common' + +/ ! end of controls namelist + + +&pgstar + + read_extra_pgstar_inlist(2) = .true. + extra_pgstar_inlist_name(2)= 'inlist_to_he_dep' + + read_extra_pgstar_inlist(1) = .true. + extra_pgstar_inlist_name(1)= 'inlist_pgstar' + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/make/makefile b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/make/makefile new file mode 100644 index 000000000..f2017faed --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/make/makefile @@ -0,0 +1,5 @@ + + +STAR = star + +include $(MESA_DIR)/star/work_standard_makefile diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/mk b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/mk new file mode 100755 index 000000000..aec7a5195 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/mk @@ -0,0 +1,13 @@ +#!/bin/bash + +function check_okay { + if [ $? -ne 0 ] + then + echo + echo "FAILED" + echo + exit 1 + fi +} + +cd make; make; check_okay diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/profile_columns.list b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/profile_columns.list new file mode 100644 index 000000000..1078b36b2 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/profile_columns.list @@ -0,0 +1,965 @@ +! profile_columns.list -- determines the contents of star model profiles +! you can use a non-standard version by setting profile_columns_file in your inlist + +! units are cgs unless otherwise noted. + +! reorder the following names as desired to reorder columns. +! comment out the name to omit a column (fewer columns => less IO => faster running). +! remove '!' to restore a column. + +! if you have a situation where you want a non-standard set of columns, +! make a copy of this file, edit as desired, and give the new filename in your inlist +! as profile_columns_file. if you are just adding columns, you can 'include' this file, +! and just list the additions in your file. note: to include the standard default +! version, use include '' -- the 0 length string means include the default file. + +! if you need to have something added to the list of options, let me know.... + +! the first few lines of the profile contain general info about the model. +! for completeness, those items are described at the end of this file. + + +! note: you can include another list by doing +! include 'filename' +! include '' means include the default standard list file + + +! the following lines of the profile contain info for 1 zone per row, surface to center. + +! minimal set of enabled columns: + + zone ! numbers start with 1 at the surface + mass ! m/Msun. mass coordinate of outer boundary of cell. + logR ! log10(radius/Rsun) at outer boundary of zone + logT ! log10(temperature) at center of zone + logRho ! log10(density) at center of zone + logP ! log10(pressure) at center of zone + x_mass_fraction_H + y_mass_fraction_He + z_mass_fraction_metals + + +! everything below this line is deactivated + + +!# Structure + !logM ! log10(m/Msun) + !log_mass + !dm ! cell mass (grams) + !dm_bar ! boundary mass (grams) average of adjacent dm's + logdq ! log10(dq) + !log_dq + dq_ratio ! dq(k-1)/dq(k) + q ! fraction of star mass interior to outer boundary of this zone + log_q ! log10(q) + !xq + + !grav ! gravitational acceleration (cm sec^2) + !log_g ! log10 gravitational acceleration (cm sec^2) + !g_div_r ! grav/radius (sec^2) + !r_div_g ! radius/grav (sec^-2) + !cgrav_factor ! = cgrav(k)/standard_cgrav + vel_km_per_s ! velocity at outer boundary of zone (km/s) -- 0 if no velocity variable + + radius ! radius at outer boundary of zone (in Rsun units) + !radius_cm ! radius at outer boundary of zone (in centimeters) + !radius_km ! radius at outer boundary of zone (in kilometers) + !logR_cm ! log10 radius at outer boundary of zone (in centimeters) + !rmid ! radius at center by mass of zone (in Rsun units) + !r_div_R ! fraction of total radius + + velocity ! velocity at outer boundary of zone (cm/s) -- 0 if no velocity variable + !v_div_r ! velocity divided by radius + !v_times_t_div_r + !rho_times_r3 ! at face + !log_rho_times_r3 ! at face + !scale_height ! in Rsun units + pressure_scale_height ! in Rsun units + + !m_div_r ! gm/cm + !dmbar_m_div_r + !log_dmbar_m_div_r + !mass_grams ! mass coordinate of outer boundary of cell in grams + !mmid ! mass at midpoint of cell (average of mass coords of the cell boundaries) Msun units. + + !m_grav ! total enclosed gravitational mass. Msun units. + !m_grav_div_m_baryonic ! mass_gravitational/mass at cell boundary + !mass_correction_factor ! dm_gravitational/dm (dm is baryonic mass of cell) + + !xm ! mass exterior to point (Msun units) + dq ! mass of zone as a fraction of total star mass + !logxq ! log10(1-q) + !logxm ! log10(xm) + + !xr ! radial distance from point to surface (Rsun) + !xr_cm ! radial distance from point to surface (cm) + !xr_div_R ! radial distance from point to surface in units of star radius + !log_xr ! log10 radial distance from point to surface (Rsun) + !log_xr_cm ! log10 radial distance from point to surface (cm) + !log_xr_div_R ! log10 radial distance from point to surface in units of star radius + + !dr ! r(outer edge) - r(inner edge); radial extent of cell in cm. + !log_dr ! log10 cell width (cm) + !dv ! v(inner edge) - v(outer edge); rate at which delta_r is shrinking (cm/sec). + + dt_dv_div_dr ! dt*dv/dr; need to have this << 1 for every cell + !dr_div_R ! cell width divided by star R + !log_dr_div_R ! log10 cell width divided by star R + !dr_div_rmid ! cell width divided by rmid + !log_dr_div_rmid ! log(dr_div_rmid) + + !dr_div_cs ! cell sound crossing time (sec) + !log_dr_div_cs ! log10 cell sound crossing time (sec) + dr_div_cs_yr ! cell sound crossing time (years) + !log_dr_div_cs_yr ! log10 cell sound crossing time (years) + + !acoustic_radius ! sound time from center to outer cell boundary (sec) + !log_acoustic_radius ! log10(acoustic_radius) (sec) + !acoustic_depth ! sound time from surface to outer cell boundary (sec) + !log_acoustic_depth ! log10(acoustic_depth) (sec) + !acoustic_r_div_R_phot + + !cell_collapse_time ! only set if doing explicit hydro + ! time (seconds) for cell inner edge to catch cell outer edge at current velocities + ! 0 if distance between inner and outer is increasing + !log_cell_collapse_time ! log of cell_collapse_time + + !compression_gradient + + + +!# Thermodynamics + !temperature ! temperature at center of zone + !logT_face ! log10(temperature) at outer boundary of zone + !logT_bb ! log10(black body temperature) at outer boundary of zone + !logT_face_div_logT_bb + + energy ! internal energy (ergs/g) + !logE ! log10(specific internal energy) at center of zone + !rho ! density + !density ! rho + + entropy ! specific entropy divided by (avo*kerg) + !logS ! log10(specific entropy) + !logS_per_baryon ! log10(specific entropy per baryon / kerg) + + !pressure ! total pressure at center of zone (pgas + prad) + !prad ! radiation pressure at center of zone + !pgas ! gas pressure at center of zone (electrons and ions) + logPgas ! log10(pgas) + pgas_div_ptotal ! pgas/pressure + + eta ! electron degeneracy parameter (eta >> 1 for significant degeneracy) + mu ! mean molecular weight per gas particle (ions + free electrons) + + grada ! dlnT_dlnP at constant S + !dE_dRho ! at constant T + !cv ! specific heat at constant volume + !cp ! specific heat at constant total pressure + + !log_CpT + gamma1 ! dlnP_dlnRho at constant S + !gamma3 ! gamma3 - 1 = dlnT_dlnRho at constant S + !gam ! plasma interaction parameter (> 160 or so means starting crystallization) + free_e ! free_e is mean number of free electrons per nucleon + !logfree_e ! log10(free_e), free_e is mean number of free electrons per nucleon + !chiRho ! dlnP_dlnRho at constant T + !chiT ! dlnP_dlnT at constant Rho + + csound ! sound speed + log_csound + !csound_face ! sound speed (was previously called csound_at_face) + !cs_at_cell_bdy ! sound speed at cell boundary (csound is at cell center) + !v_div_cs ! velocity divided by sound speed + v_div_csound ! velocity divided by sound speed + !div_v + + !thermal_time_to_surface ! in seconds + !log_thermal_time_to_surface + !t_rad + !log_t_rad + !log_t_sound + !log_t_thermal + + !eos_phase + !eos_frac_OPAL_SCVH + !eos_frac_HELM + !eos_frac_Skye + !eos_frac_PC + !eos_frac_FreeEOS + !eos_frac_CMS + !eos_frac_ideal + + !pgas_div_p + !prad_div_pgas + !prad_div_pgas_div_L_div_Ledd + !pressure_scale_height_cm + + !eps_grav_composition_term + eps_grav_plus_eps_mdot + + !chiRho_for_partials + !chiT_for_partials + !rel_diff_chiRho_for_partials + !rel_diff_chiT_for_partials + + !latent_ddlnRho + !latent_ddlnT + + !log_P_face + !log_Ptrb + !log_cp_T_div_t_sound + + !QQ + + +!# Mass accretion + eps_grav ! -T*ds/dt (negative for expansion) + !log_abs_eps_grav_dm_div_L + !log_abs_v ! log10(abs(velocity)) (cm/s) + !log_mdot_cs + !log_mdot_v + eps_mdot + !env_eps_grav + !xm_div_delta_m + !log_xm_div_delta_m + + +!# Nuclear energy generation + !signed_log_eps_grav ! sign(eps_grav)*log10(max(1,abs(eps_grav))) + !signed_log_eps_nuc + net_nuclear_energy ! erg/gm/s from nuclear reactions minus all neutrino losses + ! The value plotted is net_nuclear_energy = sign(val)*log10(max(1,abs(val))) + ! where val = net nuclear energy minus all neutrino losses. + net_energy ! net_energy + eps_grav. + ! The value plotted is net_energy = sign(val)*log10(max(1,abs(val))) + ! where val = net nuclear energy plus eps_grav minus all neutrino losses. + eps_nuc_plus_nuc_neu + !eps_nuc_minus_non_nuc_neu + !eps_nuc_start + + eps_nuc ! ergs/g/sec from nuclear reactions (including losses to reaction neutrinos) + !log_abs_eps_nuc + !d_lnepsnuc_dlnd + !d_epsnuc_dlnd + !deps_dlnd_face + ! (was previously called deps_dlnd_at_face) + !d_lnepsnuc_dlnT + !d_epsnuc_dlnT + !deps_dlnT_face + ! (was previously called deps_dlnT_at_face) + !eps_nuc_neu_total ! erg/gm/sec as neutrinos from nuclear reactions + + non_nuc_neu ! non-nuclear-reaction neutrino losses + !nonnucneu_plas ! plasmon neutrinos (for collective reactions like gamma_plasmon => nu_e + nubar_e) + !nonnucneu_brem ! bremsstrahlung (for reactions like e- + (z,a) => e- + (z,a) + nu + nubar) + !nonnucneu_phot ! photon neutrinos (for reactions like e- + gamma => e- + nu_e + nubar_e) + !nonnucneu_pair ! pair production (for reactions like e+ + e- => nu_e + nubar_e) + !nonnucneu_reco ! recombination neutrinos (for reactions like e- (continuum) => e- (bound) + nu_e + nubar_e) + + ! ergs/g/sec for reaction categories + add_reaction_categories ! this adds all the reaction categories + ! NOTE: you can list specific categories by giving their names (from chem_def) + pp + cno + tri_alpha + !c_alpha + !n_alpha + !o_alpha + !ne_alpha + !na_alpha + !mg_alpha + !si_alpha + !s_alpha + !ar_alpha + !ca_alpha + !ti_alpha + !fe_co_ni + !c12_c12 + !c12_o16 + !o16_o16 + !photo + !pnhe4 + !other + + ! adds columns for all of the reactions that are in the current net + ! Note that if using op_split_burn=.true. then zones which have been split will report 0 for thier rates + !add_raw_rates ! raw reaction rates, reactions/second + !add_screened_rates ! screened reaction rates reactions/second + !add_eps_nuc_rates ! Nuclear energy (minus neutrino losses) released erg/s + !add_eps_neu_rates ! Neutrino losses erg/s + + ! individual reactions (as many as desired) + ! use list_net_reactions = .true. in star_job to list all reactions in the current net + ! reactions/second + !raw_rate r_h1_h1_ec_h2 + !raw_rate r_h1_h1_wk_h2 + + !burn_num_iters ! Number of split_burn iterations taken + !burn_avg_epsnuc + !log_burn_avg_epsnuc + +!# Composition + !x_mass_fraction_H + !y_mass_fraction_He + !z_mass_fraction_metals + abar ! average atomic weight (g/mole) + !zbar ! average charge + !z2bar ! average charge^2 + ye ! average charge per baryon = proton fraction + + x ! hydrogen mass fraction + !log_x + y ! helium mass fraction + !log_y + z ! metallicity + !log_z ! metallicity + + add_abundances ! this adds all of the isos that are in the current net + ! NOTE: you can list specific isotopes by giving their names (from chem_def) + !h1 + !he3 + !he4 + !c12 + !n14 + !o16 + + !add_log_abundances ! this adds log10 of all of the isos that are in the current net + ! NOTE: you can list specific isotopes by giving their names (from chem_def) + !log h1 + !log he3 + !log he4 + !log c12 + !log n14 + !log o16 + + ! log concentration of species + ! concentration = number density / number density of electrons + ! Ci = (Xi/Ai) / sum(Zi*Xi/Ai) [see Thoul et al, ApJ 421:828-842, 1994] + !log_concentration h1 + !log_concentration he4 + + + ! typical charge for given species + ! (used by diffusion) + !typical_charge he4 + !typical_charge c12 + !typical_charge fe52 + + ! ionization state for given species + ! (same as typical charge, except that it's unsmoothed) + !ionization he4 + !ionization c12 + !ionization fe52 + + !cno_div_z ! abundance of c12, n14, and o16 as a fraction of total z + + + + +!# Opacity + !opacity ! opacity measured at center of zone + log_opacity ! log10(opacity) + !dkap_dlnrho_face ! partial derivative of opacity wrt. ln rho (at T=const) at outer edge of cell + ! (was previously called dkap_dlnrho_at_face) + !dkap_dlnT_face ! partial derivative of opacity wrt. ln T (at rho=const) at outer edge of cell + ! (was previously called dkap_dlnT_at_face) + !kap_frac_lowT ! fraction of opacity from lowT tables + !kap_frac_highT ! fraction of opacity from highT tables + !kap_frac_Type2 ! fraction of opacity from Type2 tables + !kap_frac_Compton ! fraction of opacity from Compton_Opacity + !kap_frac_op_mono ! fraction of opacity from OP mono + + !log_kap + !log_kap_times_factor + + !log_c_div_tau + !xtau + !xlogtau + !logtau_sub_xlogtau + +!# Luminosity + luminosity ! luminosity at outer boundary of zone (in Lsun units) + !logL ! log10(max(1d-2,L/Lsun)) + !log_Lrad + log_Ledd ! log10(Leddington/Lsun) -- local Ledd, 4 pi clight G m / kap + !log_L_div_Ledd ! log10(max(1d-12,L/Leddington)) + log_Lrad_div_Ledd + !log_Lrad_div_L + !signed_log_power ! sign(L)*log10(max(1,abs(L))) + + !lum_adv + lum_conv + !lum_conv_MLT + lum_div_Ledd + !lum_erg_s + !lum_plus_lum_adv + lum_rad + + !log_L_div_CpTMdot + !log_abs_lum_erg_s + + !L + !Lc + Lc_div_L + !Lr + !Lr_div_L + !Lt + !Lt_div_L + +!# Energetics + !total_energy ! specific total energy of cell (ergs/g). internal+potential+kinetic+rotation. + !cell_specific_IE + !cell_specific_KE + !cell_IE_div_IE_plus_KE + !cell_KE_div_IE_plus_KE + + !cell_ie_div_star_ie + !cell_internal_energy_fraction + !cell_internal_energy_fraction_start + !cell_specific_PE + + !log_cell_ie_div_star_ie + !log_cell_specific_IE + + ergs_eps_grav_plus_eps_mdot + ergs_error + !ergs_error_integral + ergs_mdot + !ergs_rel_error_integral + !dm_eps_grav + + !dE + + !etrb + log_etrb + !extra_grav + log_rel_E_err + + !total_energy_sign + +!# Convection + !mlt_mixing_length ! mixing length for mlt (cm) + mlt_mixing_type ! value returned by mlt + mlt_Pturb + !alpha_mlt + + conv_vel ! convection velocity (cm/sec) + log_conv_vel ! log10 convection velocity (cm/sec) + + !conv_L_div_L + log_conv_L_div_L + !lum_conv_div_lum_rad + !lum_rad_div_L_Edd + !lum_conv_div_lum_Edd + lum_conv_div_L + lum_rad_div_L + Frad_div_cUrad ! Frad/(C*Urad), must be < 1 to not violate c. + !flux_limit_lambda + !flux_limit_R + !lum_rad_div_L_Edd_sub_fourPrad_div_PchiT ! density increases outward if this is > 0 + ! see Joss, Salpeter, and Ostriker, "Critical Luminosity", ApJ 181:429-438, 1973. + + gradT ! mlt value for required temperature gradient dlnT/dlnP + + gradr ! dlnT/dlnP required for purely radiative transport + !grad_temperature ! smoothed dlnT/dlnP at cell boundary + !grad_density ! smoothed dlnRho/dlnP at cell boundary + + gradL ! gradient for Ledoux criterion for convection + !sch_stable ! 1 if grada > gradr, 0 otherwise + !ledoux_stable ! 1 if gradL > gradr, 0 otherwise + + !grada_sub_gradT + gradT_sub_grada ! gradT-grada at cell boundary + gradT_div_grada ! gradT/grada at cell boundary + + !gradr_sub_gradT + !gradT_sub_gradr ! gradT-gradr at cell boundary + !gradT_div_gradr ! gradT/gradr at cell boundary + + !log_gradT_div_gradr ! log10 gradT/gradr at cell boundary + log_mlt_Gamma ! convective efficiency + conv_vel_div_csound ! convection velocity divided by sound speed + !conv_vel_div_L_vel ! L_vel is velocity needed to carry L by convection; L = 4*pi*r^2*rho*vel**3 + log_mlt_D_mix ! log10 diffusion coefficient for mixing from mlt (cm^2/sec) + + !gradr_div_grada ! gradr/grada_face; > 1 => Schwarzschild unstable for convection + !gradr_sub_grada ! gradr - grada_face; > 0 => Schwarzschild unstable for convection + + !gradL_sub_gradr + !gradP_div_rho + !gradT_excess_effect + !gradT_rel_err + !gradT_sub_a + !grada_face + !grada_sub_gradr + !diff_grads + !log_diff_grads + + !mlt_D + !mlt_Gamma + mlt_Y_face + !mlt_Zeta + !mlt_gradT + !mlt_log_abs_Y + !mlt_vc + !log_mlt_vc + !dvc_dt_TDC_div_g + + !superad_reduction_factor + !conv_vel_div_mlt_vc + + !log_Lconv + !log_Lconv_div_L + +!# Mixing + mixing_type ! mixing types are defined in mesa/const/public/const_def + log_D_mix ! log10 diffusion coefficient for mixing in units of cm^2/second (Eulerian) + !log_D_mix_non_rotation + !log_D_mix_rotation + + log_D_conv ! D_mix for regions where mix_type = convective_mixing + !log_D_leftover ! D_mix for regions where mix_type = leftover_convective_mixing + log_D_semi ! D_mix for regions where mix_type = semiconvective_mixing + log_D_ovr ! D_mix for regions where mix_type = overshoot_mixing + log_D_thrm ! D_mix for regions where mix_type = thermohaline_mixing + !log_D_minimum ! D_mix for regions where mix_type = minimum_mixing + !log_D_rayleigh_taylor ! D_mix for regions where mix_type = rayleigh_taylor_mixing + !log_D_anon ! D_mix for regions where mix_type = anonymous_mixing + !log_D_omega + + !log_sig_mix ! sig(k) is mixing flow across face k in (gm sec^1) + ! sig(k) = D_mix*(4*pi*r(k)**2*rho_face)**2/dmavg + + !dominant_isoA_for_thermohaline + !dominant_isoZ_for_thermohaline + !gradL_composition_term + + !mix_type + + + +!# Optical Depth + tau ! optical depth + !log_column_depth ! log10 column depth, exterior mass / area (g cm^-2) + !log_radial_depth ! log10 radial distance to surface (cm) + !logtau ! log10(optical depth) at cell face + !tau_eff ! tau that gives the local P == P_atm if this location at surface + ! tau_eff = kap*(P/g - Pextra_factor*(L/M)/(6*pi*clight*cgrav)) + !tau_eff_div_tau + + + +!# Rotation + omega ! angular velocity = j_rot/i_rot + !log_omega + log_j_rot + !log_J_div_M53 ! J is j*1e-15 integrated from center; M53 is m^(5/3) + log_J_inside ! J_inside is j_rot integrated from center + !shear ! -dlnomega/dlnR + !log_abs_shear ! log10(abs(dlnomega/dlnR)) + !richardson_number + i_rot ! specific moment of inertia at cell boundary + !j_rot ! specific angular momentum at cell boundary + !v_rot ! rotation velocity at cell boundary (km/sec) + !w_div_w_crit_roche !ratio of rotational velocity to keplerian at the equator + !without the contribution from the Eddington factor + fp_rot ! rotation factor for pressure + ft_rot ! rotation factor for temperature + !ft_rot_div_fp_rot ! gradr factor + + !log_am_nu_non_rot ! log10(am_nu_non_rot) + !log_am_nu_rot ! log10(am_nu_rot) + log_am_nu ! log10(am_nu_non_rot + am_nu_rot) + + !r_polar ! (Rsun) + !log_r_polar ! log10 (Rsun) + !r_equatorial ! (Rsun) + !log_r_equatorial ! log10 (Rsun) + !r_e_div_r_p ! equatorial/r_polar + !omega_crit ! breakup angular velocity = sqrt(G M / equatorial^3) + !omega_div_omega_crit + + !am_log_nu_omega ! for diffusion of omega + !am_log_nu_j ! for diffusion of angular momentum + + !am_log_nu_rot ! diffusion of angular momentum driven by rotation + !am_log_nu_non_rot ! diffusion driven by other sources, e.g. convection + + !am_log_sig_omega ! for diffusion of omega + !am_log_sig_j ! for diffusion of angular momentum + !am_log_sig ! == am_log_sig_omega + + !am_log_D_visc ! diffusion coeff for kinematic viscosity + !am_log_D_DSI ! diffusion coeff for dynamical shear instability + !am_log_D_SH ! diffusion coeff for Solberg-Hoiland instability + !am_log_D_SSI ! diffusion coeff for secular shear instability + !am_log_D_ES ! diffusion coeff for Eddington-Sweet circulation + !am_log_D_GSF ! diffusion coeff for Goldreich-Schubert-Fricke instability + !am_log_D_ST ! Spruit dynamo mixing diffusivity + !am_log_nu_ST ! Spruit dynamo effective viscosity + + !dynamo_log_B_r ! (Gauss) + !dynamo_log_B_phi ! (Gauss) + + !am_domega_dlnR + !log_abs_dlnR_domega + + !w_div_w_crit_roche2 + + +!# Diffusion + ! electric field from element diffusion calculation + !e_field + !log_e_field + + ! gravitational field from element diffusion calculation + !g_field_element_diffusion + !log_g_field_element_diffusion + + !eE_div_mg_element_diffusion + !log_eE_div_mg_element_diffusion + + ! element diffusion velocity for species + !edv h1 + !edv he4 + !edv o16 + + ! Energy generated by Ne22 sedimentation. + !eps_WD_sedimentation + !log_eps_WD_sedimentation + + !eps_diffusion + !log_eps_diffusion + + !diffusion_D h1 ! self diffusion coeff + !diffusion_dX h1 ! change in h1 mass fraction from diffusion + !diffusion_dX he4 ! change in he4 mass fraction from diffusion + !diffusion_dX n20 ! change in n20 mass fraction from diffusion + + !v_rad h1 ! velocity from radiative levitation + !v_rad he4 ! velocity from radiative levitation + !v_rad ne20 ! velocity from radiative levitation + + !log_g_rad h1 ! log10 acceleration from radiative levitation + !log_g_rad he4 ! log10 acceleration from radiative levitation + !log_g_rad ne20 ! log10 acceleration from radiative levitation + +!# Phase Separation + !eps_phase_separation + +!# Oscillations + brunt_N2 ! brunt-vaisala frequency squared + brunt_N2_structure_term + brunt_N2_composition_term + !log_brunt_N2_structure_term + !log_brunt_N2_composition_term + !brunt_A ! = N^2*r/g + !brunt_A_div_x2 ! x = r(k)/r(1) + !brunt_N2_dimensionless ! N2 in units of 3GM/R^3 + !brunt_N_dimensionless ! N in units of sqrt(3GM/R^3) + !brunt_frequency ! cycles per day + !brunt_N ! sqrt(abs(brunt_N2)) + !log_brunt_N ! log10(brunt_N) + !log_brunt_N2 ! log10(brunt_N2) + !log_brunt_N2_dimensionless ! log10(brunt_N2_dimensionless) + + !brunt_B ! smoothed numerical difference + !brunt_nonB ! = grada - gradT + !log_brunt_B ! smoothed numerical difference + !log_brunt_nonB ! = grada - gradT + + !sign_brunt_N2 ! sign of brunt_N2 (+1 for Ledoux stable; -1 for Ledoux unstable) + !brunt_nu ! brunt_frequency in microHz + !log_brunt_nu ! brunt_frequency in microHz + + !lamb_S ! lamb frequency for l=1: S = sqrt(2)*csound/r (rad/s) + !lamb_S2 ! squared lamb frequency for l=1: S2 = 2*(csound/r)^2 (rad^2/s^2) + + !lamb_Sl1 ! lamb frequency for l=1; = sqrt(2)*csound/r (microHz) + !lamb_Sl2 ! lamb frequency for l=2; = sqrt(6)*csound/r (microHz) + !lamb_Sl3 ! lamb frequency for l=3; = sqrt(12)*csound/r (microHz) + !lamb_Sl10 ! lamb frequency for l=10; = sqrt(110)*csound/r (microHz) + + !log_lamb_Sl1 ! log10(lamb_Sl1) + !log_lamb_Sl2 ! log10(lamb_Sl2) + !log_lamb_Sl3 ! log10(lamb_Sl3) + !log_lamb_Sl10 ! log10(lamb_Sl10) + + !brunt_N_div_r_integral ! integral from center of N*dr/r + !k_r_integral ! integral from center of k_r*dr + !brunt_N2_sub_omega2 + !sl2_sub_omega2 + + +!# RSP + + !rsp_Chi ! dlnP_dlnRho + !rsp_Et ! Specific turbulent energy + !rsp_logEt ! Log specific turbulent energy + !rsp_erad ! Specific internal (radiative) energy + !rsp_log_erad ! Log specific internal (radiative) energy + !rsp_Hp_face ! Pressure scale height at cell face + !rsp_Lc ! Convective luminosity + !rsp_Lc_div_L ! Convective luminosity div total luminosity + !rsp_Lr ! Radiative luminosity + !rsp_Lr_div_L ! Radiative luminosity div total luminosity + !rsp_Lt ! Turbulent luminosity + !rsp_Lt_div_L ! Turbulent luminosity div total luminosity + !rsp_Pt ! Turbulent pressure, p_t, see Table 1 in MESA5 + !rsp_Uq ! Viscous momentum transfer rate, U_q, see Table 1 in MESA5 + !rsp_Eq ! Viscous energy transfer rate, epsilon_q, see Table 1 in MESA5 + !rsp_Pvsc ! Artificial viscosity, p_av, see Table 1 in MESA5 + !rsp_gradT ! Temperature gradient + !rsp_Y_face ! Superadiabatic gradient at cell face, Y_sag, see Table 1 in MESA5 + !rsp_damp ! Turbulent dissipation, D, see Table 1 in MESA5 + !rsp_dampR ! Radiative cooling, D_r, see Table 1 in MESA5 + !rsp_sink ! Sum of turbulent dissipation and radiative cooling terms + !rsp_src ! Source function, S, see Table 1 in MESA5 + !rsp_src_snk ! Convective coupling, C, see Table 1 in MESA5 + !rsp_heat_exchange_timescale ! 1d0/(clight * opacity * density) + !rsp_log_heat_exchange_timescale + !rsp_log_dt_div_heat_exchange_timescale ! Ratio of time step to heat exchange timescale + !w + !log_w + + !COUPL + !DAMP + !DAMPR + !SOURCE + !Chi + Eq + !Hp_face + !PII_face + !Ptrb + Pvsc + Uq + !Y_face + +!# RTI + + !RTI_du_diffusion_kick + !alpha_RTI + !boost_for_eta_RTI + !dedt_RTI + !dudt_RTI + !eta_RTI + !log_alpha_RTI + !log_boost_for_eta_RTI + !log_eta_RTI + !log_etamid_RTI + !log_lambda_RTI_div_Hrho + !log_sig_RTI + !log_sigmid_RTI + !log_source_RTI + !log_source_minus_alpha_RTI + !log_source_plus_alpha_RTI + !source_minus_alpha_RTI + !source_plus_alpha_RTI + !lambda_RTI + +!# Hydrodynamics + + + !v + !v_div_v_escape + !v_div_vesc + !v_kms + !log_v_escape + + !u + !u_face + + !P_face + + +!# Extras + !extra_heat + !extra_L ! extra_heat integrated from center (Lsun) + !log_extra_L ! log10 integrated from center (Lsun) + !log_irradiation_heat + + !extra_jdot ! set in other_torque routine + !extra_omegadot ! set in other_torque routine + + !extra_opacity_factor ! set in other_opacity_factor routine + + ! diffusion factor profile for species, set in other_diffusion_factor routine + !extra_diffusion_factor h1 + !extra_diffusion_factor he4 + !extra_diffusion_factor o16 + + + +!# Miscellaneous + + !dlog_h1_dlogP ! (log(h1(k)) - log(h1(k-1)))/(log(P(k)) - log(P(k-1))) + !dlog_he3_dlogP + !dlog_he4_dlogP + !dlog_c12_dlogP + !dlog_c13_dlogP + !dlog_n14_dlogP + !dlog_o16_dlogP + !dlog_ne20_dlogP + !dlog_mg24_dlogP + !dlog_si28_dlogP + + !dlog_pp_dlogP + !dlog_cno_dlogP + !dlog_3alf_dlogP + + !dlog_burn_c_dlogP + !dlog_burn_n_dlogP + !dlog_burn_o_dlogP + + !dlog_burn_ne_dlogP + !dlog_burn_na_dlogP + !dlog_burn_mg_dlogP + + !dlog_cc_dlogP + !dlog_co_dlogP + !dlog_oo_dlogP + + !dlog_burn_si_dlogP + !dlog_burn_s_dlogP + !dlog_burn_ar_dlogP + !dlog_burn_ca_dlogP + !dlog_burn_ti_dlogP + !dlog_burn_cr_dlogP + !dlog_burn_fe_dlogP + + !dlog_pnhe4_dlogP + !dlog_photo_dlogP + !dlog_other_dlogP + + !logR_kap ! logR = logRho - 3*logT + 18 ; used in kap tables + !logW ! logW = logPgas - 4*logT + !logQ ! logQ = logRho - 2*logT + 12 + !logV ! logV = logRho - 0.7*logE + 20 + + !log_CpT_absMdot_div_L ! log10(s% Cp(k)*s% T(k)*abs(s% mstar_dot)/s% L(k)) + + !delta_r ! r - r_start, change during step + !delta_L ! L - L_start, change during step + !delta_cell_vol ! cell_vol - cell_vol_start, change during step + !delta_entropy ! entropy - entropy_start, change during step (does not include effects of diffusion) + !delta_T ! T - T_start, change during step + !delta_rho ! rho - rho_start, change during step + !delta_eps_nuc ! eps_nuc - eps_nuc_start, change during step + !delta_mu ! mu - mu_start, change during step + + !zFe ! mass fraction of "Fe" = Fe+Co+Ni + !log_zFe + !dPdr_dRhodr_info + !log_sig_raw_mix + + !d_u_div_rmid + !d_u_div_rmid_start + !d_v_div_r_dm + !d_v_div_r_dr + + !dlnP_dlnR + !dlnRho_dlnR + !dlnRho_dr + !dlnX_dr + !dlnY_dr + !dlogR + !dPdr_div_grav + !dPdr_info + !dRhodr_info + !dRstar_div_dr + !dr_ratio + !dm_eps_grav + !dr_ratio + !dt_cs_div_dr + !dt_div_tau_conv + !dt_times_conv_vel_div_mixing_length + log_dt_cs_div_dr + !log_dt_div_tau_conv + !log_dt_times_conv_vel_div_mixing_length + !log_du_kick_div_du + !du + !dvdt_dPdm + !dvdt_grav + + !tau_conv + !tau_cool + !tau_epsnuc + !tau_qhse + + !max_abs_xa_corr + + !tdc_num_iters + + !k + + +! the first few lines of the profile contain general info about the model. +! for completeness, those items are described here. + + ! initial mass and Z + ! initial_mass + ! initial_z + ! general properties of the current state + ! model_number + ! num_zones + ! star_age + ! time_step + ! properties at the photosphere + ! Teff + ! photosphere_L + ! photosphere_r + ! properties at the outermost zone of the model + ! log_surface_L + ! log_surface_radius + ! log_surface_temp + ! properties near the center of the model + ! log_center_temp + ! log_center_density + ! log_center_P + ! center_eta + ! abundances near the center + ! center_h1 + ! center_he3 + ! center_he4 + ! center_c12 + ! center_n14 + ! center_o16 + ! center_ne20 + ! information about total mass + ! star_mass + ! star_mdot + ! star_mass_h1 + ! star_mass_he3 + ! star_mass_he4 + ! star_mass_c12 + ! star_mass_n14 + ! star_mass_o16 + ! star_mass_ne20 + ! locations of abundance transitions + ! he_core_mass + ! c_core_mass + ! o_core_mass + ! si_core_mass + ! fe_core_mass + ! location of optical depths 10 and 100 + ! tau10_mass + ! tau10_radius + ! tau100_mass + ! tau100_radius + ! time scales + ! dynamic_time + ! kh_timescale + ! nuc_timescale + ! various kinds of total power + ! power_nuc_burn + ! power_h_burn + ! power_he_burn + ! power_neu + ! a few control parameter values + ! h1_boundary_limit + ! he4_boundary_limit + ! c12_boundary_limit + ! burn_min1 + ! burn_min2 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re new file mode 100755 index 000000000..c9ef26f96 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re @@ -0,0 +1,33 @@ +#!/bin/bash + +shopt -u expand_aliases + +photo_directory=photos + +function most_recent_photo { + ls -tp "$photo_directory" | grep -v / | head -1 +} + +if [ $# -eq 0 ] +then + photo=$(most_recent_photo) +else + photo=$1 +fi + +if [ -z "$photo" ] || ! [ -f "$photo_directory/$photo" ] +then + echo "specified photo ($photo) does not exist" + exit 1 +fi + +echo "restart from $photo" +if ! cp "$photo_directory/$photo" restart_photo +then + echo "failed to copy photo ($photo)" + exit 1 +fi + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re_all b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re_all new file mode 100755 index 000000000..ebf6c806f --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re_all @@ -0,0 +1,2 @@ +#./re_nomodfiles x00001900 inlist_to_he_dep_header +#./re_nomodfiles x00001970 inlist_pulses_header diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re_mid_pulse b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re_mid_pulse new file mode 100755 index 000000000..9f85ff5d4 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re_mid_pulse @@ -0,0 +1 @@ +./re_nomodfiles x00080000 inlist_pulses_header diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re_nomodfiles b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re_nomodfiles new file mode 100755 index 000000000..565b74208 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/re_nomodfiles @@ -0,0 +1,41 @@ +#!/bin/bash + +#echo $# +#echo $1 +#echo $2 + +photo_directory=photos + +function most_recent_photo { + ls -t "$photo_directory" | head -1 +} + +if [ "$#" -ne 2 ] +then + echo "must pass two arguments, photo string and inlist name" + exit 1 +fi + +if [ $1 = "." ] +then + photo=$(most_recent_photo) +else + photo=$1 +fi + +if [ -z "$photo" ] || ! [ -f "$photo_directory/$photo" ] +then + echo "specified photo does not exist" + exit 1 +fi + +echo "restart from $photo" +if ! cp "$photo_directory/$photo" restart_photo +then + echo "failed to copy photo" + exit 1 +fi + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star $2 +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/rn b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/rn new file mode 100755 index 000000000..417b21378 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/rn @@ -0,0 +1,25 @@ +#!/bin/bash + +# uncomment the following line to skip the optional inlists +# MESA_SKIP_OPTIONAL=t + +# this provides the definition of do_one (run one part of test) +# do_one [inlist] [output model] [LOGS directory] +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +# check if can skip building starting model +#if [ -n "$MESA_SKIP_OPTIONAL" ]; then +# cp standard_he_dep.mod he_dep.mod +#else + do_one inlist_to_he_dep_header he_dep.mod + cp he_dep.mod standard_he_dep.mod +#fi + +do_one inlist_pulses_header final.mod + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +echo 'finished' + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/rn1 b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/rn1 new file mode 100755 index 000000000..25590040a --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/rn1 @@ -0,0 +1,7 @@ +#!/bin/bash + +rm -f restart_photo + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/rn_nomodfiles b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/rn_nomodfiles new file mode 100755 index 000000000..35bd84f4c --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/rn_nomodfiles @@ -0,0 +1,7 @@ +#!/bin/bash +rm -f restart_photo +echo $1 + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star $1 +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/run_all b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/run_all new file mode 100755 index 000000000..3c4429ac3 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/run_all @@ -0,0 +1,2 @@ +./rn_nomodfiles inlist_to_he_dep_header +./re_nomodfiles . inlist_pulses_header diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run.f90 b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run.f90 new file mode 100644 index 000000000..112660f7c --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run.f90 @@ -0,0 +1,15 @@ +program run + use run_star_support, only: do_read_star_job + use run_star, only: do_run_star + + implicit none + + integer :: ierr + + ierr = 0 + call do_read_star_job('inlist', ierr) + if (ierr /= 0) stop 1 + + call do_run_star + +end program diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run_star_extras.f90 b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run_star_extras.f90 new file mode 100644 index 000000000..840974278 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run_star_extras.f90 @@ -0,0 +1,735 @@ +! *********************************************************************** +! +! Copyright (C) 2010-2019 The MESA Team +! +! this file is part of mesa. +! +! mesa is free software; you can redistribute it and/or modify +! it under the terms of the gnu general library public license as published +! by the free software foundation; either version 2 of the license, or +! (at your option) any later version. +! +! mesa is distributed in the hope that it will be useful, +! but without any warranty; without even the implied warranty of +! merchantability or fitness for a particular purpose. see the +! gnu library general public license for more details. +! +! you should have received a copy of the gnu library general public license +! along with this software; if not, write to the free software +! foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa +! +! *********************************************************************** + + module run_star_extras + + use star_lib + use star_def + use const_def + use math_lib + use auto_diff + use chem_def + use utils_lib + use rates_def, only: i_rate + use gyre_mesa_m + + + use interp_1d_def, only: pm_work_size + use interp_1d_lib, only: interp_pm, interp_values, interp_value + + implicit none + + include "test_suite_extras_def.inc" + include 'run_star_extras_TDC_pulsation_defs.inc' + + logical :: dbg = .false. + + !!!!!!!!!!!!!!!!!!!!!!!!! + ! These variables are loaded up from x_ctrl, x_integer_ctrl and x_logical_ctrl + ! values specified on inlist_common, inlist_pulses + !!!!!!!!!!!!!!!!!!!!!!!!! + + + logical :: in_inlist_pulses, remesh_for_envelope_model, turn_off_remesh, remove_core + integer :: kick_model_number, timestep_drop_model_number, turn_off_remesh_model_number + integer :: initial_model_number + real(dp) :: max_dt_before_pulse, max_dt_during_pulse, core_T_for_cut + + contains + + include "test_suite_extras.inc" + include 'run_star_extras_TDC_pulsation.inc' + + + subroutine extras_controls(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + s% extras_startup => extras_startup + s% extras_start_step => extras_start_step + s% extras_check_model => extras_check_model + s% extras_finish_step => extras_finish_step + s% extras_after_evolve => extras_after_evolve + s% how_many_extra_history_columns => how_many_extra_history_columns + s% data_for_extra_history_columns => data_for_extra_history_columns + s% how_many_extra_profile_columns => how_many_extra_profile_columns + s% data_for_extra_profile_columns => data_for_extra_profile_columns + + ! pulsation info + s% other_photo_write => photo_write + s% other_photo_read => photo_read + + s% how_many_other_mesh_fcns => how_many_other_mesh_fcns + s% other_mesh_fcn_data => RSP_mesh + + ! this is optional + s% other_wind => brott_wind + s% other_adjust_mdot => my_adjust_mdot + s% other_before_struct_burn_mix => my_before_struct_burn_mix + s% other_kap_get => my_other_kap_get + + ! store user provided options from the inlist + + in_inlist_pulses = s% x_logical_ctrl(22) + max_dt_before_pulse = s% x_ctrl(17) + max_dt_during_pulse = s% x_ctrl(18) + remesh_for_envelope_model = s% x_logical_ctrl(23) + turn_off_remesh = s% x_logical_ctrl(24) + kick_model_number = s% x_ctrl(11) + timestep_drop_model_number = s% x_ctrl(13) + turn_off_remesh_model_number = s% x_ctrl(12) + remove_core = s% x_logical_ctrl(25) + core_T_for_cut = s% x_ctrl(14) + end subroutine extras_controls + + subroutine brott_wind(id, Lsurf, Msurf, Rsurf, Tsurf, X, Y, Z, w, ierr) + use star_def + integer, intent(in) :: id + real(dp), intent(in) :: Lsurf, Msurf, Rsurf, Tsurf, X, Y, Z ! surface values (cgs) + ! NOTE: surface is outermost cell. not necessarily at photosphere. + ! NOTE: don't assume that vars are set at this point. + ! so if you want values other than those given as args, + ! you should use values from s% xh(:,:) and s% xa(:,:) only. + ! rather than things like s% Teff or s% lnT(:) which have not been set yet. + real(dp), intent(out) :: w ! wind in units of Msun/year (value is >= 0) + integer, intent(out) :: ierr + + integer :: h1, he4 + real(dp) :: Xs, Ys, Z_div_Z_solar, Teff_jump, alfa, L1, M1, R1, T1, & + vink_wind, nieu_wind, hamann_wind + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + L1 = Lsurf + M1 = Msurf + R1 = Rsurf + T1 = Tsurf + + h1 = s% net_iso(ih1) + he4 = s% net_iso(ihe4) + Xs = s% xa(h1,1) + Ys = s% xa(he4,1) + ! Z=0.0142 is Z from Asplund et al. 2009 + Z_div_Z_solar = s% kap_rq% Zbase/0.0142d0 + ! use Vink et al 2001, eqns 14 and 15 to set "jump" temperature + Teff_jump = 1d3*(61.2d0 + 2.59d0*(-13.636d0 + 0.889d0*log10(Z_div_Z_solar))) + + vink_wind = 0d0 + nieu_wind = 0d0 + hamann_wind = 0d0 + w = 0 + + call eval_Vink_wind(vink_wind) + call eval_Nieuwenhuijzen_wind(nieu_wind) + call eval_Hamann_wind(hamann_wind) + + ! use 1/10 hamann + hamann_wind = hamann_wind/10d0 + + if (T1 < Teff_jump) then + ! low T wind + w = max(vink_wind, nieu_wind) + else + ! high T wind + alfa = 0d0 + if (Xs > 0.7d0) then + alfa = 1d0 + else if (Xs > 0.4d0 .and. Xs < 0.7d0) then + alfa = (Xs - 0.4d0)/0.3d0 + end if + w = alfa * vink_wind + (1d0-alfa) * hamann_wind + end if + + ierr = 0 + + contains + + subroutine eval_Vink_wind(w) + real(dp), intent(inout) :: w + real(dp) :: alfa, w1, w2, logMdot, dT, vinf_div_vesc + + ! alfa = 1 for hot side, = 0 for cool side + if (T1 > 27500d0) then + alfa = 1 + else if (T1 < 22500d0) then + alfa = 0 + else + dT = 100d0 + if (T1 > Teff_jump + dT) then + alfa = 1 + else if (T1 < Teff_jump - dT) then + alfa = 0 + else + alfa = (T1 - (Teff_jump - dT)) / (2*dT) + end if + end if + + if (alfa > 0) then ! eval hot side wind (eqn 24) + vinf_div_vesc = 2.6d0 ! this is the hot side galactic value + vinf_div_vesc = vinf_div_vesc*pow(Z_div_Z_solar,0.13d0) ! corrected for Z + logMdot = & + - 6.697d0 & + + 2.194d0*log10(L1/Lsun/1d5) & + - 1.313d0*log10(M1/Msun/30) & + - 1.226d0*log10(vinf_div_vesc/2d0) & + + 0.933d0*log10(T1/4d4) & + - 10.92d0*pow2(log10(T1/4d4)) & + + 0.85d0*log10(Z_div_Z_solar) + w1 = exp10(logMdot) + else + w1 = 0 + end if + + if (alfa < 1) then ! eval cool side wind (eqn 25) + vinf_div_vesc = 1.3d0 ! this is the cool side galactic value + vinf_div_vesc = vinf_div_vesc*pow(Z_div_Z_solar,0.13d0) ! corrected for Z + logMdot = & + - 6.688d0 & + + 2.210d0*log10(L1/Lsun/1d5) & + - 1.339d0*log10(M1/Msun/30) & + - 1.601d0*log10(vinf_div_vesc/2d0) & + + 1.07d0*log10(T1/2d4) & + + 0.85d0*log10(Z_div_Z_solar) + w2 = exp10(logMdot) + else + w2 = 0 + end if + + w = alfa*w1 + (1 - alfa)*w2 + + end subroutine eval_Vink_wind + + subroutine eval_Nieuwenhuijzen_wind(w) + ! Nieuwenhuijzen, H.; de Jager, C. 1990, A&A, 231, 134 (eqn 2) + real(dp), intent(out) :: w + real(dp) :: log10w + include 'formats' + log10w = -14.02d0 & + +1.24d0*log10(L1/Lsun) & + +0.16d0*log10(M1/Msun) & + +0.81d0*log10(R1/Rsun) & + +0.85d0*log10(Z_div_Z_solar) + w = exp10(log10w) + end subroutine eval_Nieuwenhuijzen_wind + + subroutine eval_Hamann_wind(w) + ! Hamann, W.-R.; Koesterke, L.; Wessolowski, U. 1995, A&A, 299, 151 + real(dp), intent(out) :: w + real(dp) :: log10w + include 'formats' + log10w = -11.95d0 & + +1.5d0*log10(L1/Lsun) & + -2.85d0*Xs & + + 0.85d0*log10(Z_div_Z_solar) + w = exp10(log10w) + end subroutine eval_Hamann_wind + + end subroutine brott_wind + + subroutine my_adjust_mdot(id, ierr) + use star_def + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + real(dp) :: Lrad_div_Ledd + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + if (s% generations > 2) then + write(*,*) "check mdots", s% mstar_dot, s% mstar_dot_old + if (abs(s% mstar_dot) > 1.05d0*abs(s% mstar_dot_old)) then + s% mstar_dot = 1.05d0*s% mstar_dot_old + else if (abs(s% mstar_dot) < 0.95d0*abs(s% mstar_dot_old)) then + s% mstar_dot = 0.95d0*s% mstar_dot_old + end if + end if + end subroutine my_adjust_mdot + + + subroutine my_other_kap_get( & + id, k, handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, & + lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + + use kap_def, only: num_kap_fracs + use kap_lib + + ! INPUT + integer, intent(in) :: id ! star id if available; 0 otherwise + integer, intent(in) :: k ! cell number or 0 if not for a particular cell + integer, intent(in) :: handle ! from alloc_kap_handle + integer, intent(in) :: species + integer, pointer :: chem_id(:) ! maps species to chem id + ! index from 1 to species + ! value is between 1 and num_chem_isos + integer, pointer :: net_iso(:) ! maps chem id to species number + ! index from 1 to num_chem_isos (defined in chem_def) + ! value is 0 if the iso is not in the current net + ! else is value between 1 and number of species in current net + real(dp), intent(in) :: xa(:) ! mass fractions + real(dp), intent(in) :: log10_rho ! density + real(dp), intent(in) :: log10_T ! temperature + real(dp), intent(in) :: lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT + ! free_e := total combined number per nucleon of free electrons and positrons + real(dp), intent(in) :: eta, d_eta_dlnRho, d_eta_dlnT + ! eta := electron degeneracy parameter + + ! OUTPUT + real(dp), intent(out) :: kap_fracs(num_kap_fracs) + real(dp), intent(out) :: kap ! opacity + real(dp), intent(out) :: dln_kap_dlnRho ! partial derivative at constant T + real(dp), intent(out) :: dln_kap_dlnT ! partial derivative at constant Rho + real(dp), intent(out) :: dln_kap_dxa(:) ! partial derivative w.r.t. to species + integer, intent(out) :: ierr ! 0 means AOK. + + type (star_info), pointer :: s + real(dp) :: velocity + real(dp) :: radius, logR + real(dp) :: logT_alt, inv_diff + real(dp) :: log_kap, alpha + + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + kap = 0; dln_kap_dlnRho = 0; dln_kap_dlnT = 0; dln_kap_dxa = 0 + velocity = 0 + radius = 0 + + !if (k==1 .and. s% u_flag .and. .not. is_nan(s% lnR_start(1))) then !very surface cell can go mad, things are more stable if we fix opacity + ! if (s% xh_start(s% i_u,1)>sqrt(2*s% cgrav(1)*s% m(1)/exp(s% lnR_start(1)))) then + if (k==1 .and. s% u_flag) then !very surface cell can go mad, things are more stable if we fix opacity + ! this is to support restarts, as xh_start and r_start are + ! not properly set when model loads + if (s% solver_iter > 0) then + velocity = s% xh_start(s% i_u,1) + radius = s% r_start(1) + else + velocity = s% xh(s% i_u,1) + radius = s% r(1) + end if + if (velocity>sqrt(2*s% cgrav(1)*s% m(1)/radius)) then + kap = 0.2d0*(1 + s% X(1)) + dln_kap_dlnRho = 0d0 + dln_kap_dlnT = 0d0 + return + else + call kap_get( & + s% kap_handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + end if + else + call kap_get( & + s% kap_handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + end if + + + end subroutine my_other_kap_get + + subroutine extras_startup(id, restart, ierr) + integer, intent(in) :: id + logical, intent(in) :: restart + integer, intent(out) :: ierr + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call test_suite_startup(s, restart, ierr) + call TDC_pulsation_extras_startup(id, restart, ierr) + + ! interestingly, if you do this instead of remove_center_by_temperature + ! in the starjob section of the inlist, then the tau relaxation happens + ! before the cut. Not sure which is better, but leaving like this for now + if (.not. restart .and. in_inlist_pulses .and. remove_core) then + call star_remove_center_by_temperature(id, core_T_for_cut, ierr) + end if + + ! Initialize GYRE + + call init('gyre.in') + + ! Set constants + + call set_constant('G_GRAVITY', standard_cgrav) + call set_constant('C_LIGHT', clight) + call set_constant('A_RADIATION', crad) + + call set_constant('M_SUN', Msun) + call set_constant('R_SUN', Rsun) + call set_constant('L_SUN', Lsun) + + call set_constant('GYRE_DIR', TRIM(mesa_dir)//'/gyre/gyre') + + !if (.not. restart .and. in_inlist_pulses) then + ! initial_model_number = s% model_number + !end if + initial_model_number = 0 ! since we are setting model # to 0 in inlist_pulses + + + ! for rsp style mesh + if (.not. restart .and. in_inlist_pulses .and. remesh_for_envelope_model) then + call remesh_for_TDC_pulsation(id, ierr) + end if + end subroutine extras_startup + + + subroutine extras_after_evolve(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + real(dp) :: dt + character (len=strlen) :: test + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call test_suite_after_evolve(s, ierr) + + if (.not. s% x_logical_ctrl(37)) return + call final() + end subroutine extras_after_evolve + + + ! returns either keep_going, retry, or terminate. + integer function extras_check_model(id) + integer, intent(in) :: id + integer :: ierr, k + real(dp) :: max_v + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + extras_check_model = keep_going + + + end function extras_check_model + + + integer function how_many_extra_history_columns(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + how_many_extra_history_columns = TDC_pulsation_how_many_extra_history_columns(id) + end function how_many_extra_history_columns + + + subroutine data_for_extra_history_columns(id, n, names, vals, ierr) + integer, intent(in) :: id, n + character (len=maxlen_history_column_name) :: names(n) + real(dp) :: vals(n), v_esc + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k, k0 + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call TDC_pulsation_data_for_extra_history_columns(id, n, names, vals, ierr) + end subroutine data_for_extra_history_columns + + + integer function how_many_extra_profile_columns(id) + use star_def, only: star_info + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + how_many_extra_profile_columns = TDC_pulsation_how_many_extra_profile_columns(id) + + end function how_many_extra_profile_columns + + + subroutine data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + use star_def, only: star_info, maxlen_profile_column_name + use const_def, only: dp + integer, intent(in) :: id, n, nz + character (len=maxlen_profile_column_name) :: names(n) + real(dp) :: vals(nz,n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call TDC_pulsation_data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + + end subroutine data_for_extra_profile_columns + + + integer function extras_start_step(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + include 'formats' + extras_start_step = terminate + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + !this is used to ensure we read the right inlist options + s% use_other_before_struct_burn_mix = .true. + + ! we want to ignore T gradient equation for a few steps after remesh + if (s% model_number < initial_model_number + 10 .and. in_inlist_pulses) then + s% convergence_ignore_equL_residuals = .true. + else if (in_inlist_pulses) then + s% convergence_ignore_equL_residuals = .false. + end if + + if (s% model_number == kick_model_number .and. in_inlist_pulses & + .and. s% x_logical_ctrl(5))then + + ! if v= 0, turn on v so we can kick + if (.not. s% v_flag .or. .not. s% u_flag) then + call star_set_v_flag(id, .true., ierr) + end if + + call gyre_in_mesa_extras_set_velocities(s,.false.,ierr) + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + + end if + + call my_before_struct_burn_mix(s% id, s% dt, extras_start_step) + + ! add stopping condition for testing. + if ((.not. in_inlist_pulses) .and. s% center_he4 < 2d-1) then + s% Teff_lower_limit = exp10(3.75d0) + else + s% Teff_lower_limit = -1d99 + end if + + extras_start_step = keep_going + end function extras_start_step + + subroutine my_before_struct_burn_mix(id, dt, res) + use const_def, only: dp + use star_def + integer, intent(in) :: id + real(dp), intent(in) :: dt + integer, intent(out) :: res ! keep_going, redo, retry, terminate + real(dp) :: power_photo, v_esc + integer :: ierr, k + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + +! !s% use_atm_PT_at_center_of_surface_cell = .false. +! s% use_momentum_outer_BC = .false. ! offset_P_to_center_cell = .true. +! s% use_compression_outer_BC = .false. ! offset_P_to_center_cell = .true. +! s% use_zero_Pgas_outer_BC = .true. +! s% atm_option = 'T_tau' +! s% atm_T_tau_relation = 'Eddington' +! s% atm_T_tau_opacity = 'fixed' +! s% tau_factor = 1d-3 +! s% Pextra_factor = 1d0 +! s% force_tau_factor = 1d-3 +! s% delta_lgL_limit = 0.25d0 +! !s% delta_lgTeff_limit = 1d-2!0.25d0 +! s% delta_lgL_limit_L_min = 1d99!-100 +! s% delta_lgL_limit_L_min = 1d99!-100 +! +! !s% atm_T_tau_errtol = 1d-12 +! !s% atm_T_tau_max_iters = 500 + + if (in_inlist_pulses) then + if (s% model_number > timestep_drop_model_number )then + s% max_timestep = max_dt_during_pulse + else + s% max_timestep = max_dt_before_pulse + end if + + ! time step control on pulsations + if (period > 0d0 .and. period/s% max_timestep < 600 .and. & + s% model_number > timestep_drop_model_number) then + s% max_timestep = period/600d0 + end if + + if (s% model_number > turn_off_remesh_model_number .and. turn_off_remesh )then + s% okay_to_remesh = .false. + ! if ((s% model_number == turn_off_remesh_model_number + 1) & + ! .and. .not. remesh_for_envelope_model )then + ! do k =1,s%nz + ! if (s%lnT(k) >= log(2d6)) then + ! exit + ! end if + ! end do + ! s% mesh_min_k_old_for_split = k + ! end if + ! write (*,*) 's% mesh_min_k_old_for_split', s% mesh_min_k_old_for_split + end if + end if + + ! reading inlists can turn this flag off for some reason + s% use_other_before_struct_burn_mix = .true. + + res = keep_going + end subroutine my_before_struct_burn_mix + + subroutine null_binary_controls(id, binary_id, ierr) + integer, intent(in) :: id, binary_id + integer, intent(out) :: ierr + ierr = 0 + end subroutine null_binary_controls + + ! returns either keep_going or terminate. + integer function extras_finish_step(id) + use run_star_support + use math_lib + integer, intent(in) :: id + integer :: ierr,k + real(dp) :: max_vel_inside, vesc_for_cell, vesc_surf !check_avg_v_div_vesc + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + extras_finish_step = keep_going + extras_finish_step = TDC_pulsation_extras_finish_step(id) + +! if (.not. s% x_logical_ctrl(37)) return +! extras_finish_step = gyre_in_mesa_extras_finish_step(id) + + if (extras_finish_step == terminate) s% termination_code = t_extras_finish_step + + end function extras_finish_step + + + + + ! here is an example that adds a mesh function for log(opacity) + subroutine how_many_other_mesh_fcns(id, n) + integer, intent(in) :: id + integer, intent(out) :: n + n = 1 + end subroutine how_many_other_mesh_fcns + + + subroutine RSP_mesh( & + id, nfcns, names, gval_is_xa_function, vals1, ierr) + use star_def + use math_lib + use const_def + integer, intent(in) :: id + integer, intent(in) :: nfcns + character(len=*) :: names(:) + logical, intent(out) :: gval_is_xa_function(:) ! (nfcns) + real(dp), pointer :: vals1(:) ! =(nz, nfcns) + integer, intent(out) :: ierr + integer :: nz, k + real(dp), pointer :: vals(:, :) + real(dp) :: weight1 = 1d6!1d4 + real(dp) :: weight2 = 8d5!1d4 + real(dp) :: weight3 = 0d0 + real(dp) :: logT_anchor1, logT_anchor2, logT_anchor3, lmid, delta, ell + integer :: k_anchor1, k_anchor2 + + type(star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + names(1) = 'RSP_function' + gval_is_xa_function(1) = .false. + nz = s%nz + vals(1:nz, 1:nfcns) => vals1(1:nz*nfcns) + + logT_anchor1 = log(11d3)!log(11d3) + logT_anchor2 = log(20d3)!log(11d3) + logT_anchor3 = log(30d3) + + lmid = 0.5d0*(logT_anchor2+logT_anchor3) + delta = (logT_anchor3 - logT_anchor2) + + k_anchor1 = 0 + k_anchor2 = 0 + + ! do k = 1, nz + ! if (s% lnT(k) < logT_anchor1) then + ! vals(k, 1) = weight1*(s% m(1) - s% m(k))/Msun + ! k_anchor = k + ! !write (*,*) "k", k ,"dm", vals(k, 1) + ! else if (s% lnT(k) < logT_anchor2 .and. s% lnT(k) >= logT_anchor1) then + ! vals(k, 1) = weight2*(s% m(k_anchor) - s% m(k))/Msun + ! !write (*,*) "k", k ,"dm", vals(k, 1) + ! else + ! vals(k, 1) = weight3*(s% m(1)/Msun - s% m(k)/Msun) + ! end if + ! end do + + + do k = 1, nz + ell = s%lnT(k) + if (s% lnT(k) <= logT_anchor1) then + vals(k,1) = weight1*(s%m(1) - s%m(k))/Msun + k_anchor1 = k + else if (s% lnT(k) <= logT_anchor2 .and. s% lnT(k) >= logT_anchor1) then + vals(k,1) = weight2*(s%m(1) - s%m(k))/Msun + k_anchor2 = k + else if (s% lnT(k) < logT_anchor3) then + ! smooth taper doqn to 0. +! vals(k,1) = vals(k-1,1)/2d0 + vals(k,1) = (0.5d0*weight2*(1d0 - tanh( (ell - lmid)/delta )) & + ) * ( (s%m(k_anchor2) - s%m(k)) / Msun ) + end if + end do + + end subroutine RSP_mesh + + + subroutine photo_write(id, iounit) + integer, intent(in) :: id, iounit + call TDC_pulsation_photo_write(id, iounit) + end subroutine photo_write + + + subroutine photo_read(id, iounit, ierr) + integer, intent(in) :: id, iounit + integer, intent(out) :: ierr + call TDC_pulsation_photo_read(id, iounit, ierr) + end subroutine photo_read + + end module run_star_extras + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run_star_extras_TDC_pulsation.inc b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run_star_extras_TDC_pulsation.inc new file mode 100644 index 000000000..e3254cb2a --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run_star_extras_TDC_pulsation.inc @@ -0,0 +1,383 @@ + + + subroutine TDC_pulsation_photo_write(id, iounit) + integer, intent(in) :: id, iounit + write(iounit) num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev, & + period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag, & + time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max, & + best_period, best_model_number, best_order, best_cycles_to_double + end subroutine TDC_pulsation_photo_write + + + subroutine TDC_pulsation_photo_read(id, iounit, ierr) + integer, intent(in) :: id, iounit + integer, intent(out) :: ierr + ierr = 0 + read(iounit, iostat=ierr) num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev, & + period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag, & + time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max, & + best_period, best_model_number, best_order, best_cycles_to_double + end subroutine TDC_pulsation_photo_read + + + subroutine TDC_pulsation_extras_startup(id, restart, ierr) + integer, intent(in) :: id + logical, intent(in) :: restart + integer, intent(out) :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + if (.not. restart) then + num_periods = 0 + run_num_steps_end_prev = 0 + run_num_iters_end_prev = 0 + run_num_retries_end_prev = 0 + period = 0 + KE_growth = 0 + KE_growth_avg = 0 + prev_KE_max = 0 + delta_R_growth = 0 + delta_R_growth_avg = 0 + prev_delta_R = 0 + period_max_v_div_cs = 0 + period_max_v_div_vesc = 0 + period_delta_R = 0 + period_delta_Teff = 0 + period_delta_logTeff = 0 + period_delta_logL = 0 + period_delta_Mag = 0 + time_started = 0 + v_div_cs_max = 0 + v_div_vesc_max = 0 + KE_min = 0 + KE_max = 0 + R_min = 0 + R_max = 0 + L_min = 0 + L_max = 0 + T_min = 0 + T_max = 0 + best_period = 0 + best_model_number = 0 + best_order = 0 + best_cycles_to_double = 0 + end if + end subroutine TDC_pulsation_extras_startup + + + integer function TDC_pulsation_extras_finish_step(id) + use chem_def + integer, intent(in) :: id + type (star_info), pointer :: s + integer :: ierr, gyre_interval, test_period + real(dp) :: target_period + logical :: doing_pulses + include 'formats' + + TDC_pulsation_extras_finish_step = terminate + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_extras_finish_step = keep_going + + gyre_interval = s% x_integer_ctrl(1) + if (gyre_interval > 0) then + if (MOD(s% model_number, gyre_interval) == 0) & + call get_gyre_info_for_this_step + if (TDC_pulsation_extras_finish_step == terminate) & + s% termination_code = t_extras_finish_step + if (TDC_pulsation_extras_finish_step /= keep_going) return + end if + + doing_pulses = s% x_logical_ctrl(7) + if (.not. doing_pulses) return + target_period = s% x_ctrl(7) + if (target_period <= 0d0) return + if (.not. get_period_info()) return + + test_period = s% x_integer_ctrl(7) + if (num_periods < test_period .or. test_period <= 0) return + + ! have finished test run + call report_test_results + TDC_pulsation_extras_finish_step = terminate + + contains + + subroutine get_gyre_info_for_this_step + integer :: i + TDC_pulsation_extras_finish_step = gyre_in_mesa_extras_finish_step(id) + if (s% ixtra3_array(1) > 0) then ! unpack the GYRE results + do i=1,s% ixtra3_array(1) + if (s% xtra1_array(i) == 0d0 .or. & + (s% ixtra1_array(i) /= s% x_integer_ctrl(4) .and. s% x_integer_ctrl(4) > 0)) cycle + if (s% xtra3_array(i) > 0d0 .and. & + (best_cycles_to_double == 0d0 .or. s% xtra3_array(i) < best_cycles_to_double)) then + !best_growth = s% xtra1_array(i) + best_period = 1d0/s% xtra2_array(i) ! xtra2_array = freq (s^-1) + best_period = best_period/(24*3600) ! change to days + best_cycles_to_double = s% xtra3_array(i) + best_order = s% ixtra1_array(i) + best_model_number = s% model_number + end if + end do + end if + end subroutine get_gyre_info_for_this_step + + logical function get_period_info() + real(dp) :: v_surf, v_surf_start, KE, min_period, time_ended, & + delta_R, min_deltaR_for_periods, growth_avg_frac_new, & + min_period_div_target, cs, vesc + include 'formats' + get_period_info = .false. + + if (s% r(1) < R_min) R_min = s% r(1) + if (s% r(1) > R_max) R_max = s% r(1) + if (s% L(1) < L_min) L_min = s% L(1) + if (s% L(1) > L_max) L_max = s% L(1) + if (s% Teff < T_min) T_min = s% Teff + if (s% Teff > T_max) T_max = s% Teff + KE = s% total_radial_kinetic_energy_end + if (KE > KE_max) KE_max = KE + if (KE < KE_min) KE_min = KE + + if (s% v_flag) then + v_surf = s% v(1) + v_surf_start = s% v_start(1) + else if (s% u_flag) then + v_surf = s% u_face_val(1) + v_surf_start = s% u_face_start(1) + else ! + v_surf = 0d0 + v_surf_start = 0d0 + !stop 'TDC_pulsation_extras_finish_step: both v_flag and u_flag are false' + end if + cs = s% csound(1) + if (v_surf > v_div_cs_max*cs) v_div_cs_max = v_surf/cs + vesc = sqrt(2*s% cgrav(1)*s% m(1)/(s% r(1))) + if (v_surf > v_div_vesc_max*vesc) v_div_vesc_max = v_surf/vesc + + ! period is completed when v_surf goes from positive to negative during step + if (v_surf > 0d0 .or. v_surf_start < 0d0) return + + if (time_started == 0) then ! start of 1st cycle + time_started = s% time + run_num_steps_end_prev = s% model_number + run_num_iters_end_prev = s% total_num_solver_iterations + run_num_retries_end_prev = s% num_retries + prev_KE_max = 0d0 + call init_min_max_info + write(*,*) 'first maximum radius, period calculations starting at model, day', & + s% model_number, s% time/(24*3600) + return + end if + + delta_R = R_max - R_min + min_deltaR_for_periods = s% x_ctrl(8)*Rsun + if (min_deltaR_for_periods > 0d0) then + if (delta_R < min_deltaR_for_periods) return ! filter out glitches + end if + + time_ended = s% time + if (abs(v_surf - v_surf_start) > 1d-10) & ! tweak the end time to match when v_surf == 0 + time_ended = s% time - v_surf*s% dt/(v_surf - v_surf_start) + min_period_div_target = s% x_ctrl(10) + min_period = target_period*(24*3600)*min_period_div_target + if (min_period > 0d0 .and. & + time_ended - time_started < min_period) return ! filter out glitches + + period = time_ended - time_started + num_periods = num_periods + 1 + + if (num_periods > 1) then + growth_avg_frac_new = s% x_ctrl(9) + KE_growth = (KE_max - prev_KE_max)/prev_KE_max + KE_growth_avg = growth_avg_frac_new*KE_growth + & + (1d0 - growth_avg_frac_new)*KE_growth_avg + delta_R_growth = (delta_R - prev_delta_R)/prev_delta_R + delta_R_growth_avg = growth_avg_frac_new*delta_R_growth + & + (1d0 - growth_avg_frac_new)*delta_R_growth_avg + end if + + period_delta_Teff = T_max - T_min + period_delta_logTeff = log10(T_max/T_min) + period_delta_R = R_max - R_min + period_delta_logL = log10(L_max/L_min) + period_delta_Mag = 2.5d0*period_delta_logL + period_max_v_div_cs = v_div_cs_max + period_max_v_div_vesc = v_div_vesc_max + prev_KE_max = KE_max + prev_delta_R = period_delta_R + ! 1 2 3 4 5 6 7 8 9 + write(*,'(i4,a14,i6,a13,f8.3,a13,f9.3,a9,f9.4,a15,f10.4,a13,f9.4,a13,f10.4,a11,f9.4,a13,f9.4)') & + num_periods, & + 'steps/cycle', s% model_number - run_num_steps_end_prev, & ! 1 a14,i6 + 'iters/step', & + dble(s% total_num_solver_iterations - run_num_iters_end_prev)/ & + dble(s% model_number - run_num_steps_end_prev), & ! 2 a13,f8.3 + 'period (d)', period/(24*3600), & ! 3 a13,f9.3 + 'growth', delta_R_growth_avg, & ! 4 a9,f9.4 + 'delta R/Rsun', period_delta_R/Rsun, & ! 5 a15,f10.4 + 'delta logL', period_delta_logL, & ! 6 a13,f9.4 + 'delta Teff', period_delta_Teff, & ! 7 a13,f10.4 + 'max v/cs', period_max_v_div_cs, & ! 8 a11,f9.4 + 'max v/vesc', period_max_v_div_vesc ! 9 a13,f9.4 + + time_started = time_ended + run_num_steps_end_prev = s% model_number + run_num_iters_end_prev = s% total_num_solver_iterations + run_num_retries_end_prev = s% num_retries + call init_min_max_info + get_period_info = .true. + + end function get_period_info + + subroutine init_min_max_info + v_div_cs_max = 0d0 + v_div_vesc_max = 0d0 + KE_min = 1d99 + KE_max = -1d99 + R_min = 1d99 + R_max = -1d99 + L_min = 1d99 + L_max = -1d99 + T_min = 1d99 + T_max = -1d99 + end subroutine init_min_max_info + + subroutine report_test_results + real(dp) :: rel_run_E_err + write(*,*) + write(*,*) + write(*,*) + rel_run_E_err = s% cumulative_energy_error/s% total_energy + write(*,*) 'rel_run_E_err', rel_run_E_err + if (s% total_energy /= 0d0 .and. abs(rel_run_E_err) > 1d-5) then + write(*,*) '*** BAD rel_run_E_error ***', & + s% cumulative_energy_error/s% total_energy + else if (abs(period/(24*3600) - target_period) > 1d-2) then + write(*,*) '*** BAD period ***', period/(24*3600) - target_period, & + period/(24*3600), target_period + else + write(*,*) 'good match for period', & + period/(24*3600), target_period + end if + write(*,*) + write(*,*) + write(*,*) + end subroutine report_test_results + + end function TDC_pulsation_extras_finish_step + + + include 'gyre_in_mesa_extras_finish_step.inc' + + + subroutine TDC_pulsation_extras_after_evolve(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + ierr = 0 + call final() + end subroutine TDC_pulsation_extras_after_evolve + + + integer function TDC_pulsation_how_many_extra_history_columns(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_how_many_extra_history_columns = 11 + end function TDC_pulsation_how_many_extra_history_columns + + + subroutine TDC_pulsation_data_for_extra_history_columns(id, n, names, vals, ierr) + integer, intent(in) :: id, n + character (len=maxlen_history_column_name) :: names(n) + real(dp) :: vals(n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: i + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + i = 1 + names(i) = 'num_periods'; vals(i) = num_periods; i=i+1 + names(i) = 'period'; vals(i) = period/(24*3600); i=i+1 + names(i) = 'growth'; vals(i) = delta_R_growth_avg; i=i+1 + names(i) = 'max_v_div_cs'; vals(i) = period_max_v_div_cs; i=i+1 + names(i) = 'max_v_div_vesc'; vals(i) = period_max_v_div_vesc; i=i+1 + names(i) = 'delta_R'; vals(i) = period_delta_R/Rsun; i=i+1 + names(i) = 'delta_Teff'; vals(i) = period_delta_Teff; i=i+1 + names(i) = 'delta_logTeff'; vals(i) = period_delta_logTeff; i=i+1 + names(i) = 'delta_logL'; vals(i) = period_delta_logL; i=i+1 + names(i) = 'delta_Mag'; vals(i) = period_delta_Mag; i=i+1 + names(i) = 'KE_growth_avg'; vals(i) = KE_growth_avg; i = i+1 + + end subroutine TDC_pulsation_data_for_extra_history_columns + + + integer function TDC_pulsation_how_many_extra_profile_columns(id) + use star_def, only: star_info + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_how_many_extra_profile_columns = 0 ! 6 + end function TDC_pulsation_how_many_extra_profile_columns + + + subroutine TDC_pulsation_data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + use star_def, only: star_info, maxlen_profile_column_name + use const_def, only: dp + integer, intent(in) :: id, n, nz + character (len=maxlen_profile_column_name) :: names(n) + real(dp) :: vals(nz,n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k + ierr = 0 + return + + + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + names(1) = 'xtra1' + names(2) = 'xtra2' + names(3) = 'xtra3' + names(4) = 'xtra4' + names(5) = 'xtra5' + names(6) = 'xtra6' + + do k=1,nz + vals(k,1) = s% xtra1_array(k) + vals(k,2) = s% xtra2_array(k) + vals(k,3) = s% xtra3_array(k) + vals(k,4) = s% xtra4_array(k) + vals(k,5) = s% xtra5_array(k) + vals(k,6) = s% xtra6_array(k) + end do + + end subroutine TDC_pulsation_data_for_extra_profile_columns + + + include 'gyre_in_mesa_extras_set_velocities.inc' + + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run_star_extras_TDC_pulsation_defs.inc b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run_star_extras_TDC_pulsation_defs.inc new file mode 100644 index 000000000..b7b6e47b6 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_Cepheid_6M_u_flag/src/run_star_extras_TDC_pulsation_defs.inc @@ -0,0 +1,16 @@ + + ! GYRE "best" info + real(dp) :: best_period, best_cycles_to_double + integer :: best_model_number, best_order + + ! summary info at time of recently completely period + integer :: num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev + real(dp) :: period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag + ! info for period in progress + real(dp) :: time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/README.rst b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/README.rst new file mode 100644 index 000000000..a25931921 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/README.rst @@ -0,0 +1,21 @@ +.. _ppisn: + +***** +ppisn +***** + +This test case evolves a very massive helium star from the He-ZAMS +up to the ocurrence of a pulsational pair-instability event (see |Marchant2019|). + +.. |Marchant2019| replace:: `Marchant et al. 2019 `__ + +Initialization of the model +=========================== +The initial mass of the helium star is set in ``inlist_extra`` + +.. literalinclude:: ../../../star/test_suite/ppisn/inlist_extra + +In this case we use a :math:`72 M_\odot` + +Last-Updated: 2019-11-12 (mesa r12413) by Pablo Marchant + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/ck b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/ck new file mode 100755 index 000000000..ac08f15c6 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/ck @@ -0,0 +1,7 @@ +#!/bin/bash + +# this provides the definition of check_one +# check_one +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +check_one diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/clean b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/clean new file mode 100755 index 000000000..95545a5c1 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/clean @@ -0,0 +1,4 @@ +#!/bin/bash + +cd make +make clean diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/gyre.in b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/gyre.in new file mode 100644 index 000000000..10381b567 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/gyre.in @@ -0,0 +1,34 @@ +&model + add_center = .FALSE. +/ + +&mode + l = 0 +/ + +&osc + inner_bound = 'ZERO_R' ! for envelopes + nonadiabatic = .TRUE. +/ + +&rot +/ + +&num + diff_scheme = 'MAGNUS_GL2'!'COLLOC_GL2' +/ + +&scan + grid_type = 'LINEAR' + freq_min = 0.5!1d-4 + freq_max = 5.0!10.0 + freq_min_units = 'ACOUSTIC_DELTA' + freq_max_units = 'ACOUSTIC_DELTA' + n_freq = 50 +/ + +&grid + w_osc = 10 + w_exp = 2 + w_ctr = 10 +/ diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/he_dep.mod b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/he_dep.mod new file mode 100644 index 000000000..b3823f861 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/he_dep.mod @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef24c8117e2c3e6fadbe05c18649c1a2213a6fbbf239cdcb657f7a25c08a9bf1 +size 696808 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/history_columns.list b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/history_columns.list new file mode 100644 index 000000000..c9f423332 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/history_columns.list @@ -0,0 +1,1073 @@ +! history_columns.list -- determines the contents of star history logs +! you can use a non-standard version by setting history_columns_file in your inlist + +! units are cgs unless otherwise noted. + +! reorder the following names as desired to reorder columns. +! comment out the name to omit a column (fewer columns => less IO => faster running). +! remove '!' to restore a column. + +! if you have a situation where you want a non-standard set of columns, +! make a copy of this file, edit as desired, and give the new filename in your inlist +! as history_columns_file. if you are just adding columns, you can 'include' this file, +! and just list the additions in your file. note: to include the standard default +! version, use include '' -- the 0 length string means include the default file. + +! blank lines and comments can be used freely. +! if a column name appears more than once in the list, only the first occurrence is used. + +! if you need to have something added to the list of options, let me know.... + + +! the first few lines of the log file contain a few items: + + ! version_number -- for the version of mesa being used + ! burn_min1 -- 1st limit for reported burning, in erg/g/s + ! burn_min2 -- 2nd limit for reported burning, in erg/g/s + + +!# other files + +! note: you can include another list by doing +! include 'filename' +! include '' means include the default standard list file + +! the following lines of the log file contain info about 1 model per row + +!---------------------------------------------------------------------------------------------- + +!# general info about the model + + model_number ! counting from the start of the run + num_zones ! number of zones in the model + + !## age + + star_age ! elapsed simulated time in years since the start of the run + !star_age_sec ! elapsed simulated time in seconds since the start of the run + !star_age_min ! elapsed simulated time in minutes since the start of the run + !star_age_hr ! elapsed simulated time in hours since the start of the run + !star_age_day ! elapsed simulated time in days since the start of the run + day ! elapsed simulated time in days since the start of the run + + log_star_age + log_star_age_sec + + !## timestep + + time_step ! timestep in years since previous model + time_step_sec ! timestep in seconds since previous model + time_step_days + log_dt ! log10 time_step in years + log_dt_sec ! log10 time_step in seconds + !log_dt_days ! log10 time_step in days + + !## mass + + star_mass ! in Msun units + !log_star_mass + + !star_gravitational_mass ! star_mass is baryonic mass + !star_mass_grav_div_mass + + !delta_mass ! star_mass - initial_mass in Msun units + log_xmstar ! log10 mass exterior to M_center (grams) + + !## mass change + + star_mdot ! d(star_mass)/dt (in msolar per year) + log_abs_mdot ! log10(abs(star_mdot)) (in msolar per year) + + !## imposed surface conditions + !Tsurf_factor + !tau_factor + !tau_surface + + !## imposed center conditions + !m_center + !m_center_gm + !r_center + !r_center_cm + !r_center_km + !L_center + !log_L_center + !log_L_center_ergs_s + !v_center + !v_center_kms + + !logt_max + +!---------------------------------------------------------------------------------------------- + +!# mixing and convection + + !max_conv_vel_div_csound + !max_gradT_div_grada + !max_gradT_sub_grada + !min_log_mlt_Gamma + + + !## mixing regions + + mass_conv_core ! (Msun) mass coord of top of convective core. 0 if core is not convective + + ! mx1 refers to the largest (by mass) convective region. + ! mx2 is the 2nd largest. + + ! conv_mx1_top and conv_mx1_bot are the region where mixing_type == convective_mixing. + ! mx1_top and mx1_bot are the extent of all kinds of mixing, convective and other. + + ! values are m/Mstar + conv_mx1_top + conv_mx1_bot + conv_mx2_top + conv_mx2_bot + mx1_top + mx1_bot + mx2_top + mx2_bot + + ! radius -- values are radii in Rsun units + !conv_mx1_top_r + !conv_mx1_bot_r + !conv_mx2_top_r + !conv_mx2_bot_r + !mx1_top_r + !mx1_bot_r + !mx2_top_r + !mx2_bot_r + + ! you might want to get a more complete list of mixing regions by using the following + + !mixing_regions ! note: this includes regions where the mixing type is no_mixing. + + ! the is the number of regions to report + ! there will be 2* columns for this in the log file, 2 for each region. + ! the first column for a region gives the mixing type as defined in const/public/const_def.f90. + + ! the second column for a region gives the m/mstar location of the top of the region + ! entries for extra columns after the last region in the star will have an invalid mixing_type value of -1. + ! mstar is the total mass of the star, so these locations range from 0 to 1 + ! all regions are include starting from the center, so the bottom of one region + ! is the top of the previous one. since we start at the center, the bottom of the 1st region is 0. + + ! the columns in the log file will have names like 'mix_type_1' and 'mix_qtop_1' + + ! if the star has too many regions to report them all, + ! the smallest regions will be merged with neighbors for reporting purposes only. + + + !mix_relr_regions + ! same as above, but locations given as r/rstar instead of m/mstar. + ! the columns in the log file will have names like 'mix_relr_type_1' and 'mix_relr_top_1' + + + !## conditions at base of largest convection zone (by mass) + !cz_bot_mass ! mass coordinate of base (Msun) + !cz_mass ! mass coordinate of base (Msun) -- same as cz_bot_mass + !cz_log_xmass ! mass exterior to base (g) + !cz_log_xmsun ! mass exterior to base (Msun) + !cz_xm ! mass exterior to base (Msun) + !cz_logT + !cz_logRho + !cz_logP + !cz_bot_radius ! Rsun + !cz_log_column_depth + !cz_log_radial_depth + !cz_luminosity ! Lsun + !cz_opacity + !cz_log_tau + !cz_eta + !cz_log_eps_nuc ! log10(ergs/g/s) + !cz_t_heat ! Cp*T/eps_nuc (seconds) + + !cz_csound + !cz_scale_height + !cz_grav + + !cz_omega + !cz_omega_div_omega_crit + + !cz_zone + + ! mass fractions at base of largest convection zone (by mass) + !cz_log_xa h1 + !cz_log_xa he4 + + !## conditions at top of largest convection zone (by mass) + !cz_top_mass ! mass coordinate of top (Msun) + !cz_top_log_xmass ! mass exterior to top (g) + !cz_top_log_xmsun ! mass exterior to top (Msun) + !cz_top_xm ! mass exterior to top (Msun) + !cz_top_logT + !cz_top_logRho + !cz_top_logP + !cz_top_radius ! Rsun + !cz_top_log_column_depth + !cz_top_log_radial_depth + !cz_top_luminosity ! Lsun + !cz_top_opacity + !cz_top_log_tau + !cz_top_eta + !cz_top_log_eps_nuc ! log10(ergs/g/s) + !cz_top_t_heat ! Cp*T/eps_nuc (seconds) + + !cz_top_csound + !cz_top_scale_height + !cz_top_grav + + !cz_top_omega + !cz_top_omega_div_omega_crit + + !cz_top_zone + !cz_top_zone_logdq + + ! mass fractions at top of largest convection zone (by mass) + !cz_top_log_xa h1 + !cz_top_log_xa he4 + +!---------------------------------------------------------------------------------------------- + +!# nuclear reactions + + !## integrated quantities + + !power_h_burn ! total thermal power from PP and CNO, excluding neutrinos (in Lsun units) + !power_he_burn ! total thermal power from triple-alpha, excluding neutrinos (in Lsun units) + !power_photo + !power_z_burn + !log_power_nuc_burn ! total thermal power from all burning, excluding photodisintegrations + log_LH ! log10 power_h_burn + log_LHe ! log10 power_he_burn + log_LZ ! log10 total burning power including LC, but excluding LH and LHe and photodisintegrations + log_Lnuc ! log(LH + LHe + LZ) + !log_Lnuc_ergs_s + !log_Lnuc_sub_log_L + !lnuc_photo + + !extra_L ! integral of extra_heat in Lsun units + !log_extra_L ! log10 extra_L + + !## neutrino losses + log_Lneu ! log10 power emitted in neutrinos, nuclear and thermal (in Lsun units) + !log_Lneu_nuc ! log10 power emitted in neutrinos, nuclear sources only (in Lsun units) + !log_Lneu_nonnuc ! log10 power emitted in neutrinos, thermal sources only (in Lsun units) + + !mass_loc_of_max_eps_nuc ! (in Msun units) + !mass_ext_to_max_eps_nuc ! (in Msun units) + !eps_grav_integral ! (in Lsun units) + !log_abs_Lgrav ! log10 abs(eps_grav_integral) (in Lsun units) + + !## information about reactions (by category) + + ! log10 total luminosity for reaction categories (Lsun units) + + pp + cno + tri_alpha + !c_alpha + !n_alpha + !o_alpha + !ne_alpha + !na_alpha + !mg_alpha + !si_alpha + !s_alpha + !ar_alpha + !ca_alpha + !ti_alpha + !fe_co_ni + !c12_c12 + !c12_o16 + !o16_o16 + !photo + !pnhe4 + !other + + !## information about individual reactions + + ! adds columns for all of the reactions that are in the current net + ! Note that if using op_split_burn=.true. then zones which have been split will report 0 for thier rates + !add_raw_rates ! raw reaction rates, reactions/second + !add_screened_rates ! screened reaction rates reactions/second + !add_eps_nuc_rates ! Nuclear energy (minus neutrino losses) released erg/s + !add_eps_neu_rates ! Neutrino losses erg/s + + ! individual reactions (as many as desired) + ! use list_net_reactions = .true. in star_job to list all reactions in the current net + ! reactions/second + !raw_rate r_h1_h1_ec_h2 + !raw_rate r_h1_h1_wk_h2 + + + + !## nuclear reactions at center + + ! center log10 burn erg/g/s for reaction categories + + !c_log_eps_burn cno + !c_log_eps_burn tri_alfa + + ! center d_eps_nuc_dlnd for reaction categories + + !c_d_eps_dlnd cno + !c_d_eps_dlnd tri_alfa + + ! center d_eps_nuc_dlnT for reaction categories + + !c_d_eps_dlnT cno + !c_d_eps_dlnT tri_alfa + + !## regions of strong nuclear burning + + ! 2 zones where eps_nuc > burn_min1 erg/g/s + ! for each zone have 4 numbers: start1, start2, end2, end1 + ! start1 is mass of inner edge where first goes > burn_min1 (or -20 if none such) + ! start2 is mass of inner edge where first zone reaches burn_min2 erg/g/sec (or -20 if none such) + ! end2 is mass of outer edge where first zone drops back below burn_min2 erg/g/s + ! end1 is mass of outer edge where first zone ends (i.e. eps_nuc < burn_min1) + ! similar for the second zone + + epsnuc_M_1 ! start1 for 1st zone + epsnuc_M_2 ! start2 + epsnuc_M_3 ! end2 + epsnuc_M_4 ! end1 + + epsnuc_M_5 ! start1 for 2nd zone + epsnuc_M_6 ! start2 + epsnuc_M_7 ! end2 + epsnuc_M_8 ! end1 + + + ! you might want to get a more complete list of burning regions by using the following + + !burning_regions + ! the is the number of regions to report + ! there will be 2* columns for this in the log file, 2 for each region. + ! the first column for a region gives int(sign(val)*log10(max(1,abs(val)))) + ! where val = ergs/gm/sec nuclear energy minus all neutrino losses. + ! the second column for a region gives the q location of the top of the region + ! entries for extra columns after the last region in the star will have a value of -9999 + ! all regions are included starting from the center, so the bottom of one region + ! is the top of the previous one. + ! since we start at the center, the bottom of the 1st region is q=0 and top of last is q=1. + + ! the columns in the log file will have names like 'burn_type_1' and 'burn_qtop_1' + + !burn_relr_regions + ! same as above, but locations given as r/rstar instead of m/mstar. + ! the columns in the log file will have names like 'burn_relr_type_1' and 'burn_relr_top_1' + + + ! if the star has too many regions to report them all, + ! the smallest regions will be merged with neighbors for reporting purposes only. + +!---------------------------------------------------------------------------------------------- + +!# information about core and envelope + + !## helium core + he_core_mass + he_core_radius + !he_core_lgT + !he_core_lgRho + !he_core_L + !he_core_v + !he_core_omega + !he_core_omega_div_omega_crit + !he_core_k + + !## CO core + co_core_mass + !CO_core + co_core_radius + !co_core_lgT + !co_core_lgRho + !co_core_L + !co_core_v + !co_core_omega + !co_core_omega_div_omega_crit + !co_core_k + + !## ONe core + one_core_mass + !one_core_radius + !one_core_lgT + !one_core_lgRho + !one_core_L + !one_core_v + !one_core_omega + !one_core_omega_div_omega_crit + !one_core_k + + !## iron core + fe_core_mass + !fe_core_radius + !fe_core_lgT + !fe_core_lgRho + !fe_core_L + !fe_core_v + !fe_core_omega + !fe_core_omega_div_omega_crit + !fe_core_k + + !## neuton rich core + neutron_rich_core_mass + !neutron_rich_core_radius + !neutron_rich_core_lgT + !neutron_rich_core_lgRho + !neutron_rich_core_L + !neutron_rich_core_v + !neutron_rich_core_omega + !neutron_rich_core_omega_div_omega_crit + !neutron_rich_core_k + + !## envelope + + !envelope_mass ! = star_mass - he_core_mass + !envelope_fraction_left ! = envelope_mass / (initial_mass - he_core_mass) + + !h_rich_layer_mass ! = star_mass - he_core_mass + !he_rich_layer_mass ! = he_core_mass - c_core_mass + !co_rich_layer_mass + +!---------------------------------------------------------------------------------------------- + +!# timescales + + !dynamic_timescale ! dynamic timescale (seconds) -- estimated by 2*pi*sqrt(r^3/(G*m)) + !kh_timescale ! kelvin-helmholtz timescale (years) + !mdot_timescale ! star_mass/abs(star_mdot) (years) + !kh_div_mdot_timescales ! kh_timescale/mdot_timescale + !nuc_timescale ! nuclear timescale (years) -- proportional to mass divided by luminosity + + !dt_cell_collapse ! min time for any cell to collapse at current velocities + !dt_div_dt_cell_collapse + + !dt_div_max_tau_conv ! dt/ maximum conv timescale + !dt_div_min_tau_conv ! dt/ minimum conv timescale + + + !min_dr_div_cs ! min over all cells of dr/csound (seconds) + !min_dr_div_cs_k ! location of min + !log_min_dr_div_cs ! log10 min dr_div_csound (seconds) + !min_dr_div_cs_yr ! min over all cells of dr/csound (years) + !log_min_dr_div_cs_yr ! log10 min dr_div_csound (years) + !dt_div_min_dr_div_cs + !log_dt_div_min_dr_div_cs + + !min_t_eddy ! minimum value of scale_height/conv_velocity + +!---------------------------------------------------------------------------------------------- + +!# conditions at or near the surface of the model + + !## conditions at the photosphere + !effective_T + !Teff + log_Teff ! log10 effective temperature + ! Teff is calculated using Stefan-Boltzmann relation L = 4 pi R^2 sigma Teff^4, + ! where L and R are evaluated at the photosphere (tau_factor < 1) + ! or surface of the model (tau_factor >= 1) when photosphere is not inside the model. + + !photosphere_black_body_T + !photosphere_cell_T ! temperature at model location closest to the photosphere, not necessarily Teff + !photosphere_cell_log_T + !photosphere_cell_density + !photosphere_cell_log_density + !photosphere_cell_opacity + !photosphere_cell_log_opacity + !photosphere_L ! Lsun units + !photosphere_log_L ! Lsun units + !photosphere_r ! Rsun units + !photosphere_log_r ! Rsun units + !photosphere_m ! Msun units + !photosphere_v_km_s + !photosphere_cell_k + !photosphere_column_density + !photosphere_csound + !photosphere_log_column_density + !photosphere_opacity + !photosphere_v_div_cs + !photosphere_xm + !photosphere_cell_free_e + !photosphere_cell_log_free_e + !photosphere_logg + !photosphere_T + + !## conditions at or near the surface of the model (outer edge of outer cell) + + luminosity ! luminosity in Lsun units + !luminosity_ergs_s ! luminosity in cgs units + log_L ! log10 luminosity in Lsun units + !log_L_ergs_s ! log10 luminosity in cgs units + radius ! Rsun + log_R ! log10 radius in Rsun units + !radius_cm + !log_R_cm + + log_g ! log10 gravity + gravity + log_Ledd + log_L_div_Ledd ! log10(L/Leddington) + lum_div_Ledd + !log_surf_optical_depth + !surface_optical_depth + + !log_surf_cell_opacity ! old name was log_surf_opacity + !log_surf_cell_P ! old name was log_surf_P + !log_surf_cell_pressure ! old name was log_surf_pressure + !log_surf_cell_density ! old name was log_surf_density + !log_surf_cell_temperature ! old name was log_surf_temperature + !surface_cell_temperature ! old name was surface_temperature + !log_surf_cell_z ! old name was log_surf_z + !surface_cell_entropy ! in units of kerg per baryon + ! old name was surface_entropy + + v_surf ! (cm/s) + v_surf_km_s ! (km/s) + v_div_csound_surf ! velocity divided by sound speed at outermost grid point + !v_div_csound_max ! max value of velocity divided by sound speed at face + !v_div_vesc + !v_phot_km_s + !v_surf_div_escape_v + + !v_surf_div_v_kh ! v_surf/(photosphere_r/kh_timescale) + + !surf_avg_j_rot + !surf_avg_omega + !surf_avg_omega_crit + !surf_avg_omega_div_omega_crit + !surf_avg_v_rot ! km/sec rotational velocity at equator + !surf_avg_v_crit ! critical rotational velocity at equator + !surf_avg_v_div_v_crit + !surf_avg_Lrad_div_Ledd + !surf_avg_logT + !surf_avg_logRho + !surf_avg_opacity + + ! Gravity Darkening, reports the surface averaged L/Lsun and Teff (K) caused by + ! gravity darkening in rotating stars. Based on the model of Espinosa Lara & Rieutord (2011) + ! 'polar' refers to the line of sight being directed along the rotation axis of the star + ! 'equatorial' refers to the line of sight coincident with the stellar equator + !grav_dark_L_polar !Lsun + !grav_dark_Teff_polar !K + !grav_dark_L_equatorial !Lsun + !grav_dark_Teff_equatorial !K + + !surf_escape_v ! cm/s + + !v_wind_Km_per_s ! Km/s + ! = 1d-5*s% opacity(1)*max(0d0,-s% mstar_dot)/ & + ! (4*pi*s% photosphere_r*Rsun*s% tau_base) + ! Lars says: + ! wind_mdot = 4*pi*R^2*rho*v_wind + ! tau = integral(opacity*rho*dr) from R to infinity + ! so tau = opacity*wind_mdot/(4*pi*R*v_wind) at photosphere + ! or v_wind = opacity*wind_mdot/(4*pi*R*tau) at photosphere + + !rotational_mdot_boost ! factor for increase in mass loss mdot due to rotation + !log_rotational_mdot_boost ! log factor for increase in mass loss mdot due to rotation + !surf_r_equatorial_div_r_polar + !surf_r_equatorial_div_r + !surf_r_polar_div_r + +!---------------------------------------------------------------------------------------------- + +!# conditions near center + + log_center_T ! temperature + log_center_Rho ! density + log_center_P ! pressure + + ! shorter names for above + log_cntr_P + log_cntr_Rho + log_cntr_T + + !center_T ! temperature + !center_Rho ! density + !center_P ! pressure + + !center_degeneracy ! the electron chemical potential in units of k*T + !center_gamma ! plasma interaction parameter + center_mu + center_ye + center_abar + !center_zbar + + !center_eps_grav + + !center_non_nuc_neu + !center_eps_nuc + !d_center_eps_nuc_dlnT + !d_center_eps_nuc_dlnd + !log_center_eps_nuc + + !center_entropy ! in units of kerg per baryon + !max_entropy ! in units of kerg per baryon + !fe_core_infall + !non_fe_core_infall + !non_fe_core_rebound + !max_infall_speed + + !compactness_parameter ! (m/Msun)/(R(m)/1000km) for m = 2.5 Msun + !compactness + !m4 ! Mass co-ordinate where entropy=4 + ! mu4 is sensitive to the choice of how much dm/dr you average over, thus we average dm and dr over M(entropy=4) and M(entropy=4)+0.3Msun + !mu4 ! dM(Msun)/dr(1000km) where entropy=4 + + + !center_omega + !center_omega_div_omega_crit + +!---------------------------------------------------------------------------------------------- + +!# abundances + + !species ! size of net + + !## mass fractions near center + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_center_abundances + !add_log_center_abundances + + ! individual central mass fractions (as many as desired) + center h1 + center he4 + center c12 + center o16 + + ! individual log10 central mass fractions (as many as desired) + !log_center h1 + !log_center he4 + ! etc. + + + !## mass fractions near surface + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_surface_abundances + !add_log_surface_abundances + + ! individual surface mass fractions (as many as desired) + !surface h1 + !surface he4 + surface c12 + surface o16 + ! etc. + + ! individual log10 surface mass fractions (as many as desired) + + !log_surface h1 + !log_surface he4 + + + !## mass fractions for entire star + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_average_abundances + !add_log_average_abundances + + ! individual average mass fractions (as many as desired) + !average h1 + !average he4 + ! etc. + + ! individual log10 average mass fractions (as many as desired) + !log_average h1 + !log_average he4 + ! etc. + + + !## mass totals for entire star (in Msun units) + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_total_mass + !add_log_total_mass + + ! individual mass totals for entire star (as many as desired) + total_mass h1 + total_mass he4 + ! etc. + + ! individial log10 mass totals for entire star (in Msun units) + !log_total_mass h1 + !log_total_mass he4 + ! etc. + +!---------------------------------------------------------------------------------------------- + +!# info at specific locations + + !## info at location of max temperature + !max_T + !log_max_T + + +!---------------------------------------------------------------------------------------------- + +!# information about shocks + + !## info about outermost outward moving shock + ! excluding locations with q > max_q_for_outer_mach1_location + ! returns values at location of max velocity + !shock_mass ! baryonic (Msun) + !shock_mass_gm ! baryonic (grams) + !shock_q + !shock_radius ! (Rsun) + !shock_radius_cm ! (cm) + !shock_velocity + !shock_csound + !shock_v_div_cs + !shock_lgT + !shock_lgRho + !shock_lgP + !shock_gamma1 + !shock_entropy + !shock_tau + !shock_k + !shock_pre_lgRho + +!---------------------------------------------------------------------------------------------- + +!# asteroseismology + + !delta_nu ! large frequency separation for p-modes (microHz) + ! 1e6/(seconds for sound to cross diameter of star) + !delta_Pg ! g-mode period spacing for l=1 (seconds) + ! sqrt(2) pi^2/(integral of brunt_N/r dr) + !log_delta_Pg + !nu_max ! estimate from scaling relation (microHz) + ! nu_max = nu_max_sun * M/Msun / ((R/Rsun)^2 (Teff/Teff_sun)^0.5) + ! with nu_max_sun = 3100 microHz, Teff_sun = 5777 + !nu_max_3_4th_div_delta_nu ! nu_max^0.75/delta_nu + !acoustic_cutoff ! 0.5*g*sqrt(gamma1*rho/P) at surface + !acoustic_radius ! integral of dr/csound (seconds) + !ng_for_nu_max ! = 1 / (nu_max*delta_Pg) + ! period for g-mode with frequency nu_max = nu_max_ng*delta_Pg + !gs_per_delta_nu ! delta_nu / (nu_max**2*delta_Pg) + ! number of g-modes per delta_nu at nu_max + + !int_k_r_dr_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=1 + !int_k_r_dr_2pt0_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=1 + !int_k_r_dr_0pt5_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=1 + !int_k_r_dr_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=2 + !int_k_r_dr_2pt0_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=2 + !int_k_r_dr_0pt5_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=2 + !int_k_r_dr_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=3 + !int_k_r_dr_2pt0_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=3 + !int_k_r_dr_0pt5_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=3 + +!---------------------------------------------------------------------------------------------- + +!# energy information + + !total_energy ! at end of step + !log_total_energy ! log(abs(total_energy)) + !total_energy_after_adjust_mass ! after mass adjustments + + ! shorter versions of above + !tot_E + !log_tot_E + + + !total_gravitational_energy + !log_total_gravitational_energy ! log(abs(total_gravitational_energy)) + !total_gravitational_energy_after_adjust_mass + + ! shorter versions of above + !tot_PE + !log_tot_PE + + !total_internal_energy + !log_total_internal_energy + !total_internal_energy_after_adjust_mass + + ! shorter versions of above + !tot_IE + !log_tot_IE + + !total_radial_kinetic_energy + !log_total_radial_kinetic_energy + !total_radial_kinetic_energy_after_adjust_mass + + ! shorter versions of above (does not include rot KE) + !tot_KE + !log_tot_KE + + !total_turbulent_energy + !log_total_turbulent_energy + !total_turbulent_energy_after_adjust_mass + !tot_Et + !log_tot_Et + + !total_energy_foe + + !tot_IE_div_IE_plus_KE + !total_IE_div_IE_plus_KE + + !total_entropy + !total_eps_grav + + !total_energy_sources_and_sinks ! for this step + !total_nuclear_heating + !total_non_nuc_neu_cooling + !total_irradiation_heating + !total_extra_heating ! extra heat integrated over the model times dt (erg) + !total_WD_sedimentation_heating + + !rel_run_E_err + + !rel_E_err + !abs_rel_E_err + !log_rel_E_err + + !tot_e_equ_err + !tot_e_err + + + !error_in_energy_conservation ! for this step + ! = total_energy - (total_energy_start + total_energy_sources_and_sinks) + !cumulative_energy_error ! = sum over all steps of abs(error_in_energy_conservation) + !rel_cumulative_energy_error ! = cumulative_energy_error/total_energy + !log_rel_cumulative_energy_error ! = log10 of rel_cumulative_energy_error + !log_rel_run_E_err ! shorter name for rel_cumulative_energy_error + + !rel_error_in_energy_conservation ! = error_in_energy_conservation/total_energy + !log_rel_error_in_energy_conservation + + !virial_thm_P_avg + !virial_thm_rel_err + !work_inward_at_center + !work_outward_at_surface + + +!---------------------------------------------------------------------------------------------- + + !# rotation + + !total_angular_momentum + log_total_angular_momentum + !i_rot_total ! moment of inertia + + !total_rotational_kinetic_energy + !log_total_rotational_kinetic_energy + !total_rotational_kinetic_energy_after_adjust_mass + +!---------------------------------------------------------------------------------------------- + +!# velocities + + !avg_abs_v_div_cs + !log_avg_abs_v_div_cs + !max_abs_v_div_cs + !log_max_abs_v_div_cs + + !avg_abs_v + !log_avg_abs_v + !max_abs_v + !log_max_abs_v + + !u_surf + !u_surf_km_s + !u_div_csound_surf + !u_div_csound_max + + !infall_div_cs + +!---------------------------------------------------------------------------------------------- + +!# misc + + !e_thermal ! sum over all zones of Cp*T*dm + + !## eos + !logQ_max ! logQ = logRho - 2*logT + 12 + !logQ_min + !gamma1_min + + !## core mixing + !mass_semiconv_core + + !## H-He boundary + + !diffusion_time_H_He_bdy + !temperature_H_He_bdy + + + !## optical depth and opacity + + !one_div_yphot + !log_one_div_yphot + + !log_min_opacity + !min_opacity + + !log_tau_center + + !log_max_tau_conv + !max_tau_conv + !log_min_tau_conv + !min_tau_conv + + !tau_qhse_yrs + + !## other + + !Lsurf_m + !dlnR_dlnM + !h1_czb_mass ! location (in Msun units) of base of 1st convection zone above he core + !kh_mdot_limit + !log_cntr_dr_cm + !min_Pgas_div_P + !surf_c12_minus_o16 ! this is useful for seeing effects of dredge up on AGB + !surf_num_c12_div_num_o16 + + !phase_of_evolution ! Integer mapping to the type of evolution see star_data/public/star_data_def.inc for definitions + + !## MLT++ + !gradT_excess_alpha + !gradT_excess_min_beta + !gradT_excess_max_lambda + + !max_L_rad_div_Ledd + !max_L_rad_div_Ledd_div_phi_Joss + + + !## RTI + !rti_regions + + !## Ni & Co + !total_ni_co_56 + + + !## internal structure constants + + ! this is evaluated assuming a spherical star and does not account for rotation + !apsidal_constant_k2 + + +!---------------------------------------------------------------------------------------------- + +!# accretion + + !k_below_const_q + !q_below_const_q + !logxq_below_const_q + + !k_const_mass + !q_const_mass + !logxq_const_mass + + !k_below_just_added + !q_below_just_added + !logxq_below_just_added + + !k_for_test_CpT_absMdot_div_L + !q_for_test_CpT_absMdot_div_L + !logxq_for_test_CpT_absMdot_div_L + +!---------------------------------------------------------------------------------------------- + +!# Color output + + ! Outputs the bolometric correction (bc) for the star in filter band ``filter'' (case sensitive) + !bc filter + + ! Outputs the absolute magnitude for the star in filter band ``filter'' (case sensitive) + !abs_mag filter + + ! Adds all the bc's to the output + add_bc + + ! Adds all the absolute magnitudes to the output + add_abs_mag + + ! Outputs luminosity in filter band ``filter'' (erg s^-1) (case sensitive) + !lum_band filter + + ! Adds all the filter band luminosities to the output (erg s^-1) + add_lum_band + + ! Outputs log luminosity in filter band ``filter'' (log erg s^-1) (case sensitive) + !log_lum_band filter + + ! Adds all the filter band luminosities to the output (log erg s^-1) + add_log_lum_band + +!---------------------------------------------------------------------------------------------- + +!# RSP + + !rsp_DeltaMag ! absolute magnitude difference between minimum and maximum light (mag) + !rsp_DeltaR ! R_max - R_min difference in the max and min radius (Rsun) + !rsp_GREKM ! fractional growth of the kinetic energy per pulsation period ("nonlinear growth rate") - see equation 5 in MESA5 + !rsp_num_periods ! Count of the number of pulsation cycles completed + !rsp_period_in_days ! Running period, ie., period between two consecutive values of R_max (days) + !rsp_phase ! Running pulsation phase for a cycle + +!---------------------------------------------------------------------------------------------- +!# debugging + + !## retries + num_retries ! total during the run + + !## solver iterations + + num_iters ! same as num_solver_iterations + !num_solver_iterations ! iterations at this step + !total_num_solver_iterations ! total iterations during the run + !avg_num_solver_iters + + !rotation_solver_steps + + !diffusion_solver_steps + !diffusion_solver_iters + + !avg_setvars_per_step + !avg_skipped_setvars_per_step + !avg_solver_setvars_per_step + + !burn_solver_maxsteps + + !total_num_solver_calls_converged + !total_num_solver_calls_failed + !total_num_solver_calls_made + !total_num_solver_relax_calls_converged + !total_num_solver_relax_calls_failed + !total_num_solver_relax_calls_made + !total_num_solver_relax_iterations + + !total_step_attempts + !total_step_redos + !total_step_retries + !total_steps_finished + !total_steps_taken + + !TDC_num_cells + + !## Relaxation steps + !total_relax_step_attempts + !total_relax_step_redos + !total_relax_step_retries + !total_relax_steps_finished + !total_relax_steps_taken + + !## conservation during mesh adjust + !log_mesh_adjust_IE_conservation + !log_mesh_adjust_KE_conservation + !log_mesh_adjust_PE_conservation + + !## amr + !num_hydro_merges + !num_hydro_splits + + !## timing + !elapsed_time ! time since start of run (seconds) + + !## Extras + burning_regions 40 + mixing_regions 40 + mix_relr_regions 40 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_extra b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_extra new file mode 100644 index 000000000..6ef3c45fc --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_extra @@ -0,0 +1,27 @@ + +&star_job +!new_Z = 1.42d-2 +!new_omega_div_omega_crit = 0.10d0 + initial_zfracs = 6 ! Added by eb + +/ ! end of controls namelist + +&kap +kap_file_prefix = 'a09' ! 'gs98' 'a09' 'OP_a09' 'OP_gs98' +kap_CO_prefix = 'a09_co' ! 'gs98_co' 'a09_co' +Zbase = 0.0142d0 !0.0142d0 +kap_lowT_prefix = 'lowT_fa05_a09p' +!AESOPUS_filename = 'AESOPUS_AGSS09.h5' ! used only if kap_lowT_prefix = 'AESOPUS' +use_Type2_opacities = .true. + +!cubic_interpolation_in_X = .true. +!cubic_interpolation_in_Z = .true. + +/ ! end of kap namelist + +&controls +initial_mass = 20d0 +initial_Y = 0.2703d0 !0.2703 !0.99858d0 +initial_Z = 0.0142d0 !0.0142d0 +!initial_he3 = 0d0 +/ ! end of controls namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_pgstar b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_pgstar new file mode 100644 index 000000000..ed58f4b38 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_pgstar @@ -0,0 +1,761 @@ + +&pgstar + +!pause = .true. + +pgstar_interval = 10 ! making this too small slows the model down. +pgstar_show_age_in_years = .true. +pgstar_show_age_in_seconds = .false. +pgstar_sleep = 0.0 + +! some global grid plot settings at end + +pgstar_show_model_number = .false. +pgstar_show_age = .false. + +!------------------------------------------------------------------------------------ + +Grid1_win_flag = .true. +Grid1_win_width = 12 +Grid1_win_aspect_ratio = 0.666 + +! file output +Grid1_file_flag = .true. +Grid1_file_dir = 'png' +Grid1_file_prefix = 'Grid1_' +Grid1_file_interval = 10 ! output when mod(model_number,Grid1_file_interval)==0 +Grid1_file_width = 27 ! (inches) negative means use same value as for window +Grid1_file_aspect_ratio = -1 ! negative means use same value as for window + +! reset the defaults + +Grid1_plot_name(:) = '' +Grid1_plot_row(:) = 1 ! number from 1 at top +Grid1_plot_rowspan(:) = 1 ! plot spans this number of rows +Grid1_plot_col(:) = 1 ! number from 1 at left +Grid1_plot_colspan(:) = 1 ! plot spans this number of columns +Grid1_plot_pad_left(:) = 0.0 ! fraction of full window width for padding on left +Grid1_plot_pad_right(:) = 0.0 ! fraction of full window width for padding on right +Grid1_plot_pad_top(:) = 0.0 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(:) = 0.0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(:) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_title = '' + +Grid1_num_cols = 3 ! divide plotting region into this many equal width cols +Grid1_num_rows = 5 ! divide plotting region into this many equal height rows +Grid1_num_plots = 6 ! <= 10 + + +Grid1_plot_name(1) = 'Text_Summary1' +Grid1_plot_row(1) = 1 ! number from 1 at top +Grid1_plot_rowspan(1) = 1 ! plot spans this number of rows +Grid1_plot_col(1) = 1 ! number from 1 at left +Grid1_plot_colspan(1) = 3 ! plot spans this number of columns + +Grid1_plot_pad_left(1) = -0.03 ! fraction of full window width for padding on left +Grid1_plot_pad_right(1) = 0.0 ! fraction of full window width for padding on right +Grid1_plot_pad_top(1) = -0.06 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(1) = 0.07 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(1) = 1 ! 0.8 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(3) = 'HR' +Grid1_plot_row(3) = 2 ! number from 1 at top +Grid1_plot_rowspan(3) = 1 ! plot spans this number of rows +Grid1_plot_col(3) = 1 ! number from 1 at left +Grid1_plot_colspan(3) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(3) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(3) = 0.08 ! fraction of full window width for padding on right +Grid1_plot_pad_top(3) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(3) = 0.01 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(3) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(5) = 'Profile_Panels1' +Grid1_plot_row(5) = 3 ! number from 1 at top +Grid1_plot_rowspan(5) = 3 ! plot spans this number of rows +Grid1_plot_col(5) = 1 ! number from 1 at left +Grid1_plot_colspan(5) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(5) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(5) = 0.10 ! fraction of full window width for padding on right +Grid1_plot_pad_top(5) = 0.05 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(5) = 0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(5) = 0.6 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(2) = 'TRho_Profile' +Grid1_plot_row(2) = 2 ! number from 1 at top +Grid1_plot_rowspan(2) = 1 ! plot spans this number of rows +Grid1_plot_col(2) = 2 ! number from 1 at left +Grid1_plot_colspan(2) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(2) = -0.01 ! fraction of full window width for padding on left +Grid1_plot_pad_right(2) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(2) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(2) = 0.01 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(2) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(4) = 'History_Panels1' +Grid1_plot_row(4) = 3 ! number from 1 at top +Grid1_plot_rowspan(4) = 3 ! plot spans this number of rows +Grid1_plot_col(4) = 2 ! number from 1 at left +Grid1_plot_colspan(4) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(4) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(4) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(4) = 0.05 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(4) = 0.0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(4) = 0.6 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(6) = 'Profile_Panels3' +Grid1_plot_row(6) = 2 ! number from 1 at top +Grid1_plot_rowspan(6) = 4 ! plot spans this number of rows +Grid1_plot_col(6) = 3 ! Number from 1 at left +Grid1_plot_colspan(6) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(6) = 0.04 ! fraction of full window width for padding on left +Grid1_plot_pad_right(6) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(6) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(6) = 0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(6) = 0.6 ! multiply txt_scale for subplot by this + + +!------------------------------------------------------------------------------------ + +Profile_Panels3_win_flag = .false. + +Profile_Panels3_title = '' + +Profile_Panels3_num_panels = 5 + +Profile_Panels3_yaxis_name(1) = 'Abundance' + +Profile_Panels3_yaxis_name(2) = 'Power' + +Profile_Panels3_yaxis_name(3) = 'Mixing' +Mixing_legend_txt_scale_factor = 0.9 + +Profile_Panels3_yaxis_name(4) = 'conv_vel_div_csound'!'conv_vel'!'logRho' +Profile_Panels3_other_yaxis_name(4) = 'v_div_cs' ! 'vel_km_per_s' ! 'entropy' +Profile_Panels3_other_dymin(4) = 0.14 + +Profile_Panels3_yaxis_name(5) = 'Frad_div_cUrad'!'lum_div_Ledd'!'log_csound'!'logT' +Profile_Panels3_other_yaxis_name(5) = 'vel_km_per_s'!'burn_num_iters' + Profile_Panels3_yaxis_log(5) = .false. + +! x-axis limits and properties +Profile_Panels3_xaxis_name = 'logtau'!'zone'!'radius' +Profile_Panels3_xmin = -101d0 +Profile_Panels3_xmax = -101d0 !1700! -101d0 ! 2.2 +Profile_Panels3_xaxis_reversed = .true. + + +Profile_Panels3_txt_scale = 0.7 + +!Profile_Panels3_xaxis_name = 'zone' +!Profile_Panels3_xmin = 800 +!Profile_Panels3_xmax = 1100 +!Profile_Panels3_xaxis_reversed = .true. + +!Profile_Panels3_show_grid = .true. +Profile_Panels3_show_mix_regions_on_xaxis = .true. + +!------------------------------------------------------------------------------------ + +!Profile_Panels1_win_flag = .true. +!Profile_Panels1_file_flag = .true. + Profile_Panels1_file_dir = 'png' + Profile_Panels1_file_prefix = 'profile_panels1_' + Profile_Panels1_file_interval = 1 + Profile_Panels1_file_width = -1 + Profile_Panels1_file_aspect_ratio = -1 + +Profile_Panels1_title = '' + +Profile_Panels1_txt_scale = 0.7 +Profile_Panels1_num_panels = 4 + +Profile_Panels1_yaxis_name(1) = 'Lc_div_L'!'vel_km_per_s' +!Profile_Panels1_dymin(1) = 0.14 +Profile_Panels1_other_yaxis_name(1) = 'lum_conv'!'Lc_div_L' +!Profile_Panels1_other_dymin(1) = 0.14 +!Profile_Panels1_other_ymax(1) = 500 +!Profile_Panels1_other_ymin(1) = -100 +!Profile_Panels1_ymax(1) = 100 +!Profile_Panels1_other_ymin(1) = -100 +!Profile_Panels1_other_yaxis_log = .true. + +Profile_Panels1_yaxis_name(2) = 'logT'!'pressure'!'logT'!'logdq'!'radius'!'entropy' +Profile_Panels1_other_yaxis_name(2) = 'Lc_div_L'!'mlt_Pturb'! 'Lc_div_L'!'log_dt_cs_div_dr' +!Profile_Panels1_other_yaxis_log(2) = .true. +!Profile_Panels1_yaxis_log(2) = .true. +!Profile_Panels1_other_ymax(2) = 0.3 +!Profile_Panels1_other_ymin(2) = -5 +!Profile_Panels1_ymin(2) = -5 +!Profile_Panels1_same_yaxis_range(2) = .true. + +!Profile_Panels1_ymax(2) = 4.5 +!Profile_Panels1_other_ymax(2) = 2 + +Profile_Panels1_yaxis_name(3) = 'mlt_Y_face'!'gradT' +Profile_Panels1_other_yaxis_name(3) = 'conv_vel'!'lum_div_Ledd'!'grada' +Profile_Panels1_same_yaxis_range(3) = .false. +Profile_Panels1_other_dymin(3) = 0.08 +!Profile_Panels1_yaxis_log(3) = .false. +Profile_Panels1_ymax(3) =-101d0 + +Profile_Panels1_yaxis_name(4) = 'log_opacity' +!Profile_Panels1_ymin(4) = 0 +Profile_Panels1_dymin(4) = 0.14 +Profile_Panels1_other_yaxis_name(4) = 'gradr' +Profile_Panels1_other_dymin(4) = 0.14 + +! x-axis limits and properties +Profile_Panels1_xaxis_name = 'logtau'!'zone' +Profile_Panels1_xmin = -101d0!-101d0 +Profile_Panels1_xmax = -101d0!9d0 !-101d0 !8.1 +Profile_Panels1_xaxis_reversed = .true. + +!Profile_Panels1_xaxis_name = 'zone' +!Profile_Panels1_xmin = 15 +!Profile_Panels1_xmax = 270 +!Profile_Panels1_xaxis_reversed = .true. + +!Profile_Panels1_show_grid = .true. +Profile_Panels1_show_mix_regions_on_xaxis = .true. + +!------------------------------------------------------------------------------------ + + +!TRho_Profile_win_flag = .true. +TRho_Profile_win_width = 8 +TRho_Profile_win_aspect_ratio = 0.75 ! aspect_ratio = height/width + +! file output +!TRho_Profile_file_flag = .true. +TRho_Profile_file_dir = 'TRho' +TRho_Profile_file_prefix = 'trho_' +TRho_Profile_file_interval = 10 ! output when `mod(model_number,TRho_Profile_file_interval)==0` +TRho_Profile_file_width = -1 ! (inches) negative means use same value as for window +TRho_Profile_file_aspect_ratio = -1 ! negative means use same value as for window + +TRho_Profile_xleft = 0.15 +TRho_Profile_xright = 0.85 +TRho_Profile_ybot = 0.15 +TRho_Profile_ytop = 0.85 +TRho_Profile_txt_scale = 0.7 +TRho_Profile_title = ' ' + +TRho_switch_to_Column_Depth = .false. +TRho_switch_to_mass = .false. + +show_TRho_Profile_legend = .false. + TRho_Profile_legend_coord = 0.07 + TRho_Profile_legend_fjust = 0.0 + TRho_Profile_legend_disp1 = -2.0 + TRho_Profile_legend_del_disp = -1.3 + TRho_Profile_legend_txt_scale = 1.1 + + +show_TRho_Profile_text_info = .false. + TRho_Profile_text_info_xfac = 0.77 ! controls x location + TRho_Profile_text_info_dxfac = 0.02 ! controls x spacing to value from text + TRho_Profile_text_info_yfac = 0.6 ! controls y location of 1st line + TRho_Profile_text_info_dyfac = -0.04 ! controls line spacing + +show_TRho_Profile_mass_locs = .false. +show_TRho_accretion_mesh_borders = .false. +show_TRho_Profile_kap_regions = .false. +show_TRho_Profile_gamma1_4_3rd = .true. +show_TRho_Profile_eos_regions = .false. +show_TRho_Profile_degeneracy_line = .true. +show_TRho_Profile_Pgas_Prad_line = .true. +show_TRho_Profile_burn_lines = .true. +show_TRho_Profile_burn_labels = .true. + +! axis limits +TRho_Profile_xmin = -20.0 +TRho_Profile_xmax = 0!5d0!10.0 +TRho_Profile_ymin = 2.5 +TRho_Profile_ymax = 7.5!8.5d0!10.0 + +! these are shown if show_TRho_Profile_mass_locs = .true. +! set all the entries +profile_mass_point_q = -1 +profile_mass_point_color_index = 1 +profile_mass_point_symbol = -6 +profile_mass_point_symbol_scale = 1.7 +profile_mass_point_str = '' +profile_mass_point_str_clr = 1 +profile_mass_point_str_scale = 1.0 + +! set defaults +num_profile_mass_points = 3 ! max is defined in star_def (max_num_profile_mass_points) + +profile_mass_point_q(1) = 0.5 +profile_mass_point_color_index(1) = 1 +profile_mass_point_symbol(1) = -6 +profile_mass_point_str(1) = ' 0.5 M\d\(0844)\u' +profile_mass_point_str_clr(1) = 1 + +profile_mass_point_q(2) = 0.95 +profile_mass_point_color_index(2) = 1 +profile_mass_point_symbol(2) = -6 +profile_mass_point_str(2) = ' 0.95 M\d\(0844)\u' +profile_mass_point_str_clr(3) = 1 + +profile_mass_point_q(3) = 0.999 +profile_mass_point_color_index(3) = 1 +profile_mass_point_symbol(3) = -6 +profile_mass_point_str(3) = ' 0.999 M\d\(0844)\u' +profile_mass_point_str_clr(3) = 1 + +!------------------------------------------------------------------------------------ + + +! Text_Summary windows + +Text_Summary1_win_flag = .false. +Text_Summary1_win_width = 10 +Text_Summary1_win_aspect_ratio = 0.15 + +Text_Summary1_xleft = 0.01 +Text_Summary1_xright = 0.99 +Text_Summary1_ybot = 0.0 +Text_Summary1_ytop = 1.0 +Text_Summary1_txt_scale = 0.95 +Text_Summary1_title = '' + +Text_Summary1_num_rows = 6 ! <= 20 +Text_Summary1_num_cols = 5 ! <= 20 +Text_Summary1_name(:,:) = '' + + +Text_Summary1_name(1,1) = 'model_number' +Text_Summary1_name(1,2) = 'log_dt' +Text_Summary1_name(1,3) = 'Mass' +Text_Summary1_name(1,4) = 'H_cntr' +Text_Summary1_name(1,5) = 'H_rich' + +Text_Summary1_name(2,1) = 'non_fe_core_infall' +Text_Summary1_name(2,2) = 'star_age' +Text_Summary1_name(2,3) = 'lg_Mdot' +Text_Summary1_name(2,4) = 'He_cntr' +Text_Summary1_name(2,5) = 'He_core' + +Text_Summary1_name(3,1) = 'KE_growth_avg' +Text_Summary1_name(3,2) = 'growth' +Text_Summary1_name(3,3) = 'eta_cntr' +Text_Summary1_name(3,4) = 'C_cntr' +Text_Summary1_name(3,5) = 'CO_core' + +Text_Summary1_name(4,1) = 'period'!'log_max_T' +Text_Summary1_name(4,2) = 'log_LH' +Text_Summary1_name(4,3) = 'lg_Lnuc_tot' +Text_Summary1_name(4,4) = 'O_cntr' +Text_Summary1_name(4,5) = 'radius' + +Text_Summary1_name(5,1) = 'num_periods' +Text_Summary1_name(5,2) = 'log_LHe' +Text_Summary1_name(5,3) = 'lg_Lneu' +Text_Summary1_name(5,4) = 'Ne_cntr' +Text_Summary1_name(5,5) = 'zones' + +Text_Summary1_name(6,1) = 'log_cntr_Rho' +Text_Summary1_name(6,2) = 'log_LZ' +Text_Summary1_name(6,3) = 'lg_Lphoto' +Text_Summary1_name(6,4) = 'retries' +Text_Summary1_name(6,5) = 'log_cntr_T' + + +!------------------------------------------------------------------------------------ + +! Abundance profile plot + +Abundance_win_flag = .false. + +! window properties +Abundance_win_width = 10 +Abundance_win_aspect_ratio = 0.75 + +Abundance_xleft = 0.15 +Abundance_xright = 0.85 +Abundance_ybot = 0.15 +Abundance_ytop = 0.85 +Abundance_txt_scale = 1.1 +Abundance_title = '' + +! isotopes to plot + +Abundance_num_isos_to_show = 20 + +Abundance_which_isos_to_show(1) = 'h1' +Abundance_which_isos_to_show(2) = 'he3' +Abundance_which_isos_to_show(3) = 'he4' +Abundance_which_isos_to_show(4) = 'c12' +Abundance_which_isos_to_show(5) = 'n14' +Abundance_which_isos_to_show(6) = 'o16' +Abundance_which_isos_to_show(7) = 'ne20' +Abundance_which_isos_to_show(8) = 'mg24' +Abundance_which_isos_to_show(9) = 'si28' +Abundance_which_isos_to_show(10) = 's32' +Abundance_which_isos_to_show(11) = 'ar36' +Abundance_which_isos_to_show(12) = 'ca40' +Abundance_which_isos_to_show(13) = 'ti44' +Abundance_which_isos_to_show(14) = 'cr48' +Abundance_which_isos_to_show(15) = 'cr56' +Abundance_which_isos_to_show(16) = 'fe52' +Abundance_which_isos_to_show(17) = 'fe54' +Abundance_which_isos_to_show(18) = 'fe56' +Abundance_which_isos_to_show(19) = 'ni56' +Abundance_which_isos_to_show(20) = 'neut' +!Abundance_which_isos_to_show(22) = 'ne22' + + + +! number and size of isotope labels along curves +num_abundance_line_labels = 4 +Abundance_line_txt_scale_factor = 1.1 + + +! number and size of isotopes on legend +Abundance_legend_max_cnt = 10 +Abundance_legend_txt_scale_factor = 1.3 + +! yaxis limits +Abundance_log_mass_frac_min = -4!-6.4 ! -3.5 +Abundance_log_mass_frac_max = 0.3 + +! file output +Abundance_file_flag = .false. +Abundance_file_dir = 'Abundance' +Abundance_file_prefix = 'abund_' +Abundance_file_width = -1 ! (inches) negative means use same value as for window +Abundance_file_aspect_ratio = -1 ! negative means use same value as for window + + +!------------------------------------------------------------------------------------ + +! power plot + +Power_win_flag = .false. +Power_win_width = 10 +Power_win_aspect_ratio = 0.75 +Power_title = '' + +Power_xleft = 0.15 +Power_xright = 0.85 +Power_ybot = 0.15 +Power_ytop = 0.85 +Power_txt_scale = 1.1 +Power_title = ' ' + +Power_legend_max_cnt = 10 +Power_legend_txt_scale_factor = 1.3 ! relative to other text + +! power yaxis limits -- to override system default selections +Power_ymin = -5.0 ! -101d0 ! only used if /= -101d0 +Power_ymax = 25.0 ! -101d0 ! only used if /= -101d0 + +! file output +Power_file_flag = .false. +Power_file_dir = 'png' +Power_file_prefix = 'power_' +Power_file_interval = 5 ! output when mod(model_number,Power_file_interval)==0 +Power_file_width = -1 ! (inches) negative means use same value as for window +Power_file_aspect_ratio = -1 ! negative means use same value as for window + + +!------------------------------------------------------------------------------------ + +! mixing plot + +Mixing_xmin = 0.0 +Mixing_xmax = 1.6 ! -101d0 +Mixing_legend_txt_scale_factor = 1.4 ! relative to other text + +Mixing_show_rotation_details = .false. + +!Mixing_win_flag = .true. +!Mixing_file_flag = .true. +Mixing_file_dir = 'png' +Mixing_file_prefix = 'mixing_' +Mixing_file_interval = 1 ! output when `mod(model_number,Mixing_file_interval)==0` +Mixing_file_width = -1 ! (inches) negative means use same value as for window +Mixing_file_aspect_ratio = -1 ! negative means use same value as for window + + +!----------------------------------------------------------------------- + +! TRho window + ! history of central temperature vs. density + + TRho_txt_scale = 0.7 + TRho_title = '' + + TRho_logT_min = -101d0 + TRho_logT_max = -101d0 + TRho_logRho_min = -101d0 + TRho_logRho_max = -101d0 + show_TRho_degeneracy_line = .true. + + + +!----------------------------------------------------------------------- + + !# HR window + ! history of `lg_L` vs. `lg_Teff` + + HR_win_flag = .true. + + HR_win_width = 12 + HR_win_aspect_ratio = 0.75 ! aspect_ratio = height/width + + HR_xleft = 0.15 + HR_xright = 0.85 + HR_ybot = 0.15 + HR_ytop = 0.85 + HR_txt_scale = 0.7 !1.0 + HR_title = '' + + ! axis limits -- to override system default selections + ! HR_logT_min = -101d0 ! only used if /= -101d0 + ! HR_logT_max = -101d0 ! only used if /= -101d0 + ! HR_logL_min = -101d0 ! only used if /= -101d0 + ! HR_logL_max = -101d0 ! only used if /= -101d0 + + + + History_Panels1_xaxis_name = 'yr_since_coll' + + + ! axis limits -- to override system default selections + HR_logT_min = -101d0!3.3 !-101d0 ! only used if /= -101d0 + HR_logT_max = -101d0!3.9!-101d0 ! only used if /= -101d0 + HR_logL_min = -101d0!4.4!-101d0 ! only used if /= -101d0 + HR_logL_max = -101d0!5.5!-101d0 ! only used if /= -101d0 + + ! axis limits -- to override system default selections + HR_logT_min = -101d0 ! only used if /= -101d0 + HR_logT_max = -101d0 ! only used if /= -101d0 + HR_logL_min = -101d0 ! only used if /= -101d0 + HR_logL_max = -101d0 ! only used if /= -101d0 + + HR_logL_margin = 0.1 + HR_logT_margin = 0.1 + HR_dlogT_min = -1 + HR_dlogL_min = -1 + + HR_step_min = -1 ! only plot models with model number >= this + HR_step_max = -1 ! only plot models with model number <= this + + show_HR_classical_instability_strip = .true. + show_HR_Mira_instability_region = .false. + show_HR_WD_instabilities = .false. + + show_HR_target_box = .false. + HR_target_n_sigma = -3 ! -n means show sig 1..n + HR_target_logL = 0 + HR_target_logL_sigma = 0 + HR_target_logT = 0 + HR_target_logT_sigma = 0 + + show_HR_annotation1 = .false. + show_HR_annotation2 = .false. + show_HR_annotation3 = .false. + + HR_fname = '' ! file name for extra HR data + + ! Enables calling a subroutine to add extra information to a plot + ! see `$MESA_DIR/star/other/pgstar_decorator.f90` + HR_use_decorator = .false. + + + ! file output + HR_file_flag = .true. + HR_file_dir = 'hr_png' + HR_file_prefix = 'hr_' + HR_file_interval = 10 ! output when `mod(model_number,HR_file_interval)==0` + HR_file_width = 27 ! (inches) negative means use same value as for window + HR_file_aspect_ratio = -1 ! negative means use same value as for window + +!----------------------------------------------------------------------- + + History_Panels1_title = '' + + History_Panels1_xaxis_name = 'model_number'!'model_number' + History_Panels1_max_width = 2000! 10000 + + !History_Panels1_xaxis_name = 'star_age' + !History_Panels1_max_width = 10 + + History_Panels1_txt_scale = 0.75 + History_Panels1_xmin = -101d0!1300!200!500 + History_Panels1_xmax = -101d0 + History_Panels1_dxmin = -1 + History_Panels1_xaxis_reversed = .false. + History_Panels1_xaxis_log = .false. + History_Panels1_xmargin = 0.0 + + ! :: + + History_Panels1_num_panels = 4 + + ! :: + + History_Panels1_yaxis_name(1) = 'log_L' + History_Panels1_yaxis_reversed(1) = .false. + History_Panels1_ymin(1) = -101d0 + History_Panels1_ymax(1) = -101d0 + History_Panels1_dymin(1) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(1) = 'log_Teff' + History_Panels1_other_yaxis_reversed(1) = .false. + History_Panels1_other_ymin(1) = -101d0 + History_Panels1_other_ymax(1) = -101d0 + History_Panels1_other_dymin(1) = 0.14 + + ! :: + + History_Panels1_yaxis_name(2) = 'growth'!'lum_div_Ledd' + History_Panels1_yaxis_reversed(2) = .false. + History_Panels1_ymin(2) = -101d0 + History_Panels1_ymax(2) = -101d0 + !History_Panels1_dymin(2) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(2) = 'luminosity'!'log_max_T' ! 'v_surf_km_s' + History_Panels1_other_yaxis_reversed(2) = .false. + History_Panels1_other_ymin(2) = -101d0 + History_Panels1_other_ymax(2) = -101d0 + History_Panels1_other_dymin(2) = 0.14 + + ! :: + + History_Panels1_yaxis_name(3) = 'radius' + History_Panels1_yaxis_reversed(3) = .false. + History_Panels1_ymin(3) = -101d0 + History_Panels1_ymax(3) = -101d0 + History_Panels1_dymin(3) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(3) = 'v_surf_km_s'!'log_cntr_Rho' + History_Panels1_other_yaxis_reversed(3) = .false. + History_Panels1_other_ymin(3) = -101d0 + History_Panels1_other_ymax(3) = -101d0 + History_Panels1_other_dymin(3) = 0.14 + ! :: + + History_Panels1_yaxis_name(4) = 'log_g'!'log_dt' + History_Panels1_yaxis_reversed(4) = .false. + History_Panels1_ymin(4) = -101d0 + History_Panels1_ymax(4) = -101d0 + History_Panels1_dymin(4) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(4) = 'time_step_sec' + History_Panels1_other_yaxis_reversed(4) = .false. + History_Panels1_other_ymin(4) = -101d0 + History_Panels1_other_ymax(4) = -101d0 + History_Panels1_other_dymin(4) = 0.14 + + +!----------------------------------------------------------------------- + +! some global grid plot settings + +pgstar_grid_show_title = .true. +pgstar_grid_title_scale = 1.0 +pgstar_grid_title_lw = 3 +pgstar_grid_title_disp = 2.5 ! 1.8 +pgstar_grid_title_coord = 0.5 +pgstar_grid_title_fjust = 0.5 + +pgstar_age_scale = 0.8 +pgstar_age_disp = 3.0 +pgstar_age_coord = 0.0 +pgstar_age_fjust = 0.0 + +pgstar_xaxis_label_scale = 1.3 +pgstar_left_yaxis_label_scale = 1.3 +pgstar_xaxis_label_disp = 2.2 +pgstar_left_yaxis_label_disp = 3.1 +pgstar_right_yaxis_label_disp = 4.1 + +pgstar_model_scale = 0.8 +pgstar_model_disp = 3.0 +pgstar_model_coord = 1.0 +pgstar_model_fjust = 1.0 + +! white_on_black flags -- true means white foreground color on black background +file_white_on_black_flag = .true. +file_device = 'png' ! options 'png' and 'vcps' for png and postscript respectively + + +!file_white_on_black_flag = .false. +!file_device = 'vcps' ! options 'png' and 'vcps' for png and postscript respectively + + +kipp_win_flag=.false. +kipp_file_flag=.false. +Kipp_mix_interval = 1 +Kipp_show_luminosities = .true. + + + +! history tracks for pulsations + + +! history tracks + History_Track1_file_flag = .true. + History_Track2_file_flag = .true. + + +History_Track1_win_flag = .true. +History_Track1_file_interval = 50 +History_Track1_win_width = 12 +History_Track1_win_aspect_ratio = 0.75 + +History_Track1_xname = 'v_surf_km_s' +History_Track1_yname = 'log_L' +History_Track1_xaxis_label = 'Vsurf' +History_Track1_yaxis_label = 'log L/L\d\(2281)' +History_Track1_reverse_xaxis = .false. + + +!History_Track1_xmin = -50d0 +!History_Track1_xmax = 50d0 +!History_Track1_ymin = 3.50d0 +!History_Track1_ymax = 3.98d0 + + +History_Track2_win_flag = .true. +History_Track2_file_interval = 50 + +History_Track2_win_width = 12 +History_Track2_win_aspect_ratio = 0.75 + +History_Track2_xname = 'radius' !'v_surf_km_s' +History_Track2_yname = 'log_L' +History_Track2_xaxis_label = 'Radius' +History_Track2_yaxis_label = 'log L/L\d\(2281)' +History_Track2_reverse_xaxis = .false. + +!History_Track2_xmin = 72d0 +!History_Track2_xmax = 96d0 +!History_Track2_ymin = 3.50d0 +!History_Track2_ymax = 3.98d0 + +/ ! end of pgstar namelist + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_ppisn b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_ppisn new file mode 100644 index 000000000..cb6eeb929 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_ppisn @@ -0,0 +1,258 @@ + +&kap + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_extra' +/ + +&eos + + +/ ! end of eos namelist + +&star_job + + set_initial_cumulative_energy_error = .true. + new_cumulative_energy_error = 0d0 + + change_rotation_flag = .true. + new_rotation_flag = .false. + change_w_div_wc_flag = .true. + new_w_div_wc_flag = .false. + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_extra' + + pgstar_flag = .true. + save_pgstar_files_when_terminate = .true. + + num_special_rate_factors = 2 + reaction_for_special_factor(1) = 'r_c12_ag_o16' + special_rate_factor(1) = 1 + filename_of_special_rate(1) = 'c12ag_deboer_sigma_0p0_2000_Tgrid.dat' + + reaction_for_special_factor(2) = 'r_he4_he4_he4_to_c12' + special_rate_factor(2) = 1 + filename_of_special_rate(2) = 'r_he4_he4_he4_to_c12_cf88.txt' + + +/ !end of star_job namelist + + +&controls + + ! in principle this is the only thing that needs changing + ! it is set in inlist_extra + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_extra' + +! GYRE output controls + !write_pulse_data_with_profile = .true. + pulse_data_format = 'GYRE' + + x_logical_ctrl(37) = .true. ! if true, then run GYRE + + x_integer_ctrl(1) = 100 ! output GYRE info at this step interval + x_logical_ctrl(1) = .false. ! save GYRE info whenever save profile + + x_integer_ctrl(2) = 3 ! max number of modes to output per call + x_logical_ctrl(2) = .false. ! output eigenfunction files + + x_integer_ctrl(3) = 0 ! mode l (e.g. 0 for p modes, 1 for g modes) + ! should match gyre.in mode l + x_integer_ctrl(4) = 1 ! order + x_ctrl(1) = 0.158d-05 ! freq ~ this (Hz) + x_ctrl(2) = 0.33d+03 ! growth < this (days) + + + okay_to_remove_mixing_singleton = .false. + + + + limit_for_rel_error_in_energy_conservation = 1d1 + hard_limit_for_rel_error_in_energy_conservation = 1d2 + + + + ! adjustments to the newton solver + solver_max_tries_before_reject = 30 + max_tries_for_retry = 30 + max_tries_after_5_retries = 40 + max_tries_after_10_retries = 40 + max_tries_after_20_retries = 40 + corr_coeff_limit = 1d-2 + + + use_gold_tolerances = .true. + use_gold2_tolerances = .true. + gold_iter_for_resid_tol2 = 10 + gold_iter_for_resid_tol3 = 10 + gold_tol_residual_norm3 = 1d-6 + gold_tol_max_residual3 = 1d-3 + gold_solver_iters_timestep_limit = 20 + solver_iters_timestep_limit = 50 + ignore_too_large_correction = .true. + scale_max_correction = 0.1d0 + !corr_coeff_limit = 0.2d0 + ignore_min_corr_coeff_for_scale_max_correction = .true. + ignore_species_in_max_correction = .true. + + + mlt_make_surface_no_mixing = .true. + !convergence_ignore_equL_residuals = .false., see other inlists + make_gradr_sticky_in_solver_iters = .false. + xa_scale = 1d-5 + iter_for_resid_tol2 = 10 + + + + ! during pulses very small cells near the surface can sometimes exceed + ! the speed of light. This has no impact in the behaviour of the bulk + ! of the star so we don't want to have a retry if that happens + retry_for_v_above_clight = .false. + + + relax_max_number_retries = 99999999!1000 + max_number_retries = 99999999 !500 ! RECOMMENDED 5000 + + ! our wind implementation follows Brott+ 2011 + ! set inside inlist_ + + + + ! convection controls + MLT_option = 'TDC' + alpha_TDC_DAMP = 1d0 + alpha_TDC_DAMPR = 0d0 + alpha_TDC_PtdVdt = 0d0 + alpha_TDC_DAMPM = 0.25d0 + steps_before_use_TDC = 0 + + use_ledoux_criterion = .true. + mixing_length_alpha = 1.5d0 + alpha_semiconvection = 1d0 + thermohaline_coeff = 0d0 + num_cells_for_smooth_gradL_composition_term = 0 + + energy_eqn_option = 'dedt' + + + ! surface controls, probably uncessary + scale_max_correction_for_negative_surf_lum = .true. + max_frac_for_negative_surf_lum = 0.8 + + + ! overshoot controls + ! we only include a bit of exponential overshooting to smooth things out + + overshoot_scheme(1) = 'none' + overshoot_zone_type(1) = 'any' + overshoot_zone_loc(1) = 'shell' + overshoot_bdy_loc(1) = 'any' + overshoot_f(1) = 0.001 + overshoot_f0(1) = 0.0005 + + overshoot_scheme(2) = 'exponential' + overshoot_zone_type(2) = 'any' + overshoot_zone_loc(2) = 'core' + overshoot_bdy_loc(2) = 'any' + overshoot_f(2) = 0.01 + overshoot_f0(2) = 0.005 + + overshoot_D_min = 1d-8 + + + ! timestep options + varcontrol_target = 1d-3!5d-4 + max_timestep_factor = 1.2d0 + min_timestep_factor = 0.8d0 + dX_nuc_drop_limit = 5d-2 + dX_nuc_drop_limit_at_high_T = 1d-2 ! for center logT > 9.45 + delta_Ye_highT_limit = 1d-3 + dX_nuc_drop_max_A_limit = 52 + dX_nuc_drop_min_X_limit = 1d-4 + dX_nuc_drop_hard_limit = 1d99 + delta_lgTeff_limit = 1d0 + + delta_lgL_hard_limit = -1!1d200 + delta_lgR_limit = 1d-2!0.025d0 + delta_lgR_hard_limit = -1!0.05d0 + delta_lgR_limit_min_lgR = 3d0 ! 3d0 for >1000 Rsun + delta_lgL_He_limit = -1d0 + lgL_nuc_burn_min = 4d0 + retry_hold = 0 + + ! limit for changes in central abundances, RECOMMENDED 0.001d0 for all + delta_XH_cntr_limit = 0.01d0 + delta_XHe_cntr_limit = 0.01d0 + delta_XC_cntr_limit = 0.01d0 + delta_XO_cntr_limit = 0.01d0 + + ! extra controls for timestep + delta_lg_star_mass_limit = 2d-3 ! RECOMMENDED 2d-3 + delta_lgRho_cntr_limit = 0.005d0 ! RECOMMENDED 0.0025d0 + delta_lgRho_cntr_hard_limit = 0.1d0 ! RECOMMENDED 0.005d0 + + min_timestep_limit = 1d-20 ! (seconds) + relax_hard_limits_after_retry = .false. + + ! mesh controls + !max_dq = 1d-3 ! RECOMMENDED 1d-3 + + ! rotational mixing coeffs + !am_nu_ST_factor = 1.0 + !D_visc_factor = 0.0 + !am_nu_SH_factor = 0.0 + !D_ST_factor = 0.0 + !D_SH_factor = 0.0 + !D_GSF_factor = 1.0 + !D_ES_factor = 1.0 + !D_SSI_factor = 1.0 + !D_DSI_factor = 1.0 + !am_D_mix_factor = 0.0333333d0 + !am_gradmu_factor = 0.1d0 + !num_cells_for_smooth_gradL_composition_term = 2 + + ! use implicit wind close to critical + max_tries_for_implicit_wind = 10 + surf_avg_tau_min = 0 + surf_avg_tau = 10 + !max_mdot_redo_cnt = 200 ! this is set in inlist_hydro_on and inlist_hydro_off + min_years_dt_for_redo_mdot = 0 + surf_omega_div_omega_crit_limit = 0.98d0 + surf_omega_div_omega_crit_tol = 0.02d0 + rotational_mdot_boost_fac = 1d10 + rotational_mdot_kh_fac = 1d10 + mdot_revise_factor = 1.1 + implicit_mdot_boost = 0.05 + ! this needs to be relaxed just to avoid a crash when hydro Riemann is turned on + angular_momentum_error_retry = 1d99 + angular_momentum_error_warn = 1d-10 + + ! Fixing the position of the Lagrangian region of the mesh helps + ! convergence near the Eddington limit + !max_logT_for_k_below_const_q = 100 + !max_q_for_k_below_const_q = 0.99 + !min_q_for_k_below_const_q = 0.99 + !max_logT_for_k_const_mass = 100 + !max_q_for_k_const_mass = 0.98 + !min_q_for_k_const_mass = 0.98 + + + photo_digits = 8 + photo_interval = 10!50 + profile_interval = 200!50 + history_interval = 1!10 + terminal_interval = 10!10 + max_num_profile_models = 10000 ! 100 ! RECOMMENDED 10000 + + + num_trace_history_values = 2 + trace_history_value_name(1) = 'log_rel_run_E_err' + trace_history_value_name(2) = 'rel_E_err' + warn_when_large_rel_run_E_err = 1d-2 +/ ! end of controls namelist + +&pgstar + +/ diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_pulses b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_pulses new file mode 100644 index 000000000..694b1aa68 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_pulses @@ -0,0 +1,310 @@ +&kap + !use_Type2_opacities = .false. ! if cutting out core. + +/ + +&eos +/ + +&star_job + + save_model_when_terminate = .true. + save_model_filename = 'final.mod' + !required_termination_code_string = 'Successful test: evolved 100 days past first relax' + + load_saved_model = .true. + load_model_filename = 'he_dep.mod' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_ppisn' + + !change_initial_v_flag = .true. + !new_v_flag = .true. + + change_v_flag = .true. + new_v_flag = .false. + + change_u_flag = .true. + new_u_flag = .true. + + relax_to_this_tau_factor = 1d-1!-1 + dlogtau_factor = 0.1d0 + relax_tau_factor = .true. + + + ! if restarting from .mod file, need high initial dt for relaxing. + set_initial_dt = .true. + years_for_initial_dt = -1 + seconds_for_initial_dt = 1d2!-1 + + set_initial_age = .true. + initial_age = 0 + + ! on first pass. + remove_center_by_temperature = 5d6 + +/ !end of star_job namelist + + +&controls + + ! probably not necessary + remove_small_D_limit = 1d-16 + remove_mixing_glitches = .false.!.true. ! If true, then okay to remove gaps and singletons. + mlt_make_surface_no_mixing = .false. + make_mlt_hydrodynamic = .false. + + + ! controls for analyzing pulsations + x_integer_ctrl(1) = 0 ! gyre interval to check + x_ctrl(1) = 17d0 ! expected period (in days) + + x_logical_ctrl(7) = .true. ! doing pulses + x_integer_ctrl(7) = -1 ! 3 ! which period to check (<= 0 means don't check any) + x_ctrl(7) = 17d0 ! expected period (in days) + x_ctrl(8) = 1.0 ! min_deltaR_for_periods (Rsun) + x_ctrl(9) = 1d0 ! KE_growth_avg_abs_frac_new ! for averaging growth rates across steps. + x_ctrl(10) = 0.3 ! min_period_div_target + + + ! new rsp style meshing, thanks to Bill P. + RSP2_use_mass_interp_face_values = .true. + RSP2_nz = 500 + RSP2_nz_outer = 250 + RSP2_T_anchor = 11d3 + RSP2_dq_1_factor = 2d0 + remesh_for_TDC_pulsations_log_core_zoning = .false. ! .false means do rsp style core + + okay_to_remesh = .false. + + ! control for excising core upon loading .mod file. + x_logical_ctrl(25) = .false. ! set true to remove core + x_ctrl(14) = 5d6 ! desired core temperature to make cut at + + ! remeshing flag for if we are doing an envelope model or full stellar model. + x_logical_ctrl(23) = .true. ! .true. = envelope model, .false. = full stellar model ! depracated + x_logical_ctrl(24) = .true. ! if true turn off remesh at the following model number + x_ctrl(12) = 3400! model number to turn off remesh ( only if if okay_to_remesh = .true.) + + ! timestep + x_ctrl(13) = 3400! model number to drop timestep + + ! During hydro we can use es scattering opacity on the very outermost cell + use_other_kap = .false. + +! turn off burning and mixing, if evolving envelope model + eps_nuc_factor = 0 + non_nuc_neu_factor = 0 + dxdt_nuc_factor = 0 + mix_factor = 0 + +! GYRE set starting velocities, kick! +! kick when true and not restarting. + x_logical_ctrl(5) = .true. ! to turn on gyre kick + x_ctrl(11) = 3400! kick model at this model number + + x_ctrl(4) = 1d0 ! fraction_1st_overtone (order 2) + x_ctrl(5) = 0d0 ! fraction_2nd_overtone (order 3) + x_ctrl(6) = 5d0 ! initial vsurf (kms) + + + ! TDC Pulsation timestepping. + x_ctrl(17) = 1d5 ! dt before pulse, seconds for relaxing mesh + x_ctrl(18) = 5d4 ! After a pulse begins, limit the timestep to this (in seconds). + + ! turn of wind during Pulsation + use_other_wind = .false. + + !cool_wind_full_on_T = 0.8d4 + !hot_wind_full_on_T = 1.2d4 + !cool_wind_RGB_scheme = 'Dutch' + !cool_wind_AGB_scheme = 'Dutch' + !hot_wind_scheme = 'Dutch' + !Dutch_wind_lowT_scheme = 'de Jager' + !Dutch_scaling_factor = 10d0 + + + ! can optionally use QHSE form of dp/dm or hydro form below. + use_dPrad_dm_form_of_T_gradient_eqn = .false. ! if false use QHSE form. + min_kap_for_dPrad_dm_eqn = 1d-5 + +! timesteps for saturation + + !dt_div_min_dr_div_cs_limit = 2d0 + dt_div_min_dr_div_cs_hard_limit = 100d0! i don't like hard limits ~ EbF + min_abs_u_div_cs_for_dt_div_min_dr_div_cs_limit = 0.8d0 + + ! have used these values to do run to saturation, but may not be necessary ~ Bill P. + dt_div_min_dr_div_cs_limit = 10d0!10d0 + min_q_for_dt_div_min_dr_div_cs_limit = 0.5d0 + max_q_for_dt_div_min_dr_div_cs_limit = 1d0 + min_k_for_dt_div_min_dr_div_cs_limit = 1 + min_abs_du_div_cs_for_dt_div_min_dr_div_cs_limit = 0.001d0 + + ! artificial viscosity if necessary, only works for v_flag + use_Pvsc_art_visc = .true. + Pvsc_cq = 4.0d0 + Pvsc_zsh = 0.1d0 + + ! velocity time centering for v_flag only. + !steps_before_use_velocity_time_centering = 2900 ! no v centering when commented + use_P_d_1_div_rho_form_of_work_when_time_centering_velocity = .true. + + include_P_in_velocity_time_centering = .true. + P_theta_for_velocity_time_centering = 0.5d0 + + include_L_in_velocity_time_centering = .true. + L_theta_for_velocity_time_centering = 0.5d0 + + set_rho_to_dm_div_dV = .false. + + + convergence_ignore_equL_residuals = .false. ! include T-gradient eqn in newton + + ! OUTER BC, if not atm, then see below. + atm_T_tau_opacity = 'fixed' + atm_T_tau_errtol = 1d-10 + + ! OUTER BC for TDC Pulsations + use_RSP_L_eqn_outer_BC = .false. + RSP2_Lsurf_factor = 0.5d0 + use_zero_Pgas_outer_BC = .false. + + ! for u_flag, can optionally use these. + use_compression_outer_BC = .false. + use_momentum_outer_BC = .true. + + ! Convection model + MLT_option = 'TDC' + alpha_TDC_DAMP = 1d0 + alpha_TDC_DAMPR = 0d0 !0d0!1d0! 0d0 for mlt + alpha_TDC_PtdVdt = 0d0 !0d0!1d0!1d-2!1d-2!0d0 + steps_before_use_TDC = 0 + alpha_TDC_DAMPM = 0.25d0 !0.25d0 + mixing_length_alpha = 1.5d0 + mlt_Pturb_factor = 0d0 + + TDC_num_innermost_cells_forced_nonturbulent = 2 + alt_scale_height_flag = .false. ! ignore eggleton + TDC_use_density_form_for_eddy_viscosity = .false. !ignored when u_flag is true, and used anyway + + ! controls for shock capturing, relaxed for pulsations + max_abs_du_div_cs_for_convection = 1d-1!1d-1 !0.03d0 + max_v_div_cs_for_convection = 1d2 + max_v_for_convection = 1d4 + + x_logical_ctrl(22) = .true. ! flag for in inlist_pulses + + + + + + + +! everything below is old and from testing. + + + + + + + max_num_merge_cells = 2 + + ! these two in combination are important + !max_num_merge_surface_cells = 15 ! necessary for surface, 15 better for massive stars + !min_surface_cell_dq = 1d-5!2d-6 ! 1d-6 might be safer. + ! any higher and you risk touching the convective shell during a + ! pulsation cycle which will make the surface go haywire. + + + +!mesh_min_k_old_for_split = 15 +!min_dq = 1d-7 +!max_center_cell_dq = 1d-1! leave at default if including core +!max_surface_cell_dq = 1d-4 +!mesh_max_allowed_ratio = 2.5d0 !default + +!mesh_delta_coeff_factor_smooth_iters = 3!20!50 ! 3 +!remesh_max_allowed_logT = 5d0 ! global control, not good. +!T_function1_weight = 30!110 +!P_function_weight = 5!50 ! need custom P function weight for logT < 4.5 +!log_tau_function_weight = 10!100 +!log_kap_function_weight = 10 + +!max_dq = 5d-2 + +!xa_function_species(1) = 'he4' +!xa_function_weight(1) = 0 +!xa_function_param(1) = 1d-2 +!use_other_mesh_functions = .true. + +!mesh_min_dlnR = 1d-14!1d-9 +!merge_if_dr_div_dRstar_too_small = .false. +!merge_if_dr_div_cs_too_small = .false. + +! if split merge amr hydro + ! restore_mesh_on_retry = .true. + ! num_steps_to_hold_mesh_after_retry = 5 +! if hydro use momentum bc? + + use_split_merge_amr = .true. + + ! need src for this, turn off on first 10 steps. + split_merge_amr_okay_to_split_1 = .true. + + merge_amr_ignore_core_cells = .false. + merge_amr_logT_for_ignore_core_cells = 5d0 !1d99 + split_amr_ignore_core_cells = .false. + split_amr_logT_for_ignore_core_cells = 5d0 !1d99 + + mesh_delta_coeff = 1d0!0.8d0 ! RECOMMENDED 0.8d0 + !! this one is turned on in run_star_extras + ! true in pulses use_split_merge_amr = .false. + !split_merge_amr_log_zoning = .true. + split_merge_amr_logtau_zoning = .true. + !split_merge_amr_flipped_hybrid_zoning = .true. + !split_merge_amr_hybrid_zoning = .true. + + split_merge_amr_r_core_cm = 1d8 +split_merge_amr_nz_r_core = 1000!10000 + + + split_merge_amr_nz_baseline = 1000!6000 ! RECOMMENDED 6000 + split_merge_amr_MaxLong = 1.25d0 + split_merge_amr_MaxShort = 2.5d0 + + +! equal_split_density_amr = .false. + +! deprecated? trace_split_merge_amr = .false. + + + split_merge_amr_max_iters = 1000 ! setting this too high will smear pulsations. must restrict? + split_merge_amr_okay_to_split_nz = .false. +split_merge_amr_mesh_delta_coeff = 1.0!0.3 + + merge_amr_ignore_surface_cells = .false. + merge_amr_k_for_ignore_surface_cells = 20!1500!100 + + merge_amr_max_abs_du_div_cs = 0.03d0!0.5d0!5d-1!3d-2!0.03!0.05d0 + merge_amr_du_div_cs_limit_only_for_compression = .true. + split_merge_amr_avoid_repeated_remesh = .true. + merge_amr_inhibit_at_jumps =.false. ! reduce udnersize ratio for large jumps + + +report_solver_progress = .true. +report_ierr = .true. ! if true, produce terminal output when have some internal error + +/ ! end of controls namelist + +&pgstar + + ! axis limits -- to override system default selections + !HR_logT_min = 3.6 !-101d0 ! only used if /= -101d0 + !HR_logT_max = 3.75!-101d0 ! only used if /= -101d0 + !HR_logL_min = 3.85!-101d0 ! only used if /= -101d0 + !HR_logL_max = 3.6!-101d0 ! only used if /= -101d0 + + HR_file_interval = 50 ! output when `mod(model_number,HR_file_interval)==0` + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_pulses_header b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_pulses_header new file mode 100644 index 000000000..ae7c8e831 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_pulses_header @@ -0,0 +1,56 @@ + +&star_job + + + read_extra_star_job_inlist(2) = .true. + extra_star_job_inlist_name(2) = 'inlist_pulses' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_ppisn' + +/ ! end of star_job namelist + + +&eos + + read_extra_eos_inlist(2) = .true. + extra_eos_inlist_name(2) = 'inlist_pulses' + + read_extra_eos_inlist(1) = .true. + extra_eos_inlist_name(1) = 'inlist_ppisn' + +/ ! end of eos namelist + + +&kap + + read_extra_kap_inlist(2) = .true. + extra_kap_inlist_name(2) = 'inlist_pulses' + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_ppisn' + +/ ! end of kap namelist + + + +&controls + + read_extra_controls_inlist(2) = .true. + extra_controls_inlist_name(2)= 'inlist_pulses' + + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_ppisn' + +/ ! end of controls namelist + + +&pgstar + + read_extra_pgstar_inlist(2) = .true. + extra_pgstar_inlist_name(2)= 'inlist_pulses' + + read_extra_pgstar_inlist(1) = .true. + extra_pgstar_inlist_name(1)= 'inlist_pgstar' + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_to_he_dep b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_to_he_dep new file mode 100644 index 000000000..566ba96d6 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_to_he_dep @@ -0,0 +1,70 @@ + +&star_job + + create_pre_main_sequence_model = .true. + + save_model_when_terminate = .true. + save_model_filename = 'he_dep.mod' + required_termination_code_string = '' + + ! evolve model with hydrodynamics on from pre-ms + change_initial_v_flag = .true. + new_v_flag = .true. + + relax_to_this_tau_factor = 1d-1!-1 + dlogtau_factor = 0.1d0 + relax_tau_factor = .true. + +/ !end of star_job namelist + +&kap + +/ + +&eos + +/ + + +&controls + +! stop when the center mass fraction of h1 drops below this limit + !xa_central_lower_limit_species(1) = 'he4' + !xa_central_lower_limit(1) = 1d-6 +max_model_number = 3300 !1970 + + x_logical_ctrl(22) = .false. ! not in inlist_pulses + + + ! our wind implementation follows Brott+ 2011 + use_other_wind = .true. + +use_drag_energy = .false. +drag_coefficient = 1d0 +min_q_for_drag = 0.8d0 +!Pextra_factor = 1.5d0 + +! solver controls + convergence_ignore_equL_residuals = .true. ! for pre-ms +! use_gold2_tolerances = .false. ! if you need to get through the he_flash + + +/ ! end of controls namelist + +&pgstar + + + pgstar_interval = 10 + + History_Panels1_xaxis_name = 'model_number' + History_Panels1_max_width = -1 + + Profile_Panels3_xaxis_name = 'mass' + Profile_Panels3_xaxis_reversed = .false. + + TRho_Profile_xmin = -16.0 + TRho_Profile_xmax = 7d0!5d0!10.0 + TRho_Profile_ymin = 2.5 + TRho_Profile_ymax = 9d0!8.5d0!10.0 + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_to_he_dep_header b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_to_he_dep_header new file mode 100644 index 000000000..a007699f8 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/inlist_to_he_dep_header @@ -0,0 +1,55 @@ + +&star_job + + + read_extra_star_job_inlist(2) = .true. + extra_star_job_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_ppisn' + +/ ! end of star_job namelist + + +&eos + + read_extra_eos_inlist(2) = .true. + extra_eos_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_eos_inlist(1) = .true. + extra_eos_inlist_name(1) = 'inlist_ppisn' +/ ! end of eos namelist + + +&kap + + read_extra_kap_inlist(2) = .true. + extra_kap_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_ppisn' + +/ ! end of kap namelist + + + +&controls + + read_extra_controls_inlist(2) = .true. + extra_controls_inlist_name(2)= 'inlist_to_he_dep' + + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_ppisn' + +/ ! end of controls namelist + + +&pgstar + + read_extra_pgstar_inlist(2) = .true. + extra_pgstar_inlist_name(2)= 'inlist_to_he_dep' + + read_extra_pgstar_inlist(1) = .true. + extra_pgstar_inlist_name(1)= 'inlist_pgstar' + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/make/makefile b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/make/makefile new file mode 100644 index 000000000..f2017faed --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/make/makefile @@ -0,0 +1,5 @@ + + +STAR = star + +include $(MESA_DIR)/star/work_standard_makefile diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/mk b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/mk new file mode 100755 index 000000000..aec7a5195 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/mk @@ -0,0 +1,13 @@ +#!/bin/bash + +function check_okay { + if [ $? -ne 0 ] + then + echo + echo "FAILED" + echo + exit 1 + fi +} + +cd make; make; check_okay diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/profile_columns.list b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/profile_columns.list new file mode 100644 index 000000000..7b2196584 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/profile_columns.list @@ -0,0 +1,962 @@ +! profile_columns.list -- determines the contents of star model profiles +! you can use a non-standard version by setting profile_columns_file in your inlist + +! units are cgs unless otherwise noted. + +! reorder the following names as desired to reorder columns. +! comment out the name to omit a column (fewer columns => less IO => faster running). +! remove '!' to restore a column. + +! if you have a situation where you want a non-standard set of columns, +! make a copy of this file, edit as desired, and give the new filename in your inlist +! as profile_columns_file. if you are just adding columns, you can 'include' this file, +! and just list the additions in your file. note: to include the standard default +! version, use include '' -- the 0 length string means include the default file. + +! if you need to have something added to the list of options, let me know.... + +! the first few lines of the profile contain general info about the model. +! for completeness, those items are described at the end of this file. + + +! note: you can include another list by doing +! include 'filename' +! include '' means include the default standard list file + + +! the following lines of the profile contain info for 1 zone per row, surface to center. + +! minimal set of enabled columns: + + zone ! numbers start with 1 at the surface + mass ! m/Msun. mass coordinate of outer boundary of cell. + logR ! log10(radius/Rsun) at outer boundary of zone + logT ! log10(temperature) at center of zone + logRho ! log10(density) at center of zone + logP ! log10(pressure) at center of zone + x_mass_fraction_H + y_mass_fraction_He + z_mass_fraction_metals + + +! everything below this line is deactivated + + +!# Structure + !logM ! log10(m/Msun) + !log_mass + !dm ! cell mass (grams) + !dm_bar ! boundary mass (grams) average of adjacent dm's + logdq ! log10(dq) + !log_dq + dq_ratio ! dq(k-1)/dq(k) + q ! fraction of star mass interior to outer boundary of this zone + log_q ! log10(q) + !xq + + !grav ! gravitational acceleration (cm sec^2) + log_g ! log10 gravitational acceleration (cm sec^2) + !g_div_r ! grav/radius (sec^2) + !r_div_g ! radius/grav (sec^-2) + !cgrav_factor ! = cgrav(k)/standard_cgrav + vel_km_per_s ! velocity at outer boundary of zone (km/s) -- 0 if no velocity variable + + radius ! radius at outer boundary of zone (in Rsun units) + !radius_cm ! radius at outer boundary of zone (in centimeters) + !radius_km ! radius at outer boundary of zone (in kilometers) + !logR_cm ! log10 radius at outer boundary of zone (in centimeters) + !rmid ! radius at center by mass of zone (in Rsun units) + !r_div_R ! fraction of total radius + + velocity ! velocity at outer boundary of zone (cm/s) -- 0 if no velocity variable + !v_div_r ! velocity divided by radius + !v_times_t_div_r + !rho_times_r3 ! at face + !log_rho_times_r3 ! at face + !scale_height ! in Rsun units + pressure_scale_height ! in Rsun units + + !m_div_r ! gm/cm + !dmbar_m_div_r + !log_dmbar_m_div_r + !mass_grams ! mass coordinate of outer boundary of cell in grams + !mmid ! mass at midpoint of cell (average of mass coords of the cell boundaries) Msun units. + + !m_grav ! total enclosed gravitational mass. Msun units. + !m_grav_div_m_baryonic ! mass_gravitational/mass at cell boundary + !mass_correction_factor ! dm_gravitational/dm (dm is baryonic mass of cell) + + !xm ! mass exterior to point (Msun units) + dq ! mass of zone as a fraction of total star mass + !logxq ! log10(1-q) + !logxm ! log10(xm) + + !xr ! radial distance from point to surface (Rsun) + !xr_cm ! radial distance from point to surface (cm) + !xr_div_R ! radial distance from point to surface in units of star radius + !log_xr ! log10 radial distance from point to surface (Rsun) + !log_xr_cm ! log10 radial distance from point to surface (cm) + !log_xr_div_R ! log10 radial distance from point to surface in units of star radius + + !dr ! r(outer edge) - r(inner edge); radial extent of cell in cm. + !log_dr ! log10 cell width (cm) + !dv ! v(inner edge) - v(outer edge); rate at which delta_r is shrinking (cm/sec). + + dt_dv_div_dr ! dt*dv/dr; need to have this << 1 for every cell + !dr_div_R ! cell width divided by star R + !log_dr_div_R ! log10 cell width divided by star R + !dr_div_rmid ! cell width divided by rmid + !log_dr_div_rmid ! log(dr_div_rmid) + + !dr_div_cs ! cell sound crossing time (sec) + !log_dr_div_cs ! log10 cell sound crossing time (sec) + dr_div_cs_yr ! cell sound crossing time (years) + !log_dr_div_cs_yr ! log10 cell sound crossing time (years) + + !acoustic_radius ! sound time from center to outer cell boundary (sec) + !log_acoustic_radius ! log10(acoustic_radius) (sec) + !acoustic_depth ! sound time from surface to outer cell boundary (sec) + !log_acoustic_depth ! log10(acoustic_depth) (sec) + !acoustic_r_div_R_phot + + !cell_collapse_time ! only set if doing explicit hydro + ! time (seconds) for cell inner edge to catch cell outer edge at current velocities + ! 0 if distance between inner and outer is increasing + !log_cell_collapse_time ! log of cell_collapse_time + + !compression_gradient + + + +!# Thermodynamics + !temperature ! temperature at center of zone + !logT_face ! log10(temperature) at outer boundary of zone + !logT_bb ! log10(black body temperature) at outer boundary of zone + !logT_face_div_logT_bb + + energy ! internal energy (ergs/g) + !logE ! log10(specific internal energy) at center of zone + !rho ! density + !density ! rho + + entropy ! specific entropy divided by (avo*kerg) + !logS ! log10(specific entropy) + !logS_per_baryon ! log10(specific entropy per baryon / kerg) + + pressure ! total pressure at center of zone (pgas + prad) + !prad ! radiation pressure at center of zone + !pgas ! gas pressure at center of zone (electrons and ions) + logPgas ! log10(pgas) + pgas_div_ptotal ! pgas/pressure + + eta ! electron degeneracy parameter (eta >> 1 for significant degeneracy) + mu ! mean molecular weight per gas particle (ions + free electrons) + + grada ! dlnT_dlnP at constant S + !dE_dRho ! at constant T + !cv ! specific heat at constant volume + !cp ! specific heat at constant total pressure + + !log_CpT + gamma1 ! dlnP_dlnRho at constant S + !gamma3 ! gamma3 - 1 = dlnT_dlnRho at constant S + !gam ! plasma interaction parameter (> 160 or so means starting crystallization) + free_e ! free_e is mean number of free electrons per nucleon + !logfree_e ! log10(free_e), free_e is mean number of free electrons per nucleon + !chiRho ! dlnP_dlnRho at constant T + !chiT ! dlnP_dlnT at constant Rho + + csound ! sound speed + log_csound + !csound_face ! sound speed (was previously called csound_at_face) + !cs_at_cell_bdy ! sound speed at cell boundary (csound is at cell center) + !v_div_cs ! velocity divided by sound speed + v_div_csound ! velocity divided by sound speed + !div_v + + !thermal_time_to_surface ! in seconds + !log_thermal_time_to_surface + !t_rad + !log_t_rad + !log_t_sound + !log_t_thermal + + !eos_phase + !eos_frac_OPAL_SCVH + !eos_frac_HELM + !eos_frac_Skye + !eos_frac_PC + !eos_frac_FreeEOS + !eos_frac_CMS + !eos_frac_ideal + + !pgas_div_p + !prad_div_pgas + !prad_div_pgas_div_L_div_Ledd + !pressure_scale_height_cm + + !eps_grav_composition_term + eps_grav_plus_eps_mdot + + !chiRho_for_partials + !chiT_for_partials + !rel_diff_chiRho_for_partials + !rel_diff_chiT_for_partials + + !latent_ddlnRho + !latent_ddlnT + + !log_P_face + !log_Ptrb + !log_cp_T_div_t_sound + + !QQ + + +!# Mass accretion + eps_grav ! -T*ds/dt (negative for expansion) + !log_abs_eps_grav_dm_div_L + !log_abs_v ! log10(abs(velocity)) (cm/s) + !log_mdot_cs + !log_mdot_v + eps_mdot + !env_eps_grav + !xm_div_delta_m + !log_xm_div_delta_m + + +!# Nuclear energy generation + !signed_log_eps_grav ! sign(eps_grav)*log10(max(1,abs(eps_grav))) + !signed_log_eps_nuc + net_nuclear_energy ! erg/gm/s from nuclear reactions minus all neutrino losses + ! The value plotted is net_nuclear_energy = sign(val)*log10(max(1,abs(val))) + ! where val = net nuclear energy minus all neutrino losses. + net_energy ! net_energy + eps_grav. + ! The value plotted is net_energy = sign(val)*log10(max(1,abs(val))) + ! where val = net nuclear energy plus eps_grav minus all neutrino losses. + eps_nuc_plus_nuc_neu + !eps_nuc_minus_non_nuc_neu + !eps_nuc_start + + eps_nuc ! ergs/g/sec from nuclear reactions (including losses to reaction neutrinos) + !log_abs_eps_nuc + !d_lnepsnuc_dlnd + !d_epsnuc_dlnd + !deps_dlnd_face + ! (was previously called deps_dlnd_at_face) + !d_lnepsnuc_dlnT + !d_epsnuc_dlnT + !deps_dlnT_face + ! (was previously called deps_dlnT_at_face) + !eps_nuc_neu_total ! erg/gm/sec as neutrinos from nuclear reactions + + non_nuc_neu ! non-nuclear-reaction neutrino losses + !nonnucneu_plas ! plasmon neutrinos (for collective reactions like gamma_plasmon => nu_e + nubar_e) + !nonnucneu_brem ! bremsstrahlung (for reactions like e- + (z,a) => e- + (z,a) + nu + nubar) + !nonnucneu_phot ! photon neutrinos (for reactions like e- + gamma => e- + nu_e + nubar_e) + !nonnucneu_pair ! pair production (for reactions like e+ + e- => nu_e + nubar_e) + !nonnucneu_reco ! recombination neutrinos (for reactions like e- (continuum) => e- (bound) + nu_e + nubar_e) + + ! ergs/g/sec for reaction categories + add_reaction_categories ! this adds all the reaction categories + ! NOTE: you can list specific categories by giving their names (from chem_def) + pp + cno + tri_alpha + !c_alpha + !n_alpha + !o_alpha + !ne_alpha + !na_alpha + !mg_alpha + !si_alpha + !s_alpha + !ar_alpha + !ca_alpha + !ti_alpha + !fe_co_ni + !c12_c12 + !c12_o16 + !o16_o16 + !photo + !pnhe4 + !other + + ! adds columns for all of the reactions that are in the current net + ! Note that if using op_split_burn=.true. then zones which have been split will report 0 for thier rates + !add_raw_rates ! raw reaction rates, reactions/second + !add_screened_rates ! screened reaction rates reactions/second + !add_eps_nuc_rates ! Nuclear energy (minus neutrino losses) released erg/s + !add_eps_neu_rates ! Neutrino losses erg/s + + ! individual reactions (as many as desired) + ! use list_net_reactions = .true. in star_job to list all reactions in the current net + ! reactions/second + !raw_rate r_h1_h1_ec_h2 + !raw_rate r_h1_h1_wk_h2 + + !burn_num_iters ! Number of split_burn iterations taken + !burn_avg_epsnuc + !log_burn_avg_epsnuc + +!# Composition + !x_mass_fraction_H + !y_mass_fraction_He + !z_mass_fraction_metals + abar ! average atomic weight (g/mole) + !zbar ! average charge + !z2bar ! average charge^2 + ye ! average charge per baryon = proton fraction + + x ! hydrogen mass fraction + !log_x + y ! helium mass fraction + !log_y + z ! metallicity + !log_z ! metallicity + + add_abundances ! this adds all of the isos that are in the current net + ! NOTE: you can list specific isotopes by giving their names (from chem_def) + !h1 + !he3 + !he4 + !c12 + !n14 + !o16 + + !add_log_abundances ! this adds log10 of all of the isos that are in the current net + ! NOTE: you can list specific isotopes by giving their names (from chem_def) + !log h1 + !log he3 + !log he4 + !log c12 + !log n14 + !log o16 + + ! log concentration of species + ! concentration = number density / number density of electrons + ! Ci = (Xi/Ai) / sum(Zi*Xi/Ai) [see Thoul et al, ApJ 421:828-842, 1994] + !log_concentration h1 + !log_concentration he4 + + + ! typical charge for given species + ! (used by diffusion) + !typical_charge he4 + !typical_charge c12 + !typical_charge fe52 + + ! ionization state for given species + ! (same as typical charge, except that it's unsmoothed) + !ionization he4 + !ionization c12 + !ionization fe52 + + !cno_div_z ! abundance of c12, n14, and o16 as a fraction of total z + + + + +!# Opacity + !opacity ! opacity measured at center of zone + log_opacity ! log10(opacity) + !dkap_dlnrho_face ! partial derivative of opacity wrt. ln rho (at T=const) at outer edge of cell + ! (was previously called dkap_dlnrho_at_face) + !dkap_dlnT_face ! partial derivative of opacity wrt. ln T (at rho=const) at outer edge of cell + ! (was previously called dkap_dlnT_at_face) + !kap_frac_lowT ! fraction of opacity from lowT tables + !kap_frac_highT ! fraction of opacity from highT tables + !kap_frac_Type2 ! fraction of opacity from Type2 tables + !kap_frac_Compton ! fraction of opacity from Compton_Opacity + !kap_frac_op_mono ! fraction of opacity from OP mono + + !log_kap + !log_kap_times_factor + + !log_c_div_tau + !xtau + !xlogtau + !logtau_sub_xlogtau + +!# Luminosity + luminosity ! luminosity at outer boundary of zone (in Lsun units) + !logL ! log10(max(1d-2,L/Lsun)) + !log_Lrad + log_Ledd ! log10(Leddington/Lsun) -- local Ledd, 4 pi clight G m / kap + !log_L_div_Ledd ! log10(max(1d-12,L/Leddington)) + log_Lrad_div_Ledd + !log_Lrad_div_L + !signed_log_power ! sign(L)*log10(max(1,abs(L))) + + !lum_adv + lum_conv + !lum_conv_MLT + lum_div_Ledd + !lum_erg_s + !lum_plus_lum_adv + lum_rad + + !log_L_div_CpTMdot + !log_abs_lum_erg_s + + !L + !Lc + Lc_div_L + !Lr + !Lr_div_L + !Lt + !Lt_div_L + +!# Energetics + !total_energy ! specific total energy of cell (ergs/g). internal+potential+kinetic+rotation. + !cell_specific_IE + !cell_specific_KE + !cell_IE_div_IE_plus_KE + !cell_KE_div_IE_plus_KE + + !cell_ie_div_star_ie + !cell_internal_energy_fraction + !cell_internal_energy_fraction_start + !cell_specific_PE + + !log_cell_ie_div_star_ie + !log_cell_specific_IE + + ergs_eps_grav_plus_eps_mdot + ergs_error + !ergs_error_integral + ergs_mdot + !ergs_rel_error_integral + !dm_eps_grav + + !dE + + !etrb + log_etrb + !extra_grav + log_rel_E_err + + !total_energy_sign + +!# Convection + !mlt_mixing_length ! mixing length for mlt (cm) + mlt_mixing_type ! value returned by mlt + mlt_Pturb + !alpha_mlt + + conv_vel ! convection velocity (cm/sec) + log_conv_vel ! log10 convection velocity (cm/sec) + + !conv_L_div_L + log_conv_L_div_L + !lum_conv_div_lum_rad + !lum_rad_div_L_Edd + !lum_conv_div_lum_Edd + lum_conv_div_L + lum_rad_div_L + !lum_rad_div_L_Edd_sub_fourPrad_div_PchiT ! density increases outward if this is > 0 + ! see Joss, Salpeter, and Ostriker, "Critical Luminosity", ApJ 181:429-438, 1973. + + gradT ! mlt value for required temperature gradient dlnT/dlnP + + gradr ! dlnT/dlnP required for purely radiative transport + !grad_temperature ! smoothed dlnT/dlnP at cell boundary + !grad_density ! smoothed dlnRho/dlnP at cell boundary + + gradL ! gradient for Ledoux criterion for convection + !sch_stable ! 1 if grada > gradr, 0 otherwise + !ledoux_stable ! 1 if gradL > gradr, 0 otherwise + + !grada_sub_gradT + gradT_sub_grada ! gradT-grada at cell boundary + gradT_div_grada ! gradT/grada at cell boundary + + !gradr_sub_gradT + !gradT_sub_gradr ! gradT-gradr at cell boundary + !gradT_div_gradr ! gradT/gradr at cell boundary + + !log_gradT_div_gradr ! log10 gradT/gradr at cell boundary + log_mlt_Gamma ! convective efficiency + conv_vel_div_csound ! convection velocity divided by sound speed + !conv_vel_div_L_vel ! L_vel is velocity needed to carry L by convection; L = 4*pi*r^2*rho*vel**3 + log_mlt_D_mix ! log10 diffusion coefficient for mixing from mlt (cm^2/sec) + + !gradr_div_grada ! gradr/grada_face; > 1 => Schwarzschild unstable for convection + !gradr_sub_grada ! gradr - grada_face; > 0 => Schwarzschild unstable for convection + + !gradL_sub_gradr + !gradP_div_rho + !gradT_excess_effect + !gradT_rel_err + !gradT_sub_a + !grada_face + !grada_sub_gradr + !diff_grads + !log_diff_grads + + !mlt_D + !mlt_Gamma + mlt_Y_face + !mlt_Zeta + !mlt_gradT + !mlt_log_abs_Y + !mlt_vc + !log_mlt_vc + !dvc_dt_TDC_div_g + + !superad_reduction_factor + !conv_vel_div_mlt_vc + + !log_Lconv + !log_Lconv_div_L + +!# Mixing + mixing_type ! mixing types are defined in mesa/const/public/const_def + log_D_mix ! log10 diffusion coefficient for mixing in units of cm^2/second (Eulerian) + !log_D_mix_non_rotation + !log_D_mix_rotation + + log_D_conv ! D_mix for regions where mix_type = convective_mixing + !log_D_leftover ! D_mix for regions where mix_type = leftover_convective_mixing + log_D_semi ! D_mix for regions where mix_type = semiconvective_mixing + log_D_ovr ! D_mix for regions where mix_type = overshoot_mixing + log_D_thrm ! D_mix for regions where mix_type = thermohaline_mixing + !log_D_minimum ! D_mix for regions where mix_type = minimum_mixing + !log_D_rayleigh_taylor ! D_mix for regions where mix_type = rayleigh_taylor_mixing + !log_D_anon ! D_mix for regions where mix_type = anonymous_mixing + !log_D_omega + + !log_sig_mix ! sig(k) is mixing flow across face k in (gm sec^1) + ! sig(k) = D_mix*(4*pi*r(k)**2*rho_face)**2/dmavg + + !dominant_isoA_for_thermohaline + !dominant_isoZ_for_thermohaline + !gradL_composition_term + + !mix_type + + + +!# Optical Depth + tau ! optical depth + !log_column_depth ! log10 column depth, exterior mass / area (g cm^-2) + !log_radial_depth ! log10 radial distance to surface (cm) + !logtau ! log10(optical depth) at cell face + !tau_eff ! tau that gives the local P == P_atm if this location at surface + ! tau_eff = kap*(P/g - Pextra_factor*(L/M)/(6*pi*clight*cgrav)) + !tau_eff_div_tau + + + +!# Rotation + omega ! angular velocity = j_rot/i_rot + !log_omega + log_j_rot + !log_J_div_M53 ! J is j*1e-15 integrated from center; M53 is m^(5/3) + log_J_inside ! J_inside is j_rot integrated from center + !shear ! -dlnomega/dlnR + !log_abs_shear ! log10(abs(dlnomega/dlnR)) + !richardson_number + i_rot ! specific moment of inertia at cell boundary + !j_rot ! specific angular momentum at cell boundary + !v_rot ! rotation velocity at cell boundary (km/sec) + !w_div_w_crit_roche !ratio of rotational velocity to keplerian at the equator + !without the contribution from the Eddington factor + fp_rot ! rotation factor for pressure + ft_rot ! rotation factor for temperature + !ft_rot_div_fp_rot ! gradr factor + + !log_am_nu_non_rot ! log10(am_nu_non_rot) + !log_am_nu_rot ! log10(am_nu_rot) + log_am_nu ! log10(am_nu_non_rot + am_nu_rot) + + !r_polar ! (Rsun) + !log_r_polar ! log10 (Rsun) + !r_equatorial ! (Rsun) + !log_r_equatorial ! log10 (Rsun) + !r_e_div_r_p ! equatorial/r_polar + !omega_crit ! breakup angular velocity = sqrt(G M / equatorial^3) + !omega_div_omega_crit + + !am_log_nu_omega ! for diffusion of omega + !am_log_nu_j ! for diffusion of angular momentum + + !am_log_nu_rot ! diffusion of angular momentum driven by rotation + !am_log_nu_non_rot ! diffusion driven by other sources, e.g. convection + + !am_log_sig_omega ! for diffusion of omega + !am_log_sig_j ! for diffusion of angular momentum + !am_log_sig ! == am_log_sig_omega + + !am_log_D_visc ! diffusion coeff for kinematic viscosity + !am_log_D_DSI ! diffusion coeff for dynamical shear instability + !am_log_D_SH ! diffusion coeff for Solberg-Hoiland instability + !am_log_D_SSI ! diffusion coeff for secular shear instability + !am_log_D_ES ! diffusion coeff for Eddington-Sweet circulation + !am_log_D_GSF ! diffusion coeff for Goldreich-Schubert-Fricke instability + !am_log_D_ST ! Spruit dynamo mixing diffusivity + !am_log_nu_ST ! Spruit dynamo effective viscosity + + !dynamo_log_B_r ! (Gauss) + !dynamo_log_B_phi ! (Gauss) + + !am_domega_dlnR + !log_abs_dlnR_domega + + !w_div_w_crit_roche2 + + +!# Diffusion + ! electric field from element diffusion calculation + !e_field + !log_e_field + + ! gravitational field from element diffusion calculation + !g_field_element_diffusion + !log_g_field_element_diffusion + + !eE_div_mg_element_diffusion + !log_eE_div_mg_element_diffusion + + ! element diffusion velocity for species + !edv h1 + !edv he4 + !edv o16 + + ! Energy generated by Ne22 sedimentation. + !eps_WD_sedimentation + !log_eps_WD_sedimentation + + !eps_diffusion + !log_eps_diffusion + + !diffusion_D h1 ! self diffusion coeff + !diffusion_dX h1 ! change in h1 mass fraction from diffusion + !diffusion_dX he4 ! change in he4 mass fraction from diffusion + !diffusion_dX n20 ! change in n20 mass fraction from diffusion + + !v_rad h1 ! velocity from radiative levitation + !v_rad he4 ! velocity from radiative levitation + !v_rad ne20 ! velocity from radiative levitation + + !log_g_rad h1 ! log10 acceleration from radiative levitation + !log_g_rad he4 ! log10 acceleration from radiative levitation + !log_g_rad ne20 ! log10 acceleration from radiative levitation + +!# Phase Separation + !eps_phase_separation + +!# Oscillations + brunt_N2 ! brunt-vaisala frequency squared + brunt_N2_structure_term + brunt_N2_composition_term + !log_brunt_N2_structure_term + !log_brunt_N2_composition_term + !brunt_A ! = N^2*r/g + !brunt_A_div_x2 ! x = r(k)/r(1) + !brunt_N2_dimensionless ! N2 in units of 3GM/R^3 + !brunt_N_dimensionless ! N in units of sqrt(3GM/R^3) + !brunt_frequency ! cycles per day + !brunt_N ! sqrt(abs(brunt_N2)) + !log_brunt_N ! log10(brunt_N) + !log_brunt_N2 ! log10(brunt_N2) + !log_brunt_N2_dimensionless ! log10(brunt_N2_dimensionless) + + !brunt_B ! smoothed numerical difference + !brunt_nonB ! = grada - gradT + !log_brunt_B ! smoothed numerical difference + !log_brunt_nonB ! = grada - gradT + + !sign_brunt_N2 ! sign of brunt_N2 (+1 for Ledoux stable; -1 for Ledoux unstable) + !brunt_nu ! brunt_frequency in microHz + !log_brunt_nu ! brunt_frequency in microHz + + !lamb_S ! lamb frequency for l=1: S = sqrt(2)*csound/r (rad/s) + !lamb_S2 ! squared lamb frequency for l=1: S2 = 2*(csound/r)^2 (rad^2/s^2) + + !lamb_Sl1 ! lamb frequency for l=1; = sqrt(2)*csound/r (microHz) + !lamb_Sl2 ! lamb frequency for l=2; = sqrt(6)*csound/r (microHz) + !lamb_Sl3 ! lamb frequency for l=3; = sqrt(12)*csound/r (microHz) + !lamb_Sl10 ! lamb frequency for l=10; = sqrt(110)*csound/r (microHz) + + !log_lamb_Sl1 ! log10(lamb_Sl1) + !log_lamb_Sl2 ! log10(lamb_Sl2) + !log_lamb_Sl3 ! log10(lamb_Sl3) + !log_lamb_Sl10 ! log10(lamb_Sl10) + + !brunt_N_div_r_integral ! integral from center of N*dr/r + !k_r_integral ! integral from center of k_r*dr + !brunt_N2_sub_omega2 + !sl2_sub_omega2 + + +!# RSP + + !rsp_Chi ! dlnP_dlnRho + !rsp_Et ! Specific turbulent energy + !rsp_logEt ! Log specific turbulent energy + !rsp_erad ! Specific internal (radiative) energy + !rsp_log_erad ! Log specific internal (radiative) energy + !rsp_Hp_face ! Pressure scale height at cell face + !rsp_Lc ! Convective luminosity + !rsp_Lc_div_L ! Convective luminosity div total luminosity + !rsp_Lr ! Radiative luminosity + !rsp_Lr_div_L ! Radiative luminosity div total luminosity + !rsp_Lt ! Turbulent luminosity + !rsp_Lt_div_L ! Turbulent luminosity div total luminosity + !rsp_Pt ! Turbulent pressure, p_t, see Table 1 in MESA5 + !rsp_Uq ! Viscous momentum transfer rate, U_q, see Table 1 in MESA5 + !rsp_Eq ! Viscous energy transfer rate, epsilon_q, see Table 1 in MESA5 + !rsp_Pvsc ! Artificial viscosity, p_av, see Table 1 in MESA5 + !rsp_gradT ! Temperature gradient + !rsp_Y_face ! Superadiabatic gradient at cell face, Y_sag, see Table 1 in MESA5 + !rsp_damp ! Turbulent dissipation, D, see Table 1 in MESA5 + !rsp_dampR ! Radiative cooling, D_r, see Table 1 in MESA5 + !rsp_sink ! Sum of turbulent dissipation and radiative cooling terms + !rsp_src ! Source function, S, see Table 1 in MESA5 + !rsp_src_snk ! Convective coupling, C, see Table 1 in MESA5 + !rsp_heat_exchange_timescale ! 1d0/(clight * opacity * density) + !rsp_log_heat_exchange_timescale + !rsp_log_dt_div_heat_exchange_timescale ! Ratio of time step to heat exchange timescale + !w + !log_w + + !COUPL + !DAMP + !DAMPR + !SOURCE + !Chi + !Eq + !Hp_face + !PII_face + !Ptrb + !Pvsc + !Uq + !Y_face + +!# RTI + + !RTI_du_diffusion_kick + !alpha_RTI + !boost_for_eta_RTI + !dedt_RTI + !dudt_RTI + !eta_RTI + !log_alpha_RTI + !log_boost_for_eta_RTI + !log_eta_RTI + !log_etamid_RTI + !log_lambda_RTI_div_Hrho + !log_sig_RTI + !log_sigmid_RTI + !log_source_RTI + !log_source_minus_alpha_RTI + !log_source_plus_alpha_RTI + !source_minus_alpha_RTI + !source_plus_alpha_RTI + !lambda_RTI + +!# Hydrodynamics + + + !v + !v_div_v_escape + !v_div_vesc + !v_kms + !log_v_escape + + !u + !u_face + + !P_face + + +!# Extras + !extra_heat + !extra_L ! extra_heat integrated from center (Lsun) + !log_extra_L ! log10 integrated from center (Lsun) + !log_irradiation_heat + + !extra_jdot ! set in other_torque routine + !extra_omegadot ! set in other_torque routine + + !extra_opacity_factor ! set in other_opacity_factor routine + + ! diffusion factor profile for species, set in other_diffusion_factor routine + !extra_diffusion_factor h1 + !extra_diffusion_factor he4 + !extra_diffusion_factor o16 + + + +!# Miscellaneous + + !dlog_h1_dlogP ! (log(h1(k)) - log(h1(k-1)))/(log(P(k)) - log(P(k-1))) + !dlog_he3_dlogP + !dlog_he4_dlogP + !dlog_c12_dlogP + !dlog_c13_dlogP + !dlog_n14_dlogP + !dlog_o16_dlogP + !dlog_ne20_dlogP + !dlog_mg24_dlogP + !dlog_si28_dlogP + + !dlog_pp_dlogP + !dlog_cno_dlogP + !dlog_3alf_dlogP + + !dlog_burn_c_dlogP + !dlog_burn_n_dlogP + !dlog_burn_o_dlogP + + !dlog_burn_ne_dlogP + !dlog_burn_na_dlogP + !dlog_burn_mg_dlogP + + !dlog_cc_dlogP + !dlog_co_dlogP + !dlog_oo_dlogP + + !dlog_burn_si_dlogP + !dlog_burn_s_dlogP + !dlog_burn_ar_dlogP + !dlog_burn_ca_dlogP + !dlog_burn_ti_dlogP + !dlog_burn_cr_dlogP + !dlog_burn_fe_dlogP + + !dlog_pnhe4_dlogP + !dlog_photo_dlogP + !dlog_other_dlogP + + !logR_kap ! logR = logRho - 3*logT + 18 ; used in kap tables + !logW ! logW = logPgas - 4*logT + !logQ ! logQ = logRho - 2*logT + 12 + !logV ! logV = logRho - 0.7*logE + 20 + + !log_CpT_absMdot_div_L ! log10(s% Cp(k)*s% T(k)*abs(s% mstar_dot)/s% L(k)) + + !delta_r ! r - r_start, change during step + !delta_L ! L - L_start, change during step + !delta_cell_vol ! cell_vol - cell_vol_start, change during step + !delta_entropy ! entropy - entropy_start, change during step (does not include effects of diffusion) + !delta_T ! T - T_start, change during step + !delta_rho ! rho - rho_start, change during step + !delta_eps_nuc ! eps_nuc - eps_nuc_start, change during step + !delta_mu ! mu - mu_start, change during step + + !zFe ! mass fraction of "Fe" = Fe+Co+Ni + !log_zFe + !dPdr_dRhodr_info + !log_sig_raw_mix + + !d_u_div_rmid + !d_u_div_rmid_start + !d_v_div_r_dm + !d_v_div_r_dr + + !dlnP_dlnR + !dlnRho_dlnR + !dlnRho_dr + !dlnX_dr + !dlnY_dr + !dlogR + !dPdr_div_grav + !dPdr_info + !dRhodr_info + !dRstar_div_dr + !dr_ratio + !dm_eps_grav + !dr_ratio + !dt_cs_div_dr + dt_div_tau_conv + !dt_times_conv_vel_div_mixing_length + log_dt_cs_div_dr + !log_dt_div_tau_conv + !log_dt_times_conv_vel_div_mixing_length + !log_du_kick_div_du + !du + !dvdt_dPdm + !dvdt_grav + + !tau_conv + !tau_cool + !tau_epsnuc + !tau_qhse + + !max_abs_xa_corr + + !tdc_num_iters + + !k + + +! the first few lines of the profile contain general info about the model. +! for completeness, those items are described here. + + ! initial mass and Z + ! initial_mass + ! initial_z + ! general properties of the current state + ! model_number + ! num_zones + ! star_age + ! time_step + ! properties at the photosphere + ! Teff + ! photosphere_L + ! photosphere_r + ! properties at the outermost zone of the model + ! log_surface_L + ! log_surface_radius + ! log_surface_temp + ! properties near the center of the model + ! log_center_temp + ! log_center_density + ! log_center_P + ! center_eta + ! abundances near the center + ! center_h1 + ! center_he3 + ! center_he4 + ! center_c12 + ! center_n14 + ! center_o16 + ! center_ne20 + ! information about total mass + ! star_mass + ! star_mdot + ! star_mass_h1 + ! star_mass_he3 + ! star_mass_he4 + ! star_mass_c12 + ! star_mass_n14 + ! star_mass_o16 + ! star_mass_ne20 + ! locations of abundance transitions + ! he_core_mass + ! c_core_mass + ! o_core_mass + ! si_core_mass + ! fe_core_mass + ! location of optical depths 10 and 100 + ! tau10_mass + ! tau10_radius + ! tau100_mass + ! tau100_radius + ! time scales + ! dynamic_time + ! kh_timescale + ! nuc_timescale + ! various kinds of total power + ! power_nuc_burn + ! power_h_burn + ! power_he_burn + ! power_neu + ! a few control parameter values + ! h1_boundary_limit + ! he4_boundary_limit + ! c12_boundary_limit + ! burn_min1 + ! burn_min2 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re new file mode 100755 index 000000000..c9ef26f96 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re @@ -0,0 +1,33 @@ +#!/bin/bash + +shopt -u expand_aliases + +photo_directory=photos + +function most_recent_photo { + ls -tp "$photo_directory" | grep -v / | head -1 +} + +if [ $# -eq 0 ] +then + photo=$(most_recent_photo) +else + photo=$1 +fi + +if [ -z "$photo" ] || ! [ -f "$photo_directory/$photo" ] +then + echo "specified photo ($photo) does not exist" + exit 1 +fi + +echo "restart from $photo" +if ! cp "$photo_directory/$photo" restart_photo +then + echo "failed to copy photo ($photo)" + exit 1 +fi + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re_all b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re_all new file mode 100755 index 000000000..cb8f63b40 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re_all @@ -0,0 +1,2 @@ +./re_nomodfiles x00003000 inlist_to_he_dep_header +#./re_nomodfiles . inlist_pulses_header diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re_mid_pulse b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re_mid_pulse new file mode 100755 index 000000000..ef26715bb --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re_mid_pulse @@ -0,0 +1 @@ +./re_nomodfiles x00062000 inlist_pulses_header diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re_nomodfiles b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re_nomodfiles new file mode 100755 index 000000000..565b74208 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/re_nomodfiles @@ -0,0 +1,41 @@ +#!/bin/bash + +#echo $# +#echo $1 +#echo $2 + +photo_directory=photos + +function most_recent_photo { + ls -t "$photo_directory" | head -1 +} + +if [ "$#" -ne 2 ] +then + echo "must pass two arguments, photo string and inlist name" + exit 1 +fi + +if [ $1 = "." ] +then + photo=$(most_recent_photo) +else + photo=$1 +fi + +if [ -z "$photo" ] || ! [ -f "$photo_directory/$photo" ] +then + echo "specified photo does not exist" + exit 1 +fi + +echo "restart from $photo" +if ! cp "$photo_directory/$photo" restart_photo +then + echo "failed to copy photo" + exit 1 +fi + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star $2 +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn new file mode 100755 index 000000000..1adcae941 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn @@ -0,0 +1,25 @@ +#!/bin/bash + +# uncomment the following line to skip the optional inlists +# MESA_SKIP_OPTIONAL=t + +# this provides the definition of do_one (run one part of test) +# do_one [inlist] [output model] [LOGS directory] +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +# check if can skip building starting model +#if [ -n "$MESA_SKIP_OPTIONAL" ]; then +# cp standard_he_dep.mod he_dep.mod +#else + do_one inlist_to_he_dep_header he_dep.mod +# cp he_dep.mod standard_he_dep.mod +#fi + +#do_one inlist_pulses_header final.mod + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +echo 'finished' + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn1 b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn1 new file mode 100755 index 000000000..25590040a --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn1 @@ -0,0 +1,7 @@ +#!/bin/bash + +rm -f restart_photo + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn_nomodfiles b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn_nomodfiles new file mode 100755 index 000000000..35bd84f4c --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn_nomodfiles @@ -0,0 +1,7 @@ +#!/bin/bash +rm -f restart_photo +echo $1 + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star $1 +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn_pulse b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn_pulse new file mode 100755 index 000000000..14c5878ce --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/rn_pulse @@ -0,0 +1,25 @@ +#!/bin/bash + +# uncomment the following line to skip the optional inlists +# MESA_SKIP_OPTIONAL=t + +# this provides the definition of do_one (run one part of test) +# do_one [inlist] [output model] [LOGS directory] +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +# check if can skip building starting model +#if [ -n "$MESA_SKIP_OPTIONAL" ]; then +# cp standard_he_dep.mod he_dep.mod +#else +# do_one inlist_to_he_dep_header he_dep.mod +# cp he_dep.mod standard_he_dep.mod +#fi + +do_one inlist_pulses_header final.mod + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +echo 'finished' + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/run_all b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/run_all new file mode 100755 index 000000000..3c4429ac3 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/run_all @@ -0,0 +1,2 @@ +./rn_nomodfiles inlist_to_he_dep_header +./re_nomodfiles . inlist_pulses_header diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run.f90 b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run.f90 new file mode 100644 index 000000000..112660f7c --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run.f90 @@ -0,0 +1,15 @@ +program run + use run_star_support, only: do_read_star_job + use run_star, only: do_run_star + + implicit none + + integer :: ierr + + ierr = 0 + call do_read_star_job('inlist', ierr) + if (ierr /= 0) stop 1 + + call do_run_star + +end program diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run_star_extras.f90 b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run_star_extras.f90 new file mode 100644 index 000000000..47b54d47c --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run_star_extras.f90 @@ -0,0 +1,810 @@ +! *********************************************************************** +! +! Copyright (C) 2010-2019 The MESA Team +! +! this file is part of mesa. +! +! mesa is free software; you can redistribute it and/or modify +! it under the terms of the gnu general library public license as published +! by the free software foundation; either version 2 of the license, or +! (at your option) any later version. +! +! mesa is distributed in the hope that it will be useful, +! but without any warranty; without even the implied warranty of +! merchantability or fitness for a particular purpose. see the +! gnu library general public license for more details. +! +! you should have received a copy of the gnu library general public license +! along with this software; if not, write to the free software +! foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa +! +! *********************************************************************** + + module run_star_extras + + use star_lib + use star_def + use const_def + use math_lib + use auto_diff + use chem_def + use utils_lib + use rates_def, only: i_rate + use gyre_mesa_m + + + use interp_1d_def, only: pm_work_size + use interp_1d_lib, only: interp_pm, interp_values, interp_value + + implicit none + + include "test_suite_extras_def.inc" + include 'run_star_extras_TDC_pulsation_defs.inc' + + logical :: dbg = .false. + + !!!!!!!!!!!!!!!!!!!!!!!!! + ! These variables are loaded up from x_ctrl, x_integer_ctrl and x_logical_ctrl + ! values specified on inlist_ppisn + !!!!!!!!!!!!!!!!!!!!!!!!! + + + logical :: in_inlist_pulses, remesh_for_envelope_model, turn_off_remesh, remove_core + integer :: kick_model_number, timestep_drop_model_number, turn_off_remesh_model_number + integer :: initial_model_number + real(dp) :: max_dt_before_pulse, max_dt_during_pulse, core_T_for_cut + + contains + + include "test_suite_extras.inc" + include 'run_star_extras_TDC_pulsation.inc' + + + subroutine extras_controls(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + s% extras_startup => extras_startup + s% extras_start_step => extras_start_step + s% extras_check_model => extras_check_model + s% extras_finish_step => extras_finish_step + s% extras_after_evolve => extras_after_evolve + s% how_many_extra_history_columns => how_many_extra_history_columns + s% data_for_extra_history_columns => data_for_extra_history_columns + s% how_many_extra_profile_columns => how_many_extra_profile_columns + s% data_for_extra_profile_columns => data_for_extra_profile_columns + + ! pulsation info + s% other_photo_write => photo_write + s% other_photo_read => photo_read + + s% how_many_other_mesh_fcns => how_many_other_mesh_fcns + s% other_mesh_fcn_data => RSP_mesh + + ! this is optional + s% other_wind => brott_wind + s% other_adjust_mdot => my_adjust_mdot + s% other_before_struct_burn_mix => my_before_struct_burn_mix + s% other_kap_get => my_other_kap_get + + ! store user provided options from the inlist + + in_inlist_pulses = s% x_logical_ctrl(22) + max_dt_before_pulse = s% x_ctrl(17) + max_dt_during_pulse = s% x_ctrl(18) + remesh_for_envelope_model = s% x_logical_ctrl(23) + turn_off_remesh = s% x_logical_ctrl(24) + kick_model_number = s% x_ctrl(11) + timestep_drop_model_number = s% x_ctrl(13) + turn_off_remesh_model_number = s% x_ctrl(12) + remove_core = s% x_logical_ctrl(25) + core_T_for_cut = s% x_ctrl(14) + end subroutine extras_controls + + subroutine brott_wind(id, Lsurf, Msurf, Rsurf, Tsurf, X, Y, Z, w, ierr) + use star_def + integer, intent(in) :: id + real(dp), intent(in) :: Lsurf, Msurf, Rsurf, Tsurf, X, Y, Z ! surface values (cgs) + ! NOTE: surface is outermost cell. not necessarily at photosphere. + ! NOTE: don't assume that vars are set at this point. + ! so if you want values other than those given as args, + ! you should use values from s% xh(:,:) and s% xa(:,:) only. + ! rather than things like s% Teff or s% lnT(:) which have not been set yet. + real(dp), intent(out) :: w ! wind in units of Msun/year (value is >= 0) + integer, intent(out) :: ierr + + integer :: h1, he4 + real(dp) :: Xs, Ys, Z_div_Z_solar, Teff_jump, alfa, L1, M1, R1, T1, & + vink_wind, nieu_wind, hamann_wind + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + L1 = Lsurf + M1 = Msurf + R1 = Rsurf + T1 = Tsurf + + h1 = s% net_iso(ih1) + he4 = s% net_iso(ihe4) + Xs = s% xa(h1,1) + Ys = s% xa(he4,1) + ! Z=0.0142 is Z from Asplund et al. 2009 + Z_div_Z_solar = s% kap_rq% Zbase/0.0142d0 + ! use Vink et al 2001, eqns 14 and 15 to set "jump" temperature + Teff_jump = 1d3*(61.2d0 + 2.59d0*(-13.636d0 + 0.889d0*log10(Z_div_Z_solar))) + + vink_wind = 0d0 + nieu_wind = 0d0 + hamann_wind = 0d0 + w = 0 + + call eval_Vink_wind(vink_wind) + call eval_Nieuwenhuijzen_wind(nieu_wind) + call eval_Hamann_wind(hamann_wind) + + ! use 1/10 hamann + hamann_wind = hamann_wind/10d0 + + if (T1 < Teff_jump) then + ! low T wind + w = max(vink_wind, nieu_wind) + else + ! high T wind + alfa = 0d0 + if (Xs > 0.7d0) then + alfa = 1d0 + else if (Xs > 0.4d0 .and. Xs < 0.7d0) then + alfa = (Xs - 0.4d0)/0.3d0 + end if + w = alfa * vink_wind + (1d0-alfa) * hamann_wind + end if + + ierr = 0 + + contains + + subroutine eval_Vink_wind(w) + real(dp), intent(inout) :: w + real(dp) :: alfa, w1, w2, logMdot, dT, vinf_div_vesc + + ! alfa = 1 for hot side, = 0 for cool side + if (T1 > 27500d0) then + alfa = 1 + else if (T1 < 22500d0) then + alfa = 0 + else + dT = 100d0 + if (T1 > Teff_jump + dT) then + alfa = 1 + else if (T1 < Teff_jump - dT) then + alfa = 0 + else + alfa = (T1 - (Teff_jump - dT)) / (2*dT) + end if + end if + + if (alfa > 0) then ! eval hot side wind (eqn 24) + vinf_div_vesc = 2.6d0 ! this is the hot side galactic value + vinf_div_vesc = vinf_div_vesc*pow(Z_div_Z_solar,0.13d0) ! corrected for Z + logMdot = & + - 6.697d0 & + + 2.194d0*log10(L1/Lsun/1d5) & + - 1.313d0*log10(M1/Msun/30) & + - 1.226d0*log10(vinf_div_vesc/2d0) & + + 0.933d0*log10(T1/4d4) & + - 10.92d0*pow2(log10(T1/4d4)) & + + 0.85d0*log10(Z_div_Z_solar) + w1 = exp10(logMdot) + else + w1 = 0 + end if + + if (alfa < 1) then ! eval cool side wind (eqn 25) + vinf_div_vesc = 1.3d0 ! this is the cool side galactic value + vinf_div_vesc = vinf_div_vesc*pow(Z_div_Z_solar,0.13d0) ! corrected for Z + logMdot = & + - 6.688d0 & + + 2.210d0*log10(L1/Lsun/1d5) & + - 1.339d0*log10(M1/Msun/30) & + - 1.601d0*log10(vinf_div_vesc/2d0) & + + 1.07d0*log10(T1/2d4) & + + 0.85d0*log10(Z_div_Z_solar) + w2 = exp10(logMdot) + else + w2 = 0 + end if + + w = alfa*w1 + (1 - alfa)*w2 + + end subroutine eval_Vink_wind + + subroutine eval_Nieuwenhuijzen_wind(w) + ! Nieuwenhuijzen, H.; de Jager, C. 1990, A&A, 231, 134 (eqn 2) + real(dp), intent(out) :: w + real(dp) :: log10w + include 'formats' + log10w = -14.02d0 & + +1.24d0*log10(L1/Lsun) & + +0.16d0*log10(M1/Msun) & + +0.81d0*log10(R1/Rsun) & + +0.85d0*log10(Z_div_Z_solar) + w = exp10(log10w) + end subroutine eval_Nieuwenhuijzen_wind + + subroutine eval_Hamann_wind(w) + ! Hamann, W.-R.; Koesterke, L.; Wessolowski, U. 1995, A&A, 299, 151 + real(dp), intent(out) :: w + real(dp) :: log10w + include 'formats' + log10w = -11.95d0 & + +1.5d0*log10(L1/Lsun) & + -2.85d0*Xs & + + 0.85d0*log10(Z_div_Z_solar) + w = exp10(log10w) + end subroutine eval_Hamann_wind + + end subroutine brott_wind + + subroutine my_adjust_mdot(id, ierr) + use star_def + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + real(dp) :: Lrad_div_Ledd + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + if (s% generations > 2) then + write(*,*) "check mdots", s% mstar_dot, s% mstar_dot_old + if (abs(s% mstar_dot) > 1.05d0*abs(s% mstar_dot_old)) then + s% mstar_dot = 1.05d0*s% mstar_dot_old + else if (abs(s% mstar_dot) < 0.95d0*abs(s% mstar_dot_old)) then + s% mstar_dot = 0.95d0*s% mstar_dot_old + end if + end if + end subroutine my_adjust_mdot + + + subroutine my_other_kap_get( & + id, k, handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, & + lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + + use kap_def, only: num_kap_fracs + use kap_lib + + ! INPUT + integer, intent(in) :: id ! star id if available; 0 otherwise + integer, intent(in) :: k ! cell number or 0 if not for a particular cell + integer, intent(in) :: handle ! from alloc_kap_handle + integer, intent(in) :: species + integer, pointer :: chem_id(:) ! maps species to chem id + ! index from 1 to species + ! value is between 1 and num_chem_isos + integer, pointer :: net_iso(:) ! maps chem id to species number + ! index from 1 to num_chem_isos (defined in chem_def) + ! value is 0 if the iso is not in the current net + ! else is value between 1 and number of species in current net + real(dp), intent(in) :: xa(:) ! mass fractions + real(dp), intent(in) :: log10_rho ! density + real(dp), intent(in) :: log10_T ! temperature + real(dp), intent(in) :: lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT + ! free_e := total combined number per nucleon of free electrons and positrons + real(dp), intent(in) :: eta, d_eta_dlnRho, d_eta_dlnT + ! eta := electron degeneracy parameter + + ! OUTPUT + real(dp), intent(out) :: kap_fracs(num_kap_fracs) + real(dp), intent(out) :: kap ! opacity + real(dp), intent(out) :: dln_kap_dlnRho ! partial derivative at constant T + real(dp), intent(out) :: dln_kap_dlnT ! partial derivative at constant Rho + real(dp), intent(out) :: dln_kap_dxa(:) ! partial derivative w.r.t. to species + integer, intent(out) :: ierr ! 0 means AOK. + + type (star_info), pointer :: s + real(dp) :: velocity + real(dp) :: radius, logR + real(dp) :: logT_alt, inv_diff + real(dp) :: log_kap, alpha + + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + kap = 0; dln_kap_dlnRho = 0; dln_kap_dlnT = 0; dln_kap_dxa = 0 + velocity = 0 + radius = 0 + + !if (k==1 .and. s% u_flag .and. .not. is_nan(s% lnR_start(1))) then !very surface cell can go mad, things are more stable if we fix opacity + ! if (s% xh_start(s% i_u,1)>sqrt(2*s% cgrav(1)*s% m(1)/exp(s% lnR_start(1)))) then + if (k==1 .and. s% u_flag) then !very surface cell can go mad, things are more stable if we fix opacity + ! this is to support restarts, as xh_start and r_start are + ! not properly set when model loads + if (s% solver_iter > 0) then + velocity = s% xh_start(s% i_u,1) + radius = s% r_start(1) + else + velocity = s% xh(s% i_u,1) + radius = s% r(1) + end if + if (velocity>sqrt(2*s% cgrav(1)*s% m(1)/radius)) then + kap = 0.2d0*(1 + s% X(1)) + dln_kap_dlnRho = 0d0 + dln_kap_dlnT = 0d0 + return + else + call kap_get( & + s% kap_handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + end if + else + call kap_get( & + s% kap_handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + end if + + + end subroutine my_other_kap_get + + subroutine extras_startup(id, restart, ierr) + integer, intent(in) :: id + logical, intent(in) :: restart + integer, intent(out) :: ierr + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call test_suite_startup(s, restart, ierr) + call TDC_pulsation_extras_startup(id, restart, ierr) + + ! interestingly, if you do this instead of remove_center_by_temperature + ! in the starjob section of the inlist, then the tau relaxation happens + ! before the cut. Not sure which is better, but leaving like this for now. + ! It turns out that this appears to be the better way and + ! to do it, as this smooths the initialization of new atm BCs (if changed). + if (.not. restart .and. in_inlist_pulses .and. remove_core) then + call star_remove_center_by_temperature(id, core_T_for_cut, ierr) + end if + + ! Initialize GYRE + + call init('gyre.in') + + ! Set constants + + call set_constant('G_GRAVITY', standard_cgrav) + call set_constant('C_LIGHT', clight) + call set_constant('A_RADIATION', crad) + + call set_constant('M_SUN', Msun) + call set_constant('R_SUN', Rsun) + call set_constant('L_SUN', Lsun) + + call set_constant('GYRE_DIR', TRIM(mesa_dir)//'/gyre/gyre') + + ! for rsp style mesh + if (.not. restart .and. in_inlist_pulses ) then + initial_model_number = s% model_number + end if + + if (.not. restart .and. in_inlist_pulses .and. remesh_for_envelope_model) then + initial_model_number = s% model_number + + call remesh_for_TDC_pulsation(id, ierr) + end if + end subroutine extras_startup + + + subroutine extras_after_evolve(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + real(dp) :: dt + character (len=strlen) :: test + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call test_suite_after_evolve(s, ierr) + + if (.not. s% x_logical_ctrl(37)) return + call final() + end subroutine extras_after_evolve + + + ! returns either keep_going, retry, or terminate. + integer function extras_check_model(id) + integer, intent(in) :: id + integer :: ierr, k + real(dp) :: max_v + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + extras_check_model = keep_going + + + end function extras_check_model + + + integer function how_many_extra_history_columns(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + how_many_extra_history_columns = TDC_pulsation_how_many_extra_history_columns(id) + end function how_many_extra_history_columns + + + subroutine data_for_extra_history_columns(id, n, names, vals, ierr) + integer, intent(in) :: id, n + character (len=maxlen_history_column_name) :: names(n) + real(dp) :: vals(n), v_esc + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k, k0 + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call TDC_pulsation_data_for_extra_history_columns(id, n, names, vals, ierr) + end subroutine data_for_extra_history_columns + + + integer function how_many_extra_profile_columns(id) + use star_def, only: star_info + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return +! how_many_extra_profile_columns = TDC_pulsation_how_many_extra_profile_columns(id) + how_many_extra_profile_columns = 1!how_many_extra_profile_columns +1 + end function how_many_extra_profile_columns + + + subroutine data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + use star_def, only: star_info, maxlen_profile_column_name + use const_def, only: dp + integer, intent(in) :: id, n, nz + character (len=maxlen_profile_column_name) :: names(n) + real(dp) :: vals(nz,n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return +! call TDC_pulsation_data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + names(1) = 'Frad_div_cUrad' + do k = 1, s% nz + vals(k,1) = ((s% L(k) - s% L_conv(k)) / (4._dp*pi*pow2(s%r(k)))) & + /(clight * s% Prad(k) *3._dp) + end do + end subroutine data_for_extra_profile_columns + + + integer function extras_start_step(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + include 'formats' + extras_start_step = terminate + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + !this is used to ensure we read the right inlist options + s% use_other_before_struct_burn_mix = .true. + + ! we want to ignore T gradient equation for a few steps after remesh + if (s% model_number < initial_model_number + 100 .and. in_inlist_pulses) then + s% convergence_ignore_equL_residuals = .true. + else if (in_inlist_pulses) then + s% convergence_ignore_equL_residuals = .false. + end if + + if (s% model_number == kick_model_number .and. in_inlist_pulses & + .and. s% x_logical_ctrl(5))then + + ! if v= 0, turn on v so we can kick + if (.not. s% v_flag .or. .not. s% u_flag) then + call star_set_v_flag(id, .true., ierr) + end if + + call gyre_in_mesa_extras_set_velocities(s,.false.,ierr) + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + + end if + + call my_before_struct_burn_mix(s% id, s% dt, extras_start_step) + + extras_start_step = keep_going + end function extras_start_step + + subroutine my_before_struct_burn_mix(id, dt, res) + use const_def, only: dp + use star_def + integer, intent(in) :: id + real(dp), intent(in) :: dt + integer, intent(out) :: res ! keep_going, redo, retry, terminate + real(dp) :: power_photo, v_esc + integer :: ierr, k + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + +! !s% use_atm_PT_at_center_of_surface_cell = .false. +! s% use_momentum_outer_BC = .false. ! offset_P_to_center_cell = .true. +! s% use_compression_outer_BC = .false. ! offset_P_to_center_cell = .true. +! s% use_zero_Pgas_outer_BC = .true. +! s% atm_option = 'T_tau' +! s% atm_T_tau_relation = 'Eddington' +! s% atm_T_tau_opacity = 'fixed' +! s% tau_factor = 1d-3 +! s% Pextra_factor = 1d0 +! s% force_tau_factor = 1d-3 +! s% delta_lgL_limit = 0.25d0 +! !s% delta_lgTeff_limit = 1d-2!0.25d0 +! s% delta_lgL_limit_L_min = 1d99!-100 +! s% delta_lgL_limit_L_min = 1d99!-100 +! +! !s% atm_T_tau_errtol = 1d-12 +! !s% atm_T_tau_max_iters = 500 + + if (in_inlist_pulses) then + if (s% model_number > timestep_drop_model_number )then + s% max_timestep = max_dt_during_pulse + else + s% max_timestep = max_dt_before_pulse + end if + + if (s% model_number > turn_off_remesh_model_number .and. turn_off_remesh )then + s% okay_to_remesh = .false. + ! if ((s% model_number == turn_off_remesh_model_number + 1) & + ! .and. .not. remesh_for_envelope_model )then + ! do k =1,s%nz + ! if (s%lnT(k) >= log(2d6)) then + ! exit + ! end if + ! end do + ! s% mesh_min_k_old_for_split = k + ! end if + ! write (*,*) 's% mesh_min_k_old_for_split', s% mesh_min_k_old_for_split + end if + end if + + ! adjust convection near surface to prevent crazy issues: + +! do k = 1, s% nz +! if (s% tau(k) > 2d0/3d0) then +! exit +! end if +! end do +! +! s% max_q_for_convection_with_hydro_on = s% q(k-1) + + ! reading inlists can turn this flag off for some reason + s% use_other_before_struct_burn_mix = .true. + + res = keep_going + end subroutine my_before_struct_burn_mix + + subroutine null_binary_controls(id, binary_id, ierr) + integer, intent(in) :: id, binary_id + integer, intent(out) :: ierr + ierr = 0 + end subroutine null_binary_controls + + ! returns either keep_going or terminate. + integer function extras_finish_step(id) + use run_star_support + use math_lib + integer, intent(in) :: id + integer :: ierr,k + real(dp) :: max_vel_inside, vesc_for_cell, vesc_surf !check_avg_v_div_vesc + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + extras_finish_step = keep_going + extras_finish_step = TDC_pulsation_extras_finish_step(id) + +! if (.not. s% x_logical_ctrl(37)) return +! extras_finish_step = gyre_in_mesa_extras_finish_step(id) + + if (extras_finish_step == terminate) s% termination_code = t_extras_finish_step + + end function extras_finish_step + + + + + ! here is an example that adds a mesh function for log(opacity) + subroutine how_many_other_mesh_fcns(id, n) + integer, intent(in) :: id + integer, intent(out) :: n + n = 1 + end subroutine how_many_other_mesh_fcns + + +! subroutine RSP_mesh( & +! id, nfcns, names, gval_is_xa_function, vals1, ierr) +! use star_def +! use math_lib +! use const_def +! integer, intent(in) :: id +! integer, intent(in) :: nfcns +! character(len=*) :: names(:) +! logical, intent(out) :: gval_is_xa_function(:) ! (nfcns) +! real(dp), pointer :: vals1(:) ! =(nz, nfcns) +! integer, intent(out) :: ierr +! integer :: nz, k +! real(dp), pointer :: vals(:, :) +! real(dp) :: weight1 = 1d6!1d4 +! real(dp) :: weight2 = 8d5!1d4 +! real(dp) :: weight3 = 0d0 +! real(dp) :: logT_anchor1, logT_anchor2, logT_anchor3, lmid, delta, ell +! integer :: k_anchor1, k_anchor2 +! +! type(star_info), pointer :: s +! ierr = 0 +! call star_ptr(id, s, ierr) +! if (ierr /= 0) return +! names(1) = 'RSP_function' +! gval_is_xa_function(1) = .false. +! nz = s%nz +! vals(1:nz, 1:nfcns) => vals1(1:nz*nfcns) +! +! logT_anchor1 = log(11d3)!log(11d3) +! logT_anchor2 = log(20d3)!log(11d3) +! logT_anchor3 = log(30d3) +! +! lmid = 0.5d0*(logT_anchor2+logT_anchor3) +! delta = (logT_anchor3 - logT_anchor2) +! +! k_anchor1 = 0 +! k_anchor2 = 0 +! +! ! do k = 1, nz +! ! if (s% lnT(k) < logT_anchor1) then +! ! vals(k, 1) = weight1*(s% m(1) - s% m(k))/Msun +! ! k_anchor = k +! ! !write (*,*) "k", k ,"dm", vals(k, 1) +! ! else if (s% lnT(k) < logT_anchor2 .and. s% lnT(k) >= logT_anchor1) then +! ! vals(k, 1) = weight2*(s% m(k_anchor) - s% m(k))/Msun +! ! !write (*,*) "k", k ,"dm", vals(k, 1) +! ! else +! ! vals(k, 1) = weight3*(s% m(1)/Msun - s% m(k)/Msun) +! ! end if +! ! end do +! +! +! do k = 1, nz +! ell = s%lnT(k) +! if (s% lnT(k) <= logT_anchor1) then +! vals(k,1) = weight1*(s%m(1) - s%m(k))/Msun +! k_anchor1 = k +! else if (s% lnT(k) <= logT_anchor2 .and. s% lnT(k) >= logT_anchor1) then +! vals(k,1) = weight2*(s%m(1) - s%m(k))/Msun +! k_anchor2 = k +! else if (s% lnT(k) < logT_anchor3) then +! ! smooth taper doqn to 0. +!! vals(k,1) = vals(k-1,1)/2d0 +! vals(k,1) = (0.5d0*weight2*(1d0 - tanh( (ell - lmid)/delta )) & +! ) * ( (s%m(k_anchor2) - s%m(k)) / Msun ) +! end if +! end do +! +! end subroutine RSP_mesh + +subroutine RSP_mesh( & + id, nfcns, names, gval_is_xa_function, vals1, ierr) + use star_def + use math_lib + use const_def + integer, intent(in) :: id + integer, intent(in) :: nfcns + character(len=*) :: names(:) + logical, intent(out) :: gval_is_xa_function(:) ! (nfcns) + real(dp), pointer :: vals1(:) ! =(nz, nfcns) + integer, intent(out) :: ierr + integer :: nz, k + real(dp), pointer :: vals(:, :) + real(dp) :: weight1 = 1d5!1d4 + real(dp) :: weight2 = 1d5!1d4 + real(dp) :: weight3 = 0d0 + real(dp) :: logT_anchor1, logT_anchor2, logT_anchor3, lmid, delta, ell + integer :: k_anchor1, k_anchor2 + + type(star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + names(1) = 'RSP_function' + gval_is_xa_function(1) = .false. + nz = s%nz + vals(1:nz, 1:nfcns) => vals1(1:nz*nfcns) + + logT_anchor1 = log(11d3)!log(11d3) + logT_anchor2 = log(20d3)!log(11d3) + logT_anchor3 = log(30d3) + + lmid = 0.5d0*(logT_anchor2+logT_anchor3) + delta = (logT_anchor3 - logT_anchor2)/10d0 + + k_anchor1 = 0 + k_anchor2 = 0 + +! do k = 1, nz +! if (s% lnT(k) < logT_anchor1) then +! vals(k, 1) = weight1*(s% m(1) - s% m(k))/Msun +! k_anchor = k +! !write (*,*) "k", k ,"dm", vals(k, 1) +! else if (s% lnT(k) < logT_anchor2 .and. s% lnT(k) >= logT_anchor1) then +! vals(k, 1) = weight2*(s% m(k_anchor) - s% m(k))/Msun +! !write (*,*) "k", k ,"dm", vals(k, 1) +! else +! vals(k, 1) = weight3*(s% m(1)/Msun - s% m(k)/Msun) +! end if +! end do + + + do k = 1, nz + ell = s%lnT(k) + if (s% lnT(k) < logT_anchor1) then + ! core weighting + vals(k,1) = weight1*(s%m(1) - s%m(k))/Msun + k_anchor1 = k + else if (s% lnT(k) < logT_anchor2 .and. s% lnT(k) >= logT_anchor1) then + ! envelope weighting + vals(k,1) = weight2*(s%m(k_anchor1) - s%m(k))/Msun + k_anchor2 = k + else + ! smooth taper from weight2 → 0 + vals(k,1) = ( & + 0.5d0*weight2*(1d0 - tanh( (ell - lmid)/delta )) & + ) * ( (s%m(k_anchor2) - s%m(k)) / Msun ) + end if + end do + +end subroutine RSP_mesh + + + subroutine photo_write(id, iounit) + integer, intent(in) :: id, iounit + call TDC_pulsation_photo_write(id, iounit) + end subroutine photo_write + + + subroutine photo_read(id, iounit, ierr) + integer, intent(in) :: id, iounit + integer, intent(out) :: ierr + call TDC_pulsation_photo_read(id, iounit, ierr) + end subroutine photo_read + + end module run_star_extras + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run_star_extras_TDC_pulsation.inc b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run_star_extras_TDC_pulsation.inc new file mode 100644 index 000000000..e3254cb2a --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run_star_extras_TDC_pulsation.inc @@ -0,0 +1,383 @@ + + + subroutine TDC_pulsation_photo_write(id, iounit) + integer, intent(in) :: id, iounit + write(iounit) num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev, & + period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag, & + time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max, & + best_period, best_model_number, best_order, best_cycles_to_double + end subroutine TDC_pulsation_photo_write + + + subroutine TDC_pulsation_photo_read(id, iounit, ierr) + integer, intent(in) :: id, iounit + integer, intent(out) :: ierr + ierr = 0 + read(iounit, iostat=ierr) num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev, & + period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag, & + time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max, & + best_period, best_model_number, best_order, best_cycles_to_double + end subroutine TDC_pulsation_photo_read + + + subroutine TDC_pulsation_extras_startup(id, restart, ierr) + integer, intent(in) :: id + logical, intent(in) :: restart + integer, intent(out) :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + if (.not. restart) then + num_periods = 0 + run_num_steps_end_prev = 0 + run_num_iters_end_prev = 0 + run_num_retries_end_prev = 0 + period = 0 + KE_growth = 0 + KE_growth_avg = 0 + prev_KE_max = 0 + delta_R_growth = 0 + delta_R_growth_avg = 0 + prev_delta_R = 0 + period_max_v_div_cs = 0 + period_max_v_div_vesc = 0 + period_delta_R = 0 + period_delta_Teff = 0 + period_delta_logTeff = 0 + period_delta_logL = 0 + period_delta_Mag = 0 + time_started = 0 + v_div_cs_max = 0 + v_div_vesc_max = 0 + KE_min = 0 + KE_max = 0 + R_min = 0 + R_max = 0 + L_min = 0 + L_max = 0 + T_min = 0 + T_max = 0 + best_period = 0 + best_model_number = 0 + best_order = 0 + best_cycles_to_double = 0 + end if + end subroutine TDC_pulsation_extras_startup + + + integer function TDC_pulsation_extras_finish_step(id) + use chem_def + integer, intent(in) :: id + type (star_info), pointer :: s + integer :: ierr, gyre_interval, test_period + real(dp) :: target_period + logical :: doing_pulses + include 'formats' + + TDC_pulsation_extras_finish_step = terminate + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_extras_finish_step = keep_going + + gyre_interval = s% x_integer_ctrl(1) + if (gyre_interval > 0) then + if (MOD(s% model_number, gyre_interval) == 0) & + call get_gyre_info_for_this_step + if (TDC_pulsation_extras_finish_step == terminate) & + s% termination_code = t_extras_finish_step + if (TDC_pulsation_extras_finish_step /= keep_going) return + end if + + doing_pulses = s% x_logical_ctrl(7) + if (.not. doing_pulses) return + target_period = s% x_ctrl(7) + if (target_period <= 0d0) return + if (.not. get_period_info()) return + + test_period = s% x_integer_ctrl(7) + if (num_periods < test_period .or. test_period <= 0) return + + ! have finished test run + call report_test_results + TDC_pulsation_extras_finish_step = terminate + + contains + + subroutine get_gyre_info_for_this_step + integer :: i + TDC_pulsation_extras_finish_step = gyre_in_mesa_extras_finish_step(id) + if (s% ixtra3_array(1) > 0) then ! unpack the GYRE results + do i=1,s% ixtra3_array(1) + if (s% xtra1_array(i) == 0d0 .or. & + (s% ixtra1_array(i) /= s% x_integer_ctrl(4) .and. s% x_integer_ctrl(4) > 0)) cycle + if (s% xtra3_array(i) > 0d0 .and. & + (best_cycles_to_double == 0d0 .or. s% xtra3_array(i) < best_cycles_to_double)) then + !best_growth = s% xtra1_array(i) + best_period = 1d0/s% xtra2_array(i) ! xtra2_array = freq (s^-1) + best_period = best_period/(24*3600) ! change to days + best_cycles_to_double = s% xtra3_array(i) + best_order = s% ixtra1_array(i) + best_model_number = s% model_number + end if + end do + end if + end subroutine get_gyre_info_for_this_step + + logical function get_period_info() + real(dp) :: v_surf, v_surf_start, KE, min_period, time_ended, & + delta_R, min_deltaR_for_periods, growth_avg_frac_new, & + min_period_div_target, cs, vesc + include 'formats' + get_period_info = .false. + + if (s% r(1) < R_min) R_min = s% r(1) + if (s% r(1) > R_max) R_max = s% r(1) + if (s% L(1) < L_min) L_min = s% L(1) + if (s% L(1) > L_max) L_max = s% L(1) + if (s% Teff < T_min) T_min = s% Teff + if (s% Teff > T_max) T_max = s% Teff + KE = s% total_radial_kinetic_energy_end + if (KE > KE_max) KE_max = KE + if (KE < KE_min) KE_min = KE + + if (s% v_flag) then + v_surf = s% v(1) + v_surf_start = s% v_start(1) + else if (s% u_flag) then + v_surf = s% u_face_val(1) + v_surf_start = s% u_face_start(1) + else ! + v_surf = 0d0 + v_surf_start = 0d0 + !stop 'TDC_pulsation_extras_finish_step: both v_flag and u_flag are false' + end if + cs = s% csound(1) + if (v_surf > v_div_cs_max*cs) v_div_cs_max = v_surf/cs + vesc = sqrt(2*s% cgrav(1)*s% m(1)/(s% r(1))) + if (v_surf > v_div_vesc_max*vesc) v_div_vesc_max = v_surf/vesc + + ! period is completed when v_surf goes from positive to negative during step + if (v_surf > 0d0 .or. v_surf_start < 0d0) return + + if (time_started == 0) then ! start of 1st cycle + time_started = s% time + run_num_steps_end_prev = s% model_number + run_num_iters_end_prev = s% total_num_solver_iterations + run_num_retries_end_prev = s% num_retries + prev_KE_max = 0d0 + call init_min_max_info + write(*,*) 'first maximum radius, period calculations starting at model, day', & + s% model_number, s% time/(24*3600) + return + end if + + delta_R = R_max - R_min + min_deltaR_for_periods = s% x_ctrl(8)*Rsun + if (min_deltaR_for_periods > 0d0) then + if (delta_R < min_deltaR_for_periods) return ! filter out glitches + end if + + time_ended = s% time + if (abs(v_surf - v_surf_start) > 1d-10) & ! tweak the end time to match when v_surf == 0 + time_ended = s% time - v_surf*s% dt/(v_surf - v_surf_start) + min_period_div_target = s% x_ctrl(10) + min_period = target_period*(24*3600)*min_period_div_target + if (min_period > 0d0 .and. & + time_ended - time_started < min_period) return ! filter out glitches + + period = time_ended - time_started + num_periods = num_periods + 1 + + if (num_periods > 1) then + growth_avg_frac_new = s% x_ctrl(9) + KE_growth = (KE_max - prev_KE_max)/prev_KE_max + KE_growth_avg = growth_avg_frac_new*KE_growth + & + (1d0 - growth_avg_frac_new)*KE_growth_avg + delta_R_growth = (delta_R - prev_delta_R)/prev_delta_R + delta_R_growth_avg = growth_avg_frac_new*delta_R_growth + & + (1d0 - growth_avg_frac_new)*delta_R_growth_avg + end if + + period_delta_Teff = T_max - T_min + period_delta_logTeff = log10(T_max/T_min) + period_delta_R = R_max - R_min + period_delta_logL = log10(L_max/L_min) + period_delta_Mag = 2.5d0*period_delta_logL + period_max_v_div_cs = v_div_cs_max + period_max_v_div_vesc = v_div_vesc_max + prev_KE_max = KE_max + prev_delta_R = period_delta_R + ! 1 2 3 4 5 6 7 8 9 + write(*,'(i4,a14,i6,a13,f8.3,a13,f9.3,a9,f9.4,a15,f10.4,a13,f9.4,a13,f10.4,a11,f9.4,a13,f9.4)') & + num_periods, & + 'steps/cycle', s% model_number - run_num_steps_end_prev, & ! 1 a14,i6 + 'iters/step', & + dble(s% total_num_solver_iterations - run_num_iters_end_prev)/ & + dble(s% model_number - run_num_steps_end_prev), & ! 2 a13,f8.3 + 'period (d)', period/(24*3600), & ! 3 a13,f9.3 + 'growth', delta_R_growth_avg, & ! 4 a9,f9.4 + 'delta R/Rsun', period_delta_R/Rsun, & ! 5 a15,f10.4 + 'delta logL', period_delta_logL, & ! 6 a13,f9.4 + 'delta Teff', period_delta_Teff, & ! 7 a13,f10.4 + 'max v/cs', period_max_v_div_cs, & ! 8 a11,f9.4 + 'max v/vesc', period_max_v_div_vesc ! 9 a13,f9.4 + + time_started = time_ended + run_num_steps_end_prev = s% model_number + run_num_iters_end_prev = s% total_num_solver_iterations + run_num_retries_end_prev = s% num_retries + call init_min_max_info + get_period_info = .true. + + end function get_period_info + + subroutine init_min_max_info + v_div_cs_max = 0d0 + v_div_vesc_max = 0d0 + KE_min = 1d99 + KE_max = -1d99 + R_min = 1d99 + R_max = -1d99 + L_min = 1d99 + L_max = -1d99 + T_min = 1d99 + T_max = -1d99 + end subroutine init_min_max_info + + subroutine report_test_results + real(dp) :: rel_run_E_err + write(*,*) + write(*,*) + write(*,*) + rel_run_E_err = s% cumulative_energy_error/s% total_energy + write(*,*) 'rel_run_E_err', rel_run_E_err + if (s% total_energy /= 0d0 .and. abs(rel_run_E_err) > 1d-5) then + write(*,*) '*** BAD rel_run_E_error ***', & + s% cumulative_energy_error/s% total_energy + else if (abs(period/(24*3600) - target_period) > 1d-2) then + write(*,*) '*** BAD period ***', period/(24*3600) - target_period, & + period/(24*3600), target_period + else + write(*,*) 'good match for period', & + period/(24*3600), target_period + end if + write(*,*) + write(*,*) + write(*,*) + end subroutine report_test_results + + end function TDC_pulsation_extras_finish_step + + + include 'gyre_in_mesa_extras_finish_step.inc' + + + subroutine TDC_pulsation_extras_after_evolve(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + ierr = 0 + call final() + end subroutine TDC_pulsation_extras_after_evolve + + + integer function TDC_pulsation_how_many_extra_history_columns(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_how_many_extra_history_columns = 11 + end function TDC_pulsation_how_many_extra_history_columns + + + subroutine TDC_pulsation_data_for_extra_history_columns(id, n, names, vals, ierr) + integer, intent(in) :: id, n + character (len=maxlen_history_column_name) :: names(n) + real(dp) :: vals(n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: i + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + i = 1 + names(i) = 'num_periods'; vals(i) = num_periods; i=i+1 + names(i) = 'period'; vals(i) = period/(24*3600); i=i+1 + names(i) = 'growth'; vals(i) = delta_R_growth_avg; i=i+1 + names(i) = 'max_v_div_cs'; vals(i) = period_max_v_div_cs; i=i+1 + names(i) = 'max_v_div_vesc'; vals(i) = period_max_v_div_vesc; i=i+1 + names(i) = 'delta_R'; vals(i) = period_delta_R/Rsun; i=i+1 + names(i) = 'delta_Teff'; vals(i) = period_delta_Teff; i=i+1 + names(i) = 'delta_logTeff'; vals(i) = period_delta_logTeff; i=i+1 + names(i) = 'delta_logL'; vals(i) = period_delta_logL; i=i+1 + names(i) = 'delta_Mag'; vals(i) = period_delta_Mag; i=i+1 + names(i) = 'KE_growth_avg'; vals(i) = KE_growth_avg; i = i+1 + + end subroutine TDC_pulsation_data_for_extra_history_columns + + + integer function TDC_pulsation_how_many_extra_profile_columns(id) + use star_def, only: star_info + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_how_many_extra_profile_columns = 0 ! 6 + end function TDC_pulsation_how_many_extra_profile_columns + + + subroutine TDC_pulsation_data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + use star_def, only: star_info, maxlen_profile_column_name + use const_def, only: dp + integer, intent(in) :: id, n, nz + character (len=maxlen_profile_column_name) :: names(n) + real(dp) :: vals(nz,n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k + ierr = 0 + return + + + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + names(1) = 'xtra1' + names(2) = 'xtra2' + names(3) = 'xtra3' + names(4) = 'xtra4' + names(5) = 'xtra5' + names(6) = 'xtra6' + + do k=1,nz + vals(k,1) = s% xtra1_array(k) + vals(k,2) = s% xtra2_array(k) + vals(k,3) = s% xtra3_array(k) + vals(k,4) = s% xtra4_array(k) + vals(k,5) = s% xtra5_array(k) + vals(k,6) = s% xtra6_array(k) + end do + + end subroutine TDC_pulsation_data_for_extra_profile_columns + + + include 'gyre_in_mesa_extras_set_velocities.inc' + + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run_star_extras_TDC_pulsation_defs.inc b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run_star_extras_TDC_pulsation_defs.inc new file mode 100644 index 000000000..b7b6e47b6 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_RSG_20M_u_flag/src/run_star_extras_TDC_pulsation_defs.inc @@ -0,0 +1,16 @@ + + ! GYRE "best" info + real(dp) :: best_period, best_cycles_to_double + integer :: best_model_number, best_order + + ! summary info at time of recently completely period + integer :: num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev + real(dp) :: period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag + ! info for period in progress + real(dp) :: time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/README.rst b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/README.rst new file mode 100644 index 000000000..f42e1a90d --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/README.rst @@ -0,0 +1,33 @@ +.. _ppisn: + +***** +dev_TDC_Mira +***** + +! M-type Mira variable stars +! Ireland, Scholz, and Wood, MNRAS 418, 114-128 (2011) +! C50 5050 L series +! M = 1.35 Msun when reaches AGB. start with 1.5 at ZAMS +! at phase = 0 +! L = 6722 Lsun logL = 3.8 +! T = 3271 logT = 3.5 +! period = 427 days +! mlt_alpha = 2.0 +! age ~ 3e9 years +! see Fig 4 for history plots of logL and logTeff and R + +This test case evolves a very massive helium star from the He-ZAMS +up to the ocurrence of a pulsational pair-instability event (see |Marchant2019|). + +.. |Marchant2019| replace:: `Marchant et al. 2019 `__ + +Initialization of the model +=========================== +The initial mass of the helium star is set in ``inlist_extra`` + +.. literalinclude:: ../../../star/test_suite/ppisn/inlist_extra + +In this case we use a :math:`72 M_\odot` + +Last-Updated: 2019-11-12 (mesa r12413) by Pablo Marchant + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/ck b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/ck new file mode 100755 index 000000000..ac08f15c6 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/ck @@ -0,0 +1,7 @@ +#!/bin/bash + +# this provides the definition of check_one +# check_one +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +check_one diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/clean b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/clean new file mode 100755 index 000000000..95545a5c1 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/clean @@ -0,0 +1,4 @@ +#!/bin/bash + +cd make +make clean diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/gyre.in b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/gyre.in new file mode 100644 index 000000000..797bf067b --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/gyre.in @@ -0,0 +1,36 @@ +&model + add_center = .FALSE. + +/ + +&mode + l = 0 +/ + +&osc + nonadiabatic = .TRUE. + inner_bound = 'ZERO_R' + +/ + +&rot +/ + +&num + diff_scheme = 'MAGNUS_GL2'!'COLLOC_GL2' +/ + +&scan + grid_type = 'LINEAR' + freq_min = 0.01 + freq_max = 10.0 + freq_min_units = 'ACOUSTIC_DELTA' + freq_max_units = 'ACOUSTIC_DELTA' + n_freq = 50 +/ + +&grid + w_osc = 10 + w_exp = 2 + w_ctr = 10 +/ diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/he_dep.mod b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/he_dep.mod new file mode 100644 index 000000000..bf2127b2e --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/he_dep.mod @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59bee751e1cb5df75f654cf2d83ee37dbefe4fc765b759093e776824db9627cf +size 1004003 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/history_columns.list b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/history_columns.list new file mode 100644 index 000000000..c9f423332 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/history_columns.list @@ -0,0 +1,1073 @@ +! history_columns.list -- determines the contents of star history logs +! you can use a non-standard version by setting history_columns_file in your inlist + +! units are cgs unless otherwise noted. + +! reorder the following names as desired to reorder columns. +! comment out the name to omit a column (fewer columns => less IO => faster running). +! remove '!' to restore a column. + +! if you have a situation where you want a non-standard set of columns, +! make a copy of this file, edit as desired, and give the new filename in your inlist +! as history_columns_file. if you are just adding columns, you can 'include' this file, +! and just list the additions in your file. note: to include the standard default +! version, use include '' -- the 0 length string means include the default file. + +! blank lines and comments can be used freely. +! if a column name appears more than once in the list, only the first occurrence is used. + +! if you need to have something added to the list of options, let me know.... + + +! the first few lines of the log file contain a few items: + + ! version_number -- for the version of mesa being used + ! burn_min1 -- 1st limit for reported burning, in erg/g/s + ! burn_min2 -- 2nd limit for reported burning, in erg/g/s + + +!# other files + +! note: you can include another list by doing +! include 'filename' +! include '' means include the default standard list file + +! the following lines of the log file contain info about 1 model per row + +!---------------------------------------------------------------------------------------------- + +!# general info about the model + + model_number ! counting from the start of the run + num_zones ! number of zones in the model + + !## age + + star_age ! elapsed simulated time in years since the start of the run + !star_age_sec ! elapsed simulated time in seconds since the start of the run + !star_age_min ! elapsed simulated time in minutes since the start of the run + !star_age_hr ! elapsed simulated time in hours since the start of the run + !star_age_day ! elapsed simulated time in days since the start of the run + day ! elapsed simulated time in days since the start of the run + + log_star_age + log_star_age_sec + + !## timestep + + time_step ! timestep in years since previous model + time_step_sec ! timestep in seconds since previous model + time_step_days + log_dt ! log10 time_step in years + log_dt_sec ! log10 time_step in seconds + !log_dt_days ! log10 time_step in days + + !## mass + + star_mass ! in Msun units + !log_star_mass + + !star_gravitational_mass ! star_mass is baryonic mass + !star_mass_grav_div_mass + + !delta_mass ! star_mass - initial_mass in Msun units + log_xmstar ! log10 mass exterior to M_center (grams) + + !## mass change + + star_mdot ! d(star_mass)/dt (in msolar per year) + log_abs_mdot ! log10(abs(star_mdot)) (in msolar per year) + + !## imposed surface conditions + !Tsurf_factor + !tau_factor + !tau_surface + + !## imposed center conditions + !m_center + !m_center_gm + !r_center + !r_center_cm + !r_center_km + !L_center + !log_L_center + !log_L_center_ergs_s + !v_center + !v_center_kms + + !logt_max + +!---------------------------------------------------------------------------------------------- + +!# mixing and convection + + !max_conv_vel_div_csound + !max_gradT_div_grada + !max_gradT_sub_grada + !min_log_mlt_Gamma + + + !## mixing regions + + mass_conv_core ! (Msun) mass coord of top of convective core. 0 if core is not convective + + ! mx1 refers to the largest (by mass) convective region. + ! mx2 is the 2nd largest. + + ! conv_mx1_top and conv_mx1_bot are the region where mixing_type == convective_mixing. + ! mx1_top and mx1_bot are the extent of all kinds of mixing, convective and other. + + ! values are m/Mstar + conv_mx1_top + conv_mx1_bot + conv_mx2_top + conv_mx2_bot + mx1_top + mx1_bot + mx2_top + mx2_bot + + ! radius -- values are radii in Rsun units + !conv_mx1_top_r + !conv_mx1_bot_r + !conv_mx2_top_r + !conv_mx2_bot_r + !mx1_top_r + !mx1_bot_r + !mx2_top_r + !mx2_bot_r + + ! you might want to get a more complete list of mixing regions by using the following + + !mixing_regions ! note: this includes regions where the mixing type is no_mixing. + + ! the is the number of regions to report + ! there will be 2* columns for this in the log file, 2 for each region. + ! the first column for a region gives the mixing type as defined in const/public/const_def.f90. + + ! the second column for a region gives the m/mstar location of the top of the region + ! entries for extra columns after the last region in the star will have an invalid mixing_type value of -1. + ! mstar is the total mass of the star, so these locations range from 0 to 1 + ! all regions are include starting from the center, so the bottom of one region + ! is the top of the previous one. since we start at the center, the bottom of the 1st region is 0. + + ! the columns in the log file will have names like 'mix_type_1' and 'mix_qtop_1' + + ! if the star has too many regions to report them all, + ! the smallest regions will be merged with neighbors for reporting purposes only. + + + !mix_relr_regions + ! same as above, but locations given as r/rstar instead of m/mstar. + ! the columns in the log file will have names like 'mix_relr_type_1' and 'mix_relr_top_1' + + + !## conditions at base of largest convection zone (by mass) + !cz_bot_mass ! mass coordinate of base (Msun) + !cz_mass ! mass coordinate of base (Msun) -- same as cz_bot_mass + !cz_log_xmass ! mass exterior to base (g) + !cz_log_xmsun ! mass exterior to base (Msun) + !cz_xm ! mass exterior to base (Msun) + !cz_logT + !cz_logRho + !cz_logP + !cz_bot_radius ! Rsun + !cz_log_column_depth + !cz_log_radial_depth + !cz_luminosity ! Lsun + !cz_opacity + !cz_log_tau + !cz_eta + !cz_log_eps_nuc ! log10(ergs/g/s) + !cz_t_heat ! Cp*T/eps_nuc (seconds) + + !cz_csound + !cz_scale_height + !cz_grav + + !cz_omega + !cz_omega_div_omega_crit + + !cz_zone + + ! mass fractions at base of largest convection zone (by mass) + !cz_log_xa h1 + !cz_log_xa he4 + + !## conditions at top of largest convection zone (by mass) + !cz_top_mass ! mass coordinate of top (Msun) + !cz_top_log_xmass ! mass exterior to top (g) + !cz_top_log_xmsun ! mass exterior to top (Msun) + !cz_top_xm ! mass exterior to top (Msun) + !cz_top_logT + !cz_top_logRho + !cz_top_logP + !cz_top_radius ! Rsun + !cz_top_log_column_depth + !cz_top_log_radial_depth + !cz_top_luminosity ! Lsun + !cz_top_opacity + !cz_top_log_tau + !cz_top_eta + !cz_top_log_eps_nuc ! log10(ergs/g/s) + !cz_top_t_heat ! Cp*T/eps_nuc (seconds) + + !cz_top_csound + !cz_top_scale_height + !cz_top_grav + + !cz_top_omega + !cz_top_omega_div_omega_crit + + !cz_top_zone + !cz_top_zone_logdq + + ! mass fractions at top of largest convection zone (by mass) + !cz_top_log_xa h1 + !cz_top_log_xa he4 + +!---------------------------------------------------------------------------------------------- + +!# nuclear reactions + + !## integrated quantities + + !power_h_burn ! total thermal power from PP and CNO, excluding neutrinos (in Lsun units) + !power_he_burn ! total thermal power from triple-alpha, excluding neutrinos (in Lsun units) + !power_photo + !power_z_burn + !log_power_nuc_burn ! total thermal power from all burning, excluding photodisintegrations + log_LH ! log10 power_h_burn + log_LHe ! log10 power_he_burn + log_LZ ! log10 total burning power including LC, but excluding LH and LHe and photodisintegrations + log_Lnuc ! log(LH + LHe + LZ) + !log_Lnuc_ergs_s + !log_Lnuc_sub_log_L + !lnuc_photo + + !extra_L ! integral of extra_heat in Lsun units + !log_extra_L ! log10 extra_L + + !## neutrino losses + log_Lneu ! log10 power emitted in neutrinos, nuclear and thermal (in Lsun units) + !log_Lneu_nuc ! log10 power emitted in neutrinos, nuclear sources only (in Lsun units) + !log_Lneu_nonnuc ! log10 power emitted in neutrinos, thermal sources only (in Lsun units) + + !mass_loc_of_max_eps_nuc ! (in Msun units) + !mass_ext_to_max_eps_nuc ! (in Msun units) + !eps_grav_integral ! (in Lsun units) + !log_abs_Lgrav ! log10 abs(eps_grav_integral) (in Lsun units) + + !## information about reactions (by category) + + ! log10 total luminosity for reaction categories (Lsun units) + + pp + cno + tri_alpha + !c_alpha + !n_alpha + !o_alpha + !ne_alpha + !na_alpha + !mg_alpha + !si_alpha + !s_alpha + !ar_alpha + !ca_alpha + !ti_alpha + !fe_co_ni + !c12_c12 + !c12_o16 + !o16_o16 + !photo + !pnhe4 + !other + + !## information about individual reactions + + ! adds columns for all of the reactions that are in the current net + ! Note that if using op_split_burn=.true. then zones which have been split will report 0 for thier rates + !add_raw_rates ! raw reaction rates, reactions/second + !add_screened_rates ! screened reaction rates reactions/second + !add_eps_nuc_rates ! Nuclear energy (minus neutrino losses) released erg/s + !add_eps_neu_rates ! Neutrino losses erg/s + + ! individual reactions (as many as desired) + ! use list_net_reactions = .true. in star_job to list all reactions in the current net + ! reactions/second + !raw_rate r_h1_h1_ec_h2 + !raw_rate r_h1_h1_wk_h2 + + + + !## nuclear reactions at center + + ! center log10 burn erg/g/s for reaction categories + + !c_log_eps_burn cno + !c_log_eps_burn tri_alfa + + ! center d_eps_nuc_dlnd for reaction categories + + !c_d_eps_dlnd cno + !c_d_eps_dlnd tri_alfa + + ! center d_eps_nuc_dlnT for reaction categories + + !c_d_eps_dlnT cno + !c_d_eps_dlnT tri_alfa + + !## regions of strong nuclear burning + + ! 2 zones where eps_nuc > burn_min1 erg/g/s + ! for each zone have 4 numbers: start1, start2, end2, end1 + ! start1 is mass of inner edge where first goes > burn_min1 (or -20 if none such) + ! start2 is mass of inner edge where first zone reaches burn_min2 erg/g/sec (or -20 if none such) + ! end2 is mass of outer edge where first zone drops back below burn_min2 erg/g/s + ! end1 is mass of outer edge where first zone ends (i.e. eps_nuc < burn_min1) + ! similar for the second zone + + epsnuc_M_1 ! start1 for 1st zone + epsnuc_M_2 ! start2 + epsnuc_M_3 ! end2 + epsnuc_M_4 ! end1 + + epsnuc_M_5 ! start1 for 2nd zone + epsnuc_M_6 ! start2 + epsnuc_M_7 ! end2 + epsnuc_M_8 ! end1 + + + ! you might want to get a more complete list of burning regions by using the following + + !burning_regions + ! the is the number of regions to report + ! there will be 2* columns for this in the log file, 2 for each region. + ! the first column for a region gives int(sign(val)*log10(max(1,abs(val)))) + ! where val = ergs/gm/sec nuclear energy minus all neutrino losses. + ! the second column for a region gives the q location of the top of the region + ! entries for extra columns after the last region in the star will have a value of -9999 + ! all regions are included starting from the center, so the bottom of one region + ! is the top of the previous one. + ! since we start at the center, the bottom of the 1st region is q=0 and top of last is q=1. + + ! the columns in the log file will have names like 'burn_type_1' and 'burn_qtop_1' + + !burn_relr_regions + ! same as above, but locations given as r/rstar instead of m/mstar. + ! the columns in the log file will have names like 'burn_relr_type_1' and 'burn_relr_top_1' + + + ! if the star has too many regions to report them all, + ! the smallest regions will be merged with neighbors for reporting purposes only. + +!---------------------------------------------------------------------------------------------- + +!# information about core and envelope + + !## helium core + he_core_mass + he_core_radius + !he_core_lgT + !he_core_lgRho + !he_core_L + !he_core_v + !he_core_omega + !he_core_omega_div_omega_crit + !he_core_k + + !## CO core + co_core_mass + !CO_core + co_core_radius + !co_core_lgT + !co_core_lgRho + !co_core_L + !co_core_v + !co_core_omega + !co_core_omega_div_omega_crit + !co_core_k + + !## ONe core + one_core_mass + !one_core_radius + !one_core_lgT + !one_core_lgRho + !one_core_L + !one_core_v + !one_core_omega + !one_core_omega_div_omega_crit + !one_core_k + + !## iron core + fe_core_mass + !fe_core_radius + !fe_core_lgT + !fe_core_lgRho + !fe_core_L + !fe_core_v + !fe_core_omega + !fe_core_omega_div_omega_crit + !fe_core_k + + !## neuton rich core + neutron_rich_core_mass + !neutron_rich_core_radius + !neutron_rich_core_lgT + !neutron_rich_core_lgRho + !neutron_rich_core_L + !neutron_rich_core_v + !neutron_rich_core_omega + !neutron_rich_core_omega_div_omega_crit + !neutron_rich_core_k + + !## envelope + + !envelope_mass ! = star_mass - he_core_mass + !envelope_fraction_left ! = envelope_mass / (initial_mass - he_core_mass) + + !h_rich_layer_mass ! = star_mass - he_core_mass + !he_rich_layer_mass ! = he_core_mass - c_core_mass + !co_rich_layer_mass + +!---------------------------------------------------------------------------------------------- + +!# timescales + + !dynamic_timescale ! dynamic timescale (seconds) -- estimated by 2*pi*sqrt(r^3/(G*m)) + !kh_timescale ! kelvin-helmholtz timescale (years) + !mdot_timescale ! star_mass/abs(star_mdot) (years) + !kh_div_mdot_timescales ! kh_timescale/mdot_timescale + !nuc_timescale ! nuclear timescale (years) -- proportional to mass divided by luminosity + + !dt_cell_collapse ! min time for any cell to collapse at current velocities + !dt_div_dt_cell_collapse + + !dt_div_max_tau_conv ! dt/ maximum conv timescale + !dt_div_min_tau_conv ! dt/ minimum conv timescale + + + !min_dr_div_cs ! min over all cells of dr/csound (seconds) + !min_dr_div_cs_k ! location of min + !log_min_dr_div_cs ! log10 min dr_div_csound (seconds) + !min_dr_div_cs_yr ! min over all cells of dr/csound (years) + !log_min_dr_div_cs_yr ! log10 min dr_div_csound (years) + !dt_div_min_dr_div_cs + !log_dt_div_min_dr_div_cs + + !min_t_eddy ! minimum value of scale_height/conv_velocity + +!---------------------------------------------------------------------------------------------- + +!# conditions at or near the surface of the model + + !## conditions at the photosphere + !effective_T + !Teff + log_Teff ! log10 effective temperature + ! Teff is calculated using Stefan-Boltzmann relation L = 4 pi R^2 sigma Teff^4, + ! where L and R are evaluated at the photosphere (tau_factor < 1) + ! or surface of the model (tau_factor >= 1) when photosphere is not inside the model. + + !photosphere_black_body_T + !photosphere_cell_T ! temperature at model location closest to the photosphere, not necessarily Teff + !photosphere_cell_log_T + !photosphere_cell_density + !photosphere_cell_log_density + !photosphere_cell_opacity + !photosphere_cell_log_opacity + !photosphere_L ! Lsun units + !photosphere_log_L ! Lsun units + !photosphere_r ! Rsun units + !photosphere_log_r ! Rsun units + !photosphere_m ! Msun units + !photosphere_v_km_s + !photosphere_cell_k + !photosphere_column_density + !photosphere_csound + !photosphere_log_column_density + !photosphere_opacity + !photosphere_v_div_cs + !photosphere_xm + !photosphere_cell_free_e + !photosphere_cell_log_free_e + !photosphere_logg + !photosphere_T + + !## conditions at or near the surface of the model (outer edge of outer cell) + + luminosity ! luminosity in Lsun units + !luminosity_ergs_s ! luminosity in cgs units + log_L ! log10 luminosity in Lsun units + !log_L_ergs_s ! log10 luminosity in cgs units + radius ! Rsun + log_R ! log10 radius in Rsun units + !radius_cm + !log_R_cm + + log_g ! log10 gravity + gravity + log_Ledd + log_L_div_Ledd ! log10(L/Leddington) + lum_div_Ledd + !log_surf_optical_depth + !surface_optical_depth + + !log_surf_cell_opacity ! old name was log_surf_opacity + !log_surf_cell_P ! old name was log_surf_P + !log_surf_cell_pressure ! old name was log_surf_pressure + !log_surf_cell_density ! old name was log_surf_density + !log_surf_cell_temperature ! old name was log_surf_temperature + !surface_cell_temperature ! old name was surface_temperature + !log_surf_cell_z ! old name was log_surf_z + !surface_cell_entropy ! in units of kerg per baryon + ! old name was surface_entropy + + v_surf ! (cm/s) + v_surf_km_s ! (km/s) + v_div_csound_surf ! velocity divided by sound speed at outermost grid point + !v_div_csound_max ! max value of velocity divided by sound speed at face + !v_div_vesc + !v_phot_km_s + !v_surf_div_escape_v + + !v_surf_div_v_kh ! v_surf/(photosphere_r/kh_timescale) + + !surf_avg_j_rot + !surf_avg_omega + !surf_avg_omega_crit + !surf_avg_omega_div_omega_crit + !surf_avg_v_rot ! km/sec rotational velocity at equator + !surf_avg_v_crit ! critical rotational velocity at equator + !surf_avg_v_div_v_crit + !surf_avg_Lrad_div_Ledd + !surf_avg_logT + !surf_avg_logRho + !surf_avg_opacity + + ! Gravity Darkening, reports the surface averaged L/Lsun and Teff (K) caused by + ! gravity darkening in rotating stars. Based on the model of Espinosa Lara & Rieutord (2011) + ! 'polar' refers to the line of sight being directed along the rotation axis of the star + ! 'equatorial' refers to the line of sight coincident with the stellar equator + !grav_dark_L_polar !Lsun + !grav_dark_Teff_polar !K + !grav_dark_L_equatorial !Lsun + !grav_dark_Teff_equatorial !K + + !surf_escape_v ! cm/s + + !v_wind_Km_per_s ! Km/s + ! = 1d-5*s% opacity(1)*max(0d0,-s% mstar_dot)/ & + ! (4*pi*s% photosphere_r*Rsun*s% tau_base) + ! Lars says: + ! wind_mdot = 4*pi*R^2*rho*v_wind + ! tau = integral(opacity*rho*dr) from R to infinity + ! so tau = opacity*wind_mdot/(4*pi*R*v_wind) at photosphere + ! or v_wind = opacity*wind_mdot/(4*pi*R*tau) at photosphere + + !rotational_mdot_boost ! factor for increase in mass loss mdot due to rotation + !log_rotational_mdot_boost ! log factor for increase in mass loss mdot due to rotation + !surf_r_equatorial_div_r_polar + !surf_r_equatorial_div_r + !surf_r_polar_div_r + +!---------------------------------------------------------------------------------------------- + +!# conditions near center + + log_center_T ! temperature + log_center_Rho ! density + log_center_P ! pressure + + ! shorter names for above + log_cntr_P + log_cntr_Rho + log_cntr_T + + !center_T ! temperature + !center_Rho ! density + !center_P ! pressure + + !center_degeneracy ! the electron chemical potential in units of k*T + !center_gamma ! plasma interaction parameter + center_mu + center_ye + center_abar + !center_zbar + + !center_eps_grav + + !center_non_nuc_neu + !center_eps_nuc + !d_center_eps_nuc_dlnT + !d_center_eps_nuc_dlnd + !log_center_eps_nuc + + !center_entropy ! in units of kerg per baryon + !max_entropy ! in units of kerg per baryon + !fe_core_infall + !non_fe_core_infall + !non_fe_core_rebound + !max_infall_speed + + !compactness_parameter ! (m/Msun)/(R(m)/1000km) for m = 2.5 Msun + !compactness + !m4 ! Mass co-ordinate where entropy=4 + ! mu4 is sensitive to the choice of how much dm/dr you average over, thus we average dm and dr over M(entropy=4) and M(entropy=4)+0.3Msun + !mu4 ! dM(Msun)/dr(1000km) where entropy=4 + + + !center_omega + !center_omega_div_omega_crit + +!---------------------------------------------------------------------------------------------- + +!# abundances + + !species ! size of net + + !## mass fractions near center + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_center_abundances + !add_log_center_abundances + + ! individual central mass fractions (as many as desired) + center h1 + center he4 + center c12 + center o16 + + ! individual log10 central mass fractions (as many as desired) + !log_center h1 + !log_center he4 + ! etc. + + + !## mass fractions near surface + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_surface_abundances + !add_log_surface_abundances + + ! individual surface mass fractions (as many as desired) + !surface h1 + !surface he4 + surface c12 + surface o16 + ! etc. + + ! individual log10 surface mass fractions (as many as desired) + + !log_surface h1 + !log_surface he4 + + + !## mass fractions for entire star + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_average_abundances + !add_log_average_abundances + + ! individual average mass fractions (as many as desired) + !average h1 + !average he4 + ! etc. + + ! individual log10 average mass fractions (as many as desired) + !log_average h1 + !log_average he4 + ! etc. + + + !## mass totals for entire star (in Msun units) + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_total_mass + !add_log_total_mass + + ! individual mass totals for entire star (as many as desired) + total_mass h1 + total_mass he4 + ! etc. + + ! individial log10 mass totals for entire star (in Msun units) + !log_total_mass h1 + !log_total_mass he4 + ! etc. + +!---------------------------------------------------------------------------------------------- + +!# info at specific locations + + !## info at location of max temperature + !max_T + !log_max_T + + +!---------------------------------------------------------------------------------------------- + +!# information about shocks + + !## info about outermost outward moving shock + ! excluding locations with q > max_q_for_outer_mach1_location + ! returns values at location of max velocity + !shock_mass ! baryonic (Msun) + !shock_mass_gm ! baryonic (grams) + !shock_q + !shock_radius ! (Rsun) + !shock_radius_cm ! (cm) + !shock_velocity + !shock_csound + !shock_v_div_cs + !shock_lgT + !shock_lgRho + !shock_lgP + !shock_gamma1 + !shock_entropy + !shock_tau + !shock_k + !shock_pre_lgRho + +!---------------------------------------------------------------------------------------------- + +!# asteroseismology + + !delta_nu ! large frequency separation for p-modes (microHz) + ! 1e6/(seconds for sound to cross diameter of star) + !delta_Pg ! g-mode period spacing for l=1 (seconds) + ! sqrt(2) pi^2/(integral of brunt_N/r dr) + !log_delta_Pg + !nu_max ! estimate from scaling relation (microHz) + ! nu_max = nu_max_sun * M/Msun / ((R/Rsun)^2 (Teff/Teff_sun)^0.5) + ! with nu_max_sun = 3100 microHz, Teff_sun = 5777 + !nu_max_3_4th_div_delta_nu ! nu_max^0.75/delta_nu + !acoustic_cutoff ! 0.5*g*sqrt(gamma1*rho/P) at surface + !acoustic_radius ! integral of dr/csound (seconds) + !ng_for_nu_max ! = 1 / (nu_max*delta_Pg) + ! period for g-mode with frequency nu_max = nu_max_ng*delta_Pg + !gs_per_delta_nu ! delta_nu / (nu_max**2*delta_Pg) + ! number of g-modes per delta_nu at nu_max + + !int_k_r_dr_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=1 + !int_k_r_dr_2pt0_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=1 + !int_k_r_dr_0pt5_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=1 + !int_k_r_dr_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=2 + !int_k_r_dr_2pt0_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=2 + !int_k_r_dr_0pt5_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=2 + !int_k_r_dr_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=3 + !int_k_r_dr_2pt0_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=3 + !int_k_r_dr_0pt5_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=3 + +!---------------------------------------------------------------------------------------------- + +!# energy information + + !total_energy ! at end of step + !log_total_energy ! log(abs(total_energy)) + !total_energy_after_adjust_mass ! after mass adjustments + + ! shorter versions of above + !tot_E + !log_tot_E + + + !total_gravitational_energy + !log_total_gravitational_energy ! log(abs(total_gravitational_energy)) + !total_gravitational_energy_after_adjust_mass + + ! shorter versions of above + !tot_PE + !log_tot_PE + + !total_internal_energy + !log_total_internal_energy + !total_internal_energy_after_adjust_mass + + ! shorter versions of above + !tot_IE + !log_tot_IE + + !total_radial_kinetic_energy + !log_total_radial_kinetic_energy + !total_radial_kinetic_energy_after_adjust_mass + + ! shorter versions of above (does not include rot KE) + !tot_KE + !log_tot_KE + + !total_turbulent_energy + !log_total_turbulent_energy + !total_turbulent_energy_after_adjust_mass + !tot_Et + !log_tot_Et + + !total_energy_foe + + !tot_IE_div_IE_plus_KE + !total_IE_div_IE_plus_KE + + !total_entropy + !total_eps_grav + + !total_energy_sources_and_sinks ! for this step + !total_nuclear_heating + !total_non_nuc_neu_cooling + !total_irradiation_heating + !total_extra_heating ! extra heat integrated over the model times dt (erg) + !total_WD_sedimentation_heating + + !rel_run_E_err + + !rel_E_err + !abs_rel_E_err + !log_rel_E_err + + !tot_e_equ_err + !tot_e_err + + + !error_in_energy_conservation ! for this step + ! = total_energy - (total_energy_start + total_energy_sources_and_sinks) + !cumulative_energy_error ! = sum over all steps of abs(error_in_energy_conservation) + !rel_cumulative_energy_error ! = cumulative_energy_error/total_energy + !log_rel_cumulative_energy_error ! = log10 of rel_cumulative_energy_error + !log_rel_run_E_err ! shorter name for rel_cumulative_energy_error + + !rel_error_in_energy_conservation ! = error_in_energy_conservation/total_energy + !log_rel_error_in_energy_conservation + + !virial_thm_P_avg + !virial_thm_rel_err + !work_inward_at_center + !work_outward_at_surface + + +!---------------------------------------------------------------------------------------------- + + !# rotation + + !total_angular_momentum + log_total_angular_momentum + !i_rot_total ! moment of inertia + + !total_rotational_kinetic_energy + !log_total_rotational_kinetic_energy + !total_rotational_kinetic_energy_after_adjust_mass + +!---------------------------------------------------------------------------------------------- + +!# velocities + + !avg_abs_v_div_cs + !log_avg_abs_v_div_cs + !max_abs_v_div_cs + !log_max_abs_v_div_cs + + !avg_abs_v + !log_avg_abs_v + !max_abs_v + !log_max_abs_v + + !u_surf + !u_surf_km_s + !u_div_csound_surf + !u_div_csound_max + + !infall_div_cs + +!---------------------------------------------------------------------------------------------- + +!# misc + + !e_thermal ! sum over all zones of Cp*T*dm + + !## eos + !logQ_max ! logQ = logRho - 2*logT + 12 + !logQ_min + !gamma1_min + + !## core mixing + !mass_semiconv_core + + !## H-He boundary + + !diffusion_time_H_He_bdy + !temperature_H_He_bdy + + + !## optical depth and opacity + + !one_div_yphot + !log_one_div_yphot + + !log_min_opacity + !min_opacity + + !log_tau_center + + !log_max_tau_conv + !max_tau_conv + !log_min_tau_conv + !min_tau_conv + + !tau_qhse_yrs + + !## other + + !Lsurf_m + !dlnR_dlnM + !h1_czb_mass ! location (in Msun units) of base of 1st convection zone above he core + !kh_mdot_limit + !log_cntr_dr_cm + !min_Pgas_div_P + !surf_c12_minus_o16 ! this is useful for seeing effects of dredge up on AGB + !surf_num_c12_div_num_o16 + + !phase_of_evolution ! Integer mapping to the type of evolution see star_data/public/star_data_def.inc for definitions + + !## MLT++ + !gradT_excess_alpha + !gradT_excess_min_beta + !gradT_excess_max_lambda + + !max_L_rad_div_Ledd + !max_L_rad_div_Ledd_div_phi_Joss + + + !## RTI + !rti_regions + + !## Ni & Co + !total_ni_co_56 + + + !## internal structure constants + + ! this is evaluated assuming a spherical star and does not account for rotation + !apsidal_constant_k2 + + +!---------------------------------------------------------------------------------------------- + +!# accretion + + !k_below_const_q + !q_below_const_q + !logxq_below_const_q + + !k_const_mass + !q_const_mass + !logxq_const_mass + + !k_below_just_added + !q_below_just_added + !logxq_below_just_added + + !k_for_test_CpT_absMdot_div_L + !q_for_test_CpT_absMdot_div_L + !logxq_for_test_CpT_absMdot_div_L + +!---------------------------------------------------------------------------------------------- + +!# Color output + + ! Outputs the bolometric correction (bc) for the star in filter band ``filter'' (case sensitive) + !bc filter + + ! Outputs the absolute magnitude for the star in filter band ``filter'' (case sensitive) + !abs_mag filter + + ! Adds all the bc's to the output + add_bc + + ! Adds all the absolute magnitudes to the output + add_abs_mag + + ! Outputs luminosity in filter band ``filter'' (erg s^-1) (case sensitive) + !lum_band filter + + ! Adds all the filter band luminosities to the output (erg s^-1) + add_lum_band + + ! Outputs log luminosity in filter band ``filter'' (log erg s^-1) (case sensitive) + !log_lum_band filter + + ! Adds all the filter band luminosities to the output (log erg s^-1) + add_log_lum_band + +!---------------------------------------------------------------------------------------------- + +!# RSP + + !rsp_DeltaMag ! absolute magnitude difference between minimum and maximum light (mag) + !rsp_DeltaR ! R_max - R_min difference in the max and min radius (Rsun) + !rsp_GREKM ! fractional growth of the kinetic energy per pulsation period ("nonlinear growth rate") - see equation 5 in MESA5 + !rsp_num_periods ! Count of the number of pulsation cycles completed + !rsp_period_in_days ! Running period, ie., period between two consecutive values of R_max (days) + !rsp_phase ! Running pulsation phase for a cycle + +!---------------------------------------------------------------------------------------------- +!# debugging + + !## retries + num_retries ! total during the run + + !## solver iterations + + num_iters ! same as num_solver_iterations + !num_solver_iterations ! iterations at this step + !total_num_solver_iterations ! total iterations during the run + !avg_num_solver_iters + + !rotation_solver_steps + + !diffusion_solver_steps + !diffusion_solver_iters + + !avg_setvars_per_step + !avg_skipped_setvars_per_step + !avg_solver_setvars_per_step + + !burn_solver_maxsteps + + !total_num_solver_calls_converged + !total_num_solver_calls_failed + !total_num_solver_calls_made + !total_num_solver_relax_calls_converged + !total_num_solver_relax_calls_failed + !total_num_solver_relax_calls_made + !total_num_solver_relax_iterations + + !total_step_attempts + !total_step_redos + !total_step_retries + !total_steps_finished + !total_steps_taken + + !TDC_num_cells + + !## Relaxation steps + !total_relax_step_attempts + !total_relax_step_redos + !total_relax_step_retries + !total_relax_steps_finished + !total_relax_steps_taken + + !## conservation during mesh adjust + !log_mesh_adjust_IE_conservation + !log_mesh_adjust_KE_conservation + !log_mesh_adjust_PE_conservation + + !## amr + !num_hydro_merges + !num_hydro_splits + + !## timing + !elapsed_time ! time since start of run (seconds) + + !## Extras + burning_regions 40 + mixing_regions 40 + mix_relr_regions 40 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_extra b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_extra new file mode 100644 index 000000000..bb2ce5392 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_extra @@ -0,0 +1,27 @@ + +&star_job +!new_Z = 1.42d-2 +!new_omega_div_omega_crit = 0.10d0 + initial_zfracs = 6 ! Added by eb + +/ ! end of controls namelist + +&kap +kap_file_prefix = 'a09' ! 'gs98' 'a09' 'OP_a09' 'OP_gs98' +kap_CO_prefix = 'a09_co' ! 'gs98_co' 'a09_co' +Zbase = 0.013d0 +kap_lowT_prefix = 'lowT_fa05_a09p' +!AESOPUS_filename = 'AESOPUS_AGSS09.h5' ! used only if kap_lowT_prefix = 'AESOPUS' +use_Type2_opacities = .true. + +!cubic_interpolation_in_X = .true. +!cubic_interpolation_in_Z = .true. + +/ ! end of kap namelist + +&controls +initial_mass = 1.3d0 +initial_Y = 0.26d0 !0.2703 !0.99858d0 +initial_Z = 0.013d0 !0.0142d0 +!initial_he3 = 0d0 +/ ! end of controls namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_pgstar b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_pgstar new file mode 100644 index 000000000..4917b059f --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_pgstar @@ -0,0 +1,753 @@ + +&pgstar + +!pause = .true. + +pgstar_interval = 50 ! making this too small slows the model down. +pgstar_show_age_in_years = .true. +pgstar_show_age_in_seconds = .false. +pgstar_sleep = 0.0 + +! some global grid plot settings at end + +pgstar_show_model_number = .false. +pgstar_show_age = .false. + +!------------------------------------------------------------------------------------ + +Grid1_win_flag = .true. +Grid1_win_width = 12 +Grid1_win_aspect_ratio = 0.666 + +! file output +Grid1_file_flag = .true. +Grid1_file_dir = 'png' +Grid1_file_prefix = 'Grid1_' +Grid1_file_interval = 10 ! output when mod(model_number,Grid1_file_interval)==0 +Grid1_file_width = 27 ! (inches) negative means use same value as for window +Grid1_file_aspect_ratio = -1 ! negative means use same value as for window + +! reset the defaults + +Grid1_plot_name(:) = '' +Grid1_plot_row(:) = 1 ! number from 1 at top +Grid1_plot_rowspan(:) = 1 ! plot spans this number of rows +Grid1_plot_col(:) = 1 ! number from 1 at left +Grid1_plot_colspan(:) = 1 ! plot spans this number of columns +Grid1_plot_pad_left(:) = 0.0 ! fraction of full window width for padding on left +Grid1_plot_pad_right(:) = 0.0 ! fraction of full window width for padding on right +Grid1_plot_pad_top(:) = 0.0 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(:) = 0.0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(:) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_title = '' + +Grid1_num_cols = 3 ! divide plotting region into this many equal width cols +Grid1_num_rows = 5 ! divide plotting region into this many equal height rows +Grid1_num_plots = 6 ! <= 10 + + +Grid1_plot_name(1) = 'Text_Summary1' +Grid1_plot_row(1) = 1 ! number from 1 at top +Grid1_plot_rowspan(1) = 1 ! plot spans this number of rows +Grid1_plot_col(1) = 1 ! number from 1 at left +Grid1_plot_colspan(1) = 3 ! plot spans this number of columns + +Grid1_plot_pad_left(1) = -0.03 ! fraction of full window width for padding on left +Grid1_plot_pad_right(1) = 0.0 ! fraction of full window width for padding on right +Grid1_plot_pad_top(1) = -0.06 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(1) = 0.07 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(1) = 1 ! 0.8 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(3) = 'HR' +Grid1_plot_row(3) = 2 ! number from 1 at top +Grid1_plot_rowspan(3) = 1 ! plot spans this number of rows +Grid1_plot_col(3) = 1 ! number from 1 at left +Grid1_plot_colspan(3) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(3) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(3) = 0.08 ! fraction of full window width for padding on right +Grid1_plot_pad_top(3) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(3) = 0.01 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(3) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(5) = 'Profile_Panels1' +Grid1_plot_row(5) = 3 ! number from 1 at top +Grid1_plot_rowspan(5) = 3 ! plot spans this number of rows +Grid1_plot_col(5) = 1 ! number from 1 at left +Grid1_plot_colspan(5) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(5) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(5) = 0.10 ! fraction of full window width for padding on right +Grid1_plot_pad_top(5) = 0.05 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(5) = 0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(5) = 0.6 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(2) = 'TRho_Profile' +Grid1_plot_row(2) = 2 ! number from 1 at top +Grid1_plot_rowspan(2) = 1 ! plot spans this number of rows +Grid1_plot_col(2) = 2 ! number from 1 at left +Grid1_plot_colspan(2) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(2) = -0.01 ! fraction of full window width for padding on left +Grid1_plot_pad_right(2) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(2) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(2) = 0.01 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(2) = 0.7 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(4) = 'History_Panels1' +Grid1_plot_row(4) = 3 ! number from 1 at top +Grid1_plot_rowspan(4) = 3 ! plot spans this number of rows +Grid1_plot_col(4) = 2 ! number from 1 at left +Grid1_plot_colspan(4) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(4) = 0.00 ! fraction of full window width for padding on left +Grid1_plot_pad_right(4) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(4) = 0.05 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(4) = 0.0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(4) = 0.6 ! multiply txt_scale for subplot by this + + +Grid1_plot_name(6) = 'Profile_Panels3' +Grid1_plot_row(6) = 2 ! number from 1 at top +Grid1_plot_rowspan(6) = 4 ! plot spans this number of rows +Grid1_plot_col(6) = 3 ! Number from 1 at left +Grid1_plot_colspan(6) = 1 ! plot spans this number of columns + +Grid1_plot_pad_left(6) = 0.04 ! fraction of full window width for padding on left +Grid1_plot_pad_right(6) = 0.06 ! fraction of full window width for padding on right +Grid1_plot_pad_top(6) = -0.04 ! fraction of full window height for padding at top +Grid1_plot_pad_bot(6) = 0 ! fraction of full window height for padding at bottom +Grid1_txt_scale_factor(6) = 0.6 ! multiply txt_scale for subplot by this + + +!------------------------------------------------------------------------------------ + +Profile_Panels3_win_flag = .false. + +Profile_Panels3_title = '' + +Profile_Panels3_num_panels = 5 + +Profile_Panels3_yaxis_name(1) = 'Abundance' + +Profile_Panels3_yaxis_name(2) = 'Power' + +Profile_Panels3_yaxis_name(3) = 'Mixing' +Mixing_legend_txt_scale_factor = 0.9 + +Profile_Panels3_yaxis_name(4) = 'conv_vel_div_csound'!'conv_vel'!'logRho' +Profile_Panels3_other_yaxis_name(4) = 'v_div_cs' ! 'vel_km_per_s' ! 'entropy' +Profile_Panels3_other_dymin(4) = 0.14 + +Profile_Panels3_yaxis_name(5) = 'Frad_div_cUrad'!'Frad_div_cUrad'!'lum_div_Ledd'!'logT' +Profile_Panels3_other_yaxis_name(5) = 'vel_km_per_s'!'burn_num_iters' + Profile_Panels3_yaxis_log(5) = .false. + +! x-axis limits and properties +Profile_Panels3_xaxis_name = 'logtau'!'zone'!'radius' +Profile_Panels3_xmin = -101d0 +Profile_Panels3_xmax = -101d0 !1700! -101d0 ! 2.2 +Profile_Panels3_xaxis_reversed = .true. + + +Profile_Panels3_txt_scale = 0.7 + +!Profile_Panels3_xaxis_name = 'zone' +!Profile_Panels3_xmin = 800 +!Profile_Panels3_xmax = 1100 +!Profile_Panels3_xaxis_reversed = .true. + +!Profile_Panels3_show_grid = .true. +Profile_Panels3_show_mix_regions_on_xaxis = .true. + +!------------------------------------------------------------------------------------ + +!Profile_Panels1_win_flag = .true. +!Profile_Panels1_file_flag = .true. + Profile_Panels1_file_dir = 'png' + Profile_Panels1_file_prefix = 'profile_panels1_' + Profile_Panels1_file_interval = 1 + Profile_Panels1_file_width = -1 + Profile_Panels1_file_aspect_ratio = -1 + +Profile_Panels1_title = '' + +Profile_Panels1_txt_scale = 0.7 +Profile_Panels1_num_panels = 4 + +Profile_Panels1_yaxis_name(1) = 'luminosity' +!Profile_Panels1_dymin(1) = 0.14 +Profile_Panels1_other_yaxis_name(1) = 'lum_conv' +!Profile_Panels1_other_dymin(1) = 0.14 + +Profile_Panels1_yaxis_name(2) = 'logT'!'logdq'!'radius'!'entropy' +Profile_Panels1_other_yaxis_name(2) = 'logdq'! 'Lc_div_L'!'log_dt_cs_div_dr'!'pgas_div_p' +Profile_Panels1_other_yaxis_log(2) = .false. + +!Profile_Panels1_ymax(2) = 2 +!Profile_Panels1_other_ymax(2) = 2 + +Profile_Panels1_yaxis_name(3) = 'mlt_Y_face'!'gradT' +Profile_Panels1_other_yaxis_name(3) = 'conv_vel'!'lum_div_Ledd'!'grada' +Profile_Panels1_same_yaxis_range(3) = .false. +Profile_Panels1_other_dymin(3) = 0.08 +!Profile_Panels1_yaxis_log(3) = .false. +Profile_Panels1_ymax(3) =-101d0 +Profile_Panels1_ymin(3) =-0.3d0 + + +Profile_Panels1_yaxis_name(4) = 'log_opacity' +!Profile_Panels1_ymin(4) = 0 +Profile_Panels1_dymin(4) = 0.14 +Profile_Panels1_other_yaxis_name(4) = 'gradr' +Profile_Panels1_other_dymin(4) = 0.14 + +! x-axis limits and properties +Profile_Panels1_xaxis_name = 'zone'!'zone' +Profile_Panels1_xmin = -101d0!-101d0 +Profile_Panels1_xmax = -101d0!9d0 !-101d0 !8.1 +Profile_Panels1_xaxis_reversed = .true. + +!Profile_Panels1_xaxis_name = 'zone' +!Profile_Panels1_xmin = 15 +!Profile_Panels1_xmax = 270 +!Profile_Panels1_xaxis_reversed = .true. + +!Profile_Panels1_show_grid = .true. +Profile_Panels1_show_mix_regions_on_xaxis = .true. + +!------------------------------------------------------------------------------------ + + +!TRho_Profile_win_flag = .true. +TRho_Profile_win_width = 8 +TRho_Profile_win_aspect_ratio = 0.75 ! aspect_ratio = height/width + +! file output +!TRho_Profile_file_flag = .true. +TRho_Profile_file_dir = 'TRho' +TRho_Profile_file_prefix = 'trho_' +TRho_Profile_file_interval = 10 ! output when `mod(model_number,TRho_Profile_file_interval)==0` +TRho_Profile_file_width = -1 ! (inches) negative means use same value as for window +TRho_Profile_file_aspect_ratio = -1 ! negative means use same value as for window + +TRho_Profile_xleft = 0.15 +TRho_Profile_xright = 0.85 +TRho_Profile_ybot = 0.15 +TRho_Profile_ytop = 0.85 +TRho_Profile_txt_scale = 0.7 +TRho_Profile_title = ' ' + +TRho_switch_to_Column_Depth = .false. +TRho_switch_to_mass = .false. + +show_TRho_Profile_legend = .false. + TRho_Profile_legend_coord = 0.07 + TRho_Profile_legend_fjust = 0.0 + TRho_Profile_legend_disp1 = -2.0 + TRho_Profile_legend_del_disp = -1.3 + TRho_Profile_legend_txt_scale = 1.1 + + +show_TRho_Profile_text_info = .false. + TRho_Profile_text_info_xfac = 0.77 ! controls x location + TRho_Profile_text_info_dxfac = 0.02 ! controls x spacing to value from text + TRho_Profile_text_info_yfac = 0.6 ! controls y location of 1st line + TRho_Profile_text_info_dyfac = -0.04 ! controls line spacing + +show_TRho_Profile_mass_locs = .false. +show_TRho_accretion_mesh_borders = .false. +show_TRho_Profile_kap_regions = .false. +show_TRho_Profile_gamma1_4_3rd = .true. +show_TRho_Profile_eos_regions = .false. +show_TRho_Profile_degeneracy_line = .true. +show_TRho_Profile_Pgas_Prad_line = .true. +show_TRho_Profile_burn_lines = .true. +show_TRho_Profile_burn_labels = .true. + +! axis limits +TRho_Profile_xmin = -20.0 +TRho_Profile_xmax = 0!5d0!10.0 +TRho_Profile_ymin = 2.5 +TRho_Profile_ymax = 7.5!8.5d0!10.0 + +! these are shown if show_TRho_Profile_mass_locs = .true. +! set all the entries +profile_mass_point_q = -1 +profile_mass_point_color_index = 1 +profile_mass_point_symbol = -6 +profile_mass_point_symbol_scale = 1.7 +profile_mass_point_str = '' +profile_mass_point_str_clr = 1 +profile_mass_point_str_scale = 1.0 + +! set defaults +num_profile_mass_points = 3 ! max is defined in star_def (max_num_profile_mass_points) + +profile_mass_point_q(1) = 0.5 +profile_mass_point_color_index(1) = 1 +profile_mass_point_symbol(1) = -6 +profile_mass_point_str(1) = ' 0.5 M\d\(0844)\u' +profile_mass_point_str_clr(1) = 1 + +profile_mass_point_q(2) = 0.95 +profile_mass_point_color_index(2) = 1 +profile_mass_point_symbol(2) = -6 +profile_mass_point_str(2) = ' 0.95 M\d\(0844)\u' +profile_mass_point_str_clr(3) = 1 + +profile_mass_point_q(3) = 0.999 +profile_mass_point_color_index(3) = 1 +profile_mass_point_symbol(3) = -6 +profile_mass_point_str(3) = ' 0.999 M\d\(0844)\u' +profile_mass_point_str_clr(3) = 1 + +!------------------------------------------------------------------------------------ + + +! Text_Summary windows + +Text_Summary1_win_flag = .false. +Text_Summary1_win_width = 10 +Text_Summary1_win_aspect_ratio = 0.15 + +Text_Summary1_xleft = 0.01 +Text_Summary1_xright = 0.99 +Text_Summary1_ybot = 0.0 +Text_Summary1_ytop = 1.0 +Text_Summary1_txt_scale = 0.95 +Text_Summary1_title = '' + +Text_Summary1_num_rows = 6 ! <= 20 +Text_Summary1_num_cols = 5 ! <= 20 +Text_Summary1_name(:,:) = '' + + +Text_Summary1_name(1,1) = 'model_number' +Text_Summary1_name(1,2) = 'log_dt' +Text_Summary1_name(1,3) = 'Mass' +Text_Summary1_name(1,4) = 'H_cntr' +Text_Summary1_name(1,5) = 'H_rich' + +Text_Summary1_name(2,1) = 'delta_Mag' +Text_Summary1_name(2,2) = 'star_age' +Text_Summary1_name(2,3) = 'lg_Mdot' +Text_Summary1_name(2,4) = 'He_cntr' +Text_Summary1_name(2,5) = 'He_core' + +Text_Summary1_name(3,1) = 'KE_growth_avg' +Text_Summary1_name(3,2) = 'growth' +Text_Summary1_name(3,3) = 'eta_cntr' +Text_Summary1_name(3,4) = 'C_cntr' +Text_Summary1_name(3,5) = 'CO_core' + +Text_Summary1_name(4,1) = 'period'!'log_max_T' +Text_Summary1_name(4,2) = 'log_LH' +Text_Summary1_name(4,3) = 'lg_Lnuc_tot' +Text_Summary1_name(4,4) = 'O_cntr' +Text_Summary1_name(4,5) = 'radius' + +Text_Summary1_name(5,1) = 'num_periods' +Text_Summary1_name(5,2) = 'log_LHe' +Text_Summary1_name(5,3) = 'lg_Lneu' +Text_Summary1_name(5,4) = 'Ne_cntr' +Text_Summary1_name(5,5) = 'zones' + +Text_Summary1_name(6,1) = 'log_cntr_Rho' +Text_Summary1_name(6,2) = 'log_LZ' +Text_Summary1_name(6,3) = 'lg_Lphoto' +Text_Summary1_name(6,4) = 'retries' +Text_Summary1_name(6,5) = 'log_cntr_T' + + +!------------------------------------------------------------------------------------ + +! Abundance profile plot + +Abundance_win_flag = .false. + +! window properties +Abundance_win_width = 10 +Abundance_win_aspect_ratio = 0.75 + +Abundance_xleft = 0.15 +Abundance_xright = 0.85 +Abundance_ybot = 0.15 +Abundance_ytop = 0.85 +Abundance_txt_scale = 1.1 +Abundance_title = '' + +! isotopes to plot + +Abundance_num_isos_to_show = 20 + +Abundance_which_isos_to_show(1) = 'h1' +Abundance_which_isos_to_show(2) = 'he3' +Abundance_which_isos_to_show(3) = 'he4' +Abundance_which_isos_to_show(4) = 'c12' +Abundance_which_isos_to_show(5) = 'n14' +Abundance_which_isos_to_show(6) = 'o16' +Abundance_which_isos_to_show(7) = 'ne20' +Abundance_which_isos_to_show(8) = 'mg24' +Abundance_which_isos_to_show(9) = 'si28' +Abundance_which_isos_to_show(10) = 's32' +Abundance_which_isos_to_show(11) = 'ar36' +Abundance_which_isos_to_show(12) = 'ca40' +Abundance_which_isos_to_show(13) = 'ti44' +Abundance_which_isos_to_show(14) = 'cr48' +Abundance_which_isos_to_show(15) = 'cr56' +Abundance_which_isos_to_show(16) = 'fe52' +Abundance_which_isos_to_show(17) = 'fe54' +Abundance_which_isos_to_show(18) = 'fe56' +Abundance_which_isos_to_show(19) = 'ni56' +Abundance_which_isos_to_show(20) = 'neut' +!Abundance_which_isos_to_show(22) = 'ne22' + + + +! number and size of isotope labels along curves +num_abundance_line_labels = 4 +Abundance_line_txt_scale_factor = 1.1 + + +! number and size of isotopes on legend +Abundance_legend_max_cnt = 10 +Abundance_legend_txt_scale_factor = 1.3 + +! yaxis limits +Abundance_log_mass_frac_min = -4!-6.4 ! -3.5 +Abundance_log_mass_frac_max = 0.3 + +! file output +Abundance_file_flag = .false. +Abundance_file_dir = 'Abundance' +Abundance_file_prefix = 'abund_' +Abundance_file_width = -1 ! (inches) negative means use same value as for window +Abundance_file_aspect_ratio = -1 ! negative means use same value as for window + + +!------------------------------------------------------------------------------------ + +! power plot + +Power_win_flag = .false. +Power_win_width = 10 +Power_win_aspect_ratio = 0.75 +Power_title = '' + +Power_xleft = 0.15 +Power_xright = 0.85 +Power_ybot = 0.15 +Power_ytop = 0.85 +Power_txt_scale = 1.1 +Power_title = ' ' + +Power_legend_max_cnt = 10 +Power_legend_txt_scale_factor = 1.3 ! relative to other text + +! power yaxis limits -- to override system default selections +Power_ymin = -5.0 ! -101d0 ! only used if /= -101d0 +Power_ymax = 25.0 ! -101d0 ! only used if /= -101d0 + +! file output +Power_file_flag = .false. +Power_file_dir = 'png' +Power_file_prefix = 'power_' +Power_file_interval = 5 ! output when mod(model_number,Power_file_interval)==0 +Power_file_width = -1 ! (inches) negative means use same value as for window +Power_file_aspect_ratio = -1 ! negative means use same value as for window + + +!------------------------------------------------------------------------------------ + +! mixing plot + +Mixing_xmin = 0.0 +Mixing_xmax = 1.6 ! -101d0 +Mixing_legend_txt_scale_factor = 1.4 ! relative to other text + +Mixing_show_rotation_details = .false. + +!Mixing_win_flag = .true. +!Mixing_file_flag = .true. +Mixing_file_dir = 'png' +Mixing_file_prefix = 'mixing_' +Mixing_file_interval = 1 ! output when `mod(model_number,Mixing_file_interval)==0` +Mixing_file_width = -1 ! (inches) negative means use same value as for window +Mixing_file_aspect_ratio = -1 ! negative means use same value as for window + + +!----------------------------------------------------------------------- + +! TRho window + ! history of central temperature vs. density + + TRho_txt_scale = 0.7 + TRho_title = '' + + TRho_logT_min = -101d0 + TRho_logT_max = -101d0 + TRho_logRho_min = -101d0 + TRho_logRho_max = -101d0 + show_TRho_degeneracy_line = .true. + + + +!----------------------------------------------------------------------- + + !# HR window + ! history of `lg_L` vs. `lg_Teff` + + HR_win_flag = .true. + + HR_win_width = 12 + HR_win_aspect_ratio = 0.75 ! aspect_ratio = height/width + + HR_xleft = 0.15 + HR_xright = 0.85 + HR_ybot = 0.15 + HR_ytop = 0.85 + HR_txt_scale = 0.7 !1.0 + HR_title = '' + + ! axis limits -- to override system default selections + ! HR_logT_min = -101d0 ! only used if /= -101d0 + ! HR_logT_max = -101d0 ! only used if /= -101d0 + ! HR_logL_min = -101d0 ! only used if /= -101d0 + ! HR_logL_max = -101d0 ! only used if /= -101d0 + + + + History_Panels1_xaxis_name = 'yr_since_coll' + + + ! axis limits -- to override system default selections + HR_logT_min = -101d0!3.3 !-101d0 ! only used if /= -101d0 + HR_logT_max = -101d0!3.9!-101d0 ! only used if /= -101d0 + HR_logL_min = -101d0!4.4!-101d0 ! only used if /= -101d0 + HR_logL_max = -101d0!5.5!-101d0 ! only used if /= -101d0 + + ! axis limits -- to override system default selections + HR_logT_min = -101d0 ! only used if /= -101d0 + HR_logT_max = -101d0 ! only used if /= -101d0 + HR_logL_min = -101d0 ! only used if /= -101d0 + HR_logL_max = -101d0 ! only used if /= -101d0 + + HR_logL_margin = 0.1 + HR_logT_margin = 0.1 + HR_dlogT_min = -1 + HR_dlogL_min = -1 + + HR_step_min = -1 ! only plot models with model number >= this + HR_step_max = -1 ! only plot models with model number <= this + + show_HR_classical_instability_strip = .true. + show_HR_Mira_instability_region = .false. + show_HR_WD_instabilities = .false. + + show_HR_target_box = .false. + HR_target_n_sigma = -3 ! -n means show sig 1..n + HR_target_logL = 0 + HR_target_logL_sigma = 0 + HR_target_logT = 0 + HR_target_logT_sigma = 0 + + show_HR_annotation1 = .false. + show_HR_annotation2 = .false. + show_HR_annotation3 = .false. + + HR_fname = '' ! file name for extra HR data + + ! Enables calling a subroutine to add extra information to a plot + ! see `$MESA_DIR/star/other/pgstar_decorator.f90` + HR_use_decorator = .false. + + + ! file output + HR_file_flag = .true. + HR_file_dir = 'hr_png' + HR_file_prefix = 'hr_' + HR_file_interval = 10 ! output when `mod(model_number,HR_file_interval)==0` + HR_file_width = 27 ! (inches) negative means use same value as for window + HR_file_aspect_ratio = -1 ! negative means use same value as for window + +!----------------------------------------------------------------------- + + History_Panels1_title = '' + + History_Panels1_xaxis_name = 'day'!'model_number' + History_Panels1_max_width = 1000! 10000 + + !History_Panels1_xaxis_name = 'star_age' + !History_Panels1_max_width = 10 + + History_Panels1_txt_scale = 0.75 + History_Panels1_xmin = -101d0!1300!200!500 + History_Panels1_xmax = -101d0 + History_Panels1_dxmin = -1 + History_Panels1_xaxis_reversed = .false. + History_Panels1_xaxis_log = .false. + History_Panels1_xmargin = 0.0 + + ! :: + + History_Panels1_num_panels = 4 + + ! :: + + History_Panels1_yaxis_name(1) = 'log_L' + History_Panels1_yaxis_reversed(1) = .false. + History_Panels1_ymin(1) = -101d0 + History_Panels1_ymax(1) = -101d0 + History_Panels1_dymin(1) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(1) = 'log_Teff' + History_Panels1_other_yaxis_reversed(1) = .false. + History_Panels1_other_ymin(1) = -101d0 + History_Panels1_other_ymax(1) = -101d0 + History_Panels1_other_dymin(1) = 0.14 + + ! :: + + History_Panels1_yaxis_name(2) = 'growth'!'lum_div_Ledd' + History_Panels1_yaxis_reversed(2) = .false. + History_Panels1_ymin(2) = -101d0 + History_Panels1_ymax(2) = -101d0 + !History_Panels1_dymin(2) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(2) = 'luminosity'!'log_max_T' ! 'v_surf_km_s' + History_Panels1_other_yaxis_reversed(2) = .false. + History_Panels1_other_ymin(2) = -101d0 + History_Panels1_other_ymax(2) = -101d0 + History_Panels1_other_dymin(2) = 0.14 + + ! :: + + History_Panels1_yaxis_name(3) = 'radius' + History_Panels1_yaxis_reversed(3) = .false. + History_Panels1_ymin(3) = -101d0 + History_Panels1_ymax(3) = -101d0 + History_Panels1_dymin(3) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(3) = 'v_surf_km_s'!'log_cntr_Rho' + History_Panels1_other_yaxis_reversed(3) = .false. + History_Panels1_other_ymin(3) = -101d0 + History_Panels1_other_ymax(3) = -101d0 + History_Panels1_other_dymin(3) = 0.14 + ! :: + + History_Panels1_yaxis_name(4) = 'abs_mag_I'!'log_g'!'log_dt' + History_Panels1_yaxis_reversed(4) = .false. + History_Panels1_ymin(4) = -101d0 + History_Panels1_ymax(4) = -101d0 + History_Panels1_dymin(4) = 0.14 + + ! :: + + History_Panels1_other_yaxis_name(4) = 'time_step_sec' + History_Panels1_other_yaxis_reversed(4) = .false. + History_Panels1_other_ymin(4) = -101d0 + History_Panels1_other_ymax(4) = -101d0 + History_Panels1_other_dymin(4) = 0.14 + + +!----------------------------------------------------------------------- + +! some global grid plot settings + +pgstar_grid_show_title = .true. +pgstar_grid_title_scale = 1.0 +pgstar_grid_title_lw = 3 +pgstar_grid_title_disp = 2.5 ! 1.8 +pgstar_grid_title_coord = 0.5 +pgstar_grid_title_fjust = 0.5 + +pgstar_age_scale = 0.8 +pgstar_age_disp = 3.0 +pgstar_age_coord = 0.0 +pgstar_age_fjust = 0.0 + +pgstar_xaxis_label_scale = 1.3 +pgstar_left_yaxis_label_scale = 1.3 +pgstar_xaxis_label_disp = 2.2 +pgstar_left_yaxis_label_disp = 3.1 +pgstar_right_yaxis_label_disp = 4.1 + +pgstar_model_scale = 0.8 +pgstar_model_disp = 3.0 +pgstar_model_coord = 1.0 +pgstar_model_fjust = 1.0 + +! white_on_black flags -- true means white foreground color on black background +file_white_on_black_flag = .true. +file_device = 'png' ! options 'png' and 'vcps' for png and postscript respectively + + +!file_white_on_black_flag = .false. +!file_device = 'vcps' ! options 'png' and 'vcps' for png and postscript respectively + + +kipp_win_flag=.true. +kipp_file_flag=.false. +Kipp_mix_interval = 4 +Kipp_show_luminosities = .true. + + + +! history tracks for pulsations + + +! history tracks + History_Track1_file_flag = .true. + History_Track2_file_flag = .true. + + +History_Track1_win_flag = .true. +History_Track1_file_interval = 50 +History_Track1_win_width = 12 +History_Track1_win_aspect_ratio = 0.75 + +History_Track1_xname = 'v_surf_km_s' +History_Track1_yname = 'log_L' +History_Track1_xaxis_label = 'Vsurf' +History_Track1_yaxis_label = 'log L/L\d\(2281)' +History_Track1_reverse_xaxis = .false. + + +!History_Track1_xmin = -50d0 +!History_Track1_xmax = 50d0 +!History_Track1_ymin = 3.50d0 +!History_Track1_ymax = 3.98d0 + + +History_Track2_win_flag = .true. +History_Track2_file_interval = 50 + +History_Track2_win_width = 12 +History_Track2_win_aspect_ratio = 0.75 + +History_Track2_xname = 'radius' !'v_surf_km_s' +History_Track2_yname = 'log_L' +History_Track2_xaxis_label = 'Radius' +History_Track2_yaxis_label = 'log L/L\d\(2281)' +History_Track2_reverse_xaxis = .false. + +!History_Track2_xmin = 72d0 +!History_Track2_xmax = 96d0 +!History_Track2_ymin = 3.50d0 +!History_Track2_ymax = 3.98d0 + +/ ! end of pgstar namelist + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_ppisn b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_ppisn new file mode 100644 index 000000000..059a5ffa8 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_ppisn @@ -0,0 +1,262 @@ + +&kap + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_extra' +/ + +&eos + + +/ ! end of eos namelist + +&star_job + + set_initial_cumulative_energy_error = .true. + new_cumulative_energy_error = 0d0 + + change_rotation_flag = .true. + new_rotation_flag = .false. + change_w_div_wc_flag = .true. + new_w_div_wc_flag = .false. + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_extra' + + pgstar_flag = .true. + save_pgstar_files_when_terminate = .true. + + num_special_rate_factors = 2 + reaction_for_special_factor(1) = 'r_c12_ag_o16' + special_rate_factor(1) = 1 + filename_of_special_rate(1) = 'c12ag_deboer_sigma_0p0_2000_Tgrid.dat' + + reaction_for_special_factor(2) = 'r_he4_he4_he4_to_c12' + special_rate_factor(2) = 1 + filename_of_special_rate(2) = 'r_he4_he4_he4_to_c12_cf88.txt' + + +/ !end of star_job namelist + + +&controls + + ! in principle this is the only thing that needs changing + ! it is set in inlist_extra + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_extra' + +! GYRE output controls + !write_pulse_data_with_profile = .true. + pulse_data_format = 'GYRE' + + x_logical_ctrl(37) = .true. ! if true, then run GYRE + + x_integer_ctrl(1) = 100 ! output GYRE info at this step interval + x_logical_ctrl(1) = .false. ! save GYRE info whenever save profile + + x_integer_ctrl(2) = 5 ! max number of modes to output per call + x_logical_ctrl(2) = .false. ! output eigenfunction files + + x_integer_ctrl(3) = 0 ! mode l (e.g. 0 for p modes, 1 for g modes) + ! should match gyre.in mode l + x_integer_ctrl(4) = 1 ! order + x_ctrl(1) = 0.158d-05 ! freq ~ this (Hz) + x_ctrl(2) = 0.33d+03 ! growth < this (days) + + + okay_to_remove_mixing_singleton = .true. + + + + limit_for_rel_error_in_energy_conservation = 1d1 + hard_limit_for_rel_error_in_energy_conservation = 1d2 + + + + ! adjustments to the newton solver + solver_max_tries_before_reject = 30 + max_tries_for_retry = 30 + max_tries_after_5_retries = 40 + max_tries_after_10_retries = 40 + max_tries_after_20_retries = 40 + corr_coeff_limit = 1d-2 + + + use_gold_tolerances = .true. + use_gold2_tolerances = .true. + gold_iter_for_resid_tol2 = 10 + gold_iter_for_resid_tol3 = 10 + gold_tol_residual_norm3 = 1d-6 + gold_tol_max_residual3 = 1d-3 + gold_solver_iters_timestep_limit = 20 + solver_iters_timestep_limit = 50 + ignore_too_large_correction = .true. + scale_max_correction = 0.1d0 + !corr_coeff_limit = 0.2d0 + ignore_min_corr_coeff_for_scale_max_correction = .true. + ignore_species_in_max_correction = .true. + + + mlt_make_surface_no_mixing = .true. + !convergence_ignore_equL_residuals = .false., see other inlists + make_gradr_sticky_in_solver_iters = .false. + xa_scale = 1d-5 + iter_for_resid_tol2 = 10 + + + + ! during pulses very small cells near the surface can sometimes exceed + ! the speed of light. This has no impact in the behaviour of the bulk + ! of the star so we don't want to have a retry if that happens + retry_for_v_above_clight = .false. + + + relax_max_number_retries = 99999999!1000 + max_number_retries = 99999999 !500 ! RECOMMENDED 5000 + + ! our wind implementation follows Brott+ 2011 + ! see other inlists. + + ! During hydro we can use es scattering opacity on the very outermost cell + use_other_kap = .false. + + ! convection controls + MLT_option = 'TDC' + alpha_TDC_DAMP = 1d0 + alpha_TDC_DAMPR = 0d0 + alpha_TDC_PtdVdt = 0d0 + alpha_TDC_DAMPM = 0.25d0 + steps_before_use_TDC = 0 + + use_ledoux_criterion = .true. + !mixing_length_alpha = 2d0 + alpha_semiconvection = 1d0 + thermohaline_coeff = 0d0 + num_cells_for_smooth_gradL_composition_term = 0 + + energy_eqn_option = 'dedt' + + + ! surface controls, probably uncessary + scale_max_correction_for_negative_surf_lum = .true. + max_frac_for_negative_surf_lum = 0.8 + + + ! overshoot controls + ! we only include a bit of exponential overshooting to smooth things out + + overshoot_scheme(1) = 'none' + overshoot_zone_type(1) = 'any' + overshoot_zone_loc(1) = 'shell' + overshoot_bdy_loc(1) = 'any' + overshoot_f(1) = 0.001 + overshoot_f0(1) = 0.0005 + + overshoot_scheme(2) = 'exponential' + overshoot_zone_type(2) = 'any' + overshoot_zone_loc(2) = 'core' + overshoot_bdy_loc(2) = 'any' + overshoot_f(2) = 0.01 + overshoot_f0(2) = 0.005 + + overshoot_D_min = 1d-8 + +! add a run_star_extras or something that adds this in the last moment before pulsations. +!log_tau_function_weight = 150 +!log_kap_function_weight = 20 + + ! timestep options + varcontrol_target = 1d-3!5d-4 + max_timestep_factor = 1.2d0 + min_timestep_factor = 0.8d0 + dX_nuc_drop_limit = 5d-2 + dX_nuc_drop_limit_at_high_T = 1d-2 ! for center logT > 9.45 + delta_Ye_highT_limit = 1d-3 + dX_nuc_drop_max_A_limit = 52 + dX_nuc_drop_min_X_limit = 1d-4 + dX_nuc_drop_hard_limit = 1d99 + delta_lgTeff_limit = 1d0 + + delta_lgL_hard_limit = -1!1d200 + delta_lgR_limit = 1d-1!0.025d0 + delta_lgR_hard_limit = -1!0.05d0 + delta_lgR_limit_min_lgR = 3d0 ! 3d0 for >1000 Rsun + delta_lgL_He_limit = -1d0 + lgL_nuc_burn_min = 4d0 + retry_hold = 0 + + ! limit for changes in central abundances, RECOMMENDED 0.001d0 for all + delta_XH_cntr_limit = 0.01d0 + delta_XHe_cntr_limit = 0.01d0 + delta_XC_cntr_limit = 0.01d0 + delta_XO_cntr_limit = 0.01d0 + + ! extra controls for timestep + delta_lg_star_mass_limit = 2d-3 ! RECOMMENDED 2d-3 + delta_lgRho_cntr_limit = 0.005d0 ! RECOMMENDED 0.0025d0 + delta_lgRho_cntr_hard_limit = 0.1d0 ! RECOMMENDED 0.005d0 + + min_timestep_limit = 1d-20 ! (seconds) + relax_hard_limits_after_retry = .false. + + ! mesh controls + !max_dq = 1d-3 ! RECOMMENDED 1d-3 + + ! rotational mixing coeffs + !am_nu_ST_factor = 1.0 + !D_visc_factor = 0.0 + !am_nu_SH_factor = 0.0 + !D_ST_factor = 0.0 + !D_SH_factor = 0.0 + !D_GSF_factor = 1.0 + !D_ES_factor = 1.0 + !D_SSI_factor = 1.0 + !D_DSI_factor = 1.0 + !am_D_mix_factor = 0.0333333d0 + !am_gradmu_factor = 0.1d0 + !num_cells_for_smooth_gradL_composition_term = 2 + + ! use implicit wind close to critical + max_tries_for_implicit_wind = 10 + surf_avg_tau_min = 0 + surf_avg_tau = 10 + !max_mdot_redo_cnt = 200 ! this is set in inlist_hydro_on and inlist_hydro_off + min_years_dt_for_redo_mdot = 0 + surf_omega_div_omega_crit_limit = 0.98d0 + surf_omega_div_omega_crit_tol = 0.02d0 + rotational_mdot_boost_fac = 1d10 + rotational_mdot_kh_fac = 1d10 + mdot_revise_factor = 1.1 + implicit_mdot_boost = 0.05 + ! this needs to be relaxed just to avoid a crash when hydro Riemann is turned on + angular_momentum_error_retry = 1d99 + angular_momentum_error_warn = 1d-10 + + ! Fixing the position of the Lagrangian region of the mesh helps + ! convergence near the Eddington limit + !max_logT_for_k_below_const_q = 100 + !max_q_for_k_below_const_q = 0.99 + !min_q_for_k_below_const_q = 0.99 + !max_logT_for_k_const_mass = 100 + !max_q_for_k_const_mass = 0.98 + !min_q_for_k_const_mass = 0.98 + + + photo_digits = 8 + photo_interval = 10!50 + profile_interval = 200!50 + history_interval = 1!10 + terminal_interval = 10!10 + max_num_profile_models = 10000 ! 100 ! RECOMMENDED 10000 + + + num_trace_history_values = 2 + trace_history_value_name(1) = 'log_rel_run_E_err' + trace_history_value_name(2) = 'rel_E_err' + warn_when_large_rel_run_E_err = 1d-2 +/ ! end of controls namelist + +&pgstar + +/ diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_pulses b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_pulses new file mode 100644 index 000000000..3a56963b9 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_pulses @@ -0,0 +1,303 @@ +&kap + ! use_Type2_opacities = .false. ! if cutting out core. + +/ + +&eos +/ + +&star_job + + save_model_when_terminate = .true. + save_model_filename = 'final.mod' + !required_termination_code_string = 'Successful test: evolved 100 days past first relax' + + load_saved_model = .true. + load_model_filename = 'he_dep.mod' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_ppisn' + + !change_initial_v_flag = .true. + !new_v_flag = .true. + + change_v_flag = .true. + new_v_flag = .false. + + change_u_flag = .true. + new_u_flag = .true. + + relax_to_this_tau_factor = 1d-3!-1 + dlogtau_factor = 0.1d0 + relax_tau_factor = .false. + + + ! if restarting from .mod file, need high initial dt for relaxing. + set_initial_dt = .true. + years_for_initial_dt = -1 + seconds_for_initial_dt = 1d7!-1 + + set_initial_age = .true. + initial_age = 0 + + ! on first pass. + remove_center_by_temperature = 5d6!5d6 + +/ !end of star_job namelist + + +&controls + + ! probably not necessary + !remove_small_D_limit = 1d-16 + !remove_mixing_glitches = .false.!.true. ! If true, then okay to remove gaps and singletons. + mlt_make_surface_no_mixing = .false. + + + ! controls for analyzing pulsations + x_integer_ctrl(1) = 500 ! gyre interval to check + ! x_ctrl(1) = 0.158d-05 !1000d0 ! expected period (in days) + + x_integer_ctrl(3) = 0 ! mode l (e.g. 0 for p modes, 1 for g modes) + ! should match gyre.in mode l + x_integer_ctrl(4) = 1 ! order + x_ctrl(1) = 0.158d-05 ! freq ~ this (Hz) + x_ctrl(2) = 0.33d+04 ! growth < this (days) + + x_logical_ctrl(7) = .true. ! doing pulses + x_integer_ctrl(7) = 0 ! 3 ! which period to check (<= 0 means don't check any) + x_ctrl(7) = 1000d0 ! expected period (in days) +! x_ctrl(8) = 1.0 ! min_deltaR_for_periods (Rsun) + x_ctrl(9) = 1d0 ! KE_growth_avg_abs_frac_new ! for averaging growth rates across steps. + x_ctrl(10) = 0.3 ! min_period_div_target + + + ! new rsp style meshing, thanks to Bill P. + x_logical_ctrl(23) = .false. ! .true. = TDC remesh for pulsation + RSP2_use_mass_interp_face_values = .true. + RSP2_nz = 600 + RSP2_nz_outer = 240 + RSP2_T_anchor = 11d3 + RSP2_dq_1_factor = 2d0 + remesh_for_TDC_pulsations_log_core_zoning = .false. ! .false means do rsp style core + + ! old star meshing to achieve rsp style models. + okay_to_remesh = .true. + + ! control for excising core upon loading .mod file. + x_logical_ctrl(25) = .false. ! set true to remove core + x_ctrl(14) = 5d6 ! desired core temperature to make cut at + + x_logical_ctrl(24) = .true. ! if true turn off remesh at the following model number + x_ctrl(12) = 31620! model number to turn off remesh ( only if if okay_to_remesh = .true.) + + ! timestep + x_ctrl(13) = 31650! model number to drop timestep + + ! TDC Pulsation timestepping. + x_ctrl(17) = 1d7 ! dt before pulse, seconds for relaxing mesh + x_ctrl(18) = 2.5d4 ! After a pulse begins, limit the timestep to this (in seconds). + + +! turn off burning and mixing, if evolving envelope model + eps_nuc_factor = 0 + non_nuc_neu_factor = 0 + dxdt_nuc_factor = 0 + mix_factor = 0 + +! GYRE set starting velocities, kick! +! kick when true and not restarting. + x_logical_ctrl(5) = .true. ! to turn on gyre kick + x_ctrl(11) = 31700! kick model at this model number + + x_ctrl(4) = 0d0 ! fraction_1st_overtone (order 2) + x_ctrl(5) = 0d0 ! fraction_2nd_overtone (order 3) + x_ctrl(6) = 5d0 ! initial vsurf (kms) + + + + ! turn of wind during Pulsation + use_other_wind = .false. + + ! can optionally use QHSE form of dp/dm or hydro form below. + use_dPrad_dm_form_of_T_gradient_eqn = .false. ! if false use QHSE form. + min_kap_for_dPrad_dm_eqn = 1d-5 + +! timesteps for saturation + + !dt_div_min_dr_div_cs_limit = 2d0 + dt_div_min_dr_div_cs_hard_limit = 100d0! i don't like hard limits ~ EbF + min_abs_u_div_cs_for_dt_div_min_dr_div_cs_limit = 0.8d0 + + ! have used these values to do run to saturation, but may not be necessary ~ Bill P. + dt_div_min_dr_div_cs_limit = 10d0!10d0 + min_q_for_dt_div_min_dr_div_cs_limit = 0.5d0 + max_q_for_dt_div_min_dr_div_cs_limit = 1d0 + min_k_for_dt_div_min_dr_div_cs_limit = 1 + min_abs_du_div_cs_for_dt_div_min_dr_div_cs_limit = 0.001d0 + + ! artificial viscosity if necessary, only works for v_flag + use_Pvsc_art_visc = .true. + Pvsc_cq = 4.0d0 + Pvsc_zsh = 0.1d0 + + ! velocity time centering + !steps_before_use_velocity_time_centering = 31700 ! no v centering when commented + use_P_d_1_div_rho_form_of_work_when_time_centering_velocity = .true. + + include_P_in_velocity_time_centering = .true. + P_theta_for_velocity_time_centering = 0.5d0 + + include_L_in_velocity_time_centering = .true. + L_theta_for_velocity_time_centering = 0.5d0 + + set_rho_to_dm_div_dV = .false. ! doesn't apply to u_flag + + + convergence_ignore_equL_residuals = .true. ! include T-gradient eqn in newton + + ! OUTER BC, if not atm, then see below. + atm_T_tau_opacity = 'fixed' + + ! OUTER BC for TDC Pulsations + use_RSP_L_eqn_outer_BC = .false. + RSP2_Lsurf_factor = 0.5d0 + use_zero_Pgas_outer_BC = .false. + + ! for u_flag, can optionally use these. + use_compression_outer_BC = .false. + use_momentum_outer_BC = .false. + + ! Convection model + MLT_option = 'TDC' + include_mlt_corr_to_TDC = .false. ! true K. 1986 model, no mlt limiting + mixing_length_alpha = 2d0 + alpha_TDC_DAMP = 1d0 + alpha_TDC_DAMPR = 0d0!1d0! 0d0 for mlt + alpha_TDC_PtdVdt = 0d0!1d0!1d-2!1d-2!0d0 + steps_before_use_TDC = 0 + alpha_TDC_DAMPM = 0.15d0!0.25d0 + mlt_Pturb_factor = 0d0 + alt_scale_height_flag = .false. ! ignore eggleton + TDC_num_innermost_cells_forced_nonturbulent = 2 + make_mlt_hydrodynamic = .false. + + TDC_use_density_form_for_eddy_viscosity = .false. + + ! controls for shock capturing, relaxed for pulsations + max_abs_du_div_cs_for_convection = 1d-1 !0.03d0 + max_v_div_cs_for_convection = 1d2 + max_v_for_convection = 1d4 + + x_logical_ctrl(22) = .true. ! flag for in inlist_pulses + + + + + + + +! everything below is old and from testing. + + + + + + + max_num_merge_cells = 2 + + ! these two in combination are important + !max_num_merge_surface_cells = 15 ! necessary for surface, 15 better for massive stars + !min_surface_cell_dq = 1d-5!2d-6 ! 1d-6 might be safer. + ! any higher and you risk touching the convective shell during a + ! pulsation cycle which will make the surface go haywire. + + + +mesh_min_k_old_for_split = 15 +min_dq = 1d-5 +max_center_cell_dq = 1d-4! leave at default if including core +max_surface_cell_dq = 1d-4 +use_other_mesh_functions = .true. + + +!mesh_delta_coeff_factor_smooth_iters = 3!20!50 ! 3 +!remesh_max_allowed_logT = 5d0 ! global control, not good. +!T_function1_weight = 30!110 +!P_function_weight = 5!50 ! need custom P function weight for logT < 4.5 +!log_tau_function_weight = 10!100 +!log_kap_function_weight = 10 + +!max_dq = 5d-2 + +!xa_function_species(1) = 'he4' +!xa_function_weight(1) = 0 +!xa_function_param(1) = 1d-2 + +!mesh_min_dlnR = 1d-14!1d-9 +!merge_if_dr_div_dRstar_too_small = .false. +!merge_if_dr_div_cs_too_small = .false. + +! if split merge amr hydro + ! restore_mesh_on_retry = .true. + ! num_steps_to_hold_mesh_after_retry = 5 +! if hydro use momentum bc? + + use_split_merge_amr = .false. + split_merge_amr_okay_to_split_1 = .true. + merge_amr_ignore_core_cells = .true. + merge_amr_logT_for_ignore_core_cells = 6.3d0 !1d99 + split_amr_ignore_core_cells = .true. + split_amr_logT_for_ignore_core_cells = 6.3d0 !1d99 + + mesh_delta_coeff = 1d0!0.8d0 ! RECOMMENDED 0.8d0 + !! this one is turned on in run_star_extras + ! true in pulses use_split_merge_amr = .false. + split_merge_amr_log_zoning = .false. + !split_merge_amr_logtau_zoning = .true. + !split_merge_amr_flipped_hybrid_zoning = .true. + !split_merge_amr_hybrid_zoning = .true. + + split_merge_amr_r_core_cm = 1d8 +split_merge_amr_nz_r_core = 1000!10000 + + + split_merge_amr_nz_baseline = 1000!6000 ! RECOMMENDED 6000 + split_merge_amr_MaxLong = 1.25d0 + split_merge_amr_MaxShort = 2.5d0 + + +! equal_split_density_amr = .false. + +! deprecated? trace_split_merge_amr = .false. + + + split_merge_amr_max_iters = 100 ! setting this too high will smear pulsations. must restrict? + split_merge_amr_okay_to_split_nz = .false. +split_merge_amr_mesh_delta_coeff = 1.0!0.3 + + merge_amr_ignore_surface_cells = .false. + merge_amr_k_for_ignore_surface_cells = 20!1500!100 + + merge_amr_max_abs_du_div_cs = 0.03d0!0.5d0!5d-1!3d-2!0.03!0.05d0 + merge_amr_du_div_cs_limit_only_for_compression = .true. + split_merge_amr_avoid_repeated_remesh = .true. + merge_amr_inhibit_at_jumps =.false. ! reduce udnersize ratio for large jumps + + +report_solver_progress = .true. +report_ierr = .true. ! if true, produce terminal output when have some internal error + +/ ! end of controls namelist + +&pgstar + + ! axis limits -- to override system default selections + !HR_logT_min = 3.6 !-101d0 ! only used if /= -101d0 + !HR_logT_max = 3.75!-101d0 ! only used if /= -101d0 + !HR_logL_min = 3.85!-101d0 ! only used if /= -101d0 + !HR_logL_max = 3.6!-101d0 ! only used if /= -101d0 + + HR_file_interval = 50 ! output when `mod(model_number,HR_file_interval)==0` + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_pulses_header b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_pulses_header new file mode 100644 index 000000000..ae7c8e831 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_pulses_header @@ -0,0 +1,56 @@ + +&star_job + + + read_extra_star_job_inlist(2) = .true. + extra_star_job_inlist_name(2) = 'inlist_pulses' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_ppisn' + +/ ! end of star_job namelist + + +&eos + + read_extra_eos_inlist(2) = .true. + extra_eos_inlist_name(2) = 'inlist_pulses' + + read_extra_eos_inlist(1) = .true. + extra_eos_inlist_name(1) = 'inlist_ppisn' + +/ ! end of eos namelist + + +&kap + + read_extra_kap_inlist(2) = .true. + extra_kap_inlist_name(2) = 'inlist_pulses' + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_ppisn' + +/ ! end of kap namelist + + + +&controls + + read_extra_controls_inlist(2) = .true. + extra_controls_inlist_name(2)= 'inlist_pulses' + + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_ppisn' + +/ ! end of controls namelist + + +&pgstar + + read_extra_pgstar_inlist(2) = .true. + extra_pgstar_inlist_name(2)= 'inlist_pulses' + + read_extra_pgstar_inlist(1) = .true. + extra_pgstar_inlist_name(1)= 'inlist_pgstar' + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_to_he_dep b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_to_he_dep new file mode 100644 index 000000000..02a45b1ab --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_to_he_dep @@ -0,0 +1,92 @@ + +&star_job + + create_pre_main_sequence_model = .true. + + save_model_when_terminate = .true. + save_model_filename = 'he_dep.mod' + required_termination_code_string = '' + + ! evolve model with hydrodynamics on from pre-ms + change_initial_v_flag = .true. + new_v_flag = .true. + + relax_to_this_tau_factor = 1d-3!-1 + dlogtau_factor = 0.1d0 + relax_tau_factor = .true. + +/ !end of star_job namelist + +&kap + +/ + +&eos + +/ + + +&controls + +! stop when the center mass fraction of h1 drops below this limit + !xa_central_lower_limit_species(1) = 'he4' + !xa_central_lower_limit(1) = 1d-6 +max_model_number = 31600 !1970 + + + x_logical_ctrl(22) = .false. ! not in inlist_pulses + + + ! our wind implementation follows Brott+ 2011 + use_other_wind = .false. + +! wind model section: + cool_wind_full_on_T = 9.99d9 + hot_wind_full_on_T = 1d10 + cool_wind_RGB_scheme = 'Reimers' + cool_wind_AGB_scheme = 'Blocker' + RGB_to_AGB_wind_switch = 1d-4 + Reimers_scaling_factor = 0.5 ! 0.1 + Blocker_scaling_factor = 0.01 ! 0.5 crank up to 1.0 when the mass loss stops and/or timestep crashes + + + ! for last ten time steps make model bluer. + mixing_length_alpha = 2.25d0 + +! solver controls + convergence_ignore_equL_residuals = .true. ! for pre-ms + use_gold2_tolerances = .false. +!report_solver_progress = .true. + delta_lgL_He_limit = 1d-2 + + !max_dq = 1d-3 + + photo_interval = 1 + + terminal_interval = 1 + +use_drag_energy = .false. +drag_coefficient = 1d0 +min_q_for_drag = 0.8d0 + +/ ! end of controls namelist + +&pgstar +Kipp_max_width = 2000 + + pgstar_interval = 10 + + History_Panels1_xaxis_name = 'model_number' + History_Panels1_max_width = -1 + + Profile_Panels3_xaxis_name = 'mass' + Profile_Panels3_xaxis_reversed = .false. + +TRho_Profile_xmin = -12.0 +TRho_Profile_xmax = 7d0!5d0!10.0 +TRho_Profile_ymin = 2.5 +TRho_Profile_ymax = 9d0!8.5d0!10.0 + + + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_to_he_dep_header b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_to_he_dep_header new file mode 100644 index 000000000..a007699f8 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/inlist_to_he_dep_header @@ -0,0 +1,55 @@ + +&star_job + + + read_extra_star_job_inlist(2) = .true. + extra_star_job_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_ppisn' + +/ ! end of star_job namelist + + +&eos + + read_extra_eos_inlist(2) = .true. + extra_eos_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_eos_inlist(1) = .true. + extra_eos_inlist_name(1) = 'inlist_ppisn' +/ ! end of eos namelist + + +&kap + + read_extra_kap_inlist(2) = .true. + extra_kap_inlist_name(2) = 'inlist_to_he_dep' + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_ppisn' + +/ ! end of kap namelist + + + +&controls + + read_extra_controls_inlist(2) = .true. + extra_controls_inlist_name(2)= 'inlist_to_he_dep' + + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_ppisn' + +/ ! end of controls namelist + + +&pgstar + + read_extra_pgstar_inlist(2) = .true. + extra_pgstar_inlist_name(2)= 'inlist_to_he_dep' + + read_extra_pgstar_inlist(1) = .true. + extra_pgstar_inlist_name(1)= 'inlist_pgstar' + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/make/makefile b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/make/makefile new file mode 100644 index 000000000..f2017faed --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/make/makefile @@ -0,0 +1,5 @@ + + +STAR = star + +include $(MESA_DIR)/star/work_standard_makefile diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/mk b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/mk new file mode 100755 index 000000000..aec7a5195 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/mk @@ -0,0 +1,13 @@ +#!/bin/bash + +function check_okay { + if [ $? -ne 0 ] + then + echo + echo "FAILED" + echo + exit 1 + fi +} + +cd make; make; check_okay diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/profile_columns.list b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/profile_columns.list new file mode 100644 index 000000000..981b06f83 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/profile_columns.list @@ -0,0 +1,962 @@ +! profile_columns.list -- determines the contents of star model profiles +! you can use a non-standard version by setting profile_columns_file in your inlist + +! units are cgs unless otherwise noted. + +! reorder the following names as desired to reorder columns. +! comment out the name to omit a column (fewer columns => less IO => faster running). +! remove '!' to restore a column. + +! if you have a situation where you want a non-standard set of columns, +! make a copy of this file, edit as desired, and give the new filename in your inlist +! as profile_columns_file. if you are just adding columns, you can 'include' this file, +! and just list the additions in your file. note: to include the standard default +! version, use include '' -- the 0 length string means include the default file. + +! if you need to have something added to the list of options, let me know.... + +! the first few lines of the profile contain general info about the model. +! for completeness, those items are described at the end of this file. + + +! note: you can include another list by doing +! include 'filename' +! include '' means include the default standard list file + + +! the following lines of the profile contain info for 1 zone per row, surface to center. + +! minimal set of enabled columns: + + zone ! numbers start with 1 at the surface + mass ! m/Msun. mass coordinate of outer boundary of cell. + logR ! log10(radius/Rsun) at outer boundary of zone + logT ! log10(temperature) at center of zone + logRho ! log10(density) at center of zone + logP ! log10(pressure) at center of zone + x_mass_fraction_H + y_mass_fraction_He + z_mass_fraction_metals + + +! everything below this line is deactivated + + +!# Structure + !logM ! log10(m/Msun) + !log_mass + !dm ! cell mass (grams) + !dm_bar ! boundary mass (grams) average of adjacent dm's + logdq ! log10(dq) + !log_dq + dq_ratio ! dq(k-1)/dq(k) + q ! fraction of star mass interior to outer boundary of this zone + log_q ! log10(q) + !xq + + !grav ! gravitational acceleration (cm sec^2) + !log_g ! log10 gravitational acceleration (cm sec^2) + !g_div_r ! grav/radius (sec^2) + !r_div_g ! radius/grav (sec^-2) + !cgrav_factor ! = cgrav(k)/standard_cgrav + vel_km_per_s ! velocity at outer boundary of zone (km/s) -- 0 if no velocity variable + + radius ! radius at outer boundary of zone (in Rsun units) + !radius_cm ! radius at outer boundary of zone (in centimeters) + !radius_km ! radius at outer boundary of zone (in kilometers) + !logR_cm ! log10 radius at outer boundary of zone (in centimeters) + !rmid ! radius at center by mass of zone (in Rsun units) + !r_div_R ! fraction of total radius + + velocity ! velocity at outer boundary of zone (cm/s) -- 0 if no velocity variable + !v_div_r ! velocity divided by radius + !v_times_t_div_r + !rho_times_r3 ! at face + !log_rho_times_r3 ! at face + !scale_height ! in Rsun units + pressure_scale_height ! in Rsun units + + !m_div_r ! gm/cm + !dmbar_m_div_r + !log_dmbar_m_div_r + !mass_grams ! mass coordinate of outer boundary of cell in grams + !mmid ! mass at midpoint of cell (average of mass coords of the cell boundaries) Msun units. + + !m_grav ! total enclosed gravitational mass. Msun units. + !m_grav_div_m_baryonic ! mass_gravitational/mass at cell boundary + !mass_correction_factor ! dm_gravitational/dm (dm is baryonic mass of cell) + + !xm ! mass exterior to point (Msun units) + dq ! mass of zone as a fraction of total star mass + !logxq ! log10(1-q) + !logxm ! log10(xm) + + !xr ! radial distance from point to surface (Rsun) + !xr_cm ! radial distance from point to surface (cm) + !xr_div_R ! radial distance from point to surface in units of star radius + !log_xr ! log10 radial distance from point to surface (Rsun) + !log_xr_cm ! log10 radial distance from point to surface (cm) + !log_xr_div_R ! log10 radial distance from point to surface in units of star radius + + !dr ! r(outer edge) - r(inner edge); radial extent of cell in cm. + !log_dr ! log10 cell width (cm) + !dv ! v(inner edge) - v(outer edge); rate at which delta_r is shrinking (cm/sec). + + dt_dv_div_dr ! dt*dv/dr; need to have this << 1 for every cell + !dr_div_R ! cell width divided by star R + !log_dr_div_R ! log10 cell width divided by star R + !dr_div_rmid ! cell width divided by rmid + !log_dr_div_rmid ! log(dr_div_rmid) + + !dr_div_cs ! cell sound crossing time (sec) + !log_dr_div_cs ! log10 cell sound crossing time (sec) + dr_div_cs_yr ! cell sound crossing time (years) + !log_dr_div_cs_yr ! log10 cell sound crossing time (years) + + !acoustic_radius ! sound time from center to outer cell boundary (sec) + !log_acoustic_radius ! log10(acoustic_radius) (sec) + !acoustic_depth ! sound time from surface to outer cell boundary (sec) + !log_acoustic_depth ! log10(acoustic_depth) (sec) + !acoustic_r_div_R_phot + + !cell_collapse_time ! only set if doing explicit hydro + ! time (seconds) for cell inner edge to catch cell outer edge at current velocities + ! 0 if distance between inner and outer is increasing + !log_cell_collapse_time ! log of cell_collapse_time + + !compression_gradient + + + +!# Thermodynamics + !temperature ! temperature at center of zone + !logT_face ! log10(temperature) at outer boundary of zone + !logT_bb ! log10(black body temperature) at outer boundary of zone + !logT_face_div_logT_bb + + energy ! internal energy (ergs/g) + !logE ! log10(specific internal energy) at center of zone + !rho ! density + !density ! rho + + entropy ! specific entropy divided by (avo*kerg) + !logS ! log10(specific entropy) + !logS_per_baryon ! log10(specific entropy per baryon / kerg) + + !pressure ! total pressure at center of zone (pgas + prad) + !prad ! radiation pressure at center of zone + !pgas ! gas pressure at center of zone (electrons and ions) + logPgas ! log10(pgas) + pgas_div_ptotal ! pgas/pressure + + eta ! electron degeneracy parameter (eta >> 1 for significant degeneracy) + mu ! mean molecular weight per gas particle (ions + free electrons) + + grada ! dlnT_dlnP at constant S + !dE_dRho ! at constant T + !cv ! specific heat at constant volume + !cp ! specific heat at constant total pressure + + !log_CpT + gamma1 ! dlnP_dlnRho at constant S + !gamma3 ! gamma3 - 1 = dlnT_dlnRho at constant S + !gam ! plasma interaction parameter (> 160 or so means starting crystallization) + free_e ! free_e is mean number of free electrons per nucleon + !logfree_e ! log10(free_e), free_e is mean number of free electrons per nucleon + !chiRho ! dlnP_dlnRho at constant T + !chiT ! dlnP_dlnT at constant Rho + + csound ! sound speed + log_csound + !csound_face ! sound speed (was previously called csound_at_face) + !cs_at_cell_bdy ! sound speed at cell boundary (csound is at cell center) + !v_div_cs ! velocity divided by sound speed + v_div_csound ! velocity divided by sound speed + !div_v + + !thermal_time_to_surface ! in seconds + !log_thermal_time_to_surface + !t_rad + !log_t_rad + !log_t_sound + !log_t_thermal + + !eos_phase + !eos_frac_OPAL_SCVH + !eos_frac_HELM + !eos_frac_Skye + !eos_frac_PC + !eos_frac_FreeEOS + !eos_frac_CMS + !eos_frac_ideal + + !pgas_div_p + !prad_div_pgas + !prad_div_pgas_div_L_div_Ledd + !pressure_scale_height_cm + + !eps_grav_composition_term + eps_grav_plus_eps_mdot + + !chiRho_for_partials + !chiT_for_partials + !rel_diff_chiRho_for_partials + !rel_diff_chiT_for_partials + + !latent_ddlnRho + !latent_ddlnT + + !log_P_face + !log_Ptrb + !log_cp_T_div_t_sound + + !QQ + + +!# Mass accretion + eps_grav ! -T*ds/dt (negative for expansion) + !log_abs_eps_grav_dm_div_L + !log_abs_v ! log10(abs(velocity)) (cm/s) + !log_mdot_cs + !log_mdot_v + eps_mdot + !env_eps_grav + !xm_div_delta_m + !log_xm_div_delta_m + + +!# Nuclear energy generation + !signed_log_eps_grav ! sign(eps_grav)*log10(max(1,abs(eps_grav))) + !signed_log_eps_nuc + net_nuclear_energy ! erg/gm/s from nuclear reactions minus all neutrino losses + ! The value plotted is net_nuclear_energy = sign(val)*log10(max(1,abs(val))) + ! where val = net nuclear energy minus all neutrino losses. + net_energy ! net_energy + eps_grav. + ! The value plotted is net_energy = sign(val)*log10(max(1,abs(val))) + ! where val = net nuclear energy plus eps_grav minus all neutrino losses. + eps_nuc_plus_nuc_neu + !eps_nuc_minus_non_nuc_neu + !eps_nuc_start + + eps_nuc ! ergs/g/sec from nuclear reactions (including losses to reaction neutrinos) + !log_abs_eps_nuc + !d_lnepsnuc_dlnd + !d_epsnuc_dlnd + !deps_dlnd_face + ! (was previously called deps_dlnd_at_face) + !d_lnepsnuc_dlnT + !d_epsnuc_dlnT + !deps_dlnT_face + ! (was previously called deps_dlnT_at_face) + !eps_nuc_neu_total ! erg/gm/sec as neutrinos from nuclear reactions + + non_nuc_neu ! non-nuclear-reaction neutrino losses + !nonnucneu_plas ! plasmon neutrinos (for collective reactions like gamma_plasmon => nu_e + nubar_e) + !nonnucneu_brem ! bremsstrahlung (for reactions like e- + (z,a) => e- + (z,a) + nu + nubar) + !nonnucneu_phot ! photon neutrinos (for reactions like e- + gamma => e- + nu_e + nubar_e) + !nonnucneu_pair ! pair production (for reactions like e+ + e- => nu_e + nubar_e) + !nonnucneu_reco ! recombination neutrinos (for reactions like e- (continuum) => e- (bound) + nu_e + nubar_e) + + ! ergs/g/sec for reaction categories + add_reaction_categories ! this adds all the reaction categories + ! NOTE: you can list specific categories by giving their names (from chem_def) + pp + cno + tri_alpha + !c_alpha + !n_alpha + !o_alpha + !ne_alpha + !na_alpha + !mg_alpha + !si_alpha + !s_alpha + !ar_alpha + !ca_alpha + !ti_alpha + !fe_co_ni + !c12_c12 + !c12_o16 + !o16_o16 + !photo + !pnhe4 + !other + + ! adds columns for all of the reactions that are in the current net + ! Note that if using op_split_burn=.true. then zones which have been split will report 0 for thier rates + !add_raw_rates ! raw reaction rates, reactions/second + !add_screened_rates ! screened reaction rates reactions/second + !add_eps_nuc_rates ! Nuclear energy (minus neutrino losses) released erg/s + !add_eps_neu_rates ! Neutrino losses erg/s + + ! individual reactions (as many as desired) + ! use list_net_reactions = .true. in star_job to list all reactions in the current net + ! reactions/second + !raw_rate r_h1_h1_ec_h2 + !raw_rate r_h1_h1_wk_h2 + + !burn_num_iters ! Number of split_burn iterations taken + !burn_avg_epsnuc + !log_burn_avg_epsnuc + +!# Composition + !x_mass_fraction_H + !y_mass_fraction_He + !z_mass_fraction_metals + abar ! average atomic weight (g/mole) + !zbar ! average charge + !z2bar ! average charge^2 + ye ! average charge per baryon = proton fraction + + x ! hydrogen mass fraction + !log_x + y ! helium mass fraction + !log_y + z ! metallicity + !log_z ! metallicity + + add_abundances ! this adds all of the isos that are in the current net + ! NOTE: you can list specific isotopes by giving their names (from chem_def) + !h1 + !he3 + !he4 + !c12 + !n14 + !o16 + + !add_log_abundances ! this adds log10 of all of the isos that are in the current net + ! NOTE: you can list specific isotopes by giving their names (from chem_def) + !log h1 + !log he3 + !log he4 + !log c12 + !log n14 + !log o16 + + ! log concentration of species + ! concentration = number density / number density of electrons + ! Ci = (Xi/Ai) / sum(Zi*Xi/Ai) [see Thoul et al, ApJ 421:828-842, 1994] + !log_concentration h1 + !log_concentration he4 + + + ! typical charge for given species + ! (used by diffusion) + !typical_charge he4 + !typical_charge c12 + !typical_charge fe52 + + ! ionization state for given species + ! (same as typical charge, except that it's unsmoothed) + !ionization he4 + !ionization c12 + !ionization fe52 + + !cno_div_z ! abundance of c12, n14, and o16 as a fraction of total z + + + + +!# Opacity + !opacity ! opacity measured at center of zone + log_opacity ! log10(opacity) + !dkap_dlnrho_face ! partial derivative of opacity wrt. ln rho (at T=const) at outer edge of cell + ! (was previously called dkap_dlnrho_at_face) + !dkap_dlnT_face ! partial derivative of opacity wrt. ln T (at rho=const) at outer edge of cell + ! (was previously called dkap_dlnT_at_face) + !kap_frac_lowT ! fraction of opacity from lowT tables + !kap_frac_highT ! fraction of opacity from highT tables + !kap_frac_Type2 ! fraction of opacity from Type2 tables + !kap_frac_Compton ! fraction of opacity from Compton_Opacity + !kap_frac_op_mono ! fraction of opacity from OP mono + + !log_kap + !log_kap_times_factor + + !log_c_div_tau + !xtau + !xlogtau + !logtau_sub_xlogtau + +!# Luminosity + luminosity ! luminosity at outer boundary of zone (in Lsun units) + !logL ! log10(max(1d-2,L/Lsun)) + !log_Lrad + log_Ledd ! log10(Leddington/Lsun) -- local Ledd, 4 pi clight G m / kap + !log_L_div_Ledd ! log10(max(1d-12,L/Leddington)) + log_Lrad_div_Ledd + !log_Lrad_div_L + !signed_log_power ! sign(L)*log10(max(1,abs(L))) + + !lum_adv + lum_conv + !lum_conv_MLT + lum_div_Ledd + !lum_erg_s + !lum_plus_lum_adv + lum_rad + + !log_L_div_CpTMdot + !log_abs_lum_erg_s + + !L + !Lc + Lc_div_L + !Lr + !Lr_div_L + !Lt + !Lt_div_L + +!# Energetics + !total_energy ! specific total energy of cell (ergs/g). internal+potential+kinetic+rotation. + !cell_specific_IE + !cell_specific_KE + !cell_IE_div_IE_plus_KE + !cell_KE_div_IE_plus_KE + + !cell_ie_div_star_ie + !cell_internal_energy_fraction + !cell_internal_energy_fraction_start + !cell_specific_PE + + !log_cell_ie_div_star_ie + !log_cell_specific_IE + + ergs_eps_grav_plus_eps_mdot + ergs_error + !ergs_error_integral + ergs_mdot + !ergs_rel_error_integral + !dm_eps_grav + + !dE + + !etrb + log_etrb + !extra_grav + log_rel_E_err + + !total_energy_sign + +!# Convection + !mlt_mixing_length ! mixing length for mlt (cm) + mlt_mixing_type ! value returned by mlt + mlt_Pturb + !alpha_mlt + + conv_vel ! convection velocity (cm/sec) + log_conv_vel ! log10 convection velocity (cm/sec) + + !conv_L_div_L + log_conv_L_div_L + !lum_conv_div_lum_rad + !lum_rad_div_L_Edd + !lum_conv_div_lum_Edd + lum_conv_div_L + lum_rad_div_L + !lum_rad_div_L_Edd_sub_fourPrad_div_PchiT ! density increases outward if this is > 0 + ! see Joss, Salpeter, and Ostriker, "Critical Luminosity", ApJ 181:429-438, 1973. + + gradT ! mlt value for required temperature gradient dlnT/dlnP + + gradr ! dlnT/dlnP required for purely radiative transport + !grad_temperature ! smoothed dlnT/dlnP at cell boundary + !grad_density ! smoothed dlnRho/dlnP at cell boundary + + gradL ! gradient for Ledoux criterion for convection + !sch_stable ! 1 if grada > gradr, 0 otherwise + !ledoux_stable ! 1 if gradL > gradr, 0 otherwise + + !grada_sub_gradT + gradT_sub_grada ! gradT-grada at cell boundary + gradT_div_grada ! gradT/grada at cell boundary + + !gradr_sub_gradT + !gradT_sub_gradr ! gradT-gradr at cell boundary + !gradT_div_gradr ! gradT/gradr at cell boundary + + !log_gradT_div_gradr ! log10 gradT/gradr at cell boundary + log_mlt_Gamma ! convective efficiency + conv_vel_div_csound ! convection velocity divided by sound speed + !conv_vel_div_L_vel ! L_vel is velocity needed to carry L by convection; L = 4*pi*r^2*rho*vel**3 + log_mlt_D_mix ! log10 diffusion coefficient for mixing from mlt (cm^2/sec) + + !gradr_div_grada ! gradr/grada_face; > 1 => Schwarzschild unstable for convection + gradr_sub_grada ! gradr - grada_face; > 0 => Schwarzschild unstable for convection + + !gradL_sub_gradr + !gradP_div_rho + !gradT_excess_effect + !gradT_rel_err + !gradT_sub_a + !grada_face + !grada_sub_gradr + !diff_grads + !log_diff_grads + + !mlt_D + !mlt_Gamma + mlt_Y_face + !mlt_Zeta + !mlt_gradT + !mlt_log_abs_Y + !mlt_vc + !log_mlt_vc + !dvc_dt_TDC_div_g + + !superad_reduction_factor + !conv_vel_div_mlt_vc + + !log_Lconv + !log_Lconv_div_L + +!# Mixing + mixing_type ! mixing types are defined in mesa/const/public/const_def + log_D_mix ! log10 diffusion coefficient for mixing in units of cm^2/second (Eulerian) + !log_D_mix_non_rotation + !log_D_mix_rotation + + log_D_conv ! D_mix for regions where mix_type = convective_mixing + !log_D_leftover ! D_mix for regions where mix_type = leftover_convective_mixing + log_D_semi ! D_mix for regions where mix_type = semiconvective_mixing + log_D_ovr ! D_mix for regions where mix_type = overshoot_mixing + log_D_thrm ! D_mix for regions where mix_type = thermohaline_mixing + !log_D_minimum ! D_mix for regions where mix_type = minimum_mixing + !log_D_rayleigh_taylor ! D_mix for regions where mix_type = rayleigh_taylor_mixing + !log_D_anon ! D_mix for regions where mix_type = anonymous_mixing + !log_D_omega + + !log_sig_mix ! sig(k) is mixing flow across face k in (gm sec^1) + ! sig(k) = D_mix*(4*pi*r(k)**2*rho_face)**2/dmavg + + !dominant_isoA_for_thermohaline + !dominant_isoZ_for_thermohaline + !gradL_composition_term + + !mix_type + + + +!# Optical Depth + tau ! optical depth + !log_column_depth ! log10 column depth, exterior mass / area (g cm^-2) + !log_radial_depth ! log10 radial distance to surface (cm) + !logtau ! log10(optical depth) at cell face + !tau_eff ! tau that gives the local P == P_atm if this location at surface + ! tau_eff = kap*(P/g - Pextra_factor*(L/M)/(6*pi*clight*cgrav)) + !tau_eff_div_tau + + + +!# Rotation + omega ! angular velocity = j_rot/i_rot + !log_omega + log_j_rot + !log_J_div_M53 ! J is j*1e-15 integrated from center; M53 is m^(5/3) + log_J_inside ! J_inside is j_rot integrated from center + !shear ! -dlnomega/dlnR + !log_abs_shear ! log10(abs(dlnomega/dlnR)) + !richardson_number + i_rot ! specific moment of inertia at cell boundary + !j_rot ! specific angular momentum at cell boundary + !v_rot ! rotation velocity at cell boundary (km/sec) + !w_div_w_crit_roche !ratio of rotational velocity to keplerian at the equator + !without the contribution from the Eddington factor + fp_rot ! rotation factor for pressure + ft_rot ! rotation factor for temperature + !ft_rot_div_fp_rot ! gradr factor + + !log_am_nu_non_rot ! log10(am_nu_non_rot) + !log_am_nu_rot ! log10(am_nu_rot) + log_am_nu ! log10(am_nu_non_rot + am_nu_rot) + + !r_polar ! (Rsun) + !log_r_polar ! log10 (Rsun) + !r_equatorial ! (Rsun) + !log_r_equatorial ! log10 (Rsun) + !r_e_div_r_p ! equatorial/r_polar + !omega_crit ! breakup angular velocity = sqrt(G M / equatorial^3) + !omega_div_omega_crit + + !am_log_nu_omega ! for diffusion of omega + !am_log_nu_j ! for diffusion of angular momentum + + !am_log_nu_rot ! diffusion of angular momentum driven by rotation + !am_log_nu_non_rot ! diffusion driven by other sources, e.g. convection + + !am_log_sig_omega ! for diffusion of omega + !am_log_sig_j ! for diffusion of angular momentum + !am_log_sig ! == am_log_sig_omega + + !am_log_D_visc ! diffusion coeff for kinematic viscosity + !am_log_D_DSI ! diffusion coeff for dynamical shear instability + !am_log_D_SH ! diffusion coeff for Solberg-Hoiland instability + !am_log_D_SSI ! diffusion coeff for secular shear instability + !am_log_D_ES ! diffusion coeff for Eddington-Sweet circulation + !am_log_D_GSF ! diffusion coeff for Goldreich-Schubert-Fricke instability + !am_log_D_ST ! Spruit dynamo mixing diffusivity + !am_log_nu_ST ! Spruit dynamo effective viscosity + + !dynamo_log_B_r ! (Gauss) + !dynamo_log_B_phi ! (Gauss) + + !am_domega_dlnR + !log_abs_dlnR_domega + + !w_div_w_crit_roche2 + + +!# Diffusion + ! electric field from element diffusion calculation + !e_field + !log_e_field + + ! gravitational field from element diffusion calculation + !g_field_element_diffusion + !log_g_field_element_diffusion + + !eE_div_mg_element_diffusion + !log_eE_div_mg_element_diffusion + + ! element diffusion velocity for species + !edv h1 + !edv he4 + !edv o16 + + ! Energy generated by Ne22 sedimentation. + !eps_WD_sedimentation + !log_eps_WD_sedimentation + + !eps_diffusion + !log_eps_diffusion + + !diffusion_D h1 ! self diffusion coeff + !diffusion_dX h1 ! change in h1 mass fraction from diffusion + !diffusion_dX he4 ! change in he4 mass fraction from diffusion + !diffusion_dX n20 ! change in n20 mass fraction from diffusion + + !v_rad h1 ! velocity from radiative levitation + !v_rad he4 ! velocity from radiative levitation + !v_rad ne20 ! velocity from radiative levitation + + !log_g_rad h1 ! log10 acceleration from radiative levitation + !log_g_rad he4 ! log10 acceleration from radiative levitation + !log_g_rad ne20 ! log10 acceleration from radiative levitation + +!# Phase Separation + !eps_phase_separation + +!# Oscillations + brunt_N2 ! brunt-vaisala frequency squared + brunt_N2_structure_term + brunt_N2_composition_term + !log_brunt_N2_structure_term + !log_brunt_N2_composition_term + !brunt_A ! = N^2*r/g + !brunt_A_div_x2 ! x = r(k)/r(1) + !brunt_N2_dimensionless ! N2 in units of 3GM/R^3 + !brunt_N_dimensionless ! N in units of sqrt(3GM/R^3) + !brunt_frequency ! cycles per day + !brunt_N ! sqrt(abs(brunt_N2)) + !log_brunt_N ! log10(brunt_N) + !log_brunt_N2 ! log10(brunt_N2) + !log_brunt_N2_dimensionless ! log10(brunt_N2_dimensionless) + + !brunt_B ! smoothed numerical difference + !brunt_nonB ! = grada - gradT + !log_brunt_B ! smoothed numerical difference + !log_brunt_nonB ! = grada - gradT + + !sign_brunt_N2 ! sign of brunt_N2 (+1 for Ledoux stable; -1 for Ledoux unstable) + !brunt_nu ! brunt_frequency in microHz + !log_brunt_nu ! brunt_frequency in microHz + + !lamb_S ! lamb frequency for l=1: S = sqrt(2)*csound/r (rad/s) + !lamb_S2 ! squared lamb frequency for l=1: S2 = 2*(csound/r)^2 (rad^2/s^2) + + !lamb_Sl1 ! lamb frequency for l=1; = sqrt(2)*csound/r (microHz) + !lamb_Sl2 ! lamb frequency for l=2; = sqrt(6)*csound/r (microHz) + !lamb_Sl3 ! lamb frequency for l=3; = sqrt(12)*csound/r (microHz) + !lamb_Sl10 ! lamb frequency for l=10; = sqrt(110)*csound/r (microHz) + + !log_lamb_Sl1 ! log10(lamb_Sl1) + !log_lamb_Sl2 ! log10(lamb_Sl2) + !log_lamb_Sl3 ! log10(lamb_Sl3) + !log_lamb_Sl10 ! log10(lamb_Sl10) + + !brunt_N_div_r_integral ! integral from center of N*dr/r + !k_r_integral ! integral from center of k_r*dr + !brunt_N2_sub_omega2 + !sl2_sub_omega2 + + +!# RSP + + !rsp_Chi ! dlnP_dlnRho + !rsp_Et ! Specific turbulent energy + !rsp_logEt ! Log specific turbulent energy + !rsp_erad ! Specific internal (radiative) energy + !rsp_log_erad ! Log specific internal (radiative) energy + !rsp_Hp_face ! Pressure scale height at cell face + !rsp_Lc ! Convective luminosity + !rsp_Lc_div_L ! Convective luminosity div total luminosity + !rsp_Lr ! Radiative luminosity + !rsp_Lr_div_L ! Radiative luminosity div total luminosity + !rsp_Lt ! Turbulent luminosity + !rsp_Lt_div_L ! Turbulent luminosity div total luminosity + !rsp_Pt ! Turbulent pressure, p_t, see Table 1 in MESA5 + !rsp_Uq ! Viscous momentum transfer rate, U_q, see Table 1 in MESA5 + !rsp_Eq ! Viscous energy transfer rate, epsilon_q, see Table 1 in MESA5 + !rsp_Pvsc ! Artificial viscosity, p_av, see Table 1 in MESA5 + !rsp_gradT ! Temperature gradient + !rsp_Y_face ! Superadiabatic gradient at cell face, Y_sag, see Table 1 in MESA5 + !rsp_damp ! Turbulent dissipation, D, see Table 1 in MESA5 + !rsp_dampR ! Radiative cooling, D_r, see Table 1 in MESA5 + !rsp_sink ! Sum of turbulent dissipation and radiative cooling terms + !rsp_src ! Source function, S, see Table 1 in MESA5 + !rsp_src_snk ! Convective coupling, C, see Table 1 in MESA5 + !rsp_heat_exchange_timescale ! 1d0/(clight * opacity * density) + !rsp_log_heat_exchange_timescale + !rsp_log_dt_div_heat_exchange_timescale ! Ratio of time step to heat exchange timescale + !w + !log_w + + !COUPL + !DAMP + !DAMPR + !SOURCE + !Chi + !Eq + !Hp_face + !PII_face + !Ptrb + !Pvsc + !Uq + !Y_face + +!# RTI + + !RTI_du_diffusion_kick + !alpha_RTI + !boost_for_eta_RTI + !dedt_RTI + !dudt_RTI + !eta_RTI + !log_alpha_RTI + !log_boost_for_eta_RTI + !log_eta_RTI + !log_etamid_RTI + !log_lambda_RTI_div_Hrho + !log_sig_RTI + !log_sigmid_RTI + !log_source_RTI + !log_source_minus_alpha_RTI + !log_source_plus_alpha_RTI + !source_minus_alpha_RTI + !source_plus_alpha_RTI + !lambda_RTI + +!# Hydrodynamics + + + !v + !v_div_v_escape + !v_div_vesc + !v_kms + !log_v_escape + + !u + !u_face + + !P_face + + +!# Extras + !extra_heat + !extra_L ! extra_heat integrated from center (Lsun) + !log_extra_L ! log10 integrated from center (Lsun) + !log_irradiation_heat + + !extra_jdot ! set in other_torque routine + !extra_omegadot ! set in other_torque routine + + !extra_opacity_factor ! set in other_opacity_factor routine + + ! diffusion factor profile for species, set in other_diffusion_factor routine + !extra_diffusion_factor h1 + !extra_diffusion_factor he4 + !extra_diffusion_factor o16 + + + +!# Miscellaneous + + !dlog_h1_dlogP ! (log(h1(k)) - log(h1(k-1)))/(log(P(k)) - log(P(k-1))) + !dlog_he3_dlogP + !dlog_he4_dlogP + !dlog_c12_dlogP + !dlog_c13_dlogP + !dlog_n14_dlogP + !dlog_o16_dlogP + !dlog_ne20_dlogP + !dlog_mg24_dlogP + !dlog_si28_dlogP + + !dlog_pp_dlogP + !dlog_cno_dlogP + !dlog_3alf_dlogP + + !dlog_burn_c_dlogP + !dlog_burn_n_dlogP + !dlog_burn_o_dlogP + + !dlog_burn_ne_dlogP + !dlog_burn_na_dlogP + !dlog_burn_mg_dlogP + + !dlog_cc_dlogP + !dlog_co_dlogP + !dlog_oo_dlogP + + !dlog_burn_si_dlogP + !dlog_burn_s_dlogP + !dlog_burn_ar_dlogP + !dlog_burn_ca_dlogP + !dlog_burn_ti_dlogP + !dlog_burn_cr_dlogP + !dlog_burn_fe_dlogP + + !dlog_pnhe4_dlogP + !dlog_photo_dlogP + !dlog_other_dlogP + + !logR_kap ! logR = logRho - 3*logT + 18 ; used in kap tables + !logW ! logW = logPgas - 4*logT + !logQ ! logQ = logRho - 2*logT + 12 + !logV ! logV = logRho - 0.7*logE + 20 + + !log_CpT_absMdot_div_L ! log10(s% Cp(k)*s% T(k)*abs(s% mstar_dot)/s% L(k)) + + !delta_r ! r - r_start, change during step + !delta_L ! L - L_start, change during step + !delta_cell_vol ! cell_vol - cell_vol_start, change during step + !delta_entropy ! entropy - entropy_start, change during step (does not include effects of diffusion) + !delta_T ! T - T_start, change during step + !delta_rho ! rho - rho_start, change during step + !delta_eps_nuc ! eps_nuc - eps_nuc_start, change during step + !delta_mu ! mu - mu_start, change during step + + !zFe ! mass fraction of "Fe" = Fe+Co+Ni + !log_zFe + !dPdr_dRhodr_info + !log_sig_raw_mix + + !d_u_div_rmid + !d_u_div_rmid_start + !d_v_div_r_dm + !d_v_div_r_dr + + !dlnP_dlnR + !dlnRho_dlnR + !dlnRho_dr + !dlnX_dr + !dlnY_dr + !dlogR + !dPdr_div_grav + !dPdr_info + !dRhodr_info + !dRstar_div_dr + !dr_ratio + !dm_eps_grav + !dr_ratio + !dt_cs_div_dr + !dt_div_tau_conv + !dt_times_conv_vel_div_mixing_length + log_dt_cs_div_dr + !log_dt_div_tau_conv + !log_dt_times_conv_vel_div_mixing_length + !log_du_kick_div_du + !du + !dvdt_dPdm + !dvdt_grav + + tau_conv + !tau_cool + !tau_epsnuc + !tau_qhse + + !max_abs_xa_corr + + tdc_num_iters + + !k + + +! the first few lines of the profile contain general info about the model. +! for completeness, those items are described here. + + ! initial mass and Z + ! initial_mass + ! initial_z + ! general properties of the current state + ! model_number + ! num_zones + ! star_age + ! time_step + ! properties at the photosphere + ! Teff + ! photosphere_L + ! photosphere_r + ! properties at the outermost zone of the model + ! log_surface_L + ! log_surface_radius + ! log_surface_temp + ! properties near the center of the model + ! log_center_temp + ! log_center_density + ! log_center_P + ! center_eta + ! abundances near the center + ! center_h1 + ! center_he3 + ! center_he4 + ! center_c12 + ! center_n14 + ! center_o16 + ! center_ne20 + ! information about total mass + ! star_mass + ! star_mdot + ! star_mass_h1 + ! star_mass_he3 + ! star_mass_he4 + ! star_mass_c12 + ! star_mass_n14 + ! star_mass_o16 + ! star_mass_ne20 + ! locations of abundance transitions + ! he_core_mass + ! c_core_mass + ! o_core_mass + ! si_core_mass + ! fe_core_mass + ! location of optical depths 10 and 100 + ! tau10_mass + ! tau10_radius + ! tau100_mass + ! tau100_radius + ! time scales + ! dynamic_time + ! kh_timescale + ! nuc_timescale + ! various kinds of total power + ! power_nuc_burn + ! power_h_burn + ! power_he_burn + ! power_neu + ! a few control parameter values + ! h1_boundary_limit + ! he4_boundary_limit + ! c12_boundary_limit + ! burn_min1 + ! burn_min2 diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re new file mode 100755 index 000000000..c9ef26f96 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re @@ -0,0 +1,33 @@ +#!/bin/bash + +shopt -u expand_aliases + +photo_directory=photos + +function most_recent_photo { + ls -tp "$photo_directory" | grep -v / | head -1 +} + +if [ $# -eq 0 ] +then + photo=$(most_recent_photo) +else + photo=$1 +fi + +if [ -z "$photo" ] || ! [ -f "$photo_directory/$photo" ] +then + echo "specified photo ($photo) does not exist" + exit 1 +fi + +echo "restart from $photo" +if ! cp "$photo_directory/$photo" restart_photo +then + echo "failed to copy photo ($photo)" + exit 1 +fi + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re_all b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re_all new file mode 100755 index 000000000..2f5a874d7 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re_all @@ -0,0 +1,2 @@ +./re_nomodfiles x00031590 inlist_to_he_dep_header +#./re_nomodfiles . inlist_pulses_header diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re_mid_pulse b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re_mid_pulse new file mode 100755 index 000000000..7c18de22b --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re_mid_pulse @@ -0,0 +1,3 @@ +./re_nomodfiles x00050000 inlist_pulses_header +#./re_nomodfiles x00117100 inlist_pulses_header + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re_nomodfiles b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re_nomodfiles new file mode 100755 index 000000000..565b74208 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/re_nomodfiles @@ -0,0 +1,41 @@ +#!/bin/bash + +#echo $# +#echo $1 +#echo $2 + +photo_directory=photos + +function most_recent_photo { + ls -t "$photo_directory" | head -1 +} + +if [ "$#" -ne 2 ] +then + echo "must pass two arguments, photo string and inlist name" + exit 1 +fi + +if [ $1 = "." ] +then + photo=$(most_recent_photo) +else + photo=$1 +fi + +if [ -z "$photo" ] || ! [ -f "$photo_directory/$photo" ] +then + echo "specified photo does not exist" + exit 1 +fi + +echo "restart from $photo" +if ! cp "$photo_directory/$photo" restart_photo +then + echo "failed to copy photo" + exit 1 +fi + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star $2 +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn new file mode 100755 index 000000000..1adcae941 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn @@ -0,0 +1,25 @@ +#!/bin/bash + +# uncomment the following line to skip the optional inlists +# MESA_SKIP_OPTIONAL=t + +# this provides the definition of do_one (run one part of test) +# do_one [inlist] [output model] [LOGS directory] +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +# check if can skip building starting model +#if [ -n "$MESA_SKIP_OPTIONAL" ]; then +# cp standard_he_dep.mod he_dep.mod +#else + do_one inlist_to_he_dep_header he_dep.mod +# cp he_dep.mod standard_he_dep.mod +#fi + +#do_one inlist_pulses_header final.mod + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +echo 'finished' + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn1 b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn1 new file mode 100755 index 000000000..25590040a --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn1 @@ -0,0 +1,7 @@ +#!/bin/bash + +rm -f restart_photo + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn_nomodfiles b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn_nomodfiles new file mode 100755 index 000000000..35bd84f4c --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn_nomodfiles @@ -0,0 +1,7 @@ +#!/bin/bash +rm -f restart_photo +echo $1 + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star $1 +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn_pulse b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn_pulse new file mode 100755 index 000000000..14c5878ce --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/rn_pulse @@ -0,0 +1,25 @@ +#!/bin/bash + +# uncomment the following line to skip the optional inlists +# MESA_SKIP_OPTIONAL=t + +# this provides the definition of do_one (run one part of test) +# do_one [inlist] [output model] [LOGS directory] +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +# check if can skip building starting model +#if [ -n "$MESA_SKIP_OPTIONAL" ]; then +# cp standard_he_dep.mod he_dep.mod +#else +# do_one inlist_to_he_dep_header he_dep.mod +# cp he_dep.mod standard_he_dep.mod +#fi + +do_one inlist_pulses_header final.mod + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +echo 'finished' + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/run_all b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/run_all new file mode 100755 index 000000000..3c4429ac3 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/run_all @@ -0,0 +1,2 @@ +./rn_nomodfiles inlist_to_he_dep_header +./re_nomodfiles . inlist_pulses_header diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run.f90 b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run.f90 new file mode 100644 index 000000000..112660f7c --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run.f90 @@ -0,0 +1,15 @@ +program run + use run_star_support, only: do_read_star_job + use run_star, only: do_run_star + + implicit none + + integer :: ierr + + ierr = 0 + call do_read_star_job('inlist', ierr) + if (ierr /= 0) stop 1 + + call do_run_star + +end program diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run_star_extras.f90 b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run_star_extras.f90 new file mode 100644 index 000000000..ee40f3a07 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run_star_extras.f90 @@ -0,0 +1,810 @@ +! *********************************************************************** +! +! Copyright (C) 2010-2019 The MESA Team +! +! this file is part of mesa. +! +! mesa is free software; you can redistribute it and/or modify +! it under the terms of the gnu general library public license as published +! by the free software foundation; either version 2 of the license, or +! (at your option) any later version. +! +! mesa is distributed in the hope that it will be useful, +! but without any warranty; without even the implied warranty of +! merchantability or fitness for a particular purpose. see the +! gnu library general public license for more details. +! +! you should have received a copy of the gnu library general public license +! along with this software; if not, write to the free software +! foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa +! +! *********************************************************************** + + module run_star_extras + + use star_lib + use star_def + use const_def + use math_lib + use auto_diff + use chem_def + use utils_lib + use rates_def, only: i_rate + use gyre_mesa_m + + + use interp_1d_def, only: pm_work_size + use interp_1d_lib, only: interp_pm, interp_values, interp_value + + implicit none + + include "test_suite_extras_def.inc" + include 'run_star_extras_TDC_pulsation_defs.inc' + + logical :: dbg = .false. + + !!!!!!!!!!!!!!!!!!!!!!!!! + ! These variables are loaded up from x_ctrl, x_integer_ctrl and x_logical_ctrl + ! values specified on inlist_ppisn + !!!!!!!!!!!!!!!!!!!!!!!!! + + + logical :: in_inlist_pulses, remesh_for_envelope_model, turn_off_remesh, remove_core + integer :: kick_model_number, timestep_drop_model_number, turn_off_remesh_model_number + integer :: initial_model_number + real(dp) :: max_dt_before_pulse, max_dt_during_pulse, core_T_for_cut + + contains + + include "test_suite_extras.inc" + include 'run_star_extras_TDC_pulsation.inc' + + + subroutine extras_controls(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + s% extras_startup => extras_startup + s% extras_start_step => extras_start_step + s% extras_check_model => extras_check_model + s% extras_finish_step => extras_finish_step + s% extras_after_evolve => extras_after_evolve + s% how_many_extra_history_columns => how_many_extra_history_columns + s% data_for_extra_history_columns => data_for_extra_history_columns + s% how_many_extra_profile_columns => how_many_extra_profile_columns + s% data_for_extra_profile_columns => data_for_extra_profile_columns + + ! pulsation info + s% other_photo_write => photo_write + s% other_photo_read => photo_read + + s% how_many_other_mesh_fcns => how_many_other_mesh_fcns + s% other_mesh_fcn_data => RSP_mesh + + ! this is optional + s% other_wind => brott_wind + s% other_adjust_mdot => my_adjust_mdot + s% other_before_struct_burn_mix => my_before_struct_burn_mix + s% other_kap_get => my_other_kap_get + + ! store user provided options from the inlist + + in_inlist_pulses = s% x_logical_ctrl(22) + max_dt_before_pulse = s% x_ctrl(17) + max_dt_during_pulse = s% x_ctrl(18) + remesh_for_envelope_model = s% x_logical_ctrl(23) + turn_off_remesh = s% x_logical_ctrl(24) + kick_model_number = s% x_ctrl(11) + timestep_drop_model_number = s% x_ctrl(13) + turn_off_remesh_model_number = s% x_ctrl(12) + remove_core = s% x_logical_ctrl(25) + core_T_for_cut = s% x_ctrl(14) + end subroutine extras_controls + + subroutine brott_wind(id, Lsurf, Msurf, Rsurf, Tsurf, X, Y, Z, w, ierr) + use star_def + integer, intent(in) :: id + real(dp), intent(in) :: Lsurf, Msurf, Rsurf, Tsurf, X, Y, Z ! surface values (cgs) + ! NOTE: surface is outermost cell. not necessarily at photosphere. + ! NOTE: don't assume that vars are set at this point. + ! so if you want values other than those given as args, + ! you should use values from s% xh(:,:) and s% xa(:,:) only. + ! rather than things like s% Teff or s% lnT(:) which have not been set yet. + real(dp), intent(out) :: w ! wind in units of Msun/year (value is >= 0) + integer, intent(out) :: ierr + + integer :: h1, he4 + real(dp) :: Xs, Ys, Z_div_Z_solar, Teff_jump, alfa, L1, M1, R1, T1, & + vink_wind, nieu_wind, hamann_wind + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + L1 = Lsurf + M1 = Msurf + R1 = Rsurf + T1 = Tsurf + + h1 = s% net_iso(ih1) + he4 = s% net_iso(ihe4) + Xs = s% xa(h1,1) + Ys = s% xa(he4,1) + ! Z=0.0142 is Z from Asplund et al. 2009 + Z_div_Z_solar = s% kap_rq% Zbase/0.0142d0 + ! use Vink et al 2001, eqns 14 and 15 to set "jump" temperature + Teff_jump = 1d3*(61.2d0 + 2.59d0*(-13.636d0 + 0.889d0*log10(Z_div_Z_solar))) + + vink_wind = 0d0 + nieu_wind = 0d0 + hamann_wind = 0d0 + w = 0 + + call eval_Vink_wind(vink_wind) + call eval_Nieuwenhuijzen_wind(nieu_wind) + call eval_Hamann_wind(hamann_wind) + + ! use 1/10 hamann + hamann_wind = hamann_wind/10d0 + + if (T1 < Teff_jump) then + ! low T wind + w = max(vink_wind, nieu_wind) + else + ! high T wind + alfa = 0d0 + if (Xs > 0.7d0) then + alfa = 1d0 + else if (Xs > 0.4d0 .and. Xs < 0.7d0) then + alfa = (Xs - 0.4d0)/0.3d0 + end if + w = alfa * vink_wind + (1d0-alfa) * hamann_wind + end if + + ierr = 0 + + contains + + subroutine eval_Vink_wind(w) + real(dp), intent(inout) :: w + real(dp) :: alfa, w1, w2, logMdot, dT, vinf_div_vesc + + ! alfa = 1 for hot side, = 0 for cool side + if (T1 > 27500d0) then + alfa = 1 + else if (T1 < 22500d0) then + alfa = 0 + else + dT = 100d0 + if (T1 > Teff_jump + dT) then + alfa = 1 + else if (T1 < Teff_jump - dT) then + alfa = 0 + else + alfa = (T1 - (Teff_jump - dT)) / (2*dT) + end if + end if + + if (alfa > 0) then ! eval hot side wind (eqn 24) + vinf_div_vesc = 2.6d0 ! this is the hot side galactic value + vinf_div_vesc = vinf_div_vesc*pow(Z_div_Z_solar,0.13d0) ! corrected for Z + logMdot = & + - 6.697d0 & + + 2.194d0*log10(L1/Lsun/1d5) & + - 1.313d0*log10(M1/Msun/30) & + - 1.226d0*log10(vinf_div_vesc/2d0) & + + 0.933d0*log10(T1/4d4) & + - 10.92d0*pow2(log10(T1/4d4)) & + + 0.85d0*log10(Z_div_Z_solar) + w1 = exp10(logMdot) + else + w1 = 0 + end if + + if (alfa < 1) then ! eval cool side wind (eqn 25) + vinf_div_vesc = 1.3d0 ! this is the cool side galactic value + vinf_div_vesc = vinf_div_vesc*pow(Z_div_Z_solar,0.13d0) ! corrected for Z + logMdot = & + - 6.688d0 & + + 2.210d0*log10(L1/Lsun/1d5) & + - 1.339d0*log10(M1/Msun/30) & + - 1.601d0*log10(vinf_div_vesc/2d0) & + + 1.07d0*log10(T1/2d4) & + + 0.85d0*log10(Z_div_Z_solar) + w2 = exp10(logMdot) + else + w2 = 0 + end if + + w = alfa*w1 + (1 - alfa)*w2 + + end subroutine eval_Vink_wind + + subroutine eval_Nieuwenhuijzen_wind(w) + ! Nieuwenhuijzen, H.; de Jager, C. 1990, A&A, 231, 134 (eqn 2) + real(dp), intent(out) :: w + real(dp) :: log10w + include 'formats' + log10w = -14.02d0 & + +1.24d0*log10(L1/Lsun) & + +0.16d0*log10(M1/Msun) & + +0.81d0*log10(R1/Rsun) & + +0.85d0*log10(Z_div_Z_solar) + w = exp10(log10w) + end subroutine eval_Nieuwenhuijzen_wind + + subroutine eval_Hamann_wind(w) + ! Hamann, W.-R.; Koesterke, L.; Wessolowski, U. 1995, A&A, 299, 151 + real(dp), intent(out) :: w + real(dp) :: log10w + include 'formats' + log10w = -11.95d0 & + +1.5d0*log10(L1/Lsun) & + -2.85d0*Xs & + + 0.85d0*log10(Z_div_Z_solar) + w = exp10(log10w) + end subroutine eval_Hamann_wind + + end subroutine brott_wind + + subroutine my_adjust_mdot(id, ierr) + use star_def + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + real(dp) :: Lrad_div_Ledd + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + if (s% generations > 2) then + write(*,*) "check mdots", s% mstar_dot, s% mstar_dot_old + if (abs(s% mstar_dot) > 1.05d0*abs(s% mstar_dot_old)) then + s% mstar_dot = 1.05d0*s% mstar_dot_old + else if (abs(s% mstar_dot) < 0.95d0*abs(s% mstar_dot_old)) then + s% mstar_dot = 0.95d0*s% mstar_dot_old + end if + end if + end subroutine my_adjust_mdot + + + subroutine my_other_kap_get( & + id, k, handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, & + lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + + use kap_def, only: num_kap_fracs + use kap_lib + + ! INPUT + integer, intent(in) :: id ! star id if available; 0 otherwise + integer, intent(in) :: k ! cell number or 0 if not for a particular cell + integer, intent(in) :: handle ! from alloc_kap_handle + integer, intent(in) :: species + integer, pointer :: chem_id(:) ! maps species to chem id + ! index from 1 to species + ! value is between 1 and num_chem_isos + integer, pointer :: net_iso(:) ! maps chem id to species number + ! index from 1 to num_chem_isos (defined in chem_def) + ! value is 0 if the iso is not in the current net + ! else is value between 1 and number of species in current net + real(dp), intent(in) :: xa(:) ! mass fractions + real(dp), intent(in) :: log10_rho ! density + real(dp), intent(in) :: log10_T ! temperature + real(dp), intent(in) :: lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT + ! free_e := total combined number per nucleon of free electrons and positrons + real(dp), intent(in) :: eta, d_eta_dlnRho, d_eta_dlnT + ! eta := electron degeneracy parameter + + ! OUTPUT + real(dp), intent(out) :: kap_fracs(num_kap_fracs) + real(dp), intent(out) :: kap ! opacity + real(dp), intent(out) :: dln_kap_dlnRho ! partial derivative at constant T + real(dp), intent(out) :: dln_kap_dlnT ! partial derivative at constant Rho + real(dp), intent(out) :: dln_kap_dxa(:) ! partial derivative w.r.t. to species + integer, intent(out) :: ierr ! 0 means AOK. + + type (star_info), pointer :: s + real(dp) :: velocity + real(dp) :: radius, logR + real(dp) :: logT_alt, inv_diff + real(dp) :: log_kap, alpha + + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + kap = 0; dln_kap_dlnRho = 0; dln_kap_dlnT = 0; dln_kap_dxa = 0 + velocity = 0 + radius = 0 + + !if (k==1 .and. s% u_flag .and. .not. is_nan(s% lnR_start(1))) then !very surface cell can go mad, things are more stable if we fix opacity + ! if (s% xh_start(s% i_u,1)>sqrt(2*s% cgrav(1)*s% m(1)/exp(s% lnR_start(1)))) then + if (k==1 .and. s% u_flag) then !very surface cell can go mad, things are more stable if we fix opacity + ! this is to support restarts, as xh_start and r_start are + ! not properly set when model loads + if (s% solver_iter > 0) then + velocity = s% xh_start(s% i_u,1) + radius = s% r_start(1) + else + velocity = s% xh(s% i_u,1) + radius = s% r(1) + end if + if (velocity>sqrt(2*s% cgrav(1)*s% m(1)/radius)) then + kap = 0.2d0*(1 + s% X(1)) + dln_kap_dlnRho = 0d0 + dln_kap_dlnT = 0d0 + return + else + call kap_get( & + s% kap_handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + end if + else + call kap_get( & + s% kap_handle, species, chem_id, net_iso, xa, & + log10_rho, log10_T, lnfree_e, d_lnfree_e_dlnRho, d_lnfree_e_dlnT, & + eta, d_eta_dlnRho, d_eta_dlnT, & + kap_fracs, kap, dln_kap_dlnRho, dln_kap_dlnT, dln_kap_dxa, ierr) + end if + + + end subroutine my_other_kap_get + + subroutine extras_startup(id, restart, ierr) + integer, intent(in) :: id + logical, intent(in) :: restart + integer, intent(out) :: ierr + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call test_suite_startup(s, restart, ierr) + call TDC_pulsation_extras_startup(id, restart, ierr) + + ! interestingly, if you do this instead of remove_center_by_temperature + ! in the starjob section of the inlist, then the tau relaxation happens + ! before the cut. Not sure which is better, but leaving like this for now. + ! It turns out that this appears to be the better way and + ! to do it, as this smooths the initialization of new atm BCs (if changed). + if (.not. restart .and. in_inlist_pulses .and. remove_core) then + call star_remove_center_by_temperature(id, core_T_for_cut, ierr) + end if + + ! Initialize GYRE + + call init('gyre.in') + + ! Set constants + + call set_constant('G_GRAVITY', standard_cgrav) + call set_constant('C_LIGHT', clight) + call set_constant('A_RADIATION', crad) + + call set_constant('M_SUN', Msun) + call set_constant('R_SUN', Rsun) + call set_constant('L_SUN', Lsun) + + call set_constant('GYRE_DIR', TRIM(mesa_dir)//'/gyre/gyre') + + ! for rsp style mesh + if (.not. restart .and. in_inlist_pulses) then + initial_model_number = s% model_number + end if + + if (.not. restart .and. in_inlist_pulses .and. remesh_for_envelope_model) then + call remesh_for_TDC_pulsation(id, ierr) + end if + end subroutine extras_startup + + + subroutine extras_after_evolve(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + real(dp) :: dt + character (len=strlen) :: test + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call test_suite_after_evolve(s, ierr) + + if (.not. s% x_logical_ctrl(37)) return + call final() + end subroutine extras_after_evolve + + + ! returns either keep_going, retry, or terminate. + integer function extras_check_model(id) + integer, intent(in) :: id + integer :: ierr, k + real(dp) :: max_v + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + extras_check_model = keep_going + + + end function extras_check_model + + + integer function how_many_extra_history_columns(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + how_many_extra_history_columns = TDC_pulsation_how_many_extra_history_columns(id) + end function how_many_extra_history_columns + + + subroutine data_for_extra_history_columns(id, n, names, vals, ierr) + integer, intent(in) :: id, n + character (len=maxlen_history_column_name) :: names(n) + real(dp) :: vals(n), v_esc + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k, k0 + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call TDC_pulsation_data_for_extra_history_columns(id, n, names, vals, ierr) + end subroutine data_for_extra_history_columns + + + integer function how_many_extra_profile_columns(id) + use star_def, only: star_info + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return +! how_many_extra_profile_columns = TDC_pulsation_how_many_extra_profile_columns(id) + how_many_extra_profile_columns = 1!how_many_extra_profile_columns +1 + end function how_many_extra_profile_columns + + + subroutine data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + use star_def, only: star_info, maxlen_profile_column_name + use const_def, only: dp + integer, intent(in) :: id, n, nz + character (len=maxlen_profile_column_name) :: names(n) + real(dp) :: vals(nz,n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return +! call TDC_pulsation_data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + names(1) = 'Frad_div_cUrad' + do k = 1, s% nz + vals(k,1) = ((s% L(k) - s% L_conv(k)) / (4._dp*pi*pow2(s%r(k)))) & + /(clight * s% Prad(k) *3._dp) + end do + end subroutine data_for_extra_profile_columns + + + integer function extras_start_step(id) + integer, intent(in) :: id + integer :: ierr, i + type (star_info), pointer :: s + include 'formats' + extras_start_step = terminate + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + !this is used to ensure we read the right inlist options + s% use_other_before_struct_burn_mix = .true. + + ! we want to ignore T gradient equation for a few steps after remesh + if (s% model_number < initial_model_number + 30 .and. in_inlist_pulses) then + s% convergence_ignore_equL_residuals = .true. + else if (in_inlist_pulses) then + s% convergence_ignore_equL_residuals = .false. + end if + + !if (s% model_number == 31600) then + ! call star_set_u_flag(id, .true., ierr) + !end if + + if (s% model_number == kick_model_number .and. in_inlist_pulses & + .and. s% x_logical_ctrl(5))then + + ! if v= 0, turn on v so we can kick + if (.not. s% v_flag .or. .not. s% u_flag) then + call star_set_v_flag(id, .true., ierr) + end if + + call gyre_in_mesa_extras_set_velocities(s,.false.,ierr) + !force initial velocities to zero to prevent issues in outer layers +! call star_set_u_flag(id, .true., ierr) + +! do i = 1, 300 +! s% xh(s% i_u,i) = 1d5 +! s% xh_old(s% i_u,i) = 1d5 +! s% generations = 1 +! end do + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + write(*,*) 'kick' + + end if + + call my_before_struct_burn_mix(s% id, s% dt, extras_start_step) + + extras_start_step = keep_going + end function extras_start_step + + subroutine my_before_struct_burn_mix(id, dt, res) + use const_def, only: dp + use star_def + integer, intent(in) :: id + real(dp), intent(in) :: dt + integer, intent(out) :: res ! keep_going, redo, retry, terminate + real(dp) :: power_photo, v_esc + integer :: ierr, k + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + +! !s% use_atm_PT_at_center_of_surface_cell = .false. +! s% use_momentum_outer_BC = .false. ! offset_P_to_center_cell = .true. +! s% use_compression_outer_BC = .false. ! offset_P_to_center_cell = .true. +! s% use_zero_Pgas_outer_BC = .true. +! s% atm_option = 'T_tau' +! s% atm_T_tau_relation = 'Eddington' +! s% atm_T_tau_opacity = 'fixed' +! s% tau_factor = 1d-3 +! s% Pextra_factor = 1d0 +! s% force_tau_factor = 1d-3 +! s% delta_lgL_limit = 0.25d0 +! !s% delta_lgTeff_limit = 1d-2!0.25d0 +! s% delta_lgL_limit_L_min = 1d99!-100 +! s% delta_lgL_limit_L_min = 1d99!-100 +! +! !s% atm_T_tau_errtol = 1d-12 +! !s% atm_T_tau_max_iters = 500 + + if (in_inlist_pulses) then + if (s% model_number > timestep_drop_model_number )then + s% max_timestep = max_dt_during_pulse + else + s% max_timestep = max_dt_before_pulse + end if + + if (s% model_number > turn_off_remesh_model_number .and. turn_off_remesh )then + s% okay_to_remesh = .false. + ! if ((s% model_number == turn_off_remesh_model_number + 1) & + ! .and. .not. remesh_for_envelope_model )then + ! do k =1,s%nz + ! if (s%lnT(k) >= log(2d6)) then + ! exit + ! end if + ! end do + ! s% mesh_min_k_old_for_split = k + ! end if + ! write (*,*) 's% mesh_min_k_old_for_split', s% mesh_min_k_old_for_split + end if + end if + + ! reading inlists can turn this flag off for some reason + s% use_other_before_struct_burn_mix = .true. + + res = keep_going + end subroutine my_before_struct_burn_mix + + subroutine null_binary_controls(id, binary_id, ierr) + integer, intent(in) :: id, binary_id + integer, intent(out) :: ierr + ierr = 0 + end subroutine null_binary_controls + + ! returns either keep_going or terminate. + integer function extras_finish_step(id) + use run_star_support + use math_lib + integer, intent(in) :: id + integer :: ierr,k + real(dp) :: max_vel_inside, vesc_for_cell, vesc_surf !check_avg_v_div_vesc + type (star_info), pointer :: s + include 'formats' + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + extras_finish_step = keep_going + extras_finish_step = TDC_pulsation_extras_finish_step(id) + +! if (.not. s% x_logical_ctrl(37)) return +! extras_finish_step = gyre_in_mesa_extras_finish_step(id) + + if (extras_finish_step == terminate) s% termination_code = t_extras_finish_step + + end function extras_finish_step + + + + + ! here is an example that adds a mesh function for log(opacity) + subroutine how_many_other_mesh_fcns(id, n) + integer, intent(in) :: id + integer, intent(out) :: n + n = 1 + end subroutine how_many_other_mesh_fcns + + +! subroutine RSP_mesh( & +! id, nfcns, names, gval_is_xa_function, vals1, ierr) +! use star_def +! use math_lib +! use const_def +! integer, intent(in) :: id +! integer, intent(in) :: nfcns +! character(len=*) :: names(:) +! logical, intent(out) :: gval_is_xa_function(:) ! (nfcns) +! real(dp), pointer :: vals1(:) ! =(nz, nfcns) +! integer, intent(out) :: ierr +! integer :: nz, k +! real(dp), pointer :: vals(:, :) +! real(dp) :: weight1 = 1d6!1d4 +! real(dp) :: weight2 = 8d5!1d4 +! real(dp) :: weight3 = 0d0 +! real(dp) :: logT_anchor1, logT_anchor2, logT_anchor3, lmid, delta, ell +! integer :: k_anchor1, k_anchor2 +! +! type(star_info), pointer :: s +! ierr = 0 +! call star_ptr(id, s, ierr) +! if (ierr /= 0) return +! names(1) = 'RSP_function' +! gval_is_xa_function(1) = .false. +! nz = s%nz +! vals(1:nz, 1:nfcns) => vals1(1:nz*nfcns) +! +! logT_anchor1 = log(11d3)!log(11d3) +! logT_anchor2 = log(20d3)!log(11d3) +! logT_anchor3 = log(30d3) +! +! lmid = 0.5d0*(logT_anchor2+logT_anchor3) +! delta = (logT_anchor3 - logT_anchor2) +! +! k_anchor1 = 0 +! k_anchor2 = 0 +! +! ! do k = 1, nz +! ! if (s% lnT(k) < logT_anchor1) then +! ! vals(k, 1) = weight1*(s% m(1) - s% m(k))/Msun +! ! k_anchor = k +! ! !write (*,*) "k", k ,"dm", vals(k, 1) +! ! else if (s% lnT(k) < logT_anchor2 .and. s% lnT(k) >= logT_anchor1) then +! ! vals(k, 1) = weight2*(s% m(k_anchor) - s% m(k))/Msun +! ! !write (*,*) "k", k ,"dm", vals(k, 1) +! ! else +! ! vals(k, 1) = weight3*(s% m(1)/Msun - s% m(k)/Msun) +! ! end if +! ! end do +! +! +! do k = 1, nz +! ell = s%lnT(k) +! if (s% lnT(k) <= logT_anchor1) then +! vals(k,1) = weight1*(s%m(1) - s%m(k))/Msun +! k_anchor1 = k +! else if (s% lnT(k) <= logT_anchor2 .and. s% lnT(k) >= logT_anchor1) then +! vals(k,1) = weight2*(s%m(1) - s%m(k))/Msun +! k_anchor2 = k +! else if (s% lnT(k) < logT_anchor3) then +! ! smooth taper doqn to 0. +!! vals(k,1) = vals(k-1,1)/2d0 +! vals(k,1) = (0.5d0*weight2*(1d0 - tanh( (ell - lmid)/delta )) & +! ) * ( (s%m(k_anchor2) - s%m(k)) / Msun ) +! end if +! end do +! +! end subroutine RSP_mesh + +subroutine RSP_mesh( & + id, nfcns, names, gval_is_xa_function, vals1, ierr) + use star_def + use math_lib + use const_def + integer, intent(in) :: id + integer, intent(in) :: nfcns + character(len=*) :: names(:) + logical, intent(out) :: gval_is_xa_function(:) ! (nfcns) + real(dp), pointer :: vals1(:) ! =(nz, nfcns) + integer, intent(out) :: ierr + integer :: nz, k + real(dp), pointer :: vals(:, :) + real(dp) :: weight1 = 5d3!1d4 + real(dp) :: weight2 = 1d2!1d4 + real(dp) :: weight3 = 0d0 + real(dp) :: logT_anchor1, logT_anchor2, logT_anchor3, lmid, delta, ell + integer :: k_anchor1, k_anchor2 + + type(star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + names(1) = 'RSP_function' + gval_is_xa_function(1) = .false. + nz = s%nz + vals(1:nz, 1:nfcns) => vals1(1:nz*nfcns) + + logT_anchor1 = log(11d3)!log(11d3) + logT_anchor2 = log(20d3)!log(11d3) + logT_anchor3 = log(30d3) + + lmid = 0.5d0*(logT_anchor2+logT_anchor3) + delta = (logT_anchor3 - logT_anchor2)/10d0 + + k_anchor1 = 0 + k_anchor2 = 0 + +! do k = 1, nz +! if (s% lnT(k) < logT_anchor1) then +! vals(k, 1) = weight1*(s% m(1) - s% m(k))/Msun +! k_anchor = k +! !write (*,*) "k", k ,"dm", vals(k, 1) +! else if (s% lnT(k) < logT_anchor2 .and. s% lnT(k) >= logT_anchor1) then +! vals(k, 1) = weight2*(s% m(k_anchor) - s% m(k))/Msun +! !write (*,*) "k", k ,"dm", vals(k, 1) +! else +! vals(k, 1) = weight3*(s% m(1)/Msun - s% m(k)/Msun) +! end if +! end do + + + do k = 1, nz + ell = s%lnT(k) + if (s% lnT(k) < logT_anchor1) then + ! core weighting + vals(k,1) = weight1*(s%m(1) - s%m(k))/Msun + k_anchor1 = k + else if (s% lnT(k) < logT_anchor2 .and. s% lnT(k) >= logT_anchor1 ) then + ! envelope weighting + vals(k,1) = 0d0!weight2*(s%m(k_anchor1-1) - s%m(k))/Msun + k_anchor2 = k + else + ! smooth taper from weight2 → 0 + vals(k,1) = 0d0!( + !0.5d0*weight2*(1d0 - tanh( (ell - lmid)/delta )) & + !) * ( (s%m(k_anchor2-1) - s%m(k)) / Msun ) + end if + end do + +end subroutine RSP_mesh + + + subroutine photo_write(id, iounit) + integer, intent(in) :: id, iounit + call TDC_pulsation_photo_write(id, iounit) + end subroutine photo_write + + + subroutine photo_read(id, iounit, ierr) + integer, intent(in) :: id, iounit + integer, intent(out) :: ierr + call TDC_pulsation_photo_read(id, iounit, ierr) + end subroutine photo_read + + end module run_star_extras + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run_star_extras_TDC_pulsation.inc b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run_star_extras_TDC_pulsation.inc new file mode 100644 index 000000000..f9b82b96a --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run_star_extras_TDC_pulsation.inc @@ -0,0 +1,382 @@ + + + subroutine TDC_pulsation_photo_write(id, iounit) + integer, intent(in) :: id, iounit + write(iounit) num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev, & + period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag, & + time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max, & + best_period, best_model_number, best_order, best_cycles_to_double + end subroutine TDC_pulsation_photo_write + + + subroutine TDC_pulsation_photo_read(id, iounit, ierr) + integer, intent(in) :: id, iounit + integer, intent(out) :: ierr + ierr = 0 + read(iounit, iostat=ierr) num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev, & + period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag, & + time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max, & + best_period, best_model_number, best_order, best_cycles_to_double + end subroutine TDC_pulsation_photo_read + + + subroutine TDC_pulsation_extras_startup(id, restart, ierr) + integer, intent(in) :: id + logical, intent(in) :: restart + integer, intent(out) :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + if (.not. restart) then + num_periods = 0 + run_num_steps_end_prev = 0 + run_num_iters_end_prev = 0 + run_num_retries_end_prev = 0 + period = 0 + KE_growth = 0 + KE_growth_avg = 0 + prev_KE_max = 0 + delta_R_growth = 0 + delta_R_growth_avg = 0 + prev_delta_R = 0 + period_max_v_div_cs = 0 + period_max_v_div_vesc = 0 + period_delta_R = 0 + period_delta_Teff = 0 + period_delta_logTeff = 0 + period_delta_logL = 0 + period_delta_Mag = 0 + time_started = 0 + v_div_cs_max = 0 + v_div_vesc_max = 0 + KE_min = 0 + KE_max = 0 + R_min = 0 + R_max = 0 + L_min = 0 + L_max = 0 + T_min = 0 + T_max = 0 + best_period = 0 + best_model_number = 0 + best_order = 0 + best_cycles_to_double = 0 + end if + end subroutine TDC_pulsation_extras_startup + + + integer function TDC_pulsation_extras_finish_step(id) + use chem_def + integer, intent(in) :: id + type (star_info), pointer :: s + integer :: ierr, gyre_interval, test_period + real(dp) :: target_period + logical :: doing_pulses + include 'formats' + + TDC_pulsation_extras_finish_step = terminate + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_extras_finish_step = keep_going + + gyre_interval = s% x_integer_ctrl(1) + if (gyre_interval > 0) then + if (MOD(s% model_number, gyre_interval) == 0) & + call get_gyre_info_for_this_step + if (TDC_pulsation_extras_finish_step == terminate) & + s% termination_code = t_extras_finish_step + if (TDC_pulsation_extras_finish_step /= keep_going) return + end if + + doing_pulses = s% x_logical_ctrl(7) + if (.not. doing_pulses) return + target_period = s% x_ctrl(7) + if (target_period <= 0d0) return + if (.not. get_period_info()) return + + test_period = s% x_integer_ctrl(7) + if (num_periods < test_period .or. test_period <= 0) return + + ! have finished test run + call report_test_results + TDC_pulsation_extras_finish_step = terminate + + contains + + subroutine get_gyre_info_for_this_step + integer :: i + TDC_pulsation_extras_finish_step = gyre_in_mesa_extras_finish_step(id) + if (s% ixtra3_array(1) > 0) then ! unpack the GYRE results + do i=1,s% ixtra3_array(1) + if (s% xtra1_array(i) == 0d0 .or. & + (s% ixtra1_array(i) /= s% x_integer_ctrl(4) .and. s% x_integer_ctrl(4) > 0)) cycle + if (s% xtra3_array(i) > 0d0 .and. & + (best_cycles_to_double == 0d0 .or. s% xtra3_array(i) < best_cycles_to_double)) then + !best_growth = s% xtra1_array(i) + best_period = 1d0/s% xtra2_array(i) ! xtra2_array = freq (s^-1) + best_period = best_period/(24*3600) ! change to days + best_cycles_to_double = s% xtra3_array(i) + best_order = s% ixtra1_array(i) + best_model_number = s% model_number + end if + end do + end if + end subroutine get_gyre_info_for_this_step + + logical function get_period_info() + real(dp) :: v_surf, v_surf_start, KE, min_period, time_ended, & + delta_R, min_deltaR_for_periods, growth_avg_frac_new, & + min_period_div_target, cs, vesc + include 'formats' + get_period_info = .false. + + if (s% r(1) < R_min) R_min = s% r(1) + if (s% r(1) > R_max) R_max = s% r(1) + if (s% L(1) < L_min) L_min = s% L(1) + if (s% L(1) > L_max) L_max = s% L(1) + if (s% Teff < T_min) T_min = s% Teff + if (s% Teff > T_max) T_max = s% Teff + KE = s% total_radial_kinetic_energy_end + if (KE > KE_max) KE_max = KE + if (KE < KE_min) KE_min = KE + + if (s% v_flag) then + v_surf = s% v(1) + v_surf_start = s% v_start(1) + else if (s% u_flag) then + v_surf = s% u_face_val(1) + v_surf_start = s% u_face_start(1) + else ! + v_surf = 0d0 + v_surf_start = 0d0 + !stop 'TDC_pulsation_extras_finish_step: both v_flag and u_flag are false' + end if + cs = s% csound(1) + if (v_surf > v_div_cs_max*cs) v_div_cs_max = v_surf/cs + vesc = sqrt(2*s% cgrav(1)*s% m(1)/(s% r(1))) + if (v_surf > v_div_vesc_max*vesc) v_div_vesc_max = v_surf/vesc + + ! period is completed when v_surf goes from positive to negative during step + if (v_surf > 0d0 .or. v_surf_start < 0d0) return + + if (time_started == 0) then ! start of 1st cycle + time_started = s% time + run_num_steps_end_prev = s% model_number + run_num_iters_end_prev = s% total_num_solver_iterations + run_num_retries_end_prev = s% num_retries + prev_KE_max = 0d0 + call init_min_max_info + write(*,*) 'first maximum radius, period calculations starting at model, day', & + s% model_number, s% time/(24*3600) + return + end if + + delta_R = R_max - R_min + min_deltaR_for_periods = s% x_ctrl(8)*Rsun + if (min_deltaR_for_periods > 0d0) then + if (delta_R < min_deltaR_for_periods) return ! filter out glitches + end if + + time_ended = s% time + if (abs(v_surf - v_surf_start) > 1d-10) & ! tweak the end time to match when v_surf == 0 + time_ended = s% time - v_surf*s% dt/(v_surf - v_surf_start) + min_period_div_target = s% x_ctrl(10) + min_period = target_period*(24*3600)*min_period_div_target + if (min_period > 0d0 .and. & + time_ended - time_started < min_period) return ! filter out glitches + + period = time_ended - time_started + num_periods = num_periods + 1 + + if (num_periods > 1) then + growth_avg_frac_new = s% x_ctrl(9) + KE_growth = (KE_max - prev_KE_max)/prev_KE_max + KE_growth_avg = growth_avg_frac_new*KE_growth + & + (1d0 - growth_avg_frac_new)*KE_growth_avg + delta_R_growth = (delta_R - prev_delta_R)/prev_delta_R + delta_R_growth_avg = growth_avg_frac_new*delta_R_growth + & + (1d0 - growth_avg_frac_new)*delta_R_growth_avg + end if + + period_delta_Teff = T_max - T_min + period_delta_logTeff = log10(T_max/T_min) + period_delta_R = R_max - R_min + period_delta_logL = log10(L_max/L_min) + period_delta_Mag = 2.5d0*period_delta_logL + period_max_v_div_cs = v_div_cs_max + period_max_v_div_vesc = v_div_vesc_max + prev_KE_max = KE_max + prev_delta_R = period_delta_R + ! 1 2 3 4 5 6 7 8 9 + write(*,'(i4,a14,i6,a13,f8.3,a13,f9.3,a9,f9.4,a15,f10.4,a13,f9.4,a13,f10.4,a11,f9.4,a13,f9.4)') & + num_periods, & + 'steps/cycle', s% model_number - run_num_steps_end_prev, & ! 1 a14,i6 + 'iters/step', & + dble(s% total_num_solver_iterations - run_num_iters_end_prev)/ & + dble(s% model_number - run_num_steps_end_prev), & ! 2 a13,f8.3 + 'period (d)', period/(24*3600), & ! 3 a13,f9.3 + 'growth', delta_R_growth_avg, & ! 4 a9,f9.4 + 'delta R/Rsun', period_delta_R/Rsun, & ! 5 a15,f10.4 + 'delta logL', period_delta_logL, & ! 6 a13,f9.4 + 'delta Teff', period_delta_Teff, & ! 7 a13,f10.4 + 'max v/cs', period_max_v_div_cs, & ! 8 a11,f9.4 + 'max v/vesc', period_max_v_div_vesc ! 9 a13,f9.4 + + time_started = time_ended + run_num_steps_end_prev = s% model_number + run_num_iters_end_prev = s% total_num_solver_iterations + run_num_retries_end_prev = s% num_retries + call init_min_max_info + get_period_info = .true. + + end function get_period_info + + subroutine init_min_max_info + v_div_cs_max = 0d0 + v_div_vesc_max = 0d0 + KE_min = 1d99 + KE_max = -1d99 + R_min = 1d99 + R_max = -1d99 + L_min = 1d99 + L_max = -1d99 + T_min = 1d99 + T_max = -1d99 + end subroutine init_min_max_info + + subroutine report_test_results + real(dp) :: rel_run_E_err + write(*,*) + write(*,*) + write(*,*) + rel_run_E_err = s% cumulative_energy_error/s% total_energy + write(*,*) 'rel_run_E_err', rel_run_E_err + if (s% total_energy /= 0d0 .and. abs(rel_run_E_err) > 1d-5) then + write(*,*) '*** BAD rel_run_E_error ***', & + s% cumulative_energy_error/s% total_energy + else if (abs(period/(24*3600) - target_period) > 1d-2) then + write(*,*) '*** BAD period ***', period/(24*3600) - target_period, & + period/(24*3600), target_period + else + write(*,*) 'good match for period', & + period/(24*3600), target_period + end if + write(*,*) + write(*,*) + write(*,*) + end subroutine report_test_results + + end function TDC_pulsation_extras_finish_step + + + include 'gyre_in_mesa_extras_finish_step.inc' + + + subroutine TDC_pulsation_extras_after_evolve(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + ierr = 0 + call final() + end subroutine TDC_pulsation_extras_after_evolve + + + integer function TDC_pulsation_how_many_extra_history_columns(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_how_many_extra_history_columns = 11 + end function TDC_pulsation_how_many_extra_history_columns + + + subroutine TDC_pulsation_data_for_extra_history_columns(id, n, names, vals, ierr) + integer, intent(in) :: id, n + character (len=maxlen_history_column_name) :: names(n) + real(dp) :: vals(n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: i + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + i = 1 + names(i) = 'num_periods'; vals(i) = num_periods; i=i+1 + names(i) = 'period'; vals(i) = period/(24*3600); i=i+1 + names(i) = 'growth'; vals(i) = delta_R_growth_avg; i=i+1 + names(i) = 'max_v_div_cs'; vals(i) = period_max_v_div_cs; i=i+1 + names(i) = 'max_v_div_vesc'; vals(i) = period_max_v_div_vesc; i=i+1 + names(i) = 'delta_R'; vals(i) = period_delta_R/Rsun; i=i+1 + names(i) = 'delta_Teff'; vals(i) = period_delta_Teff; i=i+1 + names(i) = 'delta_logTeff'; vals(i) = period_delta_logTeff; i=i+1 + names(i) = 'delta_logL'; vals(i) = period_delta_logL; i=i+1 + names(i) = 'delta_Mag'; vals(i) = period_delta_Mag; i=i+1 + names(i) = 'KE_growth_avg'; vals(i) = KE_growth_avg; i = i+1 + end subroutine TDC_pulsation_data_for_extra_history_columns + + + integer function TDC_pulsation_how_many_extra_profile_columns(id) + use star_def, only: star_info + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + TDC_pulsation_how_many_extra_profile_columns = 0 ! 6 + end function TDC_pulsation_how_many_extra_profile_columns + + + subroutine TDC_pulsation_data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + use star_def, only: star_info, maxlen_profile_column_name + use const_def, only: dp + integer, intent(in) :: id, n, nz + character (len=maxlen_profile_column_name) :: names(n) + real(dp) :: vals(nz,n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k + ierr = 0 + return + + + call star_ptr(id, s, ierr) + if (ierr /= 0) return + + names(1) = 'xtra1' + names(2) = 'xtra2' + names(3) = 'xtra3' + names(4) = 'xtra4' + names(5) = 'xtra5' + names(6) = 'xtra6' + + do k=1,nz + vals(k,1) = s% xtra1_array(k) + vals(k,2) = s% xtra2_array(k) + vals(k,3) = s% xtra3_array(k) + vals(k,4) = s% xtra4_array(k) + vals(k,5) = s% xtra5_array(k) + vals(k,6) = s% xtra6_array(k) + end do + + end subroutine TDC_pulsation_data_for_extra_profile_columns + + + include 'gyre_in_mesa_extras_set_velocities.inc' + + diff --git a/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run_star_extras_TDC_pulsation_defs.inc b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run_star_extras_TDC_pulsation_defs.inc new file mode 100644 index 000000000..b7b6e47b6 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/dev_TDC_mira_u_flag/src/run_star_extras_TDC_pulsation_defs.inc @@ -0,0 +1,16 @@ + + ! GYRE "best" info + real(dp) :: best_period, best_cycles_to_double + integer :: best_model_number, best_order + + ! summary info at time of recently completely period + integer :: num_periods, run_num_steps_end_prev, & + run_num_iters_end_prev, run_num_retries_end_prev + real(dp) :: period, KE_growth, KE_growth_avg, prev_KE_max, & + delta_R_growth, delta_R_growth_avg, prev_delta_R, & + period_max_v_div_vesc, period_max_v_div_cs, period_delta_R, & + period_delta_Teff, period_delta_logTeff, & + period_delta_logL, period_delta_Mag + ! info for period in progress + real(dp) :: time_started, v_div_cs_max, v_div_vesc_max, & + KE_min, KE_max, R_min, R_max, L_min, L_max, T_min, T_max diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/.ignore_checksum b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/.ignore_checksum new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/.ignore_checksum @@ -0,0 +1 @@ + diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/ck b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/ck new file mode 100755 index 000000000..ac08f15c6 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/ck @@ -0,0 +1,7 @@ +#!/bin/bash + +# this provides the definition of check_one +# check_one +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +check_one diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/clean b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/clean new file mode 100755 index 000000000..95545a5c1 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/clean @@ -0,0 +1,4 @@ +#!/bin/bash + +cd make +make clean diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/history_columns.list b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/history_columns.list new file mode 100644 index 000000000..a54f0fbcc --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/history_columns.list @@ -0,0 +1,1073 @@ +! history_columns.list -- determines the contents of star history logs +! you can use a non-standard version by setting history_columns_file in your inlist + +! units are cgs unless otherwise noted. + +! reorder the following names as desired to reorder columns. +! comment out the name to omit a column (fewer columns => less IO => faster running). +! remove '!' to restore a column. + +! if you have a situation where you want a non-standard set of columns, +! make a copy of this file, edit as desired, and give the new filename in your inlist +! as history_columns_file. if you are just adding columns, you can 'include' this file, +! and just list the additions in your file. note: to include the standard default +! version, use include '' -- the 0 length string means include the default file. + +! blank lines and comments can be used freely. +! if a column name appears more than once in the list, only the first occurrence is used. + +! if you need to have something added to the list of options, let me know.... + + +! the first few lines of the log file contain a few items: + + ! version_number -- for the version of mesa being used + ! burn_min1 -- 1st limit for reported burning, in erg/g/s + ! burn_min2 -- 2nd limit for reported burning, in erg/g/s + + +!# other files + +! note: you can include another list by doing +! include 'filename' +! include '' means include the default standard list file + +! the following lines of the log file contain info about 1 model per row + +!---------------------------------------------------------------------------------------------- + +!# general info about the model + + model_number ! counting from the start of the run + num_zones ! number of zones in the model + + !## age + + star_age ! elapsed simulated time in years since the start of the run + !star_age_sec ! elapsed simulated time in seconds since the start of the run + !star_age_min ! elapsed simulated time in minutes since the start of the run + !star_age_hr ! elapsed simulated time in hours since the start of the run + !star_age_day ! elapsed simulated time in days since the start of the run + day ! elapsed simulated time in days since the start of the run + + log_star_age + log_star_age_sec + + !## timestep + + time_step ! timestep in years since previous model + time_step_sec ! timestep in seconds since previous model + time_step_days + log_dt ! log10 time_step in years + log_dt_sec ! log10 time_step in seconds + !log_dt_days ! log10 time_step in days + + !## mass + + star_mass ! in Msun units + !log_star_mass + + !star_gravitational_mass ! star_mass is baryonic mass + !star_mass_grav_div_mass + + !delta_mass ! star_mass - initial_mass in Msun units + log_xmstar ! log10 mass exterior to M_center (grams) + + !## mass change + + star_mdot ! d(star_mass)/dt (in msolar per year) + log_abs_mdot ! log10(abs(star_mdot)) (in msolar per year) + + !## imposed surface conditions + !Tsurf_factor + !tau_factor + !tau_surface + + !## imposed center conditions + !m_center + !m_center_gm + !r_center + !r_center_cm + !r_center_km + !L_center + !log_L_center + !log_L_center_ergs_s + !v_center + !v_center_kms + + !logt_max + +!---------------------------------------------------------------------------------------------- + +!# mixing and convection + + !max_conv_vel_div_csound + !max_gradT_div_grada + !max_gradT_sub_grada + !min_log_mlt_Gamma + + + !## mixing regions + + mass_conv_core ! (Msun) mass coord of top of convective core. 0 if core is not convective + + ! mx1 refers to the largest (by mass) convective region. + ! mx2 is the 2nd largest. + + ! conv_mx1_top and conv_mx1_bot are the region where mixing_type == convective_mixing. + ! mx1_top and mx1_bot are the extent of all kinds of mixing, convective and other. + + ! values are m/Mstar + conv_mx1_top + conv_mx1_bot + conv_mx2_top + conv_mx2_bot + mx1_top + mx1_bot + mx2_top + mx2_bot + + ! radius -- values are radii in Rsun units + !conv_mx1_top_r + !conv_mx1_bot_r + !conv_mx2_top_r + !conv_mx2_bot_r + !mx1_top_r + !mx1_bot_r + !mx2_top_r + !mx2_bot_r + + ! you might want to get a more complete list of mixing regions by using the following + + !mixing_regions ! note: this includes regions where the mixing type is no_mixing. + + ! the is the number of regions to report + ! there will be 2* columns for this in the log file, 2 for each region. + ! the first column for a region gives the mixing type as defined in const/public/const_def.f90. + + ! the second column for a region gives the m/mstar location of the top of the region + ! entries for extra columns after the last region in the star will have an invalid mixing_type value of -1. + ! mstar is the total mass of the star, so these locations range from 0 to 1 + ! all regions are include starting from the center, so the bottom of one region + ! is the top of the previous one. since we start at the center, the bottom of the 1st region is 0. + + ! the columns in the log file will have names like 'mix_type_1' and 'mix_qtop_1' + + ! if the star has too many regions to report them all, + ! the smallest regions will be merged with neighbors for reporting purposes only. + + + !mix_relr_regions + ! same as above, but locations given as r/rstar instead of m/mstar. + ! the columns in the log file will have names like 'mix_relr_type_1' and 'mix_relr_top_1' + + + !## conditions at base of largest convection zone (by mass) + !cz_bot_mass ! mass coordinate of base (Msun) + !cz_mass ! mass coordinate of base (Msun) -- same as cz_bot_mass + !cz_log_xmass ! mass exterior to base (g) + !cz_log_xmsun ! mass exterior to base (Msun) + !cz_xm ! mass exterior to base (Msun) + !cz_logT + !cz_logRho + !cz_logP + !cz_bot_radius ! Rsun + !cz_log_column_depth + !cz_log_radial_depth + !cz_luminosity ! Lsun + !cz_opacity + !cz_log_tau + !cz_eta + !cz_log_eps_nuc ! log10(ergs/g/s) + !cz_t_heat ! Cp*T/eps_nuc (seconds) + + !cz_csound + !cz_scale_height + !cz_grav + + !cz_omega + !cz_omega_div_omega_crit + + !cz_zone + + ! mass fractions at base of largest convection zone (by mass) + !cz_log_xa h1 + !cz_log_xa he4 + + !## conditions at top of largest convection zone (by mass) + !cz_top_mass ! mass coordinate of top (Msun) + !cz_top_log_xmass ! mass exterior to top (g) + !cz_top_log_xmsun ! mass exterior to top (Msun) + !cz_top_xm ! mass exterior to top (Msun) + !cz_top_logT + !cz_top_logRho + !cz_top_logP + !cz_top_radius ! Rsun + !cz_top_log_column_depth + !cz_top_log_radial_depth + !cz_top_luminosity ! Lsun + !cz_top_opacity + !cz_top_log_tau + !cz_top_eta + !cz_top_log_eps_nuc ! log10(ergs/g/s) + !cz_top_t_heat ! Cp*T/eps_nuc (seconds) + + !cz_top_csound + !cz_top_scale_height + !cz_top_grav + + !cz_top_omega + !cz_top_omega_div_omega_crit + + !cz_top_zone + !cz_top_zone_logdq + + ! mass fractions at top of largest convection zone (by mass) + !cz_top_log_xa h1 + !cz_top_log_xa he4 + +!---------------------------------------------------------------------------------------------- + +!# nuclear reactions + + !## integrated quantities + + !power_h_burn ! total thermal power from PP and CNO, excluding neutrinos (in Lsun units) + !power_he_burn ! total thermal power from triple-alpha, excluding neutrinos (in Lsun units) + !power_photo + !power_z_burn + !log_power_nuc_burn ! total thermal power from all burning, excluding photodisintegrations + log_LH ! log10 power_h_burn + log_LHe ! log10 power_he_burn + log_LZ ! log10 total burning power including LC, but excluding LH and LHe and photodisintegrations + log_Lnuc ! log(LH + LHe + LZ) + !log_Lnuc_ergs_s + !log_Lnuc_sub_log_L + !lnuc_photo + + !extra_L ! integral of extra_heat in Lsun units + !log_extra_L ! log10 extra_L + + !## neutrino losses + log_Lneu ! log10 power emitted in neutrinos, nuclear and thermal (in Lsun units) + !log_Lneu_nuc ! log10 power emitted in neutrinos, nuclear sources only (in Lsun units) + !log_Lneu_nonnuc ! log10 power emitted in neutrinos, thermal sources only (in Lsun units) + + !mass_loc_of_max_eps_nuc ! (in Msun units) + !mass_ext_to_max_eps_nuc ! (in Msun units) + !eps_grav_integral ! (in Lsun units) + !log_abs_Lgrav ! log10 abs(eps_grav_integral) (in Lsun units) + + !## information about reactions (by category) + + ! log10 total luminosity for reaction categories (Lsun units) + + pp + cno + tri_alpha + !c_alpha + !n_alpha + !o_alpha + !ne_alpha + !na_alpha + !mg_alpha + !si_alpha + !s_alpha + !ar_alpha + !ca_alpha + !ti_alpha + !fe_co_ni + !c12_c12 + !c12_o16 + !o16_o16 + !photo + !pnhe4 + !other + + !## information about individual reactions + + ! adds columns for all of the reactions that are in the current net + ! Note that if using op_split_burn=.true. then zones which have been split will report 0 for thier rates + !add_raw_rates ! raw reaction rates, reactions/second + !add_screened_rates ! screened reaction rates reactions/second + !add_eps_nuc_rates ! Nuclear energy (minus neutrino losses) released erg/s + !add_eps_neu_rates ! Neutrino losses erg/s + + ! individual reactions (as many as desired) + ! use list_net_reactions = .true. in star_job to list all reactions in the current net + ! reactions/second + !raw_rate r_h1_h1_ec_h2 + !raw_rate r_h1_h1_wk_h2 + + + + !## nuclear reactions at center + + ! center log10 burn erg/g/s for reaction categories + + !c_log_eps_burn cno + !c_log_eps_burn tri_alfa + + ! center d_eps_nuc_dlnd for reaction categories + + !c_d_eps_dlnd cno + !c_d_eps_dlnd tri_alfa + + ! center d_eps_nuc_dlnT for reaction categories + + !c_d_eps_dlnT cno + !c_d_eps_dlnT tri_alfa + + !## regions of strong nuclear burning + + ! 2 zones where eps_nuc > burn_min1 erg/g/s + ! for each zone have 4 numbers: start1, start2, end2, end1 + ! start1 is mass of inner edge where first goes > burn_min1 (or -20 if none such) + ! start2 is mass of inner edge where first zone reaches burn_min2 erg/g/sec (or -20 if none such) + ! end2 is mass of outer edge where first zone drops back below burn_min2 erg/g/s + ! end1 is mass of outer edge where first zone ends (i.e. eps_nuc < burn_min1) + ! similar for the second zone + + epsnuc_M_1 ! start1 for 1st zone + epsnuc_M_2 ! start2 + epsnuc_M_3 ! end2 + epsnuc_M_4 ! end1 + + epsnuc_M_5 ! start1 for 2nd zone + epsnuc_M_6 ! start2 + epsnuc_M_7 ! end2 + epsnuc_M_8 ! end1 + + + ! you might want to get a more complete list of burning regions by using the following + + !burning_regions + ! the is the number of regions to report + ! there will be 2* columns for this in the log file, 2 for each region. + ! the first column for a region gives int(sign(val)*log10(max(1,abs(val)))) + ! where val = ergs/gm/sec nuclear energy minus all neutrino losses. + ! the second column for a region gives the q location of the top of the region + ! entries for extra columns after the last region in the star will have a value of -9999 + ! all regions are included starting from the center, so the bottom of one region + ! is the top of the previous one. + ! since we start at the center, the bottom of the 1st region is q=0 and top of last is q=1. + + ! the columns in the log file will have names like 'burn_type_1' and 'burn_qtop_1' + + !burn_relr_regions + ! same as above, but locations given as r/rstar instead of m/mstar. + ! the columns in the log file will have names like 'burn_relr_type_1' and 'burn_relr_top_1' + + + ! if the star has too many regions to report them all, + ! the smallest regions will be merged with neighbors for reporting purposes only. + +!---------------------------------------------------------------------------------------------- + +!# information about core and envelope + + !## helium core + he_core_mass + he_core_radius + !he_core_lgT + !he_core_lgRho + !he_core_L + !he_core_v + !he_core_omega + !he_core_omega_div_omega_crit + !he_core_k + + !## CO core + co_core_mass + !CO_core + co_core_radius + !co_core_lgT + !co_core_lgRho + !co_core_L + !co_core_v + !co_core_omega + !co_core_omega_div_omega_crit + !co_core_k + + !## ONe core + one_core_mass + !one_core_radius + !one_core_lgT + !one_core_lgRho + !one_core_L + !one_core_v + !one_core_omega + !one_core_omega_div_omega_crit + !one_core_k + + !## iron core + fe_core_mass + !fe_core_radius + !fe_core_lgT + !fe_core_lgRho + !fe_core_L + !fe_core_v + !fe_core_omega + !fe_core_omega_div_omega_crit + !fe_core_k + + !## neuton rich core + neutron_rich_core_mass + !neutron_rich_core_radius + !neutron_rich_core_lgT + !neutron_rich_core_lgRho + !neutron_rich_core_L + !neutron_rich_core_v + !neutron_rich_core_omega + !neutron_rich_core_omega_div_omega_crit + !neutron_rich_core_k + + !## envelope + + !envelope_mass ! = star_mass - he_core_mass + !envelope_fraction_left ! = envelope_mass / (initial_mass - he_core_mass) + + !h_rich_layer_mass ! = star_mass - he_core_mass + !he_rich_layer_mass ! = he_core_mass - c_core_mass + !co_rich_layer_mass + +!---------------------------------------------------------------------------------------------- + +!# timescales + + !dynamic_timescale ! dynamic timescale (seconds) -- estimated by 2*pi*sqrt(r^3/(G*m)) + !kh_timescale ! kelvin-helmholtz timescale (years) + !mdot_timescale ! star_mass/abs(star_mdot) (years) + !kh_div_mdot_timescales ! kh_timescale/mdot_timescale + !nuc_timescale ! nuclear timescale (years) -- proportional to mass divided by luminosity + + !dt_cell_collapse ! min time for any cell to collapse at current velocities + !dt_div_dt_cell_collapse + + !dt_div_max_tau_conv ! dt/ maximum conv timescale + !dt_div_min_tau_conv ! dt/ minimum conv timescale + + + !min_dr_div_cs ! min over all cells of dr/csound (seconds) + !min_dr_div_cs_k ! location of min + !log_min_dr_div_cs ! log10 min dr_div_csound (seconds) + !min_dr_div_cs_yr ! min over all cells of dr/csound (years) + !log_min_dr_div_cs_yr ! log10 min dr_div_csound (years) + !dt_div_min_dr_div_cs + !log_dt_div_min_dr_div_cs + + !min_t_eddy ! minimum value of scale_height/conv_velocity + +!---------------------------------------------------------------------------------------------- + +!# conditions at or near the surface of the model + + !## conditions at the photosphere + !effective_T + !Teff + log_Teff ! log10 effective temperature + ! Teff is calculated using Stefan-Boltzmann relation L = 4 pi R^2 sigma Teff^4, + ! where L and R are evaluated at the photosphere (tau_factor < 1) + ! or surface of the model (tau_factor >= 1) when photosphere is not inside the model. + + !photosphere_black_body_T + !photosphere_cell_T ! temperature at model location closest to the photosphere, not necessarily Teff + !photosphere_cell_log_T + !photosphere_cell_density + !photosphere_cell_log_density + !photosphere_cell_opacity + !photosphere_cell_log_opacity + !photosphere_L ! Lsun units + !photosphere_log_L ! Lsun units + !photosphere_r ! Rsun units + !photosphere_log_r ! Rsun units + !photosphere_m ! Msun units + !photosphere_v_km_s + !photosphere_cell_k + !photosphere_column_density + !photosphere_csound + !photosphere_log_column_density + !photosphere_opacity + !photosphere_v_div_cs + !photosphere_xm + !photosphere_cell_free_e + !photosphere_cell_log_free_e + !photosphere_logg + !photosphere_T + + !## conditions at or near the surface of the model (outer edge of outer cell) + + luminosity ! luminosity in Lsun units + !luminosity_ergs_s ! luminosity in cgs units + log_L ! log10 luminosity in Lsun units + !log_L_ergs_s ! log10 luminosity in cgs units + radius ! Rsun + log_R ! log10 radius in Rsun units + !radius_cm + !log_R_cm + + log_g ! log10 gravity + gravity + log_Ledd + log_L_div_Ledd ! log10(L/Leddington) + lum_div_Ledd + !log_surf_optical_depth + !surface_optical_depth + + !log_surf_cell_opacity ! old name was log_surf_opacity + !log_surf_cell_P ! old name was log_surf_P + !log_surf_cell_pressure ! old name was log_surf_pressure + !log_surf_cell_density ! old name was log_surf_density + !log_surf_cell_temperature ! old name was log_surf_temperature + !surface_cell_temperature ! old name was surface_temperature + !log_surf_cell_z ! old name was log_surf_z + !surface_cell_entropy ! in units of kerg per baryon + ! old name was surface_entropy + + v_surf ! (cm/s) + v_surf_km_s ! (km/s) + v_div_csound_surf ! velocity divided by sound speed at outermost grid point + !v_div_csound_max ! max value of velocity divided by sound speed at face + !v_div_vesc + !v_phot_km_s + !v_surf_div_escape_v + + !v_surf_div_v_kh ! v_surf/(photosphere_r/kh_timescale) + + !surf_avg_j_rot + !surf_avg_omega + !surf_avg_omega_crit + !surf_avg_omega_div_omega_crit + !surf_avg_v_rot ! km/sec rotational velocity at equator + !surf_avg_v_crit ! critical rotational velocity at equator + !surf_avg_v_div_v_crit + !surf_avg_Lrad_div_Ledd + !surf_avg_logT + !surf_avg_logRho + !surf_avg_opacity + + ! Gravity Darkening, reports the surface averaged L/Lsun and Teff (K) caused by + ! gravity darkening in rotating stars. Based on the model of Espinosa Lara & Rieutord (2011) + ! 'polar' refers to the line of sight being directed along the rotation axis of the star + ! 'equatorial' refers to the line of sight coincident with the stellar equator + !grav_dark_L_polar !Lsun + !grav_dark_Teff_polar !K + !grav_dark_L_equatorial !Lsun + !grav_dark_Teff_equatorial !K + + !surf_escape_v ! cm/s + + !v_wind_Km_per_s ! Km/s + ! = 1d-5*s% opacity(1)*max(0d0,-s% mstar_dot)/ & + ! (4*pi*s% photosphere_r*Rsun*s% tau_base) + ! Lars says: + ! wind_mdot = 4*pi*R^2*rho*v_wind + ! tau = integral(opacity*rho*dr) from R to infinity + ! so tau = opacity*wind_mdot/(4*pi*R*v_wind) at photosphere + ! or v_wind = opacity*wind_mdot/(4*pi*R*tau) at photosphere + + !rotational_mdot_boost ! factor for increase in mass loss mdot due to rotation + !log_rotational_mdot_boost ! log factor for increase in mass loss mdot due to rotation + !surf_r_equatorial_div_r_polar + !surf_r_equatorial_div_r + !surf_r_polar_div_r + +!---------------------------------------------------------------------------------------------- + +!# conditions near center + + log_center_T ! temperature + log_center_Rho ! density + log_center_P ! pressure + + ! shorter names for above + log_cntr_P + log_cntr_Rho + log_cntr_T + + !center_T ! temperature + !center_Rho ! density + !center_P ! pressure + + !center_degeneracy ! the electron chemical potential in units of k*T + !center_gamma ! plasma interaction parameter + center_mu + center_ye + center_abar + !center_zbar + + !center_eps_grav + + !center_non_nuc_neu + !center_eps_nuc + !d_center_eps_nuc_dlnT + !d_center_eps_nuc_dlnd + !log_center_eps_nuc + + !center_entropy ! in units of kerg per baryon + !max_entropy ! in units of kerg per baryon + !fe_core_infall + !non_fe_core_infall + !non_fe_core_rebound + !max_infall_speed + + !compactness_parameter ! (m/Msun)/(R(m)/1000km) for m = 2.5 Msun + !compactness + !m4 ! Mass co-ordinate where entropy=4 + ! mu4 is sensitive to the choice of how much dm/dr you average over, thus we average dm and dr over M(entropy=4) and M(entropy=4)+0.3Msun + !mu4 ! dM(Msun)/dr(1000km) where entropy=4 + + + !center_omega + !center_omega_div_omega_crit + +!---------------------------------------------------------------------------------------------- + +!# abundances + + !species ! size of net + + !## mass fractions near center + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_center_abundances + !add_log_center_abundances + + ! individual central mass fractions (as many as desired) + center h1 + center he4 + center c12 + center o16 + + ! individual log10 central mass fractions (as many as desired) + !log_center h1 + !log_center he4 + ! etc. + + + !## mass fractions near surface + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_surface_abundances + !add_log_surface_abundances + + ! individual surface mass fractions (as many as desired) + !surface h1 + !surface he4 + surface c12 + surface o16 + ! etc. + + ! individual log10 surface mass fractions (as many as desired) + + !log_surface h1 + !log_surface he4 + + + !## mass fractions for entire star + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_average_abundances + !add_log_average_abundances + + ! individual average mass fractions (as many as desired) + !average h1 + !average he4 + ! etc. + + ! individual log10 average mass fractions (as many as desired) + !log_average h1 + !log_average he4 + ! etc. + + + !## mass totals for entire star (in Msun units) + + ! the following controls automatically add columns for all of the isos that are in the current net + !add_total_mass + !add_log_total_mass + + ! individual mass totals for entire star (as many as desired) + total_mass h1 + total_mass he4 + ! etc. + + ! individial log10 mass totals for entire star (in Msun units) + !log_total_mass h1 + !log_total_mass he4 + ! etc. + +!---------------------------------------------------------------------------------------------- + +!# info at specific locations + + !## info at location of max temperature + !max_T + !log_max_T + + +!---------------------------------------------------------------------------------------------- + +!# information about shocks + + !## info about outermost outward moving shock + ! excluding locations with q > max_q_for_outer_mach1_location + ! returns values at location of max velocity + !shock_mass ! baryonic (Msun) + !shock_mass_gm ! baryonic (grams) + !shock_q + !shock_radius ! (Rsun) + !shock_radius_cm ! (cm) + !shock_velocity + !shock_csound + !shock_v_div_cs + !shock_lgT + !shock_lgRho + !shock_lgP + !shock_gamma1 + !shock_entropy + !shock_tau + !shock_k + !shock_pre_lgRho + +!---------------------------------------------------------------------------------------------- + +!# asteroseismology + + delta_nu ! large frequency separation for p-modes (microHz) + ! 1e6/(seconds for sound to cross diameter of star) + delta_Pg ! g-mode period spacing for l=1 (seconds) + ! sqrt(2) pi^2/(integral of brunt_N/r dr) + !log_delta_Pg + nu_max ! estimate from scaling relation (microHz) + ! nu_max = nu_max_sun * M/Msun / ((R/Rsun)^2 (Teff/Teff_sun)^0.5) + ! with nu_max_sun = 3100 microHz, Teff_sun = 5777 + !nu_max_3_4th_div_delta_nu ! nu_max^0.75/delta_nu + acoustic_cutoff ! 0.5*g*sqrt(gamma1*rho/P) at surface + acoustic_radius ! integral of dr/csound (seconds) + !ng_for_nu_max ! = 1 / (nu_max*delta_Pg) + ! period for g-mode with frequency nu_max = nu_max_ng*delta_Pg + !gs_per_delta_nu ! delta_nu / (nu_max**2*delta_Pg) + ! number of g-modes per delta_nu at nu_max + + !int_k_r_dr_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=1 + !int_k_r_dr_2pt0_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=1 + !int_k_r_dr_0pt5_nu_max_Sl1 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=1 + !int_k_r_dr_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=2 + !int_k_r_dr_2pt0_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=2 + !int_k_r_dr_0pt5_nu_max_Sl2 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=2 + !int_k_r_dr_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max, l=3 + !int_k_r_dr_2pt0_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max*2, l=3 + !int_k_r_dr_0pt5_nu_max_Sl3 ! integral of k_r*dr where nu < N < Sl for nu = nu_max/2, l=3 + +!---------------------------------------------------------------------------------------------- + +!# energy information + + !total_energy ! at end of step + !log_total_energy ! log(abs(total_energy)) + !total_energy_after_adjust_mass ! after mass adjustments + + ! shorter versions of above + !tot_E + !log_tot_E + + + !total_gravitational_energy + !log_total_gravitational_energy ! log(abs(total_gravitational_energy)) + !total_gravitational_energy_after_adjust_mass + + ! shorter versions of above + !tot_PE + !log_tot_PE + + !total_internal_energy + !log_total_internal_energy + !total_internal_energy_after_adjust_mass + + ! shorter versions of above + !tot_IE + !log_tot_IE + + !total_radial_kinetic_energy + !log_total_radial_kinetic_energy + !total_radial_kinetic_energy_after_adjust_mass + + ! shorter versions of above (does not include rot KE) + !tot_KE + !log_tot_KE + + !total_turbulent_energy + !log_total_turbulent_energy + !total_turbulent_energy_after_adjust_mass + !tot_Et + !log_tot_Et + + !total_energy_foe + + !tot_IE_div_IE_plus_KE + !total_IE_div_IE_plus_KE + + !total_entropy + !total_eps_grav + + !total_energy_sources_and_sinks ! for this step + !total_nuclear_heating + !total_non_nuc_neu_cooling + !total_irradiation_heating + !total_extra_heating ! extra heat integrated over the model times dt (erg) + !total_WD_sedimentation_heating + + !rel_run_E_err + + !rel_E_err + !abs_rel_E_err + !log_rel_E_err + + !tot_e_equ_err + !tot_e_err + + + !error_in_energy_conservation ! for this step + ! = total_energy - (total_energy_start + total_energy_sources_and_sinks) + !cumulative_energy_error ! = sum over all steps of abs(error_in_energy_conservation) + !rel_cumulative_energy_error ! = cumulative_energy_error/total_energy + log_rel_cumulative_energy_error ! = log10 of rel_cumulative_energy_error + log_rel_run_E_err ! shorter name for rel_cumulative_energy_error + + !rel_error_in_energy_conservation ! = error_in_energy_conservation/total_energy + log_rel_error_in_energy_conservation + + !virial_thm_P_avg + !virial_thm_rel_err + !work_inward_at_center + !work_outward_at_surface + + +!---------------------------------------------------------------------------------------------- + + !# rotation + + !total_angular_momentum + log_total_angular_momentum + !i_rot_total ! moment of inertia + + !total_rotational_kinetic_energy + !log_total_rotational_kinetic_energy + !total_rotational_kinetic_energy_after_adjust_mass + +!---------------------------------------------------------------------------------------------- + +!# velocities + + !avg_abs_v_div_cs + !log_avg_abs_v_div_cs + !max_abs_v_div_cs + !log_max_abs_v_div_cs + + !avg_abs_v + !log_avg_abs_v + !max_abs_v + !log_max_abs_v + + !u_surf + !u_surf_km_s + !u_div_csound_surf + !u_div_csound_max + + !infall_div_cs + +!---------------------------------------------------------------------------------------------- + +!# misc + + !e_thermal ! sum over all zones of Cp*T*dm + + !## eos + !logQ_max ! logQ = logRho - 2*logT + 12 + !logQ_min + !gamma1_min + + !## core mixing + !mass_semiconv_core + + !## H-He boundary + + !diffusion_time_H_He_bdy + !temperature_H_He_bdy + + + !## optical depth and opacity + + !one_div_yphot + !log_one_div_yphot + + !log_min_opacity + !min_opacity + + !log_tau_center + + !log_max_tau_conv + !max_tau_conv + !log_min_tau_conv + !min_tau_conv + + !tau_qhse_yrs + + !## other + + !Lsurf_m + !dlnR_dlnM + !h1_czb_mass ! location (in Msun units) of base of 1st convection zone above he core + !kh_mdot_limit + !log_cntr_dr_cm + !min_Pgas_div_P + !surf_c12_minus_o16 ! this is useful for seeing effects of dredge up on AGB + !surf_num_c12_div_num_o16 + + !phase_of_evolution ! Integer mapping to the type of evolution see star_data/public/star_data_def.inc for definitions + + !## MLT++ + !gradT_excess_alpha + !gradT_excess_min_beta + !gradT_excess_max_lambda + + !max_L_rad_div_Ledd + !max_L_rad_div_Ledd_div_phi_Joss + + + !## RTI + !rti_regions + + !## Ni & Co + !total_ni_co_56 + + + !## internal structure constants + + ! this is evaluated assuming a spherical star and does not account for rotation + !apsidal_constant_k2 + + +!---------------------------------------------------------------------------------------------- + +!# accretion + + !k_below_const_q + !q_below_const_q + !logxq_below_const_q + + !k_const_mass + !q_const_mass + !logxq_const_mass + + !k_below_just_added + !q_below_just_added + !logxq_below_just_added + + !k_for_test_CpT_absMdot_div_L + !q_for_test_CpT_absMdot_div_L + !logxq_for_test_CpT_absMdot_div_L + +!---------------------------------------------------------------------------------------------- + +!# Color output + + ! Outputs the bolometric correction (bc) for the star in filter band ``filter'' (case sensitive) + !bc filter + + ! Outputs the absolute magnitude for the star in filter band ``filter'' (case sensitive) + !abs_mag filter + + ! Adds all the bc's to the output + add_bc + + ! Adds all the absolute magnitudes to the output + add_abs_mag + + ! Outputs luminosity in filter band ``filter'' (erg s^-1) (case sensitive) + !lum_band filter + + ! Adds all the filter band luminosities to the output (erg s^-1) + add_lum_band + + ! Outputs log luminosity in filter band ``filter'' (log erg s^-1) (case sensitive) + !log_lum_band filter + + ! Adds all the filter band luminosities to the output (log erg s^-1) + add_log_lum_band + +!---------------------------------------------------------------------------------------------- + +!# RSP + + rsp_DeltaMag ! absolute magnitude difference between minimum and maximum light (mag) + rsp_DeltaR ! R_max - R_min difference in the max and min radius (Rsun) + rsp_GREKM ! fractional growth of the kinetic energy per pulsation period ("nonlinear growth rate") - see equation 5 in MESA5 + rsp_num_periods ! Count of the number of pulsation cycles completed + rsp_period_in_days ! Running period, ie., period between two consecutive values of R_max (days) + rsp_phase ! Running pulsation phase for a cycle + +!---------------------------------------------------------------------------------------------- +!# debugging + + !## retries + num_retries ! total during the run + + !## solver iterations + + num_iters ! same as num_solver_iterations + !num_solver_iterations ! iterations at this step + !total_num_solver_iterations ! total iterations during the run + !avg_num_solver_iters + + !rotation_solver_steps + + !diffusion_solver_steps + !diffusion_solver_iters + + !avg_setvars_per_step + !avg_skipped_setvars_per_step + !avg_solver_setvars_per_step + + !burn_solver_maxsteps + + !total_num_solver_calls_converged + !total_num_solver_calls_failed + !total_num_solver_calls_made + !total_num_solver_relax_calls_converged + !total_num_solver_relax_calls_failed + !total_num_solver_relax_calls_made + !total_num_solver_relax_iterations + + !total_step_attempts + !total_step_redos + !total_step_retries + !total_steps_finished + !total_steps_taken + + !TDC_num_cells + + !## Relaxation steps + !total_relax_step_attempts + !total_relax_step_redos + !total_relax_step_retries + !total_relax_steps_finished + !total_relax_steps_taken + + !## conservation during mesh adjust + !log_mesh_adjust_IE_conservation + !log_mesh_adjust_KE_conservation + !log_mesh_adjust_PE_conservation + + !## amr + !num_hydro_merges + !num_hydro_splits + + !## timing + !elapsed_time ! time since start of run (seconds) + + !## Extras + burning_regions 40 + mixing_regions 40 + mix_relr_regions 40 diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/inlist_rsp_Cepheid b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/inlist_rsp_Cepheid new file mode 100644 index 000000000..a2313a003 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/inlist_rsp_Cepheid @@ -0,0 +1,145 @@ + +&star_job + + show_log_description_at_start = .false. + + create_RSP_model = .true. + + save_model_when_terminate = .true. + save_model_filename = 'rsp_cepheid_6M_cycle0.mod' + + initial_zfracs = 6 + + color_num_files=2 + color_file_names(2)='blackbody_johnson.dat' + color_num_colors(2)=5 + + set_initial_age = .true. + initial_age = 0 + + set_initial_model_number = .true. + initial_model_number = 0 + + set_initial_cumulative_energy_error = .true. + new_cumulative_energy_error = 0d0 + + pgstar_flag = .true. + +/ ! end of star_job namelist + +&eos +/ ! end of eos namelist + +&kap + Zbase = 0.003d0 + + kap_file_prefix = 'a09' + kap_lowT_prefix = 'lowT_fa05_a09p' + kap_CO_prefix = 'a09_co' + +/ ! end of kap namelist + + +&controls +!max_model_number = 2000 +!RSP_alfam = 1d0 + ! limit max_model_number as part of test_suite + ! max_model_number = 1192 ! 16000 + +! RSP controls + +RSP_kick_vsurf_km_per_sec = 5d0 +RSP_fraction_1st_overtone = 0d0 +RSP_fraction_2nd_overtone = 0d0 + +mixing_length_alpha = 1.5d0 + + x_integer_ctrl(1) = -1 !10 ! which period to check + x_ctrl(1) = 12.7 ! expected period (in days) + +RSP_nz = 600 +RSP_nz_outer = 240 + + RSP_mass = 5.9089479 !5.9634671d0 + RSP_Teff = 5623.4d0 !3.75 + RSP_L = 5357.96d0 !3.729 + RSP_X = 0.729525d0 !0.7295d0 + RSP_Z = 0.003032d0 !0.003032d0 + ! Y = 0.267d0 + + +! timesteps for saturation + + !dt_div_min_dr_div_cs_limit = 2d0 + dt_div_min_dr_div_cs_hard_limit = 100d0! i don't like hard limits ~ EbF + min_abs_u_div_cs_for_dt_div_min_dr_div_cs_limit = 0.8d0 + + ! have used these values to do run to saturation, but may not be necessary ~ Bill P. + dt_div_min_dr_div_cs_limit = 4d0!5d0!10d0 + min_q_for_dt_div_min_dr_div_cs_limit = 0.5d0 + max_q_for_dt_div_min_dr_div_cs_limit = 1d0 + min_k_for_dt_div_min_dr_div_cs_limit = 1 + min_abs_du_div_cs_for_dt_div_min_dr_div_cs_limit = 0.001d0 + +! solver + use_gold2_tolerances = .true. + +! output controls + + terminal_show_age_units = 'days' + terminal_show_timestep_units = 'secs' + terminal_show_log_dt = .false. + terminal_show_log_age = .false. + + num_trace_history_values = 2 + trace_history_value_name(1) = 'rel_E_err' + trace_history_value_name(2) = 'log_rel_run_E_err' + + ! for cases in which you have a run that has reached steady pulses + ! and you want to look at plots of just a few periods to see the details, + ! i suggest the following method. interrupt the run soon after + ! it makes a photo. remove or delete LOGS/history.data to force + ! creation of a new one when restart. edit the inlist to set + ! history_interval to 1 to get maximum time resolution. + ! restart the run and let it go for as many periods as desired. + RSP_work_period = 5 + RSP_work_filename = 'work.data' + + photo_interval = 1000 + profile_interval = 4000 + history_interval = 1 + terminal_interval = 200 + +/ ! end of controls namelist + + + +&pgstar + + !pause = .true. + + !pgstar_interval = 20 + + Grid2_win_flag = .true. + + Grid2_title = '4.165 M\d\(2281)\u Z=0.007 Classical Cepheid' + + History_Panels1_xaxis_name='star_age_day' + History_Panels1_max_width = 365 ! only used if > 0. causes xmin to move with xmax. + + ! Grid2_file_flag = .true. + file_digits = 7 + Grid2_file_dir = 'png' + Grid2_file_prefix = 'grid' + Grid2_file_interval = 100 ! output when mod(model_number,Grid2_file_interval)==0 + + !Profile_Panels1_show_grid = .true. + + Profile_Panels1_xaxis_name = 'logtau' + Profile_Panels1_xaxis_reversed = .true. + Profile_Panels1_xmin = -101D0 + Profile_Panels1_xmax = -101D0 + + Profile_Panels1_dymin(4) = 0.02 + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/inlist_rsp_Cepheid_header b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/inlist_rsp_Cepheid_header new file mode 100644 index 000000000..6811dd64e --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/inlist_rsp_Cepheid_header @@ -0,0 +1,46 @@ + +&star_job + + + read_extra_star_job_inlist(1) = .true. + extra_star_job_inlist_name(1) = 'inlist_rsp_Cepheid' + +/ ! end of star_job namelist + + +&eos + + read_extra_eos_inlist(1) = .true. + extra_eos_inlist_name(1) = 'inlist_rsp_Cepheid' + +/ ! end of controls namelist + + +&kap + + read_extra_kap_inlist(1) = .true. + extra_kap_inlist_name(1) = 'inlist_rsp_Cepheid' + +/ ! end of controls namelist + + +&controls + + read_extra_controls_inlist(1) = .true. + extra_controls_inlist_name(1)= 'inlist_rsp_Cepheid' + +/ ! end of controls namelist + + + +&pgstar + + read_extra_pgstar_inlist(1) = .true. + extra_pgstar_inlist_name(1)= 'inlist_rsp_pgstar_default' + + read_extra_pgstar_inlist(2) = .true. + extra_pgstar_inlist_name(2)= 'inlist_rsp_Cepheid' + + + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/inlist_rsp_pgstar_default b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/inlist_rsp_pgstar_default new file mode 100644 index 000000000..5a4be102b --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/inlist_rsp_pgstar_default @@ -0,0 +1,223 @@ +&pgstar + pgstar_interval = 10 + + pgstar_xaxis_label_scale = 0.9 + pgstar_left_yaxis_label_scale = 0.9 + pgstar_right_yaxis_label_scale = 0.9 + + pgstar_xaxis_label_disp = 2.5 + pgstar_left_yaxis_label_disp = 4.2 ! 3.4 + pgstar_right_yaxis_label_disp = 4.4 + + + Grid2_win_width = 8 + Grid2_win_aspect_ratio = 1.2 ! aspect_ratio = height/width + Grid2_num_cols = 3 ! divide plotting region into this many equal width cols + Grid2_num_rows = 8 ! divide plotting region into this many equal height rows + Grid2_num_plots = 6 ! <= 10 + + Grid2_plot_name(1) = 'Profile_Panels2' + Grid2_plot_row(1) = 1 ! number from 1 at top + Grid2_plot_rowspan(1) = 3 ! plot spans this number of rows + Grid2_plot_col(1) = 1 ! number from 1 at left + Grid2_plot_colspan(1) = 2 ! plot spans this number of columns + Grid2_plot_pad_left(1) = -0.02 ! fraction of full window width for padding on left + Grid2_plot_pad_right(1) = 0.12 ! fraction of full window width for padding on right + Grid2_plot_pad_top(1) = -0.02 ! fraction of full window height for padding at top + Grid2_plot_pad_bot(1) = -0.14 ! fraction of full window height for padding at bottom + Grid2_txt_scale_factor(1) = 0.7 ! multiply txt_scale for subplot by this + + Grid2_plot_name(2) = 'History_Panels2' + Grid2_plot_row(2) = 4 ! number from 1 at top + Grid2_plot_rowspan(2) = 3 ! plot spans this number of rows + Grid2_plot_col(2) = 1 ! number from 1 at left + Grid2_plot_colspan(2) = 2 ! plot spans this number of columns + Grid2_plot_pad_left(2) = -0.02 ! fraction of full window width for padding on left + Grid2_plot_pad_right(2) = 0.12 ! fraction of full window width for padding on right + Grid2_plot_pad_top(2) = 0.19 ! fraction of full window height for padding at top + Grid2_plot_pad_bot(2) = -0.06 ! fraction of full window height for padding at bottom + Grid2_txt_scale_factor(2) = 0.7 ! multiply txt_scale for subplot by this + + Grid2_plot_name(3) = 'Text_Summary2' + Grid2_plot_row(3) = 7 ! number from 1 at top + Grid2_plot_rowspan(3) = 2 ! plot spans this number of rows + Grid2_plot_col(3) = 1 ! number from 1 at left + Grid2_plot_colspan(3) = 3 ! plot spans this number of columns + Grid2_plot_pad_left(3) = -0.08 ! fraction of full window width for padding on left + Grid2_plot_pad_right(3) = 0.0 ! fraction of full window width for padding on right + Grid2_plot_pad_top(3) = 0.12 ! fraction of full window height for padding at top + Grid2_plot_pad_bot(3) = -0.04 ! fraction of full window height for padding at bottom + Grid2_txt_scale_factor(3) = 0.17 ! multiply txt_scale for subplot by this + + Grid2_plot_name(6) = 'logL_Teff' + Grid2_plot_row(6) = 1 ! number from 1 at top + Grid2_plot_rowspan(6) = 2 ! plot spans this number of rows + Grid2_plot_col(6) = 3 ! number from 1 at left + Grid2_plot_colspan(6) = 1 ! plot spans this number of columns + Grid2_plot_pad_left(6) = 0.04 ! fraction of full window width for padding on left + Grid2_plot_pad_right(6) = 0.0 ! fraction of full window width for padding on right + Grid2_plot_pad_top(6) = -0.02 ! fraction of full window height for padding at top + Grid2_plot_pad_bot(6) = 0.02 ! fraction of full window height for padding at bottom + Grid2_txt_scale_factor(6) = 0.6 ! multiply txt_scale for subplot by this + logL_Teff_title = '' + + Grid2_plot_name(5) = 'logL_v' + Grid2_plot_row(5) = 3 ! number from 1 at top + Grid2_plot_rowspan(5) = 2 ! plot spans this number of rows + Grid2_plot_col(5) = 3 ! number from 1 at left + Grid2_plot_colspan(5) = 1 ! plot spans this number of columns + Grid2_plot_pad_left(5) = 0.04 ! fraction of full window width for padding on left + Grid2_plot_pad_right(5) = 0.0 ! fraction of full window width for padding on right + Grid2_plot_pad_top(5) = 0.02 ! fraction of full window height for padding at top + Grid2_plot_pad_bot(5) = -0.02 ! fraction of full window height for padding at bottom + Grid2_txt_scale_factor(5) = 0.6 ! multiply txt_scale for subplot by this + logL_v_title = '' + + Grid2_plot_name(4) = 'logL_R' + Grid2_plot_row(4) = 5 ! number from 1 at top + Grid2_plot_rowspan(4) = 2 ! plot spans this number of rows + Grid2_plot_col(4) = 3 ! number from 1 at left + Grid2_plot_colspan(4) = 1 ! plot spans this number of columns + Grid2_plot_pad_left(4) = 0.04 ! fraction of full window width for padding on left + Grid2_plot_pad_right(4) = 0.0 ! fraction of full window width for padding on right + Grid2_plot_pad_top(4) = 0.06 ! fraction of full window height for padding at top + Grid2_plot_pad_bot(4) = -0.06 ! fraction of full window height for padding at bottom + Grid2_txt_scale_factor(4) = 0.6 ! multiply txt_scale for subplot by this + logL_R_title = '' + + Grid2_file_flag = .true. + file_digits = 7 + Grid2_file_dir = 'png' + Grid2_file_prefix = 'grid2' + Grid2_file_interval = 100 ! output when mod(model_number,Grid2_file_interval)==0 + + + History_Panels2_title = '' + History_Panels2_num_panels = 2 + + !History_Panels2_xaxis_name='model_number' + History_Panels2_xaxis_name='day' + History_Panels2_max_width = 40 ! 200 ! only used if > 0. causes xmin to move with xmax. + + History_Panels2_yaxis_name(1) = 'Teff' + History_Panels2_yaxis_reversed(1) = .false. + History_Panels2_ymin(1) = -101d0 ! only used if /= -101d0 + History_Panels2_ymax(1) = -101d0 ! only used if /= -101d0 + History_Panels2_dymin(1) = -1 + + History_Panels2_other_yaxis_name(1) = 'log_L' + History_Panels2_other_yaxis_reversed(1) = .false. + History_Panels2_other_ymin(1) = -101d0 ! only used if /= -101d0 + History_Panels2_other_ymax(1) = -101d0 ! only used if /= -101d0 + History_Panels2_other_dymin(1) = -1 + + History_Panels2_yaxis_name(2) = 'radius' ! 'star_mass' + History_Panels2_yaxis_reversed(2) = .false. + History_Panels2_ymin(2) = -101d0 ! only used if /= -101d0 + History_Panels2_ymax(2) = -101d0 ! only used if /= -101d0 + History_Panels2_dymin(2) = -1 + + History_Panels2_other_yaxis_name(2) = 'v_surf_km_s' + History_Panels2_other_yaxis_reversed(2) = .false. + History_Panels2_other_ymin(2) = -101d0 ! only used if /= -101d0 + History_Panels2_other_ymax(2) = -101d0 ! only used if /= -101d0 + History_Panels2_other_dymin(2) = -1 + + History_Panels2_yaxis_name(3) = 'r_center' ! 'star_mass' + History_Panels2_yaxis_reversed(3) = .false. + History_Panels2_ymin(3) = -101d0 ! only used if /= -101d0 + History_Panels2_ymax(3) = -101d0 ! only used if /= -101d0 + History_Panels2_dymin(3) = -1 + + History_Panels2_other_yaxis_name(3) = 'v_center' + History_Panels2_other_yaxis_reversed(3) = .false. + History_Panels2_other_ymin(3) = -101d0 ! only used if /= -101d0 + History_Panels2_other_ymax(3) = -101d0 ! only used if /= -101d0 + History_Panels2_other_dymin(3) = -1 + + + Profile_Panels2_win_flag = .false. + Profile_Panels2_title = '' + + Profile_Panels2_xaxis_name = 'logtau' + Profile_Panels2_xaxis_reversed = .true. + Profile_Panels2_xmin = -101D0 + Profile_Panels2_xmax = 6.0 ! -101D0 + Profile_Panels2_show_mix_regions_on_xaxis = .true. + !Profile_Panels2_show_grid = .true. + + Profile_Panels2_num_panels = 5 + + Profile_Panels2_yaxis_name(1) = 'v_div_cs' + Profile_Panels2_ymax(1) = -101D0 ! 1 + Profile_Panels2_ymin(1) = -101D0 ! -1 + Profile_Panels2_dymin(1) = 0.1 + Profile_Panels2_other_yaxis_name(1) = 'vel_km_per_s' + Profile_Panels2_other_ymax(1) = -101D0 ! 2e6 + Profile_Panels2_other_ymin(1) = -101D0 ! -2e6 + Profile_Panels2_other_dymin(1) = 0.1 + + Profile_Panels2_yaxis_name(2) = 'lum_conv' + Profile_Panels2_ymax(2) = -101D0 ! 3.7 + Profile_Panels2_ymin(2) = -101D0 ! 3.1 + Profile_Panels2_dymin(2) = 0.02 + Profile_Panels2_other_yaxis_name(2) = 'logL' + Profile_Panels2_other_ymax(2) = -101D0 ! + Profile_Panels2_other_ymin(2) = -101D0 ! + + Profile_Panels2_yaxis_name(3) = 'logtau' + Profile_Panels2_other_yaxis_name(3) = 'opacity' + + Profile_Panels2_yaxis_name(4) = 'dq' + Profile_Panels2_ymax(4) = -101D0 + Profile_Panels2_ymin(4) = -101D0 + Profile_Panels2_other_yaxis_name(4) = 'zone' + Profile_Panels2_other_ymax(4) = 70!-101D0 ! + Profile_Panels2_other_ymin(4) = -101D0 ! + Profile_Panels2_yaxis_log(4) = .true. + + Profile_Panels2_yaxis_name(5) = 'logT' + Profile_Panels2_other_yaxis_name(5) = 'free_e' + + Profile_Panels2_yaxis_name(6) = 'log_dt_div_tau_conv' + Profile_Panels2_ymax(6) = -101D0 ! + Profile_Panels2_ymin(6) = -101D0 ! + Profile_Panels2_other_yaxis_name(6) = '' + Profile_Panels2_other_ymax(6) = 1d-3 + Profile_Panels2_other_ymin(6) = -1d-3 + + + Profile_Panels2_file_flag = .false. + Profile_Panels2_file_dir = 'png' + Profile_Panels2_file_prefix = 'profile_panels1_' + Profile_Panels2_file_interval = 1 + + Text_Summary2_num_rows = 4 ! <= 20 + Text_Summary2_num_cols = 4 ! <= 20 + Text_Summary2_name(:,:) = '' + + Text_Summary2_name(1,1) = 'model_number' + Text_Summary2_name(2,1) = 'time_step_sec' + Text_Summary2_name(3,1) = 'log_rel_run_E_err' + Text_Summary2_name(4,1) = 'period' + Text_Summary2_name(5,1) = '' + + Text_Summary2_name(1,2) = 'v_surf_km_s' + Text_Summary2_name(2,2) = 'v_div_cs' + Text_Summary2_name(3,2) = 'radius' + Text_Summary2_name(4,2) = 'delta_R' + Text_Summary2_name(5,2) = '' + + Text_Summary2_name(1,3) = 'log_Teff' + Text_Summary2_name(2,3) = 'Teff' + Text_Summary2_name(3,3) = 'log_L' + Text_Summary2_name(4,3) = 'delta_logL' + Text_Summary2_name(5,3) = '' + + Text_Summary2_name(1,4) = 'num_zones' + Text_Summary2_name(2,4) = 'num_retries' + Text_Summary2_name(3,4) = 'num_periods' + Text_Summary2_name(4,4) = 'growth' + Text_Summary2_name(5,4) = '' + +/ ! end of pgstar namelist diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/make/makefile b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/make/makefile new file mode 100644 index 000000000..f2017faed --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/make/makefile @@ -0,0 +1,5 @@ + + +STAR = star + +include $(MESA_DIR)/star/work_standard_makefile diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/mk b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/mk new file mode 100755 index 000000000..aec7a5195 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/mk @@ -0,0 +1,13 @@ +#!/bin/bash + +function check_okay { + if [ $? -ne 0 ] + then + echo + echo "FAILED" + echo + exit 1 + fi +} + +cd make; make; check_okay diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/profile_columns.list b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/profile_columns.list new file mode 100644 index 000000000..9aef616c7 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/profile_columns.list @@ -0,0 +1,965 @@ +! profile_columns.list -- determines the contents of star model profiles +! you can use a non-standard version by setting profile_columns_file in your inlist + +! units are cgs unless otherwise noted. + +! reorder the following names as desired to reorder columns. +! comment out the name to omit a column (fewer columns => less IO => faster running). +! remove '!' to restore a column. + +! if you have a situation where you want a non-standard set of columns, +! make a copy of this file, edit as desired, and give the new filename in your inlist +! as profile_columns_file. if you are just adding columns, you can 'include' this file, +! and just list the additions in your file. note: to include the standard default +! version, use include '' -- the 0 length string means include the default file. + +! if you need to have something added to the list of options, let me know.... + +! the first few lines of the profile contain general info about the model. +! for completeness, those items are described at the end of this file. + + +! note: you can include another list by doing +! include 'filename' +! include '' means include the default standard list file + + +! the following lines of the profile contain info for 1 zone per row, surface to center. + +! minimal set of enabled columns: + + zone ! numbers start with 1 at the surface + mass ! m/Msun. mass coordinate of outer boundary of cell. + logR ! log10(radius/Rsun) at outer boundary of zone + logT ! log10(temperature) at center of zone + logRho ! log10(density) at center of zone + logP ! log10(pressure) at center of zone + x_mass_fraction_H + y_mass_fraction_He + z_mass_fraction_metals + + +! everything below this line is deactivated + + +!# Structure + !logM ! log10(m/Msun) + !log_mass + !dm ! cell mass (grams) + !dm_bar ! boundary mass (grams) average of adjacent dm's + logdq ! log10(dq) + !log_dq + dq_ratio ! dq(k-1)/dq(k) + q ! fraction of star mass interior to outer boundary of this zone + log_q ! log10(q) + !xq + + !grav ! gravitational acceleration (cm sec^2) + !log_g ! log10 gravitational acceleration (cm sec^2) + !g_div_r ! grav/radius (sec^2) + !r_div_g ! radius/grav (sec^-2) + !cgrav_factor ! = cgrav(k)/standard_cgrav + vel_km_per_s ! velocity at outer boundary of zone (km/s) -- 0 if no velocity variable + + radius ! radius at outer boundary of zone (in Rsun units) + !radius_cm ! radius at outer boundary of zone (in centimeters) + !radius_km ! radius at outer boundary of zone (in kilometers) + !logR_cm ! log10 radius at outer boundary of zone (in centimeters) + !rmid ! radius at center by mass of zone (in Rsun units) + !r_div_R ! fraction of total radius + + velocity ! velocity at outer boundary of zone (cm/s) -- 0 if no velocity variable + !v_div_r ! velocity divided by radius + !v_times_t_div_r + !rho_times_r3 ! at face + !log_rho_times_r3 ! at face + !scale_height ! in Rsun units + pressure_scale_height ! in Rsun units + + !m_div_r ! gm/cm + !dmbar_m_div_r + !log_dmbar_m_div_r + !mass_grams ! mass coordinate of outer boundary of cell in grams + !mmid ! mass at midpoint of cell (average of mass coords of the cell boundaries) Msun units. + + !m_grav ! total enclosed gravitational mass. Msun units. + !m_grav_div_m_baryonic ! mass_gravitational/mass at cell boundary + !mass_correction_factor ! dm_gravitational/dm (dm is baryonic mass of cell) + + !xm ! mass exterior to point (Msun units) + dq ! mass of zone as a fraction of total star mass + !logxq ! log10(1-q) + !logxm ! log10(xm) + + !xr ! radial distance from point to surface (Rsun) + !xr_cm ! radial distance from point to surface (cm) + !xr_div_R ! radial distance from point to surface in units of star radius + !log_xr ! log10 radial distance from point to surface (Rsun) + !log_xr_cm ! log10 radial distance from point to surface (cm) + !log_xr_div_R ! log10 radial distance from point to surface in units of star radius + + !dr ! r(outer edge) - r(inner edge); radial extent of cell in cm. + !log_dr ! log10 cell width (cm) + !dv ! v(inner edge) - v(outer edge); rate at which delta_r is shrinking (cm/sec). + + dt_dv_div_dr ! dt*dv/dr; need to have this << 1 for every cell + !dr_div_R ! cell width divided by star R + !log_dr_div_R ! log10 cell width divided by star R + !dr_div_rmid ! cell width divided by rmid + !log_dr_div_rmid ! log(dr_div_rmid) + + !dr_div_cs ! cell sound crossing time (sec) + !log_dr_div_cs ! log10 cell sound crossing time (sec) + dr_div_cs_yr ! cell sound crossing time (years) + !log_dr_div_cs_yr ! log10 cell sound crossing time (years) + + !acoustic_radius ! sound time from center to outer cell boundary (sec) + !log_acoustic_radius ! log10(acoustic_radius) (sec) + !acoustic_depth ! sound time from surface to outer cell boundary (sec) + !log_acoustic_depth ! log10(acoustic_depth) (sec) + !acoustic_r_div_R_phot + + !cell_collapse_time ! only set if doing explicit hydro + ! time (seconds) for cell inner edge to catch cell outer edge at current velocities + ! 0 if distance between inner and outer is increasing + !log_cell_collapse_time ! log of cell_collapse_time + + !compression_gradient + + + +!# Thermodynamics + !temperature ! temperature at center of zone + !logT_face ! log10(temperature) at outer boundary of zone + !logT_bb ! log10(black body temperature) at outer boundary of zone + !logT_face_div_logT_bb + + energy ! internal energy (ergs/g) + !logE ! log10(specific internal energy) at center of zone + !rho ! density + !density ! rho + + entropy ! specific entropy divided by (avo*kerg) + !logS ! log10(specific entropy) + !logS_per_baryon ! log10(specific entropy per baryon / kerg) + + !pressure ! total pressure at center of zone (pgas + prad) + !prad ! radiation pressure at center of zone + !pgas ! gas pressure at center of zone (electrons and ions) + logPgas ! log10(pgas) + pgas_div_ptotal ! pgas/pressure + + eta ! electron degeneracy parameter (eta >> 1 for significant degeneracy) + mu ! mean molecular weight per gas particle (ions + free electrons) + + grada ! dlnT_dlnP at constant S + !dE_dRho ! at constant T + !cv ! specific heat at constant volume + !cp ! specific heat at constant total pressure + + !log_CpT + gamma1 ! dlnP_dlnRho at constant S + !gamma3 ! gamma3 - 1 = dlnT_dlnRho at constant S + !gam ! plasma interaction parameter (> 160 or so means starting crystallization) + free_e ! free_e is mean number of free electrons per nucleon + !logfree_e ! log10(free_e), free_e is mean number of free electrons per nucleon + !chiRho ! dlnP_dlnRho at constant T + !chiT ! dlnP_dlnT at constant Rho + + csound ! sound speed + log_csound + !csound_face ! sound speed (was previously called csound_at_face) + !cs_at_cell_bdy ! sound speed at cell boundary (csound is at cell center) + !v_div_cs ! velocity divided by sound speed + v_div_csound ! velocity divided by sound speed + !div_v + + !thermal_time_to_surface ! in seconds + !log_thermal_time_to_surface + !t_rad + !log_t_rad + !log_t_sound + !log_t_thermal + + !eos_phase + !eos_frac_OPAL_SCVH + !eos_frac_HELM + !eos_frac_Skye + !eos_frac_PC + !eos_frac_FreeEOS + !eos_frac_CMS + !eos_frac_ideal + + !pgas_div_p + !prad_div_pgas + !prad_div_pgas_div_L_div_Ledd + !pressure_scale_height_cm + + !eps_grav_composition_term + eps_grav_plus_eps_mdot + + !chiRho_for_partials + !chiT_for_partials + !rel_diff_chiRho_for_partials + !rel_diff_chiT_for_partials + + !latent_ddlnRho + !latent_ddlnT + + !log_P_face + !log_Ptrb + !log_cp_T_div_t_sound + + !QQ + + +!# Mass accretion + eps_grav ! -T*ds/dt (negative for expansion) + !log_abs_eps_grav_dm_div_L + !log_abs_v ! log10(abs(velocity)) (cm/s) + !log_mdot_cs + !log_mdot_v + eps_mdot + !env_eps_grav + !xm_div_delta_m + !log_xm_div_delta_m + + +!# Nuclear energy generation + !signed_log_eps_grav ! sign(eps_grav)*log10(max(1,abs(eps_grav))) + !signed_log_eps_nuc + net_nuclear_energy ! erg/gm/s from nuclear reactions minus all neutrino losses + ! The value plotted is net_nuclear_energy = sign(val)*log10(max(1,abs(val))) + ! where val = net nuclear energy minus all neutrino losses. + net_energy ! net_energy + eps_grav. + ! The value plotted is net_energy = sign(val)*log10(max(1,abs(val))) + ! where val = net nuclear energy plus eps_grav minus all neutrino losses. + eps_nuc_plus_nuc_neu + !eps_nuc_minus_non_nuc_neu + !eps_nuc_start + + eps_nuc ! ergs/g/sec from nuclear reactions (including losses to reaction neutrinos) + !log_abs_eps_nuc + !d_lnepsnuc_dlnd + !d_epsnuc_dlnd + !deps_dlnd_face + ! (was previously called deps_dlnd_at_face) + !d_lnepsnuc_dlnT + !d_epsnuc_dlnT + !deps_dlnT_face + ! (was previously called deps_dlnT_at_face) + !eps_nuc_neu_total ! erg/gm/sec as neutrinos from nuclear reactions + + non_nuc_neu ! non-nuclear-reaction neutrino losses + !nonnucneu_plas ! plasmon neutrinos (for collective reactions like gamma_plasmon => nu_e + nubar_e) + !nonnucneu_brem ! bremsstrahlung (for reactions like e- + (z,a) => e- + (z,a) + nu + nubar) + !nonnucneu_phot ! photon neutrinos (for reactions like e- + gamma => e- + nu_e + nubar_e) + !nonnucneu_pair ! pair production (for reactions like e+ + e- => nu_e + nubar_e) + !nonnucneu_reco ! recombination neutrinos (for reactions like e- (continuum) => e- (bound) + nu_e + nubar_e) + + ! ergs/g/sec for reaction categories + add_reaction_categories ! this adds all the reaction categories + ! NOTE: you can list specific categories by giving their names (from chem_def) + pp + cno + tri_alpha + !c_alpha + !n_alpha + !o_alpha + !ne_alpha + !na_alpha + !mg_alpha + !si_alpha + !s_alpha + !ar_alpha + !ca_alpha + !ti_alpha + !fe_co_ni + !c12_c12 + !c12_o16 + !o16_o16 + !photo + !pnhe4 + !other + + ! adds columns for all of the reactions that are in the current net + ! Note that if using op_split_burn=.true. then zones which have been split will report 0 for thier rates + !add_raw_rates ! raw reaction rates, reactions/second + !add_screened_rates ! screened reaction rates reactions/second + !add_eps_nuc_rates ! Nuclear energy (minus neutrino losses) released erg/s + !add_eps_neu_rates ! Neutrino losses erg/s + + ! individual reactions (as many as desired) + ! use list_net_reactions = .true. in star_job to list all reactions in the current net + ! reactions/second + !raw_rate r_h1_h1_ec_h2 + !raw_rate r_h1_h1_wk_h2 + + !burn_num_iters ! Number of split_burn iterations taken + !burn_avg_epsnuc + !log_burn_avg_epsnuc + +!# Composition + !x_mass_fraction_H + !y_mass_fraction_He + !z_mass_fraction_metals + abar ! average atomic weight (g/mole) + !zbar ! average charge + !z2bar ! average charge^2 + ye ! average charge per baryon = proton fraction + + x ! hydrogen mass fraction + !log_x + y ! helium mass fraction + !log_y + z ! metallicity + !log_z ! metallicity + + add_abundances ! this adds all of the isos that are in the current net + ! NOTE: you can list specific isotopes by giving their names (from chem_def) + !h1 + !he3 + !he4 + !c12 + !n14 + !o16 + + !add_log_abundances ! this adds log10 of all of the isos that are in the current net + ! NOTE: you can list specific isotopes by giving their names (from chem_def) + !log h1 + !log he3 + !log he4 + !log c12 + !log n14 + !log o16 + + ! log concentration of species + ! concentration = number density / number density of electrons + ! Ci = (Xi/Ai) / sum(Zi*Xi/Ai) [see Thoul et al, ApJ 421:828-842, 1994] + !log_concentration h1 + !log_concentration he4 + + + ! typical charge for given species + ! (used by diffusion) + !typical_charge he4 + !typical_charge c12 + !typical_charge fe52 + + ! ionization state for given species + ! (same as typical charge, except that it's unsmoothed) + !ionization he4 + !ionization c12 + !ionization fe52 + + !cno_div_z ! abundance of c12, n14, and o16 as a fraction of total z + + + + +!# Opacity + !opacity ! opacity measured at center of zone + log_opacity ! log10(opacity) + !dkap_dlnrho_face ! partial derivative of opacity wrt. ln rho (at T=const) at outer edge of cell + ! (was previously called dkap_dlnrho_at_face) + !dkap_dlnT_face ! partial derivative of opacity wrt. ln T (at rho=const) at outer edge of cell + ! (was previously called dkap_dlnT_at_face) + !kap_frac_lowT ! fraction of opacity from lowT tables + !kap_frac_highT ! fraction of opacity from highT tables + !kap_frac_Type2 ! fraction of opacity from Type2 tables + !kap_frac_Compton ! fraction of opacity from Compton_Opacity + !kap_frac_op_mono ! fraction of opacity from OP mono + + !log_kap + !log_kap_times_factor + + !log_c_div_tau + !xtau + !xlogtau + !logtau_sub_xlogtau + +!# Luminosity + luminosity ! luminosity at outer boundary of zone (in Lsun units) + !logL ! log10(max(1d-2,L/Lsun)) + !log_Lrad + log_Ledd ! log10(Leddington/Lsun) -- local Ledd, 4 pi clight G m / kap + !log_L_div_Ledd ! log10(max(1d-12,L/Leddington)) + log_Lrad_div_Ledd + !log_Lrad_div_L + !signed_log_power ! sign(L)*log10(max(1,abs(L))) + + !lum_adv + lum_conv + !lum_conv_MLT + lum_div_Ledd + !lum_erg_s + !lum_plus_lum_adv + lum_rad + + !log_L_div_CpTMdot + !log_abs_lum_erg_s + + !L + !Lc + Lc_div_L + !Lr + !Lr_div_L + !Lt + !Lt_div_L + +!# Energetics + !total_energy ! specific total energy of cell (ergs/g). internal+potential+kinetic+rotation. + !cell_specific_IE + !cell_specific_KE + !cell_IE_div_IE_plus_KE + !cell_KE_div_IE_plus_KE + + !cell_ie_div_star_ie + !cell_internal_energy_fraction + !cell_internal_energy_fraction_start + !cell_specific_PE + + !log_cell_ie_div_star_ie + !log_cell_specific_IE + + ergs_eps_grav_plus_eps_mdot + ergs_error + !ergs_error_integral + ergs_mdot + !ergs_rel_error_integral + !dm_eps_grav + + !dE + + !etrb + log_etrb + !extra_grav + log_rel_E_err + + !total_energy_sign + +!# Convection + !mlt_mixing_length ! mixing length for mlt (cm) + mlt_mixing_type ! value returned by mlt + mlt_Pturb + !alpha_mlt + + conv_vel ! convection velocity (cm/sec) + log_conv_vel ! log10 convection velocity (cm/sec) + + !conv_L_div_L + log_conv_L_div_L + !lum_conv_div_lum_rad + !lum_rad_div_L_Edd + !lum_conv_div_lum_Edd + lum_conv_div_L + lum_rad_div_L + Frad_div_cUrad ! Frad/(C*Urad), must be < 1 to not violate c. + !flux_limit_lambda + !flux_limit_R + !lum_rad_div_L_Edd_sub_fourPrad_div_PchiT ! density increases outward if this is > 0 + ! see Joss, Salpeter, and Ostriker, "Critical Luminosity", ApJ 181:429-438, 1973. + + gradT ! mlt value for required temperature gradient dlnT/dlnP + + gradr ! dlnT/dlnP required for purely radiative transport + !grad_temperature ! smoothed dlnT/dlnP at cell boundary + !grad_density ! smoothed dlnRho/dlnP at cell boundary + + gradL ! gradient for Ledoux criterion for convection + !sch_stable ! 1 if grada > gradr, 0 otherwise + !ledoux_stable ! 1 if gradL > gradr, 0 otherwise + + !grada_sub_gradT + gradT_sub_grada ! gradT-grada at cell boundary + gradT_div_grada ! gradT/grada at cell boundary + + !gradr_sub_gradT + !gradT_sub_gradr ! gradT-gradr at cell boundary + !gradT_div_gradr ! gradT/gradr at cell boundary + + !log_gradT_div_gradr ! log10 gradT/gradr at cell boundary + log_mlt_Gamma ! convective efficiency + conv_vel_div_csound ! convection velocity divided by sound speed + !conv_vel_div_L_vel ! L_vel is velocity needed to carry L by convection; L = 4*pi*r^2*rho*vel**3 + log_mlt_D_mix ! log10 diffusion coefficient for mixing from mlt (cm^2/sec) + + !gradr_div_grada ! gradr/grada_face; > 1 => Schwarzschild unstable for convection + !gradr_sub_grada ! gradr - grada_face; > 0 => Schwarzschild unstable for convection + + !gradL_sub_gradr + !gradP_div_rho + !gradT_excess_effect + !gradT_rel_err + !gradT_sub_a + !grada_face + !grada_sub_gradr + !diff_grads + !log_diff_grads + + !mlt_D + !mlt_Gamma + mlt_Y_face + !mlt_Zeta + !mlt_gradT + !mlt_log_abs_Y + !mlt_vc + !log_mlt_vc + !dvc_dt_TDC_div_g + + !superad_reduction_factor + !conv_vel_div_mlt_vc + + !log_Lconv + !log_Lconv_div_L + +!# Mixing + mixing_type ! mixing types are defined in mesa/const/public/const_def + log_D_mix ! log10 diffusion coefficient for mixing in units of cm^2/second (Eulerian) + !log_D_mix_non_rotation + !log_D_mix_rotation + + log_D_conv ! D_mix for regions where mix_type = convective_mixing + !log_D_leftover ! D_mix for regions where mix_type = leftover_convective_mixing + log_D_semi ! D_mix for regions where mix_type = semiconvective_mixing + log_D_ovr ! D_mix for regions where mix_type = overshoot_mixing + log_D_thrm ! D_mix for regions where mix_type = thermohaline_mixing + !log_D_minimum ! D_mix for regions where mix_type = minimum_mixing + !log_D_rayleigh_taylor ! D_mix for regions where mix_type = rayleigh_taylor_mixing + !log_D_anon ! D_mix for regions where mix_type = anonymous_mixing + !log_D_omega + + !log_sig_mix ! sig(k) is mixing flow across face k in (gm sec^1) + ! sig(k) = D_mix*(4*pi*r(k)**2*rho_face)**2/dmavg + + !dominant_isoA_for_thermohaline + !dominant_isoZ_for_thermohaline + !gradL_composition_term + + !mix_type + + + +!# Optical Depth + tau ! optical depth + !log_column_depth ! log10 column depth, exterior mass / area (g cm^-2) + !log_radial_depth ! log10 radial distance to surface (cm) + !logtau ! log10(optical depth) at cell face + !tau_eff ! tau that gives the local P == P_atm if this location at surface + ! tau_eff = kap*(P/g - Pextra_factor*(L/M)/(6*pi*clight*cgrav)) + !tau_eff_div_tau + + + +!# Rotation + omega ! angular velocity = j_rot/i_rot + !log_omega + log_j_rot + !log_J_div_M53 ! J is j*1e-15 integrated from center; M53 is m^(5/3) + log_J_inside ! J_inside is j_rot integrated from center + !shear ! -dlnomega/dlnR + !log_abs_shear ! log10(abs(dlnomega/dlnR)) + !richardson_number + i_rot ! specific moment of inertia at cell boundary + !j_rot ! specific angular momentum at cell boundary + !v_rot ! rotation velocity at cell boundary (km/sec) + !w_div_w_crit_roche !ratio of rotational velocity to keplerian at the equator + !without the contribution from the Eddington factor + fp_rot ! rotation factor for pressure + ft_rot ! rotation factor for temperature + !ft_rot_div_fp_rot ! gradr factor + + !log_am_nu_non_rot ! log10(am_nu_non_rot) + !log_am_nu_rot ! log10(am_nu_rot) + log_am_nu ! log10(am_nu_non_rot + am_nu_rot) + + !r_polar ! (Rsun) + !log_r_polar ! log10 (Rsun) + !r_equatorial ! (Rsun) + !log_r_equatorial ! log10 (Rsun) + !r_e_div_r_p ! equatorial/r_polar + !omega_crit ! breakup angular velocity = sqrt(G M / equatorial^3) + !omega_div_omega_crit + + !am_log_nu_omega ! for diffusion of omega + !am_log_nu_j ! for diffusion of angular momentum + + !am_log_nu_rot ! diffusion of angular momentum driven by rotation + !am_log_nu_non_rot ! diffusion driven by other sources, e.g. convection + + !am_log_sig_omega ! for diffusion of omega + !am_log_sig_j ! for diffusion of angular momentum + !am_log_sig ! == am_log_sig_omega + + !am_log_D_visc ! diffusion coeff for kinematic viscosity + !am_log_D_DSI ! diffusion coeff for dynamical shear instability + !am_log_D_SH ! diffusion coeff for Solberg-Hoiland instability + !am_log_D_SSI ! diffusion coeff for secular shear instability + !am_log_D_ES ! diffusion coeff for Eddington-Sweet circulation + !am_log_D_GSF ! diffusion coeff for Goldreich-Schubert-Fricke instability + !am_log_D_ST ! Spruit dynamo mixing diffusivity + !am_log_nu_ST ! Spruit dynamo effective viscosity + + !dynamo_log_B_r ! (Gauss) + !dynamo_log_B_phi ! (Gauss) + + !am_domega_dlnR + !log_abs_dlnR_domega + + !w_div_w_crit_roche2 + + +!# Diffusion + ! electric field from element diffusion calculation + !e_field + !log_e_field + + ! gravitational field from element diffusion calculation + !g_field_element_diffusion + !log_g_field_element_diffusion + + !eE_div_mg_element_diffusion + !log_eE_div_mg_element_diffusion + + ! element diffusion velocity for species + !edv h1 + !edv he4 + !edv o16 + + ! Energy generated by Ne22 sedimentation. + !eps_WD_sedimentation + !log_eps_WD_sedimentation + + !eps_diffusion + !log_eps_diffusion + + !diffusion_D h1 ! self diffusion coeff + !diffusion_dX h1 ! change in h1 mass fraction from diffusion + !diffusion_dX he4 ! change in he4 mass fraction from diffusion + !diffusion_dX n20 ! change in n20 mass fraction from diffusion + + !v_rad h1 ! velocity from radiative levitation + !v_rad he4 ! velocity from radiative levitation + !v_rad ne20 ! velocity from radiative levitation + + !log_g_rad h1 ! log10 acceleration from radiative levitation + !log_g_rad he4 ! log10 acceleration from radiative levitation + !log_g_rad ne20 ! log10 acceleration from radiative levitation + +!# Phase Separation + !eps_phase_separation + +!# Oscillations + brunt_N2 ! brunt-vaisala frequency squared + brunt_N2_structure_term + brunt_N2_composition_term + !log_brunt_N2_structure_term + !log_brunt_N2_composition_term + !brunt_A ! = N^2*r/g + !brunt_A_div_x2 ! x = r(k)/r(1) + !brunt_N2_dimensionless ! N2 in units of 3GM/R^3 + !brunt_N_dimensionless ! N in units of sqrt(3GM/R^3) + !brunt_frequency ! cycles per day + !brunt_N ! sqrt(abs(brunt_N2)) + !log_brunt_N ! log10(brunt_N) + !log_brunt_N2 ! log10(brunt_N2) + !log_brunt_N2_dimensionless ! log10(brunt_N2_dimensionless) + + !brunt_B ! smoothed numerical difference + !brunt_nonB ! = grada - gradT + !log_brunt_B ! smoothed numerical difference + !log_brunt_nonB ! = grada - gradT + + !sign_brunt_N2 ! sign of brunt_N2 (+1 for Ledoux stable; -1 for Ledoux unstable) + !brunt_nu ! brunt_frequency in microHz + !log_brunt_nu ! brunt_frequency in microHz + + !lamb_S ! lamb frequency for l=1: S = sqrt(2)*csound/r (rad/s) + !lamb_S2 ! squared lamb frequency for l=1: S2 = 2*(csound/r)^2 (rad^2/s^2) + + !lamb_Sl1 ! lamb frequency for l=1; = sqrt(2)*csound/r (microHz) + !lamb_Sl2 ! lamb frequency for l=2; = sqrt(6)*csound/r (microHz) + !lamb_Sl3 ! lamb frequency for l=3; = sqrt(12)*csound/r (microHz) + !lamb_Sl10 ! lamb frequency for l=10; = sqrt(110)*csound/r (microHz) + + !log_lamb_Sl1 ! log10(lamb_Sl1) + !log_lamb_Sl2 ! log10(lamb_Sl2) + !log_lamb_Sl3 ! log10(lamb_Sl3) + !log_lamb_Sl10 ! log10(lamb_Sl10) + + !brunt_N_div_r_integral ! integral from center of N*dr/r + !k_r_integral ! integral from center of k_r*dr + !brunt_N2_sub_omega2 + !sl2_sub_omega2 + + +!# RSP + + rsp_Chi ! dlnP_dlnRho + rsp_Et ! Specific turbulent energy + rsp_logEt ! Log specific turbulent energy + rsp_erad ! Specific internal (radiative) energy + rsp_log_erad ! Log specific internal (radiative) energy + rsp_Hp_face ! Pressure scale height at cell face + rsp_Lc ! Convective luminosity + rsp_Lc_div_L ! Convective luminosity div total luminosity + rsp_Lr ! Radiative luminosity + rsp_Lr_div_L ! Radiative luminosity div total luminosity + rsp_Lt ! Turbulent luminosity + rsp_Lt_div_L ! Turbulent luminosity div total luminosity + rsp_Pt ! Turbulent pressure, p_t, see Table 1 in MESA5 + rsp_Uq ! Viscous momentum transfer rate, U_q, see Table 1 in MESA5 + rsp_Eq ! Viscous energy transfer rate, epsilon_q, see Table 1 in MESA5 + rsp_Pvsc ! Artificial viscosity, p_av, see Table 1 in MESA5 + rsp_gradT ! Temperature gradient + rsp_Y_face ! Superadiabatic gradient at cell face, Y_sag, see Table 1 in MESA5 + rsp_damp ! Turbulent dissipation, D, see Table 1 in MESA5 + rsp_dampR ! Radiative cooling, D_r, see Table 1 in MESA5 + rsp_sink ! Sum of turbulent dissipation and radiative cooling terms + rsp_src ! Source function, S, see Table 1 in MESA5 + rsp_src_snk ! Convective coupling, C, see Table 1 in MESA5 + rsp_heat_exchange_timescale ! 1d0/(clight * opacity * density) + rsp_log_heat_exchange_timescale + rsp_log_dt_div_heat_exchange_timescale ! Ratio of time step to heat exchange timescale + w + log_w + + !COUPL + !DAMP + !DAMPR + !SOURCE + !Chi + !Eq + !Hp_face + !PII_face + !Ptrb + !Pvsc + !Uq + !Y_face + +!# RTI + + !RTI_du_diffusion_kick + !alpha_RTI + !boost_for_eta_RTI + !dedt_RTI + !dudt_RTI + !eta_RTI + !log_alpha_RTI + !log_boost_for_eta_RTI + !log_eta_RTI + !log_etamid_RTI + !log_lambda_RTI_div_Hrho + !log_sig_RTI + !log_sigmid_RTI + !log_source_RTI + !log_source_minus_alpha_RTI + !log_source_plus_alpha_RTI + !source_minus_alpha_RTI + !source_plus_alpha_RTI + !lambda_RTI + +!# Hydrodynamics + + + !v + !v_div_v_escape + !v_div_vesc + !v_kms + !log_v_escape + + !u + !u_face + + !P_face + + +!# Extras + !extra_heat + !extra_L ! extra_heat integrated from center (Lsun) + !log_extra_L ! log10 integrated from center (Lsun) + !log_irradiation_heat + + !extra_jdot ! set in other_torque routine + !extra_omegadot ! set in other_torque routine + + !extra_opacity_factor ! set in other_opacity_factor routine + + ! diffusion factor profile for species, set in other_diffusion_factor routine + !extra_diffusion_factor h1 + !extra_diffusion_factor he4 + !extra_diffusion_factor o16 + + + +!# Miscellaneous + + !dlog_h1_dlogP ! (log(h1(k)) - log(h1(k-1)))/(log(P(k)) - log(P(k-1))) + !dlog_he3_dlogP + !dlog_he4_dlogP + !dlog_c12_dlogP + !dlog_c13_dlogP + !dlog_n14_dlogP + !dlog_o16_dlogP + !dlog_ne20_dlogP + !dlog_mg24_dlogP + !dlog_si28_dlogP + + !dlog_pp_dlogP + !dlog_cno_dlogP + !dlog_3alf_dlogP + + !dlog_burn_c_dlogP + !dlog_burn_n_dlogP + !dlog_burn_o_dlogP + + !dlog_burn_ne_dlogP + !dlog_burn_na_dlogP + !dlog_burn_mg_dlogP + + !dlog_cc_dlogP + !dlog_co_dlogP + !dlog_oo_dlogP + + !dlog_burn_si_dlogP + !dlog_burn_s_dlogP + !dlog_burn_ar_dlogP + !dlog_burn_ca_dlogP + !dlog_burn_ti_dlogP + !dlog_burn_cr_dlogP + !dlog_burn_fe_dlogP + + !dlog_pnhe4_dlogP + !dlog_photo_dlogP + !dlog_other_dlogP + + !logR_kap ! logR = logRho - 3*logT + 18 ; used in kap tables + !logW ! logW = logPgas - 4*logT + !logQ ! logQ = logRho - 2*logT + 12 + !logV ! logV = logRho - 0.7*logE + 20 + + !log_CpT_absMdot_div_L ! log10(s% Cp(k)*s% T(k)*abs(s% mstar_dot)/s% L(k)) + + !delta_r ! r - r_start, change during step + !delta_L ! L - L_start, change during step + !delta_cell_vol ! cell_vol - cell_vol_start, change during step + !delta_entropy ! entropy - entropy_start, change during step (does not include effects of diffusion) + !delta_T ! T - T_start, change during step + !delta_rho ! rho - rho_start, change during step + !delta_eps_nuc ! eps_nuc - eps_nuc_start, change during step + !delta_mu ! mu - mu_start, change during step + + !zFe ! mass fraction of "Fe" = Fe+Co+Ni + !log_zFe + !dPdr_dRhodr_info + !log_sig_raw_mix + + !d_u_div_rmid + !d_u_div_rmid_start + !d_v_div_r_dm + !d_v_div_r_dr + + !dlnP_dlnR + !dlnRho_dlnR + !dlnRho_dr + !dlnX_dr + !dlnY_dr + !dlogR + !dPdr_div_grav + !dPdr_info + !dRhodr_info + !dRstar_div_dr + !dr_ratio + !dm_eps_grav + !dr_ratio + !dt_cs_div_dr + !dt_div_tau_conv + !dt_times_conv_vel_div_mixing_length + log_dt_cs_div_dr + !log_dt_div_tau_conv + !log_dt_times_conv_vel_div_mixing_length + !log_du_kick_div_du + !du + !dvdt_dPdm + !dvdt_grav + + !tau_conv + !tau_cool + !tau_epsnuc + !tau_qhse + + !max_abs_xa_corr + + !tdc_num_iters + + !k + + +! the first few lines of the profile contain general info about the model. +! for completeness, those items are described here. + + ! initial mass and Z + ! initial_mass + ! initial_z + ! general properties of the current state + ! model_number + ! num_zones + ! star_age + ! time_step + ! properties at the photosphere + ! Teff + ! photosphere_L + ! photosphere_r + ! properties at the outermost zone of the model + ! log_surface_L + ! log_surface_radius + ! log_surface_temp + ! properties near the center of the model + ! log_center_temp + ! log_center_density + ! log_center_P + ! center_eta + ! abundances near the center + ! center_h1 + ! center_he3 + ! center_he4 + ! center_c12 + ! center_n14 + ! center_o16 + ! center_ne20 + ! information about total mass + ! star_mass + ! star_mdot + ! star_mass_h1 + ! star_mass_he3 + ! star_mass_he4 + ! star_mass_c12 + ! star_mass_n14 + ! star_mass_o16 + ! star_mass_ne20 + ! locations of abundance transitions + ! he_core_mass + ! c_core_mass + ! o_core_mass + ! si_core_mass + ! fe_core_mass + ! location of optical depths 10 and 100 + ! tau10_mass + ! tau10_radius + ! tau100_mass + ! tau100_radius + ! time scales + ! dynamic_time + ! kh_timescale + ! nuc_timescale + ! various kinds of total power + ! power_nuc_burn + ! power_h_burn + ! power_he_burn + ! power_neu + ! a few control parameter values + ! h1_boundary_limit + ! he4_boundary_limit + ! c12_boundary_limit + ! burn_min1 + ! burn_min2 diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/re b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/re new file mode 100755 index 000000000..c9ef26f96 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/re @@ -0,0 +1,33 @@ +#!/bin/bash + +shopt -u expand_aliases + +photo_directory=photos + +function most_recent_photo { + ls -tp "$photo_directory" | grep -v / | head -1 +} + +if [ $# -eq 0 ] +then + photo=$(most_recent_photo) +else + photo=$1 +fi + +if [ -z "$photo" ] || ! [ -f "$photo_directory/$photo" ] +then + echo "specified photo ($photo) does not exist" + exit 1 +fi + +echo "restart from $photo" +if ! cp "$photo_directory/$photo" restart_photo +then + echo "failed to copy photo ($photo)" + exit 1 +fi + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/rn b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/rn new file mode 100755 index 000000000..d8a2aa03d --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/rn @@ -0,0 +1,14 @@ +#!/bin/bash + +# this provides the definition of do_one (run one part of test) +# do_one [inlist] [output model] [LOGS directory] +source "${MESA_DIR}/star/test_suite/test_suite_helpers" + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +do_one inlist_rsp_Cepheid_header final.mod + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" + +echo 'finished' + diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/rn1 b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/rn1 new file mode 100755 index 000000000..25590040a --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/rn1 @@ -0,0 +1,7 @@ +#!/bin/bash + +rm -f restart_photo + +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" +./star +date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/src/run.f90 b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/src/run.f90 new file mode 100644 index 000000000..76d423f1a --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/src/run.f90 @@ -0,0 +1,15 @@ +program run + use run_star_support, only: do_read_star_job + use run_star, only: do_run_star + + implicit none + + integer :: ierr + + ierr = 0 + call do_read_star_job('inlist', ierr) + if (ierr /= 0) stop 1 + + call do_run_star + +end program run diff --git a/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/src/run_star_extras.f90 b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/src/run_star_extras.f90 new file mode 100644 index 000000000..44dc7b750 --- /dev/null +++ b/star/dev_cases_TDC_Pulsation/rsp_Cepheid_6M_compare/src/run_star_extras.f90 @@ -0,0 +1,227 @@ +! *********************************************************************** +! +! Copyright (C) 2018-2019 The MESA Team +! +! this file is part of mesa. +! +! mesa is free software; you can redistribute it and/or modify +! it under the terms of the gnu general library public license as published +! by the free software foundation; either version 2 of the license, or +! (at your option) any later version. +! +! mesa is distributed in the hope that it will be useful, +! but without any warranty; without even the implied warranty of +! merchantability or fitness for a particular purpose. see the +! gnu library general public license for more details. +! +! you should have received a copy of the gnu library general public license +! along with this software; if not, write to the free software +! foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa +! +! *********************************************************************** + +module run_star_extras + + use star_lib + use star_def + use const_def + use math_lib + use auto_diff + + implicit none + + include "test_suite_extras_def.inc" + logical :: need_to_write_LINA_data + + contains + + include "test_suite_extras.inc" + + + subroutine extras_controls(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + s% extras_startup => extras_startup + s% extras_check_model => extras_check_model + s% extras_start_step => extras_start_step + s% extras_finish_step => extras_finish_step + s% extras_after_evolve => extras_after_evolve + s% how_many_extra_history_columns => how_many_extra_history_columns + s% data_for_extra_history_columns => data_for_extra_history_columns + s% how_many_extra_profile_columns => how_many_extra_profile_columns + s% data_for_extra_profile_columns => data_for_extra_profile_columns + end subroutine extras_controls + + + subroutine extras_startup(id, restart, ierr) + integer, intent(in) :: id + logical, intent(in) :: restart + integer, intent(out) :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call test_suite_startup(s, restart, ierr) + if (.not. restart) then + need_to_write_LINA_data = len_trim(s% x_character_ctrl(10)) > 0 + else ! it is a restart + need_to_write_LINA_data = .false. + end if + end subroutine extras_startup + + + integer function extras_start_step(id) + integer, intent(in) :: id + integer :: ierr, io, i + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + extras_start_step = keep_going + if (need_to_write_LINA_data) then + io = 61 + open(io,file=trim(s% x_character_ctrl(10)),status='unknown') + write(io, '(99d16.5)') s% RSP_mass, s% RSP_L, s% RSP_Teff, & + (s% rsp_LINA_periods(i), s% rsp_LINA_growth_rates(i), i=1, s% RSP_nmodes) + close(io) + write(*,*) 'write ' // trim(s% x_character_ctrl(10)) + need_to_write_LINA_data = .false. + end if + end function extras_start_step + + + ! returns either keep_going or terminate. + integer function extras_finish_step(id) + integer, intent(in) :: id + integer :: ierr + real(dp) :: target_period, rel_run_E_err + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + extras_finish_step = keep_going + if (s% x_integer_ctrl(1) <= 0) return + if (s% rsp_num_periods < s% x_integer_ctrl(1)) return + write(*,'(A)') + write(*,'(A)') + write(*,'(A)') + target_period = s% x_ctrl(1) + rel_run_E_err = s% cumulative_energy_error/s% total_energy + write(*,*) 'rel_run_E_err', rel_run_E_err + if (s% total_energy /= 0d0 .and. abs(rel_run_E_err) > 1d-5) then + write(*,*) '*** BAD rel_run_E_error ***', & + s% cumulative_energy_error/s% total_energy + else if (abs(s% rsp_period/(24*3600) - target_period) > 1d-2) then + write(*,*) '*** BAD ***', s% rsp_period/(24*3600) - target_period, & + s% rsp_period/(24*3600), target_period + else + write(*,*) 'good match for period', & + s% rsp_period/(24*3600), target_period + end if + write(*,'(A)') + write(*,'(A)') + write(*,'(A)') + extras_finish_step = terminate + end function extras_finish_step + + + subroutine extras_after_evolve(id, ierr) + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + real(dp) :: dt + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call test_suite_after_evolve(s, ierr) + end subroutine extras_after_evolve + + + ! returns either keep_going, retry, or terminate. + integer function extras_check_model(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + extras_check_model = keep_going + end function extras_check_model + + + integer function how_many_extra_history_columns(id) + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + how_many_extra_history_columns = 8 + end function how_many_extra_history_columns + + + subroutine data_for_extra_history_columns(id, n, names, vals, ierr) + integer, intent(in) :: id, n + character (len=maxlen_history_column_name) :: names(n) + real(dp) :: vals(n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: i + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + i = 1 + names(i) = 'num_periods'; vals(i) = s% RSP_num_periods; i=i+1 + names(i) = 'period'; vals(i) = s% RSP_period/(24*3600); i=i+1 + names(i) = 'growth'; vals(i) = s% rsp_GREKM_avg_abs; i=i+1 + names(i) = 'max_v_div_cs'; vals(i) = 0; i=i+1 + names(i) = 'delta_R'; vals(i) = s% rsp_DeltaR; i=i+1 + names(i) = 'delta_Teff'; vals(i) = 0; i=i+1 + names(i) = 'delta_logL'; vals(i) = s% rsp_DeltaMag/2.5; i=i+1 + names(i) = 'delta_Mag'; vals(i) = 0; i=i+1 + end subroutine data_for_extra_history_columns + + + integer function how_many_extra_profile_columns(id) + use star_def, only: star_info + integer, intent(in) :: id + integer :: ierr + type (star_info), pointer :: s + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + how_many_extra_profile_columns = 1 + end function how_many_extra_profile_columns + + + subroutine data_for_extra_profile_columns(id, n, nz, names, vals, ierr) + use star_def, only: star_info, maxlen_profile_column_name + use const_def, only: dp + integer, intent(in) :: id, n, nz + character (len=maxlen_profile_column_name) :: names(n) + real(dp) :: vals(nz,n) + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: k + ierr = 0 + call star_ptr(id, s, ierr) + if (ierr /= 0) return + names(1) = 'sign_Lc' + do k=1,nz + if (abs(s% Lc(k)) < 1d-6) then + vals(k,1) = 0d0 + else + vals(k,1) = sign(1d0,s% Lc(k)) + end if + end do + end subroutine data_for_extra_profile_columns + + + + + end module run_star_extras + diff --git a/star/dev_cases_test_RSP2/dev_rsp2_Cepheid_6M/inlist_rsp2_Cepheid b/star/dev_cases_test_RSP2/dev_rsp2_Cepheid_6M/inlist_rsp2_Cepheid index 49958f0ee..6211b74ec 100644 --- a/star/dev_cases_test_RSP2/dev_rsp2_Cepheid_6M/inlist_rsp2_Cepheid +++ b/star/dev_cases_test_RSP2/dev_rsp2_Cepheid_6M/inlist_rsp2_Cepheid @@ -51,7 +51,14 @@ kap_CO_prefix = 'a09_co' / ! end of kap namelist -&controls +&controls + num_trace_history_values = 2 + trace_history_value_name(1) = 'log_rel_run_E_err' + trace_history_value_name(2) = 'rel_E_err' + warn_when_large_rel_run_E_err = 1d-2 + +!convergence_ignore_equL_residuals = .true. + !save_controls_namelist = .true. !controls_namelist_name = 'rsp2_controls.txt' @@ -67,8 +74,16 @@ ! surf BCs use_zero_Pgas_outer_BC = .true. - RSP2_use_L_eqn_at_surface = .true. - + !RSP2_use_L_eqn_at_surface = .true. + !use_compression_outer_BC = .true. + +RSP2_Lsurf_factor = 0.5d0 + RSP2_use_L_eqn_at_surface = .true. + RSP2_assume_HSE = .true. + RSP2_use_RSP_eqn_for_Y_face = .true. + RSP2_use_mass_interp_face_values = .false. + RSP2_use_Stellingwerf_Lr = .true. + ! timesteps ! RSP_max_dt_times_min_dr_div_cs = 2d0 dt_div_min_dr_div_cs_limit = 2d0 @@ -123,29 +138,33 @@ energy_eqn_option = 'dedt' - RSP2_assume_HSE = .true. include_w_in_correction_limits = .true. include_v_in_correction_limits = .true. include_L_in_correction_limits = .true. + RSP2_w_fix_if_neg = 5d-5 +RSP2_w_min_for_damping = 1d2 + RSP2_alfap = 0.0d0 ! turbulent pressure; Pt ~ alfap RSP2_alfat = 0.0d0 ! turbulent flux; Lt ~ RSP2_alfat RSP2_alfam = 0.25d0 ! turbulent viscosity; Eq and Uq ~ RSP2_alfam RSP2_alfar = 0.0d0 ! radiative dissipation of turbulent energy; Dr ~ RSP2_alfar RSP2_alfad = 1d0 - RSP2_num_outermost_cells_forced_nonturbulent = 1 - RSP2_num_innermost_cells_forced_nonturbulent = 5 + ! RSP2_num_outermost_cells_forced_nonturbulent = 1 + ! RSP2_num_innermost_cells_forced_nonturbulent = 5 alt_scale_height_flag = .false. - tol_max_correction = 5d-7 + !tol_max_correction = 5d-7 ! output - x_integer_ctrl(1) = -1 ! which period to check + x_integer_ctrl(1) = 0 ! which period to check x_ctrl(1) = 20 ! expected period (in days) + x_logical_ctrl(5) = .false. + x_logical_ctrl(7) = .true. ! doing pulses - x_integer_ctrl(7) = 0 ! 3 ! which period to check (<= 0 means don't check any) + x_integer_ctrl(7) = -1 ! 3 ! which period to check (<= 0 means don't check any) x_ctrl(7) = 20 ! expected period (in days) ! x_ctrl(8) = 1.0 ! min_deltaR_for_periods (Rsun) x_ctrl(9) = 0.1 ! KE_growth_avg_abs_frac_new @@ -163,7 +182,7 @@ photo_interval = 2000 profile_interval = 2000 history_interval = 40 - terminal_interval = 2000 + terminal_interval = 100 !2000 !photo_interval = 100 !profile_interval = 400 @@ -254,10 +273,10 @@ Grid1_win_flag = .true. Grid1_title = '6 M\d\(2281)\u Z=0.018 Cepheid RSP2' - !Grid1_file_flag = .true. + Grid1_file_flag = .true. Grid1_file_dir = 'png1' Grid1_file_prefix = 'grid1' - Grid1_file_interval = 10 ! output when mod(model_number,Grid1_file_interval)==0 + Grid1_file_interval = 100 ! output when mod(model_number,Grid1_file_interval)==0 Profile_Panels1_xaxis_name = 'zone' Profile_Panels1_xaxis_reversed = .true. @@ -272,7 +291,7 @@ History_Panels2_xaxis_name='day' History_Panels2_max_width = 40 ! only used if > 0. causes xmin to move with xmax. - !Grid2_file_flag = .true. + Grid2_file_flag = .true. file_digits = 7 Grid2_file_dir = 'png' Grid2_file_prefix = 'grid2' diff --git a/star/job/gyre_in_mesa_extras_set_velocities.inc b/star/job/gyre_in_mesa_extras_set_velocities.inc index e2d2a702f..bbf4f1348 100644 --- a/star/job/gyre_in_mesa_extras_set_velocities.inc +++ b/star/job/gyre_in_mesa_extras_set_velocities.inc @@ -59,7 +59,7 @@ !write(*,*) 'call star_get_pulse_data' call star_get_pulse_data(s%id, 'GYRE', & - .FALSE., .FALSE., .FALSE., global_data, point_data, ierr) + .FALSE., .FALSE., .FALSE., global_data, point_data, ierr) ! might need surface point for good kick if (ierr /= 0) then write(*,*) 'Failed when calling star_get_pulse_data' return diff --git a/star/private/adjust_mesh.f90 b/star/private/adjust_mesh.f90 index 540cddf87..a243f2442 100644 --- a/star/private/adjust_mesh.f90 +++ b/star/private/adjust_mesh.f90 @@ -281,8 +281,8 @@ integer function remesh(s) do_not_split, num_gvals, gval_names, & gval_is_xa_function, gval_is_logT_function, gvals, delta_gval_max, & s% max_center_cell_dq*s% mesh_delta_coeff, s% max_surface_cell_dq*s% mesh_delta_coeff, & - s% max_num_subcells, s% max_num_merge_cells, & - nz_new, xq_new, dq_new, which_gval, comes_from, ierr) + s% min_surface_cell_dq*s% mesh_delta_coeff, s% max_num_subcells, s% max_num_merge_cells, & + s% max_num_merge_surface_cells, nz_new, xq_new, dq_new, which_gval, comes_from, ierr) if (dbg_remesh .or. dbg) write(*,*) 'back from mesh_plan' diff --git a/star/private/adjust_mesh_split_merge.f90 b/star/private/adjust_mesh_split_merge.f90 index f727525af..84edf6e50 100644 --- a/star/private/adjust_mesh_split_merge.f90 +++ b/star/private/adjust_mesh_split_merge.f90 @@ -375,6 +375,12 @@ subroutine biggest_smallest( & dx_actual = xR - xL if (logtau_zoning) dx_actual = -dx_actual ! make dx_actual > 0 + + if (s% split_amr_ignore_core_cells .and. & + s%lnT(k)/ln10 >= s% split_amr_logT_for_ignore_core_cells) then + cycle + end if + ! first check for cells that are too big and need to be split oversize_ratio = dx_actual/dx_baseline if (TooBig < oversize_ratio .and. s% dq(k) > 5d0*dq_min) then @@ -387,9 +393,14 @@ subroutine biggest_smallest( & ! next check for cells that are too small and need to be merged + ! surface cells if (s% merge_amr_ignore_surface_cells .and. & k<=s% merge_amr_k_for_ignore_surface_cells) cycle + ! core cells + if (s% merge_amr_ignore_core_cells .and. & + s%lnT(k)/ln10>= s% merge_amr_logT_for_ignore_core_cells) cycle + if (abs(dx_actual)>0d0) then undersize_ratio = max(dx_baseline/dx_actual, dq_min/s% dq(k)) else @@ -589,6 +600,10 @@ subroutine do_merge(s, i_merge, species, new_xa, ierr) s% xa(q,i) = (dm_i*s% xa(q,i) + dm_ip*s% xa(q,ip))/dm end do +! ! remesh mlt_vc after merge. +! s% mlt_vc(i) = (dm_i*s% mlt_vc(i) + dm_ip*s% mlt_vc(ip)) / dm +! s% mlt_vc_old(i) = (dm_i*s% mlt_vc_old(i) + dm_ip*s% mlt_vc_old(ip)) / dm + KE = KE_i + KE_ip if (s% u_flag) then v = sqrt(KE/(0.5d0*dm)) @@ -646,6 +661,7 @@ subroutine do_merge(s, i_merge, species, new_xa, ierr) s% lnT(im) = s% lnT(i0) s% D_mix(im) = s% D_mix(i0) s% mlt_vc(im) = s% mlt_vc(i0) +! s% mlt_vc_old(im) = s% mlt_vc_old(i0) s% csound(im) = s% csound(i0) s% tau(im) = s% tau(i0) s% opacity(im) = s% opacity(i0) @@ -819,7 +835,7 @@ subroutine do_split(s, i_split, species, tau_center, grad_xa, new_xa, ierr) dLeft, dRght, dCntr, grad_rho, grad_energy, grad_v2, & sumx, sumxp, new_xaL, new_xaR, star_PE0, star_PE1, & grad_alpha, f, new_alphaL, new_alphaR, v_R, v_C, v_L, min_dm, & - mlt_vcL, mlt_vcR, tauL, tauR, etrb, etrb_L, etrb_C, etrb_R, grad_etrb, & + mlt_vcL, mlt_vcR, mlt_vc_oldL, mlt_vc_oldR, tauL, tauR, etrb, etrb_L, etrb_C, etrb_R, grad_etrb, & j_rot_new, dmbar_old, dmbar_p1_old, dmbar_new, dmbar_p1_new, dmbar_p2_new, J_old logical :: done, use_new_grad_rho include 'formats' @@ -867,6 +883,17 @@ subroutine do_split(s, i_split, species, tau_center, grad_xa, new_xa, ierr) tauL = s% tau(ip) end if +! mlt_vc_oldR = s% mlt_vc_old(i) +! if (i == nz) then +! rL = s% R_center +! mlt_vc_oldL = 0d0 +! tauL = tau_center +! else +! rL = s% r(ip) +! mlt_vc_oldL = s% mlt_vc_old(ip) +! tauL = s% tau(ip) +! end if + tauR = s% tau(i) if (i == nz) then tauL = tau_center @@ -1027,6 +1054,7 @@ subroutine do_split(s, i_split, species, tau_center, grad_xa, new_xa, ierr) s% lnT(jp) = s% lnT(j) s% D_mix(jp) = s% D_mix(j) s% mlt_vc(jp) = s% mlt_vc(j) +! s% mlt_vc_old(jp) = s% mlt_vc_old(j) s% csound(jp) = s% csound(j) s% tau(jp) = s% tau(j) s% opacity(jp) = s% opacity(j) @@ -1170,6 +1198,17 @@ subroutine do_split(s, i_split, species, tau_center, grad_xa, new_xa, ierr) s% mlt_vc(ip) = (mlt_vcL*dML + mlt_vcR*dMR)/dM end if +! if (i == 1) then +! s% mlt_vc_old(ip) = s% mlt_vc_old(i) +! else +! s% mlt_vc_old(ip) = (mlt_vc_oldL*dML + mlt_vc_oldR*dMR)/dM +! end if +! +! ! keep mlt_vc pair in the *right-hand* piece (cell i) consistent <--- PATCH +! s% mlt_vc(i) = mlt_vcR ! PATCH +! s% mlt_vc_old(i) = mlt_vc_oldR ! PATCH + + s% tau(ip) = tauR + (tauL - tauR)*dMR/dM if (is_bad(s% tau(ip))) then write(*,2) 'tau', ip, s% tau(ip), tauL, tauR, dMR/dM @@ -1232,6 +1271,7 @@ subroutine do_split(s, i_split, species, tau_center, grad_xa, new_xa, ierr) s% T(ip) = s% T(i) s% D_mix(ip) = s% D_mix(i) s% mlt_vc(ip) = s% mlt_vc(i) +! s% mlt_vc_old(ip) = s% mlt_vc_old(i) s% csound(ip) = s% csound(i) s% opacity(ip) = s% opacity(i) if (s% RTI_flag) s% alpha_RTI(ip) = s% alpha_RTI(i) diff --git a/star/private/auto_diff_support.f90 b/star/private/auto_diff_support.f90 index 14475fd79..e46b4a3b0 100644 --- a/star/private/auto_diff_support.f90 +++ b/star/private/auto_diff_support.f90 @@ -285,6 +285,37 @@ function wrap_d_p1(s, k) result(d_p1) end if end function wrap_d_p1 + function wrap_d_m1_start(s, k) result(d_m1) + type (star_info), pointer :: s + type(auto_diff_real_star_order1) :: d_m1 + integer, intent(in) :: k + d_m1 = 0d0 + if (k > 1) then + d_m1 % val = s%rho_start(k-1) + d_m1 % d1Array(i_lnd_m1) = s%rho_start(k-1) + end if + end function wrap_d_m1_start + + function wrap_d_00_start(s, k) result(d_00) + type (star_info), pointer :: s + type(auto_diff_real_star_order1) :: d_00 + integer, intent(in) :: k + d_00 = 0d0 + d_00 % val = s%rho_start(k) + d_00 % d1Array(i_lnd_00) = s%rho_start(k) + end function wrap_d_00_start + + function wrap_d_p1_start(s, k) result(d_p1) + type (star_info), pointer :: s + type(auto_diff_real_star_order1) :: d_p1 + integer, intent(in) :: k + d_p1 = 0d0 + if (k < s%nz) then + d_p1 % val = s%rho_start(k+1) + d_p1 % d1Array(i_lnd_p1) = s%rho_start(k+1) + end if + end function wrap_d_p1_start + function wrap_lnd_m1(s, k) result(lnd_m1) type (star_info), pointer :: s type(auto_diff_real_star_order1) :: lnd_m1 @@ -952,6 +983,69 @@ function wrap_dxh_lnR(s, k) result(dxh_lnR) dxh_lnR % d1Array(i_lnR_00) = 1d0 end function wrap_dxh_lnR + function wrap_dxh_v_face(s, k) result(dxh_v) ! ! wrap_dxh_v_face_00 technically + type (star_info), pointer :: s + type(auto_diff_real_star_order1) :: dxh_v + integer, intent(in) :: k + if (s% u_flag) then + dxh_v = wrap_dxh_u_face(s,k) ! wrap_dxh_u_face_00 technically + return + end if + dxh_v = 0d0 + dxh_v % val = s% dxh_v(k) + dxh_v % d1Array(i_v_00) = 1d0 + end function wrap_dxh_v_face + + + function wrap_geff_face(s, k) result(geff) + type (star_info), pointer :: s + type(auto_diff_real_star_order1) :: geff, dv_dt, r + integer, intent(in) :: k + geff = 0d0 + dv_dt = 0d0 + r = wrap_r_00(s,k) + if (s% make_mlt_hydrodynamic .and. (s% v_flag .or. s% u_flag)) then + ! add in hydrodynamic term + dv_dt = wrap_dxh_v_face(s,k)/s%dt + ! hydrodynamic correction to g is geff = g - dvdt + geff = s%cgrav(k)*s%m_grav(k)/pow2(r) - dv_dt + else + geff = s% m_grav(k)*s% cgrav(k)/pow2(r) + end if + end function wrap_geff_face + + subroutine get_face_weights_ad_support(s, k, alfa, beta) + type (star_info), pointer :: s + integer, intent(in) :: k + real(dp), intent(out) :: alfa, beta + ! face_value(k) = alfa*cell_value(k) + beta*cell_value(k-1) + if (k == 1) call mesa_error(__FILE__,__LINE__,'bad k==1 for get_face_weights') + alfa = s% dq(k-1)/(s% dq(k-1) + s% dq(k)) + beta = 1d0 - alfa + end subroutine get_face_weights_ad_support + + function wrap_dxh_u_face(s, k) result(dxh_u_face) ! wrap_dxh_u_face_00 technically + type (star_info), pointer :: s + integer, intent(in) :: k + type(auto_diff_real_star_order1) :: dxh_u_face + real(dp) :: alpha, beta + + dxh_u_face = 0d0 + if (k == 1) then + ! at the inner boundary just take the first cell‐update + dxh_u_face%val = s%dxh_u(1) + dxh_u_face%d1Array(i_v_00) = 1d0 + else + ! get mass weighted face interpolation coefficients + call get_face_weights_ad_support(s, k, alpha, beta) + dxh_u_face%val = alpha*s%dxh_u(k) + beta*s%dxh_u(k-1) + ! derivatives wrt the two neighbouring dxh_u's + dxh_u_face%d1Array(i_v_00) = alpha + dxh_u_face%d1Array(i_v_m1) = beta + end if + end function wrap_dxh_u_face + + function wrap_u_face_m1(s, k) result(v_m1) type (star_info), pointer :: s type(auto_diff_real_star_order1) :: v_m1 diff --git a/star/private/ctrls_io.f90 b/star/private/ctrls_io.f90 index 8487d4884..18ee70b1a 100644 --- a/star/private/ctrls_io.f90 +++ b/star/private/ctrls_io.f90 @@ -105,7 +105,9 @@ module ctrls_io mixing_D_limit_for_log, trace_mass_location, min_tau_for_max_abs_v_location, & min_q_for_inner_mach1_location, max_q_for_outer_mach1_location, & conv_core_gap_dq_limit, & - alpha_TDC_DAMP, alpha_TDC_DAMPR, alpha_TDC_PtdVdt, & + alpha_TDC_DAMP, alpha_TDC_DAMPR, alpha_TDC_PtdVdt, alpha_TDC_DAMPM, TDC_use_density_form_for_eddy_viscosity, & + TDC_num_innermost_cells_forced_nonturbulent, include_mlt_Pturb_in_thermodynamic_gradients, & + make_mlt_hydrodynamic, include_mlt_corr_to_TDC, & ! burn zone eps definitions for use in logs and profiles burn_min1, burn_min2, & @@ -221,8 +223,8 @@ module ctrls_io mesh_min_dlnR, merge_if_dlnR_too_small, min_dq_for_logT, & mesh_min_dr_div_dRstar, merge_if_dr_div_dRstar_too_small, & mesh_min_dr_div_cs, merge_if_dr_div_cs_too_small, & - max_center_cell_dq, max_surface_cell_dq, max_num_subcells, max_num_merge_cells, & - mesh_delta_coeff, mesh_delta_coeff_for_highT, & + max_center_cell_dq, max_surface_cell_dq, min_surface_cell_dq, max_num_subcells, max_num_merge_cells, & + max_num_merge_surface_cells ,mesh_delta_coeff, mesh_delta_coeff_for_highT, & logT_max_for_standard_mesh_delta_coeff, logT_min_for_highT_mesh_delta_coeff, remesh_dt_limit, & mesh_Pgas_div_P_exponent, & E_function_weight, E_function_param, P_function_weight, & @@ -251,6 +253,8 @@ module ctrls_io split_merge_amr_okay_to_split_1, merge_amr_inhibit_at_jumps, split_merge_amr_MaxLong, split_merge_amr_nz_r_core_fraction, & split_merge_amr_MaxShort, merge_amr_max_abs_du_div_cs, & merge_amr_ignore_surface_cells, merge_amr_k_for_ignore_surface_cells, & + merge_amr_ignore_core_cells, merge_amr_logT_for_ignore_core_cells, & + split_amr_ignore_core_cells, split_amr_logT_for_ignore_core_cells, & merge_amr_du_div_cs_limit_only_for_compression, split_merge_amr_avoid_repeated_remesh, split_merge_amr_r_core_cm, & split_merge_amr_dq_min, split_merge_amr_dq_max, split_merge_amr_max_iters, trace_split_merge_amr, equal_split_density_amr, & @@ -349,8 +353,9 @@ module ctrls_io include_P_in_velocity_time_centering, include_L_in_velocity_time_centering, & P_theta_for_velocity_time_centering, L_theta_for_velocity_time_centering, & steps_before_use_TDC, use_P_d_1_div_rho_form_of_work_when_time_centering_velocity, compare_TDC_to_MLT, & - velocity_logT_lower_bound, max_dt_yrs_for_velocity_logT_lower_bound, velocity_tau_lower_bound, velocity_q_upper_bound, & - report_max_infall_inside_fe_core, use_drag_energy, drag_coefficient, min_q_for_drag, & + remesh_for_TDC_pulsations_log_core_zoning, velocity_logT_lower_bound, & + max_dt_yrs_for_velocity_logT_lower_bound, velocity_tau_lower_bound, velocity_q_upper_bound, & + use_drag_energy, drag_coefficient, min_q_for_drag, & v_drag_factor, v_drag, q_for_v_drag_full_off, q_for_v_drag_full_on, & retry_for_v_above_clight, & @@ -489,7 +494,7 @@ module ctrls_io atm_irradiated_max_iters, & use_compression_outer_BC, use_momentum_outer_BC, Tsurf_factor, use_zero_Pgas_outer_BC, & - fixed_Psurf, use_fixed_Psurf_outer_BC, fixed_vsurf, use_fixed_vsurf_outer_BC, & + fixed_Psurf, use_fixed_Psurf_outer_BC, fixed_vsurf, use_fixed_vsurf_outer_BC, use_RSP_L_eqn_outer_BC, & atm_build_tau_outer, atm_build_dlogtau, atm_build_errtol, & @@ -1283,6 +1288,7 @@ subroutine store_controls(s, ierr) s% use_zero_Pgas_outer_BC = use_zero_Pgas_outer_BC s% fixed_vsurf = fixed_vsurf s% use_fixed_vsurf_outer_BC = use_fixed_vsurf_outer_BC + s% use_RSP_L_eqn_outer_BC = use_RSP_L_eqn_outer_BC s% fixed_Psurf = fixed_Psurf s% use_fixed_Psurf_outer_BC = use_fixed_Psurf_outer_BC @@ -1483,8 +1489,10 @@ subroutine store_controls(s, ierr) s% max_center_cell_dq = max_center_cell_dq s% max_surface_cell_dq = max_surface_cell_dq + s% min_surface_cell_dq = min_surface_cell_dq s% max_num_subcells = max_num_subcells s% max_num_merge_cells = max_num_merge_cells + s% max_num_merge_surface_cells = max_num_merge_surface_cells s% mesh_delta_coeff = mesh_delta_coeff s% mesh_delta_coeff_for_highT = mesh_delta_coeff_for_highT @@ -1586,9 +1594,13 @@ subroutine store_controls(s, ierr) s% split_merge_amr_MaxShort = split_merge_amr_MaxShort s% merge_amr_max_abs_du_div_cs = merge_amr_max_abs_du_div_cs s% merge_amr_ignore_surface_cells = merge_amr_ignore_surface_cells + s% merge_amr_ignore_core_cells = merge_amr_ignore_core_cells + s% split_amr_ignore_core_cells = split_amr_ignore_core_cells s% merge_amr_du_div_cs_limit_only_for_compression = merge_amr_du_div_cs_limit_only_for_compression s% split_merge_amr_avoid_repeated_remesh = split_merge_amr_avoid_repeated_remesh s% merge_amr_k_for_ignore_surface_cells = merge_amr_k_for_ignore_surface_cells + s% merge_amr_logT_for_ignore_core_cells = merge_amr_logT_for_ignore_core_cells + s% split_amr_logT_for_ignore_core_cells = split_amr_logT_for_ignore_core_cells s% split_merge_amr_dq_min = split_merge_amr_dq_min s% split_merge_amr_dq_max = split_merge_amr_dq_max s% split_merge_amr_r_core_cm = split_merge_amr_r_core_cm @@ -2065,8 +2077,16 @@ subroutine store_controls(s, ierr) s% alpha_TDC_DAMP = alpha_TDC_DAMP s% alpha_TDC_DAMPR = alpha_TDC_DAMPR s% alpha_TDC_PtdVdt = alpha_TDC_PtdVdt + s% alpha_TDC_DAMPM = alpha_TDC_DAMPM + s% TDC_use_density_form_for_eddy_viscosity = TDC_use_density_form_for_eddy_viscosity + s% TDC_num_innermost_cells_forced_nonturbulent = TDC_num_innermost_cells_forced_nonturbulent + s% include_mlt_Pturb_in_thermodynamic_gradients = include_mlt_Pturb_in_thermodynamic_gradients + s% make_mlt_hydrodynamic = make_mlt_hydrodynamic + s% include_mlt_corr_to_TDC = include_mlt_corr_to_TDC s% compare_TDC_to_MLT = compare_TDC_to_MLT + s% remesh_for_TDC_pulsations_log_core_zoning = remesh_for_TDC_pulsations_log_core_zoning + s% RSP2_alfap = RSP2_alfap s% RSP2_alfad = RSP2_alfad s% RSP2_alfat = RSP2_alfat @@ -2974,6 +2994,7 @@ subroutine set_controls_for_writing(s, ierr) use_zero_Pgas_outer_BC = s% use_zero_Pgas_outer_BC fixed_vsurf = s% fixed_vsurf use_fixed_vsurf_outer_BC = s% use_fixed_vsurf_outer_BC + use_RSP_L_eqn_outer_BC = s% use_RSP_L_eqn_outer_BC fixed_Psurf = s% fixed_Psurf use_fixed_Psurf_outer_BC = s% use_fixed_Psurf_outer_BC @@ -3168,8 +3189,11 @@ subroutine set_controls_for_writing(s, ierr) max_center_cell_dq = s% max_center_cell_dq max_surface_cell_dq = s% max_surface_cell_dq + min_surface_cell_dq = s% min_surface_cell_dq + max_num_subcells = s% max_num_subcells max_num_merge_cells = s% max_num_merge_cells + max_num_merge_surface_cells = s% max_num_merge_surface_cells mesh_delta_coeff = s% mesh_delta_coeff mesh_delta_coeff_for_highT = s% mesh_delta_coeff_for_highT @@ -3271,9 +3295,13 @@ subroutine set_controls_for_writing(s, ierr) split_merge_amr_MaxShort = s% split_merge_amr_MaxShort merge_amr_max_abs_du_div_cs = s% merge_amr_max_abs_du_div_cs merge_amr_ignore_surface_cells = s% merge_amr_ignore_surface_cells + merge_amr_ignore_core_cells = s% merge_amr_ignore_core_cells + split_amr_ignore_core_cells = s% split_amr_ignore_core_cells merge_amr_du_div_cs_limit_only_for_compression = s% merge_amr_du_div_cs_limit_only_for_compression split_merge_amr_avoid_repeated_remesh = s% split_merge_amr_avoid_repeated_remesh merge_amr_k_for_ignore_surface_cells = s% merge_amr_k_for_ignore_surface_cells + merge_amr_logT_for_ignore_core_cells = s% merge_amr_logT_for_ignore_core_cells + split_amr_logT_for_ignore_core_cells = s% split_amr_logT_for_ignore_core_cells split_merge_amr_dq_min = s% split_merge_amr_dq_min split_merge_amr_dq_max = s% split_merge_amr_dq_max split_merge_amr_r_core_cm = s% split_merge_amr_r_core_cm @@ -3747,8 +3775,16 @@ subroutine set_controls_for_writing(s, ierr) alpha_TDC_DAMP = s% alpha_TDC_DAMP alpha_TDC_DAMPR = s% alpha_TDC_DAMPR alpha_TDC_PtdVdt = s% alpha_TDC_PtdVdt + alpha_TDC_DAMPM = s% alpha_TDC_DAMPM + TDC_use_density_form_for_eddy_viscosity = s% TDC_use_density_form_for_eddy_viscosity + TDC_num_innermost_cells_forced_nonturbulent = s% TDC_num_innermost_cells_forced_nonturbulent + include_mlt_Pturb_in_thermodynamic_gradients = s% include_mlt_Pturb_in_thermodynamic_gradients + make_mlt_hydrodynamic = s% make_mlt_hydrodynamic + include_mlt_corr_to_TDC = s% include_mlt_corr_to_TDC compare_TDC_to_MLT = s% compare_TDC_to_MLT + remesh_for_TDC_pulsations_log_core_zoning = s% remesh_for_TDC_pulsations_log_core_zoning + RSP2_alfap= s% RSP2_alfap RSP2_alfad = s% RSP2_alfad RSP2_alfat= s% RSP2_alfat diff --git a/star/private/eps_mdot.f90 b/star/private/eps_mdot.f90 index 3bf32e6d4..2014aff48 100644 --- a/star/private/eps_mdot.f90 +++ b/star/private/eps_mdot.f90 @@ -484,7 +484,7 @@ subroutine calculate_eps_mdot(s, dt, ierr) real(dp), dimension(:), allocatable :: & p_bar, rho_bar, te_bar, te, & leak_frac, thermal_energy, density_weighted_flux, eps_mdot_per_total_mass,& - accumulated, grad_r_sub_grad_a + accumulated, grad_r_sub_grad_a!, v_bar real(qp), dimension(:), allocatable :: change_in_dm, mass_flux, dm, prev_mesh_dm,& total_mass_through_cell type(accurate_real) :: sum @@ -550,6 +550,7 @@ subroutine calculate_eps_mdot(s, dt, ierr) allocate(p_bar(nz+1)) allocate(rho_bar(nz+1)) allocate(te_bar(nz+1)) + !allocate(v_bar(nz+1)) !$OMP PARALLEL DO do j=1,nz @@ -565,6 +566,12 @@ subroutine calculate_eps_mdot(s, dt, ierr) p_bar(j) = interpolate_onto_faces(s%Peos, prev_mesh_dm, nz, j) rho_bar(j) = interpolate_onto_faces(s%rho, prev_mesh_dm, nz, j) te_bar(j) = interpolate_onto_faces(te, prev_mesh_dm, nz, j) + +! if (s% u_flag) then +! v_bar(j) = interpolate_onto_faces( s%v, prev_mesh_dm, nz, j) +! else +! v_bar(j) = s%v(j) +! end if end do !$OMP END PARALLEL DO @@ -612,6 +619,10 @@ subroutine calculate_eps_mdot(s, dt, ierr) ! Calculate change in heat. s % mdot_acoustic_surface = delta_m * p_bar(1) / rho_bar(1) / dt + + ! kinetic‐energy loss at the surface face j=1: + !s%mdot_ke_surface = delta_m * 0.5_dp * v_bar(1)**2 / dt + do j=1,nz ! We calculate eps_mdot using accurate reals to reduce roundoff errors. sum % sum = 0.0d0 @@ -632,6 +643,10 @@ subroutine calculate_eps_mdot(s, dt, ierr) ! but when composition changes this term also captures that. sum = sum - real(s% total_energy_profile_after_adjust_mass(j) - s%dm(j) * te(j), qp) + !— kinetic‐energy flux: ½·ṁ·v² difference across faces j and j+1 — + ! sum = sum + real( 0.5_qp * mass_flux(j) * pow2(v_bar(j)) , qp) + ! sum = sum - real( 0.5_qp * mass_flux(j+1) * pow2(v_bar(j+1)) , qp) + change_sum = change_sum + sum%value() / (dt) ! Multiplicative factors diff --git a/star/private/hydro_energy.f90 b/star/private/hydro_energy.f90 index 370f2e61e..b851d9e30 100644 --- a/star/private/hydro_energy.f90 +++ b/star/private/hydro_energy.f90 @@ -212,8 +212,10 @@ subroutine setup_dL_dm(ierr) dL_dm_ad = (L00_ad - Lp1_ad)/dm end subroutine setup_dL_dm - subroutine setup_sources_and_others(ierr) ! sources_ad, others_ad - !use hydro_rsp2, only: compute_Eq_cell + + subroutine setup_sources_and_others(ierr) ! sources_ad, others_ad + use hydro_rsp2, only: compute_Eq_cell + integer, intent(out) :: ierr type(auto_diff_real_star_order1) :: & eps_nuc_ad, non_nuc_neu_ad, extra_heat_ad, Eq_ad, RTI_diffusion_ad, & @@ -263,6 +265,17 @@ subroutine setup_sources_and_others(ierr) ! sources_ad, others_ad if (ierr /= 0) return end if +! we do not need this term for tdc, because Eq is included +! in the turbulent energy equation solved inside TDC. It's effects +! are seen in hydro_momentum +! if (s% alpha_TDC_DampM >0d0 .and. s% MLT_option == 'TDC') then +! Eq_ad = s% Eq_ad(k) !compute_Eq_cell(s, k, ierr) +!! if (k==91) then +!! write(*,*) 'test Eq, k', Eq_ad %val , k +!! end if +! if (ierr /= 0) return +! end if + call setup_RTI_diffusion(RTI_diffusion_ad) drag_energy = 0d0 diff --git a/star/private/hydro_eqns.f90 b/star/private/hydro_eqns.f90 index a89d9c91c..6b7b48086 100644 --- a/star/private/hydro_eqns.f90 +++ b/star/private/hydro_eqns.f90 @@ -255,7 +255,7 @@ subroutine eval_equ_for_solver(s, nvar, nzlo, nzhi, ierr) if (len_trim(s% retry_message) == 0) s% retry_message = 'error in do1_rsp2_L_eqn' ierr = op_err end if - else if (k > 1) then ! k==1 is done by T_surf BC + else if (k > 1 .or. (k ==1 .and. s% use_RSP_L_eqn_outer_BC) ) then ! k==1 is done by T_surf BC call do1_dlnT_dm_eqn(s, k, nvar, op_err) if (op_err /= 0) then if (s% report_ierr) write(*,2) 'ierr in do1_dlnT_dm_eqn', k @@ -772,7 +772,7 @@ subroutine PT_eqns_surf(s, nvar, do_du_dt, do_dv_dt, do_equL, ierr) need_T_surf = .false. if ((.not. do_equL) .or. & - (s% RSP2_flag .and. s% RSP2_use_L_eqn_at_surface)) then + (s% RSP2_flag) .or. (s% use_RSP_L_eqn_outer_BC)) then ! no Tsurf BC else need_T_surf = .true. @@ -782,7 +782,7 @@ subroutine PT_eqns_surf(s, nvar, do_du_dt, do_dv_dt, do_equL, ierr) offset_P_to_cell_center = .not. s% use_momentum_outer_BC offset_T_to_cell_center = .true. - if (s% use_other_surface_PT .or. s% RSP2_flag) & + if (s% use_other_surface_PT .or. s% RSP2_flag .or. s% use_RSP_L_eqn_outer_BC) & offset_T_to_cell_center = .false. call get_PT_bc_ad(ierr) @@ -1009,7 +1009,7 @@ subroutine set_Tsurf_BC(ierr) !test_partials = (1 == s% solver_test_partials_k) test_partials = .false. ierr = 0 - if (s% RSP2_flag) then ! interpolate lnT by mass + if (s% RSP2_flag) then ! interpolate lnT by mass, To do: check what happens if we try this with mlt? T4_p1 = pow4(wrap_T_p1(s,1)) T4_surf = pow4(T_bc_ad) dT4_dm = (T4_surf - T4_p1)/(s% dm(1) + 0.5d0*s% dm(2)) diff --git a/star/private/hydro_momentum.f90 b/star/private/hydro_momentum.f90 index f5ae18c20..8f333007f 100644 --- a/star/private/hydro_momentum.f90 +++ b/star/private/hydro_momentum.f90 @@ -393,6 +393,7 @@ subroutine expected_non_HSE_term( & extra_ad = s% extra_grav(k) end if + Uq_ad = 0d0 accel_ad = 0d0 drag = 0d0 s% dvdt_drag(k) = 0d0 @@ -425,14 +426,20 @@ subroutine expected_non_HSE_term( & s% dvdt_drag(k) = drag%val end if - end if ! v_flag + if (s% RSP2_flag) then ! Uq(k) is turbulent viscosity drag at face k + Uq_ad = compute_Uq_face(s, k, ierr) + if (ierr /= 0) return + end if - Uq_ad = 0d0 - if (s% RSP2_flag) then ! Uq(k) is turbulent viscosity drag at face k - Uq_ad = compute_Uq_face(s, k, ierr) - if (ierr /= 0) return - end if + ! need to add check for v_flag. + if (s% alpha_TDC_DampM > 0 .and. s% MLT_option == 'TDC') then ! Uq(k) is turbulent viscosity drag at face k + Uq_ad = compute_Uq_face(s, k, ierr) + !write (*,*) Uq_ad %val, 'Uq_ad %val' + if (ierr /= 0) return + end if + end if ! v_flag + other_ad = extra_ad - accel_ad + drag + Uq_ad other = other_ad%val diff --git a/star/private/hydro_riemann.f90 b/star/private/hydro_riemann.f90 index d00dab261..eec07b4b0 100644 --- a/star/private/hydro_riemann.f90 +++ b/star/private/hydro_riemann.f90 @@ -425,10 +425,20 @@ subroutine do1_uface_and_Pface(s, k, ierr) end if end if + if (s% RSP2_flag) then ! include Uq in u_face Uq_ad = compute_Uq_face(s, k, ierr) if (ierr /= 0) return s% u_face_ad(k) = s% u_face_ad(k) + Uq_ad + else if (s% alpha_TDC_DampM >0d0 .and. s% MLT_option == 'TDC') then ! include Uq in u_face + Uq_ad = compute_Uq_face(s, k, ierr) + if (ierr /= 0) return + !if (k==-63) then + ! write(*,*) 'test Uq, k', Uq_ad %val, k + !end if + s% u_face_ad(k) = s% u_face_ad(k) + Uq_ad + else + Uq_ad = 0d0 end if s% u_face_val(k) = s% u_face_ad(k)%val diff --git a/star/private/hydro_rsp2.f90 b/star/private/hydro_rsp2.f90 index e87d0bb10..9e2a896f3 100644 --- a/star/private/hydro_rsp2.f90 +++ b/star/private/hydro_rsp2.f90 @@ -30,16 +30,12 @@ module hydro_rsp2 implicit none private - public :: do1_rsp2_L_eqn - public :: do1_turbulent_energy_eqn - public :: do1_rsp2_Hp_eqn - public :: compute_Eq_cell - public :: compute_Uq_face - public :: set_RSP2_vars - public :: Hp_face_for_rsp2_val - public :: Hp_face_for_rsp2_eqn, set_etrb_start_vars - public :: RSP2_adjust_vars_before_call_solver - public :: get_RSP2_alfa_beta_face_weights + public :: & + do1_rsp2_L_eqn, do1_turbulent_energy_eqn, do1_rsp2_Hp_eqn, & + compute_Eq_cell, compute_Uq_face, set_RSP2_vars, & + Hp_face_for_rsp2_val, Hp_face_for_rsp2_eqn, set_etrb_start_vars, & + RSP2_adjust_vars_before_call_solver, get_RSP2_alfa_beta_face_weights, & + set_viscosity_vars_TDC real(dp), parameter :: & x_ALFAP = 2.d0/3.d0, & ! Ptrb @@ -111,6 +107,53 @@ subroutine set_RSP2_vars(s,ierr) end subroutine set_RSP2_vars + ! This routine is called to initialize eq and uq for TDC. + subroutine set_viscosity_vars_TDC(s,ierr) + type (star_info), pointer :: s + integer, intent(out) :: ierr + type(auto_diff_real_star_order1) :: x + integer :: k, op_err + include 'formats' + ierr = 0 + op_err = 0 + + !$OMP PARALLEL DO PRIVATE(k,op_err) SCHEDULE(dynamic,2) + do k=1,s%nz + ! Hp_face(k) <= 0 means it needs to be set. e.g., after read file + if (s% Hp_face(k) <= 0) then + ! this scale height for face is already calculated in TDC + s% Hp_face(k) = get_scale_height_face_val(s,k) ! because this is called before s% scale_height(k) is updated in mlt_vars. + end if + end do + !$OMP END PARALLEL DO + if (ierr /= 0) then + if (s% report_ierr) write(*,2) 'failed in set_viscosity_vars_TDC loop 1', s% model_number + return + end if + !$OMP PARALLEL DO PRIVATE(k,op_err) SCHEDULE(dynamic,2) + do k=1,s% nz + x = compute_Chi_cell(s, k, op_err) + if (op_err /= 0) ierr = op_err + x = compute_Eq_cell(s, k, op_err) + if (op_err /= 0) ierr = op_err + x = compute_Uq_face(s, k, op_err) + if (op_err /= 0) ierr = op_err + end do + !$OMP END PARALLEL DO + if (ierr /= 0) then + if (s% report_ierr) write(*,2) 'failed in set_viscosity_vars_TDC loop 2', s% model_number + return + end if + if (.not. (s% v_flag .or. s% u_flag)) then ! set values 0 if not using v_flag or u_flag. + do k = 1, s% nz + s% Eq(k) = 0d0; s% Eq_ad(k) = 0d0 + s% Chi(k) = 0d0; s% Chi_ad(k) = 0d0 + s% Uq(k) = 0d0 + end do + end if + end subroutine set_viscosity_vars_TDC + + subroutine do1_rsp2_L_eqn(s, k, nvar, ierr) use star_utils, only: save_eqn_residual_info type (star_info), pointer :: s @@ -583,18 +626,82 @@ function compute_d_v_div_r(s, k, ierr) result(d_v_div_r) ! s^-1 integer, intent(in) :: k type(auto_diff_real_star_order1) :: d_v_div_r integer, intent(out) :: ierr - type(auto_diff_real_star_order1) :: v_00, v_p1, r_00, r_p1 + type(auto_diff_real_star_order1) :: v_00, v_p1, r_00, r_p1, term1, term2 + logical :: dbg include 'formats' ierr = 0 + dbg = .false. v_00 = wrap_v_00(s,k) v_p1 = wrap_v_p1(s,k) r_00 = wrap_r_00(s,k) r_p1 = wrap_r_p1(s,k) if (r_p1%val == 0d0) r_p1 = 1d0 - d_v_div_r = v_00/r_00 - v_p1/r_p1 ! units s^-1 + d_v_div_r = v_00/r_00 - v_p1/r_p1 ! units s^-1 + + ! Debugging output to trace values + if (dbg .and. k == -63) then + write(*,*) 'test d_v_div_r, k:', k + write(*,*) 'v_00:', v_00%val, 'v_p1:', v_p1%val + write(*,*) 'r_00:', r_00%val, 'r_p1:', r_p1%val + write(*,*) 'd_v_div_r:', d_v_div_r %val + end if end function compute_d_v_div_r + + function compute_rho_form_of_d_v_div_r(s, k, ierr) result(d_v_div_r) + type(star_info), pointer :: s + integer, intent(in) :: k + integer, intent(out) :: ierr + type(auto_diff_real_star_order1) :: d_v_div_r + type(auto_diff_real_star_order1) :: r_cell, rho_cell, v_cell, dlnrho_dt + real(dp) :: dm_cell + ierr = 0 + + ! shortcuts ----------------------------------------------------------- + r_cell = 0.5d0*(wrap_r_00(s,k) + wrap_r_p1(s,k)) + rho_cell = wrap_d_00(s,k) + v_cell = wrap_v_00(s,k) ! cell-centred velocity (u_flag) + dlnrho_dt = wrap_dxh_lnd(s,k) / s%dt ! (∂/∂t)lnρ + dm_cell = s%dm(k) ! cell mass + + ! Eq. (5) + d_v_div_r = -dm_cell/(4d0*pi*rho_cell) * & + ( dlnrho_dt/pow3(r_cell) & + + 3d0*v_cell/pow4(r_cell) ) + + ! units check: (g) / (g cm) * (s⁻¹ cm⁻3) = s⁻¹ ✓ + end function compute_rho_form_of_d_v_div_r + + + + function compute_rho_form_of_d_v_div_r_opt_time_center(s, k, ierr) result(d_v_div_r) ! s^-1 + type(star_info), pointer :: s + integer, intent(in) :: k + integer, intent(out) :: ierr + type(auto_diff_real_star_order1) :: d_v_div_r + type(auto_diff_real_star_order1) :: r_cell, rho_cell, v_cell, dlnrho_dt + real(dp) :: dm_cell + ierr = 0 + + ! shortcuts ----------------------------------------------------------- + r_cell = 0.5d0*(wrap_opt_time_center_r_00(s,k) + wrap_opt_time_center_r_p1(s,k)) + rho_cell = wrap_d_00(s,k) + v_cell = wrap_opt_time_center_v_00(s,k) ! cell-centred velocity (u_flag) + dlnrho_dt = wrap_dxh_lnd(s,k) / s%dt ! (∂/∂t)lnρ + dm_cell = s%dm(k) ! cell mass + + ! Eq. (5) + d_v_div_r = -dm_cell/(4d0*pi*rho_cell) * & + ( dlnrho_dt/pow3(r_cell) & + + 3d0*v_cell/pow4(r_cell) ) + + ! units check: (g) / (g cm) * (s⁻¹ cm⁻3) = s⁻¹ ✓ + end function compute_rho_form_of_d_v_div_r_opt_time_center + + + + function compute_d_v_div_r_opt_time_center(s, k, ierr) result(d_v_div_r) ! s^-1 type (star_info), pointer :: s integer, intent(in) :: k @@ -660,9 +767,21 @@ function compute_Chi_cell(s, k, ierr) result(Chi_cell) type(auto_diff_real_star_order1) :: & rho2, r6_cell, d_v_div_r, Hp_cell, w_00, d_00, r_00, r_p1 real(dp) :: f, ALFAM_ALFA + logical :: dbg include 'formats' ierr = 0 - ALFAM_ALFA = s% RSP2_alfam*s% mixing_length_alpha + dbg = .false. + + ! check where we are getting alfam from. + if (s% MLT_option == 'TDC' .and. .not. s% RSP2_flag) then + ALFAM_ALFA = s% alpha_TDC_DampM * s% mixing_length_alpha + else if (s% RSP2_flag) then + ALFAM_ALFA = s% RSP2_alfam * s% mixing_length_alpha + else ! this is for safety, but probably is never called. + ALFAM_ALFA = 0d0 + end if + + if (ALFAM_ALFA == 0d0 .or. & k <= s% RSP2_num_outermost_cells_forced_nonturbulent .or. & k > s% nz - int(s% nz/s% RSP2_nz_div_IBOTOM)) then @@ -674,9 +793,24 @@ function compute_Chi_cell(s, k, ierr) result(Chi_cell) else Hp_cell = Hp_cell_for_Chi(s, k, ierr) if (ierr /= 0) return - d_v_div_r = compute_d_v_div_r(s, k, ierr) + if (s% u_flag .or. s% TDC_use_density_form_for_eddy_viscosity) then + ! new density derivative term + d_v_div_r = compute_rho_form_of_d_v_div_r(s, k, ierr) + else + d_v_div_r = compute_d_v_div_r(s, k, ierr) + end if if (ierr /= 0) return - w_00 = wrap_w_00(s,k) + + ! don't need to check if mlt_vc > 0 here. + if (s% MLT_option == 'TDC' .and. .not. s% RSP2_flag) then + if (s% have_mlt_vc .and. s% okay_to_set_mlt_vc) then + w_00 = s% mlt_vc_old(k)/sqrt_2_div_3! same as info%A0 from TDC + else + w_00 = s% mlt_vc(k)/sqrt_2_div_3! same as info%A0 from TDC + end if + else ! normal RSP2 + w_00 = wrap_w_00(s,k) + end if d_00 = wrap_d_00(s,k) f = (16d0/3d0)*pi*ALFAM_ALFA/s% dm(k) rho2 = pow2(d_00) @@ -687,10 +821,24 @@ function compute_Chi_cell(s, k, ierr) result(Chi_cell) ! units = g^-1 cm s^-1 g^2 cm^-6 cm^6 s^-1 cm ! = g cm^2 s^-2 ! = erg + + end if s% Chi(k) = Chi_cell%val s% Chi_ad(k) = Chi_cell + if (dbg .and. k==-100) then + write(*,*) ' s% ALFAM_ALFA', ALFAM_ALFA + write(*,*) 'Hp_cell', Hp_cell %val + write(*,*) 'd_v_div_r', d_v_div_r %val + write(*,*) ' f', f + write(*,*) 'w_00',w_00 %val + write(*,*) 'd_00 ', d_00 %val + write(*,*) 'rho2 ', rho2 %val + write(*,*) 'r_00', r_00 %val + write(*,*) 'r_p1 ', r_p1 %val + write(*,*) 'r6_cell', r6_cell %val + end if end function compute_Chi_cell @@ -710,7 +858,14 @@ function compute_Eq_cell(s, k, ierr) result(Eq_cell) ! erg g^-1 s^-1 else Chi_cell = s% Chi_ad(k) ! compute_Chi_cell(s,k,ierr) if (ierr /= 0) return - d_v_div_r = compute_d_v_div_r_opt_time_center(s, k, ierr) + + if (s% u_flag .or. s% TDC_use_density_form_for_eddy_viscosity) then + ! new density derivative term + d_v_div_r = compute_rho_form_of_d_v_div_r_opt_time_center(s, k, ierr) + else + d_v_div_r = compute_d_v_div_r_opt_time_center(s, k, ierr) + end if + if (ierr /= 0) return Eq_cell = 4d0*pi*Chi_cell*d_v_div_r/s% dm(k) ! erg s^-1 g^-1 end if @@ -733,10 +888,14 @@ function compute_Uq_face(s, k, ierr) result(Uq_face) ! cm s^-2, acceleration Uq_face = 0d0 else r_00 = wrap_opt_time_center_r_00(s,k) - Chi_00 = s% Chi_ad(k) ! compute_Chi_cell(s,k,ierr) + + ! which do we adopt? + Chi_00 = compute_Chi_cell(s,k,ierr) ! s% Chi_ad(k) XXX + !Chi_00 = s% Chi_ad(k) ! compute_Chi_cell(s,k,ierr) + if (k > 1) then - !Chi_m1 = shift_m1(compute_Chi_cell(s,k-1,ierr)) - Chi_m1 = shift_m1(s% Chi_ad(k-1)) + Chi_m1 = shift_m1(compute_Chi_cell(s,k-1,ierr)) + !Chi_m1 = shift_m1(s% Chi_ad(k-1)) XXX if (ierr /= 0) return else Chi_m1 = 0d0 diff --git a/star/private/hydro_rsp2_support.f90 b/star/private/hydro_rsp2_support.f90 index 0d6aaabcd..6824f8bfc 100644 --- a/star/private/hydro_rsp2_support.f90 +++ b/star/private/hydro_rsp2_support.f90 @@ -30,7 +30,7 @@ module hydro_rsp2_support implicit none private - public :: remesh_for_RSP2 + public :: remesh_for_RSP2, remesh_for_TDC_pulsations contains @@ -442,4 +442,600 @@ end subroutine set_Hp_face end subroutine remesh_for_RSP2 + subroutine remesh_for_TDC_pulsations(s,ierr) + ! uses these controls + ! RSP2_nz = 150 + ! RSP2_nz_outer = 40 + ! RSP2_T_anchor = 11d3 + ! RSP2_dq_1_factor = 2d0 + use interp_1d_def, only: pm_work_size + use interp_1d_lib, only: interpolate_vector_pm + type (star_info), pointer :: s + integer, intent(out) :: ierr + integer :: k, j, nz_old, nz + real(dp) :: xm_anchor, P_surf, T_surf, old_L1, old_r1, xm_anchor_core + real(dp), parameter :: RSP2_T_core = 1d6 ! Tcore anchor + real(dp), allocatable, dimension(:) :: & + xm_old, xm, xm_mid_old, xm_mid, v_old, v_new + real(dp), pointer :: work1(:) ! =(nz_old+1, pm_work_size) + include 'formats' + ierr = 0 + nz_old = s% nz + nz = s% RSP2_nz + if (nz == nz_old) return ! assume have already done remesh for RSP2 + if (nz > nz_old) call mesa_error(__FILE__,__LINE__,'remesh_for_RSP2 cannot increase nz') + call setvars2(ierr) + if (ierr /= 0) call mesa_error(__FILE__,__LINE__,'remesh_for_RSP2 failed in setvars') + old_L1 = s% L(1) + old_r1 = s% r(1) + call set_phot_info(s) ! sets Teff + call get_PT_surf2(P_surf, T_surf, ierr) + if (ierr /= 0) call mesa_error(__FILE__,__LINE__,'remesh_for_RSP2 failed in get_PT_surf') + allocate(& + xm_old(nz_old+1), xm_mid_old(nz_old), v_old(nz_old+1), & + xm(nz+1), xm_mid(nz), v_new(nz+1), work1((nz_old+1)*pm_work_size)) + call set_xm_old2 + call find_xm_anchor2 + call find_xm_anchor_core2 + call set_xm_new2 + call interpolate1_face_val2(s% i_lnR, log(max(1d0,s% r_center))) + call check_new_lnR2 + call interpolate1_face_val2(s% i_lum, s% L_center) + !call interpolate_mlt_vc_face_val2() + if (s% i_v /= 0) call interpolate1_face_val2(s% i_v, s% v_center) + call set_new_lnd2 + call interpolate1_cell_val2(s% i_lnT) + !call interpolate1_cell_val(s% i_w) + do j=1,s% species + call interpolate1_xa2(j) + end do + call rescale_xa2 + call revise_lnT_for_QHSE2(P_surf, ierr) + if (ierr /= 0) call mesa_error(__FILE__,__LINE__,'remesh_for_RSP2 failed in revise_lnT_for_QHSE') + do k=1,nz + call set_Hp_face2(k) + end do + deallocate(work1) + s% nz = nz + write(*,1) 'new old L_surf/Lsun', s% xh(s% i_lum,1)/Lsun, old_L1/Lsun + write(*,1) 'new old R_surf/Rsun', exp(s% xh(s% i_lnR,1))/Rsun, old_r1/Rsun + write(*,'(A)') + !call mesa_error(__FILE__,__LINE__,'remesh_for_RSP2') + + contains + + subroutine setvars2(ierr) + use hydro_vars, only: unpack_xh, set_hydro_vars + integer, intent(out) :: ierr + logical, parameter :: & + skip_basic_vars = .false., & + skip_micro_vars = .false., & + skip_m_grav_and_grav = .false., & + skip_net = .true., & + skip_neu = .true., & + skip_kap = .false., & + skip_grads = .true., & + skip_rotation = .true., & + skip_brunt = .true., & + skip_other_cgrav = .true., & + skip_mixing_info = .true., & + skip_set_cz_bdy_mass = .true., & + skip_mlt = .true., & + skip_eos = .false. + ierr = 0 + call unpack_xh(s,ierr) + if (ierr /= 0) call mesa_error(__FILE__,__LINE__,'remesh_for_RSP2 failed in unpack_xh') + call set_hydro_vars( & + s, 1, nz_old, skip_basic_vars, & + skip_micro_vars, skip_m_grav_and_grav, skip_eos, skip_net, skip_neu, & + skip_kap, skip_grads, skip_rotation, skip_brunt, skip_other_cgrav, & + skip_mixing_info, skip_set_cz_bdy_mass, skip_mlt, ierr) + if (ierr /= 0) call mesa_error(__FILE__,__LINE__,'remesh_for_RSP2 failed in set_hydro_vars') + end subroutine setvars2 + + subroutine get_PT_surf2(P_surf, T_surf, ierr) + use atm_support, only: get_atm_PT + real(dp), intent(out) :: P_surf, T_surf + integer, intent(out) :: ierr + real(dp) :: & + Teff, lnT_surf, dlnT_dL, dlnT_dlnR, dlnT_dlnM, dlnT_dlnkap, & + lnP_surf, dlnP_dL, dlnP_dlnR, dlnP_dlnM, dlnP_dlnkap + logical, parameter :: skip_partials = .true. + include 'formats' + ierr = 0 + call set_phot_info(s) ! sets s% Teff + Teff = s% Teff + call get_atm_PT( & ! this uses s% opacity(1) + s, s% tau_factor*s% tau_base, s% L(1), s% r(1), s% m(1), s% cgrav(1), skip_partials, & + Teff, lnT_surf, dlnT_dL, dlnT_dlnR, dlnT_dlnM, dlnT_dlnkap, & + lnP_surf, dlnP_dL, dlnP_dlnR, dlnP_dlnM, dlnP_dlnkap, ierr) + if (ierr /= 0) call mesa_error(__FILE__,__LINE__,'get_P_surf failed in get_atm_PT') + P_surf = exp(lnP_surf) + T_surf = exp(lnT_surf) + return + + write(*,1) 'get_PT_surf P_surf', P_surf + write(*,1) 'get_PT_surf T_surf', T_surf + write(*,1) 'get_PT_surf Teff', Teff + write(*,1) 'get_PT_surf opacity(1)', s% opacity(1) + write(*,1) + !call mesa_error(__FILE__,__LINE__,'get_PT_surf') + end subroutine get_PT_surf2 + + subroutine set_xm_old2 + xm_old(1) = 0d0 + do k=2,nz_old + xm_old(k) = xm_old(k-1) + s% dm(k-1) + end do + xm_old(nz_old+1) = s% xmstar + do k=1,nz_old + xm_mid_old(k) = xm_old(k) + 0.5d0*s% dm(k) + end do + end subroutine set_xm_old2 + + subroutine find_xm_anchor_core2 + implicit none + real(dp) :: lnT_core, xmm1, xm00, lnTm1, lnT00 + integer :: k + include 'formats' + + !-- target ln T for the core anchor + lnT_core = log(RSP2_T_core) + + !-- sanity check: must be hotter than the surface + if ( lnT_core <= s% xh(s% i_lnT,1) ) then + write(*,1) 'T_core < T_surf', RSP2_T_core, exp(s% xh(s% i_lnT,1)) + call mesa_error(__FILE__,__LINE__,'find_xm_anchor_core') + end if + + !-- default if never crossed (should not happen) + xm_anchor_core = xm_old(nz_old) + + !-- find first cell where lnT ≥ lnT_core + do k = 2, nz_old + if ( s% xh(s% i_lnT,k) >= lnT_core ) then + xmm1 = xm_old(k-1) + xm00 = xm_old(k) + lnTm1 = s% xh(s% i_lnT,k-1) + lnT00 = s% xh(s% i_lnT,k) + xm_anchor_core = xmm1 + & + (xm00 - xmm1) * & + (lnT_core - lnTm1) / (lnT00 - lnTm1) + if ( is_bad(xm_anchor_core) .or. xm_anchor_core <= 0d0 ) then + write(*,2) 'bad xm_anchor_core', k, xm_anchor_core, & + xmm1, xm00, lnTm1, lnT00, lnT_core + call mesa_error(__FILE__,__LINE__,'find_xm_anchor_core') + end if + return + end if + end do + end subroutine find_xm_anchor_core2 + + + subroutine find_xm_anchor2 + real(dp) :: lnT_anchor, xmm1, xm00, lnTm1, lnT00 + include 'formats' + lnT_anchor = log(s% RSP2_T_anchor) + if (lnT_anchor <= s% xh(s% i_lnT,1)) then + write(*,1) 'T_anchor < T_surf', s% RSP2_T_anchor, exp(s% xh(s% i_lnT,1)) + call mesa_error(__FILE__,__LINE__,'find_xm_anchor') + end if + xm_anchor = xm_old(nz_old) + do k=2,nz_old + if (s% xh(s% i_lnT,k) >= lnT_anchor) then + xmm1 = xm_old(k-1) + xm00 = xm_old(k) + lnTm1 = s% xh(s% i_lnT,k-1) + lnT00 = s% xh(s% i_lnT,k) + xm_anchor = xmm1 + & + (xm00 - xmm1)*(lnT_anchor - lnTm1)/(lnT00 - lnTm1) + if (is_bad(xm_anchor) .or. xm_anchor <= 0d0) then + write(*,2) 'bad xm_anchor', k, xm_anchor, xmm1, xm00, lnTm1, lnT00, lnT_anchor, s% lnT(1) + call mesa_error(__FILE__,__LINE__,'find_xm_anchor') + end if + return + end if + end do + end subroutine find_xm_anchor2 + + subroutine set_xm_new2 ! sets xm, dm, m, dq, q + integer :: nz_outer, k, n_inner + real(dp) :: dq_1_factor, dxm_outer, lnx, dlnx, base_dm, rem_mass, H, sum_geom + real(dp) :: H_low, H_high, H_mid, f_low, f_high, f_mid + +! integer :: N_lnT, N_log, j, k_old, idx +! real(dp) :: lnT_core_old, lnT_anchor_core, dlnT_step +! real(dp) :: ln_xm_anchor, ln_xm_core, dln_xm, lnT_target +! real(dp) :: ln_xm_center, dln_xm2 + + integer :: iter + include 'formats' + nz_outer = s% RSP2_nz_outer + dq_1_factor = s% RSP2_dq_1_factor + dxm_outer = xm_anchor/(nz_outer - 1d0 + dq_1_factor) + !write(*,2) 'dxm_outer', nz_outer, dxm_outer, xm_anchor + xm(1) = 0d0 + xm(2) = dxm_outer*dq_1_factor + s% dm(1) = xm(2) + do k=3,nz_outer+1 + xm(k) = xm(k-1) + dxm_outer + s% dm(k-1) = dxm_outer + end do + + if ( .not. s% remesh_for_TDC_pulsations_log_core_zoning) then + ! do rsp style core zoning with a power law on dq + + !-- solve for a smooth ramp factor H via bisection ---------------------- + n_inner = nz - nz_outer + rem_mass = s% xmstar - xm(nz_outer+1) + base_dm = dxm_outer ! anchor continuity: first dm equals outer spacing + + ! define function f(H) = base_dm*(sum_{j=1..n_inner-1}H^j) - rem_mass + + H_low = 1.001! Heuristics + H_high = 1.40! Heuristics + ! compute f at bounds + f_low = base_dm*( (H_low*(1d0 - H_low**(n_inner-1))/(1d0 - H_low))) - rem_mass + f_high = base_dm*( (H_high*(1d0 - H_high**(n_inner-1))/(1d0 - H_high))) - rem_mass + do iter = 1, 1000 + H_mid = 0.5d0*(H_low + H_high) + f_mid = base_dm*( (H_mid*(1d0 - H_mid**(n_inner-1))/(1d0 - H_mid))) - rem_mass + if (abs(f_mid) < 1d-12*rem_mass) exit + if (f_low*f_mid <= 0d0) then + H_high = H_mid + f_high = f_mid + else + H_low = H_mid + f_low = f_mid + end if + end do + H = H_mid + + !-- first interior cell: + s% dm(nz_outer+1) = base_dm + xm(nz_outer+2) = xm(nz_outer+1) + s% dm(nz_outer+1) + + !-- subsequent interior cells: ramp by H per zone (except final) + do k = nz_outer+2, nz-1 + s% dm(k) = H**(k - nz_outer - 1) * base_dm + xm(k+1) = xm(k) + s% dm(k) + end do + + !-- final interior cell absorbs any remaining mass + s% dm(nz) = s% xmstar - xm(nz) + xm(nz+1) = s% xmstar + + else ! use log zoning inward from anchor to core. + lnx = log(xm(nz_outer+1)) + if (is_bad(lnx)) then + write(*,2) 'bad lnx', nz_outer+1, lnx, xm(nz_outer+1) + call mesa_error(__FILE__,__LINE__,'set_xm_new') + end if + dlnx = (log(s% xmstar) - lnx)/(nz - nz_outer) + do k=nz_outer+2,nz + lnx = lnx + dlnx + xm(k) = exp(lnx) + s% dm(k-1) = xm(k) - xm(k-1) + end do + s% dm(nz) = s% xmstar - xm(nz) + + +! +! !———— two-stage core zoning ———— +! +! ! 1) how many ΔlnT zones from core-anchor to true core T? +! dlnT_step = 0.05d0 +! lnT_anchor_core = log(RSP2_T_core) +! lnT_core_old = s% xh(s% i_lnT, nz_old) +! N_lnT = int( (lnT_core_old - lnT_anchor_core) / dlnT_step + 0.5d0 ) +! N_lnT = max(1, min(N_lnT, nz - nz_outer)) +! write(*,*) "N_lnT", N_lnT +! ! 2) the rest are log-mass zones between xm_anchor and xm_anchor_core +! N_log = (nz - nz_outer) - N_lnT +! write(*,*) "N_log", N_log +! +! idx = nz_outer + 1 ! first interior boundary +! +! ! — log spacing in xm from xm_anchor → xm_anchor_core +! ln_xm_anchor = log(xm_anchor) +! ln_xm_core = log(xm_anchor_core) +! dln_xm = (ln_xm_core - ln_xm_anchor) / N_log +! do j = 1, N_log +! xm(idx + j) = exp( ln_xm_anchor + dln_xm * j ) +! end do +! +!!! — equal ΔlnT spacing from RSP2_T_core → core +!! do j = 1, N_lnT +!! lnT_target = lnT_anchor_core + dlnT_step * j +!! if (lnT_target > lnT_core_old) lnT_target = lnT_core_old +!! +!! do k_old = 1, nz_old-1 +!! if ( s% xh(s% i_lnT, k_old) <= lnT_target .and. & +!! lnT_target <= s% xh(s% i_lnT, k_old+1) ) then +!! xm(idx + N_log + j) = xm_old(k_old) + & +!! (xm_old(k_old+1)-xm_old(k_old)) * & +!! (lnT_target - s% xh(s% i_lnT, k_old)) / & +!! (s% xh(s% i_lnT, k_old+1)-s% xh(s% i_lnT, k_old)) +!! exit +!! end if +!! end do +!! end do +! +!! — log spacing in xm from xm_anchor_core → center over N_lnT cells +!ln_xm_core = log(xm_anchor_core) +!ln_xm_center = log(s% xmstar) +!dln_xm2 = (ln_xm_center - ln_xm_core) / N_lnT +!do j = 1, N_lnT +! xm(idx + N_log + j) = exp( ln_xm_core + dln_xm2 * j ) +!end do + +!! — **equal-mass** spacing over N_lnT cells from xm_anchor_core → center +!do j = 1, N_lnT +! xm(idx + N_log + j) = xm_anchor_core + & +! (s% xmstar - xm_anchor_core) * j / N_lnT +!end do + + ! — enforce the last boundary at total mass + xm(nz+1) = s% xmstar + + ! — recompute cell masses + do k = nz_outer+1, nz + s% dm(k) = xm(k+1) - xm(k) + end do + + end if + + do k=1,nz-1 + xm_mid(k) = 0.5d0*(xm(k) + xm(k+1)) + end do + xm_mid(nz) = 0.5d0*(xm(nz) + s% xmstar) + s% m(1) = s% mstar + s% q(1) = 1d0 + s% dq(1) = s% dm(1)/s% xmstar + do k=2,nz + s% m(k) = s% m(k-1) - s% dm(k-1) + s% dq(k) = s% dm(k)/s% xmstar + s% q(k) = s% q(k-1) - s% dq(k-1) + end do + call set_dm_bar(s, s% nz, s% dm, s% dm_bar) + return + + do k=2,nz + write(*,2) 'dm(k)/dm(k-1) m(k)', k, s%dm(k)/s%dm(k-1), s%m(k)/Msun + end do + write(*,1) 'm_center', s% m_center/msun + call mesa_error(__FILE__,__LINE__,'set_xm_new') + end subroutine set_xm_new2 + + + subroutine interpolate_mlt_vc_face_val2() ! might be unnecessary +! integer, intent(in) :: i +! real(dp), intent(in) :: cntr_val + do k=1,nz_old + v_old(k) = s% mlt_vc(k) + end do + v_old(nz_old+1) = s%mlt_vc(nz_old) + call interpolate_vector_pm( & + nz_old+1, xm_old, nz+1, xm, v_old, v_new, work1, 'remesh_for_RSP2', ierr) + do k=1,nz + s% mlt_vc(k) = v_new(k) + end do + + ! this could be problematic if mlt_vc_old isnt set +! do k=1,nz_old +! v_old(k) = s% mlt_vc_old(k) +! end do +! v_old(nz_old+1) = s%mlt_vc_old(nz_old) +! call interpolate_vector_pm( & +! nz_old+1, xm_old, nz+1, xm, v_old, v_new, work1, 'remesh_for_RSP2', ierr) +! do k=1,nz +! s% mlt_vc_old(k) = v_new(k) +! end do + end subroutine interpolate_mlt_vc_face_val2 + + subroutine interpolate1_face_val2(i, cntr_val) + integer, intent(in) :: i + real(dp), intent(in) :: cntr_val + do k=1,nz_old + v_old(k) = s% xh(i,k) + end do + v_old(nz_old+1) = cntr_val + call interpolate_vector_pm( & + nz_old+1, xm_old, nz+1, xm, v_old, v_new, work1, 'remesh_for_RSP2', ierr) + do k=1,nz + s% xh(i,k) = v_new(k) + end do + end subroutine interpolate1_face_val2 + + subroutine check_new_lnR2 + include 'formats' + do k=1,nz + s% lnR(k) = s% xh(s% i_lnR,k) + s% r(k) = exp(s% lnR(k)) + end do + do k=1,nz-1 + if (s% r(k) <= s% r(k+1)) then + write(*,2) 'bad r', k, s% r(k), s% r(k+1) + call mesa_error(__FILE__,__LINE__,'check_new_lnR remesh rsp2') + end if + end do + if (s% r(nz) <= s% r_center) then + write(*,2) 'bad r center', nz, s% r(nz), s% r_center + call mesa_error(__FILE__,__LINE__,'check_new_lnR remesh rsp2') + end if + end subroutine check_new_lnR2 + + subroutine set_new_lnd2 + real(dp) :: vol, r300, r3p1 + include 'formats' + do k=1,nz + r300 = pow3(s% r(k)) + if (k < nz) then + r3p1 = pow3(s% r(k+1)) + else + r3p1 = pow3(s% r_center) + end if + vol = (4d0*pi/3d0)*(r300 - r3p1) + s% rho(k) = s% dm(k)/vol + s% lnd(k) = log(s% rho(k)) + s% xh(s% i_lnd,k) = s% lnd(k) + if (is_bad(s% lnd(k))) then + write(*,2) 'bad lnd vol dm r300 r3p1', k, s% lnd(k), vol, s% dm(k), r300, r3p1 + call mesa_error(__FILE__,__LINE__,'remesh for rsp2') + end if + end do + end subroutine set_new_lnd2 + + subroutine interpolate1_cell_val2(i) + integer, intent(in) :: i + do k=1,nz_old + v_old(k) = s% xh(i,k) + end do + call interpolate_vector_pm( & + nz_old, xm_mid_old, nz, xm_mid, v_old, v_new, work1, 'remesh_for_RSP2', ierr) + do k=1,nz + s% xh(i,k) = v_new(k) + end do + end subroutine interpolate1_cell_val2 + + subroutine interpolate1_xa2(j) + integer, intent(in) :: j + do k=1,nz_old + v_old(k) = s% xa(j,k) + end do + call interpolate_vector_pm( & + nz_old, xm_mid_old, nz, xm_mid, v_old, v_new, work1, 'remesh_for_RSP2', ierr) + do k=1,nz + s% xa(j,k) = v_new(k) + end do + end subroutine interpolate1_xa2 + + subroutine rescale_xa2 + integer :: k, j + real(dp) :: sum_xa + do k=1,nz + sum_xa = sum(s% xa(1:s% species,k)) + do j=1,s% species + s% xa(j,k) = s% xa(j,k)/sum_xa + end do + end do + end subroutine rescale_xa2 + + subroutine revise_lnT_for_QHSE2(P_surf, ierr) + use eos_def, only: num_eos_basic_results, num_eos_d_dxa_results + use chem_def, only: chem_isos + use eos_support, only: solve_eos_given_DP + use eos_def, only: i_eta, i_lnfree_e + use kap_def, only: num_kap_fracs + use kap_support, only: get_kap + real(dp), intent(in) :: P_surf + integer, intent(out) :: ierr + real(dp) :: logRho, logP, logT_guess, & + logT_tol, logP_tol, logT, P_m1, P_00, dm_face, & + kap_fracs(num_kap_fracs), kap, dlnkap_dlnRho, dlnkap_dlnT, & + old_kap, new_P_surf, new_T_surf + real(dp), dimension(num_eos_basic_results) :: & + res, d_dlnd, d_dlnT + real(dp) :: dres_dxa(num_eos_d_dxa_results,s% species) + include 'formats' + ierr = 0 + P_m1 = P_surf + do k=1,nz + s% lnT(k) = s% xh(s% i_lnT,k) + s% lnR(k) = s% xh(s% i_lnR,k) + s% r(k) = exp(s% lnR(k)) + end do + !write(*,1) 'before revise_lnT_for_QHSE: logT cntr', s% lnT(nz)/ln10 + do k=1,nz + if (k < nz) then + dm_face = s% dm_bar(k) + else + dm_face = 0.5d0*(s% dm(k-1) + s% dm(k)) + end if + P_00 = P_m1 + s% cgrav(k)*s% m(k)*dm_face/(4d0*pi*pow4(s% r(k))) + logP = log10(P_00) ! value for QHSE + s% lnPeos(k) = logP/ln10 + s% Peos(k) = P_00 + logRho = s% lnd(k)/ln10 + logT_guess = s% lnT(k)/ln10 + logT_tol = 1d-11 + logP_tol = 1d-11 + call solve_eos_given_DP( & + s, k, s% xa(:,k), & + logRho, logP, logT_guess, logT_tol, logP_tol, & + logT, res, d_dlnd, d_dlnT, dres_dxa, ierr) + if (ierr /= 0) then + write(*,2) 'solve_eos_given_DP failed', k + write(*,'(A)') + write(*,1) 'sum(xa)', sum(s% xa(:,k)) + do j=1,s% species + write(*,4) 'xa(j,k) ' // trim(chem_isos% name(s% chem_id(j))), j, j+s% nvar_hydro, k, s% xa(j,k) + end do + write(*,1) 'logRho', logRho + write(*,1) 'logP', logP + write(*,1) 'logT_guess', logT_guess + write(*,1) 'logT_tol', logT_tol + write(*,1) 'logP_tol', logP_tol + write(*,'(A)') + call mesa_error(__FILE__,__LINE__,'revise_lnT_for_QHSE') + end if + s% lnT(k) = logT*ln10 + s% xh(s% i_lnT,k) = s% lnT(k) + !write(*,2) 'logP dlogT logT logT_guess logRho', k, & + ! logP, logT - logT_guess, logT, logT_guess, logRho + P_m1 = P_00 + + if (k == 1) then ! get opacity and recheck surf BCs + call get_kap( & ! assume zbar is set + s, k, s% zbar(k), s% xa(:,k), logRho, logT, & + res(i_lnfree_e), d_dlnd(i_lnfree_e), d_dlnT(i_lnfree_e), & + res(i_eta), d_dlnd(i_eta), d_dlnT(i_eta), & + kap_fracs, kap, dlnkap_dlnRho, dlnkap_dlnT, & + ierr) + if (ierr /= 0) then + write(*,2) 'get_kap failed', k + call mesa_error(__FILE__,__LINE__,'revise_lnT_for_QHSE') + end if + old_kap = s% opacity(1) + s% opacity(1) = kap ! for use by atm surf PT + call get_PT_surf2(new_P_surf, new_T_surf, ierr) + if (ierr /= 0) then + write(*,2) 'get_PT_surf failed', k + call mesa_error(__FILE__,__LINE__,'revise_lnT_for_QHSE') + end if + write(*,1) 'new old T_surf', new_T_surf, T_surf + write(*,1) 'new old P_surf', new_P_surf, P_surf + write(*,1) 'new old kap(1)', kap, old_kap + !call mesa_error(__FILE__,__LINE__,'revise_lnT_for_QHSE') + end if + + end do + !write(*,1) 'after revise_lnT_for_QHSE: logT cntr', s% lnT(nz)/ln10 + !stop + end subroutine revise_lnT_for_QHSE2 + + subroutine set_Hp_face2(k) + use hydro_rsp2, only: get_RSP2_alfa_beta_face_weights + integer, intent(in) :: k + real(dp) :: r_00, d_00, Peos_00, Peos_div_rho, Hp_face, & + d_m1, Peos_m1, alfa, beta + r_00 = s% r(k) + d_00 = s% rho(k) + Peos_00 = s% Peos(k) + if (k == 1) then + Peos_div_rho = Peos_00/d_00 + Hp_face = pow2(r_00)*Peos_div_rho/(s% cgrav(k)*s% m(k)) + else + d_m1 = s% rho(k-1) + Peos_m1 = s% Peos(k-1) + call get_RSP2_alfa_beta_face_weights(s, k, alfa, beta) + Peos_div_rho = alfa*Peos_00/d_00 + beta*Peos_m1/d_m1 + Hp_face = pow2(r_00)*Peos_div_rho/(s% cgrav(k)*s% m(k)) + end if + s% Hp_face(k) = get_scale_height_face_val(s,k)!Hp_face + !s% xh(s% i_Hp, k) = Hp_face + end subroutine set_Hp_face2 + + end subroutine remesh_for_TDC_pulsations + end module hydro_rsp2_support diff --git a/star/private/hydro_temperature.f90 b/star/private/hydro_temperature.f90 index 2e50faf29..a18de3297 100644 --- a/star/private/hydro_temperature.f90 +++ b/star/private/hydro_temperature.f90 @@ -253,6 +253,11 @@ subroutine do1_dlnT_dm_eqn(s, k, nvar, ierr) i_equL = s% i_equL if (i_equL == 0) return + if (k ==1 .and. s% use_RSP_L_eqn_outer_BC) then + call set_RSP_Lsurf_BC(s, nvar, ierr) + return + end if + if (s% use_gradT_actual_vs_gradT_MLT_for_T_gradient_eqn) then call do1_gradT_eqn(s, k, nvar, ierr) return @@ -310,17 +315,98 @@ end subroutine do1_dlnT_dm_eqn + subroutine set_RSP_Lsurf_BC(s, nvar, ierr) + use const_def, only: crad, clight, pi4 + use eos_def + use star_utils, only: save_eqn_residual_info + use auto_diff_support + implicit none + + type(star_info), pointer :: s + integer, intent(out) :: ierr + integer, intent(in) :: nvar + + type(auto_diff_real_star_order1) :: L1_ad, r1_ad, area_ad, rhs_ad, lhs_ad, resid_ad + type(auto_diff_real_star_order1) :: T_surf, Erad_ad + integer :: i_equL + real(dp) :: factor, scale + logical :: debug + + ierr = 0 + debug = .false. + + i_equL = s% i_equL + + if (s%nz < 1) then + write(*,*) 'ERROR: Insufficient zones (nz < 1)' + ierr = -1 + return + end if + + if (debug) write(*,*) 'Exact RSP2 zone 1 surface BC being set' + + ! wrap zone 1 variables + L1_ad = wrap_L_00(s, 1) + r1_ad = wrap_r_00(s, 1) + area_ad = pi4 * pow2(r1_ad) + T_surf = wrap_T_00(s,1) + + if (debug) then + write(*,*) 'T_surf =', T_surf%val, ' r_surf =', r1_ad%val, ' area =', area_ad%val + end if + + ! rsp2 equation, zone 1: + rhs_ad = s%RSP2_Lsurf_factor * area_ad * clight * (crad * pow4(T_surf)) ! missing Lc at the moment, so only radiative surface + + if (debug) then + write(*,*) 'RSP2_Lsurf_factor =', s%RSP2_Lsurf_factor + write(*,*) 'rhs_ad (exact RSP2 BC) =', rhs_ad%val + end if + + ! residual + lhs_ad = L1_ad + resid_ad = lhs_ad - rhs_ad + + scale =maxval(s% L_start(1:s% nz))!abs(s% L_start(1)) ! maybe use maxval(s% L_start(1:s% nz)) + resid_ad = resid_ad / scale + + if (debug) then + write(*,*) 'lhs (L1) =', lhs_ad%val + write(*,*) 'scaled residual =', resid_ad%val + end if + + s%equ(i_equL,1) = resid_ad%val + + if (is_bad(resid_ad%val)) then + write(*,*) 'ERROR: NaN or Inf residual:', resid_ad%val + ierr = -1 + end if + + call save_eqn_residual_info( & + s, 1, nvar, i_equL, resid_ad, 'do1_dlnT_dm_eqn', ierr) + + + end subroutine set_RSP_Lsurf_BC + + + + + + + + ! only used for dlnT_dm equation subroutine eval_dlnPdm_qhse(s, k, & ! calculate the expected dlnPdm for HSE dlnPdm_qhse, Ppoint, ierr) use hydro_momentum, only: expected_HSE_grav_term + use star_utils, only: get_area_info_opt_time_center type (star_info), pointer :: s integer, intent(in) :: k type(auto_diff_real_star_order1), intent(out) :: dlnPdm_qhse, Ppoint integer, intent(out) :: ierr real(dp) :: alfa - type(auto_diff_real_star_order1) :: grav, area, P00, Pm1 + type(auto_diff_real_star_order1) :: grav, area, P00, Pm1, inv_R2, mlt_Ptrb00, mlt_Ptrbm1 include 'formats' ierr = 0 @@ -330,17 +416,39 @@ subroutine eval_dlnPdm_qhse(s, k, & ! calculate the expected dlnPdm for HSE ! for rotation, multiply gravity by factor fp. MESA 2, eqn 22. - call expected_HSE_grav_term(s, k, grav, area, ierr) +! if (s% make_mlt_hydrodynamic .and. (s%v_flag .or. s% u_flag)) then +! call get_area_info_opt_time_center(s, k, area, inv_R2, ierr) +! grav = wrap_geff_face(s,k) +! else + call expected_HSE_grav_term(s, k, grav, area, ierr) +! end if + if (ierr /= 0) return - P00 = wrap_Peos_00(s,k) + ! mlt_pturb in thermodynamic gradients does not currently support time centering + if ((s% have_mlt_vc .and. s% okay_to_set_mlt_vc) .and. s% include_mlt_Pturb_in_thermodynamic_gradients & + .and. s% mlt_Pturb_factor > 0d0 .and. k > 1 .and. .not. s% using_velocity_time_centering) then + mlt_Ptrb00 = s% mlt_Pturb_factor*pow2(s% mlt_vc_old(k))*wrap_d_00(s,k)/3d0 + mlt_Ptrbm1 = s% mlt_Pturb_factor*pow2(s% mlt_vc_old(k))*wrap_d_m1(s,k)/3d0 + else if ((s% have_mlt_vc .and. s% okay_to_set_mlt_vc) .and. s% include_mlt_Pturb_in_thermodynamic_gradients & + .and. s% mlt_Pturb_factor > 0d0 .and. k == 1 .and. .not. s% using_velocity_time_centering) then + mlt_Ptrb00 = s% mlt_Pturb_factor*pow2(s% mlt_vc_old(k))*wrap_d_00(s,k)/3d0 + mlt_Ptrbm1 = 0d0 + else + mlt_Ptrb00 = 0d0 + mlt_Ptrbm1 = 0d0 + end if + + P00 = wrap_Peos_00(s,k) + mlt_Ptrb00 ! probably don't want to add 0d0, even if safe. + + ! mlt Pturb doesn't support time centering yet. if (s% using_velocity_time_centering) P00 = 0.5d0*(P00 + s% Peos_start(k)) if (k == 1) then Pm1 = 0d0 - Ppoint = P00 + Ppoint = P00 + mlt_Ptrb00 else - Pm1 = wrap_Peos_m1(s,k) + Pm1 = wrap_Peos_m1(s,k) + mlt_Ptrbm1 alfa = s% dq(k-1)/(s% dq(k-1) + s% dq(k)) Ppoint = alfa*P00 + (1d0-alfa)*Pm1 end if diff --git a/star/private/hydro_vars.f90 b/star/private/hydro_vars.f90 index 905af43ef..b98277666 100644 --- a/star/private/hydro_vars.f90 +++ b/star/private/hydro_vars.f90 @@ -484,7 +484,7 @@ subroutine set_hydro_vars( & use hydro_rotation, only: set_rotation_info, compute_j_fluxes_and_extra_jdot use brunt, only: do_brunt_B, do_brunt_N2 use mix_info, only: set_mixing_info - use hydro_rsp2, only: set_RSP2_vars + use hydro_rsp2, only: set_RSP2_vars, set_viscosity_vars_TDC type (star_info), pointer :: s integer, intent(in) :: nzlo, nzhi @@ -597,6 +597,15 @@ subroutine set_hydro_vars( & else s% gradr_factor(nzlo:nzhi) = 1d0 end if + + if (s% alpha_TDC_DampM > 0) then + call set_viscosity_vars_TDC(s,ierr) + if (ierr /= 0) then + if (len_trim(s% retry_message) == 0) s% retry_message = 'set_viscosity_vars_TDC failed' + if (s% report_ierr) write(*,*) 'ierr from set_viscosity_vars_TDC' + return + end if + end if call set_mlt_vars(s, nzlo, nzhi, ierr) if (failed('set_mlt_vars')) return @@ -635,6 +644,7 @@ subroutine set_hydro_vars( & end if end if + if (s% doing_timing) & call update_time(s, time0, total, s% time_set_hydro_vars) diff --git a/star/private/mesh_plan.f90 b/star/private/mesh_plan.f90 index bea6d48f3..17a40bf78 100644 --- a/star/private/mesh_plan.f90 +++ b/star/private/mesh_plan.f90 @@ -40,15 +40,16 @@ subroutine do_mesh_plan( & min_dq_in, max_dq, min_dq_for_split, mesh_max_allowed_ratio, & do_not_split, num_gvals, gval_names, & gval_is_xa_function, gval_is_logT_function, gvals, & - delta_gval_max, max_center_cell_dq, max_surface_cell_dq, & - max_num_subcells, max_num_merge_cells, & + delta_gval_max, max_center_cell_dq, max_surface_cell_dq, min_surface_cell_dq, & + max_num_subcells, max_num_merge_cells, max_num_merge_surface_cells, & nz_new, xq_new, dq_new, which_gval, comes_from, ierr) ! return keep_going, or terminate use mesh_functions, only: max_allowed_gvals ! inputs type (star_info), pointer :: s integer, intent(in) :: nz_old, max_allowed_nz, max_num_subcells, & - max_num_merge_cells, max_k_old_for_split_in, min_k_old_for_split_in + max_num_merge_cells, max_num_merge_surface_cells, max_k_old_for_split_in, & + min_k_old_for_split_in logical, intent(in) :: okay_to_merge real(dp), pointer :: D_mix(:) ! (nz_old) real(dp), pointer :: xq_old(:) ! (nz_old) @@ -60,7 +61,8 @@ subroutine do_mesh_plan( & logical, dimension(max_allowed_gvals) :: gval_is_xa_function, gval_is_logT_function real(dp), pointer :: gvals(:,:) ! (nz_old, num_gvals) real(dp), pointer :: delta_gval_max(:) ! (nz_old) - real(dp), intent(in) :: max_center_cell_dq, max_surface_cell_dq + real(dp), intent(in) :: max_center_cell_dq, max_surface_cell_dq, & + min_surface_cell_dq ! outputs integer, intent(out) :: nz_new real(dp), pointer :: xq_new(:), dq_new(:) ! (nz_new) @@ -75,7 +77,7 @@ subroutine do_mesh_plan( & integer, intent(out) :: ierr integer :: j, k, k_old, k_new, nz, new_capacity, iounit, species, & - max_num_merge_surface_cells, max_k_old_for_split, min_k_old_for_split + max_k_old_for_split, min_k_old_for_split real(dp) :: D_mix_cutoff, next_xq, next_dq, max_dq_cntr, & dq_sum, min_dq, min_dq_for_xa, min_dq_for_logT @@ -99,8 +101,6 @@ subroutine do_mesh_plan( & min_k_old_for_split = min_k_old_for_split_in end if - max_num_merge_surface_cells = max_num_merge_cells ! for now - if (max_dq < min_dq) then write(*,1) 'ERROR in controls: max_dq < min_dq', max_dq, min_dq ierr = -1 @@ -699,9 +699,15 @@ subroutine pick_new_points(s, ierr) next_dq = max_surface_cell_dq end if + ! Enforce minimum surface‐cell dq + if (k_old == 1 .and. next_dq < min_surface_cell_dq) then + !write(*,*) 'next_dq < min_surface_cell_dq' + next_dq = min_surface_cell_dq + end if + next_xq = xq_new(k_new) + next_dq - if (next_xq > 1 - min_dq) then - next_xq = (1 + xq_new(k_new))/2 + if (next_xq > 1d0 - min_dq) then + next_xq = (1d0 + xq_new(k_new))/2d0 if (k_old < nz_old) then ! make sure don't split current k_old for this case if (xq_old(k_old+1) > next_xq) next_xq = xq_old(k_old+1) end if @@ -711,7 +717,7 @@ subroutine pick_new_points(s, ierr) if (k_old < nz_old) then if (xq_new(k_new) == xq_old(k_old) .and. & - next_dq > dq_old(k_old) - min_dq/2) then + next_dq > dq_old(k_old) - min_dq/2d0) then if (.not. okay_to_merge) then @@ -741,7 +747,7 @@ subroutine pick_new_points(s, ierr) ! don't merge across convective or crystal boundary k_old_next = kk-1 exit - else if (next_xq <= xq_old(kk) + min_dq/2) then + else if (next_xq <= xq_old(kk) + min_dq/2d0) then k_old_next = max(k_old+1,kk-1) exit end if @@ -753,7 +759,7 @@ subroutine pick_new_points(s, ierr) next_xq = xq_old(k_old_next) next_dq = next_xq - xq_new(k_new) - else if (next_xq >= xq_old(k_old+1) - min_dq/2) then + else if (next_xq >= xq_old(k_old+1) - min_dq/2d0) then ! this is final subcell of a split, so adjust to finish the parent cell k_old_next = k_old+1 diff --git a/star/private/micro.f90 b/star/private/micro.f90 index c54e39679..499a887de 100644 --- a/star/private/micro.f90 +++ b/star/private/micro.f90 @@ -461,7 +461,7 @@ subroutine store_eos_for_cell(s, k, res, d_dlnd, d_dlnT, d_dxa, ierr) end if return end if - s% Prad(k) = crad * T*T*T*T / 3 + s% Prad(k) = crad * T*T*T*T / 3d0 s% Peos(k) = s% Prad(k) + s% Pgas(k) s% lnPeos(k) = log(s% Peos(k)) s% lnS(k) = res(i_lnS) diff --git a/star/private/profile_getval.f90 b/star/private/profile_getval.f90 index 1ee201039..5f9b1f4f9 100644 --- a/star/private/profile_getval.f90 +++ b/star/private/profile_getval.f90 @@ -1892,11 +1892,11 @@ subroutine getval_for_profile(s, c, k, val, int_flag, int_val) case(p_PII_face) if (rsp_or_w) val = s% PII(k) case(p_Chi) - if (rsp_or_w) val = s% Chi(k) + val = s% Chi(k) case(p_Eq) - if (rsp_or_w) val = s% Eq(k) + val = s% Eq(k) case(p_Uq) - if (rsp_or_w) val = s% Uq(k) + val = s% Uq(k) case(p_Lr) val = get_Lrad(s,k) case(p_Lr_div_L) diff --git a/star/private/read_model.f90 b/star/private/read_model.f90 index b8fafa85a..615664fae 100644 --- a/star/private/read_model.f90 +++ b/star/private/read_model.f90 @@ -72,7 +72,7 @@ subroutine finish_load_model(s, restart, ierr) total_angular_momentum, reset_epsnuc_vectors, set_qs use hydro_rotation, only: use_xh_to_update_i_rot_and_j_rot, & set_i_rot_from_omega_and_j_rot, use_xh_to_update_i_rot, set_rotation_info - use hydro_RSP2, only: set_RSP2_vars + use hydro_RSP2, only: set_RSP2_vars, set_viscosity_vars_TDC use RSP, only: RSP_setup_part1, RSP_setup_part2 use report, only: do_report use alloc, only: fill_ad_with_zeros @@ -160,6 +160,7 @@ subroutine finish_load_model(s, restart, ierr) s% doing_finish_load_model = .true. call set_vars(s, s% dt, ierr) if (ierr == 0 .and. s% RSP2_flag) call set_RSP2_vars(s,ierr) + if (ierr == 0 .and. s% alpha_TDC_DampM > 0) call set_viscosity_vars_TDC(s,ierr) s% doing_finish_load_model = .false. if (ierr /= 0) then write(*,*) 'finish_load_model: failed in set_vars' diff --git a/star/private/set_flags.f90 b/star/private/set_flags.f90 index 202eb682d..e772cf4c3 100644 --- a/star/private/set_flags.f90 +++ b/star/private/set_flags.f90 @@ -185,6 +185,7 @@ subroutine set_u_flag(id, u_flag, ierr) call set_v_flag(id, .false., ierr) end if + contains subroutine del(xs) @@ -287,6 +288,39 @@ end subroutine insert end subroutine set_RTI_flag + subroutine set_TDC_to_RSP2_mesh(id, ierr) + use hydro_rsp2_support, only: remesh_for_TDC_pulsations + use hydro_vars, only: set_vars + use star_utils, only: set_m_and_dm, set_dm_bar, set_qs + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + integer :: nvar_hydro_old, i, k, nz + logical, parameter :: dbg = .false. + + include 'formats' + + ierr = 0 + call get_star_ptr(id, s, ierr) + if (ierr /= 0) return + + + nz = s% nz + + nvar_hydro_old = s% nvar_hydro + + write(*,*) 'doing automatic RSP style remesh for TDC Pulsations' + call remesh_for_TDC_pulsations(s,ierr) + if (ierr /= 0) return + call set_qs(s, nz, s% q, s% dq, ierr) + if (ierr /= 0) return + call set_m_and_dm(s) + call set_dm_bar(s, nz, s% dm, s% dm_bar) + call set_vars(s, s% dt, ierr) ! redo after remesh_for_RSP2 + if (ierr /= 0) return + + end subroutine set_TDC_to_RSP2_mesh + subroutine set_RSP2_flag(id, RSP2_flag, ierr) use const_def, only: sqrt_2_div_3 use hydro_vars, only: set_vars diff --git a/star/private/solver_support.f90 b/star/private/solver_support.f90 index 70d05ca43..3044c2a52 100644 --- a/star/private/solver_support.f90 +++ b/star/private/solver_support.f90 @@ -1078,7 +1078,7 @@ subroutine set_vars_for_solver(s, nvar, nzlo, nzhi, dt, ierr) if (do_edit_lnR) s% r(k) = exp(s% lnR(k)) call set_rv_info(s,k) ! note: m_grav is held constant during solver iterations - s% grav(k) = s% cgrav(k)*s% m_grav(k)/(s% r(k)*s% r(k)) + s% grav(k) = s% cgrav(k)*s% m_grav(k)/(s% r(k)*s% r(k)) ! why is this here? end do if (do_lnR) then diff --git a/star/private/star_utils.f90 b/star/private/star_utils.f90 index f5c578885..90256e6c7 100644 --- a/star/private/star_utils.f90 +++ b/star/private/star_utils.f90 @@ -85,6 +85,7 @@ module star_utils public :: weighted_smoothing public :: get_kap_face public :: get_rho_face + public :: get_rho_start_face public :: get_chirho_face public :: get_chit_face public :: get_t_face @@ -402,7 +403,7 @@ subroutine set_m_grav_and_grav(s) ! using mass_corrections do k=1,nz ! We need to call set_m_grav_and_grav during model loading before we have set all vars call get_r_and_lnR_from_xh(s, k, r, lnR) - s% grav(k) = s% cgrav(k)*s% m_grav(k)/(r*r) + s% grav(k) = s% cgrav(k)*s% m_grav(k)/(r*r) ! needs replaced with new wrapper for geff for hydro. end do end subroutine set_m_grav_and_grav @@ -1710,7 +1711,7 @@ end subroutine check_dequ end subroutine store_partials - subroutine set_scale_height(s) + subroutine set_scale_height(s) ! do i need to alter this to use geff, it doesn't look like it's used in mlt... type (star_info), pointer :: s real(dp) :: Hp, alt_Hp, alfa, beta, rho_face, Peos_face integer :: k @@ -3793,6 +3794,18 @@ real(dp) function get_rho_face_val(s,k) result(rho_face) rho_face = alfa*s% rho(k) + beta*s% rho(k-1) end function get_rho_face_val + function get_rho_start_face(s,k) result(rho_face) + type (star_info), pointer :: s + integer, intent(in) :: k + type(auto_diff_real_star_order1) :: rho_face + real(dp) :: alfa, beta + if (k == 1) then + rho_face = wrap_d_00_start(s,k) + return + end if + call get_face_weights(s, k, alfa, beta) + rho_face = alfa*wrap_d_00_start(s,k) + beta*wrap_d_m1_start(s,k) + end function get_rho_start_face function get_T_face(s,k) result(T_face) type (star_info), pointer :: s @@ -3889,14 +3902,20 @@ end function get_kap_face function get_grada_face(s,k) result(grada_face) type (star_info), pointer :: s integer, intent(in) :: k - type(auto_diff_real_star_order1) :: grada_face + type(auto_diff_real_star_order1) :: grada_face, mlt_Pturb_ad, P real(dp) :: alfa, beta + P = get_Peos_face(s,k) if (k == 1) then grada_face = wrap_grad_ad_00(s,k) return end if call get_face_weights(s, k, alfa, beta) grada_face = alfa*wrap_grad_ad_00(s,k) + beta*wrap_grad_ad_m1(s,k) + if (s% have_mlt_vc .and. s% okay_to_set_mlt_vc .and. s% include_mlt_Pturb_in_thermodynamic_gradients & + .and. s% mlt_Pturb_factor > 0d0 .and. k > 1) then + mlt_Pturb_ad = s% mlt_Pturb_factor*pow2(s% mlt_vc_old(k))*get_rho_face(s,k)/3d0 + grada_face = grada_face*P/(P+mlt_Pturb_ad) + end if end function get_grada_face @@ -3904,13 +3923,20 @@ function get_gradr_face(s,k) result(gradr) type (star_info), pointer :: s integer, intent(in) :: k type(auto_diff_real_star_order1) :: gradr - type(auto_diff_real_star_order1) :: P, opacity, L, Pr + type(auto_diff_real_star_order1) :: P, opacity, L, Pr, geff, r, mlt_Pturb_ad !include 'formats' P = get_Peos_face(s,k) opacity = get_kap_face(s,k) L = wrap_L_00(s,k) + r = wrap_r_00(s,k) Pr = get_Prad_face(s,k) - gradr = P*opacity*L/(16d0*pi*clight*s% m_grav(k)*s% cgrav(k)*Pr) + geff = wrap_geff_face(s,k) ! now supports hse and hydro form of g + gradr = P*opacity*L/(16d0*pi*clight*geff*pow2(r)*Pr) + if (s% have_mlt_vc .and. s% okay_to_set_mlt_vc .and. s% include_mlt_Pturb_in_thermodynamic_gradients & + .and. s% mlt_Pturb_factor > 0d0 .and. k > 1) then + mlt_Pturb_ad = s% mlt_Pturb_factor*pow2(s% mlt_vc_old(k))*get_rho_face(s,k)/3d0 + gradr = gradr*P/(P+mlt_Pturb_ad) + end if end function get_gradr_face @@ -3922,7 +3948,7 @@ function get_scale_height_face(s,k) result(scale_height) real(dp) :: G include 'formats' G = s% cgrav(k) - grav = G*s% m_grav(k)/pow2(wrap_r_00(s,k)) + grav = wrap_geff_face(s,k) ! old form is G*s% m_grav(k)/pow2(wrap_r_00(s,k)) P = get_Peos_face(s,k) rho = get_rho_face(s,k) scale_height = P/(grav*rho) ! this assumes HSE @@ -3940,15 +3966,15 @@ end function get_scale_height_face real(dp) function get_scale_height_face_val(s,k) result(scale_height) type (star_info), pointer :: s integer, intent(in) :: k - real(dp) :: G, grav, scale_height2, P, rho - type(auto_diff_real_star_order1) :: P_face, rho_face + real(dp) :: G, scale_height2, P, rho + type(auto_diff_real_star_order1) :: P_face, rho_face, grav G = s% cgrav(k) - grav = G*s% m_grav(k)/pow2(s% r(k)) + grav = wrap_geff_face(s,k) ! old form is G*s% m_grav(k)/pow2(wrap_r_00(s,k)) P_face = get_Peos_face(s,k) P = P_face%val rho_face = get_rho_face(s,k) rho = rho_face%val - scale_height = P/(grav*rho) ! this assumes HSE + scale_height = P/(grav%val*rho) ! this assumes HSE, unles make_mlt_hydrodynamic = .true. if (s% alt_scale_height_flag) then ! consider sound speed*hydro time scale as an alternative scale height ! (this comes from Eggleton's code.) diff --git a/star/private/turb_support.f90 b/star/private/turb_support.f90 index 333df7232..f3f610337 100644 --- a/star/private/turb_support.f90 +++ b/star/private/turb_support.f90 @@ -116,7 +116,7 @@ subroutine do1_mlt_eval( & real(dp) :: cgrav, m, XH1 integer :: iso - type(auto_diff_real_star_order1) :: gradr, r, L, T, P, opacity, rho, dV, chiRho, chiT, Cp + type(auto_diff_real_star_order1) :: gradr, r, L, T, P, opacity, rho, dV, chiRho, chiT, Cp, rho_start include 'formats' ierr = 0 @@ -126,11 +126,12 @@ subroutine do1_mlt_eval( & m = s% m_grav(k) L = wrap_L_00(s,k) T = get_T_face(s,k) - P = get_Peos_face(s,k) + P = get_Peos_face(s,k) ! missing Pturb component r = wrap_r_00(s,k) opacity = get_kap_face(s,k) - rho = get_Rho_face(s,k) - dV = 1d0/rho - 1d0/s% rho_start(k) + rho = get_rho_face(s,k) + rho_start = get_rho_start_face(s,k) + dV = 1d0/rho - 1d0/rho_start ! both variables are face wrapped. chiRho = get_ChiRho_face(s,k) chiT = get_ChiT_face(s,k) Cp = get_Cp_face(s,k) @@ -165,6 +166,7 @@ subroutine Get_results(s, k, MLT_option, & ! NOTE: k=0 is a valid arg alpha_semiconvection, thermohaline_coeff, & mixing_type, gradT, Y_face, conv_vel, D, Gamma, ierr) use star_utils + use hydro_rsp2, only: compute_Eq_cell type (star_info), pointer :: s integer, intent(in) :: k character (len=*), intent(in) :: MLT_option @@ -184,19 +186,56 @@ subroutine Get_results(s, k, MLT_option, & ! NOTE: k=0 is a valid arg ! these are used by use_superad_reduction real(dp) :: Gamma_limit, scale_value1, scale_value2, diff_grads_limit, reduction_limit, lambda_limit type(auto_diff_real_star_order1) :: Lrad_div_Ledd, Gamma_inv_threshold, Gamma_factor, alfa0, & - diff_grads_factor, Gamma_term, exp_limit, grad_scale, gradr_scaled - + diff_grads_factor, Gamma_term, exp_limit, grad_scale, gradr_scaled, Eq_div_w, check_Eq, mlt_Pturb, Ptot + character (len=256) :: message logical :: test_partials, using_TDC logical, parameter :: report = .false. include 'formats' - ! Pre-calculate some things. + ! check if this particular k can be done with TDC + using_TDC = .false. + if (s% MLT_option == 'TDC') using_TDC = .true. + if (.not. s% have_mlt_vc) using_TDC = .false. + if (k <= 0 .or. s%dt <= 0d0) using_TDC = .false. + if (using_TDC) using_TDC = .not. check_if_must_fall_back_to_MLT(s, k) + + ! Pre-calculate some things. + Eq_div_w = 0d0 + if (s% v_flag .or. s% u_flag) then ! only include Eq_div_w if v_flag or u_flag is true. + if (using_TDC .and. s% alpha_TDC_DampM > 0) then + if (s% have_mlt_vc .and. s% okay_to_set_mlt_vc) then + if (s% mlt_vc_old(k) > 0) then ! calculate using mlt_vc from previous timestep. + check_Eq = compute_Eq_cell(s, k, ierr) + Eq_div_w = check_Eq/(s% mlt_vc_old(k)/sqrt_2_div_3) + end if + else ! if mlt_vc_old is not set, i.e. when building a new model. + if (s% mlt_vc(k) > 0) then ! calculate using mlt_vc from current timestep. + check_Eq = compute_Eq_cell(s, k, ierr) + Eq_div_w = check_Eq/(s% mlt_vc(k)/sqrt_2_div_3) + end if + end if + end if + end if + + ! Wrap Pturb into P + if (s% okay_to_set_mlt_vc .and. s% include_mlt_Pturb_in_thermodynamic_gradients) then + mlt_Pturb = s% mlt_Pturb_factor*pow2(s% mlt_vc_old(k))*get_rho_face(s,k)/3d0 + Ptot = P + mlt_Pturb + else + Ptot = P + end if + Pr = crad*pow4(T)/3d0 - Pg = P - Pr - beta = Pg / P + Pg = Ptot - Pr + beta = Pg / Ptot Lambda = mixing_length_alpha*scale_height - grav = cgrav*m/pow2(r) - max_conv_vel = 1d99 + + if (k == 0) then + grav = cgrav*m/pow2(r) + else + grav = wrap_geff_face(s,k) !actual geff = g - dv/dt + end if + if (s% use_Ledoux_criterion) then gradL = grada + gradL_composition_term ! Ledoux temperature gradient else @@ -240,14 +279,6 @@ subroutine Get_results(s, k, MLT_option, & ! NOTE: k=0 is a valid arg k, s% solver_iter, s% model_number, gradr%val, grada%val, scale_height%val end if - - ! check if this particular k can be done with TDC - using_TDC = .false. - if (s% MLT_option == 'TDC') using_TDC = .true. - if (.not. s% have_mlt_vc) using_TDC = .false. - if (k <= 0 .or. s%dt <= 0d0) using_TDC = .false. - if (using_TDC) using_TDC = .not. check_if_must_fall_back_to_MLT(s, k) - if (k >= 1) then s% dvc_dt_TDC(k) = 0d0 end if @@ -268,10 +299,9 @@ subroutine Get_results(s, k, MLT_option, & ! NOTE: k=0 is a valid arg end if call set_TDC(& - conv_vel_start, mixing_length_alpha, & - s% alpha_TDC_DAMP, s%alpha_TDC_DAMPR, s%alpha_TDC_PtdVdt, s%dt, cgrav, m, report, & - mixing_type, scale, chiT, chiRho, gradr, r, P, T, rho, dV, Cp, opacity, & - scale_height, gradL, grada, conv_vel, D, Y_face, gradT, s%tdc_num_iters(k), max_conv_vel, ierr) + conv_vel_start, mixing_length_alpha, s% alpha_TDC_DAMP, s%alpha_TDC_DAMPR, s%alpha_TDC_PtdVdt, s%dt, cgrav, m, report, & + mixing_type, scale, chiT, chiRho, gradr, r, Ptot, T, rho, dV, Cp, opacity, & + scale_height, gradL, grada, conv_vel, D, Y_face, gradT, s%tdc_num_iters(k), max_conv_vel, Eq_div_w, grav, s% include_mlt_corr_to_TDC, ierr) s% dvc_dt_TDC(k) = (conv_vel%val - conv_vel_start) / s%dt if (ierr /= 0) then @@ -287,10 +317,9 @@ subroutine Get_results(s, k, MLT_option, & ! NOTE: k=0 is a valid arg call set_superad_reduction if (Gamma_factor > 1d0) then call set_TDC(& - conv_vel_start, mixing_length_alpha, & - s% alpha_TDC_DAMP, s%alpha_TDC_DAMPR, s%alpha_TDC_PtdVdt, s%dt, cgrav, m, report, & - mixing_type, scale, chiT, chiRho, gradr_scaled, r, P, T, rho, dV, Cp, opacity, & - scale_height, gradL, grada, conv_vel, D, Y_face, gradT, s%tdc_num_iters(k), max_conv_vel, ierr) + conv_vel_start, mixing_length_alpha, s% alpha_TDC_DAMP, s%alpha_TDC_DAMPR, s%alpha_TDC_PtdVdt, s%dt, cgrav, m, report, & + mixing_type, scale, chiT, chiRho, gradr_scaled, r, Ptot, T, rho, dV, Cp, opacity, & + scale_height, gradL, grada, conv_vel, D, Y_face, gradT, s%tdc_num_iters(k), max_conv_vel, Eq_div_w, grav, s% include_mlt_corr_to_TDC, ierr) s% dvc_dt_TDC(k) = (conv_vel%val - conv_vel_start) / s%dt if (ierr /= 0) then if (s% report_ierr) write(*,*) 'ierr from set_TDC when using superad_reduction' @@ -302,7 +331,7 @@ subroutine Get_results(s, k, MLT_option, & ! NOTE: k=0 is a valid arg else if (gradr > gradL) then if (report) write(*,3) 'call set_MLT', k, s% solver_iter call set_MLT(MLT_option, mixing_length_alpha, s% Henyey_MLT_nu_param, s% Henyey_MLT_y_param, & - chiT, chiRho, Cp, grav, Lambda, rho, P, T, opacity, & + chiT, chiRho, Cp, grav, Lambda, rho, Ptot, T, opacity, & gradr, grada, gradL, & Gamma, gradT, Y_face, conv_vel, D, mixing_type, max_conv_vel, ierr) @@ -320,7 +349,7 @@ subroutine Get_results(s, k, MLT_option, & ! NOTE: k=0 is a valid arg call set_superad_reduction if (Gamma_factor > 1d0) then call set_MLT(MLT_option, mixing_length_alpha, s% Henyey_MLT_nu_param, s% Henyey_MLT_y_param, & - chiT, chiRho, Cp, grav, Lambda, rho, P, T, opacity, & + chiT, chiRho, Cp, grav, Lambda, rho, Ptot, T, opacity, & gradr_scaled, grada, gradL, & Gamma, gradT, Y_face, conv_vel, D, mixing_type, max_conv_vel, ierr) @@ -345,7 +374,7 @@ subroutine Get_results(s, k, MLT_option, & ! NOTE: k=0 is a valid arg end if else if (gradr > grada) then if (report) write(*,3) 'call set_semiconvection', k, s% solver_iter - call set_semiconvection(L, Lambda, m, T, P, Pr, beta, opacity, rho, alpha_semiconvection, & + call set_semiconvection(L, Lambda, m, T, Ptot, Pr, beta, opacity, rho, alpha_semiconvection, & s% semiconvection_option, cgrav, Cp, gradr, grada, gradL, & gradL_composition_term, & gradT, Y_face, conv_vel, D, mixing_type, ierr) @@ -367,6 +396,33 @@ subroutine Get_results(s, k, MLT_option, & ! NOTE: k=0 is a valid arg Gamma = 0d0 end if + ! Prevent convection near center of model for TDC pulsations + ! We don't check for the using_TDC flag, because mlt is sometimes called when using TDC + if ( s% TDC_num_innermost_cells_forced_nonturbulent > 0 .and. & + k > s% nz - s% TDC_num_innermost_cells_forced_nonturbulent) then + if (report) write(*,2) 'make TDC center cells non-turbulent', k + mixing_type = no_mixing + gradT = gradr + Y_face = gradT - gradL + conv_vel = 0d0 + D = 0d0 + Gamma = 0d0 + end if + + ! + ! disable negative sources? Makes TDC the same as florida budapest. + !Lconv_ratio = (1d0 - gradT/gradr) ! Lconv/Ltotal = 1 - gradT/gradr + !if ((Lconv_ratio%val < 0d0 .or. is_bad(Lconv_ratio%val))) then + ! if (report) write(*,2) 'Lconv_ratio < 0', k, Lconv_ratio%val + ! mixing_type = no_mixing + ! gradT = gradr + ! Y_face = gradT - gradL + ! conv_vel = 0d0 + ! D = 0d0 + ! Gamma = 0d0 + !end if + + contains subroutine set_superad_reduction() diff --git a/star/public/star_lib.f90 b/star/public/star_lib.f90 index f71f5bc67..410a414d2 100644 --- a/star/public/star_lib.f90 +++ b/star/public/star_lib.f90 @@ -816,6 +816,15 @@ subroutine star_set_j_rot_flag(id, j_rot_flag, ierr) call set_j_rot_flag(id, j_rot_flag, ierr) end subroutine star_set_j_rot_flag + subroutine remesh_for_TDC_pulsation(id, ierr) + use set_flags, only: set_TDC_to_RSP2_mesh + integer, intent(in) :: id + integer, intent(out) :: ierr + type (star_info), pointer :: s + call star_ptr(id, s, ierr) + if (ierr /= 0) return + call set_TDC_to_RSP2_mesh(id, ierr) + end subroutine remesh_for_TDC_pulsation subroutine star_set_RSP2_flag(id, et_flag, ierr) use set_flags, only: set_RSP2_flag diff --git a/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid b/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid index 4af49bc15..a6fbb2a16 100644 --- a/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid +++ b/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid @@ -22,9 +22,9 @@ set_initial_cumulative_energy_error = .true. new_cumulative_energy_error = 0d0 - - !pgstar_flag = .true. - + + pgstar_flag = .true. + / ! end of star_job namelist &eos @@ -51,8 +51,8 @@ x_ctrl(1) = 8.2974 ! expected period (in days) RSP_mass = 6d0 - RSP_Teff = 4892 - RSP_L = 4660 + RSP_Teff = 5559 !4892 + RSP_L = 6250 !4660 RSP_X = 0.730d0 RSP_Z = 0.003d0 ! Y = 0.267d0 @@ -84,7 +84,7 @@ photo_interval = 1000 profile_interval = 4000 history_interval = 10 - terminal_interval = 4000 + terminal_interval = 200 / ! end of controls namelist diff --git a/star/test_suite/rsp_Cepheid_6M/rsp_cepheid_6M_cycle0.mod b/star/test_suite/rsp_Cepheid_6M/rsp_cepheid_6M_cycle0.mod index f5bf4bfae..610f21bf0 100644 --- a/star/test_suite/rsp_Cepheid_6M/rsp_cepheid_6M_cycle0.mod +++ b/star/test_suite/rsp_Cepheid_6M/rsp_cepheid_6M_cycle0.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2b90114c754a84d0876372df20d0db897546c1e30b3645dd45d0a83ec5efa8ee -size 84955 +oid sha256:6efa098dca92b7324e75559e7f69be867dc4620c62a4f3610025f1cf58d00c7b +size 80844 diff --git a/star_data/private/star_controls.inc b/star_data/private/star_controls.inc index 837f17206..4cb1c9f68 100644 --- a/star_data/private/star_controls.inc +++ b/star_data/private/star_controls.inc @@ -418,6 +418,7 @@ logical :: use_momentum_outer_BC logical :: use_zero_Pgas_outer_BC logical :: use_fixed_vsurf_outer_BC + logical :: use_RSP_L_eqn_outer_BC real(dp) :: fixed_vsurf logical :: use_fixed_Psurf_outer_BC real(dp) :: fixed_Psurf @@ -593,8 +594,10 @@ real(dp) :: max_center_cell_dq real(dp) :: max_surface_cell_dq + real(dp) :: min_surface_cell_dq integer :: max_num_subcells integer :: max_num_merge_cells + integer :: max_num_merge_surface_cells character (len=iso_name_length) :: mesh_logX_species(num_mesh_logX) @@ -682,10 +685,14 @@ real(dp) :: split_merge_amr_MaxLong, split_merge_amr_MaxShort, & split_merge_amr_nz_r_core_fraction, & merge_amr_max_abs_du_div_cs, split_merge_amr_dq_min, split_merge_amr_dq_max, & - split_merge_amr_r_core_cm, split_merge_amr_mesh_delta_coeff + split_merge_amr_r_core_cm, split_merge_amr_mesh_delta_coeff, & + merge_amr_logT_for_ignore_core_cells, split_amr_logT_for_ignore_core_cells logical :: merge_amr_ignore_surface_cells integer :: merge_amr_k_for_ignore_surface_cells + logical :: merge_amr_ignore_core_cells + logical :: split_amr_ignore_core_cells + logical :: merge_amr_du_div_cs_limit_only_for_compression logical :: split_merge_amr_avoid_repeated_remesh diff --git a/star_data/private/star_controls_dev.inc b/star_data/private/star_controls_dev.inc index 7dcc951c2..b967bfebb 100644 --- a/star_data/private/star_controls_dev.inc +++ b/star_data/private/star_controls_dev.inc @@ -1,5 +1,12 @@ - - logical :: compare_TDC_to_MLT + + logical :: compare_TDC_to_MLT + + real(dp) :: alpha_TDC_DAMPM + logical :: remesh_for_TDC_pulsations_log_core_zoning + logical :: TDC_use_density_form_for_eddy_viscosity + real(dp) :: TDC_num_innermost_cells_forced_nonturbulent + logical :: include_mlt_Pturb_in_thermodynamic_gradients + logical :: make_mlt_hydrodynamic, include_mlt_corr_to_TDC real(dp) :: RSP2_Lsurf_factor real(dp) :: RSP2_alfap diff --git a/turb/private/tdc_support.f90 b/turb/private/tdc_support.f90 index aae886dea..a7d3fe858 100644 --- a/turb/private/tdc_support.f90 +++ b/turb/private/tdc_support.f90 @@ -62,10 +62,10 @@ module tdc_support !! @param grada grada is the adiabatic dlnT/dlnP, !! @param Gamma Gamma is the MLT Gamma efficiency parameter, which we evaluate in steady state from MLT. type tdc_info - logical :: report + logical :: report, include_mlt_corr_to_TDC real(dp) :: mixing_length_alpha, alpha_TDC_DAMP, alpha_TDC_DAMPR, alpha_TDC_PtdVdt, dt type(auto_diff_real_tdc) :: A0, c0, L, L0, gradL, grada - type(auto_diff_real_star_order1) :: T, rho, dV, Cp, kap, Hp, Gamma + type(auto_diff_real_star_order1) :: T, rho, dV, Cp, kap, Hp, Gamma, Eq_div_w end type tdc_info contains @@ -459,6 +459,7 @@ subroutine compute_Q(info, Y, Q, Af) type(auto_diff_real_tdc), intent(in) :: Y type(auto_diff_real_tdc), intent(out) :: Q, Af type(auto_diff_real_tdc) :: xi0, xi1, xi2, Y_env + type(auto_diff_real_tdc) :: w, G, F, X, FL ! Y = grad-gradL ! Gamma=(grad-gradE)/(gradE-gradL) @@ -469,7 +470,7 @@ subroutine compute_Q(info, Y, Q, Af) ! We only use Y_env /= Y when Y > 0 (i.e. the system is convectively unstable) ! because we only have a Gamma from MLT in that case. ! so when Y < 0 we just use Y_env = Y. - if (Y > 0) then + if (Y > 0 .and. info%include_mlt_corr_to_TDC) then Y_env = Y * convert(info%Gamma/(1+info%Gamma)) else Y_env = Y @@ -479,8 +480,66 @@ subroutine compute_Q(info, Y, Q, Af) call eval_xis(info, Y_env, xi0, xi1, xi2) Af = eval_Af(info%dt, info%A0, xi0, xi1, xi2) + if (.false.) then ! tdc use enthalpy flux limiter use_TDC_enthalpy_flux_limiter + + ! Compute specific enthalpy for flux limiter, can optionally extend with total + ! energy terms from MESA-star, but eos enthalpy is fine approximation for now. + ! w = E+P/ρ ~ Cp*T + w = convert(info%Cp * info%T) + + ! build the correlation function G = α·α_s·cₚ·Y: + G = info%mixing_length_alpha * convert(info%Cp) * Y_env ! assumes alpha_s == 1. + + ! enthalpy flux scale F = √(2/3)·w·√(e_t) + F = sqrt(2d0/3d0)* w * Af ! unused, but can experiment with + + ! rsp form from smolec 2008, we skip this and use G/F instead... + X = sqrt(3d0/2d0)*(convert(info%T)/w)*G ! should be same as G/F + + FL = flux_limiter_function(G/F) ! X + else + FL = 1d0 ! might need to set derivs to 0. + end if + + ! Y_env sets the convective flux but not the radiative flux. - Q = (info%L - info%L0*info%gradL) - info%L0 * Y - info%c0*Af*Y_env + Q = (info%L - info%L0*info%gradL) - info%L0 * Y - info%c0*Af*Y_env!*FL + + contains + + type(auto_diff_real_tdc) function flux_limiter_function(X) result(FL) + implicit none + type(auto_diff_real_tdc), intent(in) :: X + real(dp), parameter :: delta = 0.1_dp + real(dp) :: t, P, dPdt + + if (X%val <= 1.0_dp) then + ! no limiting below X=1 + FL = 1.0_dp + + else if (X%val >= 1.0_dp + delta) then + ! full cap above X=1+delta + FL = 1.0_dp / X%val + + else + ! smooth quintic blend on [1,1+delta] + t = (X%val - 1.0_dp) / delta ! t in [0,1] + + ! S(t) = 6 t^5 − 15 t^4 + 10 t^3 + P = 6.0_dp * pow5(t) -15.0_dp * pow4(t) +10.0_dp * pow3(t) + + ! blend from FL=1 -> FL=1/X + FL%val = (1.0_dp - P) + P / X%val + + ! dP/dt = 30 t^4 − 60 t^3 + 30 t^2 + dPdt = 30.0_dp * pow4(t) -60.0_dp * pow3(t)+ 30.0_dp * pow2(t) + + ! dFL/dX = (dP/dt)/delta * (−1 + 1/X) − P/X^2 + FL%d1val1 = (dPdt / delta) * (-1.0_dp + 1.0_dp/X%val) - P / (X%val * X%val) + end if + + end function flux_limiter_function + end subroutine compute_Q @@ -523,7 +582,7 @@ subroutine eval_xis(info, Y, xi0, xi1, xi2) real(dp), parameter :: x_GAMMAR = 2.d0*sqrt(3.d0) S0 = convert(x_ALFAS*info%mixing_length_alpha*info%Cp*info%T/info%Hp)*info%grada - S0 = S0*Y + S0 = S0*Y + convert(info%Eq_div_w) D0 = convert(info%alpha_TDC_DAMP*x_CEDE/(info%mixing_length_alpha*info%Hp)) gammar_div_alfa = info%alpha_TDC_DAMPR*x_GAMMAR/(info%mixing_length_alpha*info%Hp) DR0 = convert(4d0*boltz_sigma*pow2(gammar_div_alfa)*pow3(info%T)/(pow2(info%rho)*info%Cp*info%kap)) diff --git a/turb/public/turb.f90 b/turb/public/turb.f90 index f1ff3c565..b1e6d386d 100644 --- a/turb/public/turb.f90 +++ b/turb/public/turb.f90 @@ -114,18 +114,18 @@ end subroutine set_thermohaline subroutine set_TDC( & conv_vel_start, mixing_length_alpha, alpha_TDC_DAMP, alpha_TDC_DAMPR, alpha_TDC_PtdVdt, dt, cgrav, m, report, & mixing_type, scale, chiT, chiRho, gradr, r, P, T, rho, dV, Cp, opacity, & - scale_height, gradL, grada, conv_vel, D, Y_face, gradT, tdc_num_iters, max_conv_vel, ierr) + scale_height, gradL, grada, conv_vel, D, Y_face, gradT, tdc_num_iters, max_conv_vel, Eq_div_w, grav, include_mlt_corr_to_TDC, ierr) use tdc use tdc_support real(dp), intent(in) :: conv_vel_start, mixing_length_alpha, alpha_TDC_DAMP, alpha_TDC_DAMPR, alpha_TDC_PtdVdt real(dp), intent(in) :: dt, cgrav, m, scale, max_conv_vel type(auto_diff_real_star_order1), intent(in) :: & - chiT, chiRho, gradr, r, P, T, rho, dV, Cp, opacity, scale_height, gradL, grada - logical, intent(in) :: report + chiT, chiRho, gradr, r, P, T, rho, dV, Cp, opacity, scale_height, gradL, grada, Eq_div_w, grav + logical, intent(in) :: report, include_mlt_corr_to_TDC type(auto_diff_real_star_order1),intent(out) :: conv_vel, Y_face, gradT, D integer, intent(out) :: tdc_num_iters, mixing_type, ierr type(tdc_info) :: info - type(auto_diff_real_star_order1) :: L, grav, Lambda, Gamma + type(auto_diff_real_star_order1) :: L, Lambda, Gamma real(dp), parameter :: alpha_c = (1d0/2d0)*sqrt_2_div_3 real(dp), parameter :: lower_bound_Z = -1d2 real(dp), parameter :: upper_bound_Z = 1d2 @@ -134,7 +134,7 @@ subroutine set_TDC( & include 'formats' ! Do a call to MLT - grav = cgrav * m / pow2(r) + !grav = cgrav * m / pow2(r) L = 64 * pi * boltz_sigma * pow4(T) * grav * pow2(r) * gradr / (3d0 * P * opacity) Lambda = mixing_length_alpha * scale_height call set_MLT('Cox', mixing_length_alpha, 0d0, 0d0, & @@ -145,6 +145,7 @@ subroutine set_TDC( & ! Pack TDC info info%report = report + info%include_mlt_corr_to_TDC = include_mlt_corr_to_TDC info%mixing_length_alpha = mixing_length_alpha info%alpha_TDC_DAMP = alpha_TDC_DAMP info%alpha_TDC_DAMPR = alpha_TDC_DAMPR @@ -154,7 +155,7 @@ subroutine set_TDC( & info%gradL = convert(gradL) info%grada = convert(grada) info%c0 = convert(mixing_length_alpha*alpha_c*rho*T*Cp*4d0*pi*pow2(r)) - info%L0 = convert((16d0*pi*crad*clight/3d0)*cgrav*m*pow4(T)/(P*opacity)) ! assumes QHSE for dP/dm + info%L0 = convert((16d0*pi*crad*clight/3d0)*pow2(r)*grav*pow4(T)/(P*opacity)) ! assumes QHSE for dP/dm, needs correction for if s% make_mlt_hydrodynamic = .false. info%A0 = conv_vel_start/sqrt_2_div_3 info%T = T info%rho = rho @@ -163,6 +164,7 @@ subroutine set_TDC( & info%kap = opacity info%Hp = scale_height info%Gamma = Gamma + info%Eq_div_w = Eq_div_w ! Get solution Zub = upper_bound_Z diff --git a/turb/test/src/test_turb.f90 b/turb/test/src/test_turb.f90 index 4ebfb24ce..3645c7166 100644 --- a/turb/test/src/test_turb.f90 +++ b/turb/test/src/test_turb.f90 @@ -83,11 +83,12 @@ subroutine compare_TDC_and_Cox_MLT() real(dp) :: mixing_length_alpha, conv_vel_start, alpha_TDC_DAMP, alpha_TDC_DAMPR, alpha_TDC_PtdVdt, dt, cgrav, m, scale type(auto_diff_real_star_order1) :: & r, L, T, P, opacity, rho, dV, chiRho, chiT, Cp, gradr, grada, scale_height, gradL, grav, Lambda - type(auto_diff_real_star_order1) :: gradT, Y_face, conv_vel, D, Gamma + type(auto_diff_real_star_order1) :: gradT, Y_face, conv_vel, D, Gamma, Eq_div_w real(dp) :: Henyey_MLT_nu_param, Henyey_MLT_y_param, max_conv_vel + character(len=3) :: MLT_option integer :: mixing_type, ierr, tdc_num_iters - logical :: report + logical :: report, include_mlt_corr_to_TDC include 'formats' @@ -129,7 +130,9 @@ subroutine compare_TDC_and_Cox_MLT() conv_vel_start = 0d0 !1d10 scale = L%val*1d-3 report = .false. - dt = 1d40 ! Long time-step so we get into equilibrium + dt = 1d40 ! Long time-step so we get into equilibrium + Eq_div_w = 0d0 + include_mlt_corr_to_TDC = .true. ! MLT MLT_option = 'Cox' @@ -141,7 +144,8 @@ subroutine compare_TDC_and_Cox_MLT() call set_TDC( & conv_vel_start, mixing_length_alpha, alpha_TDC_DAMP, alpha_TDC_DAMPR, alpha_TDC_PtdVdt, dt, cgrav, m, report, & mixing_type, scale, chiT, chiRho, gradr, r, P, T, rho, dV, Cp, opacity, & - scale_height, gradL, grada, conv_vel, D, Y_face, gradT, tdc_num_iters, max_conv_vel, ierr) + scale_height, gradL, grada, conv_vel, D, Y_face, gradT, tdc_num_iters, max_conv_vel, Eq_div_w, grav, include_mlt_corr_to_TDC, ierr) + write (*, 1) 'TDC: Y, conv_vel_start, conv_vel, dt ', Y_face%val, conv_vel_start, conv_vel%val, dt @@ -159,9 +163,9 @@ subroutine check_TDC() real(dp) :: alpha_TDC_DAMP, alpha_TDC_DAMPR, alpha_TDC_PtdVdt, dt, cgrav, m, scale, max_conv_vel type(auto_diff_real_star_order1) :: & r, L, T, P, opacity, rho, dV, chiRho, chiT, Cp, gradr, grada, scale_height, gradL - type(auto_diff_real_star_order1) :: gradT, Y_face, conv_vel, D + type(auto_diff_real_star_order1) :: gradT, Y_face, conv_vel, D, Eq_div_w, grav integer :: mixing_type, ierr, tdc_num_iters - logical :: report + logical :: report, include_mlt_corr_to_TDC integer :: j include 'formats' @@ -194,7 +198,11 @@ subroutine check_TDC() report = .false. chiT = 1d0 chiRho = 1d0 - gradr = 3d0*P*opacity*L/(64*pi*boltz_sigma*pow4(T)*cgrav*m) + + gradr = 3d0 * P * opacity * L / (64 * pi * boltz_sigma * pow4(T) * cgrav * m) + grav = m * cgrav / pow2(r) + Eq_div_w = 0d0 + include_mlt_corr_to_TDC = .true. write (*, *) "####################################" write (*, *) "Running dt test" @@ -204,7 +212,8 @@ subroutine check_TDC() call set_TDC( & conv_vel_start, mixing_length_alpha, alpha_TDC_DAMP, alpha_TDC_DAMPR, alpha_TDC_PtdVdt, dt, cgrav, m, report, & mixing_type, scale, chiT, chiRho, gradr, r, P, T, rho, dV, Cp, opacity, & - scale_height, gradL, grada, conv_vel, D, Y_face, gradT, tdc_num_iters, max_conv_vel, ierr) + scale_height, gradL, grada, conv_vel, D, Y_face, gradT, tdc_num_iters, max_conv_vel, Eq_div_w, grav, include_mlt_corr_to_TDC, ierr) + write (*, 1) 'dt, gradT, conv_vel_start, conv_vel', dt, gradT%val, conv_vel_start, conv_vel%val if (report) stop diff --git a/turb/test/test_output b/turb/test/test_output index 454ffeb53..5f3c9c6de 100644 --- a/turb/test/test_output +++ b/turb/test/test_output @@ -51,5 +51,5 @@ Expected ~10 because in the efficient limit vc ~ L^{1/3} ---------------------------------------------------------------- gradR - gradA 4.0000000000040004D-06 - TDC: Y, conv_vel_start, conv_vel, dt 3.9999852208023926D-06 0.0000000000000000D+00 1.5051085052069075D+02 1.0000000000000000D+40 + TDC: Y, conv_vel_start, conv_vel, dt 3.9999852208627750D-06 0.0000000000000000D+00 1.5051085052182680D+02 1.0000000000000000D+40 MLT: Y, conv_vel_start, conv_vel, Gamma 3.9999830300230244D-06 0.0000000000000000D+00 1.5051080930415759D+02 1.3740991947818479D-03