Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

constants.C

Go to the documentation of this file.
00001 #include "constants.h"
00002 #include "stdfunc.h"
00003 
00004 // constructor for constant class.
00005 // Currently there are not functionalities.
00006 
00007 //stellar_evolution_constants::stellar_evolution_constants() {
00008 //  //Dummy function in order to allow compilation.
00009 //}
00010 
00011 
00012 real stellar_evolution_constants::mathematics(mathematical_constant pm) {
00013 
00014     switch(pm) {
00015         case one_third:                        return 0.33333333333333333333;
00016              break;
00017         case two_third:                        return 0.66666666666666666666;
00018              break;
00019         case pi:                               return 3.14159265358979323846;
00020           break;                               // of the orde of 1
00021         case two_pi:                           return 6.28318530717958647692;
00022              break;
00023         default:
00024              cerr << "\nNo recognized option in "
00025                      "stellar_evolution_constants::"
00026                      "parameters(mathematical_constant "
00027                   << pm << ")"
00028                   << endl;
00029              exit(1);
00030     }
00031 }
00032 
00033 real stellar_evolution_constants::physics(physics_constants pp) {
00034 
00035     // physics parameters 
00036     switch(pp) {
00037         case gravitational_constant:
00038         case G:                             return 6.67e-8;    // [cgs]
00039              break;
00040         case speed_of_light:                                        
00041         case C:                             return 2.9979e+10; // [cm/s]
00042              break;
00043         case million_years:
00044         case Myear:                         return 3.15e+13;   // [s]
00045              break;
00046         case seconds_per_day:
00047         case days:                          return 8.6400e+4;   // [s]
00048              break;
00049         case kilometer_per_second:
00050         case km_per_s:                      return 1.0e+5;      // [cm/s]
00051              break;
00052         case kilometer_in_centimeters:
00053         case kilometer:                     return 1.0e+5;   // [cm]
00054              break;
00055         case nucleair_efficiency:                      return 0.007;
00056               break;                          // nuc. energy production eff
00057                                               // Delta E = 0.007 Mc^2
00058         default:
00059              cerr << "\nNo recognized option in "
00060                      "stellar_evolution_constants::"
00061                      "parameters(physics_constants "
00062                   << pp << ")"
00063                   << endl;
00064              exit(1);
00065     }
00066 }
00067 
00068 real stellar_evolution_constants::super_nova_kick(
00069                                   super_nova_kick_distribution pk,
00070                                   const real v_disp){
00071   
00072   // Super Nova Kick functions.
00073   // kick velicity imparted to the remnant during the supernova event.
00074   // changing the kick velocity requires recompilation.
00075 
00076   //    Paczynsky's velocity distribution with a dispersion
00077   //    of 600 km/s is prefered by Hartman.
00078 
00079   //    Gauss kick velocity distribution.
00080   //    Lyne, A.G., \& Lorimer, D.R., 1994, Nature 369, 127
00081   //    propose v_k = 450 +- 90 km/s
00082   //    this is comparable to a one dimensional gaussion
00083   //    of 260 km/s.
00084 
00085   //    Hansen & Phinney (1997, MNRAS 291, 569) kick velocity distribution.
00086   //    They prever a Maxwellian with a velocity dispersion of
00087   //    270 km/s.
00088   
00089   // selected kick distribution imparted to a newly formed neutron star
00090   // in a supernova. 
00091     switch(pk) {
00092         case no_velocity_kick:              return 0;
00093              break;                                
00094         case Maxwellian_velocity_kick:      return
00095                                             random_maxwellian_velocity(v_disp);
00096              break;
00097         case internally_decided_velocity_kick:
00098         case Paczynski_velocity_kick:       return
00099                                             random_paczynski_velocity(v_disp);
00100              break;
00101         case delta_function_velocity_kick:  return v_disp;
00102              break;
00103     default:
00104              cerr << "\nNo recognized option in "
00105                      "stellar_evolution_constants::"
00106                      "super_nova_kick(super_nova_kick_distribution "
00107                   << pk << ")"
00108                   << endl;
00109              exit(1);
00110     }
00111 }  
00112 
00113 real stellar_evolution_constants::parameters(astronomical_scale_parameter pa) {
00114 
00115     // Astronomical distance scale parameters in centimeters [cm]
00116     switch(pa) {
00117         case PC:
00118         case parsec:                             return 3.0857e+18;
00119              break;                                
00120         case AU:                      
00121         case astronomical_unit:                  return 1.496e+13; 
00122              break;                                
00123         default:
00124              cerr << "\nNo recognized option in "
00125                      "stellar_evolution_constants::"
00126                      "parameters(astronomical_scale_parameter "
00127                   << pa << ")"
00128                   << endl;
00129              exit(1);
00130     }
00131 }
00132 
00133 real stellar_evolution_constants::parameters(solar_parameter ps) {
00134 
00135     // Solar parameters in cgs.
00136     switch(ps) {
00137         case solar_mass:
00138         case Msun:                      return 1.989e+33; //[gram]
00139              break;                                
00140         case solar_radius:
00141         case Rsun:                      return 6.96e+10;//[centimeter]
00142              break;                                
00143         case solar_luminosity:
00144         case Lsun:                      return 3.862e+33; // [erg/s]
00145              break;                                
00146         case solar_temperature:
00147         case Tsun:                      return 5770;     // [Kelvin]
00148              break;
00149         case energy_to_mass_in_internal_units:         return 
00150                                    cnsts.physics(nucleair_efficiency)
00151                                  * pow(cnsts.physics(C), 2)
00152                                  * cnsts.parameters(solar_mass)
00153                                  / (cnsts.parameters(solar_luminosity) *
00154                                     cnsts.physics(Myear));
00155              break;
00156         default:
00157              cerr << "\nNo recognized option in "
00158                      "stellar_evolution_constants::"
00159                      "parameters(solar_parameter "
00160                   << ps << ")"
00161                   << endl;
00162              exit(1);
00163     }
00164 }
00165 
00166 real stellar_evolution_constants::parameters(pulsar_initial_conditions pp) {
00167 
00168     // Netron star basic parameters.
00169     switch(pp) {
00170         case pulsar_magnetic_field:              return 12;     // [log Gs]
00171              break;                                
00172         case pulsar_pulse_period:                return 0.1;    // [s]
00173              break;                                
00174         case kanonical_neutron_star_radius:      return 1.5e-5; // [cm]
00175              break;                               
00176         case kanonical_neutron_star_mass:        return 1.34;   // [msun]
00177              break;                                
00178         case maximum_neutron_star_mass:          return 2.0;    // [Msun]
00179              break;                              // was 1.5
00180         case minimum_neutron_star_mass:          return 0.0925; // [Msun]
00181              break;                              // Newtonian polytrope 
00182         default:
00183              cerr << "\nNo recognized option in "
00184                      "stellar_evolution_constants::"
00185                      "parameters(pulsar_initial_conditions "
00186                   << pp << ")"
00187                   << endl;
00188              exit(1);
00189     }
00190 }
00191 
00192 real stellar_evolution_constants::parameters(stellar_mass_limits pm) {
00193 
00194     // Switch statement for certain limits. All values are in
00195     // solar units [Msun].
00196     switch(pm) {
00197         case low_mass_star_mass_limit:           return 1.5;
00198              break;                                
00199         case medium_mass_star_mass_limit:        return 15;
00200              break;                               
00201         case massive_star_mass_limit:            return 25;
00202              break;                               
00203         case upper_ZAMS_mass_for_degenerate_core: return 2.3;
00204              break;                                
00205         case minimum_main_sequence:              return 0.075;
00206              break;                              // for pop III: 0.095 [Msun] 
00207         case maximum_planet_mass:                return 0.00314;
00208              break;                              // Lynden-Bell&O'Dwyer2001
00209         case helium_dwarf_mass_limit:            return 0.45;
00210              break;                                
00211         case carbon_dwarf_mass_limit:            return 1.2;
00212              break;
00213         case Chandrasekar_mass:                  return 1.44;
00214              break;                                
00215         case helium2neutron_star:                return 2.2;
00216              break;                                
00217         case COcore2black_hole:                  return 5; // was 10
00218                                                       // (SPZ+GN: 27 Jul 2000)
00219              break;                                
00220         case super_giant2neutron_star:           return 8;
00221              break;                                
00222         case super_giant2black_hole:             return 25; // was 40
00223              break;                                
00224         case maximum_main_sequence:              return 100;
00225              break;                               
00226         case minimum_helium_star:                return 0.33;
00227              break;
00228         case helium_star_lifetime_fraction:      return 0.9;
00229              break;
00230         case helium_star_final_core_fraction:    return 0.80;
00231              break;
00232         default:
00233              cerr << "\nNo recognized option in "
00234                      "stellar_evolution_constants::"
00235                      "parameters(stellar_mass_limits "
00236                   << pm << ")"
00237                   << endl;
00238              exit(1);
00239     }
00240 }
00241 
00242 
00243 bool stellar_evolution_constants::parameters(boolean_parameter pb) {
00244 
00245     switch(pb) {                                
00246         case hyper_critical:                        return false;
00247              break;                                // 10^8 x Eddington
00248                                                    // see: Chevalier 1993
00249         case super_giant_disintegration:               return false;
00250              break;
00251         case proto_star_to_binary:                     return false;
00252              break;                                                 
00253         default:
00254              cerr << "\nNo recognized option in "
00255                      "stellar_evolution_constants::"
00256                      "parameters(boolean_parameter "
00257                   << pb << ")"
00258                   << endl;
00259              exit(1);
00260     }
00261 }
00262     
00263 real stellar_evolution_constants::parameters(accretion_parameter pa) {
00264 
00265     switch(pa) {                        // Mass of accretion to core.
00266         case black_hole_accretion_limit:        return 0.1;
00267              break;                             // 
00268         case neutron_star_accretion_limit:      return 0.05;
00269              break;                             //
00270         case white_dwarf_accretion_limit:       return 0.01;
00271              break;                             //
00272         case thermo_nuclear_flash:              return 1;  // used to be 0.05;
00273              break;                             // mass fractioncauses flash
00274         default:
00275              cerr << "\nNo recognized option in "
00276                      "stellar_evolution_constants::"
00277                      "parameters(accretion_parameter "
00278                   << pa << ")"
00279                   << endl;
00280              exit(1);
00281 
00282       }
00283 }
00284 
00285 
00286 real stellar_evolution_constants::parameters(model_parameter pm) {
00287 
00288     switch(pm) {
00289         case star_formation_efficiency:                return 1.0;
00290              break;                             // [%] 
00291         case star_formation_timescale:                 return 1.0; // [Myr]
00292              break;                                 // if(<0) abs times KH timescale 
00293         case magnetic_mass_limit:                      return 0.7;
00294              break;                             // [msun] magnetic if(M<this)
00295         case magnetic_braking_exponent:                return 2.5;
00296               break;                        
00297         case corotation_eccentricity:                  return 0.001;
00298               break;                          // corotation if(ecc<this)
00299         case tidal_circularization_radius:             return 5.0;
00300               break;                          
00301         case core_overshoot:                           return 0.125;
00302               break;                          // overshoot fraction.
00303         case hydrogen_fraction:                        return 0.7;
00304               break;                          // X
00305         case common_envelope_efficiency:               return 4;
00306               break;                          // (alpha_ce)
00307         case envelope_binding_energy:                  return 0.5;
00308               break;                          // (lambda)
00309         case specific_angular_momentum_loss:           return 3.;
00310               break;                          // (beta)
00311         case dynamic_mass_transfer_gamma:               return 1.75;
00312               break;                          // (gamma)
00313         case non_massive_star_envelope_fraction_lost:  return 0.03;
00314               break;                          
00315         case massive_star_envelope_fraction_lost:      return 0.9;
00316               break;               
00317         case relaxation_driven_mass_loss_constant:     return 1;           
00318              break;                                                    
00319         case massive_star_mass_loss_law:               return 6.8;
00320               break;                          
00321         case time_independent_mass_loss_law:           return 1;
00322               break;
00323         case Darwin_Riemann_instability_factor:        return
00324                                                cnsts.mathematics(one_third);
00325               break;
00326         case homogeneous_sphere_gyration_radius_sq:    return 0.4;
00327               break;
00328         case radiative_star_gyration_radius_sq:        return 0.03;
00329               break;
00330         case convective_star_gyration_radius_sq:       return 0.2;
00331               break;
00332         case rejuvenation_exponent:                    return 1;
00333               break;
00334         case spiral_in_time:                           return 0.0005; // Myr
00335               break;
00336         default:
00337              cerr << "\nNo recognized option in "
00338                      "stellar_evolution_constants::"
00339                      "parameters(model_parameter "
00340                   << pm << ")"
00341                   << endl;
00342              exit(1);
00343     }
00344 }
00345 
00346 
00347 real stellar_evolution_constants::parameters(observational_parameter pm) {
00348 
00349     switch(pm) {
00350         case B_emission_star_mass_limit:               return 0.1;
00351              break; 
00352         case Barium_star_mass_limit:                   return 0.01;
00353               break;                        
00354         case Blue_straggler_mass_limit:                return 0;
00355               break;                        
00356         default:
00357              cerr << "\nNo recognized option in "
00358                      "stellar_evolution_constants::"
00359                      "parameters(observational_parameter "
00360                   << pm << ")"
00361                   << endl;
00362              exit(1);
00363     }
00364 }
00365 
00366 // Safetly parameters means that changing these may cause
00367 // unexpected errors and changes the bahavious of the program.
00368 real stellar_evolution_constants::safety(safety_parameter ps) {
00369 
00370   switch(ps) {
00371     case timestep_factor:                      return 0.01;       
00372           break;                             // 0.01 ok, but big for AM CVns
00373     case maximum_binary_update_time_fraction: return 0.9;
00374           break;                            // see also star_to_dyn
00375     case minimum_timestep:                   return 1.e-11; // Do not change!
00376           break;                                   // == 10*HubbleT*precision
00377     case minimum_mass_step:                  return 1.e-5;
00378           break;                                   // Tricky used to be 1.e-7
00379     case maximum_timestep:                   return 1; // was 1000  
00380           break;                                   // 2.5 works fine but slow
00381     case maximum_recursive_calls:            return 1000;
00382           break;
00383         default:
00384              cerr << "\nNo recognized option in "
00385                      "stellar_evolution_constants::"
00386                      "parameters(safety_parameter "
00387                   << ps << ")"
00388                   << endl;
00389              exit(1);
00390   } 
00391 }
00392 
00393 real stellar_evolution_constants::star_to_dyn(dynamics_update_parameter dup) {
00394 
00395     switch(dup) {
00396         case stellar_mass_update_limit:                return 0.001;
00397              break; 
00398         case semi_major_axis_update_limit:             return 0.001;
00399               break;                        
00400         case binary_update_time_fraction:              return 0.001; //was 0.05
00401              break;
00402         default:
00403              cerr << "\nNo recognized option in "
00404                      "stellar_evolution_constants::"
00405                      "star_to_dyn(dynamica_update_parameter "
00406                   << dup << ")"
00407                   << endl;
00408              exit(1);
00409     }
00410 }
00411 
00412 
00413 
00414 
00415 
00416 

Generated at Sun Feb 24 09:56:56 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001