/// <summary> /// Runs calculation\operations for cref="BeamSection" and cref="ColumnSection". /// </summary> /// <param name="obj">cref="BeamSection" object or cref="ColumnSection" object.</param> /// <returns>Result of calculation.</returns> public bool Run(ObjectDataBase obj) { bool ret = true; SectionDataBase sectionData = obj as SectionDataBase; if (obj != null) { Concrete.ConcreteSectionDesign design = new ConcreteSectionDesign(); design.ElementType = sectionData.Category; switch (sectionData.Category) { default: break; case BuiltInCategory.OST_ColumnAnalytical: case BuiltInCategory.OST_BeamAnalytical: if (sectionData.Label is LabelColumn) { CodeCheckingConcreteExample.Main.LabelColumn label = sectionData.Label as CodeCheckingConcreteExample.Main.LabelColumn; design.LongitudinalReinforcementMinimumYieldStress = label.LongitudinalReinforcement.MinimumYieldStress; design.LongitudinalReinforcementArea = label.LongitudinalReinforcement.Area; design.LongitudinalReinforcementDiameter = label.LongitudinalReinforcement.BarDiameter; design.LongitudinalCalculationType = label.LongitudinalCalculationType; /// design.TransversalReinforcementMinimumYieldStress = label.TransversalReinforcement.MinimumYieldStress; design.TransversalReinforcementArea = label.TransversalReinforcement.Area; design.TransversalReinforcementDiameter = label.TransversalReinforcement.BarDiameter; design.TransversalCalculationType = label.TransversalCalculationType; design.CreepCoefficient = label.CreepCoefficient; } if (sectionData.Label is LabelBeam) { CodeCheckingConcreteExample.Main.LabelBeam label = sectionData.Label as CodeCheckingConcreteExample.Main.LabelBeam; design.LongitudinalReinforcementMinimumYieldStress = label.LongitudinalReinforcement.MinimumYieldStress; design.LongitudinalReinforcementArea = label.LongitudinalReinforcement.Area; design.LongitudinalReinforcementDiameter = label.LongitudinalReinforcement.BarDiameter; design.LongitudinalCalculationType = label.LongitudinalCalculationType; /// design.TransversalReinforcementMinimumYieldStress = label.TransversalReinforcement.MinimumYieldStress; design.TransversalReinforcementArea = label.TransversalReinforcement.Area; design.TransversalReinforcementDiameter = label.TransversalReinforcement.BarDiameter; design.TransversalCalculationType = label.TransversalCalculationType; design.CreepCoefficient = label.CreepCoefficient; } if (sectionData is LinearSection) { LinearSection section = sectionData as LinearSection; if (section.Info != null) { design.CoverTop = 0.0; design.CoverBottom = 0.0; if (section.Info.RebarCovers != null) { if (section is BeamSection) { if (section.Info.RebarCovers.Exist(BuiltInParameter.CLEAR_COVER_BOTTOM)) { design.CoverBottom = section.Info.RebarCovers.GetDistance(BuiltInParameter.CLEAR_COVER_BOTTOM); } if (section.Info.RebarCovers.Exist(BuiltInParameter.CLEAR_COVER_TOP)) { design.CoverTop = section.Info.RebarCovers.GetDistance(BuiltInParameter.CLEAR_COVER_TOP); } } if (section is ColumnSection) { if (section.Info.RebarCovers.Exist(BuiltInParameter.CLEAR_COVER_OTHER)) { design.CoverBottom = section.Info.RebarCovers.GetDistance(BuiltInParameter.CLEAR_COVER_OTHER); design.CoverTop = section.Info.RebarCovers.GetDistance(BuiltInParameter.CLEAR_COVER_OTHER); } } } if (section.Info.SectionsParams == null) { design.Type = SectionShapeType.RectangularBar; } else { design.Type = section.Info.SectionsParams.ShapeType; } design.YoungModulus = section.Info.Material.Characteristics.YoungModulus.X; MaterialConcreteCharacteristics concrete = (MaterialConcreteCharacteristics)section.Info.Material.Characteristics.Specific; if (concrete != null) { design.Compression = concrete.Compression; } design.Geometry = section.Geometry; design.Width = section.Width; design.Height = section.Height; List <InternalForcesContainer> listInternalForces = new List <InternalForcesContainer>(); foreach (InternalForcesLinear force in section.ListInternalForces) { listInternalForces.Add(force.Forces); } design.ListInternalForces = listInternalForces;; // // calculation // design.Calculate(); // // save result // section.AsBottom = design.AsBottom; section.AsTop = design.AsTop; section.AsRight = design.AsRight; section.AsLeft = design.AsLeft; section.Spacing = design.Spacing; section.TransversalDensity = design.TransversalDensity; section.MinStiffness = design.MinStiffness; section.DesignInfo.AddRange(design.DesignInfo); section.DesignError.AddRange(design.DesignError); section.DesignWarning.AddRange(design.DesignWarning); if (section.DesignError.Count > 0) { ret = false; } } } break; } } return(ret); }
/// <summary> /// Simple buckling effect calculation: /// This is only example: braced (non-sway) structure and single curvature! /// </summary> /// <param name="obj">cref="BeamElement" object or cref="ColumnElement" object.</param> private void ModifyForcesBecauseOfBuckling(ObjectDataBase obj) { ColumnElement elem = obj as ColumnElement; CodeCheckingConcreteExample.Main.LabelColumn rcLabelColumn = elem.Label as CodeCheckingConcreteExample.Main.LabelColumn; bool dirY = rcLabelColumn.EnabledInternalForces.Contains(ConcreteTypes.EnabledInternalForces.MY); bool dirZ = rcLabelColumn.EnabledInternalForces.Contains(ConcreteTypes.EnabledInternalForces.MZ); dirY &= rcLabelColumn.BucklingDirectionY; dirZ &= rcLabelColumn.BucklingDirectionZ; if (dirY || dirZ) { double lambdaLim = 15.0; double lambdaY = 0; double lambdaZ = 0; double length = elem.Info.GeomLength(); bool modifMy = false; bool modifMz = false; if (dirY) { lambdaY = (length * rcLabelColumn.LengthCoefficientY) / elem.Info.SectionsParams.AtTheBeg.Characteristics.ry; modifMy = lambdaY > lambdaLim; } if (dirZ) { lambdaZ = (length * rcLabelColumn.LengthCoefficientZ) / elem.Info.SectionsParams.AtTheBeg.Characteristics.rz; modifMz = lambdaZ > lambdaLim; } double additionalMy = 0; double additionalMz = 0; double My = 0; double Mz = 0; double N = 0; double dimY = elem.Info.SectionsParams.AtTheBeg.Dimensions.vpy + elem.Info.SectionsParams.AtTheBeg.Dimensions.vy; double dimZ = elem.Info.SectionsParams.AtTheBeg.Dimensions.vpz + elem.Info.SectionsParams.AtTheBeg.Dimensions.vz; foreach (SectionDataBase sd in elem.ListSectionData) { ColumnSection sec = sd as ColumnSection; if (sec != null) { foreach (InternalForcesBase forces in sec.ListInternalForces) { InternalForcesLinear f = forces as InternalForcesLinear; if (f != null) { if (f.Forces.LimitState == ForceLimitState.Uls) { CalcPointLinear calcPoint = sec.CalcPoint as CalcPointLinear; N = f.Forces.ForceFx; if (N > Double.Epsilon) { if (dirY) { My = f.Forces.MomentMy; additionalMy = (-0.002 * N / dimZ); additionalMy *= rcLabelColumn.LengthCoefficientY * rcLabelColumn.LengthCoefficientY; additionalMy *= (calcPoint.CoordAbsolute * calcPoint.CoordAbsolute - length * calcPoint.CoordAbsolute); f.Forces.MomentMy += f.Forces.MomentMy > 0.0 ? additionalMy : -additionalMy; } if (dirZ) { Mz = f.Forces.MomentMz; additionalMz = (-0.002 * N / dimY); additionalMz *= rcLabelColumn.LengthCoefficientZ * rcLabelColumn.LengthCoefficientZ; additionalMz *= (calcPoint.CoordAbsolute * calcPoint.CoordAbsolute - length * calcPoint.CoordAbsolute); f.Forces.MomentMz += f.Forces.MomentMz > 0.0 ? additionalMz : -additionalMz; } } } } } } } } }