diff --git a/CHANGES b/CHANGES index 690bace01e8dbb8fecee6a0a4ed8e109e5251605..3275d93f91b95fb86c610ea9144080155aa0035a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,19 @@ +02/10/2019 V2.1.2 + + add new "overspin_algorithm" option to handle what happens + when a star is spinning faster than it can + + currently there are two options: + OVERSPIN_BSE transfers the excess angular momentum back to the orbit, + so is conservative in that no mass or angular momentum is lost. + + OVERSPIN_MASSLOSS uses the rotationally_enhanced_mass_loss formalism + given below to remove material which reduces the star's spin. + + Also removed the ROTATIONALLY_ENHANCED_MASS_LOSS compile define, + because this functionality is now required always. + + 14/09/2019 V2.1.1 I have removed the "default" pointer from the cmd_line_args, diff --git a/binary_c-config b/binary_c-config index 719f28abb3eea9eb7a8134007fb30b923fb61aa3..54a1737212d885aef56439e3dcd6a5fe5042fadb 100755 --- a/binary_c-config +++ b/binary_c-config @@ -5,11 +5,18 @@ # binary_c-config # # config script for binary_c to show configuration options on the -# command line +# command line, or for listing binary_c's default parameters # # We call binary_c and filter out the appropriate data. # Requires grep and sed. # +# Note that the source directory of this file is used as the +# root directory of binary_c. +# +# If you have an alternative $BINARY_C set, you should call +# the script in there (e.g. $BINARY_C/binary_c-config) and +# the location will be set automatically. +# ############################################################ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" @@ -22,6 +29,7 @@ if [[ ! -x "$BIN" ]];then exit fi VER="$BIN version " +DEFAULTS="$BIN list_args" GREP="grep" TR="tr" SED="sed" @@ -54,6 +62,7 @@ where option is one of the following. The '--' can be '-' or just omitted. --build_date Show the date and time of binary_c's build --define_macros Show macros defined by -D... in the CFLAGS --undef_macros Show macros undefined by -U... in the CFLAGS +--defaults Show binary_c's default settings Note: this script requires standard tools like grep, sed, tr, ldd @@ -86,6 +95,11 @@ while (( $# )); do $VER 2>/dev/null | $GREP 'CFLAGS is \"' | $SED -e s/CFLAGS\ is\ // | $SED 's/[[:space:]]\+/\n/g' | $GREP '\-U' | $TR "\n" " " | $SED -e 's/[^[-U__]]//g' -e 's/^"[[:space:]]*//' -e 's/"[[:space:]]*$//' -e 's/$/\n/' shift ;; + --defaults|-defaults|defaults) + # show binary_c's default parameters + $DEFAULTS 2>/dev/null | grep ARG_BEGIN -A999999 |grep -v ARG_BEGIN | grep -v __ARG_END |grep -v Normal\ exit\ from\ binary_c + shift + ;; --flags|-flags|flags|--cflags|-cflags|cflags) # return build flags $VER 2>/dev/null | $GREP 'CFLAGS is \"' | $SED -e s/CFLAGS\ is\ // -e 's/^"[[:space:]]*//' -e 's/"[[:space:]]*$//' diff --git a/src/RLOF/RLOF_mass_transfer_rate.c b/src/RLOF/RLOF_mass_transfer_rate.c index bbf12f3ee9cf452405ee4fc6699a04aaf8631a45..efadabb21adec8ebc3f2627b9b280462a6fb77bd 100644 --- a/src/RLOF/RLOF_mass_transfer_rate.c +++ b/src/RLOF/RLOF_mass_transfer_rate.c @@ -548,11 +548,6 @@ double Pure_function hurley_rate(const double r, else { mdot = 3.0e-06*Pow3(log(r/roche_radius))*Pow2(Min(mass,5.0)); - printf("DM1 %g %g %g %g\n", - mdot, - r, - roche_radius, - mass); if(stardata->preferences->RLOF_method == RLOF_METHOD_CLAEYS) { diff --git a/src/binary_c_parameters.h b/src/binary_c_parameters.h index 6914087f243242278e35e08a24cfd61e52c69c97..f9f4beebedad936480ccd3e95bf2b5e8f3dbe2f7 100644 --- a/src/binary_c_parameters.h +++ b/src/binary_c_parameters.h @@ -1032,7 +1032,7 @@ * The RLOF_REDUCE_TIMESTEP_THRESHOLD is the minimum ratio of R/RL which * is required to activate the algorithm. */ -#define RLOF_REDUCE_TIMESTEP +//#define RLOF_REDUCE_TIMESTEP #ifdef RLOF_REDUCE_TIMESTEP #define RLOF_REDUCE_TIMESTEP_AGGRESSION (100.0) diff --git a/src/binary_star_functions/WD_max_accretion_rate.c b/src/binary_star_functions/WD_max_accretion_rate.c index 6c08e91b7a9e4e08726ea3bac30c83ac0ddbdddd..d740213c0768f8f5c906c031ca28726cf5fe9b2e 100644 --- a/src/binary_star_functions/WD_max_accretion_rate.c +++ b/src/binary_star_functions/WD_max_accretion_rate.c @@ -57,7 +57,6 @@ double WD_max_accretion_rate(struct stardata_t * RESTRICT const stardata, /* * Claeys et al. (2014) algorithm */ - fprintf(stderr,"use claeys\n"); rate = Hachisu_max_rate(donor,accretor); break; diff --git a/src/binary_star_functions/apply_stellar_mass_and_angular_momentum_derivatives.c b/src/binary_star_functions/apply_stellar_mass_and_angular_momentum_derivatives.c index ef816f4326cdbf73beb73a88623c49aa5fbab317..04808f33418ef48e24b4a03b2ebe57ca97412919 100644 --- a/src/binary_star_functions/apply_stellar_mass_and_angular_momentum_derivatives.c +++ b/src/binary_star_functions/apply_stellar_mass_and_angular_momentum_derivatives.c @@ -358,10 +358,6 @@ void apply_stellar_mass_and_angular_momentum_derivatives(struct stardata_t * RES &steady_burn_rate, &new_envelope_rate); - fprintf(stderr,"compare accretion Mdot = %g to new_envelope_rate = %g\n", - Mdot_net(accretor), - new_envelope_rate); - if(Mdot_net(accretor) > new_envelope_rate) { /* @@ -377,11 +373,6 @@ void apply_stellar_mass_and_angular_momentum_derivatives(struct stardata_t * RES // helium accretion HeGB; // helium donor -> always a helium giant (core is CO) - fprintf(stderr,"accretor stellar type %d (hybrid? %s) new_stellar_type %d\n", - accretor->stellar_type, - Yesno(accretor->hybrid_HeCOWD), - new_stellar_type); - /* * Reset number of thermal pulses */ @@ -398,7 +389,6 @@ void apply_stellar_mass_and_angular_momentum_derivatives(struct stardata_t * RES stardata, accretor); #endif // BSE - fprintf(stderr,"post giant age %d\n",new_stellar_type); accretor->core_mass = Min(accretor->mass,accretor->mass); accretor->CO_core_mass = Min(accretor->core_mass, accretor->CO_core_mass); diff --git a/src/binary_star_functions/prevent_overspin.c b/src/binary_star_functions/prevent_overspin.c index def5e32d4d61373185135768f909867abb121aa8..f7df87e9ce73698da27f7a1a5490463956c116bb 100644 --- a/src/binary_star_functions/prevent_overspin.c +++ b/src/binary_star_functions/prevent_overspin.c @@ -86,6 +86,12 @@ Boolean prevent_overspin(struct star_t * const star, { /* * BSE algorithm returns excess angular momentum to the orbit + * + * This is equivalent to saying the material forms a disc + * around the accreting star, and this disc is tidally coupled + * to the stars, hence can "give back" its angular momentum. + * + * It also assumes no mass is lost from the disc. */ stardata->model.derivative[DERIVATIVE_ORBIT_ANGMOM] += j_excess/dt; star->derivative[DERIVATIVE_STELLAR_ANGMOM_TIDES] -= j_excess/dt; diff --git a/src/logging/log_every_timestep.c b/src/logging/log_every_timestep.c index 934fafc24a91b7b0b563173e1672b7f83fe23b92..a61a45049145775a1790df1c25ce056aa624bc8f 100644 --- a/src/logging/log_every_timestep.c +++ b/src/logging/log_every_timestep.c @@ -2370,7 +2370,7 @@ void log_every_timestep(struct stardata_t * RESTRICT const stardata) */ - if(1) + if(0) { const double Jtot = stardata->star[0].angular_momentum + stardata->star[1].angular_momentum + diff --git a/src/nucsyn/nucsyn_parameters.h b/src/nucsyn/nucsyn_parameters.h index 0b67abc82d463c04c7c6059f572219758b8ce0dd..c53527665d7ed88e43bd2fcb418a69eb38462366 100644 --- a/src/nucsyn/nucsyn_parameters.h +++ b/src/nucsyn/nucsyn_parameters.h @@ -740,7 +740,7 @@ undances with s-process /* define NUCSYN_GCE to modify yield output for gce.pl * NB this just activates other defines, and turns some off. */ -//#define NUCSYN_GCE +#define NUCSYN_GCE #ifdef NUCSYN_GCE diff --git a/src/setup/set_default_preferences.c b/src/setup/set_default_preferences.c index 5252f7ab9721da4969d46ae33e16f40f6accb915..573e4603fbc27cb0b9c9fcc271cc2ebae65ef911 100644 --- a/src/setup/set_default_preferences.c +++ b/src/setup/set_default_preferences.c @@ -4,6 +4,19 @@ void set_default_preferences(struct preferences_t * RESTRICT const preferences) { /* * Reset the preferences struct to its default values + * + * This is the location where binary_c's defaults are set. + * + * Other software, such as binary_grid2, may have a backup + * set of defaults, but this is the master list. + * + * You should be able to run (in a terminal): + * + * ./binary_c-config defaults + * + * to list the default parameters. + * + * Beware that these defaults are not */ timestep_set_default_multipliers(preferences); #ifdef TIMESTEP_MODULATION diff --git a/src/stellar_structure/stellar_structure_RG.c b/src/stellar_structure/stellar_structure_RG.c index 0e6c05a1d7f290139ba655e1469231adea1a3560..96300616bd63b7097bf2079ecfaf0408c680da83 100644 --- a/src/stellar_structure/stellar_structure_RG.c +++ b/src/stellar_structure/stellar_structure_RG.c @@ -120,12 +120,12 @@ Stellar_type stellar_structure_RG(struct star_t * RESTRICT const newstar, /* use helium core mass algorithm */ newstar->core_mass > min_He_ignition_core_mass(stardata,newstar); - printf("CF%d phase start mass %g to zpar %g\n", + Dprint("CF%d phase start mass %g to zpar %g\n", newstar->starnum, newstar->phase_start_mass, metallicity_parameters[ZPAR_MASS_HE_FLASH]); - printf("CF Mc = %g to He ig Mc %g -> ignite? %s\n", + Dprint("CF Mc = %g to He ig Mc %g -> ignite? %s\n", newstar->core_mass, min_He_ignition_core_mass(stardata,newstar), Yesno(ignite)); diff --git a/tbse b/tbse index da06c56c66046c0571755cd46e0632b0758cb3fe..eeea4decc411883a338a2932107ebd74fffa9ca1 100755 --- a/tbse +++ b/tbse @@ -364,7 +364,7 @@ E2_PRESCRIPTION=E2_IZZARD # RLOF_METHOD_ADAPTIVE = 1 = Adaptive (really only good for radiative stars) # RLOF_METHOD_RITTER = 2 = Ritter (probably broken), # RLOF_METHOD_CLAEYS = 3 = Claeys et al. 2014 variant on BSE -RLOF_METHOD=RLOF_METHOD_BSE +RLOF_METHOD=RLOF_METHOD_CLAEYS # RLOF interpolation method: this is how you get from a # timestep with R>>RL to R=~RL @@ -909,9 +909,15 @@ WRWINDFAC=1.0 # # OVERSPIN_BSE transfers the excess angular momentum back to the orbit, # so is conservative in that no mass or angular momentum is lost. +# You can also imagine this is like forming a decretion disc that +# never loses mass, just tidally locks to the orbit feeding angular +# momentum back into the orbit. # # OVERSPIN_MASSLOSS uses the rotationally_enhanced_mass_loss formalism # given below to remove material which reduces the star's spin. +# This can be wind or a decretion disc but both are considered +# to be a mass loss that carries angular momentum out of the +# system. # ############################################################ OVERSPIN_ALGORITHM=OVERSPIN_BSE @@ -2127,6 +2133,7 @@ $TIMESTEP_MULTIPLIERS \ --zoomfac_multiplier_increase $ZOOMFAC_MULTIPLIER_INCREASE \ --max_stellar_angmom_change $MAX_STELLAR_ANGMOM_CHANGE \ --force_corotation_on_RLOF $FORCE_COROTATION_ON_RLOF \ +--overspin_algorithm $OVERSPIN_ALGORITHM \ "; # valgrind options