Esempio n. 1
0
        static internal bool GetSectionPropertyCrvs(string section, out List <Curve> crvs)
        {
            CrossSectionType cst = CrossSectionTypeFromString(section);

            switch (cst)
            {
            case CrossSectionType.RectangularSolid:
                return(GetRectangleCurve(section, out crvs));

            case CrossSectionType.RHS:
                return(GetRHSCurve(section, out crvs));

            case CrossSectionType.CHS:
                return(GetCHSCurve(section, out crvs));

            case CrossSectionType.CSS:
                return(GetCSSCurve(section, out crvs));

            default:
                break;
            }

            // If fails
            crvs = null;
            return(false);
        }
Esempio n. 2
0
        static internal bool CrossSectionFormString(string section, out WR_IXSec xSec)
        {
            CrossSectionType cst = CrossSectionTypeFromString(section);

            switch (cst)
            {
            case CrossSectionType.RectangularSolid:
                return(RectangularCrossSection(section, out xSec));

            case CrossSectionType.RHS:
                return(RHSCrossSection(section, out xSec));

            case CrossSectionType.CHS:
                return(CHSCrossSection(section, out xSec));

            case CrossSectionType.CSS:     // Not implemented yet
                return(CSSCrossSection(section, out xSec));

            case CrossSectionType.Invalid:
            default:
            {
                xSec = null;
                return(false);
            }
            }
        }
Esempio n. 3
0
 public ErrorMessage SpecifyCrossSectionType(CrossSectionType aValue)
 {
     if (aValue != crossSectionType)
     {
         crossSectionType = aValue;
         //owner.HasBeenModified(true);
         DoScopingCalculation();
     }
     return(null);
 }
Esempio n. 4
0
        public CrossSectionGeometry(CrossSectionType crossSectionType, UnitOperation owner) : base()
        {
            this.owner            = owner;
            this.crossSectionType = crossSectionType;
            diameter         = new ProcessVarDouble(StringConstants.DIAMETER, PhysicalQuantity.SmallLength, VarState.Specified, owner);
            width            = new ProcessVarDouble(StringConstants.WIDTH, PhysicalQuantity.Length, VarState.Specified, owner);
            height           = new ProcessVarDouble(StringConstants.HEIGHT, PhysicalQuantity.Length, VarState.Specified, owner);
            heightWidthRatio = new ProcessVarDouble(StringConstants.HEIGHT_WIDTH_RATIO, PhysicalQuantity.Unknown, VarState.Specified, owner);

            InitializeVarListAndRegisterVars();
        }
Esempio n. 5
0
 private void ManageProcessVarList(CrossSectionType sectionType)
 {
     if (sectionType == CrossSectionType.Rectangle)
     {
         RemoveVarsOnListAndUnregisterInSystem(circularGeometryVarList);
         AddVarsOnListAndRegisterInSystem(rectangularGeometryVarList);
     }
     else if (sectionType == CrossSectionType.Circle)
     {
         RemoveVarsOnListAndUnregisterInSystem(rectangularGeometryVarList);
         AddVarsOnListAndRegisterInSystem(circularGeometryVarList);
     }
 }
Esempio n. 6
0
 public void SetCrossSectionType(CrossSectionType type)
 {
     if (type == CrossSectionType.Circle)
     {
         this.radioButtonCrossSectionTypeCircle.Checked = true;
         this.SetCircularSectionUI();
     }
     else if (type == CrossSectionType.Rectangle)
     {
         this.radioButtonCrossSectionTypeRectangle.Checked = true;
         this.SetRectangularSectionUI();
     }
 }
Esempio n. 7
0
        public override void SetObjectData()
        {
            base.SetObjectData();
            int persistedClassVersion = (int)info.GetValue("ClassPersistenceVersionCrossSectionGeometry", typeof(int));

            if (persistedClassVersion == 1)
            {
                this.crossSectionType = (CrossSectionType)info.GetValue("CrossSectionType", typeof(CrossSectionType));
                this.diameter         = RecallStorableObject("Diameter", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.width            = RecallStorableObject("Width", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.height           = RecallStorableObject("Height", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.heightWidthRatio = RecallStorableObject("HeightWidthRatio", typeof(ProcessVarDouble)) as ProcessVarDouble;
            }
        }
Esempio n. 8
0
        public DryerScopingModel(Dryer dryer) : base()
        {
            this.owner       = dryer;
            crossSectionType = CrossSectionType.Circle;
            gasVelocity      = new ProcessVarDouble(StringConstants.GAS_VELOCITY, PhysicalQuantity.Velocity, 2.0, VarState.Specified, dryer);

            diameter            = new ProcessVarDouble(StringConstants.DIAMETER, PhysicalQuantity.Length, VarState.Specified, dryer);
            height              = new ProcessVarDouble(StringConstants.HEIGHT, PhysicalQuantity.Length, VarState.Specified, dryer);
            lengthDiameterRatio = new ProcessVarDouble(StringConstants.LENGTH_DIAMETER_RATIO, PhysicalQuantity.Unknown, 8.0, VarState.Specified, dryer);
            width            = new ProcessVarDouble(StringConstants.WIDTH, PhysicalQuantity.Length, VarState.Specified, dryer);
            length           = new ProcessVarDouble(StringConstants.LENGTH, PhysicalQuantity.Length, VarState.Specified, dryer);
            lengthWidthRatio = new ProcessVarDouble(StringConstants.LENGTH_WIDTH_RATIO, PhysicalQuantity.Unknown, VarState.Specified, dryer);
            heightWidthRatio = new ProcessVarDouble(StringConstants.HEIGHT_WIDTH_RATIO, PhysicalQuantity.Unknown, VarState.Specified, dryer);

            InitializeVarListAndRegisterVars();
        }
Esempio n. 9
0
        public Fan(string name, UnitOpSystem uoSys) : base(name, uoSys)
        {
            staticPressure         = new ProcessVarDouble(StringConstants.STATIC_PRESSURE, PhysicalQuantity.Pressure, VarState.Specified, this);
            totalDischargePressure = new ProcessVarDouble(StringConstants.TOTAL_DISCHARGE_PRESSURE, PhysicalQuantity.Pressure, VarState.AlwaysCalculated, this);
            efficiency             = new ProcessVarDouble(StringConstants.EFFICIENCY, PhysicalQuantity.Fraction, VarState.Specified, this);
            powerInput             = new ProcessVarDouble(StringConstants.POWER_INPUT, PhysicalQuantity.Power, VarState.AlwaysCalculated, this);

            outletCrossSectionType = CrossSectionType.Circle;
            outletDiameter         = new ProcessVarDouble(StringConstants.OUTLET_DIAMETER, PhysicalQuantity.SmallLength, VarState.Specified, this);
            outletWidth            = new ProcessVarDouble(StringConstants.WIDTH, PhysicalQuantity.SmallLength, VarState.Specified, this);
            outletHeight           = new ProcessVarDouble(StringConstants.HEIGHT, PhysicalQuantity.SmallLength, VarState.Specified, this);
            outletHeightWidthRatio = new ProcessVarDouble(StringConstants.HEIGHT_WIDTH_RATIO, PhysicalQuantity.Unknown, VarState.Specified, this);

            includeOutletVelocityEffect = true;
            outletVelocity = new ProcessVarDouble(StringConstants.OUTLET_VELOCITY, PhysicalQuantity.Velocity, VarState.AlwaysCalculated, this);

            //outletGeometry = new CrossSectionGeometry(this);

            InitializeVarListAndRegisterVars();
        }
Esempio n. 10
0
        public override void SetObjectData()
        {
            base.SetObjectData();
            int persistedClassVersion = (int)info.GetValue("ClassPersistenceVersionDryerScopingModel", typeof(int));

            if (persistedClassVersion == 1)
            {
                this.owner               = info.GetValue("Owner", typeof(Dryer)) as Dryer;
                this.procVarList         = info.GetValue("ProcVarList", typeof(ArrayList)) as ArrayList;
                this.crossSectionType    = (CrossSectionType)info.GetValue("CrossSectionType", typeof(CrossSectionType));
                this.diameter            = (ProcessVarDouble)RecallStorableObject("Diameter", typeof(ProcessVarDouble));
                this.gasVelocity         = (ProcessVarDouble)RecallStorableObject("GasVelocity", typeof(ProcessVarDouble));
                this.height              = (ProcessVarDouble)RecallStorableObject("Height", typeof(ProcessVarDouble));
                this.lengthDiameterRatio = (ProcessVarDouble)RecallStorableObject("LengthDiameterRatio", typeof(ProcessVarDouble));
                this.width               = (ProcessVarDouble)RecallStorableObject("Width", typeof(ProcessVarDouble));
                this.length              = (ProcessVarDouble)RecallStorableObject("Length", typeof(ProcessVarDouble));
                this.lengthWidthRatio    = (ProcessVarDouble)RecallStorableObject("LengthWidthRatio", typeof(ProcessVarDouble));
                this.heightWidthRatio    = (ProcessVarDouble)RecallStorableObject("HeightWidthRatio", typeof(ProcessVarDouble));
            }
        }
Esempio n. 11
0
        //public ErrorMessage SpecifyFanType(FanType aValue) {
        //   ErrorMessage retValue = null;
        //   if (aValue != fanType) {
        //      if (fanType == FanType.Fan && staticPressure.IsSpecifiedAndHasValue && staticPressure.Value > 3477) {
        //         string msg = "Changing the fan type from Blower to Fan causes the specified value of " + staticPressure.VarTypeName + " to be out of the appropriate range.";
        //         retValue = new ErrorMessage(ErrorType.SpecifiedValueCausingOtherVarsOutOfRange, StringConstants.INAPPROPRIATE_SPECIFIED_VALUE, msg);
        //         retValue.AddVarAndItsRange(staticPressure, new DoubleRange(0, 3477));
        //      }
        //      else if (fanType == FanType.Blower && staticPressure.HasValue && (staticPressure.Value < 3477 || staticPressure.Value > 10320)) {
        //         string msg = "Changing the fan type from Blower to Fan causes the specified value of " + staticPressure.VarTypeName + " to be out of the appropriate range.";
        //         retValue = new ErrorMessage(ErrorType.SpecifiedValueCausingOtherVarsOutOfRange, StringConstants.INAPPROPRIATE_SPECIFIED_VALUE, msg);
        //         retValue.AddVarAndItsRange(staticPressure, new DoubleRange(3477, 10320));
        //      }

        //      if (retValue == null) {
        //         fanType = aValue;
        //      }
        //   }
        //   return retValue;
        //}

        public ErrorMessage SpecifyOutletCrossSectionType(CrossSectionType aValue)
        {
            ErrorMessage retMsg = null;

            if (aValue != outletCrossSectionType)
            {
                ManageProcessVarList(aValue);
                CrossSectionType oldValue = outletCrossSectionType;
                outletCrossSectionType = aValue;

                try {
                    HasBeenModified(true);
                }
                catch (Exception e) {
                    outletCrossSectionType = oldValue;
                    ManageProcessVarList(oldValue);
                    retMsg = HandleException(e);
                }
            }
            return(retMsg);
        }
Esempio n. 12
0
        public override void SetObjectData()
        {
            base.SetObjectData();
            int persistedClassVersion = (int)info.GetValue("ClassPersistenceVersionFan", typeof(int));

            if (persistedClassVersion == 1)
            {
                //this.fanType = (FanType) info.GetValue("FanType", typeof(FanType));
                this.staticPressure              = RecallStorableObject("StaticPressure", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.totalDischargePressure      = RecallStorableObject("TotalDischargePressure", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.efficiency                  = RecallStorableObject("Efficiency", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.powerInput                  = RecallStorableObject("PowerInput", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.includeOutletVelocityEffect = (bool)info.GetValue("IncludeOutletVelocityEffect", typeof(bool));
                this.outletCrossSectionType      = (CrossSectionType)info.GetValue("OutletCrossSectionType", typeof(CrossSectionType));
                this.outletDiameter              = RecallStorableObject("OutletDiameter", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.outletVelocity              = RecallStorableObject("OutletVelocity", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.outletWidth                 = RecallStorableObject("OutletWidth", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.outletHeight                = RecallStorableObject("OutletHeight", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.outletHeightWidthRatio      = RecallStorableObject("OutletHeightWidthRatio", typeof(ProcessVarDouble)) as ProcessVarDouble;
                this.circularGeometryVarList     = info.GetValue("CircularGeometryVarList", typeof(ArrayList)) as ArrayList;
                this.rectangularGeometryVarList  = info.GetValue("RectangularGeometryVarList", typeof(ArrayList)) as ArrayList;
            }
        }