private void AdjustPropertiesForGasBody() { HasGreenhouseEffect = false; VolatileGasInventory = Ratio.FromDecimalFractions(GlobalConstants.NOT_APPLICABLE); BoilingPointWater = Temperature.FromKelvins(GlobalConstants.NOT_APPLICABLE); Temperature = Temperature.FromKelvins(GlobalConstants.NOT_APPLICABLE); GreenhouseRiseTemperature = TemperatureDelta.Zero; Albedo = Ratio.FromDecimalFractions(Extensions.About(GlobalConstants.GAS_GIANT_ALBEDO, 0.1)); WaterCoverFraction = Ratio.Zero; CloudCoverFraction = Ratio.Zero; IceCoverFraction = Ratio.Zero; }
/// <summary> /// Calculates the inventory of volatiles in a planet's atmosphere /// as a result of outgassing. This value is used to calculate /// the planet's surface pressure. Implements Fogg's eq. 17. /// </summary> /// <param name="mass">Planet mass in solar masses</param> /// <param name="escapeVelocity">Planet escape velocity in cm/sec</param> /// <param name="rmsVelocity">Planet RMS velocity in cm/sec</param> /// <param name="stellarMass">Mass of the planet's star in solar masses</param> /// <param name="zone">Planet's "zone" in the system</param> /// <param name="hasGreenhouseEffect">True if the planet is experiencing /// a runaway greenhouse effect</param> /// <param name="hasAccretedGas">True if the planet has accreted any</param> public virtual Ratio GetVolatileGasInventory(Mass massSM, Speed escapeVelocity, Speed rmsVelocity, Mass sunMass, Mass gasMassSM, int orbitZone, bool hasGreenhouse) { var hasAccretedGas = gasMassSM / massSM > 0.000001; // This implements Fogg's eq.17. The 'inventory' returned is unitless. var velocityRatio = escapeVelocity / rmsVelocity; if (velocityRatio >= GlobalConstants.GAS_RETENTION_THRESHOLD) { double proportionConst; switch (orbitZone) { case 1: proportionConst = 100000.0; /* 100 . 140 JLB */ break; case 2: proportionConst = 75000.0; break; case 3: proportionConst = 250.0; break; default: proportionConst = 0.0; break; } var earthUnits = massSM * GlobalConstants.SUN_MASS_IN_EARTH_MASSES; var volInv = Extensions.About((proportionConst * earthUnits) / sunMass, 0.2); if (hasGreenhouse || hasAccretedGas) { return(Ratio.FromDecimalFractions(volInv)); } return(Ratio.FromDecimalFractions(volInv / 100.0)); /* 100 . 140 JLB */ } return(Ratio.FromDecimalFractions(0.0)); }
private Angle GetRandomInclination(Length semiMajorAxis) { var inclination = ((int)(Math.Pow(semiMajorAxis.Kilometers / GlobalConstants.ASTRONOMICAL_UNIT_KM, 0.2) * Extensions.About(GlobalConstants.EARTH_AXIAL_TILT, 0.4)) % 360); return(Angle.FromDegrees(inclination)); }