Fix max spacing of stirrups
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
|
||||
41
DataAccess/DTOs/DTOEntities/BeamShearCalculatorDTO.cs
Normal file
41
DataAccess/DTOs/DTOEntities/BeamShearCalculatorDTO.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace DataAccess.DTOs.DTOEntities
|
||||
{
|
||||
internal class BeamShearCalculatorDTO : IBeamShearCalculator
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
[JsonProperty("InputData")]
|
||||
public IBeamShearCalculatorInputData InputData { get; set; }
|
||||
[JsonProperty("ShowTraceData")]
|
||||
public bool ShowTraceData { get; set; }
|
||||
[JsonIgnore]
|
||||
public IResult Result => throw new NotImplementedException();
|
||||
[JsonIgnore]
|
||||
public IShiftTraceLogger? TraceLogger { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
|
||||
public BeamShearCalculatorDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
|
||||
namespace DataAccess.DTOs.DTOEntities
|
||||
{
|
||||
internal class BeamShearCalculatorInputDataDTO : IBeamShearCalculatorInputData
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Actions")]
|
||||
public List<IBeamShearAction> Actions { get; } = new();
|
||||
[JsonProperty("Sections")]
|
||||
public List<IBeamShearSection> Sections { get; } = new();
|
||||
[JsonProperty("Stirrups")]
|
||||
public List<IStirrup> Stirrups { get; } = new();
|
||||
}
|
||||
}
|
||||
@@ -17,10 +17,14 @@ namespace DataAccess.DTOs.DTOEntities
|
||||
public List<IBeamShearSection> Sections { get; } = new();
|
||||
[JsonProperty("Stirrups")]
|
||||
public List<IStirrup> Stirrups { get; } = new();
|
||||
public BeamShearRepositoryDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
DataAccess/DTOs/DTOEntities/BeamShearSectionDTO.cs
Normal file
33
DataAccess/DTOs/DTOEntities/BeamShearSectionDTO.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace DataAccess.DTOs.DTOEntities
|
||||
{
|
||||
public class BeamShearSectionDTO : IBeamShearSection
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Name")]
|
||||
public string? Name { get; set; }
|
||||
[JsonProperty("Shape")]
|
||||
public IShape Shape { get; set; }
|
||||
[JsonProperty("Material")]
|
||||
public IConcreteLibMaterial Material { get; set; }
|
||||
[JsonProperty("CenterCover")]
|
||||
public double CenterCover { get; set; }
|
||||
public BeamShearSectionDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
DataAccess/DTOs/DTOEntities/StirrupByDensityDTO.cs
Normal file
23
DataAccess/DTOs/DTOEntities/StirrupByDensityDTO.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
|
||||
namespace DataAccess.DTOs.DTOEntities
|
||||
{
|
||||
public class StirrupByDensityDTO : IStirrupByDensity
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Name")]
|
||||
public string? Name { get; set; } = string.Empty;
|
||||
[JsonProperty("StirrupDensity")]
|
||||
public double StirrupDensity { get; set; }
|
||||
[JsonProperty("CompressedGap")]
|
||||
public double CompressedGap { get; set; }
|
||||
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
34
DataAccess/DTOs/DTOEntities/StirrupByRebarDTO.cs
Normal file
34
DataAccess/DTOs/DTOEntities/StirrupByRebarDTO.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
|
||||
namespace DataAccess.DTOs.DTOEntities
|
||||
{
|
||||
public class StirrupByRebarDTO : IStirrupByRebar
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Name")]
|
||||
public string? Name { get; set; }
|
||||
[JsonProperty("LegCount")]
|
||||
public double LegCount { get; set; }
|
||||
[JsonProperty("Diameter")]
|
||||
public double Diameter { get; set; }
|
||||
[JsonProperty("Material")]
|
||||
public IReinforcementLibMaterial Material { get; set; }
|
||||
[JsonProperty("Spacing")]
|
||||
public double Spacing { get; set; }
|
||||
[JsonProperty("CompressedGap")]
|
||||
public double CompressedGap { get; set; }
|
||||
|
||||
public StirrupByRebarDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
var sectionEffectiveness = SectionEffectivenessFactory.GetSheaEffectiveness(BeamShearSectionType.Rectangle);
|
||||
double longitudinalForce = InputData.ForceTuple.Nz;
|
||||
concreteLogic = new(sectionEffectiveness, InputData.InclinedSection, longitudinalForce, TraceLogger);
|
||||
stirrupLogic = new(InputData.Stirrup, InputData.InclinedSection, TraceLogger);
|
||||
stirrupLogic = new(InputData, TraceLogger);
|
||||
}
|
||||
|
||||
private void PrepareNewResult()
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
@@ -11,6 +12,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
private IStirrupEffectiveness stirrupEffectiveness;
|
||||
private IStirrupByRebar stirrupByRebar;
|
||||
private IInclinedSection inclinedSection;
|
||||
private readonly IForceTuple forceTuple;
|
||||
private StirrupByDensityStrengthLogic stirrupDensityStrengthLogic;
|
||||
private IConvertStrategy<IStirrupByDensity, IStirrupByRebar> convertStrategy;
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
@@ -19,6 +21,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
IStirrupEffectiveness stirrupEffectiveness,
|
||||
IStirrupByRebar stirrupByRebar,
|
||||
IInclinedSection inclinedSection,
|
||||
IForceTuple forceTuple,
|
||||
StirrupByDensityStrengthLogic stirrupDensityStrengthLogic,
|
||||
IConvertStrategy<IStirrupByDensity, IStirrupByRebar> convertStrategy,
|
||||
IShiftTraceLogger? traceLogger)
|
||||
@@ -26,6 +29,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
this.stirrupEffectiveness = stirrupEffectiveness;
|
||||
this.stirrupByRebar = stirrupByRebar;
|
||||
this.inclinedSection = inclinedSection;
|
||||
this.forceTuple = forceTuple;
|
||||
this.stirrupDensityStrengthLogic = stirrupDensityStrengthLogic;
|
||||
this.convertStrategy = convertStrategy;
|
||||
TraceLogger = traceLogger;
|
||||
@@ -35,17 +39,27 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
IStirrupEffectiveness stirrupEffectiveness,
|
||||
IStirrupByRebar stirrupByRebar,
|
||||
IInclinedSection inclinedSection,
|
||||
IForceTuple forceTuple,
|
||||
IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.stirrupEffectiveness = stirrupEffectiveness;
|
||||
this.stirrupByRebar = stirrupByRebar;
|
||||
this.inclinedSection = inclinedSection;
|
||||
this.forceTuple = forceTuple;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public double GetShearStrength()
|
||||
{
|
||||
InitializeStrategies();
|
||||
double maxSpacingRatio = inclinedSection.ConcreteTensionStrength * inclinedSection.WebWidth * inclinedSection.EffectiveDepth / forceTuple.Qy;
|
||||
maxSpacingRatio = Math.Min(maxSpacingRatio, 0.5);
|
||||
double maxStirrupSpacingByEffectibeDepth = maxSpacingRatio * inclinedSection.EffectiveDepth;
|
||||
if (stirrupByRebar.Spacing > maxStirrupSpacingByEffectibeDepth)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Stirrup spacing S = {stirrupByRebar.Spacing}(m) is greater than max stirrup spacing Smax = {maxStirrupSpacingByEffectibeDepth}(m), stirrups are ignored", TraceLogStatuses.Warning);
|
||||
return 0;
|
||||
}
|
||||
double shearStrength = stirrupDensityStrengthLogic.GetShearStrength();
|
||||
return shearStrength;
|
||||
}
|
||||
|
||||
@@ -10,14 +10,14 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
{
|
||||
internal class StirrupStrengthLogic : IBeamShearStrenghLogic
|
||||
{
|
||||
private IStirrup stirrup;
|
||||
private IInclinedSection inclinedSection;
|
||||
private readonly IBeamShearSectionLogicInputData inputData;
|
||||
private IStirrup stirrup => inputData.Stirrup;
|
||||
private IInclinedSection inclinedSection => inputData.InclinedSection;
|
||||
private IBeamShearStrenghLogic stirrupDensityStrengthLogic;
|
||||
|
||||
public StirrupStrengthLogic(IStirrup stirrup, IInclinedSection inclinedSection, IShiftTraceLogger? traceLogger)
|
||||
public StirrupStrengthLogic(IBeamShearSectionLogicInputData inputData, IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.stirrup = stirrup;
|
||||
this.inclinedSection = inclinedSection;
|
||||
this.inputData = inputData;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
else if (stirrup is IStirrupByRebar stirrupByRebar)
|
||||
{
|
||||
TraceLogger?.AddMessage("Stirrups type is stirrup by rebar");
|
||||
stirrupDensityStrengthLogic = new StirrupByRebarStrengthLogic(stirrupEffectiveness, stirrupByRebar, inclinedSection, TraceLogger);
|
||||
stirrupDensityStrengthLogic = new StirrupByRebarStrengthLogic(stirrupEffectiveness, stirrupByRebar, inclinedSection, inputData.ForceTuple, TraceLogger);
|
||||
return stirrupDensityStrengthLogic.GetShearStrength();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user