private double GetChildDragCoefficient(List <ISpaceCraft> children, double totalDragCoefficient) { foreach (SpaceCraftBase child in children) { AeroDynamicProperties props = child.GetAeroDynamicProperties; if (props.HasFlag(AeroDynamicProperties.ExposedToAirFlow)) { if (child.FormDragCoefficient > totalDragCoefficient) { totalDragCoefficient = child.FormDragCoefficient; } } else if (props.HasFlag(AeroDynamicProperties.ExtendsFineness)) { totalDragCoefficient *= child.FormDragCoefficient; } else if (props.HasFlag(AeroDynamicProperties.ExtendsCrossSection)) { totalDragCoefficient = (totalDragCoefficient + child.FormDragCoefficient) / 2; } totalDragCoefficient = GetChildDragCoefficient(child.Children, totalDragCoefficient); } return(totalDragCoefficient); }
/// <summary> /// Recursively finds the total drag area of all surfaces exposed to air in the spacecraft. /// </summary> private double TotalFormDragArea() { double totalFormDragArea = 0; AeroDynamicProperties props = GetAeroDynamicProperties; if (props.HasFlag(AeroDynamicProperties.ExposedToAirFlow) || props.HasFlag(AeroDynamicProperties.ExtendsFineness)) { totalFormDragArea = FrontalArea; } return(GetChildFormDragArea(Children, totalFormDragArea)); }
/// <summary> /// Recursively finds the total drag of all surfaces exposed to air in the spacecraft. /// </summary> private double TotalFormDragCoefficient() { double totalDragCoefficient = 0; AeroDynamicProperties props = GetAeroDynamicProperties; if (props.HasFlag(AeroDynamicProperties.ExposedToAirFlow) || props.HasFlag(AeroDynamicProperties.ExtendsFineness)) { totalDragCoefficient = FormDragCoefficient; } return(GetChildDragCoefficient(Children, totalDragCoefficient)); }
/// <summary> /// Recursively finds the total lift of all surfaces exposed to air in the spacecraft. /// </summary> private double TotalLiftCoefficient() { double totalLiftCoefficient = 0; AeroDynamicProperties props = GetAeroDynamicProperties; if (props.HasFlag(AeroDynamicProperties.ExposedToAirFlow) || props.HasFlag(AeroDynamicProperties.ExtendsFineness) || props.HasFlag(AeroDynamicProperties.ExtendsCrossSection)) { totalLiftCoefficient = LiftCoefficient; } return(GetMaxChildLiftCoefficient(Children, totalLiftCoefficient)); }
/// <summary> /// Recursively finds the total lift area of all surfaces exposed to air in the spacecraft. /// </summary> private double TotalLiftArea() { double totalLiftArea = 0; AeroDynamicProperties props = GetAeroDynamicProperties; if (props.HasFlag(AeroDynamicProperties.ExposedToAirFlow) || props.HasFlag(AeroDynamicProperties.ExtendsFineness) || props.HasFlag(AeroDynamicProperties.ExtendsCrossSection)) { totalLiftArea = LiftingSurfaceArea; } return(GetChildLiftArea(Children, totalLiftArea)); }
private static double GetChildHeight(double height, ISpaceCraft spacecraft) { PropertyInfo prop = spacecraft.GetType().GetProperty("GetAeroDynamicProperties"); AeroDynamicProperties props = (AeroDynamicProperties)prop.GetValue(spacecraft, null); if (props == AeroDynamicProperties.ExtendsFineness) { height += spacecraft.Height; } foreach (ISpaceCraft child in spacecraft.Children) { height = GetChildHeight(height, child); } return(height); }
/// <summary> /// Recursively finds the total drag area of all surfaces exposed to air in the spacecraft. /// </summary> private double TotalSkinFrictionArea() { double totalSkinFrictionArea = 0; AeroDynamicProperties props = GetAeroDynamicProperties; if (props.HasFlag(AeroDynamicProperties.ExposedToAirFlow) || props.HasFlag(AeroDynamicProperties.ExtendsFineness) || props.HasFlag(AeroDynamicProperties.ExtendsCrossSection)) { totalSkinFrictionArea += ExposedSurfaceArea; } foreach (SpaceCraftBase child in Children) { totalSkinFrictionArea += child.TotalSkinFrictionArea(); } return(totalSkinFrictionArea); }
private double GetChildFormDragArea(List <ISpaceCraft> children, double totalFormDragArea) { foreach (SpaceCraftBase child in children) { AeroDynamicProperties props = child.GetAeroDynamicProperties; if (props.HasFlag(AeroDynamicProperties.ExposedToAirFlow)) { if (child.FrontalArea > totalFormDragArea) { totalFormDragArea = child.FrontalArea; } } else if (props.HasFlag(AeroDynamicProperties.ExtendsCrossSection)) { totalFormDragArea += child.FrontalArea; } totalFormDragArea = GetChildFormDragArea(child.Children, totalFormDragArea); } return(totalFormDragArea); }
private double GetMaxChildLiftCoefficient(List <ISpaceCraft> children, double totalLiftCoefficient) { foreach (SpaceCraftBase child in children) { AeroDynamicProperties props = child.GetAeroDynamicProperties; if (props.HasFlag(AeroDynamicProperties.ExposedToAirFlow)) { if (Math.Abs(child.LiftCoefficient) > Math.Abs(totalLiftCoefficient)) { totalLiftCoefficient = child.LiftCoefficient; } } else if (props.HasFlag(AeroDynamicProperties.ExtendsFineness) || props.HasFlag(AeroDynamicProperties.ExtendsCrossSection)) { totalLiftCoefficient += child.LiftCoefficient; } totalLiftCoefficient = GetMaxChildLiftCoefficient(child.Children, totalLiftCoefficient); } return(totalLiftCoefficient); }
private double GetChildLiftArea(List <ISpaceCraft> children, double totalLiftArea) { foreach (SpaceCraftBase child in children) { AeroDynamicProperties props = child.GetAeroDynamicProperties; if (props.HasFlag(AeroDynamicProperties.ExposedToAirFlow)) { if (child.LiftingSurfaceArea > totalLiftArea) { totalLiftArea = child.LiftingSurfaceArea; } } else if (props.HasFlag(AeroDynamicProperties.ExtendsFineness) || props.HasFlag(AeroDynamicProperties.ExtendsCrossSection)) { totalLiftArea += child.LiftingSurfaceArea; } totalLiftArea = GetChildLiftArea(child.Children, totalLiftArea); } return(totalLiftArea); }