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 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); }
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); }
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); }
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); }
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 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); }
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); }
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); }
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 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 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); }
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 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); }
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 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); }
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); }
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); }
private double GetIceDensity() { double gammai = 56.0; #region gammai ICalcLogEntry gammaiEntry = new CalcLogEntry(); gammaiEntry.ValueName = "gammai"; gammaiEntry.Reference = ""; gammaiEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Ice/IceDensity.docx"; gammaiEntry.FormulaID = null; //reference to formula from code gammaiEntry.VariableValue = Math.Round(gammai, 3).ToString(); #endregion this.AddToLog(gammaiEntry); return(gammai); }
public double GetThermalFactor(string CaseId) { double Ct = 1.0; try { var Tv11 = new { CaseId = "", Ct = 0.0, CaseDescription = "" }; // sample var ValueList = ListFactory.MakeList(Tv11); using (StringReader reader = new StringReader(Resources.ASCE7_10T7_3SnowCt)) { string line; while ((line = reader.ReadLine()) != null) { string[] Vals = line.Split(','); if (Vals.Count() == 3) { string _CaseId = Vals[0]; double _Ct = double.Parse(Vals[1], CultureInfo.InvariantCulture); string _CaseDescription = Vals[2]; ValueList.Add(new { CaseId = _CaseId, Ct = _Ct, CaseDescription = _CaseDescription }); } } } var CtValues = from sc in ValueList where (sc.CaseId == CaseId) select sc; Ct = CtValues.ToList().FirstOrDefault().Ct; string Description = CtValues.ToList().FirstOrDefault().CaseDescription; #region Ct ICalcLogEntry CtEntry = new CalcLogEntry(); CtEntry.ValueName = "Ct"; CtEntry.AddDependencyValue("StructureType ", " " + Description); CtEntry.Reference = ""; CtEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Snow/SnowThermalFactor.docx"; CtEntry.FormulaID = null; //reference to formula from code CtEntry.VariableValue = Math.Round(Ct, 3).ToString(); #endregion this.AddToLog(CtEntry); } catch (Exception) { Ct = 1.0; } return(Ct); }
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); return(Ta); }
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); }
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 double GetDesignPressure(double q, double GCpPos, double GCpNeg, double qi, double GCpi, double h) { double p1; double p2; if (h <= 60.0) { p1 = q * (GCpPos + GCpi); p2 = q * (GCpNeg - GCpi); } else { p1 = q * GCpPos + qi * GCpi; p2 = q * GCpNeg - qi * GCpi; } double p = Math.Max(Math.Abs(p1), Math.Abs(p2)); #region p ICalcLogEntry pEntry = new CalcLogEntry(); pEntry.ValueName = "p"; pEntry.AddDependencyValue("p1", Math.Round(p1, 3)); pEntry.AddDependencyValue("p2", Math.Round(p2, 3)); pEntry.AddDependencyValue("q", Math.Round(q, 3)); pEntry.AddDependencyValue("qi", Math.Round(qi, 3)); pEntry.AddDependencyValue("h", Math.Round(h, 3)); pEntry.AddDependencyValue("GCpPos", Math.Round(GCpPos, 3)); pEntry.AddDependencyValue("GCpNeg", Math.Round(GCpNeg, 3)); pEntry.AddDependencyValue("GCpi", Math.Round(GCpi, 3)); pEntry.Reference = ""; if (h <= 60.0) { pEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/WindPressure/WindPressureCCLowRise.docx"; } else { pEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/WindPressure/WindPressureCCLowRise.docx"; } pEntry.FormulaID = null; //reference to formula from code pEntry.VariableValue = Math.Round(p, 3).ToString(); #endregion this.AddToLog(pEntry); return(p); }
public double GetPeakFactorForResonantResponse_gr() { double log = 2 * Math.Log(3600 * n1); double gr = Math.Sqrt(log) + 0.577 / (Math.Sqrt(log)); #region gr ICalcLogEntry grEntry = new CalcLogEntry(); grEntry.ValueName = "gr"; grEntry.AddDependencyValue("n1", Math.Round(n1, 3)); grEntry.Reference = ""; grEntry.DescriptionReference = "/Templates/Loads/ASCE7_10/Wind/GustFactor/WindGustFactorFlexiblegv.docx"; grEntry.FormulaID = null; //reference to formula from code grEntry.VariableValue = Math.Round(gr, 3).ToString(); #endregion this.AddToLog(grEntry); return(gr); }
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); }
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); }
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); }
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); }