예제 #1
0
        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);
        }
예제 #2
0
        /// <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));
        }
예제 #3
0
        /// <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));
        }
예제 #4
0
        /// <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));
        }
예제 #5
0
        /// <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));
        }
예제 #6
0
        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);
        }
예제 #7
0
        /// <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);
        }
예제 #8
0
        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);
        }
예제 #9
0
        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);
        }
예제 #10
0
        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);
        }