Fix beam shear force calculator
This commit is contained in:
@@ -15,6 +15,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public string? Description { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public LimitStates LimitState { get; set; }
|
||||
public IBeamShearSection Section { get; set; }
|
||||
public IStirrup Stirrup { get; set; }
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public IBeamShearAction BeamShearAction { get; set; }
|
||||
public List<IBeamShearSectionLogicResult> SectionResults { get; set; } = new();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -18,6 +19,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public IResult Result => result;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public bool ShowTraceData { get; set; } = false;
|
||||
|
||||
public BeamShearCalculator(Guid id)
|
||||
{
|
||||
@@ -34,6 +36,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
public void Run()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
PrepareNewResult();
|
||||
//PrepareInputData();
|
||||
try
|
||||
@@ -82,7 +85,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
result = new BeamShearCalculatorResult()
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty
|
||||
Description = string.Empty,
|
||||
InputData = InputData
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -12,10 +13,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShearCalculatorLogic : IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult>
|
||||
{
|
||||
private const LimitStates CollapsLimitState = LimitStates.ULS;
|
||||
private const LimitStates CollapseLimitState = LimitStates.ULS;
|
||||
private IBeamShearCalculatorResult result;
|
||||
private IBeamShearSectionLogic beamShearSectionLogic;
|
||||
private List<IBeamShearSectionLogicInputData> sectionInputDatas;
|
||||
private List<IBeamShearActionResult> actionResults;
|
||||
private IBeamShearCalculatorInputData inputData;
|
||||
private List<CalcTerms> calcTerms = new() { CalcTerms.LongTerm, CalcTerms.ShortTerm };
|
||||
|
||||
@@ -29,13 +30,14 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
public IBeamShearCalculatorResult GetResultByInputData(IBeamShearCalculatorInputData inputData)
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
this.inputData = inputData;
|
||||
PrepareNewResult();
|
||||
InitializeStrategies();
|
||||
try
|
||||
{
|
||||
GetSectionInputDatas();
|
||||
CalculateResult();
|
||||
GetSections();
|
||||
result.ActionResults = actionResults;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -46,20 +48,17 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
return result;
|
||||
}
|
||||
|
||||
private void CalculateResult()
|
||||
private IBeamShearSectionLogicResult CalculateResult(IBeamShearSectionLogicInputData sectionInputData)
|
||||
{
|
||||
foreach (var sectionInputData in sectionInputDatas)
|
||||
{
|
||||
beamShearSectionLogic.InputData = sectionInputData;
|
||||
beamShearSectionLogic.Run();
|
||||
var sectionResult = beamShearSectionLogic.Result as IBeamShearSectionLogicResult;
|
||||
//result.ActionResults.Add(sectionResult);
|
||||
}
|
||||
beamShearSectionLogic.InputData = sectionInputData;
|
||||
beamShearSectionLogic.Run();
|
||||
var sectionResult = beamShearSectionLogic.Result as IBeamShearSectionLogicResult;
|
||||
return sectionResult;
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
beamShearSectionLogic ??= new BeamShearSectionLogic();
|
||||
beamShearSectionLogic ??= new BeamShearSectionLogic(TraceLogger);
|
||||
}
|
||||
|
||||
private void PrepareNewResult()
|
||||
@@ -71,40 +70,92 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
};
|
||||
}
|
||||
|
||||
private void GetSectionInputDatas()
|
||||
private void GetSections()
|
||||
{
|
||||
sectionInputDatas = new();
|
||||
foreach (var beamShearSection in inputData.Sections)
|
||||
actionResults = new();
|
||||
foreach (var beamShearAction in inputData.Actions)
|
||||
{
|
||||
List<IInclinedSection> inclinedSections = GetInclinedSections(beamShearSection);
|
||||
foreach (var inclinedSection in inclinedSections)
|
||||
foreach (var calcTerm in calcTerms)
|
||||
{
|
||||
GetSections(inclinedSection);
|
||||
foreach (var section in inputData.Sections)
|
||||
{
|
||||
foreach (var stirrup in inputData.Stirrups)
|
||||
{
|
||||
List<IInclinedSection> inclinedSections = GetInclinedSections(section);
|
||||
List<IBeamShearSectionLogicInputData> sectionInputDatas = GetSectionInputDatas(beamShearAction, calcTerm, section, stirrup, inclinedSections);
|
||||
List<IBeamShearSectionLogicResult> sectionResults = GetSectionResults(sectionInputDatas);
|
||||
BeamShearActionResult actionResult = GetActionResult(beamShearAction, calcTerm, section, stirrup, sectionResults);
|
||||
actionResults.Add(actionResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void GetSections(IInclinedSection inclinedSection)
|
||||
private BeamShearActionResult GetActionResult(IBeamShearAction beamShearAction, CalcTerms calcTerm, IBeamShearSection section, IStirrup stirrup, List<IBeamShearSectionLogicResult> sectionResults)
|
||||
{
|
||||
foreach (var stirrup in inputData.Stirrups)
|
||||
BeamShearActionResult actionResult = PrepareNewActionResult(beamShearAction, calcTerm, section, stirrup);
|
||||
if (sectionResults.Any(x => x.IsValid == false))
|
||||
{
|
||||
foreach (var beamShearAction in inputData.Actions)
|
||||
actionResult.IsValid = false;
|
||||
if (actionResult.Description.Length > 0)
|
||||
{
|
||||
foreach (var calcTerm in calcTerms)
|
||||
{
|
||||
IForceTuple forceTuple = GetForceTupleByShearAction(beamShearAction, inclinedSection, CollapsLimitState, calcTerm);
|
||||
BeamShearSectionLogicInputData newInputData = new(Guid.NewGuid())
|
||||
{
|
||||
InclinedSection = inclinedSection,
|
||||
Stirrup = stirrup,
|
||||
ForceTuple = forceTuple,
|
||||
LimitState = CollapsLimitState,
|
||||
CalcTerm = calcTerm
|
||||
};
|
||||
sectionInputDatas.Add(newInputData);
|
||||
}
|
||||
actionResult.Description += "\n";
|
||||
}
|
||||
actionResult.Description += $"There are {sectionResults.Count(x => x.IsValid == false)} invalid section result(s)";
|
||||
}
|
||||
actionResult.SectionResults = sectionResults;
|
||||
return actionResult;
|
||||
}
|
||||
|
||||
private List<IBeamShearSectionLogicResult> GetSectionResults(List<IBeamShearSectionLogicInputData> sectionInputDatas)
|
||||
{
|
||||
List<IBeamShearSectionLogicResult> sectionResults = new();
|
||||
foreach (var item in sectionInputDatas)
|
||||
{
|
||||
IBeamShearSectionLogicResult sectionResult = CalculateResult(item);
|
||||
sectionResults.Add(sectionResult);
|
||||
}
|
||||
|
||||
return sectionResults;
|
||||
}
|
||||
|
||||
private List<IBeamShearSectionLogicInputData> GetSectionInputDatas(IBeamShearAction beamShearAction, CalcTerms calcTerm, IBeamShearSection section, IStirrup stirrup, List<IInclinedSection> inclinedSections)
|
||||
{
|
||||
List<IBeamShearSectionLogicInputData> sectionInputDatas = new();
|
||||
var material = section.Material;
|
||||
var strength = material.GetStrength(CollapseLimitState, calcTerm);
|
||||
foreach (var inclinedSection in inclinedSections)
|
||||
{
|
||||
inclinedSection.ConcreteCompressionStrength = strength.Compressive;
|
||||
inclinedSection.ConcreteTensionStrength = strength.Tensile;
|
||||
IForceTuple forceTuple = GetForceTupleByShearAction(beamShearAction, inclinedSection, CollapseLimitState, calcTerm);
|
||||
BeamShearSectionLogicInputData newInputData = new(Guid.NewGuid())
|
||||
{
|
||||
InclinedSection = inclinedSection,
|
||||
Stirrup = stirrup,
|
||||
ForceTuple = forceTuple,
|
||||
LimitState = CollapseLimitState,
|
||||
CalcTerm = calcTerm
|
||||
};
|
||||
sectionInputDatas.Add(newInputData);
|
||||
}
|
||||
|
||||
return sectionInputDatas;
|
||||
}
|
||||
|
||||
private static BeamShearActionResult PrepareNewActionResult(IBeamShearAction beamShearAction, CalcTerms calcTerm, IBeamShearSection section, IStirrup stirrup)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty,
|
||||
BeamShearAction = beamShearAction,
|
||||
LimitState = CollapseLimitState,
|
||||
CalcTerm = calcTerm,
|
||||
Section = section,
|
||||
Stirrup = stirrup
|
||||
};
|
||||
}
|
||||
|
||||
private List<IInclinedSection> GetInclinedSections(IBeamShearSection beamShearSection)
|
||||
|
||||
@@ -6,10 +6,16 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class BeamShearCalculatorResult : IBeamShearCalculatorResult
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool IsValid { get; set; } = true;
|
||||
/// <inheritdoc/>
|
||||
public string? Description { get; set; } = string.Empty;
|
||||
/// <inheritdoc/>
|
||||
public IBeamShearCalculatorInputData InputData { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public List<IBeamShearActionResult> ActionResults { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShearSectionCalculatorResult : IBeamShearSectionLogicResult
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public string? Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,82 @@
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperLogics.Models.BeamShears.Logics;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShearSectionLogic : IBeamShearSectionLogic
|
||||
{
|
||||
private IBeamShearSectionLogicResult result;
|
||||
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()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
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.Stirrup, InputData.InclinedSection, TraceLogger);
|
||||
}
|
||||
|
||||
private void PrepareNewResult()
|
||||
{
|
||||
result = new()
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty,
|
||||
InputData = InputData
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShearSectionLogicResult : IBeamShearSectionLogicResult
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public IBeamShearSectionLogicInputData InputData { get; set; }
|
||||
public double ConcreteStrength { get; set; }
|
||||
public double StirrupStrength { get; set; }
|
||||
public double TotalStrength { get; set; }
|
||||
public double FactorOfUsing { get => InputData.ForceTuple.Qy / TotalStrength; }
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
LimitStates LimitState { get; set; }
|
||||
CalcTerms CalcTerm { get; set; }
|
||||
IBeamShearSection Section { get; set; }
|
||||
IStirrup Stirrup { get; set; }
|
||||
IBeamShearAction BeamShearAction { get; set; }
|
||||
List<IBeamShearSectionLogicResult> SectionResults { get; set; }
|
||||
}
|
||||
|
||||
@@ -10,5 +10,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public interface IBeamShearCalculator : ICalculator
|
||||
{
|
||||
IBeamShearCalculatorInputData InputData { get; set; }
|
||||
bool ShowTraceData { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,12 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements group of results for beam shear calculator
|
||||
/// </summary>
|
||||
public interface IBeamShearCalculatorResult : IResult
|
||||
{
|
||||
IBeamShearCalculatorInputData InputData {get;set;}
|
||||
List<IBeamShearActionResult> ActionResults { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public interface IBeamShearSectionLogicResult : IResult
|
||||
{
|
||||
IBeamShearSectionLogicInputData InputData { get; set; }
|
||||
public double ConcreteStrength { get; set; }
|
||||
public double StirrupStrength { get; set; }
|
||||
public double TotalStrength { get; set; }
|
||||
public double FactorOfUsing { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,14 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// Coordinate of end of inclined cross-section
|
||||
/// </summary>
|
||||
double EndCoord { get; set; }
|
||||
/// <summary>
|
||||
/// Strength of concrete in compression, Pa
|
||||
/// </summary>
|
||||
double ConcreteCompressionStrength { get; set; }
|
||||
/// <summary>
|
||||
/// Strength of concrete in tension, Pa
|
||||
/// </summary>
|
||||
double ConcreteTensionStrength { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <summary>
|
||||
/// Properties of concrete cross-section effectiveness for shear
|
||||
/// Implements properties of concrete cross-section effectiveness for shear
|
||||
/// </summary>
|
||||
public interface ISectionEffectiveness
|
||||
{
|
||||
|
||||
@@ -19,5 +19,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public double StartCoord { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double EndCoord { get; set; }
|
||||
public double ConcreteCompressionStrength { get; set; }
|
||||
public double ConcreteTensionStrength { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; };
|
||||
InitializeStrategies();
|
||||
hasActionUpdateStrategy?.Update(targetObject, sourceObject);
|
||||
hasSectionsUpdateStrategy?.Update(targetObject, sourceObject);
|
||||
hasStirrupsUpdateStrategy?.Update(targetObject, sourceObject);
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; };
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.ShowTraceData = sourceObject.ShowTraceData;
|
||||
targetObject.InputData ??= new BeamShearCalculatorInputData(Guid.NewGuid());
|
||||
InitializeStrategies();
|
||||
inputDataUpdateStrategy.Update(targetObject.InputData, sourceObject.InputData);
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperLogics.Models.BeamShears.Logics;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
internal class BeamSectionShearStrengthLogic : IBeamShearStrenghLogic
|
||||
public class ConcreteStrengthLogic : IBeamShearStrenghLogic
|
||||
{
|
||||
private readonly double longitudinalForce;
|
||||
private readonly ISectionEffectiveness sectionEffectiveness;
|
||||
private readonly double concreteStrength;
|
||||
private readonly IInclinedSection inclinedSection;
|
||||
private IGetLongitudinalForceFactorLogic getLongitudinalForceFactorLogic;
|
||||
|
||||
private double crackLength;
|
||||
|
||||
public BeamSectionShearStrengthLogic(
|
||||
public ConcreteStrengthLogic(
|
||||
ISectionEffectiveness sectionEffectiveness,
|
||||
double concreteStrength,
|
||||
IInclinedSection inclinedSection,
|
||||
double longitudinalForce,
|
||||
IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.sectionEffectiveness = sectionEffectiveness;
|
||||
this.concreteStrength = concreteStrength;
|
||||
this.inclinedSection = inclinedSection;
|
||||
this.longitudinalForce = longitudinalForce;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
@@ -26,18 +29,34 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
public double GetShearStrength()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
InitializeStrategies();
|
||||
TraceLogger?.AddMessage($"Base shape factor = {sectionEffectiveness.BaseShapeFactor}, (dimensionless)");
|
||||
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)");
|
||||
RestrictCrackLength();
|
||||
double concreteMoment = sectionEffectiveness.BaseShapeFactor * sectionEffectiveness.ShapeFactor * concreteStrength * inclinedSection.WebWidth * inclinedSection.EffectiveDepth * inclinedSection.EffectiveDepth;
|
||||
double shearStrength = concreteMoment / crackLength;
|
||||
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)");
|
||||
return shearStrength;
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
getLongitudinalForceFactorLogic ??= new GetLogitudinalForceFactorLogic(TraceLogger?.GetSimilarTraceLogger(100));
|
||||
}
|
||||
|
||||
private void SetLongitudinalForce()
|
||||
{
|
||||
getLongitudinalForceFactorLogic.LongitudinalForce = longitudinalForce;
|
||||
getLongitudinalForceFactorLogic.InclinedSection = inclinedSection;
|
||||
}
|
||||
|
||||
private void RestrictCrackLength()
|
||||
{
|
||||
double maxCrackLength = sectionEffectiveness.MaxCrackLengthRatio * inclinedSection.EffectiveDepth;
|
||||
@@ -49,7 +68,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
return;
|
||||
}
|
||||
double minCrackLength = sectionEffectiveness.MinCrackLengthRatio * inclinedSection.EffectiveDepth;
|
||||
if (crackLength > minCrackLength)
|
||||
if (crackLength < minCrackLength)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Crack length c = {crackLength} is less than minimum crack length = {minCrackLength}");
|
||||
crackLength = minCrackLength;
|
||||
@@ -51,7 +51,8 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
for (int i = 0; i < inputData.StepCount + 1; i++)
|
||||
{
|
||||
double endCoord = step * i;
|
||||
coordinates.Add(endCoord);
|
||||
double roundedEndCoord = Math.Round(endCoord, 6);
|
||||
coordinates.Add(roundedEndCoord);
|
||||
}
|
||||
}
|
||||
private void Check()
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
{
|
||||
public class GetLogitudinalForceFactorLogic : IGetLongitudinalForceFactorLogic
|
||||
{
|
||||
private const double fstRatioInCompression = 1.25;
|
||||
private const double sndRationInCompression = 0.75;
|
||||
private double sectionArea;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public IInclinedSection InclinedSection { get; set; }
|
||||
public double LongitudinalForce { get; set; }
|
||||
|
||||
public GetLogitudinalForceFactorLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
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");
|
||||
Check();
|
||||
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();
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger?.AddMessage("Longitudinal force N={LongitudinalForce}(N) is positive (tension)", TraceLogStatuses.Service);
|
||||
return GetPosForceResult();
|
||||
}
|
||||
}
|
||||
|
||||
private void Check()
|
||||
{
|
||||
if (InclinedSection is null)
|
||||
{
|
||||
string errorString = ErrorStrings.DataIsInCorrect + "Inclined section is null";
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
if (InclinedSection.WebWidth <= 0 || InclinedSection.FullDepth <= 0)
|
||||
{
|
||||
string errorString = ErrorStrings.DataIsInCorrect + $"Inclined section width = {InclinedSection.WebWidth}(m), and full depth = {InclinedSection.FullDepth}, but both of them must be greater than zero";
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
}
|
||||
|
||||
private double GetPosForceResult()
|
||||
{
|
||||
double stressInConcrete = LongitudinalForce / sectionArea;
|
||||
TraceLogger?.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)");
|
||||
double stressRatio = stressInConcrete / concreteStrength;
|
||||
TraceLogger?.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)");
|
||||
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)");
|
||||
double concreteStrength = InclinedSection.ConcreteCompressionStrength;
|
||||
TraceLogger?.AddMessage($"Concrete strength Rb = {concreteStrength}(Pa)");
|
||||
double stressRatio = stressInConcrete / concreteStrength;
|
||||
TraceLogger?.AddMessage($"Stress ratio rc = {stressInConcrete} / {concreteStrength} = {stressRatio}(dimensionless)");
|
||||
double factor;
|
||||
if (stressRatio < fstRatioInCompression)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Stress ratio rc = {stressRatio} < {fstRatioInCompression}");
|
||||
factor = 1 + stressRatio;
|
||||
}
|
||||
else if (stressRatio > sndRationInCompression)
|
||||
{
|
||||
factor = 5 * (1 - stressRatio);
|
||||
factor = Math.Max(factor, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
factor = 1;
|
||||
}
|
||||
TraceLogger?.AddMessage($"Factor value fi_n = {factor}(dimensionless)");
|
||||
return factor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
{
|
||||
/// <summary>
|
||||
/// Implement logic for calculation of bearing capacity of inclined section for shear
|
||||
@@ -0,0 +1,15 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
{
|
||||
public interface IGetLongitudinalForceFactorLogic : IGetFactorLogic
|
||||
{
|
||||
public double LongitudinalForce { get; set; }
|
||||
public IInclinedSection InclinedSection { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Services;
|
||||
using StructureHelperLogics.Models.BeamShears.Logics;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
@@ -8,14 +9,15 @@ using StructureHelperCommon.Services;
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class BeamShearStrengthByStirrupDensityLogic : IBeamShearStrenghLogic
|
||||
public class StirrupByDensityStrengthLogic : IBeamShearStrenghLogic
|
||||
{
|
||||
private const double minStirrupRatio = 0.25;
|
||||
private readonly IStirrupEffectiveness stirrupEffectiveness;
|
||||
private readonly IStirrupByDensity stirrupByDensity;
|
||||
private readonly IInclinedSection inclinedSection;
|
||||
|
||||
|
||||
public BeamShearStrengthByStirrupDensityLogic(
|
||||
public StirrupByDensityStrengthLogic(
|
||||
IStirrupEffectiveness stirrupEffectiveness,
|
||||
IStirrupByDensity stirrupByDensity,
|
||||
IInclinedSection inclinedSection,
|
||||
@@ -40,8 +42,16 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
TraceLogger?.AddMessage($"Max length of crack = {stirrupEffectiveness.MaxCrackLengthRatio} * {inclinedSection.EffectiveDepth} = {maxCrackLength}(m)");
|
||||
double finalCrackLength = Math.Min(crackLength, maxCrackLength);
|
||||
TraceLogger?.AddMessage($"Length of crack = Min({crackLength}, {maxCrackLength}) = {finalCrackLength}(m)");
|
||||
double strength = stirrupEffectiveness.StirrupShapeFactor * stirrupEffectiveness.StirrupPlacementFactor * finalCrackLength * stirrupByDensity.StirrupDensity;
|
||||
TraceLogger?.AddMessage($"Bearing capacity of stirrups V = {stirrupEffectiveness.StirrupShapeFactor} * {stirrupEffectiveness.StirrupPlacementFactor} * {finalCrackLength} * {stirrupByDensity.StirrupDensity} = {strength}(N)");
|
||||
double finalDensity = stirrupEffectiveness.StirrupShapeFactor * stirrupEffectiveness.StirrupPlacementFactor * stirrupByDensity.StirrupDensity;
|
||||
TraceLogger?.AddMessage($"Stirrups design density qsw = {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");
|
||||
finalDensity = 0;
|
||||
}
|
||||
double strength = finalDensity * finalCrackLength;
|
||||
TraceLogger?.AddMessage($"Bearing capacity of stirrups V = {finalDensity} * {finalCrackLength} = {strength}(N)");
|
||||
TraceLogger?.AddMessage("Calculation has been finished successfully", TraceLogStatuses.Debug);
|
||||
return strength;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears.Logics
|
||||
{
|
||||
public class StirrupByRebarStrengthLogic : IBeamShearStrenghLogic
|
||||
{
|
||||
private IStirrupEffectiveness stirrupEffectiveness;
|
||||
private IStirrupByRebar stirrupByRebar;
|
||||
private IInclinedSection inclinedSection;
|
||||
private StirrupByDensityStrengthLogic stirrupDensityStrengthLogic;
|
||||
private IConvertStrategy<IStirrupByDensity, IStirrupByRebar> convertStrategy;
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public StirrupByRebarStrengthLogic(
|
||||
IStirrupEffectiveness stirrupEffectiveness,
|
||||
IStirrupByRebar stirrupByRebar,
|
||||
IInclinedSection inclinedSection,
|
||||
StirrupByDensityStrengthLogic stirrupDensityStrengthLogic,
|
||||
IConvertStrategy<IStirrupByDensity, IStirrupByRebar> convertStrategy,
|
||||
IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.stirrupEffectiveness = stirrupEffectiveness;
|
||||
this.stirrupByRebar = stirrupByRebar;
|
||||
this.inclinedSection = inclinedSection;
|
||||
this.stirrupDensityStrengthLogic = stirrupDensityStrengthLogic;
|
||||
this.convertStrategy = convertStrategy;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public StirrupByRebarStrengthLogic(
|
||||
IStirrupEffectiveness stirrupEffectiveness,
|
||||
IStirrupByRebar stirrupByRebar,
|
||||
IInclinedSection inclinedSection,
|
||||
IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.stirrupEffectiveness = stirrupEffectiveness;
|
||||
this.stirrupByRebar = stirrupByRebar;
|
||||
this.inclinedSection = inclinedSection;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public double GetShearStrength()
|
||||
{
|
||||
InitializeStrategies();
|
||||
double shearStrength = stirrupDensityStrengthLogic.GetShearStrength();
|
||||
return shearStrength;
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
{
|
||||
convertStrategy ??= new StirrupByRebarToDensityConvertStrategy(TraceLogger);
|
||||
IStirrupByDensity stirrupByDensity = convertStrategy.Convert(stirrupByRebar);
|
||||
stirrupDensityStrengthLogic ??= new(stirrupEffectiveness, stirrupByDensity, inclinedSection, TraceLogger);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,11 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public Dictionary<(Guid id, Type type), ISaveable> ReferenceDictionary { get; set; }
|
||||
public IShiftTraceLogger TraceLogger { get; set; }
|
||||
|
||||
public StirrupByRebarToDensityConvertStrategy(IShiftTraceLogger traceLogger)
|
||||
{
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public StirrupByRebarToDensityConvertStrategy(IUpdateStrategy<IStirrup> updateStrategy, IShiftTraceLogger traceLogger)
|
||||
{
|
||||
this.updateStrategy = updateStrategy;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
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
|
||||
{
|
||||
internal class StirrupStrengthLogic : IBeamShearStrenghLogic
|
||||
{
|
||||
private IStirrup stirrup;
|
||||
private IInclinedSection inclinedSection;
|
||||
private IBeamShearStrenghLogic stirrupDensityStrengthLogic;
|
||||
|
||||
public StirrupStrengthLogic(IStirrup stirrup, IInclinedSection inclinedSection, IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.stirrup = stirrup;
|
||||
this.inclinedSection = inclinedSection;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public double GetShearStrength()
|
||||
{
|
||||
var stirrupEffectiveness = StirrupEffectivenessFactory.GetEffectiveness(BeamShearSectionType.Rectangle);
|
||||
if (stirrup is IStirrupByDensity stirrupByDensity)
|
||||
{
|
||||
TraceLogger?.AddMessage("Stirrups type is stirrup by density");
|
||||
stirrupDensityStrengthLogic = new StirrupByDensityStrengthLogic(stirrupEffectiveness, stirrupByDensity, inclinedSection,TraceLogger);
|
||||
return stirrupDensityStrengthLogic.GetShearStrength();
|
||||
}
|
||||
else if (stirrup is IStirrupByRebar stirrupByRebar)
|
||||
{
|
||||
TraceLogger?.AddMessage("Stirrups type is stirrup by rebar");
|
||||
stirrupDensityStrengthLogic = new StirrupByRebarStrengthLogic(stirrupEffectiveness, stirrupByRebar, inclinedSection, TraceLogger);
|
||||
return stirrupDensityStrengthLogic.GetShearStrength();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(stirrup));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
private readonly List<IMaterialLogic> materialLogics;
|
||||
private LMBuilders.ConcreteOptions lmOptions;
|
||||
private IMaterialOptionLogic optionLogic;
|
||||
private IFactorLogic factorLogic => new FactorLogic(SafetyFactors);
|
||||
private IMaterialFactorLogic factorLogic => new MaterialFactorLogic(SafetyFactors);
|
||||
private LMLogic.ITrueStrengthLogic strengthLogic;
|
||||
private IUpdateStrategy<IConcreteLibMaterial> updateStrategy = new ConcreteLibUpdateStrategy();
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
const double gammaF2Max = 0.9d;
|
||||
double gammaF2;
|
||||
IFactorLogic factorLogic = new FactorLogic(SafetyFactors);
|
||||
IMaterialFactorLogic factorLogic = new MaterialFactorLogic(SafetyFactors);
|
||||
var factors = factorLogic.GetTotalFactor(LimitStates.ULS, CalcTerms.ShortTerm);
|
||||
var rf = TensileStrength * factors.Tensile;
|
||||
var epsUlt = rf / Modulus;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
IMaterial material = new Material();
|
||||
material.InitModulus = elasticMaterial.Modulus;
|
||||
IFactorLogic factorLogic = new FactorLogic(elasticMaterial.SafetyFactors);
|
||||
IMaterialFactorLogic factorLogic = new MaterialFactorLogic(elasticMaterial.SafetyFactors);
|
||||
var factors = factorLogic.GetTotalFactor(limitState, calcTerm);
|
||||
parameters = new List<double>()
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
const MaterialTypes materialType = MaterialTypes.Reinforcement;
|
||||
|
||||
private IFactorLogic factorLogic => new FactorLogic(SafetyFactors);
|
||||
private IMaterialFactorLogic factorLogic => new MaterialFactorLogic(SafetyFactors);
|
||||
private LoaderMaterialLogics.ITrueStrengthLogic strengthLogic;
|
||||
private readonly List<IMaterialLogic> materialLogics;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user