Change shear calculator add crack export to excel
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -27,6 +31,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
this.inputData = inputData;
|
||||
|
||||
PrepareNewResult();
|
||||
InitializeStrategies();
|
||||
try
|
||||
@@ -38,12 +43,35 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
TraceLogger?.AddMessage(ex.Message, TraceLogStatuses.Error);
|
||||
result.IsValid = false;
|
||||
result.Description += "\n" + ex.Message;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private IBeamShearSectionLogicResult CalculateResult(IBeamShearSectionLogicInputData sectionInputData)
|
||||
private void TraceSection(IBeamShearSection section)
|
||||
{
|
||||
List<IHeadMaterial> headMaterials = new()
|
||||
{
|
||||
new HeadMaterial(Guid.Empty)
|
||||
{
|
||||
Name = $"{section.Name}.Concrete",
|
||||
HelperMaterial = section.ConcreteMaterial
|
||||
},
|
||||
new HeadMaterial(Guid.Empty)
|
||||
{
|
||||
Name = $"{section.Name}.Reinforcement",
|
||||
HelperMaterial = section.ReinforcementMaterial
|
||||
},
|
||||
};
|
||||
var traceLogic = new TraceMaterialsFactory()
|
||||
{
|
||||
Collection = headMaterials
|
||||
};
|
||||
traceLogic.AddEntriesToTraceLogger(TraceLogger);
|
||||
}
|
||||
|
||||
private IBeamShearSectionLogicResult CalculateInclinedSectionResult(IBeamShearSectionLogicInputData sectionInputData)
|
||||
{
|
||||
beamShearSectionLogic.InputData = sectionInputData;
|
||||
beamShearSectionLogic.Run();
|
||||
@@ -79,6 +107,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
foreach (var section in inputData.Sections)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Analysis for action: {beamShearAction.Name}, section: {section.Name}, calc turm {calcTerm} has been started");
|
||||
TraceSection(section);
|
||||
foreach (var stirrup in stirrups)
|
||||
{
|
||||
List<IInclinedSection> inclinedSections = GetInclinedSections(section);
|
||||
@@ -87,6 +117,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
BeamShearActionResult actionResult = GetActionResult(beamShearAction, calcTerm, section, stirrup, sectionResults);
|
||||
actionResults.Add(actionResult);
|
||||
}
|
||||
TraceLogger?.AddMessage($"Analysis for action: {beamShearAction.Name}, section: {section.Name}, calc term {calcTerm} has been finished sucessfull");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,7 +144,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
List<IBeamShearSectionLogicResult> sectionResults = new();
|
||||
foreach (var item in sectionInputDatas)
|
||||
{
|
||||
IBeamShearSectionLogicResult sectionResult = CalculateResult(item);
|
||||
IBeamShearSectionLogicResult sectionResult = CalculateInclinedSectionResult(item);
|
||||
sectionResults.Add(sectionResult);
|
||||
}
|
||||
|
||||
@@ -123,10 +154,12 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
private List<IBeamShearSectionLogicInputData> GetSectionInputDatas(IBeamShearAction beamShearAction, CalcTerms calcTerm, IBeamShearSection section, IStirrup stirrup, List<IInclinedSection> inclinedSections)
|
||||
{
|
||||
List<IBeamShearSectionLogicInputData> sectionInputDatas = new();
|
||||
var material = section.Material;
|
||||
var material = section.ConcreteMaterial;
|
||||
var strength = material.GetStrength(CollapseLimitState, calcTerm);
|
||||
foreach (var inclinedSection in inclinedSections)
|
||||
{
|
||||
inclinedSection.LimitState = CollapseLimitState;
|
||||
inclinedSection.CalcTerm = calcTerm;
|
||||
inclinedSection.ConcreteCompressionStrength = strength.Compressive;
|
||||
inclinedSection.ConcreteTensionStrength = strength.Tensile;
|
||||
DirectShearForceLogicInputData inputData = new()
|
||||
|
||||
@@ -10,18 +10,20 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public Guid Id { get; }
|
||||
public string? Name { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public IConcreteLibMaterial Material { get; set; }
|
||||
public IConcreteLibMaterial ConcreteMaterial { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public IShape Shape { get; set; } = new RectangleShape(Guid.NewGuid()) { Height = 0.6, Width = 0.4};
|
||||
|
||||
public double CenterCover { get; set; } = 0.05;
|
||||
|
||||
public double ReinforcementArea { get; set; } = 0;
|
||||
public IReinforcementLibMaterial ReinforcementMaterial { get; set; }
|
||||
|
||||
public BeamShearSection(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
Material = ConcreteLibMaterialFactory.GetConcreteLibMaterial(ConcreteLibTypes.Concrete25);
|
||||
Material.TensionForULS = true;
|
||||
ConcreteMaterial = ConcreteLibMaterialFactory.GetConcreteLibMaterial(ConcreteLibTypes.Concrete25);
|
||||
ReinforcementMaterial = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Reinforcement500).HelperMaterial as IReinforcementLibMaterial;
|
||||
ConcreteMaterial.TensionForULS = true;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperLogics.Models.BeamShears.Logics;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShearSectionLogic : IBeamShearSectionLogic
|
||||
{
|
||||
private BeamShearSectionLogicResult result;
|
||||
private ConcreteStrengthLogic concreteLogic;
|
||||
private StirrupStrengthLogic stirrupLogic;
|
||||
|
||||
public IBeamShearSectionLogicInputData InputData { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public BeamShearSectionLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public IResult Result => result;
|
||||
|
||||
|
||||
public void Run()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
PrepareNewResult();
|
||||
InitializeStrategies();
|
||||
try
|
||||
{
|
||||
CalculateResult();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.IsValid = false;
|
||||
result.Description += ex.Message;
|
||||
}
|
||||
}
|
||||
|
||||
private void CalculateResult()
|
||||
{
|
||||
double concreteStrength = concreteLogic.GetShearStrength();
|
||||
result.ConcreteStrength = concreteStrength;
|
||||
double stirrupStrength = stirrupLogic.GetShearStrength();
|
||||
result.StirrupStrength = stirrupStrength;
|
||||
double totalStrength = concreteStrength + stirrupStrength;
|
||||
result.TotalStrength = totalStrength;
|
||||
double actualShearForce = InputData.ForceTuple.Qy;
|
||||
if (actualShearForce > totalStrength)
|
||||
{
|
||||
result.IsValid = false;
|
||||
string message = $"Actual shear force Qa = {actualShearForce}(N), greater than bearing capacity Olim = {totalStrength}(N)";
|
||||
result.Description += message;
|
||||
TraceLogger?.AddMessage(message, TraceLogStatuses.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
string message = $"Actual shear force Qa = {actualShearForce}(N), not greater than bearing capacity Olim = {totalStrength}(N)";
|
||||
TraceLogger?.AddMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
var sectionEffectiveness = SectionEffectivenessFactory.GetSheaEffectiveness(BeamShearSectionType.Rectangle);
|
||||
double longitudinalForce = InputData.ForceTuple.Nz;
|
||||
concreteLogic = new(sectionEffectiveness, InputData.InclinedSection, longitudinalForce, TraceLogger);
|
||||
stirrupLogic = new(InputData, TraceLogger);
|
||||
}
|
||||
|
||||
private void PrepareNewResult()
|
||||
{
|
||||
result = new()
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty,
|
||||
InputData = InputData
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using StructureHelperCommon.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -15,5 +16,12 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public double StirrupStrength { get; set; }
|
||||
public double TotalStrength { get; set; }
|
||||
public double FactorOfUsing { get => InputData.ForceTuple.Qy / TotalStrength; }
|
||||
|
||||
public IShiftTraceLogger TraceLogger { get; }
|
||||
|
||||
public BeamShearSectionLogicResult(IShiftTraceLogger traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// <summary>
|
||||
/// Concrete of cross-section
|
||||
/// </summary>
|
||||
IConcreteLibMaterial Material { get; set; }
|
||||
IConcreteLibMaterial ConcreteMaterial { get; set; }
|
||||
/// <summary>
|
||||
/// Shape of cross-section
|
||||
/// </summary>
|
||||
@@ -22,5 +22,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// Distance from edge of tension zone to center of the nearest reinforcement bar
|
||||
/// </summary>
|
||||
double CenterCover { get; set; }
|
||||
/// <summary>
|
||||
/// Area of reinforcement in tension zone, m^2
|
||||
/// </summary>
|
||||
double ReinforcementArea { get; set; }
|
||||
/// <summary>
|
||||
/// Material of reinforcement in tension zone
|
||||
/// </summary>
|
||||
IReinforcementLibMaterial ReinforcementMaterial { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -14,5 +16,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public double StirrupStrength { get; set; }
|
||||
public double TotalStrength { get; set; }
|
||||
public double FactorOfUsing { get; }
|
||||
public IShiftTraceLogger TraceLogger { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -12,6 +8,18 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// </summary>
|
||||
public interface IInclinedSection : IEffectiveDepth
|
||||
{
|
||||
/// <summary>
|
||||
/// Reference to source beam shear section
|
||||
/// </summary>
|
||||
IBeamShearSection BeamShearSection { get; set; }
|
||||
/// <summary>
|
||||
/// Type of limite state for calculating
|
||||
/// </summary>
|
||||
LimitStates LimitState { get; set; }
|
||||
/// <summary>
|
||||
/// Type od calc term for calculating
|
||||
/// </summary>
|
||||
CalcTerms CalcTerm { get; set; }
|
||||
/// <summary>
|
||||
/// Width of cross-section
|
||||
/// </summary>
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -21,5 +17,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public double EndCoord { get; set; }
|
||||
public double ConcreteCompressionStrength { get; set; }
|
||||
public double ConcreteTensionStrength { get; set; }
|
||||
public IBeamShearSection BeamShearSection { get; set; }
|
||||
public LimitStates LimitState { get; set; }
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperLogics.Models.BeamShears.Logics;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShearSectionLogic : IBeamShearSectionLogic
|
||||
{
|
||||
private BeamShearSectionLogicResult result;
|
||||
private ISectionEffectiveness sectionEffectiveness;
|
||||
private ConcreteStrengthLogic concreteLogic;
|
||||
private StirrupStrengthLogic stirrupLogic;
|
||||
private IGetLongitudinalForceFactorLogic getLongitudinalForceFactorLogic;
|
||||
private string sectionMessage;
|
||||
private ICheckInputDataLogic<IBeamShearSectionLogicInputData> checkInputDataLogic;
|
||||
|
||||
private ShiftTraceLogger? localTraceLogger { get; set; }
|
||||
|
||||
public IBeamShearSectionLogicInputData InputData { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public BeamShearSectionLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public IResult Result => result;
|
||||
|
||||
|
||||
public void Run()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
sectionMessage = $"Inclined section: start xstart = {InputData.InclinedSection.StartCoord}(m), end xend = {InputData.InclinedSection.EndCoord}(m). ";
|
||||
PrepareNewResult();
|
||||
if (Check() == false) { return; }
|
||||
localTraceLogger?.AddMessage(sectionMessage);
|
||||
InitializeStrategies();
|
||||
try
|
||||
{
|
||||
CalculateResult();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.IsValid = false;
|
||||
result.Description += ex.Message;
|
||||
}
|
||||
}
|
||||
|
||||
private bool Check()
|
||||
{
|
||||
bool checkResult = true;
|
||||
checkInputDataLogic ??= new CheckSectionLogicInputDataLogic(TraceLogger);
|
||||
checkInputDataLogic.InputData = InputData;
|
||||
if (checkInputDataLogic.Check() == false)
|
||||
{
|
||||
checkResult = false;
|
||||
result.IsValid = false;
|
||||
string errorMessage = checkInputDataLogic.CheckResult;
|
||||
result.Description += errorMessage;
|
||||
localTraceLogger?.AddMessage(errorMessage, TraceLogStatuses.Error);
|
||||
}
|
||||
return checkResult;
|
||||
}
|
||||
|
||||
private void CalculateResult()
|
||||
{
|
||||
SetLongitudinalForce();
|
||||
double factorOfLongitudinalForce = getLongitudinalForceFactorLogic.GetFactor();
|
||||
localTraceLogger?.AddMessage($"Factor of longitudinal force = {factorOfLongitudinalForce}, (dimensionless)");
|
||||
double concreteStrength = concreteLogic.GetShearStrength();
|
||||
double stirrupStrength = stirrupLogic.GetShearStrength();
|
||||
if (stirrupStrength > concreteStrength)
|
||||
{
|
||||
stirrupStrength = GetStirrupStrengthBySearch();
|
||||
}
|
||||
concreteStrength *= factorOfLongitudinalForce;
|
||||
localTraceLogger?.AddMessage($"Concrete strength Qb = {concreteStrength}(N)");
|
||||
result.ConcreteStrength = concreteStrength;
|
||||
stirrupStrength *= factorOfLongitudinalForce;
|
||||
localTraceLogger?.AddMessage($"Stirrup strength Qsw = {stirrupStrength}(N)");
|
||||
result.StirrupStrength = stirrupStrength;
|
||||
double totalStrength = concreteStrength + stirrupStrength;
|
||||
localTraceLogger?.AddMessage($"Total strength = {concreteStrength} + {stirrupStrength} = {totalStrength}(N)");
|
||||
result.TotalStrength = totalStrength;
|
||||
double actualShearForce = InputData.ForceTuple.Qy;
|
||||
if (actualShearForce > totalStrength)
|
||||
{
|
||||
result.IsValid = false;
|
||||
string message = $"Actual shear force Qa = {actualShearForce}(N), greater than bearing capacity Olim = {totalStrength}(N)";
|
||||
result.Description += message;
|
||||
localTraceLogger?.AddMessage(message, TraceLogStatuses.Error);
|
||||
TraceLogger?.AddMessage(sectionMessage + message, TraceLogStatuses.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
string message = $"Actual shear force Qa = {actualShearForce}(N), not greater than bearing capacity Olim = {totalStrength}(N)";
|
||||
localTraceLogger?.AddMessage(message);
|
||||
TraceLogger?.AddMessage(sectionMessage + message);
|
||||
}
|
||||
}
|
||||
|
||||
private double GetStirrupStrengthBySearch()
|
||||
{
|
||||
var logic = new StirrupBySearchLogic(TraceLogger)
|
||||
{
|
||||
InputData = InputData,
|
||||
SectionEffectiveness = sectionEffectiveness
|
||||
};
|
||||
double stirrupStrength = logic.GetShearStrength();
|
||||
localTraceLogger?.AddMessage($"Stirrup strength was restricted as Qsw,restricted = {stirrupStrength}(N)");
|
||||
return stirrupStrength;
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
sectionEffectiveness = SectionEffectivenessFactory.GetSheaEffectiveness(BeamShearSectionType.Rectangle);
|
||||
concreteLogic = new(sectionEffectiveness, InputData.InclinedSection, localTraceLogger);
|
||||
stirrupLogic = new(InputData, localTraceLogger);
|
||||
getLongitudinalForceFactorLogic = new GetLongitudinalForceFactorLogic(localTraceLogger?.GetSimilarTraceLogger(100));
|
||||
}
|
||||
|
||||
private void SetLongitudinalForce()
|
||||
{
|
||||
getLongitudinalForceFactorLogic.LongitudinalForce = InputData.ForceTuple.Nz;
|
||||
getLongitudinalForceFactorLogic.InclinedSection = InputData.InclinedSection;
|
||||
}
|
||||
|
||||
private void PrepareNewResult()
|
||||
{
|
||||
localTraceLogger = new();
|
||||
result = new(localTraceLogger)
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty,
|
||||
InputData = InputData,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
private IUpdateStrategy<IShape> shapeUpdateStrategy;
|
||||
private IUpdateStrategy<IConcreteLibMaterial> concreteUpdateStrategy;
|
||||
private IUpdateStrategy<IReinforcementLibMaterial> reinforcementUpdateStrategy;
|
||||
public void Update(IBeamShearSection targetObject, IBeamShearSection sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
@@ -22,9 +23,12 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
InitializeStrategies();
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.ReinforcementArea = sourceObject.ReinforcementArea;
|
||||
shapeUpdateStrategy.Update(targetObject.Shape, sourceObject.Shape);
|
||||
targetObject.Material ??= new ConcreteLibMaterial();
|
||||
concreteUpdateStrategy.Update(targetObject.Material, sourceObject.Material);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -32,6 +36,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
shapeUpdateStrategy ??= new ShapeUpdateStrategy();
|
||||
concreteUpdateStrategy ??= new ConcreteLibUpdateStrategy();
|
||||
reinforcementUpdateStrategy ??= new ReinforcementLibUpdateStrategy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Entity.Material is null)
|
||||
if (Entity.ConcreteMaterial is null)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"\nMaterial of cross-section is not assigned");
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
internal class CheckSectionLogicInputDataLogic : ICheckInputDataLogic<IBeamShearSectionLogicInputData>
|
||||
{
|
||||
private bool result;
|
||||
private string checkResult;
|
||||
public CheckSectionLogicInputDataLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public IBeamShearSectionLogicInputData InputData { get; set; }
|
||||
|
||||
public string CheckResult => checkResult;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
result = true;
|
||||
checkResult = string.Empty;
|
||||
if (InputData is null)
|
||||
{
|
||||
result = false;
|
||||
string errorString = ErrorStrings.ParameterIsNull + ": Input data";
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
if (InputData.ForceTuple is null)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage("Force tuple is null");
|
||||
}
|
||||
if (InputData.ForceTuple.Qy < 0)
|
||||
{
|
||||
result = false;
|
||||
TraceMessage($"Shear force Qy = {InputData.ForceTuple.Qy} must be positive");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString;
|
||||
TraceLogger?.AddMessage(errorString);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,22 +6,19 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class ConcreteStrengthLogic : IBeamShearStrenghLogic
|
||||
{
|
||||
private readonly double longitudinalForce;
|
||||
private readonly ISectionEffectiveness sectionEffectiveness;
|
||||
private readonly IInclinedSection inclinedSection;
|
||||
private IGetLongitudinalForceFactorLogic getLongitudinalForceFactorLogic;
|
||||
|
||||
|
||||
private double crackLength;
|
||||
|
||||
public ConcreteStrengthLogic(
|
||||
ISectionEffectiveness sectionEffectiveness,
|
||||
IInclinedSection inclinedSection,
|
||||
double longitudinalForce,
|
||||
IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.sectionEffectiveness = sectionEffectiveness;
|
||||
this.inclinedSection = inclinedSection;
|
||||
this.longitudinalForce = longitudinalForce;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
@@ -35,27 +32,29 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
TraceLogger?.AddMessage($"Section shape factor = {sectionEffectiveness.ShapeFactor}, (dimensionless)");
|
||||
TraceLogger?.AddMessage($"Effective depth = {inclinedSection.EffectiveDepth}, (m)");
|
||||
crackLength = inclinedSection.EndCoord - inclinedSection.StartCoord;
|
||||
TraceLogger?.AddMessage($"Crack length = {inclinedSection.EndCoord} - {inclinedSection.StartCoord} = {crackLength}, (m)");
|
||||
TraceLogger?.AddMessage($"Absolute crack length c = {inclinedSection.EndCoord} - {inclinedSection.StartCoord} = {crackLength}, (m)");
|
||||
TraceLogger?.AddMessage($"Relative crack length c/d = {crackLength} / {inclinedSection.EffectiveDepth} = {crackLength/ inclinedSection.EffectiveDepth},(dimensionless)");
|
||||
RestrictCrackLength();
|
||||
SetLongitudinalForce();
|
||||
double factorOfLongitudinalForce = getLongitudinalForceFactorLogic.GetFactor();
|
||||
TraceLogger?.AddMessage($"Factor of longitudinal force = {factorOfLongitudinalForce}, (dimensionless)");
|
||||
double concreteMoment = sectionEffectiveness.BaseShapeFactor * sectionEffectiveness.ShapeFactor * inclinedSection.ConcreteTensionStrength * inclinedSection.WebWidth * inclinedSection.EffectiveDepth * inclinedSection.EffectiveDepth;
|
||||
double shearStrength = factorOfLongitudinalForce * concreteMoment / crackLength;
|
||||
TraceLogger?.AddMessage($"Shear strength of concrete = {shearStrength}, (N)");
|
||||
|
||||
|
||||
double concreteMoment =
|
||||
sectionEffectiveness.BaseShapeFactor
|
||||
* sectionEffectiveness.ShapeFactor
|
||||
* inclinedSection.ConcreteTensionStrength
|
||||
* inclinedSection.WebWidth
|
||||
* inclinedSection.EffectiveDepth
|
||||
* inclinedSection.EffectiveDepth;
|
||||
double shearStrength = concreteMoment / crackLength;
|
||||
TraceLogger?.AddMessage($"Shear strength of concrete = {sectionEffectiveness.BaseShapeFactor} * {sectionEffectiveness.ShapeFactor} * {inclinedSection.ConcreteTensionStrength} * {inclinedSection.WebWidth} * {inclinedSection.EffectiveDepth} ^ 2 / {crackLength} = {shearStrength}, (N)");
|
||||
return shearStrength;
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
getLongitudinalForceFactorLogic ??= new GetLongitudinalForceFactorLogic(TraceLogger?.GetSimilarTraceLogger(100));
|
||||
|
||||
}
|
||||
|
||||
private void SetLongitudinalForce()
|
||||
{
|
||||
getLongitudinalForceFactorLogic.LongitudinalForce = longitudinalForce;
|
||||
getLongitudinalForceFactorLogic.InclinedSection = inclinedSection;
|
||||
}
|
||||
|
||||
|
||||
private void RestrictCrackLength()
|
||||
{
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
effectiveDepth = depth - beamShearSection.CenterCover;
|
||||
inclinedSection = new()
|
||||
{
|
||||
BeamShearSection = beamShearSection,
|
||||
FullDepth = depth,
|
||||
EffectiveDepth = effectiveDepth,
|
||||
StartCoord = startCoord,
|
||||
|
||||
@@ -7,10 +7,13 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
{
|
||||
public class GetLongitudinalForceFactorLogic : IGetLongitudinalForceFactorLogic
|
||||
{
|
||||
private const double fstRatioInCompression = 0.25;
|
||||
private const double sndRatioInCompression = 0.75;
|
||||
private const double sndRatioInCompression = 0.5;
|
||||
private const double maxFactor = 1.25;
|
||||
|
||||
private double sectionArea;
|
||||
private ShiftTraceLogger localTraceLogger;
|
||||
private ICheckEntityLogic<IInclinedSection> checkInclinedSectionLogic;
|
||||
private IGetReducedAreaLogic getReducedAreaLogic;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public IInclinedSection InclinedSection { get; set; }
|
||||
@@ -21,39 +24,62 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public GetLongitudinalForceFactorLogic(
|
||||
ICheckEntityLogic<IInclinedSection> checkInclinedSectionLogic,
|
||||
IGetReducedAreaLogic getReducedAreaLogic,
|
||||
IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.checkInclinedSectionLogic = checkInclinedSectionLogic;
|
||||
this.getReducedAreaLogic = getReducedAreaLogic;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public double GetFactor()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage("Logic of calculating of factor of influence of longitudinal force according to SP 63.13330.2018");
|
||||
localTraceLogger = new();
|
||||
localTraceLogger.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
localTraceLogger.AddMessage("Logic of calculating of factor of influence of longitudinal force according to SP 63.13330.2018");
|
||||
Check();
|
||||
double result;
|
||||
if (LongitudinalForce == 0)
|
||||
{
|
||||
TraceLogger?.AddMessage("Longitudinal force is zero", TraceLogStatuses.Service);
|
||||
return 1;
|
||||
}
|
||||
sectionArea = InclinedSection.WebWidth * InclinedSection.FullDepth;
|
||||
TraceLogger?.AddMessage($"Area of cross-section Ac = {InclinedSection.WebWidth} * {InclinedSection.FullDepth} = {sectionArea}(m^2)");
|
||||
if (LongitudinalForce < 0)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Longitudinal force N={LongitudinalForce}(N) is negative (compression)", TraceLogStatuses.Service);
|
||||
return GetNegForceResult();
|
||||
localTraceLogger.AddMessage("Longitudinal force is zero", TraceLogStatuses.Service);
|
||||
result = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger?.AddMessage($"Longitudinal force N={LongitudinalForce}(N) is positive (tension)", TraceLogStatuses.Service);
|
||||
return GetPosForceResult();
|
||||
result = GetFactorByForce();
|
||||
}
|
||||
localTraceLogger.TraceLoggerEntries.ForEach(x => TraceLogger?.TraceLoggerEntries.Add(x));
|
||||
return result;
|
||||
}
|
||||
|
||||
private double GetFactorByForce()
|
||||
{
|
||||
double result;
|
||||
getReducedAreaLogic ??= new GetReducedAreaLogicSP63_2018_rev3(LongitudinalForce, InclinedSection, localTraceLogger);
|
||||
sectionArea = getReducedAreaLogic.GetArea();
|
||||
if (LongitudinalForce < 0)
|
||||
{
|
||||
localTraceLogger.AddMessage($"Longitudinal force N={LongitudinalForce}(N) is negative (compression)", TraceLogStatuses.Service);
|
||||
result = GetNegForceResult();
|
||||
}
|
||||
else
|
||||
{
|
||||
localTraceLogger.AddMessage($"Longitudinal force N={LongitudinalForce}(N) is positive (tension)", TraceLogStatuses.Service);
|
||||
result = GetPosForceResult();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void Check()
|
||||
{
|
||||
checkInclinedSectionLogic ??= new CheckInclinedSectionLogic(TraceLogger);
|
||||
checkInclinedSectionLogic ??= new CheckInclinedSectionLogic(localTraceLogger);
|
||||
checkInclinedSectionLogic.Entity = InclinedSection;
|
||||
if (checkInclinedSectionLogic.Check() == false)
|
||||
{
|
||||
string errorString = checkInclinedSectionLogic.CheckResult;
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
localTraceLogger.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
}
|
||||
@@ -61,41 +87,43 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
private double GetPosForceResult()
|
||||
{
|
||||
double stressInConcrete = LongitudinalForce / sectionArea;
|
||||
TraceLogger?.AddMessage($"Average stress in concrete (positive in tension) Sigma = {LongitudinalForce}(N) / {sectionArea}(m^2) = {stressInConcrete}(Pa)");
|
||||
localTraceLogger.AddMessage($"Average stress in concrete (positive in tension) Sigma = {LongitudinalForce}(N) / {sectionArea}(m^2) = {stressInConcrete}(Pa)");
|
||||
double concreteStrength = InclinedSection.ConcreteTensionStrength;
|
||||
TraceLogger?.AddMessage($"Concrete strength Rbt = {concreteStrength}(Pa)");
|
||||
localTraceLogger.AddMessage($"Concrete strength Rbt = {concreteStrength}(Pa)");
|
||||
double stressRatio = stressInConcrete / concreteStrength;
|
||||
TraceLogger?.AddMessage($"Stress ratio rt = {stressInConcrete} / {concreteStrength} = {stressRatio}(dimensionless)");
|
||||
localTraceLogger.AddMessage($"Stress ratio rt = {stressInConcrete} / {concreteStrength} = {stressRatio}(dimensionless)");
|
||||
double factor = 1 - 0.5 * stressRatio;
|
||||
factor = Math.Max(factor, 0);
|
||||
TraceLogger?.AddMessage($"Factor value fi_n = {factor}(dimensionless)");
|
||||
localTraceLogger.AddMessage($"Factor value fi_n = {factor}(dimensionless)");
|
||||
return factor;
|
||||
}
|
||||
|
||||
private double GetNegForceResult()
|
||||
{
|
||||
double stressInConcrete = (-1) * LongitudinalForce / sectionArea;
|
||||
TraceLogger?.AddMessage($"Average stress in concrete (positive in compression) Sigma = {LongitudinalForce}(N) / {sectionArea}(m^2) = {stressInConcrete}(Pa)");
|
||||
localTraceLogger.AddMessage($"Average stress in concrete (positive in compression) Sigma = {LongitudinalForce}(N) / {sectionArea}(m^2) = {stressInConcrete}(Pa)");
|
||||
double concreteStrength = InclinedSection.ConcreteCompressionStrength;
|
||||
TraceLogger?.AddMessage($"Concrete strength Rb = {concreteStrength}(Pa)");
|
||||
localTraceLogger.AddMessage($"Concrete strength Rb = {concreteStrength}(Pa)");
|
||||
double stressRatio = stressInConcrete / concreteStrength;
|
||||
TraceLogger?.AddMessage($"Stress ratio rc = {stressInConcrete} / {concreteStrength} = {stressRatio}(dimensionless)");
|
||||
localTraceLogger.AddMessage($"Stress ratio rc = {stressInConcrete} / {concreteStrength} = {stressRatio}(dimensionless)");
|
||||
double factor;
|
||||
double fstRatioInCompression = maxFactor-1;
|
||||
if (stressRatio < fstRatioInCompression)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Stress ratio rc = {stressRatio} < {fstRatioInCompression}");
|
||||
localTraceLogger.AddMessage($"Stress ratio rc = {stressRatio} < {fstRatioInCompression}");
|
||||
factor = 1 + stressRatio;
|
||||
}
|
||||
else if (stressRatio > sndRatioInCompression)
|
||||
{
|
||||
factor = 5 * (1 - stressRatio);
|
||||
double stressFactor = maxFactor / (1 - sndRatioInCompression);
|
||||
factor = stressFactor * (1 - stressRatio);
|
||||
factor = Math.Max(factor, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
factor = 1 + fstRatioInCompression;
|
||||
factor = maxFactor;
|
||||
}
|
||||
TraceLogger?.AddMessage($"Factor value fi_n = {factor}(dimensionless)");
|
||||
localTraceLogger.AddMessage($"Factor value fi_n = {factor}(dimensionless)");
|
||||
return factor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class GetReducedAreaLogicSP63_2018_rev3 : IGetReducedAreaLogic
|
||||
{
|
||||
private const double epsilon_b0 = 0.002;
|
||||
private const double epsilon_bt0 = 0.0001;
|
||||
|
||||
private double longitudinalForce;
|
||||
private IInclinedSection inclinedSection;
|
||||
private (double Compressive, double Tensile) concreteStrength;
|
||||
private double reinforcementModulus;
|
||||
private double concreteModulus;
|
||||
private double reducingFactor;
|
||||
private double concreteArea;
|
||||
private double reinforcementArea;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public GetReducedAreaLogicSP63_2018_rev3(double longitudinalForce, IInclinedSection inclinedSection, IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.longitudinalForce = longitudinalForce;
|
||||
this.inclinedSection = inclinedSection;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public double GetArea()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage($"Calculting of reduced area of cross-section according to SP 63.13330.2018 rev.3");
|
||||
GetSuplimentaryParemeters();
|
||||
double area = GetReducedArea();
|
||||
return area;
|
||||
}
|
||||
|
||||
private double GetReducedArea()
|
||||
{
|
||||
if (longitudinalForce <= 0)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Longitudinal force Nz = {longitudinalForce} is negative, section under compression");
|
||||
return GetNegForceArea();
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger?.AddMessage($"Longitudinal force Nz = {longitudinalForce} is positive, section under tension");
|
||||
return GetPosForceArea();
|
||||
}
|
||||
}
|
||||
|
||||
private void GetSuplimentaryParemeters()
|
||||
{
|
||||
GetConcreteModulus();
|
||||
GetReinforcementModulus();
|
||||
GetConcreteStrength();
|
||||
GetAreas();
|
||||
}
|
||||
|
||||
private double GetPosForceArea()
|
||||
{
|
||||
double tensileStrength = concreteStrength.Tensile;
|
||||
TraceLogger?.AddMessage($"Modulus of elasticity of reinforcement Es = {reinforcementModulus }(Pa)");
|
||||
TraceLogger?.AddMessage($"Modulus of elasticity of concrete Eb = {concreteModulus }(Pa)");
|
||||
TraceLogger?.AddMessage($"Ratio of modulus of elasticity alpha = {reducingFactor }(dimensionless)");
|
||||
TraceLogger?.AddMessage($"Tensile strength of concrete Rbt = {tensileStrength }(Pa)");
|
||||
TraceLogger?.AddMessage($"Reference strain of concrete Epsilonbt0 = {epsilon_bt0 }(dimensionless)");
|
||||
double factorOfInelasticity = tensileStrength / (epsilon_bt0 * concreteModulus);
|
||||
TraceLogger?.AddMessage($"Factor of inelastisity nu = Rbt / (Epsilon_bt0 * Eb) = {tensileStrength } / ({epsilon_bt0} * {concreteModulus}) = {factorOfInelasticity}(dimensionless)");
|
||||
double factor = reducingFactor / factorOfInelasticity;
|
||||
double area = concreteArea + reinforcementArea * factor;
|
||||
TraceLogger?.AddMessage($"Reduced area Ared = {concreteArea} + {reducingFactor} / {factorOfInelasticity} * {reinforcementArea} = {area}(m^2)");
|
||||
return area;
|
||||
}
|
||||
|
||||
private double GetNegForceArea()
|
||||
{
|
||||
double compressiveStrength = concreteStrength.Compressive;
|
||||
TraceLogger?.AddMessage($"Modulus of elasticity of reinforcement Es = {reinforcementModulus }(Pa)");
|
||||
TraceLogger?.AddMessage($"Modulus of elasticity of concrete Eb = {concreteModulus }(Pa)");
|
||||
TraceLogger?.AddMessage($"Ratio of modulus of elasticity alpha = {reducingFactor }(dimensionless)");
|
||||
TraceLogger?.AddMessage($"Compressive strength of concrete Rb = {compressiveStrength }(Pa)");
|
||||
TraceLogger?.AddMessage($"Reference strain of concrete Epsilonb0 = {epsilon_b0 }(dimensionless)");
|
||||
double factorOfInelasticity = compressiveStrength / (epsilon_b0 * concreteModulus);
|
||||
TraceLogger?.AddMessage($"Factor of inelastisity nu = Rb / (Epsilon_b0 * Eb) = {compressiveStrength } / ({epsilon_b0} * {concreteModulus}) = {factorOfInelasticity}(dimensionless)");
|
||||
double factor = reducingFactor / factorOfInelasticity;
|
||||
double area = concreteArea + reinforcementArea * factor;
|
||||
TraceLogger?.AddMessage($"Reduced area Ared = {concreteArea} + {reducingFactor} / {factorOfInelasticity} * {reinforcementArea} = {area}(m^2)");
|
||||
return area;
|
||||
}
|
||||
|
||||
private void GetAreas()
|
||||
{
|
||||
reducingFactor = reinforcementModulus / concreteModulus;
|
||||
concreteArea = inclinedSection.WebWidth * inclinedSection.FullDepth;
|
||||
TraceLogger?.AddMessage($"Concrete area Ac = {concreteArea}(m^2)");
|
||||
reinforcementArea = inclinedSection.BeamShearSection.ReinforcementArea;
|
||||
TraceLogger?.AddMessage($"Reinforcement area As = {reinforcementArea}(m^2)");
|
||||
}
|
||||
|
||||
private void GetConcreteModulus()
|
||||
{
|
||||
var concreteMaterial = inclinedSection.BeamShearSection.ConcreteMaterial;
|
||||
var loaderMaterial = concreteMaterial.GetLoaderMaterial(inclinedSection.LimitState, inclinedSection.CalcTerm);
|
||||
concreteModulus = loaderMaterial.InitModulus;
|
||||
}
|
||||
|
||||
private void GetReinforcementModulus()
|
||||
{
|
||||
var reinforcementMaterial = inclinedSection.BeamShearSection.ReinforcementMaterial;
|
||||
var loaderMaterial = reinforcementMaterial.GetLoaderMaterial(inclinedSection.LimitState, inclinedSection.CalcTerm);
|
||||
reinforcementModulus = loaderMaterial.InitModulus;
|
||||
}
|
||||
|
||||
private void GetConcreteStrength()
|
||||
{
|
||||
concreteStrength = inclinedSection.BeamShearSection.ConcreteMaterial.GetStrength(inclinedSection.LimitState, inclinedSection.CalcTerm);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <summary>
|
||||
/// Implement logic for calculation of bearing capacity of inclined section for shear
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public interface IGetInclinedSectionListInputData
|
||||
public interface IGetInclinedSectionListInputData : IInputData
|
||||
{
|
||||
int StepCount { get; set; }
|
||||
double MaxInclinedSectionLegthFactor { get; set; }
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -0,0 +1,9 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public interface IGetReducedAreaLogic : ILogic
|
||||
{
|
||||
double GetArea();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
internal class InclinedSectionUpdateStrategy : IUpdateStrategy<IInclinedSection>
|
||||
{
|
||||
public void Update(IInclinedSection targetObject, IInclinedSection sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; };
|
||||
targetObject.StartCoord = sourceObject.StartCoord;
|
||||
targetObject.EndCoord = sourceObject.EndCoord;
|
||||
targetObject.EffectiveDepth = sourceObject.EffectiveDepth;
|
||||
targetObject.FullDepth = sourceObject.FullDepth;
|
||||
targetObject.LimitState = sourceObject.LimitState;
|
||||
targetObject.CalcTerm = sourceObject.CalcTerm;
|
||||
targetObject.ConcreteCompressionStrength = sourceObject.ConcreteCompressionStrength;
|
||||
targetObject.ConcreteTensionStrength = sourceObject.ConcreteTensionStrength;
|
||||
targetObject.WebWidth = sourceObject.WebWidth;
|
||||
targetObject.BeamShearSection = sourceObject.BeamShearSection.Clone() as IBeamShearSection;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,11 +43,11 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
double finalCrackLength = Math.Min(crackLength, maxCrackLength);
|
||||
TraceLogger?.AddMessage($"Length of crack = Min({crackLength}, {maxCrackLength}) = {finalCrackLength}(m)");
|
||||
double finalDensity = stirrupEffectiveness.StirrupShapeFactor * stirrupEffectiveness.StirrupPlacementFactor * stirrupByDensity.StirrupDensity;
|
||||
TraceLogger?.AddMessage($"Stirrups design density qsw = {finalDensity}(N/m)");
|
||||
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)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Since stirrups design density qsw = {finalDensity}(N/m) less than {minStirrupRatio} * {concreteDensity}, final density is equal to zero");
|
||||
TraceLogger?.AddMessage($"Since stirrups design density qsw = {finalDensity}(N/m) less than {minStirrupRatio} * {concreteDensity}, final density is equal to zero", TraceLogStatuses.Warning);
|
||||
finalDensity = 0;
|
||||
}
|
||||
double strength = finalDensity * finalCrackLength;
|
||||
|
||||
@@ -5,7 +5,7 @@ using StructureHelperCommon.Models.Forces;
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class StirrupByRebarStrengthLogic : IBeamShearStrenghLogic
|
||||
{
|
||||
@@ -52,9 +52,15 @@ namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
public double GetShearStrength()
|
||||
{
|
||||
InitializeStrategies();
|
||||
TraceLogger?.AddMessage($"Stirrup diameter d = {stirrupByRebar.Diameter}(m)");
|
||||
TraceLogger?.AddMessage($"Stirrup leg number n = {stirrupByRebar.LegCount}");
|
||||
TraceLogger?.AddMessage($"Stirrup spacing S = {stirrupByRebar.Spacing}(m)");
|
||||
double maxSpacingRatio = inclinedSection.ConcreteTensionStrength * inclinedSection.WebWidth * inclinedSection.EffectiveDepth / forceTuple.Qy;
|
||||
TraceLogger?.AddMessage($"Maximum spacing ratio due to strength beetwen hoops Sr,max = {maxSpacingRatio}(dimensionless)");
|
||||
maxSpacingRatio = Math.Min(maxSpacingRatio, 0.5);
|
||||
TraceLogger?.AddMessage($"Maximum spacing ratio Sr,max = {maxSpacingRatio}(dimensionless)");
|
||||
double maxStirrupSpacingByEffectibeDepth = maxSpacingRatio * inclinedSection.EffectiveDepth;
|
||||
TraceLogger?.AddMessage($"Maximum spacing S,max = {maxStirrupSpacingByEffectibeDepth}(m)");
|
||||
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);
|
||||
|
||||
@@ -6,9 +6,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class StirrupByRebarToDensityConvertStrategy : IConvertStrategy<IStirrupByDensity, IStirrupByRebar>
|
||||
{
|
||||
private const double stirrupStrengthFactor = 1d;
|
||||
private const double stirrupStrengthFactor = 0.8d;
|
||||
private const double maxStirrupStrength = 3e8;
|
||||
|
||||
private IUpdateStrategy<IStirrup> updateStrategy;
|
||||
public Dictionary<(Guid id, Type type), ISaveable> ReferenceDictionary { get; set; }
|
||||
public IShiftTraceLogger TraceLogger { get; set; }
|
||||
@@ -36,12 +35,15 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
private double GetStirrupDensity(IStirrupByRebar source)
|
||||
{
|
||||
double area = Math.PI * source.Diameter * source.Diameter / 4d;
|
||||
TraceLogger?.AddMessage($"Area of rebar = {Math.PI} * ({source.Diameter})^2 / 4 = {area}, m^2");
|
||||
double strength = stirrupStrengthFactor * source.Material.GetStrength(LimitStates.ULS, CalcTerms.ShortTerm).Tensile;
|
||||
TraceLogger?.AddMessage($"Strength of rebar = {strength}, Pa");
|
||||
strength = Math.Min(strength, maxStirrupStrength);
|
||||
double density = strength * area * source.LegCount / source.Spacing;
|
||||
TraceLogger?.AddMessage($"Density of stirrups = {strength} * {area} * {source.LegCount} / {source.Spacing} = {density}, N/m");
|
||||
TraceLogger?.AddMessage($"Area of rebar = {Math.PI} * ({source.Diameter})^2 / 4 = {area}(m^2)");
|
||||
double materialStrength = source.Material.GetStrength(LimitStates.ULS, CalcTerms.ShortTerm).Tensile;
|
||||
TraceLogger?.AddMessage($"Stirrup material strength Rsw = {materialStrength}");
|
||||
double stirrupStrength = stirrupStrengthFactor * materialStrength;
|
||||
TraceLogger?.AddMessage($"Strength of rebar Rsw = {stirrupStrengthFactor} * {materialStrength} = {stirrupStrength}(Pa)");
|
||||
double minimizedStrength = Math.Min(stirrupStrength, maxStirrupStrength);
|
||||
TraceLogger?.AddMessage($"Strength of rebar Rsw = Min({stirrupStrength}, {maxStirrupStrength})= {minimizedStrength}(Pa)");
|
||||
double density = minimizedStrength * area * source.LegCount / source.Spacing;
|
||||
TraceLogger?.AddMessage($"Density of stirrups = {minimizedStrength} * {area} * {source.LegCount} / {source.Spacing} = {density}(N/m)");
|
||||
return density;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperLogics.Models.BeamShears.Logics;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
internal class StirrupBySearchLogic : IBeamShearStrenghLogic
|
||||
{
|
||||
private ConcreteStrengthLogic concreteLogic;
|
||||
private StirrupStrengthLogic stirrupLogic;
|
||||
private ShiftTraceLogger? localTraceLogger { get; 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 stirrupStrength = stirrupLogic.GetShearStrength();
|
||||
return stirrupStrength;
|
||||
}
|
||||
|
||||
public double GetParameter()
|
||||
{
|
||||
var parameterCalculator = new FindParameterCalculator(TraceLogger);
|
||||
parameterCalculator.InputData.Predicate = GetPredicate;
|
||||
parameterCalculator.Accuracy.IterationAccuracy = 0.0001d;
|
||||
parameterCalculator.Accuracy.MaxIterationCount = 1000;
|
||||
parameterCalculator.Run();
|
||||
if (parameterCalculator.Result.IsValid == false)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": predicate error");
|
||||
}
|
||||
var result = parameterCalculator.Result as FindParameterResult;
|
||||
var parameter = result.Parameter;
|
||||
return parameter;
|
||||
}
|
||||
|
||||
private bool GetPredicate(double factor)
|
||||
{
|
||||
BeamShearSectionLogicInputData newInputData = GetNewInputData(factor);
|
||||
concreteLogic = new(SectionEffectiveness, newInputData.InclinedSection, localTraceLogger);
|
||||
stirrupLogic = new(newInputData, localTraceLogger);
|
||||
double concreteStrength = concreteLogic.GetShearStrength();
|
||||
double stirrupStrength = stirrupLogic.GetShearStrength();
|
||||
return stirrupStrength > concreteStrength;
|
||||
}
|
||||
|
||||
private BeamShearSectionLogicInputData GetNewInputData(double factor)
|
||||
{
|
||||
double sourceCrackLength = InputData.InclinedSection.EndCoord - InputData.InclinedSection.StartCoord;
|
||||
double newCrackLength = sourceCrackLength * factor;
|
||||
double newStartCoord = InputData.InclinedSection.EndCoord - newCrackLength;
|
||||
InclinedSection newSection = new();
|
||||
var updateStrategy = new InclinedSectionUpdateStrategy();
|
||||
updateStrategy.Update(newSection, InputData.InclinedSection);
|
||||
newSection.StartCoord = newStartCoord;
|
||||
BeamShearSectionLogicInputData newInputData = new(Guid.Empty)
|
||||
{
|
||||
InclinedSection = newSection,
|
||||
LimitState = InputData.LimitState,
|
||||
CalcTerm = InputData.CalcTerm,
|
||||
Stirrup = InputData.Stirrup,
|
||||
ForceTuple = InputData.ForceTuple
|
||||
};
|
||||
return newInputData;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,7 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
internal class StirrupStrengthLogic : IBeamShearStrenghLogic
|
||||
{
|
||||
|
||||
@@ -30,6 +30,11 @@ namespace StructureHelperLogics.Models.Materials
|
||||
ProcessCollection();
|
||||
return traceLoggerEntries;
|
||||
}
|
||||
public void AddEntriesToTraceLogger(IShiftTraceLogger traceLogger)
|
||||
{
|
||||
var entries = GetTraceEntries();
|
||||
entries.ForEach(x => traceLogger?.AddEntry(x));
|
||||
}
|
||||
|
||||
private void ProcessCollection()
|
||||
{
|
||||
@@ -45,7 +50,6 @@ namespace StructureHelperLogics.Models.Materials
|
||||
}
|
||||
traceLoggerEntries.Add(table);
|
||||
}
|
||||
|
||||
private List<IShTableRow<ITraceLoggerEntry>> ProcessLibMaterial(ILibMaterial libMaterial)
|
||||
{
|
||||
List<IShTableRow<ITraceLoggerEntry>> rows = new();
|
||||
@@ -76,7 +80,6 @@ namespace StructureHelperLogics.Models.Materials
|
||||
rows.Add(ndmRow);
|
||||
return rows;
|
||||
}
|
||||
|
||||
private void Check()
|
||||
{
|
||||
if (Collection is null)
|
||||
@@ -84,7 +87,6 @@ namespace StructureHelperLogics.Models.Materials
|
||||
throw new StructureHelperException(ErrorStrings.ParameterIsNull + ": Collection of primitives");
|
||||
}
|
||||
}
|
||||
|
||||
private IShTableRow<ITraceLoggerEntry> GetHeader(IHeadMaterial headMaterial)
|
||||
{
|
||||
const CellRole cellRole = CellRole.Header;
|
||||
@@ -263,10 +265,5 @@ namespace StructureHelperLogics.Models.Materials
|
||||
return rows;
|
||||
}
|
||||
|
||||
public void AddEntriesToTraceLogger(IShiftTraceLogger traceLogger)
|
||||
{
|
||||
var entries = GetTraceEntries();
|
||||
entries.ForEach(x => traceLogger?.AddEntry(x));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses
|
||||
{
|
||||
public class ExportForcesResultToCSVLogic : ExportToCSVLogicBase
|
||||
{
|
||||
private const string errorString = "-error-";
|
||||
IForcesResults results;
|
||||
|
||||
public ExportForcesResultToCSVLogic(IForcesResults results)
|
||||
@@ -45,14 +46,14 @@ namespace StructureHelperLogics.NdmCalculations.Analyses
|
||||
}
|
||||
string[] newLine =
|
||||
{
|
||||
item.DesignForceTuple.LimitState.ToString(),
|
||||
item.DesignForceTuple.CalcTerm.ToString(),
|
||||
tuple.Mx.ToString(),
|
||||
tuple.My.ToString(),
|
||||
tuple.Nz.ToString(),
|
||||
strainMatrix?.Kx.ToString(),
|
||||
strainMatrix?.Ky.ToString(),
|
||||
strainMatrix?.EpsZ.ToString()
|
||||
item.DesignForceTuple.LimitState.ToString() ?? errorString,
|
||||
item.DesignForceTuple.CalcTerm.ToString() ?? errorString,
|
||||
tuple.Mx.ToString() ?? errorString,
|
||||
tuple.My.ToString() ?? errorString,
|
||||
tuple.Nz.ToString() ?? errorString,
|
||||
strainMatrix?.Kx.ToString() ?? errorString,
|
||||
strainMatrix?.Ky.ToString() ?? errorString,
|
||||
strainMatrix?.EpsZ.ToString() ?? errorString
|
||||
};
|
||||
output.AppendLine(string.Join(separator, newLine));
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CrackResult : IResult
|
||||
public class CrackResult : ICrackResult
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public List<ITupleCrackResult> TupleResults {get;set;}
|
||||
public List<ITupleCrackResult> TupleResults { get; set; }
|
||||
public CrackResult()
|
||||
{
|
||||
TupleResults = new();
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface ICrackResult : IResult
|
||||
{
|
||||
List<ITupleCrackResult> TupleResults { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class ExportCrackResultToCSVLogic : ExportToCSVLogicBase
|
||||
{
|
||||
private const string errorString = "-error-";
|
||||
private ICrackResult crackResult;
|
||||
|
||||
public ExportCrackResultToCSVLogic(ICrackResult crackResult)
|
||||
{
|
||||
this.crackResult = crackResult;
|
||||
}
|
||||
|
||||
public override void ExportHeadings()
|
||||
{
|
||||
string[] headings =
|
||||
{
|
||||
"Action name",
|
||||
"Long Nz",
|
||||
"Long Mx",
|
||||
"Long My",
|
||||
"Long CrackWidth",
|
||||
"Long UltimateCrackWidth",
|
||||
"Long IsGood",
|
||||
"Long Uf",
|
||||
"Short Nz",
|
||||
"Short Mx",
|
||||
"Short My",
|
||||
"Short CrackWidth",
|
||||
"Short UltimateCrackWidth",
|
||||
"Short IsGood",
|
||||
"Short Uf",
|
||||
};
|
||||
output.AppendLine(string.Join(separator, headings));
|
||||
}
|
||||
public override void ExportBoby()
|
||||
{
|
||||
foreach (var item in crackResult.TupleResults)
|
||||
{
|
||||
//if (item.IsValid == true)
|
||||
{
|
||||
string[] newLine =
|
||||
{
|
||||
item?.InputData?.TupleName ?? errorString,
|
||||
item?.InputData?.LongTermTuple?.Nz.ToString() ?? errorString,
|
||||
item?.InputData?.LongTermTuple?.Mx.ToString() ?? errorString,
|
||||
item?.InputData?.LongTermTuple?.My.ToString() ?? errorString,
|
||||
item?.LongTermResult?.CrackWidth.ToString() ?? errorString,
|
||||
item?.LongTermResult ?.UltimateCrackWidth.ToString() ?? errorString,
|
||||
item?.LongTermResult ?.IsCrackLessThanUltimate.ToString() ?? errorString,
|
||||
(item?.LongTermResult ?.CrackWidth / item?.LongTermResult?.UltimateCrackWidth).ToString() ?? errorString,
|
||||
item?.InputData?.ShortTermTuple?.Nz.ToString() ?? errorString,
|
||||
item?.InputData?.ShortTermTuple?.Mx.ToString() ?? errorString,
|
||||
item ?.InputData?.ShortTermTuple?.My.ToString() ?? errorString,
|
||||
item?.ShortTermResult?.CrackWidth.ToString() ?? errorString,
|
||||
item?.ShortTermResult?.UltimateCrackWidth.ToString() ?? errorString,
|
||||
item?.ShortTermResult?.IsCrackLessThanUltimate.ToString() ?? errorString,
|
||||
(item?.ShortTermResult?.CrackWidth / item?.ShortTermResult?.UltimateCrackWidth).ToString() ?? errorString,
|
||||
};
|
||||
output.AppendLine(string.Join(separator, newLine));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,4 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\Materials\DTOs\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user