/// <summary> /// Adds the meta data XML node. /// </summary> /// <param name="Metadata">The metadata.</param> /// <param name="parameterDetail">The parameter detail.</param> private static void AddMetaDataXMLNode(XElement Metadata, ANSYSParameterDetail parameterDetail) { XElement ParameterDetails = new XElement("ParameterDetails"); if (parameterDetail.IdPrefix == "pr") { ParameterDetails = new XElement("PropertyDetails"); } ParameterDetails.SetAttributeValue("id", parameterDetail.IdString); XElement Name = new XElement("Name"); Name.Value = parameterDetail.Name; if (parameterDetail.Units != null && parameterDetail.Units.Count > 0) { XElement Units = new XElement("Units"); foreach (var item in parameterDetail.Units) { XElement Unit = new XElement("Unit"); if (item.Attribite != null) { Unit.SetAttributeValue(item.Attribite, item.AttribiteValue); } XElement NameOfUnit = new XElement("Name"); NameOfUnit.Value = item.Name; Unit.Add(NameOfUnit); Units.Add(Unit); } if (parameterDetail.IdPrefix == "pr") { ParameterDetails.Add(Units); ParameterDetails.Add(Name); } else { ParameterDetails.Add(Name); ParameterDetails.Add(Units); } } else { if (parameterDetail.IdPrefix == "pr") { XElement Unitless = new XElement("Unitless"); ParameterDetails.Add(Unitless); ParameterDetails.Add(Name); } else { ParameterDetails.Add(Name); XElement Unitless = new XElement("Unitless"); ParameterDetails.Add(Unitless); } } Metadata.Add(ParameterDetails); }
/// <summary> /// Creates the parameter detail. /// </summary> /// <param name="type">The type.</param> /// <param name="idPrefix">The identifier prefix.</param> /// <param name="Id">The identifier.</param> /// <param name="Name">The name.</param> /// <param name="units">The units.</param> /// <returns></returns> private static ANSYSParameterDetail CreateParameterDetail(TMPropertyTypeEnum type, string idPrefix, int Id, string Name, IList <ANSYSUnit> units) { ANSYSParameterDetail parameterDetail = new ANSYSParameterDetail(); parameterDetail.Id = Id; parameterDetail.IdPrefix = idPrefix; parameterDetail.Type = type; parameterDetail.IdString = idPrefix + Id.ToString(); parameterDetail.Name = Name; if (units != null && units.Count > 0) { parameterDetail.Units = units; } return(parameterDetail); }
/// <summary> /// Fills the list of parameter details. /// </summary> /// <returns></returns> private static IList <ANSYSParameterDetail> FillListOFParameterDetails() { IList <ANSYSParameterDetail> listOfParameters = new List <ANSYSParameterDetail>(); ANSYSParameterDetail parameterDetail = null; parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalModulusOfElasticity, "pa", 0, "Temperature", new List <ANSYSUnit> { new ANSYSUnit() { Name = "C" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalModulusOfElasticity, "pa", 1, "Young's Modulus", new List <ANSYSUnit> { new ANSYSUnit() { Name = "Pa" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalPoissonCoefficient, "pa", 2, "Poisson's Ratio", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PlasticStrainStress, "pa", 3, "Bulk Modulus", new List <ANSYSUnit> { new ANSYSUnit() { Name = "Pa" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PlasticStrainStress, "pa", 4, "Shear Modulus", new List <ANSYSUnit> { new ANSYSUnit() { Name = "Pa" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PlasticStrainStress, "pa", 5, "Stress", new List <ANSYSUnit> { new ANSYSUnit() { Name = "Pa" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PlasticStrainStress, "pa", 6, "Plastic Strain", new List <ANSYSUnit> { new ANSYSUnit() { Name = "m" }, new ANSYSUnit { Name = "m", Attribite = "power", AttribiteValue = "-1" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.FatigueStressPoints, "pa", 7, "Alternating Stress", new List <ANSYSUnit> { new ANSYSUnit() { Name = "Pa" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.FatigueStressPoints, "pa", 8, "Cycles", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.FatigueStressPoints, "pa", 9, "Mean Stress", new List <ANSYSUnit> { new ANSYSUnit() { Name = "Pa" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.FatigueStrengthCoefficient, "pa", 10, "Strength Coefficient", new List <ANSYSUnit> { new ANSYSUnit() { Name = "Pa" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.FatigueStrengthExponent, "pa", 11, "Strength Exponent", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.FatigueDuctilityCoefficient, "pa", 12, "Ductility Coefficient", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.FatigueDuctilityExponent, "pa", 13, "Ductility Exponent", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.FatigueCyclicStrengthCoefficient, "pa", 14, "Cyclic Strength Coefficient", new List <ANSYSUnit> { new ANSYSUnit() { Name = "Pa" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.FatigueCyclicStrengthExponent, "pa", 15, "Cyclic Strain Hardening Exponent", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalThermalConductivity, "pa", 20, "Thermal Conductivity", new List <ANSYSUnit> { new ANSYSUnit() { Name = "W" }, new ANSYSUnit() { Name = "m", Attribite = "power", AttribiteValue = "-1" }, new ANSYSUnit() { Name = "C", Attribite = "power", AttribiteValue = "-1" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalMeanCoeffThermalExpansion, "pa", 22, "Coefficient of Thermal Expansion", new List <ANSYSUnit> { new ANSYSUnit() { Name = "C", Attribite = "power", AttribiteValue = "-1" } }); listOfParameters.Add(parameterDetail); ///Boca /// parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalThermalConductivity, "pa", 21, "Temperature", new List <ANSYSUnit> { new ANSYSUnit() { Name = "C" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalSpecificThermalCapacity, "pa", 26, "Temperature", new List <ANSYSUnit> { new ANSYSUnit() { Name = "C" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalMeanCoeffThermalExpansion, "pa", 25, "Temperature", new List <ANSYSUnit> { new ANSYSUnit() { Name = "C" } }); listOfParameters.Add(parameterDetail); //parameterDetail = CreateParameterDetail(PropertyTypeEnum.None, "pa", 18, "Reference Temperature", new List<ANSYSUnit> { new ANSYSUnit() { Name = "C"} }); //listOfParameters.Add(parameterDetail); //parameterDetail = CreateParameterDetail(PropertyTypeEnum.None, "pa", 19, "Material Property", null); //listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalDensity, "pr", 0, "Density", new List <ANSYSUnit> { new ANSYSUnit() { Name = "kg" }, new ANSYSUnit { Name = "m", Attribite = "power", AttribiteValue = "-3" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.None, "pr", 1, "Elasticity", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.None, "pr", 2, "Isotropic Hardening", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.None, "pr", 3, "Alternating Stress", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.None, "pr", 4, "Strain-Life Parameters", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.MechanicalYield, "pr", 5, "Tensile Yield Strength", new List <ANSYSUnit> { new ANSYSUnit() { Name = "Pa" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.MechanicalTensile, "pr", 6, "Tensile Ultimate Strength", new List <ANSYSUnit> { new ANSYSUnit() { Name = "Pa" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalThermalConductivity, "pr", 20, "Thermal Conductivity", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalMeanCoeffThermalExpansion, "pr", 21, "Coefficient of Thermal Expansion", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalMeanCoeffThermalExpansion, "pr", 22, "Reference Temperature", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalMeanCoeffThermalExpansion, "pa", 23, "Reference Temperature", new List <ANSYSUnit> { new ANSYSUnit() { Name = "C" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalMeanCoeffThermalExpansion, "pa", 24, "Material Property", null); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.PhysicalSpecificThermalCapacity, "pr", 26, "Specific Heat", new List <ANSYSUnit> { new ANSYSUnit() { Name = "J" }, new ANSYSUnit() { Name = "kg", Attribite = "power", AttribiteValue = "-1" }, new ANSYSUnit() { Name = "C", Attribite = "power", AttribiteValue = "-1" } }); listOfParameters.Add(parameterDetail); parameterDetail = CreateParameterDetail(TMPropertyTypeEnum.None, "pr", 10, "Reference Temperature", null); listOfParameters.Add(parameterDetail); return(listOfParameters); }