/// <summary> /// This sets the spectral type of our star. /// </summary> public virtual void SetSpectralType() { if (EvoLine.FindCurrentAgeGroup(StarAge) == StarAgeLine.RetMainbranch) { SpecType = GetStellarTypeFromMass(CurrMass) + " V"; } if (EvoLine.FindCurrentAgeGroup(StarAge) == StarAgeLine.RetSubbranch) { SpecType = GetStellarTypeFromTemp(CurrMass) + " IV"; } if (EvoLine.FindCurrentAgeGroup(StarAge) == StarAgeLine.RetGiantbranch) { SpecType = GetStellarTypeFromTemp(CurrMass) + " II"; } //the fun one - white dwarf if (EvoLine.FindCurrentAgeGroup(StarAge) == StarAgeLine.RetCollaspedstar) { if (EffTemp >= 1000) { SpecType = "DA"; } if (EffTemp >= 300 && EffTemp < 1000) { SpecType = "DB"; } if (EffTemp < 300) { SpecType = "DC"; } } }
public virtual void PurgeSwallowedOrbits() { if (!(EvoLine.FindCurrentAgeGroup(StarAge) >= StarAgeLine.RetGiantbranch)) { throw new Exception("This star is not in supernova state or beyond."); } SysPlanets.RemoveAll(orbital => orbital.OrbitalRadius <= GetSwallowedSpace()); SortOrbitals(); }
//update temp. public virtual void UpdateTemp(double effTemp) { if (EvoLine.FindCurrentAgeGroup(StarAge) == StarAgeLine.RetSubbranch || EvoLine.FindCurrentAgeGroup(StarAge) == StarAgeLine.RetGiantbranch) { EffTemp = effTemp; SpecType = GetStellarTypeFromTemp(EffTemp); } if (EvoLine.FindCurrentAgeGroup(StarAge) == StarAgeLine.RetMainbranch) { EffTemp = effTemp; } }
public virtual void UpdateLumin(double lumin) { var currStatus = EvoLine.FindCurrentAgeGroup(StarAge); if (currStatus == StarAgeLine.RetMainbranch && CurrMass < .45) { CurrLumin = lumin; InitLumin = lumin; } if ((currStatus == StarAgeLine.RetMainbranch && CurrMass >= .45) || currStatus == StarAgeLine.RetSubbranch || currStatus == StarAgeLine.RetGiantbranch || currStatus == StarAgeLine.RetGiantbranch) { CurrLumin = lumin; } }
//mass functionality public virtual void UpdateMass(double mass, bool isWhiteDwarf = false) { if (mass == 0.00) { throw new Exception("Mass is 0 solar masses."); } CurrMass = mass; EvoLine.AddMainLimit(FindMainLimit(CurrMass)); EvoLine.AddSubLimit(FindSubLimit(CurrMass)); EvoLine.AddGiantLimit(FindGiantLimit(CurrMass)); if (!isWhiteDwarf) { InitMass = mass; } }
/// <summary> /// This function sets the inital luminosity of a Star object /// </summary> public virtual void SetLumin() { var currAgeGroup = EvoLine.FindCurrentAgeGroup(StarAge); InitLumin = GetMinLumin(); //this applies for most stars. CurrLumin = GetCurrLumin(EvoLine, StarAge, CurrMass); //set the maximum luminosity. Used for determining the formation zones if the star is in a few phases. if (currAgeGroup == StarAgeLine.RetGiantbranch) { MaxLumin = CurrLumin; } if (currAgeGroup == StarAgeLine.RetCollaspedstar) { MaxLumin = GetMinLumin(CurrMass) * 10000; } }
//describes the age status. public virtual string GetStatusDesc() { if (EvoLine.FindCurrentAgeGroup(StarAge) == StarAgeLine.RetMainbranch) { return("Main Sequence"); } if (EvoLine.FindCurrentAgeGroup(StarAge) == StarAgeLine.RetSubbranch) { return("Subgiant Branch"); } if (EvoLine.FindCurrentAgeGroup(StarAge) == StarAgeLine.RetGiantbranch) { return("Asymptotic Giant Branch"); } if (EvoLine.FindCurrentAgeGroup(StarAge) == StarAgeLine.RetCollaspedstar) { return("White Dwarf"); } return("INVALID STATUS"); }
/// <summary> /// This returns the current branch description for this star /// </summary> /// <returns>A string containing the branch description</returns> public string ReturnCurrentBranchDesc() { return(StarAgeLine.DescBranch(EvoLine.FindCurrentAgeGroup(StarAge))); }
public override string ToString() { var nL = Environment.NewLine + " "; var ret = Name + " is a " + GetStatusDesc() + " star with spectral type " + SpecType; ret = ret + nL + "This star has " + CurrMass + " solar masses, and a current luminosity of " + Math.Round(CurrLumin, OptionCont.NumberOfDecimal); ret = ret + nL + "solar luminosities. It has a surface temperature of " + Math.Round(EffTemp, OptionCont.NumberOfDecimal) + "K."; ret = ret + nL + "This star's radius is " + Math.Round(GetRadiusAu(), OptionCont.NumberOfDecimal) + " AU."; ret = ret + nL + "Apparent Color : " + StarColor; if (OptionCont.GetVerboseOutput()) { ret = ret + Environment.NewLine; ret = ret + nL + "Initial Luminosity: " + InitLumin + " solar luminosities."; ret = ret + nL + "Initial Mass: " + InitMass + " solar masses"; ret = ret + nL + "Formation Zones: " + InnerRadius(InitLumin, InitMass) + " AU to " + Math.Round(OuterRadius(InitMass), OptionCont.NumberOfDecimal) + " AU"; ret = ret + nL + "Snow Line: " + Math.Round(SnowLine(InitLumin), OptionCont.NumberOfDecimal) + " AU."; } ret = ret + Environment.NewLine; if (IsFlareStar) { ret = ret + nL + "This star is a flare star."; } ret = ret + Environment.NewLine; if (OptionCont.GetVerboseOutput()) { ret = ret + nL + "Self ID: " + GetDescSelfFlag(SelfId) + " and Parent ID: " + GetDescSelfFlag(ParentId); ret = ret + nL; } //printing out age details ret = ret + nL + "Evolution Data"; ret = ret + Environment.NewLine; if (EvoLine.GetGiantLimit() < 1000) { ret = ret + nL + "Main Sequence Ends: " + EvoLine.GetMainLimit() + " Gyr,"; ret = ret + " Subgiant Ends: " + EvoLine.GetSubLimit() + " Gyr"; ret = ret + nL + "Giant Stage Ends: " + EvoLine.GetGiantLimit() + " Gyr"; if (StarAge < EvoLine.GetMainLimit()) { ret = ret + nL + "This star will exit the main sequence phase in: " + (EvoLine.GetMainLimit() - StarAge) + " Gyr"; } if (StarAge >= EvoLine.GetMainLimit() && StarAge < EvoLine.GetSubLimit()) { ret = ret + nL + "This star will exit the subgiant phase in: " + (EvoLine.GetSubLimit() - StarAge) + " Gyr"; } if (StarAge >= EvoLine.GetSubLimit() && StarAge < EvoLine.GetGiantLimit()) { ret = ret + nL + "This star will exit the giant phase in: " + (EvoLine.GetGiantLimit() - StarAge) + " Gyr"; } if (StarAge >= EvoLine.GetGiantLimit()) { ret = ret + nL + "This star has been a white dwarf for: " + (StarAge - EvoLine.GetGiantLimit()) + " Gyr"; } } else { ret = ret + nL + "This star will burn out sometime well after the galaxy disappears."; } if (SelfId != IsPrimary) { ret = ret + Environment.NewLine; ret = ret + nL + "Orbital Details"; ret = ret + nL + "This orbits " + ParentName + " at " + OrbitalRadius + " AU."; if (OrbitalEccent > 0) { ret = ret + nL + "Eccentricity: " + OrbitalEccent + "."; ret = ret + nL + "Periapsis: " + GetPeriapsis(OrbitalEccent, OrbitalRadius) + " AU and Apapasis: " + GetApapsis(OrbitalEccent, OrbitalRadius) + " AU."; } ret = ret + nL + "Orbital period is " + Math.Round(OrbitalPeriod, 2) + " years (" + Math.Round(OrbitalPeriod * 365.25, 2); ret = ret + " days)"; ret = ret + nL + "This has a seperation of " + LibStarGen.GetSeperationStr(OrbitalSep); } //ret = ret + nL; //ret = ret + nL + "Orbital Details"; //foreach (Satellite s in this.sysPlanets) //{ // ret = ret + nL + s; // ret = ret + nL; //} //ret = ret + nL; if (!OptionCont.GetVerboseOutput()) { return(ret); } ret = ret + nL; ret = ret + nL + "Formation Zone Details"; ret = ret + nL; ret = ZonesOfInterest.ForbiddenZones.Aggregate(ret, (current, r) => current + nL + r); ret = ret + nL; ret = ZonesOfInterest.FormationZones.Aggregate(ret, (current, r) => current + nL + r); ret = ret + nL; ret = ret + nL + "Gas Giant Flag: " + DescGasGiantFlag(GasGiantFlag); ret = ret + nL; return(ret); }