Skip to content

adding eddy viscous damping to TDC #735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions star/defaults/controls.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -4578,6 +4578,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
Expand Down Expand Up @@ -5863,11 +5877,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
Expand All @@ -5882,12 +5900,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
Expand Down Expand Up @@ -6475,6 +6496,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
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
40 changes: 39 additions & 1 deletion star/defaults/controls_dev.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@


! split burn
! ================
! ==========


! op_split_burn_min_T_for_variable_T_solver
Expand All @@ -174,3 +174,41 @@
! ::

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.

! 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.


45 changes: 32 additions & 13 deletions star/dev_cases_test_RSP2/dev_rsp2_Cepheid_6M/inlist_rsp2_Cepheid
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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'
Expand Down
21 changes: 21 additions & 0 deletions star/dev_cases_test_TDC/dev_TDC_Cepheid_15M_u_flag/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://ui.adsabs.harvard.edu/abs/2019ApJ...882...36M/abstract>`__

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

7 changes: 7 additions & 0 deletions star/dev_cases_test_TDC/dev_TDC_Cepheid_15M_u_flag/ck
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions star/dev_cases_test_TDC/dev_TDC_Cepheid_15M_u_flag/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

cd make
make clean
32 changes: 32 additions & 0 deletions star/dev_cases_test_TDC/dev_TDC_Cepheid_15M_u_flag/gyre.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
&model
/

&mode
l = 0
/

&osc
nonadiabatic = .TRUE.
/

&rot
/

&num
diff_scheme = 'MAGNUS_GL2'!'COLLOC_GL2'
/

&scan
grid_type = 'LINEAR'
freq_min = 0.1
freq_max = 10.0
freq_min_units = 'ACOUSTIC_DELTA'
freq_max_units = 'ACOUSTIC_DELTA'
n_freq = 200 !50
/

&grid
w_osc = 10
w_exp = 2
w_ctr = 10
/
3 changes: 3 additions & 0 deletions star/dev_cases_test_TDC/dev_TDC_Cepheid_15M_u_flag/he_dep.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading