Ejemplo n.º 1
0
        public double CalculateSDS(double SS, double Fa)
        {
            double SMS = Fa * SS;         //(11.4-1)

            double SDS = 2.0 / 3.0 * SMS; //(11.4-3)


            #region SMS
            ICalcLogEntry SMSEntry = new CalcLogEntry();
            SMSEntry.ValueName = "SMS";
            SMSEntry.AddDependencyValue("Fa", Math.Round(Fa, 2));
            SMSEntry.AddDependencyValue("SS", Math.Round(SS, 3));
            SMSEntry.Reference            = "The MCER spectral response acceleration parameter for short periods";
            SMSEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicSMS.docx";
            SMSEntry.FormulaID            = null; //(11.4-1)
            SMSEntry.VariableValue        = Math.Round(SMS, 3).ToString();
            #endregion
            this.AddToLog(SMSEntry);

            #region SDS
            ICalcLogEntry SDSEntry = new CalcLogEntry();
            SDSEntry.ValueName = "SDS";
            SDSEntry.AddDependencyValue("SMS", Math.Round(SMS, 3));
            SDSEntry.Reference            = "Design earthquake spectral response acceleration parameter for short periods";
            SDSEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicSDS.docx";
            SDSEntry.FormulaID            = null; //(11.4-3)
            SDSEntry.VariableValue        = Math.Round(SDS, 3).ToString();
            #endregion
            this.AddToLog(SDSEntry);

            return(SDS);
        }
Ejemplo n.º 2
0
        public double GetCornerZoneDimension(double B, double L, double h)
        {
            double Lm  = Math.Min(B, L);
            double a01 = 0.1 * Lm;
            double a02 = 0.4 * h;
            double a1  = Math.Min(a01, a02);
            double a11 = 3.0;
            double a12 = 0.04 * Lm;
            double a2  = Math.Min(a11, a12);

            double a = Math.Max(a1, a2);

            #region a
            ICalcLogEntry aEntry = new CalcLogEntry();
            aEntry.ValueName = "a";
            aEntry.AddDependencyValue("a1", Math.Round(a1, 3));
            aEntry.AddDependencyValue("a2", Math.Round(a2, 3));
            aEntry.AddDependencyValue("Lm", Math.Round(Lm, 3));
            aEntry.Reference            = "";
            aEntry.DescriptionReference = "/Templates/loads/ASCE7_10/Wind/PressureCoefficient/WindCpWallCCCornerDimension.docx";
            aEntry.FormulaID            = null; //reference to formula from code
            aEntry.VariableValue        = Math.Round(a, 3).ToString();
            #endregion
            this.AddToLog(aEntry);
            return(a);
        }
Ejemplo n.º 3
0
        public double GetMinimumSnowLoad(double slope, double pg, double Is)
        {
            double pm = 0.0;


            #region pm
            ICalcLogEntry pmEntry = new CalcLogEntry();
            pmEntry.ValueName = "pm";
            pmEntry.AddDependencyValue("pg", Math.Round(pg, 3));
            pmEntry.AddDependencyValue("Is", Math.Round(Is, 3));
            pmEntry.Reference = "";
            pmEntry.FormulaID = null; //reference to formula from code

            #endregion

            if (slope <= 15.0)
            {
                if (pg <= 20.0)
                {
                    pm = Is * pg;;
                    pmEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Snow/GroundSnowMinimumLight.docx";
                }
                else
                {
                    pm = 20 * (Is);
                    pmEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Snow/GroundSnowMinimumHeavy.docx";
                }
            }

            pmEntry.VariableValue = Math.Round(pm, 3).ToString();
            this.AddToLog(pmEntry);

            return(pm);
        }
Ejemplo n.º 4
0
        public double CalculateSD1(double S1, double Fv)
        {
            double SM1 = Fv * S1;         //(11.4-2)

            double SD1 = 2.0 / 3.0 * SM1; //(11.4-4)

            #region SM1
            ICalcLogEntry SM1Entry = new CalcLogEntry();
            SM1Entry.ValueName = "SM1";
            SM1Entry.AddDependencyValue("Fv", Math.Round(Fv, 2));
            SM1Entry.AddDependencyValue("Sone", Math.Round(S1, 3));
            SM1Entry.Reference            = "The MCER spectral response acceleration parameter at 1 second";
            SM1Entry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicSM1.docx";
            SM1Entry.FormulaID            = null; //(11.4-2)
            SM1Entry.VariableValue        = Math.Round(SM1, 3).ToString();
            #endregion


            #region SD1
            ICalcLogEntry SD1Entry = new CalcLogEntry();
            SD1Entry.ValueName = "SD1";
            SD1Entry.AddDependencyValue("SM1", Math.Round(SM1, 3));
            SD1Entry.Reference            = "Design earthquake spectral response acceleration parameter at 1 second";
            SD1Entry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicSD1.docx";
            SD1Entry.FormulaID            = null; //(11.4-4)
            SD1Entry.VariableValue        = Math.Round(SD1, 3).ToString();
            #endregion

            // set entry in Log

            this.AddToLog(SM1Entry);
            this.AddToLog(SD1Entry);

            return(SD1);
        }
        double GetMeanHourlyWindVz()
        {
            if (terrainCoefficientsNeedCalculation == true)
            {
                CalculateTerrainCoefficients(WindExposure);
            }
            double V     = windSpeed;
            double Vz_ob = b_ob * Math.Pow(z_ob / 33, alpha_ob) * (88.0 / 60.0) * V;


            #region Vz_ob
            ICalcLogEntry Vz_obEntry = new CalcLogEntry();
            Vz_obEntry.ValueName = "Vz";
            Vz_obEntry.AddDependencyValue("b_ob", Math.Round(b_ob, 3));
            Vz_obEntry.AddDependencyValue("z_ob", Math.Round(z_ob, 3));
            Vz_obEntry.AddDependencyValue("alphob", Math.Round(alpha_ob, 3));
            Vz_obEntry.AddDependencyValue("V", Math.Round(V, 3));
            Vz_obEntry.Reference            = "";
            Vz_obEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindGustFactorFlexibleMeanHourlyWindVz.docx";
            Vz_obEntry.FormulaID            = null; //reference to formula from code
            Vz_obEntry.VariableValue        = Math.Round(Vz_ob, 3).ToString();
            #endregion
            this.AddToLog(Vz_obEntry);


            this.Vz_ob = Vz_ob;
            VzClean    = true;
            return(Vz_ob);
        }
        double GetIntegralLengthScaleOfTurbulenceLz()
        {
            if (terrainCoefficientsNeedCalculation == true)
            {
                CalculateTerrainCoefficients(WindExposure);
            }

            double Lz = l * (Math.Pow(z_ob / 33.0, epsilon_overbar));

            #region Lz
            ICalcLogEntry LzEntry = new CalcLogEntry();
            LzEntry.ValueName = "Lz";
            LzEntry.AddDependencyValue("z_ob", Math.Round(z_ob, 3));
            LzEntry.AddDependencyValue("l", Math.Round(l, 3));
            LzEntry.AddDependencyValue("epsilon_overbar", Math.Round(epsilon_overbar, 3));
            LzEntry.Reference            = "";
            LzEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindGustFactorFlexibleIntegralLengthScaleOfTurbulenceLz.docx";
            LzEntry.FormulaID            = null; //reference to formula from code
            LzEntry.VariableValue        = Math.Round(Lz, 3).ToString();
            #endregion
            this.AddToLog(LzEntry);
            this.Lz = Lz;
            LzClean = true;
            return(Lz);
        }
Ejemplo n.º 7
0
        public double GetInternalPressureCoefficient(WindEnclosureType EnclosureType, double OpeningArea,
                                                     double InternalVolume)
        {
            double GCpi  = this.GetInternalPressureCoefficient(EnclosureType);
            double Vi    = InternalVolume;
            double Aog   = OpeningArea;
            double Ri    = 1.0;
            double GCpiR = GCpi * Ri;

            //WindInternalPressureCoefficientLargeVolumeRi.docx


            #region GCpiR
            ICalcLogEntry GCpiREntry = new CalcLogEntry();
            GCpiREntry.ValueName = "GCpiR";
            GCpiREntry.AddDependencyValue("GCpi", Math.Round(GCpi, 3));
            GCpiREntry.AddDependencyValue("Vi", Math.Round(Vi, 3));
            GCpiREntry.Reference            = "";
            GCpiREntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/WindInternalPressureCoefficientLargeVolumeRi.docx";
            GCpiREntry.FormulaID            = null; //reference to formula from code
            GCpiREntry.VariableValue        = Math.Round(GCpiR, 3).ToString();
            #endregion
            this.AddToLog(GCpiREntry);

            return(GCpiR);
        }
        public CCPressureResult GetPressure(WindWallCladdingZone Zone, double theta, double A_trib, double B, double L, double h)
        {
            double CpPos = GetWallPressureCoefficientPositive(Zone, theta, A_trib, h);
            double CpNeg = GetWallPressureCoefficientNegative(Zone, theta, A_trib, h);


            double CpMax = Math.Max(Math.Abs(CpPos), Math.Abs(CpNeg));

            #region Cp
            ICalcLogEntry CpEntry = new CalcLogEntry();
            CpEntry.ValueName = "Cp";
            CpEntry.AddDependencyValue("A", Math.Round(A_trib, 3));
            CpEntry.AddDependencyValue("h", Math.Round(h, 3));
            CpEntry.AddDependencyValue("theta", Math.Round(theta, 3));
            CpEntry.AddDependencyValue("Gcp", Math.Round(CpPos, 3));
            CpEntry.AddDependencyValue("GcpNeg", Math.Round(CpNeg, 3));
            CpEntry.Reference            = "";
            CpEntry.DescriptionReference = SelectTemplate(h, theta, Zone);
            CpEntry.FormulaID            = null; //reference to formula from code
            CpEntry.VariableValue        = Math.Round(CpMax, 3).ToString();
            #endregion
            this.AddToLog(CpEntry);

            double           a      = GetCornerZoneDimension(B, L, h);
            CCPressureResult result = new CCPressureResult(CpPos, CpNeg, a);
            return(result);
        }
        public double GetResonantResponseFactorR()
        {
            double Vz   = Vz_ob;
            double beta = Damping;

            double N1 = n1 * Lz / Vz;

            #region N1
            ICalcLogEntry N1Entry = new CalcLogEntry();
            N1Entry.ValueName = "N1";
            N1Entry.AddDependencyValue("n1", Math.Round(n1, 3));
            N1Entry.AddDependencyValue("Lz", Math.Round(Lz, 3));
            N1Entry.AddDependencyValue("Vz", Math.Round(Vz, 3));
            N1Entry.Reference            = "";
            N1Entry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindGustFactorFlexibleN1.docx";
            N1Entry.FormulaID            = null; //reference to formula from code
            N1Entry.VariableValue        = Math.Round(N1, 3).ToString();
            #endregion
            this.AddToLog(N1Entry);
            double Rn = 7.47 * N1 / (Math.Pow(1 + 10.3 * N1, 5.0 / 3.0));

            #region Rn
            ICalcLogEntry RnEntry = new CalcLogEntry();
            RnEntry.ValueName = "Rn";
            RnEntry.AddDependencyValue("N1", Math.Round(N1, 3));
            RnEntry.Reference            = "";
            RnEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindGustFactorFlexiblegRn.docx";
            RnEntry.FormulaID            = null; //reference to formula from code
            RnEntry.VariableValue        = Math.Round(Rn, 3).ToString();
            #endregion
            this.AddToLog(RnEntry);

            double eta_L = Get_eta_L();
            double eta_B = Get_eta_B();
            double eta_h = Get_eta_h();

            double Rh = GetRl(eta_h, "h");
            double RB = GetRl(eta_B, "B");
            double RL = GetRl(eta_L, "L");
            double R  = Math.Sqrt(1.0 / beta * Rn * Rh * RB * (0.53 + 0.47 * RL));


            #region R
            ICalcLogEntry REntry = new CalcLogEntry();
            REntry.ValueName = "R";
            REntry.AddDependencyValue("beta", Math.Round(beta, 3));
            REntry.AddDependencyValue("Rn", Math.Round(Rn, 3));
            REntry.AddDependencyValue("Rh", Math.Round(Rh, 3));
            REntry.AddDependencyValue("RB", Math.Round(RB, 3));
            REntry.AddDependencyValue("RL", Math.Round(RL, 3));
            REntry.Reference            = "";
            REntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindGustFactorFlexibleR.docx";
            REntry.FormulaID            = null; //reference to formula from code
            REntry.VariableValue        = Math.Round(R, 3).ToString();
            #endregion
            this.AddToLog(REntry);

            return(R);
        }
        public double GetApproximatePeriodGeneral(double hn, SeismicSystemTypeForApproximateAnalysis System)
        {
            this.GeneralProcedureData = new GeneralProcedureDataInfo();

            #region Read Table 12.8-2 Values of Approximate Period Parameters Ct and x

            var Tv2 = new { System = SeismicSystemTypeForApproximateAnalysis.OtherStructuralSystem, Ct = 0.0, x = 0.0 }; // sample
            var ApproximatePeriodParameterList = ListFactory.MakeList(Tv2);

            using (StringReader reader = new StringReader(Resources.ASCE7_10T12_8_2))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 3)
                    {
                        SeismicSystemTypeForApproximateAnalysis system =
                            (SeismicSystemTypeForApproximateAnalysis)Enum.Parse(typeof(SeismicSystemTypeForApproximateAnalysis), Vals[0]);
                        double ct = double.Parse(Vals[1], CultureInfo.InvariantCulture);
                        double _x = double.Parse(Vals[2], CultureInfo.InvariantCulture);
                        ApproximatePeriodParameterList.Add(new { System = system, Ct = ct, x = _x });
                    }
                }
            }

            #endregion

            var Params          = from p in ApproximatePeriodParameterList where p.System == System select p;
            var ParamResultList = (Params.ToList());
            var thisSysParams   = ParamResultList[0];


            double Ta;
            double Ct = thisSysParams.Ct;
            GeneralProcedureData.Ct = Ct; //store off for unit testing
            double x = thisSysParams.x;
            GeneralProcedureData.x = x;   //store off for unit testing
            Ta = Ct * Math.Pow(hn, x);

            #region Ta
            ICalcLogEntry TaEntry = new CalcLogEntry();
            TaEntry.ValueName = "Ta";
            TaEntry.AddDependencyValue("Ct", Math.Round(Ct, 3));
            TaEntry.AddDependencyValue("hn", Math.Round(hn, 3));
            TaEntry.AddDependencyValue("x", Math.Round(x, 3));
            TaEntry.Reference            = "";
            TaEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicApproximatePeriodGeneralProcedureTa.docx";
            TaEntry.FormulaID            = null; //reference to formula from code
            TaEntry.VariableValue        = Math.Round(Ta, 3).ToString();
            #endregion
            this.AddToLog(TaEntry);

            return(Ta);
        }
        public double GetApproximatePeriodShearWall(List <ApproximatePeriodShearWallInfo> Walls, double BaseArea, double Height)
        {
            double Ta = 0.0;
            double Cw = 0.0;

            double hn    = Height;
            double A_B   = BaseArea;
            double CwSum = 0.0;

            List <List <string> > ReportTableData = new List <List <string> >();

            foreach (ApproximatePeriodShearWallInfo wall in Walls)
            {
                //Summation term in 12.8-10
                double hi = wall.Height;
                double Ai = wall.WebArea;
                double Di = wall.Length;

                double CwThis = Math.Pow(hn / hi, 2.0) * Ai / (1 + 0.83 * Math.Pow(hi / Di, 2.0));
                CwSum += CwThis;
                #region report part

                List <string> row = new List <string>()
                {
                    Math.Round(hi, 3).ToString(), Math.Round(Di, 3).ToString(), Math.Round(Ai, 2).ToString(), Math.Round(CwThis, 3).ToString()
                };
                ReportTableData.Add(row);

                #endregion
            }
            //12.8-10
            Cw = 100.0 / A_B * CwSum;
            Ta = 0.0019 / Math.Sqrt(Cw) * hn;


            #region Ta
            ICalcLogEntry TaEntry = new CalcLogEntry();
            TaEntry.ValueName = "Ta";
            TaEntry.AddDependencyValue("Cw", Math.Round(Cw, 3));
            TaEntry.AddDependencyValue("AeffSum", Math.Round(CwSum, 3));
            TaEntry.AddDependencyValue("hn", Math.Round(hn, 3));
            TaEntry.AddDependencyValue("AB", Math.Round(A_B, 3));
            TaEntry.TableData            = ReportTableData;
            TaEntry.TemplateTableTitle   = "W";
            TaEntry.Reference            = "";
            TaEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicApproximatePeriodShearWallTa.docx";
            TaEntry.FormulaID            = null; //reference to formula from code
            TaEntry.VariableValue        = Math.Round(Ta, 3).ToString();
            #endregion
            this.AddToLog(TaEntry);

            return(Ta);
        }
Ejemplo n.º 12
0
 public void AddGoverningCaseMaxLogEntry(string ValueName, double ValMax, double ValMin, string GoverningEquation)
 {
     #region GoverningValueMax
     ICalcLogEntry GoverningValueEntryMax = new CalcLogEntry();
     GoverningValueEntryMax.ValueName = ValueName;
     GoverningValueEntryMax.AddDependencyValue("ValMax", Math.Round(ValMax, 3));
     GoverningValueEntryMax.AddDependencyValue("ValMin", Math.Round(ValMin, 3));
     GoverningValueEntryMax.AddDependencyValue("GoverningEquation", GoverningEquation);
     GoverningValueEntryMax.Reference            = "Governing case";
     GoverningValueEntryMax.DescriptionReference = "/Templates/General/GoverningValueMax.docx";
     GoverningValueEntryMax.FormulaID            = GoverningEquation; //reference to formula from code
     GoverningValueEntryMax.VariableValue        = Math.Round(ValMax, 3).ToString();
     #endregion
     log.AddEntry(GoverningValueEntryMax);
 }
Ejemplo n.º 13
0
        public double GetKd(string StructureTypeId)
        {
            #region Read Table

            var SampleValue = new { StructureTypeId = "", Description = "", Kd = "" }; // sample
            var KdList      = ListFactory.MakeList(SampleValue);

            using (StringReader reader = new StringReader(Resources.ASCE7_10F26_6_1Kd))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 3)
                    {
                        string thisStructureTypeId = (string)Vals[0];
                        string thisDescription     = (string)Vals[1];
                        string thisKd = (string)Vals[2];

                        KdList.Add(new
                        {
                            StructureTypeId = thisStructureTypeId,
                            Description     = thisDescription,
                            Kd = thisKd
                        });
                    }
                }
            }

            #endregion

            var tableValues = from KdEntry in KdList
                              where (KdEntry.StructureTypeId == StructureTypeId)
                              select KdEntry;
            var result = (tableValues.ToList()).FirstOrDefault();

            double Kd = 1.0;
            if (result != null)
            {
                Kd = double.Parse(result.Kd, CultureInfo.InvariantCulture);
                string SystemDescription = result.Description;

                #region Kd
                ICalcLogEntry KdEntry = new CalcLogEntry();
                KdEntry.ValueName = "Kd";
                KdEntry.AddDependencyValue("SystemDescription", SystemDescription);
                KdEntry.Reference            = "";
                KdEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/WindDirectionalityFactor.docx";
                KdEntry.FormulaID            = null; //reference to formula from code
                KdEntry.VariableValue        = Math.Round(Kd, 2).ToString();
                #endregion
                this.AddToLog(KdEntry);
            }
            else
            {
                throw new ParameterNotFoundInTableException("Kd");
            }

            return(Kd);
        }
Ejemplo n.º 14
0
        public BuildingRiskCategory GetRiskCategory(string structureCategoryByOccupancyId)
        {
            #region Read Category Data (ASCE Table 1.5-1)

            var SampleValue      = new { OccupancyId = "", OccupancyDescription = "", RiskCategory = "" }; // sample
            var RiskCategoryList = ListFactory.MakeList(SampleValue);

            using (StringReader reader = new StringReader(Resources.ASCE7_10T1_5_1RiskCategories))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 3)
                    {
                        string OccupId = (string)Vals[0];
                        string OccupancyDescription = (string)Vals[1];
                        string RiskCat = (string)Vals[2];


                        RiskCategoryList.Add(new
                        {
                            OccupancyId          = OccupId,
                            OccupancyDescription = OccupancyDescription,
                            RiskCategory         = RiskCat
                        });
                    }
                }
            }

            #endregion

            var dataValues     = from riskCat in RiskCategoryList where (riskCat.OccupancyId == structureCategoryByOccupancyId) select riskCat;
            var resultCategory = dataValues.ToList().First();

            string parsedCategoryValue        = resultCategory.RiskCategory;
            string parsedOccupancyDescription = resultCategory.OccupancyDescription;

            BuildingRiskCategory riskCategory = BuildingRiskCategory.None;
            BuildingRiskCategory tmpParsedVal;
            if (Enum.TryParse <BuildingRiskCategory>(parsedCategoryValue, false, out tmpParsedVal) == true)
            {
                riskCategory = tmpParsedVal;
            }


            #region RiskCategory
            ICalcLogEntry riskCategoryEntry = new CalcLogEntry();
            riskCategoryEntry.ValueName = "RiskCategory";
            riskCategoryEntry.AddDependencyValue("OccupancyDescription", parsedOccupancyDescription);
            riskCategoryEntry.Reference            = "Risk Category";
            riskCategoryEntry.DescriptionReference = "/Templates/General/RiskCategory.docx";
            riskCategoryEntry.FormulaID            = "Table 1.5-1"; //reference to formula from code
            riskCategoryEntry.VariableValue        = riskCategory.ToString();
            #endregion
            this.AddToLog(riskCategoryEntry);

            return(riskCategory);
        }
Ejemplo n.º 15
0
        public double GetMaximumPeriod(double TApr, double Cu)
        {
            double Tmax = Cu * TApr;

            #region Tmax
            ICalcLogEntry TmaxEntry = new CalcLogEntry();
            TmaxEntry.ValueName = "Tmax";
            TmaxEntry.AddDependencyValue("Cu", Math.Round(Cu, 3));
            TmaxEntry.AddDependencyValue("Ta", Math.Round(TApr, 3));
            TmaxEntry.Reference            = "";
            TmaxEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicFundamentalPeriodTmax.docx";
            TmaxEntry.FormulaID            = "12.8.2 Period Determination"; //reference to formula from code
            TmaxEntry.VariableValue        = Math.Round(Tmax, 3).ToString();
            #endregion
            this.AddToLog(TmaxEntry);
            return(Tmax);
        }
Ejemplo n.º 16
0
        public double GetBaseShearVb(double Cs, double W)
        {
            double Vb = W * Cs;

            #region Vb
            ICalcLogEntry VbEntry = new CalcLogEntry();
            VbEntry.ValueName = "Vb";
            VbEntry.AddDependencyValue("W", Math.Round(W, 3));
            VbEntry.AddDependencyValue("Cs", Math.Round(Cs, 3));
            VbEntry.Reference            = "Base shear";
            VbEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicBaseShear.docx";
            VbEntry.FormulaID            = "12.8-1"; //reference to formula from code
            VbEntry.VariableValue        = Math.Round(Vb, 3).ToString();
            #endregion

            this.AddToLog(VbEntry);
            return(Vb);
        }
Ejemplo n.º 17
0
        public double GetFlatRoofLoad(double Ce, double Ct, double Is, double pg, double pm)
        {
            double pf;

            pf = 0.7 * Ce * Ct * Is * pg;

            #region pf
            ICalcLogEntry pfEntry = new CalcLogEntry();
            pfEntry.ValueName = "pf";
            pfEntry.AddDependencyValue("Ce", Math.Round(Ce, 3));
            pfEntry.AddDependencyValue("Ct", Math.Round(Ct, 3));
            pfEntry.AddDependencyValue("Is", Math.Round(Is, 3));
            pfEntry.AddDependencyValue("pg", Math.Round(pg, 3));
            pfEntry.Reference            = "";
            pfEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Snow/FlatRoofSnowLoad.docx";
            pfEntry.FormulaID            = null; //reference to formula from code
            pfEntry.VariableValue        = Math.Round(pf, 3).ToString();
            #endregion
            this.AddToLog(pfEntry);

            double p_snow = pf;
            if (pm != 0.0)
            {
                if (pf > pm)
                {
                    p_snow = pf;
                }
                else
                {
                    p_snow = pm;

                    #region pm
                    ICalcLogEntry pmEntry = new CalcLogEntry();
                    pmEntry.ValueName            = "pf";
                    pmEntry.Reference            = "";
                    pmEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Snow/FlatRoofSnowLoadMin.docx";
                    pmEntry.FormulaID            = null; //reference to formula from code
                    pmEntry.VariableValue        = Math.Round(pm, 3).ToString();
                    #endregion
                    this.AddToLog(pmEntry);
                }
            }
            return(p_snow);
        }
Ejemplo n.º 18
0
        public double GetExposureFactor(WindExposureCategory windExposureCategory, SnowRoofExposure RoofExposure)
        {
            var Tv11      = new { Exposure = WindExposureCategory.B, SnowRoofExposure = SnowRoofExposure.PartiallyExposed, Ce = 0.0 }; // sample
            var ValueList = ListFactory.MakeList(Tv11);

            using (StringReader reader = new StringReader(Resources.ASCE7_10T7_2SnowCe))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 3)
                    {
                        WindExposureCategory _exp    = (WindExposureCategory)Enum.Parse(typeof(WindExposureCategory), Vals[0]);
                        SnowRoofExposure     _SnoExp = (SnowRoofExposure)Enum.Parse(typeof(SnowRoofExposure), Vals[1]);
                        double _Ce = double.Parse(Vals[2], CultureInfo.InvariantCulture);

                        ValueList.Add(new { Exposure = _exp, SnowRoofExposure = _SnoExp, Ce = _Ce });
                    }
                }
            }

            var CeValues = from sc in ValueList where (sc.Exposure == windExposureCategory && sc.SnowRoofExposure == RoofExposure) select sc;
            var Ce       = CeValues.ToList().FirstOrDefault().Ce;

            string ExposureCategoryString = GetExposureCategoryString(windExposureCategory);
            string RoofExposureString     = GetRoofExposureString(RoofExposure);


            #region Ce
            ICalcLogEntry CeEntry = new CalcLogEntry();
            CeEntry.ValueName = "Ce";
            CeEntry.AddDependencyValue("WindExposureCategory", ExposureCategoryString);
            CeEntry.AddDependencyValue("RoofExposure", RoofExposureString);
            CeEntry.Reference            = "";
            CeEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Snow/SnowExposureFactor.docx";
            CeEntry.FormulaID            = null; //reference to formula from code
            CeEntry.VariableValue        = Math.Round(Ce, 3).ToString();
            #endregion
            this.AddToLog(CeEntry);

            return(Ce);
        }
Ejemplo n.º 19
0
        public double GetSlopedRoofLoad(double Cs, double pf)
        {
            double ps = Cs * pf;

            #region ps
            ICalcLogEntry psEntry = new CalcLogEntry();
            psEntry.ValueName = "ps";
            psEntry.AddDependencyValue("Cs", Math.Round(Cs, 3));
            psEntry.AddDependencyValue("pf", Math.Round(pf, 3));
            psEntry.Reference            = "";
            psEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Snow/SlopedRoofSnowLoad.docx";
            psEntry.FormulaID            = null; //reference to formula from code
            psEntry.VariableValue        = Math.Round(ps, 3).ToString();
            #endregion
            this.AddToLog(psEntry);

            double p_snow = ps;

            return(p_snow);
        }
Ejemplo n.º 20
0
        public double GetIceWeightPlate(double td, IcePlateOrientation plateOrientation, double gammai)
        {
            double qi;

            if (gammai == 0.0)
            {
                gammai = GetIceDensity();
            }

            #region qi
            ICalcLogEntry qiEntry = new CalcLogEntry();
            qiEntry.ValueName = "qi";
            qiEntry.AddDependencyValue("td", Math.Round(td, 3));
            qiEntry.AddDependencyValue("gammai", Math.Round(gammai, 3));
            qiEntry.Reference = "";

            qiEntry.FormulaID = null; //reference to formula from code

            #endregion
            switch (plateOrientation)
            {
            case IcePlateOrientation.Vertical:
                qi = 0.8 * Math.PI * td / 12.0 * gammai;
                qiEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Ice/IceWeightPlateVertical.docx";
                break;

            case IcePlateOrientation.Horizontal:
                qi = 0.6 * Math.PI * td / 12.0 * gammai;
                qiEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Ice/IceWeightPlateHorizontal.docx";
                break;

            default:
                qi = Math.PI * td / 12.0 * gammai;
                qiEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Ice/IceWeightPlate.docx";
                break;
            }

            qiEntry.VariableValue = Math.Round(qi, 3).ToString();
            this.AddToLog(qiEntry);
            return(qi);
        }
        public double GetS1()
        {
            if (IsDirty == true)
            {
                CalculateSeismicValues();
            }

            #region S1
            ICalcLogEntry S1Entry = new CalcLogEntry();
            S1Entry.ValueName = "Sone";
            S1Entry.AddDependencyValue("Latitude", Math.Round(Latitude, 3).ToString());
            S1Entry.AddDependencyValue("Longitude", Math.Round(Longitude, 3).ToString());
            S1Entry.Reference            = "MCER mapped 1-second period acceleration";
            S1Entry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicMappedS1.docx";
            S1Entry.FormulaID            = null; //reference to formula from code
            S1Entry.VariableValue        = S1.ToString();
            #endregion
            this.AddToLog(S1Entry);

            return(S1);
        }
        private double GetGustFactorRigid(double gQ, double gv, double Q, double Iz)
        {
            double tv1 = 1.7 * gQ * Iz * Q;
            double tv2 = 1.7 * gv * Iz;
            double G   = 0.925 * (1.0 + tv1) / (1.0 + tv2);

            #region G
            ICalcLogEntry GEntry = new CalcLogEntry();
            GEntry.ValueName = "G";
            GEntry.AddDependencyValue("gQ", Math.Round(gQ, 3));
            GEntry.AddDependencyValue("gv", Math.Round(gv, 3));
            GEntry.AddDependencyValue("Iz", Math.Round(Iz, 3));
            GEntry.AddDependencyValue("Q", Math.Round(Q, 3));
            GEntry.Reference            = "";
            GEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/GustFactorRigid.docx";
            GEntry.FormulaID            = null; //reference to formula from code
            GEntry.VariableValue        = Math.Round(G, 3).ToString();
            #endregion
            this.AddToLog(GEntry);
            return(G);
        }
Ejemplo n.º 23
0
 public void AddGoverningCaseLogEntry(string ValueName, string Value)
 {
     #region GoverningValue
     ICalcLogEntry GoverningValueEntry = new CalcLogEntry();
     GoverningValueEntry.ValueName = "V";
     GoverningValueEntry.AddDependencyValue("N", ValueName);
     GoverningValueEntry.DescriptionReference = "/Templates/General/GoverningValue.docx";
     GoverningValueEntry.FormulaID            = null; //reference to formula from code
     GoverningValueEntry.VariableValue        = Value.ToString();
     #endregion
     log.AddEntry(GoverningValueEntry);
 }
Ejemplo n.º 24
0
        public static void CreateEntry(string ValueName, double Value, BeamTemplateType TemplateType, int SubTypeIndex,
                                       Dictionary <string, double> DependencyValues, string CaseId, IAnalysisBeam beam, bool AddMax = false, bool AddMin = false)
        {
            ICalcLogEntry Entry = new CalcLogEntry();

            Entry.ValueName     = ValueName;
            Entry.VariableValue = Math.Round(Value, 3).ToString();

            if (DependencyValues != null)
            {
                foreach (var depVal in DependencyValues)
                {
                    Entry.AddDependencyValue(depVal.Key, Math.Round(depVal.Value, 3));
                }
            }
            if (AddMax == true)
            {
                Entry.AddDependencyValue("Maximum", "Maximum");
                Entry.AddDependencyValue("maximum", "Maximum");
            }
            if (AddMin == true)
            {
                Entry.AddDependencyValue("Maximum", "Minimum");
                Entry.AddDependencyValue("maximum", "Minimum");
            }
            Entry.AddDependencyValue("CF", "1728");
            Entry.Reference = "";
            //Entry.DescriptionReference = beam.ResourceLocator.GetTemplatePath(TemplateType, CaseId, SubTypeIndex);
            Entry.FormulaID = null;         //reference to formula from code

            //beam.Log.AddEntry(Entry); // this bypasses the check for LogMode
            beam.AddToLog(Entry);
        }
        double GetGustFacrorFlexible(double gQ, double Q, double gR, double R, double gv, double Iz)
        {
            double G;
            double a = (gQ * gQ) * (Q * Q) + (gR * gR) * (R * R);
            double b = 1.0 + 1.7 * gv * Iz;

            G = 0.925 * ((1.0 + 1.7 * Iz * Math.Sqrt(a)) / b);


            #region G
            ICalcLogEntry GEntry = new CalcLogEntry();
            GEntry.ValueName = "G";
            GEntry.AddDependencyValue("gQ", Math.Round(gQ, 3));
            GEntry.AddDependencyValue("gr", Math.Round(gR, 3));
            GEntry.AddDependencyValue("gv", Math.Round(gv, 3));
            GEntry.AddDependencyValue("Iz", Math.Round(Iz, 3));
            GEntry.AddDependencyValue("R", Math.Round(R, 3));
            GEntry.AddDependencyValue("Q", Math.Round(Q, 3));
            GEntry.Reference            = "";
            GEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/GustFactorFlexible.docx";
            GEntry.FormulaID            = null; //reference to formula from code
            GEntry.VariableValue        = Math.Round(G, 3).ToString();
            #endregion
            this.AddToLog(GEntry);

            return(G);
        }
Ejemplo n.º 26
0
        public double GetFundamentalPeriod(double Tcalculated, double Tmax)
        {
            double T = 0;

            if (Tcalculated < Tmax)
            {
                T = Tcalculated;

                #region TcalcGoverns
                ICalcLogEntry TcalcGovernsEntry = new CalcLogEntry();
                TcalcGovernsEntry.ValueName = "T";
                TcalcGovernsEntry.AddDependencyValue("Tmax", Math.Round(Tmax, 3));
                TcalcGovernsEntry.AddDependencyValue("Tcalculated", Math.Round(Tcalculated, 3));
                TcalcGovernsEntry.Reference            = "";
                TcalcGovernsEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicFundamentalPeriodTcalcGoverns.docx";
                TcalcGovernsEntry.FormulaID            = null; //reference to formula from code
                TcalcGovernsEntry.VariableValue        = Math.Round(T, 3).ToString();
                #endregion
                this.AddToLog(TcalcGovernsEntry);
            }
            else
            {
                T = Tmax;

                #region TmaxGoverns
                ICalcLogEntry TmaxGovernsEntry = new CalcLogEntry();
                TmaxGovernsEntry.ValueName = "T";
                TmaxGovernsEntry.AddDependencyValue("Tmax", Math.Round(Tmax, 3));
                TmaxGovernsEntry.AddDependencyValue("Tcalculated", Math.Round(Tcalculated, 3));
                TmaxGovernsEntry.Reference            = "";
                TmaxGovernsEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicFundamentalPeriodTmaxGoverns.docx";
                TmaxGovernsEntry.FormulaID            = null; //reference to formula from code
                TmaxGovernsEntry.VariableValue        = Math.Round(T, 3).ToString();
                #endregion
                this.AddToLog(TmaxGovernsEntry);
            }

            return(T);
        }
        public double GetTL()
        {
            if (IsDirty == true)
            {
                CalculateSeismicValues();
            }


            #region TL
            ICalcLogEntry TLEntry = new CalcLogEntry();
            TLEntry.ValueName = "TL";
            TLEntry.AddDependencyValue("Latitude", Math.Round(Latitude, 3).ToString());
            TLEntry.AddDependencyValue("Longitude", Math.Round(Longitude, 3).ToString());
            TLEntry.Reference            = "Long period transition period";
            TLEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicMappedTL.docx";
            TLEntry.FormulaID            = null; //reference to formula from code
            TLEntry.VariableValue        = TL.ToString();
            #endregion
            this.AddToLog(TLEntry);

            return(TL);
        }
        double Get_eta_h()
        {
            double Vz    = Vz_ob;
            double h     = this.height;
            double eta_h = 4.6 * n1 * h / Vz;


            #region eta_h
            ICalcLogEntry eta_hEntry = new CalcLogEntry();
            eta_hEntry.ValueName = "eta";
            eta_hEntry.AddDependencyValue("n1", Math.Round(n1, 3));
            eta_hEntry.AddDependencyValue("h", Math.Round(h, 3));
            eta_hEntry.AddDependencyValue("Vz", Math.Round(Vz, 3));
            eta_hEntry.Reference            = "";
            eta_hEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindGustFactorFlexiblegEta_h.docx";
            eta_hEntry.FormulaID            = null; //reference to formula from code
            eta_hEntry.VariableValue        = Math.Round(eta_h, 3).ToString();
            #endregion
            this.AddToLog(eta_hEntry);

            return(eta_h);
        }
        public double GetBackgroundResponseFactorQ()
        {
            double B = this.width;
            double h = this.height;
            double Q = Math.Sqrt(1.0 / (1.0 + 0.63 * Math.Pow((B + h) / Lz, 0.63)));


            #region Q
            ICalcLogEntry QEntry = new CalcLogEntry();
            QEntry.ValueName = "Q";
            QEntry.AddDependencyValue("B", Math.Round(B, 3));
            QEntry.AddDependencyValue("h", Math.Round(h, 3));
            QEntry.AddDependencyValue("Lz", Math.Round(Lz, 3));
            QEntry.Reference            = "";
            QEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindGustFactorFlexibleBackgroundResponseFactorQ.docx";
            QEntry.FormulaID            = null; //reference to formula from code
            QEntry.VariableValue        = Math.Round(Q, 3).ToString();
            #endregion
            this.AddToLog(QEntry);

            return(Q);
        }
        double Get_eta_L()
        {
            double Vz    = Vz_ob;
            double L     = this.Length;
            double eta_L = 15.4 * n1 * L / Vz;


            #region eta_L
            ICalcLogEntry eta_LEntry = new CalcLogEntry();
            eta_LEntry.ValueName = "eta";
            eta_LEntry.AddDependencyValue("n1", Math.Round(n1, 3));
            eta_LEntry.AddDependencyValue("L", Math.Round(L, 3));
            eta_LEntry.AddDependencyValue("Vz", Math.Round(Vz, 3));
            eta_LEntry.Reference            = "";
            eta_LEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindGustFactorFlexiblegEta_L.docx";
            eta_LEntry.FormulaID            = null; //reference to formula from code
            eta_LEntry.VariableValue        = Math.Round(eta_L, 3).ToString();
            #endregion
            this.AddToLog(eta_LEntry);

            return(eta_L);
        }