Skip to content
Snippets Groups Projects
Commit 06f2da06 authored by Izzard, Robert Dr (Maths & Physics)'s avatar Izzard, Robert Dr (Maths & Physics)
Browse files

no longer set J=0 for "single" systems which are very wide : this accidentally...

no longer set J=0 for "single" systems which are very wide : this accidentally sent stars as single when they should just be very wide
parent 8e3b84e2
No related branches found
No related tags found
No related merge requests found
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
* this is not shown. * this is not shown.
*/ */
#define Debug_show_expression " " #define Debug_show_expression " sep=%g per=%g J=%g ",stardata->common.orbit.separation,stardata->common.orbit.period,stardata->common.orbit.angular_momentum
//#undef Debug_show_expression //#undef Debug_show_expression
......
...@@ -8,7 +8,8 @@ double Pure_function_if_no_debug calculate_orbital_period (struct stardata_t * R ...@@ -8,7 +8,8 @@ double Pure_function_if_no_debug calculate_orbital_period (struct stardata_t * R
(double)AU_IN_SOLAR_RADII)/(Total_mass)) (double)AU_IN_SOLAR_RADII)/(Total_mass))
*YEAR_LENGTH_IN_DAYS; *YEAR_LENGTH_IN_DAYS;
Dprint("Calculating orbital period: %g (M1+M2=%g a=%g)\n",per, Dprint("Calculating orbital period: %g (M1+M2=%g a=%g)\n",
per,
Total_mass,stardata->common.orbit.separation); Total_mass,stardata->common.orbit.separation);
return per; return per;
......
...@@ -7,8 +7,7 @@ void binary_star_evolution(struct stardata_t * RESTRICT const stardata, ...@@ -7,8 +7,7 @@ void binary_star_evolution(struct stardata_t * RESTRICT const stardata,
* Having calculated stellar evolution, do * Having calculated stellar evolution, do
* binary-specific evolutionary tasks * binary-specific evolutionary tasks
*/ */
if(stardata->common.orbit.eccentricity > 1.0)
if(stardata->common.orbit.eccentricity>1.0)
{ {
*retval = SYSTEM_IS_BROKEN_APART; *retval = SYSTEM_IS_BROKEN_APART;
} }
...@@ -22,15 +21,4 @@ void binary_star_evolution(struct stardata_t * RESTRICT const stardata, ...@@ -22,15 +21,4 @@ void binary_star_evolution(struct stardata_t * RESTRICT const stardata,
determine_roche_lobe_radii(stardata,&stardata->common.orbit); determine_roche_lobe_radii(stardata,&stardata->common.orbit);
set_effective_radii(stardata); set_effective_radii(stardata);
} }
if(System_is_single)
{
/*
* Single star systems have no orbital angular
* momentum, and orbital frequency is undefined,
* so set both to zero.
*/
stardata->common.orbit.angular_momentum = 0.0;
stardata->common.orbit.angular_frequency = 0.0;
}
} }
...@@ -237,6 +237,7 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata) ...@@ -237,6 +237,7 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
#endif//BSE #endif//BSE
star->q = Q(k); star->q = Q(k);
determine_roche_lobe_radius(stardata,&stardata->common.orbit,star); determine_roche_lobe_radius(stardata,&stardata->common.orbit,star);
Dprint("post-roche\n");
star->rol0 = star->roche_radius; star->rol0 = star->roche_radius;
Dprint("setting lum to %12.12e\n",lum); Dprint("setting lum to %12.12e\n",lum);
......
...@@ -43,5 +43,5 @@ void update_orbital_variables(struct stardata_t * RESTRICT const stardata, ...@@ -43,5 +43,5 @@ void update_orbital_variables(struct stardata_t * RESTRICT const stardata,
update_orbital_period_and_angular_frequency(orbit,star1,star2); update_orbital_period_and_angular_frequency(orbit,star1,star2);
determine_roche_lobe_radii(stardata,orbit); determine_roche_lobe_radii(stardata,orbit);
Dprint("post-roche\n");
} }
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
static Boolean match_scanf(const char * const arg, static Boolean match_scanf(const char * const arg,
const struct cmd_line_arg_t * const cmd_line_arg, const struct cmd_line_arg_t * const cmd_line_arg,
size_t * const offset_p); size_t * const offset_p);
static void derived_arguments(struct stardata_t * const stardata); static void derived_arguments(struct stardata_t * const stardata);
/**************/ /**************/
...@@ -544,6 +543,9 @@ static void derived_arguments(struct stardata_t * const stardata) ...@@ -544,6 +543,9 @@ static void derived_arguments(struct stardata_t * const stardata)
if(Is_not_zero(stardata->star[0].mass) && if(Is_not_zero(stardata->star[0].mass) &&
Is_not_zero(stardata->star[1].mass)) Is_not_zero(stardata->star[1].mass))
{ {
Dprint("preset : sep = %g per = %g\n",
stardata->common.orbit.separation,
stardata->common.orbit.period);
if(Is_zero(stardata->common.orbit.period) && if(Is_zero(stardata->common.orbit.period) &&
Is_not_zero(stardata->common.orbit.separation)) Is_not_zero(stardata->common.orbit.separation))
{ {
...@@ -567,6 +569,10 @@ static void derived_arguments(struct stardata_t * const stardata) ...@@ -567,6 +569,10 @@ static void derived_arguments(struct stardata_t * const stardata)
} }
} }
Dprint("postset: sep = %g per = %g\n",
stardata->common.orbit.separation,
stardata->common.orbit.period);
/* /*
* If we are using log times, choose the next * If we are using log times, choose the next
* max_evolution_time that correponds to an * max_evolution_time that correponds to an
......
...@@ -94,14 +94,14 @@ STELLAR_TYPE1=MAIN_SEQUENCE ...@@ -94,14 +94,14 @@ STELLAR_TYPE1=MAIN_SEQUENCE
STELLAR_TYPE2=MAIN_SEQUENCE STELLAR_TYPE2=MAIN_SEQUENCE
# stellar masses (solar units) # stellar masses (solar units)
M1=2 M1=1
M2=1.5 M2=0.1
# orbit: # orbit:
# If the period (days) is given, use it. # If the period (days) is given, use it.
# If the period is zero, use the separation (in Rsun) to calculate the period. # If the period is zero, use the separation (in Rsun) to calculate the period.
# (this requires that the masses are already set) # (this requires that the masses are already set)
ORBITAL_PERIOD=300 ORBITAL_PERIOD=30000000000
ORBITAL_SEPARATION=0.0 ORBITAL_SEPARATION=0.0
# Orbital eccentricity should be in the range 0.0-1.0. # Orbital eccentricity should be in the range 0.0-1.0.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment