Add rebar section logic
This commit is contained in:
@@ -1,10 +1,6 @@
|
|||||||
using StructureHelper.Windows.ViewModels;
|
using StructureHelper.Windows.MainWindow.Materials;
|
||||||
|
using StructureHelper.Windows.ViewModels;
|
||||||
using StructureHelperLogics.Models.BeamShears;
|
using StructureHelperLogics.Models.BeamShears;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.BeamShears
|
namespace StructureHelper.Windows.BeamShears
|
||||||
{
|
{
|
||||||
@@ -63,9 +59,27 @@ namespace StructureHelper.Windows.BeamShears
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double LegCount
|
||||||
|
{
|
||||||
|
get => stirrupByInclinedRebar.LegCount;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value < 0.0) { value = 0.0; }
|
||||||
|
stirrupByInclinedRebar.LegCount = value;
|
||||||
|
OnPropertyChanged(nameof(LegCount));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public RebarSectionViewModel RebarSectionViewModel {get;}
|
||||||
|
|
||||||
public StirrupByInclinedRebarViewModel(IStirrupByInclinedRebar stirrupByInclinedRebar)
|
public StirrupByInclinedRebarViewModel(IStirrupByInclinedRebar stirrupByInclinedRebar)
|
||||||
{
|
{
|
||||||
this.stirrupByInclinedRebar = stirrupByInclinedRebar;
|
this.stirrupByInclinedRebar = stirrupByInclinedRebar;
|
||||||
|
RebarSectionViewModel = new(this.stirrupByInclinedRebar.RebarSection)
|
||||||
|
{
|
||||||
|
MinRebarDiameter = 0.003,
|
||||||
|
MaxRebarDiameter = 0.032
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,35 +9,52 @@
|
|||||||
d:DataContext="{d:DesignInstance local:StirrupByInclinedRebarViewModel}"
|
d:DataContext="{d:DesignInstance local:StirrupByInclinedRebarViewModel}"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Inclined rebar" Height="450" Width="400" MaxHeight="450" MaxWidth="400" MinHeight="450" MinWidth="400" WindowStartupLocation="CenterScreen">
|
Title="Inclined rebar" Height="450" Width="400" MaxHeight="450" MaxWidth="400" MinHeight="450" MinWidth="400" WindowStartupLocation="CenterScreen">
|
||||||
|
<Window.Resources>
|
||||||
|
<ResourceDictionary Source="/Infrastructure/UI/Resources/Materials.xaml"/>
|
||||||
|
</Window.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid>
|
<TabControl>
|
||||||
<Grid.ColumnDefinitions>
|
<TabItem Header="Main">
|
||||||
<ColumnDefinition/>
|
<Grid>
|
||||||
<ColumnDefinition/>
|
<Grid.ColumnDefinitions>
|
||||||
</Grid.ColumnDefinitions>
|
<ColumnDefinition/>
|
||||||
<Grid.RowDefinitions>
|
<ColumnDefinition/>
|
||||||
<RowDefinition Height="25"/>
|
</Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="25"/>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="25"/>
|
<RowDefinition Height="25"/>
|
||||||
<RowDefinition Height="25"/>
|
<RowDefinition Height="25"/>
|
||||||
<RowDefinition Height="25"/>
|
<RowDefinition Height="25"/>
|
||||||
<RowDefinition/>
|
<RowDefinition Height="25"/>
|
||||||
</Grid.RowDefinitions>
|
<RowDefinition Height="25"/>
|
||||||
<TextBlock Text="Name"/>
|
<RowDefinition Height="25"/>
|
||||||
<TextBox Grid.Column="1" Text="{Binding Name}"/>
|
<RowDefinition Height="25"/>
|
||||||
<TextBlock Grid.Row="1" Text="Start point coordinate"/>
|
<RowDefinition/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding StartCoordinate, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock Grid.Row="2" Text="Angle of inclination"/>
|
<TextBlock Text="Name"/>
|
||||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding AngleOfInclination, Converter={StaticResource PlainDouble}, ValidatesOnDataErrors=True}"/>
|
<TextBox Grid.Column="1" Text="{Binding Name}"/>
|
||||||
<TextBlock Grid.Row="3" Text="Distance to compressed edge"/>
|
<TextBlock Grid.Row="1" Text="Diameter"/>
|
||||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding CompressedGap, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding RebarSectionViewModel.Diameter, Converter={StaticResource LengthConverter},ValidatesOnDataErrors=True}"/>
|
||||||
<TextBlock Grid.Row="4" Text="Offset"/>
|
<TextBlock Grid.Row="2" Text="Number of legs"/>
|
||||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding OffSet, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
<TextBox Grid.Row="2" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding LegCount, Converter={StaticResource PlainDouble},ValidatesOnDataErrors=True}"/>
|
||||||
</Grid>
|
<TextBlock Grid.Row="3" Text="Start point coordinate"/>
|
||||||
|
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding StartCoordinate, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
||||||
|
<TextBlock Grid.Row="4" Text="Angle of inclination"/>
|
||||||
|
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding AngleOfInclination, Converter={StaticResource PlainDouble}, ValidatesOnDataErrors=True}"/>
|
||||||
|
<TextBlock Grid.Row="5" Text="Distance to compressed edge"/>
|
||||||
|
<TextBox Grid.Row="5" Grid.Column="1" Text="{Binding CompressedGap, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
||||||
|
<TextBlock Grid.Row="6" Text="Offset"/>
|
||||||
|
<TextBox Grid.Row="6" Grid.Column="1" Text="{Binding OffSet, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Material" DataContext="{Binding RebarSectionViewModel}">
|
||||||
|
<ContentControl ContentTemplate="{StaticResource ReinforcementMaterial}" Content="{Binding Material}"/>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
|
||||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
using StructureHelper.Infrastructure;
|
||||||
|
using StructureHelper.Windows.ViewModels.Materials;
|
||||||
|
using StructureHelperLogics.Models.Materials;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.MainWindow.Materials
|
||||||
|
{
|
||||||
|
public class RebarSectionViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
private readonly IRebarSection rebarSection;
|
||||||
|
|
||||||
|
public double MinRebarDiameter { get; set; } = 0.003;
|
||||||
|
public double MaxRebarDiameter { get; set; } = 0.050;
|
||||||
|
public ReinforcementViewModel Material { get; private set; }
|
||||||
|
public double Diameter
|
||||||
|
{
|
||||||
|
get => rebarSection.Diameter;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (value < MinRebarDiameter) { value = MinRebarDiameter; }
|
||||||
|
else if (value > MaxRebarDiameter) { value = MaxRebarDiameter; }
|
||||||
|
rebarSection.Diameter = value;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public RebarSectionViewModel(IRebarSection rebarSection)
|
||||||
|
{
|
||||||
|
this.rebarSection = rebarSection;
|
||||||
|
Material = new(this.rebarSection.Material) { MaterialLogicVisibility = false };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using StructureHelperLogics.Models.Materials;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -23,5 +24,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
/// Angle of inclination of rebar in degrees
|
/// Angle of inclination of rebar in degrees
|
||||||
/// </summary>
|
/// </summary>
|
||||||
double AngleOfInclination { get; set; }
|
double AngleOfInclination { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Number of legs of inclinated rebar
|
||||||
|
/// </summary>
|
||||||
|
double LegCount { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Cross-section of rebar
|
||||||
|
/// </summary>
|
||||||
|
IRebarSection RebarSection { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
checkResult += checkDensityLogic.CheckResult;
|
checkResult += checkDensityLogic.CheckResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Entity is IStirrupByRebar rebar)
|
else if (Entity is IStirrupByRebar rebar)
|
||||||
{
|
{
|
||||||
checkRebarLogic ??= new CheckStirrupsByRebarLogic(TraceLogger);
|
checkRebarLogic ??= new CheckStirrupsByRebarLogic(TraceLogger);
|
||||||
checkRebarLogic.Entity = rebar;
|
checkRebarLogic.Entity = rebar;
|
||||||
@@ -53,6 +53,14 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
result = false;
|
result = false;
|
||||||
checkResult += checkRebarLogic.CheckResult;
|
checkResult += checkRebarLogic.CheckResult;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (Entity is IStirrupGroup stirrupGroup)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (Entity is IStirrupByInclinedRebar inclinedRebar)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Models;
|
||||||
|
using StructureHelperLogics.Models.Materials;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
public class StirrupByInclinedRebarStrengthLogic : IBeamShearStrenghLogic
|
||||||
|
{
|
||||||
|
private readonly IStirrupByInclinedRebar inclinedRebar;
|
||||||
|
private readonly IInclinedSection inclinedSection;
|
||||||
|
private IRebarSectionStrengthLogic rebarSectionStrengthLogic;
|
||||||
|
private double angleInRad;
|
||||||
|
private double rebarStartPoint;
|
||||||
|
private double rebarHeight;
|
||||||
|
private double rebarEndPoint;
|
||||||
|
private double rebarTrueStartPoint;
|
||||||
|
private double rebarTrueEndPoint;
|
||||||
|
|
||||||
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
|
public StirrupByInclinedRebarStrengthLogic(IInclinedSection inclinedSection, IStirrupByInclinedRebar inclinedRebar, IShiftTraceLogger traceLogger)
|
||||||
|
{
|
||||||
|
this.inclinedSection = inclinedSection;
|
||||||
|
this.inclinedRebar = inclinedRebar;
|
||||||
|
TraceLogger = traceLogger;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public double GetShearStrength()
|
||||||
|
{
|
||||||
|
GetGeometry();
|
||||||
|
if (inclinedSection.StartCoord > rebarTrueEndPoint)
|
||||||
|
{
|
||||||
|
TraceLogger?.AddMessage($"Inclined section start point coordinate X = {inclinedSection.StartCoord} is greater than inclined rebar true end point x = {rebarTrueEndPoint}, inclined rebar has been ignored");
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
if (inclinedSection.EndCoord < rebarTrueStartPoint)
|
||||||
|
{
|
||||||
|
TraceLogger?.AddMessage($"Inclined section end point coordinate X = {inclinedSection.EndCoord} is less than inclined rebar true end point x = {rebarTrueStartPoint}, inclined rebar has been ignored");
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
return GetInclinedRebarStrength();
|
||||||
|
}
|
||||||
|
|
||||||
|
private double GetInclinedRebarStrength()
|
||||||
|
{
|
||||||
|
rebarSectionStrengthLogic ??= new RebarSectionStrengthLogic()
|
||||||
|
{
|
||||||
|
RebarStrengthFactor = 0.8,
|
||||||
|
MaxRebarStrength = 3e8,
|
||||||
|
LimitState = LimitStates.ULS,
|
||||||
|
CalcTerm = CalcTerms.ShortTerm,
|
||||||
|
TraceLogger = TraceLogger,
|
||||||
|
};
|
||||||
|
rebarSectionStrengthLogic.RebarSection = inclinedRebar.RebarSection;
|
||||||
|
double rebarStrength = rebarSectionStrengthLogic.GetRebarMaxTensileForce();
|
||||||
|
double inclinedRebarStrength = rebarStrength * Math.Sin(angleInRad) * inclinedRebar.LegCount;
|
||||||
|
TraceLogger?.AddMessage($"Inclinated rebar {inclinedRebar.Name}, start point {rebarStartPoint}(m), end point {rebarEndPoint}(m), angle of inclination {inclinedRebar.AngleOfInclination}(deg), number of legs {inclinedRebar.LegCount}");
|
||||||
|
TraceLogger?.AddMessage($"Force in inclined rebar = {rebarStrength}(N) * sin({inclinedRebar.AngleOfInclination}) * {inclinedRebar.LegCount} = {inclinedRebarStrength}(N)");
|
||||||
|
return inclinedRebarStrength;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GetGeometry()
|
||||||
|
{
|
||||||
|
angleInRad = inclinedRebar.AngleOfInclination / 180 * Math.PI;
|
||||||
|
rebarStartPoint = inclinedRebar.StartCoordinate;
|
||||||
|
rebarHeight = inclinedSection.EffectiveDepth - inclinedRebar.CompressedGap;
|
||||||
|
rebarEndPoint = rebarStartPoint + rebarHeight * Math.Cos(angleInRad);
|
||||||
|
rebarTrueStartPoint = rebarStartPoint + inclinedRebar.OffSet;
|
||||||
|
rebarTrueEndPoint = rebarEndPoint - inclinedRebar.OffSet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -39,14 +39,9 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
double area = Math.PI * source.Diameter * source.Diameter / 4d;
|
double area = Math.PI * source.Diameter * source.Diameter / 4d;
|
||||||
TraceLogger?.AddMessage($"Area of rebar = {Math.PI} * ({source.Diameter})^2 / 4 = {area}(m^2)");
|
TraceLogger?.AddMessage($"Area of rebar = {Math.PI} * ({source.Diameter})^2 / 4 = {area}(m^2)");
|
||||||
double materialStrength = source.Material.GetStrength(LimitStates.ULS, CalcTerms.ShortTerm).Tensile;
|
double minimizedStrength = GetRebarStrength(source);
|
||||||
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 spiralEffectiveness = 1;
|
double spiralEffectiveness = 1;
|
||||||
if (source.IsSpiral = true)
|
if (source.IsSpiral == true)
|
||||||
{
|
{
|
||||||
spiralEffectiveness = GetSpiralEffectiveness(source);
|
spiralEffectiveness = GetSpiralEffectiveness(source);
|
||||||
}
|
}
|
||||||
@@ -55,6 +50,17 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
return density;
|
return density;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double GetRebarStrength(IStirrupByRebar source)
|
||||||
|
{
|
||||||
|
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)");
|
||||||
|
return minimizedStrength;
|
||||||
|
}
|
||||||
|
|
||||||
private double GetSpiralEffectiveness(IStirrupByRebar source)
|
private double GetSpiralEffectiveness(IStirrupByRebar source)
|
||||||
{
|
{
|
||||||
if (inclinedSection is null)
|
if (inclinedSection is null)
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
internal class StirrupGroupStrengthLogic : IBeamShearStrenghLogic
|
||||||
|
{
|
||||||
|
private readonly IBeamShearSectionLogicInputData sourceInputData;
|
||||||
|
private IBeamShearSectionLogicInputData localInputData;
|
||||||
|
private IStirrupGroup stirrupGroup;
|
||||||
|
private IUpdateStrategy<IBeamShearSectionLogicInputData> inputDataUpdateStrategy;
|
||||||
|
|
||||||
|
public StirrupGroupStrengthLogic(IBeamShearSectionLogicInputData inputData, IStirrupGroup stirrupGroup, IShiftTraceLogger? traceLogger)
|
||||||
|
{
|
||||||
|
this.sourceInputData = inputData;
|
||||||
|
this.stirrupGroup = stirrupGroup;
|
||||||
|
TraceLogger = traceLogger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
|
public double GetShearStrength()
|
||||||
|
{
|
||||||
|
Check();
|
||||||
|
if (!stirrupGroup.Stirrups.Any()) { return 0.0; }
|
||||||
|
GetLocalInputData();
|
||||||
|
double shearStrength = 0;
|
||||||
|
foreach (var item in stirrupGroup.Stirrups)
|
||||||
|
{
|
||||||
|
localInputData.Stirrup = item;
|
||||||
|
var stirrupSrengthLogic = new StirrupStrengthLogic(localInputData, TraceLogger?.GetSimilarTraceLogger(50));
|
||||||
|
shearStrength += stirrupSrengthLogic.GetShearStrength();
|
||||||
|
}
|
||||||
|
TraceLogger?.AddMessage($"Total bearing capacity of group {stirrupGroup.Name} for shear Vtot = {shearStrength}(N)");
|
||||||
|
return shearStrength;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Check()
|
||||||
|
{
|
||||||
|
if (stirrupGroup is null)
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.ParameterIsNull + ": Stirrup group");
|
||||||
|
}
|
||||||
|
if (stirrupGroup.Stirrups is null)
|
||||||
|
{
|
||||||
|
throw new StructureHelperException(ErrorStrings.ParameterIsNull + ": Stirrups");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GetLocalInputData()
|
||||||
|
{
|
||||||
|
localInputData = new BeamShearSectionLogicInputData(Guid.Empty);
|
||||||
|
inputDataUpdateStrategy ??= new BeamShearSectionLogicInputDataUpdateStrategy();
|
||||||
|
inputDataUpdateStrategy.Update(localInputData, sourceInputData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,7 +8,9 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
private readonly IBeamShearSectionLogicInputData inputData;
|
private readonly IBeamShearSectionLogicInputData inputData;
|
||||||
private IStirrup stirrup => inputData.Stirrup;
|
private IStirrup stirrup => inputData.Stirrup;
|
||||||
private IInclinedSection inclinedSection => inputData.InclinedSection;
|
private IInclinedSection inclinedSection => inputData.InclinedSection;
|
||||||
private IBeamShearStrenghLogic stirrupDensityStrengthLogic;
|
private IBeamShearStrenghLogic stirrupByDensityStrengthLogic;
|
||||||
|
private IBeamShearStrenghLogic stirrupGroupStrengthLogic;
|
||||||
|
private IBeamShearStrenghLogic stirrupByInclinedRebarStrengthLogic;
|
||||||
|
|
||||||
public StirrupStrengthLogic(IBeamShearSectionLogicInputData inputData, IShiftTraceLogger? traceLogger)
|
public StirrupStrengthLogic(IBeamShearSectionLogicInputData inputData, IShiftTraceLogger? traceLogger)
|
||||||
{
|
{
|
||||||
@@ -21,17 +23,29 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
public double GetShearStrength()
|
public double GetShearStrength()
|
||||||
{
|
{
|
||||||
var stirrupEffectiveness = StirrupEffectivenessFactory.GetEffectiveness(BeamShearSectionType.Rectangle);
|
var stirrupEffectiveness = StirrupEffectivenessFactory.GetEffectiveness(BeamShearSectionType.Rectangle);
|
||||||
if (stirrup is IStirrupByDensity stirrupByDensity)
|
if (stirrup is IStirrupByRebar stirrupByRebar)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage("Stirrups type is stirrup by density");
|
TraceLogger?.AddMessage($"Stirrups type is stirrup by rebar {stirrupByRebar.Name}");
|
||||||
stirrupDensityStrengthLogic = new StirrupByDensityStrengthLogic(stirrupEffectiveness, stirrupByDensity, inclinedSection,TraceLogger);
|
stirrupByDensityStrengthLogic = new StirrupByRebarStrengthLogic(stirrupEffectiveness, stirrupByRebar, inclinedSection, inputData.ForceTuple, TraceLogger);
|
||||||
return stirrupDensityStrengthLogic.GetShearStrength();
|
return stirrupByDensityStrengthLogic.GetShearStrength();
|
||||||
}
|
}
|
||||||
else if (stirrup is IStirrupByRebar stirrupByRebar)
|
else if (stirrup is IStirrupGroup stirrupGroup)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage("Stirrups type is stirrup by rebar");
|
TraceLogger?.AddMessage($"Stirrups type is stirrupGroup {stirrupGroup.Name}");
|
||||||
stirrupDensityStrengthLogic = new StirrupByRebarStrengthLogic(stirrupEffectiveness, stirrupByRebar, inclinedSection, inputData.ForceTuple, TraceLogger);
|
stirrupGroupStrengthLogic ??= new StirrupGroupStrengthLogic(inputData, stirrupGroup, TraceLogger);
|
||||||
return stirrupDensityStrengthLogic.GetShearStrength();
|
return stirrupGroupStrengthLogic.GetShearStrength();
|
||||||
|
}
|
||||||
|
else if (stirrup is IStirrupByDensity stirrupByDensity)
|
||||||
|
{
|
||||||
|
TraceLogger?.AddMessage($"Stirrups type is stirrup by density {stirrupByDensity.Name}");
|
||||||
|
stirrupByDensityStrengthLogic = new StirrupByDensityStrengthLogic(stirrupEffectiveness, stirrupByDensity, inclinedSection,TraceLogger);
|
||||||
|
return stirrupByDensityStrengthLogic.GetShearStrength();
|
||||||
|
}
|
||||||
|
else if (stirrup is IStirrupByInclinedRebar inclinedRebar)
|
||||||
|
{
|
||||||
|
TraceLogger?.AddMessage($"Stirrups type is inclined rebar {inclinedRebar.Name}");
|
||||||
|
stirrupByInclinedRebarStrengthLogic ??= new StirrupByInclinedRebarStrengthLogic(inclinedSection, inclinedRebar, TraceLogger);
|
||||||
|
return stirrupByInclinedRebarStrengthLogic.GetShearStrength();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
public class BeamShearSectionLogicInputDataUpdateStrategy : IUpdateStrategy<IBeamShearSectionLogicInputData>
|
||||||
|
{
|
||||||
|
public void Update(IBeamShearSectionLogicInputData targetObject, IBeamShearSectionLogicInputData sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||||
|
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||||
|
targetObject.InclinedSection = sourceObject.InclinedSection;
|
||||||
|
targetObject.Stirrup = sourceObject.Stirrup;
|
||||||
|
targetObject.LimitState = sourceObject.LimitState;
|
||||||
|
targetObject.CalcTerm = sourceObject.CalcTerm;
|
||||||
|
targetObject.ForceTuple = sourceObject.ForceTuple;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Services;
|
using StructureHelperCommon.Services;
|
||||||
|
using StructureHelperLogics.Models.Materials;
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
@@ -18,6 +19,9 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
targetObject.StartCoordinate = sourceObject.StartCoordinate;
|
targetObject.StartCoordinate = sourceObject.StartCoordinate;
|
||||||
targetObject.OffSet = sourceObject.OffSet;
|
targetObject.OffSet = sourceObject.OffSet;
|
||||||
targetObject.AngleOfInclination = sourceObject.AngleOfInclination;
|
targetObject.AngleOfInclination = sourceObject.AngleOfInclination;
|
||||||
|
targetObject.LegCount = sourceObject.LegCount;
|
||||||
|
CheckObject.IsNull(sourceObject.RebarSection, "Rebar section");
|
||||||
|
targetObject.RebarSection = sourceObject.RebarSection.Clone() as IRebarSection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperLogics.Models.Materials;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -59,6 +60,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
angleOfInclination = value;
|
angleOfInclination = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <inheritdoc>
|
||||||
|
public IRebarSection RebarSection { get; set; } = new RebarSection(Guid.NewGuid());
|
||||||
|
/// <inheritdoc>
|
||||||
|
public double LegCount { get; set; } = 2;
|
||||||
|
|
||||||
public StirrupByInclinedRebar(Guid id)
|
public StirrupByInclinedRebar(Guid id)
|
||||||
{
|
{
|
||||||
|
|||||||
24
StructureHelperLogics/Models/Materials/IRebarSection.cs
Normal file
24
StructureHelperLogics/Models/Materials/IRebarSection.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Implements properies of cross-section of reinforcement bar
|
||||||
|
/// </summary>
|
||||||
|
public interface IRebarSection : ISaveable, ICloneable
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Material of rebar
|
||||||
|
/// </summary>
|
||||||
|
IReinforcementLibMaterial Material { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Diameter of rebar
|
||||||
|
/// </summary>
|
||||||
|
double Diameter { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
{
|
||||||
|
public interface IRebarSectionStrengthLogic : ILogic
|
||||||
|
{
|
||||||
|
IRebarSection RebarSection { get; set; }
|
||||||
|
IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
|
double GetRebarMaxTensileForce();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
{
|
||||||
|
public class RebarSectionStrengthLogic : IRebarSectionStrengthLogic
|
||||||
|
{
|
||||||
|
public double RebarStrengthFactor { get; set; } = 1;
|
||||||
|
public double MaxRebarStrength { get; set; } = double.PositiveInfinity;
|
||||||
|
/// <summary>
|
||||||
|
/// Limit state, default - ULS
|
||||||
|
/// </summary>
|
||||||
|
public LimitStates LimitState { get; set; } = LimitStates.ULS;
|
||||||
|
/// <summary>
|
||||||
|
/// Calc term, default - short term
|
||||||
|
/// </summary>
|
||||||
|
public CalcTerms CalcTerm { get; set; } = CalcTerms.ShortTerm;
|
||||||
|
public IRebarSection RebarSection { get; set; }
|
||||||
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
public double GetRebarMaxTensileForce()
|
||||||
|
{
|
||||||
|
double rebarArea = Math.PI * RebarSection.Diameter * RebarSection.Diameter / 4;
|
||||||
|
TraceLogger?.AddMessage($"Rebar area = {rebarArea}(m2)");
|
||||||
|
double materialStrength = RebarSection.Material.GetStrength(LimitState, CalcTerm).Tensile;
|
||||||
|
TraceLogger?.AddMessage($"Stirrup material strength Rsw = {materialStrength}");
|
||||||
|
double rebarStrength = RebarStrengthFactor * materialStrength;
|
||||||
|
TraceLogger?.AddMessage($"Strength of rebar Rs = {RebarStrengthFactor} * {materialStrength} = {rebarStrength}(Pa)");
|
||||||
|
double minimizedStrength = Math.Min(rebarStrength, MaxRebarStrength);
|
||||||
|
TraceLogger?.AddMessage($"Strength of rebar Rs = Min({rebarStrength}, {MaxRebarStrength})= {minimizedStrength}(Pa)");
|
||||||
|
double rebarForce = minimizedStrength * rebarArea;
|
||||||
|
TraceLogger?.AddMessage($"Force in rebar Ns = {minimizedStrength}(Pa) * {rebarArea}(m2) = {rebarForce}");
|
||||||
|
return rebarForce;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
{
|
||||||
|
public class RebarSectionUpdateStrategy : IUpdateStrategy<IRebarSection>
|
||||||
|
{
|
||||||
|
public void Update(IRebarSection targetObject, IRebarSection sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(sourceObject);
|
||||||
|
CheckObject.IsNull(targetObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||||
|
CheckObject.IsNull(sourceObject.Material);
|
||||||
|
targetObject.Material = sourceObject.Material.Clone() as IReinforcementLibMaterial;
|
||||||
|
targetObject.Diameter = sourceObject.Diameter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
52
StructureHelperLogics/Models/Materials/RebarSection.cs
Normal file
52
StructureHelperLogics/Models/Materials/RebarSection.cs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.Materials
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public class RebarSection : IRebarSection
|
||||||
|
{
|
||||||
|
private const double minRebarDiameter = 0.001;
|
||||||
|
private const double maxRebarDiameter = 0.050;
|
||||||
|
private double diameter;
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public Guid Id { get;}
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public IReinforcementLibMaterial Material { get; set; }
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public double Diameter
|
||||||
|
{
|
||||||
|
get => diameter; set
|
||||||
|
{
|
||||||
|
if (value < minRebarDiameter)
|
||||||
|
{
|
||||||
|
throw new StructureHelperException($"Diameter of stirrup must not be less than {minRebarDiameter * 1000}mm, but was {value}");
|
||||||
|
}
|
||||||
|
if (value > maxRebarDiameter)
|
||||||
|
{
|
||||||
|
throw new StructureHelperException($"Diameter of stirrup must be less or equal than {maxRebarDiameter * 1000}mm, but was {value}");
|
||||||
|
}
|
||||||
|
diameter = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public RebarSection(Guid id)
|
||||||
|
{
|
||||||
|
Id = id;
|
||||||
|
Diameter = 0.008;
|
||||||
|
Material = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Reinforcement400).HelperMaterial as IReinforcementLibMaterial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object Clone()
|
||||||
|
{
|
||||||
|
var newItem = new RebarSection(Guid.NewGuid());
|
||||||
|
var logic = new RebarSectionUpdateStrategy();
|
||||||
|
logic.Update(newItem, this);
|
||||||
|
return newItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user