From b4c7ed8f00a6c443c70cf890758ac51f8385c8ff Mon Sep 17 00:00:00 2001 From: Robert Izzard <r.izzard@surrey.ac.uk> Date: Tue, 10 Aug 2021 09:46:27 +0100 Subject: [PATCH] removed 0.21 where it should be the CORE_MOMENT_OF_INERTIA_FACTOR --- src/rotation/moment_of_inertia.c | 30 ++----------------- .../convective_envelope_mass_and_radius.c | 3 +- .../stellar_structure_BSE_given_timescales.c | 5 +++- ...llar_structure_remnant_and_perturbations.c | 6 ++-- 4 files changed, 12 insertions(+), 32 deletions(-) diff --git a/src/rotation/moment_of_inertia.c b/src/rotation/moment_of_inertia.c index 695486074..6056b10dd 100644 --- a/src/rotation/moment_of_inertia.c +++ b/src/rotation/moment_of_inertia.c @@ -22,36 +22,12 @@ double moment_of_inertia(struct stardata_t * const stardata, star->stellar_type == BLACK_HOLE ? BH_MOI(star) : star->stellar_type == NEUTRON_STAR ? neutron_star_MOI(star,r) : normal_star_MOI(star,r); -/* - if(1) - printf("momI [star %d type %d has core? %d, M=%g R=%g (RL=%g) L=%g J=%g] = (Menv=%g-%g) * (moment_of_inertia_factor=%g) * (r=%g)^2 + (k3=%g) * (Mc=%g) * (rc=%g)^2 = %g (%g) + %g (%g) = %g\n", - star->starnum, - star->stellar_type, - HAS_BSE_CORE(star->stellar_type), - - star->mass, - star->radius, - star->roche_radius, - star->luminosity, - star->angular_momentum, - - star->mass, -Outermost_core_mass(star), - star->moment_of_inertia_factor, - r, - K3, - Outermost_core_mass(star), - star->core_radius, - (star->mass - Outermost_core_mass(star))*star->moment_of_inertia_factor*Pow2(r), - envelope_moment_of_inertia(star,r), - K3* Pow2(star->core_radius)*Outermost_core_mass(star), - core_moment_of_inertia(star,star->core_radius), - momI); -*/ if(stardata->preferences->apply_Darwin_Radau_correction == TRUE) { /* + * EXPERIMENTAL! (maybe even wrong!) + * * Darwin-Radau corretion todata into account that * the star is rotating. * @@ -105,7 +81,7 @@ static double neutron_star_MOI(const struct star_t * RESTRICT const star, */ const double x = GRAVITATIONAL_CONSTANT * star->mass * M_SUN / (r * R_SUN * Pow2(SPEED_OF_LIGHT)); - return 0.21* star->mass * Pow2(star->radius) / Max(1e-20,1.0 - 2.0 * x); + return CORE_MOMENT_OF_INERTIA_FACTOR * star->mass * Pow2(star->radius) / Max(1e-20,1.0 - 2.0 * x); } static double BH_MOI(const struct star_t * RESTRICT const star) diff --git a/src/stellar_structure/convective_envelope_mass_and_radius.c b/src/stellar_structure/convective_envelope_mass_and_radius.c index 2f9beabf1..1497c0e9c 100644 --- a/src/stellar_structure/convective_envelope_mass_and_radius.c +++ b/src/stellar_structure/convective_envelope_mass_and_radius.c @@ -91,7 +91,8 @@ void convective_envelope_mass_and_radius(struct stardata_t * const stardata, /* * Zero-age and BGB values of k^2 (== moment_of_inertia_factor = I/(MR^2)) */ - k2z = Min(0.21,Max(0.09-0.27*logm,0.037+0.033*logm)); + k2z = Min(CORE_MOMENT_OF_INERTIA_FACTOR, + Max(0.09-0.27*logm,0.037+0.033*logm)); if(logm>1.3) k2z -= 0.055*Pow2(logm-1.3); k2bgb = Min3(0.15,0.147+0.03*logm,0.162-0.04*logm); diff --git a/src/stellar_structure/stellar_structure_BSE_given_timescales.c b/src/stellar_structure/stellar_structure_BSE_given_timescales.c index d671b1c86..a08fcb4dc 100644 --- a/src/stellar_structure/stellar_structure_BSE_given_timescales.c +++ b/src/stellar_structure/stellar_structure_BSE_given_timescales.c @@ -477,12 +477,15 @@ int stellar_structure_BSE_given_timescales(struct star_t *newstar, /* presumably menv (convective envelope mass) should be zero ? */ newstar->menv = 0.0; + /* similarly renv should be zero */ newstar->renv = 0.0; + /* set core radius to actual radius */ newstar->core_radius = newstar->radius; + /* generic k2 */ - newstar->moment_of_inertia_factor = 0.21; + newstar->moment_of_inertia_factor = CORE_MOMENT_OF_INERTIA_FACTOR; } #ifdef NUCSYN diff --git a/src/stellar_structure/stellar_structure_remnant_and_perturbations.c b/src/stellar_structure/stellar_structure_remnant_and_perturbations.c index 05fe38554..7128667b5 100644 --- a/src/stellar_structure/stellar_structure_remnant_and_perturbations.c +++ b/src/stellar_structure/stellar_structure_remnant_and_perturbations.c @@ -269,9 +269,9 @@ void stellar_structure_remnant_and_perturbations(struct star_t * newstar, else { newstar->core_radius = newstar->radius; - newstar->menv = 1E-10; - newstar->renv = 1E-10; - newstar->moment_of_inertia_factor = 0.21; + newstar->menv = 1e-10; + newstar->renv = 1e-10; + newstar->moment_of_inertia_factor = CORE_MOMENT_OF_INERTIA_FACTOR; } /* -- GitLab