Example #1
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);

        }
 public double GetIceCrossSectionArea(IceElementType elementType, double td, double Dc)
 {
     double Ai=0.0;
     if (elementType == IceElementType.Line)
     {
         Ai = Math.PI * td * (Dc + td);
         
         #region Ai
         ICalcLogEntry AiEntry = new CalcLogEntry();
         AiEntry.ValueName = "Ai";
         AiEntry.AddDependencyValue("td", Math.Round(td, 3));
         AiEntry.AddDependencyValue("Dc", Math.Round(Dc, 3));
         AiEntry.Reference = "";
         AiEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Ice/CrossSectionAreaLine.docx";
         AiEntry.FormulaID = null; //reference to formula from code
         AiEntry.VariableValue = Math.Round(Ai, 3).ToString();
         #endregion
         this.AddToLog(AiEntry);
     }
     else
     {
         Ai = 0.0;
         
         #region Ai
         ICalcLogEntry AiEntry = new CalcLogEntry();
         AiEntry.ValueName = "Ai";
         AiEntry.Reference = "";
         AiEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Ice/CrossSectionArea2dOr3d.docx";
         AiEntry.FormulaID = null; //reference to formula from code
         AiEntry.VariableValue = Math.Round(Ai, 3).ToString();
         #endregion
         this.AddToLog(AiEntry);
     }
     return Ai;
 }
Example #3
0
    public partial class SnowStructure
    {
        public double GetImportanceFactor(BuildingRiskCategory RiskCategory)
        {
            double Is = 1.0;

            switch (RiskCategory)
            {
                case BuildingRiskCategory.I:
                    Is = 0.8;
                    break;
                case BuildingRiskCategory.II:
                    Is = 1.0;
                    break;
                case BuildingRiskCategory.III:
                    Is = 1.1;
                    break;
                case BuildingRiskCategory.IV:
                    Is = 1.2;
                    break;
            }

            #region Is
            ICalcLogEntry IsEntry = new CalcLogEntry();
            IsEntry.ValueName = "Is";
            IsEntry.AddDependencyValue("RiskCategory", RiskCategory.ToString());
            IsEntry.Reference = "";
            IsEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Snow/SnowImportanceFactorIs.docx";
            IsEntry.FormulaID = "Table 1.5-2"; //reference to formula from code
            IsEntry.VariableValue = Is.ToString();
            #endregion
            this.AddToLog(IsEntry);
Example #4
0
    public partial class General
    {
        public double GetImportanceFactor(BuildingRiskCategory RiskCategory)
        {
            double Ie = 1.0;

            switch (RiskCategory)
            {
                case BuildingRiskCategory.I:
                    Ie = 1.0;
                    break;
                case BuildingRiskCategory.II:
                    Ie = 1.0;
                    break;
                case BuildingRiskCategory.III:
                    Ie = 1.25;
                    break;
                case BuildingRiskCategory.IV:
                    Ie = 1.5;
                    break;
            }
            
            #region Ie
            ICalcLogEntry IeEntry = new CalcLogEntry();
            IeEntry.ValueName = "Ie";
            IeEntry.AddDependencyValue("RiskCategory", RiskCategory.ToString());
            IeEntry.Reference = "";
            IeEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicImportanceFactorIe.docx";
            IeEntry.FormulaID = "Table 1.5-2"; //reference to formula from code
            IeEntry.VariableValue = Ie.ToString();
            #endregion
            this.AddToLog(IeEntry);

            return Ie;
Example #5
0
    public partial class IceStructure : AnalyticalElement
    {
        public double GetImportanceFactor(BuildingRiskCategory RiskCategory)
        {
            double Ii = 1.0;

            switch (RiskCategory)
            {
                case BuildingRiskCategory.I:
                    Ii = 0.8;
                    break;
                case BuildingRiskCategory.II:
                    Ii = 1.0;
                    break;
                case BuildingRiskCategory.III:
                    Ii = 1.25;
                    break;
                case BuildingRiskCategory.IV:
                    Ii = 1.25;
                    break;
            }

            
            #region Ii
            ICalcLogEntry IiEntry = new CalcLogEntry();
            IiEntry.ValueName = "Ii";
            IiEntry.AddDependencyValue("RiskCategory", RiskCategory.ToString());
            IiEntry.Reference = "";
            IiEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Ice/IceImportanceFactor.docx";
            IiEntry.FormulaID = null; //reference to formula from code
            IiEntry.VariableValue = Math.Round(Ii, 3).ToString();
            #endregion
            this.AddToLog(IiEntry);
        public WindStructureDynamicResponseType GetDynamicClassification(double n1)
        {
            WindStructureDynamicResponseType classification = WindStructureDynamicResponseType.Flexible;
          
            if (n1>1.0)
            {
                classification = WindStructureDynamicResponseType.Rigid;
                
                #region Rigid
                ICalcLogEntry RigidEntry = new CalcLogEntry();
                RigidEntry.ValueName = "n1";
                RigidEntry.Reference = "";
                RigidEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindDynamicClassificationRigid.docx";
                RigidEntry.VariableValue = Math.Round(n1, 3).ToString();
                #endregion
                this.AddToLog(RigidEntry);
            }
            else
            {
                classification = WindStructureDynamicResponseType.Flexible;

                #region Flexible
                ICalcLogEntry FlexibleEntry = new CalcLogEntry();
                FlexibleEntry.ValueName = "n1";
                FlexibleEntry.Reference = "";
                FlexibleEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindDynamicClassificationFlexible.docx";
                FlexibleEntry.VariableValue = Math.Round(n1, 3).ToString();
                #endregion
                this.AddToLog(FlexibleEntry);
            }
            
            return classification;
        }
Example #7
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;
        }
Example #8
0
 public double GetHeightFactor(double z)
 {
     double fz=1.0;
     if (z<=900)
     {
         fz = Math.Pow(z / 33, 0.1);
         
         #region fz
         ICalcLogEntry fzEntry = new CalcLogEntry();
         fzEntry.ValueName = "fz";
         fzEntry.AddDependencyValue("z", Math.Round(z, 3));
         fzEntry.Reference = "";
         fzEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Ice/HeightFactor.docx";
         fzEntry.FormulaID = null; //reference to formula from code
         fzEntry.VariableValue = Math.Round(fz, 3).ToString();
         #endregion
         this.AddToLog(fzEntry);
     }
     else
     {
         fz = 1.4;
         
         #region fz
         ICalcLogEntry fzEntry = new CalcLogEntry();
         fzEntry.ValueName = "fz";
         fzEntry.AddDependencyValue("z", Math.Round(z, 3));
         fzEntry.Reference = "";
         fzEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Ice/HeightFactorHigh.docx";
         fzEntry.FormulaID = null; //reference to formula from code
         fzEntry.VariableValue = Math.Round(fz, 3).ToString();
         #endregion
         this.AddToLog(fzEntry);
     }
     return fz;
 }
        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;

        }
        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 double GetGustFacor
            (
            WindStructureDynamicResponseType DynamicClassification,
            double B    ,
            double h    ,
            double L    ,
            double beta ,
            double n1   ,
            double V    ,
            WindExposureCategory WindExposure
            )
        {
            this.Width = B;
            this.Height = h;
            this.Length = L;
            this.Damping = beta;
            this.n1 = n1;
            this.WindSpeed = V;


            double G = 0.85;
            CalculateTerrainCoefficients(WindExposure);
            if (DynamicClassification == WindStructureDynamicResponseType.Flexible)
            {

                double z_ob = GetEquivalentHeightZob();
                double Iz = GetTurbulenceIntensityIz();
                double V_z_ob = GetMeanHourlyWindVz();
                double Lz = GetIntegralLengthScaleOfTurbulenceLz();
                double R = GetResonantResponseFactorR();
                double gQ = 3.4;
                double gv = 3.4;
                double gR = GetPeakFactorForResonantResponse_gr();
                double Q = GetBackgroundResponseFactorQ();
                G = GetGustFacrorFlexible(gQ,  Q,  gR,  R,  gv,  Iz);
            }
            else
            {
                double z_ob = GetEquivalentHeightZob();
                double Iz = GetTurbulenceIntensityIz();
                double Lz = GetIntegralLengthScaleOfTurbulenceLz();
                double Q = GetBackgroundResponseFactorQ();
                double gQ = 3.4;
                double gv = 3.4;

                #region g
                ICalcLogEntry gEntry = new CalcLogEntry();
                gEntry.ValueName = "g";
                gEntry.Reference = "";
                gEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindGustFactorRigidgv.docx";
                gEntry.FormulaID = null; //reference to formula from code
                gEntry.VariableValue = Math.Round(3.4, 3).ToString();
                #endregion
                this.AddToLog(gEntry);
                G =GetGustFactorRigid(gQ, gv, Q, Iz);
                
            }
            return G;
        }
Example #12
0
    {

        public  data.SeismicDesignCategory Get02secSeismicDesignCategory(double SDS, BuildingRiskCategory RiskCategory)
        {
            data.SeismicDesignCategory CategorySDS = data.SeismicDesignCategory.A;

            //TODO: see special case when SDC is permitted  to be determined from Table 11.6-1 alone

            # region Table 11.6-1 Seismic Design Category Based on Short Period Response Acceleration Parameter

            if (SDS < 0.167)
            {
                CategorySDS = data.SeismicDesignCategory.A;
            }
            if (SDS >= 0.167 && SDS < 0.33)
            {
                if (RiskCategory == BuildingRiskCategory.IV)
                {
                    CategorySDS = data.SeismicDesignCategory.C;
                }
                else
                {
                    CategorySDS = data.SeismicDesignCategory.B;
                }

            }
            if (SDS >= 0.33 && SDS < 0.5)
            {
                if (RiskCategory == BuildingRiskCategory.IV)
                {
                    CategorySDS = data.SeismicDesignCategory.D;
                }
                else
                {
                    CategorySDS = data.SeismicDesignCategory.C;
                }

            }
            if (SDS >= 0.5)
            {
                CategorySDS = data.SeismicDesignCategory.D;
            }
            #endregion
            
            #region Sds
            ICalcLogEntry SdsEntry = new CalcLogEntry();
            SdsEntry.ValueName = "CategorySDS";
            SdsEntry.AddDependencyValue("SDS", Math.Round(SDS, 4));
            SdsEntry.AddDependencyValue("RiskCategory", RiskCategory.ToString());
            SdsEntry.Reference = "Seismic design rategory";
            SdsEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicSDC_02S.docx";
            SdsEntry.FormulaID = "Table 11.6-1"; //reference to formula from code
            SdsEntry.VariableValue = CategorySDS.ToString();
            #endregion
            this.AddToLog(SdsEntry);

            return CategorySDS;
        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 partial class Building : SeismicLateralForceResistingStructure
    {
        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);
Example #15
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);
        }
Example #16
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);
 }
Example #17
0
        public double GetKzt(
            double x, 
            double z,
            double H, 
            double Lh, 
            WindExposureCategory windExposureCategory,
            TopographicLocation TopographicLocation,
            TopographyType TopographyType
            )
        {
            double HToLh = H/Lh;
            double Mu = this.GetMu(TopographyType,TopographicLocation);
            double gamma = Getgamma(TopographyType);
            double K1OverHToLh = GetK1OverHToLh(windExposureCategory, TopographyType, HToLh);
            double K1 = GetK1(K1OverHToLh, HToLh);
            double K2 = GetK2(x,Mu,Lh);
            double K3 = GetK3(gamma, z, Lh);

            double Kzt = Math.Pow(1.0 + K1 * K2 * K3, 2.0);

            
            #region Kzt
            ICalcLogEntry KztEntry = new CalcLogEntry();
            KztEntry.ValueName = "Kzt";
            KztEntry.AddDependencyValue("WindExposureCategory", windExposureCategory.ToString() );
            KztEntry.AddDependencyValue("HillShape", GetHillShapeString(TopographyType));
            KztEntry.AddDependencyValue("LocationRelativeToCrest",GetLocationString(TopographicLocation) );
            KztEntry.AddDependencyValue("HToLh", Math.Round(HToLh, 3));
            KztEntry.AddDependencyValue("z", Math.Round(z, 3));
            KztEntry.AddDependencyValue("x", Math.Round(x, 3));
            KztEntry.AddDependencyValue("Lh", Math.Round(Lh, 3));
            KztEntry.AddDependencyValue("mu", Math.Round(Mu, 3));
            KztEntry.AddDependencyValue("gamma", Math.Round(gamma, 3));
            KztEntry.AddDependencyValue("K1OverHToLh", Math.Round(K1OverHToLh, 3));
            KztEntry.AddDependencyValue("K1", Math.Round(K1, 3));
            KztEntry.AddDependencyValue("K2", Math.Round(K2, 3));
            KztEntry.AddDependencyValue("K3", Math.Round(K3, 3));
            KztEntry.Reference = "";
            KztEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/WindTopographicFactor.docx";
            KztEntry.FormulaID = null; //reference to formula from code
            KztEntry.VariableValue = Math.Round(Kzt, 3).ToString();
            #endregion
            this.AddToLog(KztEntry);
            return Kzt;

        }
    public partial class Building : SeismicLateralForceResistingStructure
    {
        public double GetApproximatePeriodLowRiseMF(double NFloors)
        {
            double Ta = 0.1 * NFloors;
            
            #region Ta
            ICalcLogEntry TaEntry = new CalcLogEntry();
            TaEntry.ValueName = "Ta";
            TaEntry.AddDependencyValue("NFloors", Math.Round(NFloors, 1));
            TaEntry.Reference = "";
            TaEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicApproximatePeriodLowRiseMFTa.docx";
            TaEntry.FormulaID = null; //reference to formula from code
            TaEntry.VariableValue = Math.Round(Ta, 3).ToString();
            #endregion

            this.AddToLog(TaEntry);
Example #19
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;
        }
Example #20
0
        public double GetDesignThickness(double t, double Ii, double fz, double Kzt)
        {
            double td = 0.0 ;

            td = 2.0 * t * Ii * fz * Math.Pow(Kzt, 0.35);

            
            #region td
            ICalcLogEntry tdEntry = new CalcLogEntry();
            tdEntry.ValueName = "td";
            tdEntry.AddDependencyValue("t", Math.Round(t, 3));
            tdEntry.AddDependencyValue("Ii", Math.Round(Ii, 3));
            tdEntry.AddDependencyValue("fz", Math.Round(fz, 3));
            tdEntry.AddDependencyValue("Kzt", Math.Round(Kzt, 3));
            tdEntry.Reference = "";
            tdEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Ice/DesignThickness.docx";
            tdEntry.FormulaID = null; //reference to formula from code
            tdEntry.VariableValue = Math.Round(td, 3).ToString();
            #endregion
            this.AddToLog(tdEntry);
            return td;
        }
Example #21
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;


        }
Example #22
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;
        }
Example #23
0
        public double GetIceWeightLine( double Ai , double gammai)
        {
            double wi =0.0;
            if (gammai == 0.0)
            {
                 gammai = GetIceDensity();
            }
            wi = Ai/144.0 * gammai * 1.0;
            
            #region wi
            ICalcLogEntry wiEntry = new CalcLogEntry();
            wiEntry.ValueName = "wi";
            wiEntry.AddDependencyValue("Ai", Math.Round(Ai, 3));
            wiEntry.AddDependencyValue("gammai", Math.Round(gammai, 3));
            wiEntry.Reference = "";
            wiEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Ice/IceWeightLine.docx";
            wiEntry.FormulaID = null; //reference to formula from code
            wiEntry.VariableValue = Math.Round(wi, 3).ToString();
            #endregion
            this.AddToLog(wiEntry);

            return wi;
        }
Example #24
0
        public double GetSnowSlopeFactor(double RoofSlopeAngle, data.SnowRoofSurfaceType surface, double ThermalFactor)
        {
            double Ct=ThermalFactor;
            double Cs;

            
            #region Cs
            ICalcLogEntry CsEntry = new CalcLogEntry();
            CsEntry.ValueName = "Cs";
            CsEntry.AddDependencyValue("s", Math.Round(RoofSlopeAngle, 3));
            CsEntry.AddDependencyValue("Ct", Math.Round(ThermalFactor, 3));
            CsEntry.Reference = "";
            CsEntry.FormulaID = null; //reference to formula from code
            
            #endregion
            

            if (Ct<=1.0)
            {
                Cs =GetWarmRoofCs(RoofSlopeAngle, surface, CsEntry);
            }
            else
            {
                if (Ct>=1.2)
                {
                    Cs = GetColdRoofCs(RoofSlopeAngle, surface, CsEntry);
                }
                else
                {
                    Cs = GetIntermediateColdRoofCs(RoofSlopeAngle, surface, CsEntry);
                }
            }
            CsEntry.VariableValue = Math.Round(Cs, 3).ToString();
            this.AddToLog(CsEntry);

            return Cs;
        }
    public partial class SeismicLateralForceResistingStructure : AnalyticalElement
    {
        public double GetBuildingPeriodExponent_k(double T)
        {
            double k;

            ICalcLogEntry kEntry = new CalcLogEntry();
            kEntry.ValueName = "k";
            kEntry.Reference = "";
            kEntry.FormulaID = null; //reference to formula from code


            this.AddToLog(kEntry);

            if (T<=0.5)
            {
                k = 1.0;
                kEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicPeriodExponent_k_Tless0_5.docx";
                //
                
            }
            else if (T >= 2.5)
            {
                k = 2.0;
                kEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicPeriodExponent_k_Tmore2_5.docx";
            }
            else
            {
                k = 0.5 * T + 0.75;
                kEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicPeriodExponent_k_TInterpolated.docx";
                kEntry.AddDependencyValue("T", Math.Round(T, 3));

            }

            kEntry.VariableValue = Math.Round(k, 3).ToString();
            this.AddToLog(kEntry);
            
        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;
        }
Example #27
0
        public double GetWindSpeed(string ZoneId, BuildingRiskCategory RiskCategory, bool IsSpecialWindRegion)
        {

            double v = 0;
            string filename = null;
            string Figure = null;

            if (ZoneId == "0")
            {
                return -1; //error zone not found
            }

            else
            {

                #region Read Zone Data

                var SampleValue = new { ZoneId = "", LoadData = "" }; // sample
                var WindZoneList = ListFactory.MakeList(SampleValue);

                using (StringReader reader = new StringReader(Resources.ASCE7_10F26_5_1WindZones))
                {
                    string line;
                    while ((line = reader.ReadLine()) != null)
                    {
                        string[] Vals = line.Split(',');
                        if (Vals.Count() == 2)
                        {
                            string zone = (string)Vals[0];
                            string load = (string)Vals[1];


                            WindZoneList.Add(new
                            {
                                ZoneId = zone,
                                LoadData = load
                            });
                        }
                    }

                }

                #endregion

                switch (RiskCategory)
                {
                    case BuildingRiskCategory.I:
                        filename = "ASCE7_10WindEastCategoryI.txt";
                        Figure = "26.5-1C";
                        break;
                    case BuildingRiskCategory.II:
                        filename = "ASCE7_10WindEastCategoryII.txt";
                        Figure = "26.5-1A";
                        break;
                    case BuildingRiskCategory.III:
                        filename = "ASCE7_10WindEastCategoryIIIandIV.txt";
                        Figure = "26.5-1B";
                        break;
                    case BuildingRiskCategory.IV:
                        filename = "ASCE7_10WindEastCategoryIIIandIV.txt";
                        Figure = "26.5-1B";
                        break;
                }

                string loadStr = WindZoneList.First(z => z.ZoneId == ZoneId).LoadData.ToString();

                if (loadStr != "VAR")
                {
                    v = double.Parse(loadStr, CultureInfo.InvariantCulture);
                }

                else
                {

                    if (filename != null)
                    {
                        WindDataPoint wdp = FindClosestDataPoint(filename, Latitude, Longitude);
                        v = Math.Ceiling(wdp.WindSpeed);
                    }
                    else
                    {
                        v = -1;
                    }
                }
            }
            //Add CalcLogEntry

            #region v
            ICalcLogEntry vEntry = new CalcLogEntry();
            vEntry.ValueName = "v";
            vEntry.AddDependencyValue("Latitude", Math.Round(Latitude, 3));
            vEntry.AddDependencyValue("Longitude", Math.Round(Longitude, 3));
            //vEntry.AddDependencyValue("County", County);
            vEntry.AddDependencyValue("Figure", Figure);
            vEntry.AddDependencyValue("RiskCategory", RiskCategory.ToString());
            vEntry.Reference = "";
            if (County != null)
            {
                vEntry.AddDependencyValue("County", County);
                if (IsSpecialWindRegion==true)
                {
                    vEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/WindSpeedSWR.docx";
                }
                else
                {
                    vEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/WindSpeed.docx";
                }
                
            }
            else
            {
                if (IsSpecialWindRegion == true)
                {
                    vEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/WindSpeedNoCountySWR.docx";
                }
                else
                {
                    vEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/WindSpeedNoCounty.docx";
                }
                
            }
            vEntry.FormulaID = null; //reference to formula from code
            vEntry.VariableValue = Math.Round(v, 1).ToString();
            #endregion
            this.AddToLog(vEntry);
            return v;
        }
Example #28
0
        private double GetSiteCoefficientF(double S, SeismicSiteClass SiteClass, SeismicSiteCoefficient SiteCoefficient)
        {
            double SiteCoefficientF = 0;

            #region Read Coefficient Data

            var Tv11 = new { S = 0.0, Site = SeismicSiteClass.A, F = 0.0, Coefficient = SeismicSiteCoefficient.Fa }; // sample
            //var SiteCoefficientList = (new[] { Tv11 }).ToList();    //create list using casting by example
            var SiteCoefficientList = ListFactory.MakeList(Tv11);

            using (StringReader reader = new StringReader(Resources.ASCE7_10T11_4_1AND2))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 4)
                    {
                        double s = double.Parse(Vals[0], CultureInfo.InvariantCulture);
                        SeismicSiteClass Class = (SeismicSiteClass)Enum.Parse(typeof(SeismicSiteClass), Vals[1]);
                        double f = double.Parse(Vals[2], CultureInfo.InvariantCulture);
                        SeismicSiteCoefficient Coeff = (SeismicSiteCoefficient)Enum.Parse(typeof(SeismicSiteCoefficient), Vals[3]);
                        SiteCoefficientList.Add(new { S = s, Site = Class, F = f, Coefficient = Coeff });
                    }
                }

            }

            #endregion

            var FValues = from fa in SiteCoefficientList where (fa.Site == SiteClass && fa.Coefficient == SiteCoefficient) orderby fa.S select fa;
            var ResultList = (FValues.ToList());    //create list (LINQ immediate execution)
            var MinSValue = FValues.Min(fVal => fVal.S);
            var MaxSValue = FValues.Max(fVal => fVal.S);

            // Check for extreme values
            if (S <= MinSValue)
            {
                var MinEntry = from fa in FValues where (fa.Site == SiteClass && fa.S == MinSValue) select fa;
                SiteCoefficientF = MinEntry.ElementAt(0).F;
            }
            if (S >= MaxSValue)
            {
                var MaxEntry = from fa in FValues where (fa.Site == SiteClass && fa.S == MaxSValue) select fa;
                SiteCoefficientF = MaxEntry.ElementAt(0).F;
            }

            if (S > MinSValue && S < MaxSValue)
            {

                //Intermediate values
                int NumEntries = ResultList.Count();
                for (int i = 0; i < NumEntries; i++)
                {
                    var thisVal = ResultList[i];
                    if (i > 0 && i < NumEntries - 1)
                    {
                        if (thisVal.S >= ResultList[i - 1].S && thisVal.S <= ResultList[i + 1].S)
                        {
                            SiteCoefficientF = Interpolation.InterpolateLinear(ResultList[i - 1].S, ResultList[i - 1].F, ResultList[i + 1].S, ResultList[i + 1].F, S);
                        }
                    }
                }

            }

            //output 
            switch (SiteCoefficient)
            {
                case SeismicSiteCoefficient.Fa:

                    double Fa = SiteCoefficientF;
                    #region Fa
                    ICalcLogEntry FaEntry = new CalcLogEntry();
                    FaEntry.ValueName = "Fa";
                    FaEntry.AddDependencyValue("SS", Math.Round(S, 3));
                    FaEntry.AddDependencyValue("SiteClass", SiteClass.ToString());
                    FaEntry.Reference = "Short-period site coefficient";
                    FaEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicSiteCoefficientFa.docx";
                    FaEntry.FormulaID = "Table 11.4-1"; //reference to formula from code
                    FaEntry.VariableValue = Fa.ToString();
                    #endregion
                    this.AddToLog(FaEntry);

                    break;
                case SeismicSiteCoefficient.Fv:
                    double Fv = SiteCoefficientF;
                    
                    #region Fv
                    ICalcLogEntry FvEntry = new CalcLogEntry();
                    FvEntry.ValueName = "Fv";
                    FvEntry.AddDependencyValue("Sone", Math.Round(S, 3));
                    FvEntry.AddDependencyValue("SiteClass", SiteClass.ToString());
                    FvEntry.Reference = "Long-period site coefficient";
                    FvEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Seismic/SeismicSiteCoefficientFv.docx";
                    FvEntry.FormulaID = null; //reference to formula from code
                    FvEntry.VariableValue = Fv.ToString();
                    #endregion
                    this.AddToLog(FvEntry);
                    break;
            }

            return SiteCoefficientF;

        }
        private void CalculateProperties()
        {
            if (PropertiesWereCalculated == false)
            {


                #region Read Table Data

                var Tv11 = new { Id = "", Fy = 0.0, Fu = 0.0, MinDiam = 0.0, MaxDiam = 0.0 }; // sample
                var AllMaterialsList = ListFactory.MakeList(Tv11);

                using (StringReader reader = new StringReader(Resources.AISC360_10_MaterialProperties))
                {
                    string line;
                    while ((line = reader.ReadLine()) != null)
                    {
                        string[] Vals = line.Split(',');
                        if (Vals.Count() == 3)
                        {
                            string MatKey = Vals[0];
                            double V1 = double.Parse(Vals[1], CultureInfo.InvariantCulture);
                            double V2 = double.Parse(Vals[2], CultureInfo.InvariantCulture);

                            AllMaterialsList.Add(new { Id = MatKey, Fy = V1, Fu = V2, MinDiam = 0.0, MaxDiam = 0.0 });
                        }
                        if (Vals.Count() == 5)
                        {
                            string MatKey = Vals[0];
                            double V1 = double.Parse(Vals[1], CultureInfo.InvariantCulture);
                            double V2 = double.Parse(Vals[2], CultureInfo.InvariantCulture);
                            double V3 = double.Parse(Vals[3], CultureInfo.InvariantCulture);
                            double V4 = double.Parse(Vals[4], CultureInfo.InvariantCulture);

                            AllMaterialsList.Add(new { Id = MatKey, Fy = V1, Fu = V2, MinDiam = V3, MaxDiam = V4 });
                        }
                    }

                }

                #endregion

                var Materials = AllMaterialsList.Where(v => v.Id == SteelMaterialId).ToList();
                if (Materials.Count > 1 && FastenerDiameter != 0)
                {
                    var MatPropList = Materials.Where(m =>
                    {
                        if (m.MaxDiam!=0)
                        {
                            if (FastenerDiameter > m.MinDiam && FastenerDiameter <= m.MaxDiam)
                            {
                                return true;
                            }
                            else
                            {
                                return false;
                            } 
                        }
                        else
                        {
                            return true;
                        }
                    }).ToList();

                    if (MatPropList.Any())
                    {
                        var MatProp = MatPropList.FirstOrDefault();
                        this.YieldStress = MatProp.Fy;
                        this.UltimateStress = MatProp.Fu;
                    }
                }
                else
                {
                    var MatProp = Materials.FirstOrDefault();
                    this.YieldStress = MatProp.Fy;
                    this.UltimateStress = MatProp.Fu;
                }

                PropertiesWereCalculated = true;

                double Fy = YieldStress;
                double Fu = UltimateStress;
                double E = ModulusOfElasticity;
                double G = ShearModulus;
                
                #region Fy
                ICalcLogEntry FyEntry = new CalcLogEntry();
                FyEntry.ValueName = "Fy";
                FyEntry.AddDependencyValue("Fu", Math.Round(Fu, 3));
                FyEntry.AddDependencyValue("SteelMaterialId", SteelMaterialId);
                FyEntry.AddDependencyValue("E", Math.Round(E, 0));
                FyEntry.AddDependencyValue("G", Math.Round(G, 0));
                FyEntry.Reference = "";
                FyEntry.DescriptionReference = "/Templates/Steel/General/MaterialProperties.docx";
                FyEntry.FormulaID = null; //reference to formula from code
                FyEntry.VariableValue = Math.Round(Fy, 3).ToString();
                #endregion
                this.AddToLog(FyEntry);

               
            }

        }
        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;
        }
Example #31
0
        public ICalcLogEntry CreateNewEntry()
        {
            CalcLogEntry entry = new CalcLogEntry();

            return(entry);
        }