Add circle shape calculation for shear
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.Models.BeamShears.Logics;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
@@ -72,7 +74,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
double concreteStrength = concreteLogic.GetShearStrength();
|
||||
double stirrupStrength = stirrupLogic.GetShearStrength();
|
||||
if (stirrupStrength > concreteStrength)
|
||||
{
|
||||
{
|
||||
localTraceLogger?.AddMessage($"Shear reinforcement strength Qsw = {stirrupStrength} is greater than concrete strength for shear Qb = {concreteStrength}, shear reinforcement strength has to be restricted.");
|
||||
stirrupStrength = GetStirrupStrengthBySearch();
|
||||
}
|
||||
concreteStrength *= factorOfLongitudinalForce;
|
||||
@@ -103,7 +106,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
private double GetStirrupStrengthBySearch()
|
||||
{
|
||||
var logic = new StirrupBySearchLogic(TraceLogger)
|
||||
var logic = new StirrupBySearchLogic(localTraceLogger.GetSimilarTraceLogger(100))
|
||||
{
|
||||
InputData = InputData,
|
||||
SectionEffectiveness = sectionEffectiveness
|
||||
@@ -115,7 +118,18 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
sectionEffectiveness = SectionEffectivenessFactory.GetSheaEffectiveness(BeamShearSectionType.Rectangle);
|
||||
if (InputData.InclinedSection.BeamShearSection.Shape is IRectangleShape)
|
||||
{
|
||||
sectionEffectiveness = SectionEffectivenessFactory.GetShearEffectiveness(BeamShearSectionType.Rectangle);
|
||||
}
|
||||
else if (InputData.InclinedSection.BeamShearSection.Shape is ICircleShape)
|
||||
{
|
||||
sectionEffectiveness = SectionEffectivenessFactory.GetShearEffectiveness(BeamShearSectionType.Circle);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(InputData.InclinedSection.BeamShearSection.Shape));
|
||||
}
|
||||
concreteLogic = new(sectionEffectiveness, InputData.InclinedSection, localTraceLogger);
|
||||
stirrupLogic = new(InputData, localTraceLogger);
|
||||
getLongitudinalForceFactorLogic = new GetLongitudinalForceFactorLogic(localTraceLogger?.GetSimilarTraceLogger(100));
|
||||
|
||||
@@ -3,33 +3,45 @@ using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Models.Shapes.Logics;
|
||||
using StructureHelperCommon.Services;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShearSectionUpdateStrategy : IUpdateStrategy<IBeamShearSection>
|
||||
public class BeamShearSectionUpdateStrategy : IParentUpdateStrategy<IBeamShearSection>
|
||||
{
|
||||
private IUpdateStrategy<IShape> shapeUpdateStrategy;
|
||||
private IUpdateStrategy<IConcreteLibMaterial> concreteUpdateStrategy;
|
||||
private IUpdateStrategy<IReinforcementLibMaterial> reinforcementUpdateStrategy;
|
||||
|
||||
public bool UpdateChildren { get; set; } = true;
|
||||
|
||||
public void Update(IBeamShearSection targetObject, IBeamShearSection sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
Check(targetObject, sourceObject);
|
||||
InitializeStrategies();
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.ReinforcementArea = sourceObject.ReinforcementArea;
|
||||
shapeUpdateStrategy.Update(targetObject.Shape, sourceObject.Shape);
|
||||
targetObject.ConcreteMaterial ??= new ConcreteLibMaterial();
|
||||
concreteUpdateStrategy.Update(targetObject.ConcreteMaterial, sourceObject.ConcreteMaterial);
|
||||
targetObject.ReinforcementMaterial ??= new ReinforcementLibMaterial(Guid.NewGuid());
|
||||
reinforcementUpdateStrategy.Update(targetObject.ReinforcementMaterial, sourceObject.ReinforcementMaterial);
|
||||
targetObject.CenterCover = sourceObject.CenterCover;
|
||||
if (UpdateChildren)
|
||||
{
|
||||
shapeUpdateStrategy.Update(targetObject.Shape, sourceObject.Shape);
|
||||
targetObject.ConcreteMaterial ??= new ConcreteLibMaterial(Guid.NewGuid());
|
||||
concreteUpdateStrategy.Update(targetObject.ConcreteMaterial, sourceObject.ConcreteMaterial);
|
||||
targetObject.ReinforcementMaterial ??= new ReinforcementLibMaterial(Guid.NewGuid());
|
||||
reinforcementUpdateStrategy.Update(targetObject.ReinforcementMaterial, sourceObject.ReinforcementMaterial);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Check(IBeamShearSection targetObject, IBeamShearSection sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject.Shape, "Source object shape");
|
||||
CheckObject.IsNull(targetObject.Shape, "Target object shape");
|
||||
CheckObject.IsNull(sourceObject.ConcreteMaterial, "Source concrete material");
|
||||
CheckObject.IsNull(targetObject.ConcreteMaterial, "Target concrete material");
|
||||
CheckObject.IsNull(sourceObject.ReinforcementMaterial, "Source reinforcement material");
|
||||
CheckObject.IsNull(targetObject.ReinforcementMaterial, "Target reinforcement material");
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
private const double minValueOfCenterCover = 0.01;
|
||||
private const double minValueOfCrossSectionWidth = 0.05;
|
||||
private const double minValueOfCrossSectionHeight = 0.05;
|
||||
private const double minCircleDiameter = 0.05;
|
||||
private bool result;
|
||||
private string checkResult;
|
||||
|
||||
@@ -63,6 +64,10 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
{
|
||||
CheckRectangleShape(rectangle);
|
||||
}
|
||||
else if (Entity.Shape is ICircleShape circle)
|
||||
{
|
||||
CheckCircleShape(circle);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = false;
|
||||
@@ -71,6 +76,15 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckCircleShape(ICircleShape circle)
|
||||
{
|
||||
if (circle.Diameter < minCircleDiameter)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nValue of cross-section diameter D = {circle.Diameter}(m) must not be less than bmin = {minCircleDiameter}(m)");
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckRectangleShape(IRectangleShape rectangle)
|
||||
{
|
||||
if (rectangle.Width < minValueOfCrossSectionWidth)
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// <inheritdoc/>
|
||||
public class StirrupByDensityStrengthLogic : IBeamShearStrenghLogic
|
||||
{
|
||||
private const double minStirrupRatio = 0.25;
|
||||
//private const double minStirrupRatio = 0.25;
|
||||
private readonly IStirrupEffectiveness stirrupEffectiveness;
|
||||
private readonly IStirrupByDensity stirrupByDensity;
|
||||
private readonly IInclinedSection inclinedSection;
|
||||
@@ -45,9 +45,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
double finalDensity = stirrupEffectiveness.StirrupShapeFactor * stirrupEffectiveness.StirrupPlacementFactor * stirrupByDensity.StirrupDensity;
|
||||
TraceLogger?.AddMessage($"Stirrups design density qsw = {stirrupEffectiveness.StirrupShapeFactor} * {stirrupEffectiveness.StirrupPlacementFactor} * {stirrupByDensity.StirrupDensity} = {finalDensity}(N/m)");
|
||||
double concreteDensity = inclinedSection.WebWidth * inclinedSection.ConcreteTensionStrength;
|
||||
if (finalDensity < minStirrupRatio * concreteDensity)
|
||||
double minFinalDensity = stirrupEffectiveness.MinimumStirrupRatio * concreteDensity;
|
||||
if (finalDensity < minFinalDensity)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Since stirrups design density qsw = {finalDensity}(N/m) less than {minStirrupRatio} * {concreteDensity}, final density is equal to zero", TraceLogStatuses.Warning);
|
||||
TraceLogger?.AddMessage($"Since stirrups design density qsw = {finalDensity}(N/m) less than qsw,min = {stirrupEffectiveness.MinimumStirrupRatio} * {concreteDensity} = {minFinalDensity}(N/m), final density is equal to zero", TraceLogStatuses.Warning);
|
||||
finalDensity = 0;
|
||||
}
|
||||
double strength = finalDensity * finalCrackLength;
|
||||
|
||||
@@ -35,12 +35,12 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
GetGeometry();
|
||||
if (inclinedSection.StartCoord > rebarEndPoint)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Inclined section start point coordinate X = {inclinedSection.StartCoord} is greater than inclined rebar end point x = {rebarEndPoint}, inclined rebar has been ignored");
|
||||
TraceLogger?.AddMessage($"Inclined section start point coordinate X = {inclinedSection.StartCoord} is greater than inclined rebar end point X = {rebarEndPoint}, inclined rebar has been ignored");
|
||||
return 0.0;
|
||||
}
|
||||
if (inclinedSection.EndCoord < rebarStartPoint)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Inclined section end point coordinate X = {inclinedSection.EndCoord} is less than inclined rebar start point x = {rebarStartPoint}, inclined rebar has been ignored");
|
||||
TraceLogger?.AddMessage($"Inclined section end point coordinate X = {inclinedSection.EndCoord} is less than inclined rebar start point X = {rebarStartPoint}, inclined rebar has been ignored");
|
||||
return 0.0;
|
||||
}
|
||||
if (inclinedSection.StartCoord > rebarTrueEndPoint & inclinedSection.StartCoord < rebarEndPoint)
|
||||
|
||||
@@ -8,29 +8,32 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
private ConcreteStrengthLogic concreteLogic;
|
||||
private StirrupStrengthLogic stirrupLogic;
|
||||
private ShiftTraceLogger? localTraceLogger { get; set; }
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public IBeamShearSectionLogicInputData InputData { get; internal set; }
|
||||
public ISectionEffectiveness SectionEffectiveness { get; internal set; }
|
||||
public StirrupBySearchLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public IBeamShearSectionLogicInputData InputData { get; internal set; }
|
||||
public ISectionEffectiveness SectionEffectiveness { get; internal set; }
|
||||
|
||||
public double GetShearStrength()
|
||||
{
|
||||
double parameter = GetParameter();
|
||||
BeamShearSectionLogicInputData newInputData = GetNewInputData(parameter);
|
||||
stirrupLogic = new(newInputData, localTraceLogger);
|
||||
double parameter = GetInclinedCrackRatio();
|
||||
BeamShearSectionLogicInputData newInputData = GetNewInputDataByCrackLengthRatio(parameter);
|
||||
TraceLogger?.AddMessage($"New value of dangerous inclinated crack has been obtained: start point Xstart = {newInputData.InclinedSection.StartCoord}(m), end point Xend = {newInputData.InclinedSection.EndCoord}(m)");
|
||||
stirrupLogic = new(newInputData, TraceLogger);
|
||||
double stirrupStrength = stirrupLogic.GetShearStrength();
|
||||
return stirrupStrength;
|
||||
}
|
||||
|
||||
public double GetParameter()
|
||||
/// <summary>
|
||||
/// Calculates ratio of inclined crack length to inclined section length
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="StructureHelperException"></exception>
|
||||
private double GetInclinedCrackRatio()
|
||||
{
|
||||
var parameterCalculator = new FindParameterCalculator(TraceLogger);
|
||||
var parameterCalculator = new FindParameterCalculator();
|
||||
parameterCalculator.InputData.Predicate = GetPredicate;
|
||||
parameterCalculator.Accuracy.IterationAccuracy = 0.0001d;
|
||||
parameterCalculator.Accuracy.MaxIterationCount = 1000;
|
||||
@@ -40,24 +43,32 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": predicate error");
|
||||
}
|
||||
var result = parameterCalculator.Result as FindParameterResult;
|
||||
var parameter = result.Parameter;
|
||||
return parameter;
|
||||
var crackLengthRatio = result.Parameter;
|
||||
while (GetPredicate(crackLengthRatio) == false)
|
||||
{
|
||||
crackLengthRatio += 0.0001;
|
||||
}
|
||||
return crackLengthRatio;
|
||||
}
|
||||
|
||||
private bool GetPredicate(double factor)
|
||||
/// <summary>
|
||||
/// Predicate of comparing of stirrup strength and concrete strength
|
||||
/// </summary>
|
||||
/// <param name="crackLengthRatio">Ratio of inclined crack length and inclined section length</param>
|
||||
/// <returns>Is true when stirrup strength is greate than concrete strength</returns>
|
||||
private bool GetPredicate(double crackLengthRatio)
|
||||
{
|
||||
BeamShearSectionLogicInputData newInputData = GetNewInputData(factor);
|
||||
concreteLogic = new(SectionEffectiveness, newInputData.InclinedSection, localTraceLogger);
|
||||
stirrupLogic = new(newInputData, localTraceLogger);
|
||||
BeamShearSectionLogicInputData newInputData = GetNewInputDataByCrackLengthRatio(crackLengthRatio);
|
||||
concreteLogic = new(SectionEffectiveness, newInputData.InclinedSection, null);
|
||||
stirrupLogic = new(newInputData, null);
|
||||
double concreteStrength = concreteLogic.GetShearStrength();
|
||||
double stirrupStrength = stirrupLogic.GetShearStrength();
|
||||
return stirrupStrength > concreteStrength;
|
||||
}
|
||||
|
||||
private BeamShearSectionLogicInputData GetNewInputData(double factor)
|
||||
private BeamShearSectionLogicInputData GetNewInputDataByCrackLengthRatio(double crackLengthRatio)
|
||||
{
|
||||
double sourceCrackLength = InputData.InclinedSection.EndCoord - InputData.InclinedSection.StartCoord;
|
||||
double newCrackLength = sourceCrackLength * factor;
|
||||
double newCrackLength = sourceCrackLength * crackLengthRatio;
|
||||
double newStartCoord = InputData.InclinedSection.EndCoord - newCrackLength;
|
||||
InclinedSection newSection = new();
|
||||
var updateStrategy = new InclinedSectionUpdateStrategy();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -11,6 +12,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
private IBeamShearStrenghLogic stirrupByDensityStrengthLogic;
|
||||
private IBeamShearStrenghLogic stirrupGroupStrengthLogic;
|
||||
private IBeamShearStrenghLogic stirrupByInclinedRebarStrengthLogic;
|
||||
private IStirrupEffectiveness stirrupEffectiveness;
|
||||
|
||||
public StirrupStrengthLogic(IBeamShearSectionLogicInputData inputData, IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
@@ -22,28 +24,28 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
public double GetShearStrength()
|
||||
{
|
||||
var stirrupEffectiveness = StirrupEffectivenessFactory.GetEffectiveness(BeamShearSectionType.Rectangle);
|
||||
GetStirrupEffectiveness();
|
||||
if (stirrup is IStirrupByRebar stirrupByRebar)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Stirrups type is stirrup by rebar {stirrupByRebar.Name}");
|
||||
TraceLogger?.AddMessage($"Stirrups type is stirrup by rebar Name = {stirrupByRebar.Name}");
|
||||
stirrupByDensityStrengthLogic = new StirrupByRebarStrengthLogic(stirrupEffectiveness, stirrupByRebar, inclinedSection, inputData.ForceTuple, TraceLogger);
|
||||
return stirrupByDensityStrengthLogic.GetShearStrength();
|
||||
}
|
||||
else if (stirrup is IStirrupGroup stirrupGroup)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Stirrups type is stirrupGroup {stirrupGroup.Name}");
|
||||
TraceLogger?.AddMessage($"Stirrups type is stirrup group Name = {stirrupGroup.Name}");
|
||||
stirrupGroupStrengthLogic ??= new StirrupGroupStrengthLogic(inputData, stirrupGroup, TraceLogger);
|
||||
return stirrupGroupStrengthLogic.GetShearStrength();
|
||||
}
|
||||
else if (stirrup is IStirrupByDensity stirrupByDensity)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Stirrups type is stirrup by density {stirrupByDensity.Name}");
|
||||
stirrupByDensityStrengthLogic = new StirrupByDensityStrengthLogic(stirrupEffectiveness, stirrupByDensity, inclinedSection,TraceLogger);
|
||||
TraceLogger?.AddMessage($"Stirrups type is stirrup by density Name = {stirrupByDensity.Name}");
|
||||
stirrupByDensityStrengthLogic = new StirrupByDensityStrengthLogic(stirrupEffectiveness, stirrupByDensity, inclinedSection, TraceLogger);
|
||||
return stirrupByDensityStrengthLogic.GetShearStrength();
|
||||
}
|
||||
else if (stirrup is IStirrupByInclinedRebar inclinedRebar)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Stirrups type is inclined rebar {inclinedRebar.Name}");
|
||||
TraceLogger?.AddMessage($"Stirrups type is inclined rebar Name = {inclinedRebar.Name}");
|
||||
stirrupByInclinedRebarStrengthLogic ??= new StirrupByInclinedRebarStrengthLogic(inclinedSection, inclinedRebar, TraceLogger);
|
||||
return stirrupByInclinedRebarStrengthLogic.GetShearStrength();
|
||||
}
|
||||
@@ -53,5 +55,18 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void GetStirrupEffectiveness()
|
||||
{
|
||||
if (inclinedSection.BeamShearSection.Shape is IRectangleShape)
|
||||
{
|
||||
stirrupEffectiveness = StirrupEffectivenessFactory.GetEffectiveness(BeamShearSectionType.Rectangle);
|
||||
}
|
||||
else if (inclinedSection.BeamShearSection.Shape is ICircleShape)
|
||||
{
|
||||
stirrupEffectiveness = StirrupEffectivenessFactory.GetEffectiveness(BeamShearSectionType.Circle);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user