Add test of rebar by density and rebar by inclined rebar

This commit is contained in:
RedikultsevEvg
2025-08-10 18:24:46 +05:00
parent 3d8ac6f0c4
commit c61069a394
29 changed files with 364 additions and 134 deletions

View File

@@ -10,8 +10,6 @@ namespace StructureHelperLogics.Models.BeamShears
private double absoluteRangeValue = 0.0;
private double relativeEffectiveDepthRangeValue = 3.3;
private int stepCount = 55;
private double relativeEffectiveDepthSectionLengthMaxValue = 3;
private double relativeEffectiveDepthSectionLengthMinValue = 0;
/// <inheritdoc>
public Guid Id { get; }
@@ -59,32 +57,6 @@ namespace StructureHelperLogics.Models.BeamShears
}
}
public double RelativeEffectiveDepthSectionLengthMaxValue
{
get => relativeEffectiveDepthSectionLengthMaxValue;
set
{
if (value <= 0)
{
throw new StructureHelperException($"Maximum inclined section factor must be greater than zero, but was {value}");
}
relativeEffectiveDepthSectionLengthMaxValue = value;
}
}
public double RelativeEffectiveDepthSectionLengthMinValue
{
get => relativeEffectiveDepthSectionLengthMinValue;
set
{
if (value < 0)
{
throw new StructureHelperException($"Maximum inclined section factor must be greater than zero, but was {value}");
}
relativeEffectiveDepthSectionLengthMinValue = value;
}
}
public BeamShearDesignRangeProperty(Guid id)
{
Id = id;

View File

@@ -12,6 +12,7 @@ namespace StructureHelperLogics.Models.BeamShears
public bool IsValid { get; set; }
public string? Description { get; set; }
public IBeamShearSectionLogicInputData InputData { get; set; }
public IBeamShearSectionLogicInputData ResultInputData { get; set; }
public double ConcreteStrength { get; set; }
public double StirrupStrength { get; set; }
public double TotalStrength { get; set; }

View File

@@ -21,14 +21,6 @@ namespace StructureHelperLogics.Models.BeamShears
/// </summary>
double RelativeEffectiveDepthRangeValue { get; set; }
/// <summary>
/// Relative value of inclination length as factor of effective depth of cross-section
/// </summary>
double RelativeEffectiveDepthSectionLengthMaxValue { get; set; }
/// <summary>
/// Relative value of inclination length as factor of effective depth of cross-section
/// </summary>
double RelativeEffectiveDepthSectionLengthMinValue { get; set; }
/// <summary>
/// Number of step of solvation
/// </summary>
int StepCount { get; set; }

View File

@@ -13,6 +13,10 @@ namespace StructureHelperLogics.Models.BeamShears
/// </summary>
IBeamShearSectionLogicInputData InputData { get; set; }
/// <summary>
/// New Input data for calculating
/// </summary>
IBeamShearSectionLogicInputData ResultInputData { get; set; }
/// <summary>
/// Ultimate shear force due to cocrete
/// </summary>
public double ConcreteStrength { get; set; }

View File

@@ -40,10 +40,10 @@ namespace StructureHelperLogics.Models.BeamShears
PrepareNewResult();
if (Check() == false) { return; }
localTraceLogger?.AddMessage(sectionMessage);
InitializeStrategies();
try
{
AddInclinedCrackToInputData();
PrepareResultData();
InitializeStrategies();
CalculateResult();
}
catch (Exception ex)
@@ -53,18 +53,22 @@ namespace StructureHelperLogics.Models.BeamShears
}
}
private void AddInclinedCrackToInputData()
private void PrepareResultData()
{
InclinedSection newSection = new();
InclinedSection crackSection = new();
var updateStrategy = new InclinedSectionUpdateStrategy();
updateStrategy.Update(newSection, InputData.InclinedSection);
double crackLength = newSection.EndCoord - newSection.StartCoord;
double maxCrackLength = 2 * newSection.EffectiveDepth;
updateStrategy.Update(crackSection, InputData.InclinedSection);
BeamShearSectionLogicInputData resultData = new(Guid.Empty);
var resultDataUpdateStrategy = new BeamShearSectionLogicInputDataUpdateStrategy();
resultDataUpdateStrategy.Update(resultData, InputData);
double crackLength = crackSection.EndCoord - crackSection.StartCoord;
double maxCrackLength = 2 * crackSection.EffectiveDepth;
if (crackLength > maxCrackLength)
{
newSection.StartCoord = newSection.EndCoord - maxCrackLength;
crackSection.StartCoord = crackSection.EndCoord - maxCrackLength;
}
InputData.InclinedCrack = newSection;
resultData.InclinedCrack = crackSection;
result.ResultInputData = resultData;
}
private bool Check()
@@ -104,7 +108,7 @@ namespace StructureHelperLogics.Models.BeamShears
double totalStrength = concreteStrength + stirrupStrength;
localTraceLogger?.AddMessage($"Total strength = {concreteStrength} + {stirrupStrength} = {totalStrength}(N)");
result.TotalStrength = totalStrength;
double actualShearForce = InputData.ForceTuple.Qy;
double actualShearForce = result.ResultInputData.ForceTuple.Qy;
if (actualShearForce > totalStrength)
{
result.IsValid = false;
@@ -125,38 +129,38 @@ namespace StructureHelperLogics.Models.BeamShears
{
var logic = new StirrupBySearchLogic(localTraceLogger.GetSimilarTraceLogger(100))
{
InputData = InputData,
InputData = result.ResultInputData,
SectionEffectiveness = sectionEffectiveness
};
double stirrupStrength = logic.GetShearStrength();
localTraceLogger?.AddMessage($"Stirrup strength was restricted as Qsw,restricted = {stirrupStrength}(N)");
InputData.InclinedCrack = logic.InclinedCrack;
result.ResultInputData.InclinedCrack = logic.InclinedCrack;
return stirrupStrength;
}
private void InitializeStrategies()
{
if (InputData.InclinedSection.BeamShearSection.Shape is IRectangleShape)
if (result.ResultInputData.InclinedSection.BeamShearSection.Shape is IRectangleShape)
{
sectionEffectiveness = SectionEffectivenessFactory.GetShearEffectiveness(BeamShearSectionType.Rectangle);
}
else if (InputData.InclinedSection.BeamShearSection.Shape is ICircleShape)
else if (result.ResultInputData.InclinedSection.BeamShearSection.Shape is ICircleShape)
{
sectionEffectiveness = SectionEffectivenessFactory.GetShearEffectiveness(BeamShearSectionType.Circle);
}
else
{
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(InputData.InclinedSection.BeamShearSection.Shape));
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(result.ResultInputData.InclinedSection.BeamShearSection.Shape));
}
concreteLogic = new(sectionEffectiveness, InputData.InclinedSection, localTraceLogger);
stirrupLogic = new(InputData, localTraceLogger);
concreteLogic = new(sectionEffectiveness, result.ResultInputData.InclinedSection, localTraceLogger);
stirrupLogic = new(result.ResultInputData, localTraceLogger);
getLongitudinalForceFactorLogic = new GetLongitudinalForceFactorLogic(localTraceLogger?.GetSimilarTraceLogger(100));
}
private void SetLongitudinalForce()
{
getLongitudinalForceFactorLogic.LongitudinalForce = InputData.ForceTuple.Nz;
getLongitudinalForceFactorLogic.InclinedSection = InputData.InclinedSection;
getLongitudinalForceFactorLogic.LongitudinalForce = result.ResultInputData.ForceTuple.Nz;
getLongitudinalForceFactorLogic.InclinedSection = result.ResultInputData.InclinedSection;
}
private void PrepareNewResult()

View File

@@ -7,6 +7,8 @@ namespace StructureHelperLogics.Models.BeamShears
{
public class GetInclinedSectionListLogic : IGetInclinedSectionListLogic
{
private const int minimumInclinedSectionLengthFactor = 0;
private const int maximumInclinedSectionLengthFactor = 3;
private IGetInclinedSectionLogic inclinedSectionLogic;
private double depth;
private double effectiveDepth;
@@ -28,8 +30,8 @@ namespace StructureHelperLogics.Models.BeamShears
Check();
GetShapeParameters();
GetCoordinates();
double minSectionLength = DesignRangeProperty.RelativeEffectiveDepthSectionLengthMinValue * effectiveDepth;
double maxSectionLength = DesignRangeProperty.RelativeEffectiveDepthSectionLengthMaxValue * effectiveDepth;
double minSectionLength = minimumInclinedSectionLengthFactor * effectiveDepth;
double maxSectionLength = maximumInclinedSectionLengthFactor * effectiveDepth;
foreach (var startCoord in coordinates)
{
var endCoordinates = coordinates.Where(x => x >= startCoord);

View File

@@ -11,7 +11,6 @@ namespace StructureHelperLogics.Models.BeamShears
/// <inheritdoc/>
public class StirrupByDensityStrengthLogic : IBeamShearStrenghLogic
{
//private const double minStirrupRatio = 0.25;
private readonly IStirrupEffectiveness stirrupEffectiveness;
private readonly IStirrupByDensity stirrupByDensity;
private readonly IInclinedSection inclinedSection;

View File

@@ -11,25 +11,42 @@ namespace StructureHelperLogics.Models.BeamShears
const double stirrupEffectivenessFactor = 0.75;
private readonly IStirrupByInclinedRebar inclinedRebar;
private readonly IInclinedSection inclinedSection;
private IRebarSectionStrengthLogic rebarSectionStrengthLogic;
private double angleInRad;
private double rebarStartPoint;
private double rebarHeight;
private double rebarEndPoint;
private double rebarTrueStartPoint;
private double rebarTrueEndPoint;
private IRebarSectionStrengthLogic rebarSectionStrengthLogic;
private IInterpolateValueLogic interpolationLogic;
public IShiftTraceLogger? TraceLogger { get; set; }
public StirrupByInclinedRebarStrengthLogic(IInclinedSection inclinedSection, IStirrupByInclinedRebar inclinedRebar, IShiftTraceLogger traceLogger)
public StirrupByInclinedRebarStrengthLogic(
IInclinedSection inclinedSection,
IStirrupByInclinedRebar inclinedRebar,
IShiftTraceLogger traceLogger) : this(
inclinedSection,
inclinedRebar,
new RebarSectionStrengthLogic(),
new InterpolateValueLogic(),
traceLogger
) { }
public StirrupByInclinedRebarStrengthLogic(
IInclinedSection inclinedSection,
IStirrupByInclinedRebar inclinedRebar,
IRebarSectionStrengthLogic rebarSectionStrengthLogic,
IInterpolateValueLogic interpolationLogic,
IShiftTraceLogger? traceLogger)
{
this.inclinedSection = inclinedSection;
this.inclinedRebar = inclinedRebar;
this.rebarSectionStrengthLogic = rebarSectionStrengthLogic;
this.interpolationLogic = interpolationLogic;
TraceLogger = traceLogger;
}
public double GetShearStrength()
{
GetGeometry();
@@ -48,7 +65,7 @@ namespace StructureHelperLogics.Models.BeamShears
TraceLogger?.AddMessage($"Inclined section start point coordinate X = {inclinedSection.StartCoord} is in end transfer zone");
return GetEndTransferValue();
}
if (inclinedSection.EndCoord > rebarStartPoint & inclinedSection.EndCoord < rebarTrueStartPoint)
if (inclinedSection.EndCoord > rebarStartPoint && inclinedSection.EndCoord < rebarTrueStartPoint)
{
TraceLogger?.AddMessage($"Inclined section end point coordinate X = {inclinedSection.EndCoord} is in start transfer zone");
return GetStartTransferValue();
@@ -59,41 +76,33 @@ namespace StructureHelperLogics.Models.BeamShears
private double GetStartTransferValue()
{
interpolationLogic = new InterpolateValueLogic()
{
X1 = rebarStartPoint,
X2 = rebarTrueStartPoint,
Y1 = 0.0,
Y2 = GetInclinedRebarStrength(),
KnownValueX = inclinedSection.EndCoord
};
interpolationLogic.X1 = rebarStartPoint;
interpolationLogic.X2 = rebarTrueStartPoint;
interpolationLogic.Y1 = 0.0;
interpolationLogic.Y2 = GetInclinedRebarStrength();
interpolationLogic.KnownValueX = inclinedSection.EndCoord;
return interpolationLogic.GetValueY();
}
private double GetEndTransferValue()
{
interpolationLogic = new InterpolateValueLogic()
{
X1 = rebarTrueEndPoint,
X2 = rebarEndPoint,
Y1 = GetInclinedRebarStrength(),
Y2 = 0.0,
KnownValueX = inclinedSection.StartCoord
};
interpolationLogic.X1 = rebarTrueEndPoint;
interpolationLogic.X2 = rebarEndPoint;
interpolationLogic.Y1 = GetInclinedRebarStrength();
interpolationLogic.Y2 = 0.0;
interpolationLogic.KnownValueX = inclinedSection.StartCoord;
return interpolationLogic.GetValueY();
}
private double GetInclinedRebarStrength()
{
rebarSectionStrengthLogic ??= new RebarSectionStrengthLogic()
{
RebarStrengthFactor = 0.8,
MaxRebarStrength = 3e8,
LimitState = LimitStates.ULS,
CalcTerm = CalcTerms.ShortTerm,
TraceLogger = TraceLogger,
};
rebarSectionStrengthLogic.RebarStrengthFactor = 0.8;
rebarSectionStrengthLogic.MaxRebarStrength = 3e8;
rebarSectionStrengthLogic.LimitState = LimitStates.ULS;
rebarSectionStrengthLogic.CalcTerm = CalcTerms.ShortTerm;
rebarSectionStrengthLogic.TraceLogger = TraceLogger;
rebarSectionStrengthLogic.RebarSection = inclinedRebar.RebarSection;
double rebarStrength = rebarSectionStrengthLogic.GetRebarMaxTensileForce();
double inclinedRebarStrength = stirrupEffectivenessFactor * rebarStrength * Math.Sin(angleInRad) * inclinedRebar.LegCount;
TraceLogger?.AddMessage($"Inclined rebar Name = {inclinedRebar.Name}, start point {rebarStartPoint}(m), end point {rebarEndPoint}(m), angle of inclination {inclinedRebar.AngleOfInclination}(deg), number of legs {inclinedRebar.LegCount}");
@@ -113,7 +122,7 @@ namespace StructureHelperLogics.Models.BeamShears
rebarTrueEndPoint = rebarEndPoint - transferLength;
if (rebarTrueStartPoint >= rebarTrueEndPoint)
{
throw new StructureHelperException("Transfer aone in inclined rebar is too big");
throw new StructureHelperException("Transfer zone in inclined rebar is too big");
}
}
}

View File

@@ -14,8 +14,6 @@ namespace StructureHelperLogics.Models.BeamShears
targetObject.AbsoluteRangeValue = sourceObject.AbsoluteRangeValue;
targetObject.RelativeEffectiveDepthRangeValue = sourceObject.RelativeEffectiveDepthRangeValue;
targetObject.StepCount = sourceObject.StepCount;
targetObject.RelativeEffectiveDepthSectionLengthMaxValue = sourceObject.RelativeEffectiveDepthSectionLengthMaxValue;
targetObject.RelativeEffectiveDepthSectionLengthMinValue = sourceObject.RelativeEffectiveDepthSectionLengthMinValue;
}
}
}

View File

@@ -1,4 +1,5 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
namespace StructureHelperLogics.Models.Materials
@@ -7,6 +8,10 @@ namespace StructureHelperLogics.Models.Materials
{
IRebarSection RebarSection { get; set; }
IShiftTraceLogger? TraceLogger { get; set; }
CalcTerms CalcTerm { get; set; }
LimitStates LimitState { get; set; }
double MaxRebarStrength { get; set; }
double RebarStrengthFactor { get; set; }
double GetRebarMaxTensileForce();
}