/// <summary> /// Returns <see cref="WireMaterial"/> 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 material value.</returns> public static WireMaterial GetWireMaterial(string value) { WireMaterial wireMaterial = WireMaterial.COPPER; if (Enum.TryParse(value, out wireMaterial)) return wireMaterial; return WireMaterial.COPPER; }
private Wire(string name, double totalCrossSection, double initialWireDiameter, double finalWireDiameter, double initialWireLinearWeight, double finalWireLinearWeight, double maxRatedStrength, double outerElasticty, double outerThermalCoefficient, double coreElasticity, double coreThermalCoefficient, List <double> outerStressStrainList, List <double> outerCreepList, List <double> coreStressStrainList, List <double> coreCreepList, double startingTension, double startingTemp, double startingSpanLength, double startingElevation, bool startingTensionType, WireMaterial material) { Name = name; TotalCrossSection = totalCrossSection; InitialWireDiameter = initialWireDiameter; FinalWireDiameter = finalWireDiameter; InitialWireLinearWeight = initialWireLinearWeight; FinalWireLinearWeight = finalWireLinearWeight; MaxRatedStrength = maxRatedStrength; OuterElasticity = outerElasticty; OuterThermalCoefficient = outerThermalCoefficient; CoreElasticity = coreElasticity; CoreThermalCoefficient = coreThermalCoefficient; OuterStressStrainList = outerStressStrainList; OuterCreepList = outerCreepList; CoreStressStrainList = coreStressStrainList; CoreCreepList = coreCreepList; StartingTension = startingTension; StartingTemp = startingTemp; StartingSpanLength = startingSpanLength; StartingElevation = startingElevation; StartingTensionType = startingTensionType; Material = material; }
/// <summary> /// Constructor. /// </summary> /// <param name="requiredCSA">Required cross sectional area of the foil to meet for current density.</param> /// <param name="wireMaterial">What material the foil will be made of.</param> protected internal Foil(double requiredCSA, WireMaterial wireMaterial) { this.Name = "Foil"; this.requiredCSA = requiredCSA; this.WireShape = WireShape.FOIL; this.WireMaterial = wireMaterial; }
/// <summary> /// Returns a list of wires that pass the given parameters. /// /// All wires will be iterated of the range of bifilars supplied. /// As only 1H1W wires are considered standard, if a bifilar would create a passing wire with a bifilar that is not 1H1W, that wire will be created. /// /// Note: Round wires can only have a bifilar of 1H1W, if bifilar range contains values other than 1H1W, those values will be skipped for round wires. /// /// As of 04/22/2019 with the addition of the section parameter and min and max CD checking, this would make sense to become an extension method. /// </summary> /// <param name="wireMaterial">Wires of certain material to be returned, if ANY, then all materials are looked at.</param> /// <param name="wireShapes">Wires of certain shape to be returned, if ANY, then all shapes are looked at.</param> /// <param name="bifilars">Range of bifilars to iterate over.</param> /// <param name="minimumCSA">Minimum cross sectional area of the wire.</param> /// <param name="maximumCSA">Maximum cross sectional area of the wire.</param> /// <param name="section">Optional, section wires are determined for; used for checking max and min current density ranges for any material.</param> /// <returns></returns> public static List <Wire> GetWires(WireMaterial wireMaterial, WireShape[] wireShapes, Bifilar[] bifilars, double minimumCSA, double maximumCSA, Section section = null) { List <Wire> _wires = new List <Wire>(); WireMaterial[] materials; if (wireMaterial == WireMaterial.ANY) { materials = new WireMaterial[] { WireMaterial.COPPER, WireMaterial.ALUMINUM } } ; else { materials = new WireMaterial[] { wireMaterial } }; foreach (var material in materials) { foreach (var shape in wireShapes) { foreach (var bifilar in bifilars) { if (bifilar != Bifilar._1H1W && shape != WireShape.RECTANGULAR) { break; } if (shape == WireShape.FOIL) { List <Foil> foils = new List <Foil>(); for (double d = section.CurrentDensityMinimum.CurrentDensityMaterialFactor(material); d <= section.CurrentDensityMaximum.CurrentDensityMaterialFactor(material); d += 100) { foils.Add(new Foil(section.SectionCurrent / d, material)); } _wires.AddRange(foils); } else { IEnumerable <Wire> query; if (bifilar == Bifilar._1H1W) { query = Wires._wires.Where(w => w.WireShape == shape && w.WireMaterial == material && w.CrossSectionalArea >= section.SectionCurrent / section.CurrentDensityMaximum.CurrentDensityMaterialFactor(material) / BifilarMultiplier(bifilar) && w.CrossSectionalArea <= section.SectionCurrent / section.CurrentDensityMinimum.CurrentDensityMaterialFactor(material) / BifilarMultiplier(bifilar)); } else { query = from wire in Wires._wires.Where(w => w.WireShape == shape && w.WireMaterial == material && w.CrossSectionalArea >= section.SectionCurrent / section.CurrentDensityMaximum.CurrentDensityMaterialFactor(material) / BifilarMultiplier(bifilar) && w.CrossSectionalArea <= section.SectionCurrent / section.CurrentDensityMinimum.CurrentDensityMaterialFactor(material) / BifilarMultiplier(bifilar)) select new Wire(wire.Name, wire.WireMaterial, wire.WireShape, bifilar, wire.ConductorWidth, wire.ConductorThickness, wire.InsulationThickness, wire.ResistancePer1000Inches, wire.WeightPer1000Inches, wire.Cost, wire.SkewFactor); } _wires.AddRange(query); } } } } return(_wires); } }
/// <summary> /// Get the material price of a given wire material. /// </summary> /// <param name="wireMaterial">Wire material to get price of.</param> /// <returns>Price of wire material.</returns> public static decimal GetWireMaterialPrice(WireMaterial wireMaterial) { if (wireMaterial == WireMaterial.COPPER) { return(CopperPrice); } else { return(AluminumPrice); } }
/// <summary> /// Returns the current density adjusted for the maximum and minimum bounds used by different wire materials. /// </summary> /// <param name="cd">Unadjusted current density of the wire.</param> /// <param name="wireMaterial">Material of the wire.</param> /// <returns>Adjusted current density.</returns> public static double CurrentDensityMaterialFactor(this double cd, WireMaterial wireMaterial) { if (wireMaterial == WireMaterial.ALUMINUM && cd > 1300) { return(1300); } if (wireMaterial == WireMaterial.COPPER && cd < 1000) { return(1000); } return(cd); }
/// <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)); }
public static Wire Create(string name, double totalCrossSection, double initialWireDiameter, double finalWireDiameter, double initialWireLinearWeight, double finalWireLinearWeight, double maxRatedStrength, double outerElasticity, double outerThermalCoefficient, double coreElasticity, double coreThermalCoefficient, List <double> outerStressStrainList, List <double> outerCreepList, List <double> coreStressStrainList, List <double> coreCreepList, double startingTension, double startingTemp, double startingSpanLength, double startingElevation, bool startingTensionType, WireMaterial material) { return(new Wire(name, totalCrossSection, initialWireDiameter, finalWireDiameter, initialWireLinearWeight, finalWireLinearWeight, maxRatedStrength, outerElasticity, outerThermalCoefficient, coreElasticity, coreThermalCoefficient, outerStressStrainList, outerCreepList, coreStressStrainList, coreCreepList, startingTension, startingTemp, startingSpanLength, startingElevation, startingTensionType, material)); }
/// <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>(); }