/// <summary> /// Returns <see cref="WireShape"/> from user input. /// /// As of 04/04/2019 no input checking is provided. /// </summary> /// <param name="value">Enum value to find with name of.</param> /// <returns>Corresponding wire shape value.</returns> public static WireShape GetWireShape(string value) { WireShape wireShape = WireShape.RECTANGULAR; if (Enum.TryParse(value, out wireShape)) return wireShape; return WireShape.RECTANGULAR; }
/// <summary> /// Constructor. /// /// If <see cref="Bifilar"/> is <see cref="Data.Constants.Bifilar._1H1W"/> the cost of the wire is the sum of the fabrication <paramref name="cost"/> and the material price. /// If <see cref="Bifilar"/> is not <see cref="Data.Constants.Bifilar._1H1W"/> the cost of the wire will be the product of the cost and the <see cref="Functions.Functions.BifilarMultiplier(Bifilar, Wire)"/>. /// </summary> /// <param name="name">Name of the wire.</param> /// <param name="wireMaterial">Conductor material of the wire.</param> /// <param name="wireShape">Shape of the wire. </param> /// <param name="bifilar">Bifilar of the wire.</param> /// <param name="width">Conductor width of the wire.</param> /// <param name="thickness">Conductor material of the wire.</param> /// <param name="insThickness">Insulation thickness around the wire.</param> /// <param name="resistance">Resistance in Ohms of the wire per 1000 inches.</param> /// <param name="weight">Weight of the wire in Lbs. per 1000 inches.</param> /// <param name="cost">Fabrication cost of a single wire.</param> /// <param name="skew_factor">Skew factor of the wire, 1 for rectangular and round wire and 0 for foil.</param> protected internal Wire(string name, WireMaterial wireMaterial, WireShape wireShape, Bifilar bifilar, double width, double thickness, double insThickness, double resistance, double weight, double cost, int skew_factor) { this.Name = name; this.WireMaterial = wireMaterial; this.WireShape = wireShape; this.Bifilar = bifilar; this.ConductorWidth = width; this.ConductorThickness = thickness; this.InsulationThickness = insThickness; this.ResistancePer1000Inches = resistance / BifilarMultiplier(bifilar); this.WeightPer1000Inches = weight * BifilarMultiplier(bifilar); if (Bifilar != Bifilar._1H1W) { this.Cost = cost; } else { this.Cost = (cost + (double)(wireMaterial == WireMaterial.ALUMINUM ? AluminumPrice : CopperPrice));// * BifilarMultiplier(bifilar); } this.SkewFactor = skew_factor; }
/// <summary> /// Creates a new section and adds it to the given winding. /// </summary> /// <param name="winding">Winding to add section to.</param> /// <param name="order">Order of the section.</param> /// <param name="startVoltage">Starting voltage of the section.</param> /// <param name="endVoltage">Ending voltage of the section.</param> /// <param name="bulgeFactor">Bulge factor of the section.</param> /// <param name="margin">Margin of the section.</param> /// <param name="layerPaper">Total layer paper thickness of the section.</param> /// <param name="wrap">Total wrap thickness of the section.</param> /// <param name="cdMin">Minimum current density to find wires with.</param> /// <param name="cdMax">Maximum current density to find wires with.</param> /// <param name="wireMaterial">Material to find wires with.</param> /// <param name="wireShape">Shape to find wires with.</param> /// <param name="bifilars">Bifilars to find wires with.</param> public void AddSection(Winding winding, int order, double startVoltage, double endVoltage, double bulgeFactor, double margin, double layerPaper, double wrap, double cdMin, double cdMax, WireMaterial wireMaterial, WireShape wireShape, Bifilar[] bifilars) { winding.Sections.Add(new Section(winding, order, startVoltage, endVoltage, bulgeFactor, margin, layerPaper, wrap, cdMin, cdMax, wireMaterial, wireShape, bifilars)); }
/// <summary> /// Constructor. /// /// Note: For a <paramref name="wireMaterial"/> of <see cref="Data.Constants.WireMaterial.COPPER"/> or <see cref="Data.Constants.WireMaterial.ALUMINUM"/> the current density minimum and maximum work as expected. /// If <paramref name="wireMaterial"/> is <see cref="Data.Constants.WireMaterial.ANY"/> then for the Aluminum wire the maximum current density is capped at 1300, and for the Copper wire the minimum durrent density is capped at 1000. /// /// </summary> /// <param name="winding">Winding to add the section to.</param> /// <param name="order">Order of the section in the coil.</param> /// <param name="startVoltage">Starting voltage of the section.</param> /// <param name="endVoltage">Ending voltage of the section.</param> /// <param name="bulgeFactor">Bulge factor of the section.</param> /// <param name="margin">Margin of the section.</param> /// <param name="layerPaper">Total thickness of insulation between layers.</param> /// <param name="wrap">Total thickness of wrap after the section.</param> /// <param name="cdMin">Minimum current density for wires to pass.</param> /// <param name="cdMax">Maximum current density for wires to pass.</param> /// <param name="wireMaterial">Wire materials to iterate.</param> /// <param name="wireShape">Wire shapes to iterate.</param> /// <param name="bifilars">Bifilar ranges to iterate.</param> /// <param name="wireShapes">Optional parameter used to specify which cominatiopn of wire shapes for iterate over.</param> public Section(Winding winding, int order, double startVoltage, double endVoltage, double bulgeFactor, double margin, double layerPaper, double wrap, double cdMin, double cdMax, WireMaterial wireMaterial, WireShape wireShape, Bifilar[] bifilars, WireShape[] wireShapes = null) { this.Winding = winding; this.SectionOrder = order; this.WindingName = winding.Name; this.Name = "Section " + order; this.StartingVoltage = startVoltage; this.EndingVoltage = endVoltage; this.BulgeFactor = bulgeFactor; this.Margin = margin; this.LayerPaper = layerPaper; this.Wrap = wrap; this.CurrentDensityMinimum = cdMin; this.CurrentDensityMaximum = cdMax; this.IterateWireMaterial = wireMaterial; this.IterateWireShape = wireShape; this.BifilarRange = bifilars; this.IterateWireShapes = wireShapes; this.Ducts = new List <Duct>(); }