Example #1
0
 public void AddGeometry(CADGeometry geometry)
 {
     Geometry = geometry;
 }
Example #2
0
        public static FEAThermalElement[] Extract(CyPhy.ThermalFEAElements thermalElement, string compid, CADGeometry geom)
        {
            List <FEAThermalElement> result = new List <FEAThermalElement>();

            if (thermalElement is CyPhy.ThermalEnvironment)
            {
                if ((thermalElement as CyPhy.ThermalEnvironment).Children.ParameterCollection.Any())
                {
                    var    param = (thermalElement as CyPhy.ThermalEnvironment).Children.ParameterCollection.First();
                    string role  = ((MgaFCO)param.Impl).MetaRole.Name;
                    var    elem  = new FEAThermalElement(param)
                    {
                        ComponentID = compid, Geometry = geom
                    };
                    result.Add(elem);
                }
            }
            else if (thermalElement is CyPhy.ThermalLoad)
            {
                foreach (var param in (thermalElement as CyPhy.ThermalLoad).Children.ParameterCollection)
                {
                    var elem = new FEAThermalElement(param)
                    {
                        ComponentID = compid, Geometry = geom
                    };
                    if (elem.Type == "Convection")
                    {
                        elem.Unit = "J/(s-mm^2-K)";
                    }
                    else if (elem.Type == "HeatFlux")
                    {
                        elem.Unit = "J/(s-mm^2)";
                    }
                    else if (elem.Type == "HeatGeneration")
                    {
                        elem.Unit = "J/s";
                    }
                    else if (elem.Type == "InitialTemperature")
                    {
                        elem.Unit = "K";
                    }
                    else if (elem.Type == "SpecifiedTemperature")
                    {
                        elem.Unit = "K";
                    }
                    result.Add(elem);
                }
            }
            return(result.ToArray());
        }