/// <summary> /// Example explaining how to use force modification for beam: /// additonal minimum bending moment over support M=0.1*Mmax in ULS /// </summary> /// <param name="obj">cref="BeamElement" object or cref="ColumnElement" object.</param> private void ModifySupportForces(ObjectDataBase obj) { BeamElement elem = obj as BeamElement; double maximumM = Double.MinValue; double maximumL = Double.MinValue; double minimumL = Double.MaxValue; int beginIndexSupport = -1; int endIndexSupport = -1; int index = 0; bool isMaximumM = false; foreach (SectionDataBase sd in elem.ListSectionData) { BeamSection sec = sd as BeamSection; CalcPointLinear calcPoint = sec.CalcPoint as CalcPointLinear; if (calcPoint != null) { if (maximumL < calcPoint.CoordRelative) { maximumL = calcPoint.CoordRelative; endIndexSupport = index; } if (minimumL > calcPoint.CoordRelative) { minimumL = calcPoint.CoordRelative; beginIndexSupport = index; } } if (sec != null) { foreach (InternalForcesBase forces in sec.ListInternalForces) { InternalForcesLinear f = forces as InternalForcesLinear; if (f != null) { if (f.Forces.LimitState == ForceLimitState.Uls) { if (maximumM < f.Forces.MomentMy) { maximumM = f.Forces.MomentMy; isMaximumM = true; } } } } } index++; } if (isMaximumM) { if (beginIndexSupport > -1) { BeamSection bs = elem.ListSectionData[beginIndexSupport] as BeamSection; if (bs != null) { InternalForcesLinear f = new InternalForcesLinear(); f.Forces.LimitState = ForceLimitState.Uls; f.Forces.MomentMy = 0.1 * maximumM; bs.ListInternalForces.Add(f); } } if (endIndexSupport > -1) { BeamSection bs = elem.ListSectionData[endIndexSupport] as BeamSection; if (bs != null) { InternalForcesLinear f = new InternalForcesLinear(); f.Forces.LimitState = ForceLimitState.Uls; f.Forces.MomentMy = 0.1 * maximumM; bs.ListInternalForces.Add(f); } } } }
/// <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; } } } } } } } } }
/// <summary> /// Runs calculation\operations for cref="BeamElement". /// </summary> /// <param name="obj">cref="BeamElement".</param> /// <returns>Result of calculation.</returns> public bool Run(ObjectDataBase obj) { ElementDataBase elementData = obj as ElementDataBase; if (obj != null) { BeamElement objBeam = obj as BeamElement; if (objBeam != null) { CodeCheckingConcreteExample.Main.ResultBeam res = elementData.Result as CodeCheckingConcreteExample.Main.ResultBeam; if (res != null) { double young = objBeam.Info.Material.Characteristics.YoungModulus.X; double maxCoef = 0; double stifCoef = 0.0; double avrCoef = 0.0; int sectionNo = 0; foreach (SectionDataBase sd in elementData.ListSectionData) { BeamSection sec = sd as BeamSection; if (sec != null) { if (sec.MinStiffness > Double.Epsilon) { CalcPointLinear calcPoint = sec.CalcPoint as CalcPointLinear; double Iy = sec.Info.SectionsParams.AtThePoint(calcPoint.CoordRelative).Characteristics.Iy; stifCoef = (Iy * young) / sec.MinStiffness; } else { stifCoef = 0; break; } ++sectionNo; maxCoef = Math.Max(maxCoef, stifCoef); avrCoef += stifCoef; } } double finStiffnes = 0; if (stifCoef > Double.Epsilon) { avrCoef /= sectionNo; finStiffnes = 0.5 * (maxCoef + avrCoef); } else { objBeam.AddFormatedWarning(new ResultStatusMessage("Calculation of deflections was not performed.")); } foreach (SectionDataBase sd in elementData.ListSectionData) { BeamSection sec = sd as BeamSection; if (sec != null) { sec.StiffnesCoeff = finStiffnes; } } } } } return(true); }