Crack width calculation was added
This commit is contained in:
@@ -13,7 +13,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CrackForceCalculator : ICalculator
|
||||
{
|
||||
static readonly CrackedLogic crackedLogic = new();
|
||||
private CrackedLogic crackedLogic;
|
||||
ExpSofteningLogic softeningLogic = new();
|
||||
static readonly CrackStrainLogic crackStrainLogic = new();
|
||||
static readonly SofteningFactorLogic softeningFactorLogic = new();
|
||||
@@ -30,13 +30,14 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public CrackForceCalculator(IForceTupleCalculator forceTupleCalculator)
|
||||
public CrackForceCalculator(CrackedLogic crackedLogic)
|
||||
{
|
||||
StartTuple ??= new ForceTuple();
|
||||
Accuracy ??= new Accuracy() { IterationAccuracy = 0.0001d, MaxIterationCount = 10000 };
|
||||
this.forceTupleCalculator = forceTupleCalculator;
|
||||
forceTupleCalculator = new ForceTupleCalculator();
|
||||
this.crackedLogic = crackedLogic;
|
||||
}
|
||||
public CrackForceCalculator() : this(new ForceTupleCalculator())
|
||||
public CrackForceCalculator() : this(new CrackedLogic())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -20,10 +20,22 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage("Method of crack width calculation based on SP 63.13330.2018");
|
||||
CheckOptions();
|
||||
TraceLogger?.AddMessage($"Term factor fi1= {InputData.Length}", TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage($"Bond factor fi2= {inputData.BondFactor}", TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage($"Stress state factor fi3= {inputData.StressStateFactor}", TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage($"PsiS factor PsiS= {inputData.PsiSFactor}", TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage($"Length between cracks Ls = {inputData.Length}", TraceLogStatuses.Service);
|
||||
//check if strain of concrete greater than strain of rebar
|
||||
if (inputData.ConcreteStrain > inputData.RebarStrain) { return 0d; }
|
||||
double width = (inputData.RebarStrain - inputData.ConcreteStrain) * inputData.Length;
|
||||
double rebarElongation = inputData.RebarStrain - inputData.ConcreteStrain;
|
||||
if (rebarElongation < 0d)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Elongation of rebar is negative, may be rebar is under compression, width of crack a,crc = 0(dimensionless)");
|
||||
return 0d;
|
||||
}
|
||||
TraceLogger?.AddMessage($"Rebar elongation Epsilon = {inputData.RebarStrain} - {inputData.ConcreteStrain} = {rebarElongation}(dimensionless)");
|
||||
double width = rebarElongation * inputData.Length;
|
||||
width *= inputData.TermFactor * inputData.BondFactor * inputData.StressStateFactor * inputData.PsiSFactor;
|
||||
TraceLogger?.AddMessage($"Width of crack a,crc = {width}(m)");
|
||||
return width;
|
||||
}
|
||||
|
||||
@@ -37,34 +49,33 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
inputData = InputData as CrackWidthLogicInputDataSP63;
|
||||
if (inputData.Length <=0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": length between cracks L={inputData.Length} must be greate than zero";
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": length between cracks Ls={inputData.Length} must be greate than zero";
|
||||
}
|
||||
if (inputData.TermFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Term factor {inputData.TermFactor} must be greate than zero";
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Term factor fi1 {inputData.TermFactor} must be greate than zero";
|
||||
|
||||
}
|
||||
if (inputData.BondFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Bond factor {inputData.BondFactor} must be greate than zero";
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Bond factor fi2 {inputData.BondFactor} must be greate than zero";
|
||||
|
||||
}
|
||||
if (inputData.StressStateFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Bond factor {inputData.StressStateFactor} must be greate than zero";
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Stress factor fi3 factor {inputData.StressStateFactor} must be greate than zero";
|
||||
|
||||
}
|
||||
if (inputData.PsiSFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": PsiS factor {inputData.PsiSFactor} must be greate than zero";
|
||||
|
||||
}
|
||||
if (errorString != string.Empty)
|
||||
{
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
|
||||
TraceLogger?.AddMessage($"Checking parameters has done succefully", TraceLogStatuses.Service);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CrackedConcreteNdmLogic : ISectionCrackedLogic
|
||||
{
|
||||
public INdm ConcreteNdm { get; set; }
|
||||
public IForceTuple Tuple { get; set; }
|
||||
public IEnumerable<INdm> NdmCollection { get;set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public bool IsSectionCracked()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
internal class CrackedLogic : ICrackedLogic
|
||||
public class CrackedLogic : ICrackedLogic
|
||||
{
|
||||
ISectionCrackedLogic sectionCrackedLogic;
|
||||
private ISectionCrackedLogic sectionCrackedLogic;
|
||||
public IForceTuple StartTuple { get; set; }
|
||||
public IForceTuple EndTuple { get; set; }
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
@@ -23,16 +23,14 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
sectionCrackedLogic = sectionLogic;
|
||||
}
|
||||
public CrackedLogic() : this (new HoleSectionCrackedLogic())
|
||||
public CrackedLogic() : this (new SectionCrackedLogic())
|
||||
{
|
||||
|
||||
}
|
||||
public bool IsSectionCracked(double factor)
|
||||
{
|
||||
if (TraceLogger is not null)
|
||||
{
|
||||
sectionCrackedLogic.TraceLogger = TraceLogger.GetSimilarTraceLogger(50);
|
||||
}
|
||||
sectionCrackedLogic.TraceLogger = TraceLogger?.GetSimilarTraceLogger(50);
|
||||
|
||||
var actualTuple = ForceTupleService.InterpolateTuples(EndTuple, StartTuple, factor);
|
||||
sectionCrackedLogic.Tuple = actualTuple;
|
||||
sectionCrackedLogic.NdmCollection = NdmCollection;
|
||||
|
||||
@@ -78,5 +78,19 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
TraceLogger?.AddMessage($"Obtained {rebarPrimitives.Count} rebar primitives");
|
||||
return rebarPrimitives;
|
||||
}
|
||||
|
||||
public List<INdm> GetElasticNdmCollection()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(ndmPrimitiveCountMessage, TraceLogStatuses.Debug);
|
||||
triangulateLogic = new TriangulatePrimitiveLogic(new MeshElasticLogic())
|
||||
{
|
||||
LimitState = limitState,
|
||||
CalcTerm = shortTerm,
|
||||
Primitives = NdmPrimitives,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
return triangulateLogic.GetNdms();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class AverageDiameterLogic : IAverageDiameterLogic
|
||||
public class EquivalentDiameterLogic : IAverageDiameterLogic
|
||||
{
|
||||
public IEnumerable<RebarNdm> Rebars { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
@@ -21,13 +21,13 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
Check();
|
||||
var rebarArea = Rebars
|
||||
.Sum(x => x.Area);
|
||||
TraceLogger?.AddMessage($"Summary rebar area As = {rebarArea}");
|
||||
TraceLogger?.AddMessage($"Summary rebar area As = {rebarArea}(m^2)");
|
||||
var rebarCount = Rebars.Count();
|
||||
TraceLogger?.AddMessage($"Rebar count n = {rebarCount}");
|
||||
var averageArea = rebarArea / rebarCount;
|
||||
TraceLogger?.AddMessage($"Average rebar area As = {averageArea}");
|
||||
var diameter = Math.Sqrt(averageArea / Math.PI);
|
||||
TraceLogger?.AddMessage($"Average rebar diameter ds = {diameter}");
|
||||
TraceLogger?.AddMessage($"Equivalent rebar area As,eq = {averageArea}");
|
||||
var diameter = 2d * Math.Sqrt(averageArea / Math.PI);
|
||||
TraceLogger?.AddMessage($"Equivalent rebar diameter ds,eq = 2 * Sqrt( PI / As,eq) = 2 * Sqrt( PI / {averageArea}) = {diameter}(m)");
|
||||
return diameter;
|
||||
}
|
||||
private void Check()
|
||||
@@ -1,53 +1,164 @@
|
||||
using LoaderCalculator.Logics;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Logics;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
internal enum CrackWidthLogicType
|
||||
internal class CrackWidthLogicInputDataFactory : ILogic
|
||||
{
|
||||
SP63
|
||||
}
|
||||
internal static class CrackWidthLogicInputDataFactory
|
||||
{
|
||||
static IStressLogic stressLogic => new StressLogic();
|
||||
public static ICrackWidthLogicInputData GetCrackWidthLogicInputData(CrackWidthLogicType logicType, ICrackWidthSimpleCalculatorInputData inputData)
|
||||
private IStressLogic stressLogic => new StressLogic();
|
||||
|
||||
private const double minimumPsiSFactor = 0.2d;
|
||||
private INdm concreteNdm;
|
||||
private INdm rebarNdm;
|
||||
private StrainTuple strainTupleActual;
|
||||
private double rebarStrainActual;
|
||||
private double concreteStrainActual;
|
||||
private double rebarStressActual;
|
||||
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public RebarPrimitive RebarPrimitive { get; set; }
|
||||
public RebarCrackInputData InputData { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public ICrackWidthLogicInputData GetCrackWidthLogicInputData()
|
||||
{
|
||||
if (logicType == CrackWidthLogicType.SP63)
|
||||
GetNdms();
|
||||
CrackWidthLogicInputDataSP63 data = new();
|
||||
if (CalcTerm == CalcTerms.LongTerm)
|
||||
{
|
||||
CrackWidthLogicInputDataSP63 data = new();
|
||||
ProcessBaseProps(inputData, data);
|
||||
if (inputData.CalcTerm == CalcTerms.LongTerm) { data.TermFactor = 1.4d; }
|
||||
else { data.TermFactor = 1d; }
|
||||
data.PsiSFactor = inputData.PsiSFactor;
|
||||
data.StressStateFactor = inputData.StressState is SectionStressStates.Tension ? 1.2d : 1.0d;
|
||||
data.BondFactor = 0.5;
|
||||
return data;
|
||||
data.TermFactor = 1.4d;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown);
|
||||
data.TermFactor = 1d;
|
||||
}
|
||||
|
||||
data.PsiSFactor = GetPsiSFactor(InputData.ForceTuple, InputData.NdmCollection);
|
||||
data.StressStateFactor = 1.0d;
|
||||
data.BondFactor = 0.5d;
|
||||
data.Length = InputData.Length;
|
||||
data.ConcreteStrain = concreteStrainActual;
|
||||
data.RebarStrain = rebarStrainActual;
|
||||
return data;
|
||||
}
|
||||
|
||||
private static void ProcessBaseProps(ICrackWidthSimpleCalculatorInputData inputData, ICrackWidthLogicInputData data)
|
||||
private void GetNdms()
|
||||
{
|
||||
var strainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(inputData.StrainTuple);
|
||||
var triangulationOptions = new TriangulationOptions { LimiteState = LimitStates.SLS, CalcTerm = inputData.CalcTerm };
|
||||
var ndms = inputData.RebarPrimitive.GetNdms(triangulationOptions).ToArray();
|
||||
var concreteNdm = ndms[0];
|
||||
var rebarNdm = ndms[1];
|
||||
data.ConcreteStrain = concreteNdm.Prestrain;// stressLogic.GetTotalStrain(strainMatrix, concreteNdm) - stressLogic.GetTotalStrainWithPresrain(strainMatrix, concreteNdm);
|
||||
data.RebarStrain = stressLogic.GetTotalStrainWithPrestrain(strainMatrix, rebarNdm);
|
||||
data.Length = inputData.Length;
|
||||
var options = new TriangulationOptions()
|
||||
{
|
||||
CalcTerm = CalcTerms.ShortTerm,
|
||||
LimiteState = LimitStates.SLS,
|
||||
};
|
||||
concreteNdm = RebarPrimitive.GetConcreteNdm(options);
|
||||
concreteNdm.StressScale = 1d;
|
||||
rebarNdm = RebarPrimitive.GetRebarNdm(options);
|
||||
}
|
||||
|
||||
private double GetPsiSFactor(ForceTuple forceTuple, IEnumerable<INdm> ndms)
|
||||
{
|
||||
var crackResult = calculateCrackTuples(forceTuple, ndms);
|
||||
strainTupleActual = CalcStrainMatrix(forceTuple, ndms);
|
||||
rebarStrainActual = stressLogic.GetTotalStrain(TupleConverter.ConvertToLoaderStrainMatrix(strainTupleActual), rebarNdm);
|
||||
TraceLogger?.AddMessage($"Actual strain of rebar EpsilonS = {rebarStrainActual}(dimensionless)");
|
||||
concreteStrainActual = concreteNdm.Prestrain;
|
||||
//concreteStrainActual = stressLogic.GetTotalStrain(TupleConverter.ConvertToLoaderStrainMatrix(strainTupleActual), concreteNdm);
|
||||
TraceLogger?.AddMessage($"Actual strain of concrete on the axis of rebar EpsilonC = {concreteStrainActual}(dimensionless");
|
||||
if (crackResult.IsValid == false)
|
||||
{
|
||||
string errorString = LoggerStrings.CalculationError + crackResult.Description;
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
if (crackResult.IsSectionCracked == false)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Section is not cracked PsiS = {minimumPsiSFactor}");
|
||||
return minimumPsiSFactor;
|
||||
}
|
||||
if (crackResult.FactorOfCrackAppearance == 0d)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Section is cracked in start force combination, PsiS = 1.0");
|
||||
return 1d;
|
||||
}
|
||||
var strainTupleInCacking = CalcStrainMatrix(crackResult.TupleOfCrackAppearance as ForceTuple, ndms);
|
||||
var stressInCracking = stressLogic.GetStress(TupleConverter.ConvertToLoaderStrainMatrix(strainTupleInCacking), rebarNdm);
|
||||
TraceLogger?.AddMessage($"Stress in rebar immediately after cracing Sigma,scrc = {stressInCracking}(Pa)");
|
||||
rebarStressActual = stressLogic.GetStress(TupleConverter.ConvertToLoaderStrainMatrix(strainTupleActual), rebarNdm);
|
||||
TraceLogger?.AddMessage($"Actual stress in rebar Sigma,s = {rebarStressActual}(Pa)");
|
||||
var stressRatio = stressInCracking / rebarStressActual;
|
||||
var logic = new ExpSofteningLogic()
|
||||
{
|
||||
ForceRatio = stressRatio,
|
||||
PsiSMin = minimumPsiSFactor,
|
||||
PowerFactor = 1d,
|
||||
BettaFactor = 0.8d,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
double psiS = logic.GetSofteningFactor();
|
||||
TraceLogger?.AddMessage($"PsiS = {psiS}");
|
||||
return psiS;
|
||||
}
|
||||
|
||||
private CrackForceResult calculateCrackTuples(ForceTuple forceTuple, IEnumerable<INdm> ndms)
|
||||
{
|
||||
var sectionCrackedLogic = new SectionCrackedLogic()
|
||||
{
|
||||
NdmCollection = ndms,
|
||||
CheckedNdmCollection = new List<INdm>() { concreteNdm },
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(100)
|
||||
};
|
||||
var crackedLogis = new CrackedLogic(sectionCrackedLogic)
|
||||
{
|
||||
StartTuple = new ForceTuple(),
|
||||
EndTuple = forceTuple,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(100)
|
||||
};
|
||||
var calculator = new CrackForceCalculator(crackedLogis)
|
||||
{
|
||||
NdmCollection = ndms,
|
||||
EndTuple = forceTuple,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(150)
|
||||
};
|
||||
calculator.Run();
|
||||
return calculator.Result as CrackForceResult;
|
||||
}
|
||||
|
||||
private StrainTuple CalcStrainMatrix(ForceTuple forceTuple, IEnumerable<INdm> ndms)
|
||||
{
|
||||
IForceTupleInputData inputData = new ForceTupleInputData()
|
||||
{
|
||||
NdmCollection = ndms,
|
||||
Tuple = forceTuple
|
||||
};
|
||||
IForceTupleCalculator calculator = new ForceTupleCalculator()
|
||||
{
|
||||
InputData = inputData,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
calculator.Run();
|
||||
var forceResult = calculator.Result as IForcesTupleResult;
|
||||
if (forceResult.IsValid == false)
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculationError + $": {forceResult.Description}", TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(ErrorStrings.CalculationError);
|
||||
}
|
||||
var strain = TupleConverter.ConvertToStrainTuple(forceResult.LoaderResults.StrainMatrix);
|
||||
return strain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface ICrackWidthSimpleCalculatorInputData
|
||||
{
|
||||
CalcTerms CalcTerm { get; set; }
|
||||
StrainTuple StrainTuple { get; set; }
|
||||
double PsiSFactor { get; set; }
|
||||
/// <summary>
|
||||
/// Length between cracks in meters
|
||||
/// </summary>
|
||||
double Length { get; set; }
|
||||
SectionStressStates StressState { get; set; }
|
||||
RebarPrimitive RebarPrimitive { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,11 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// <returns></returns>
|
||||
List<INdm> GetCrackedNdmCollection();
|
||||
/// <summary>
|
||||
/// Returns collection of ndm elementary parts where all material are elastic ones
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<INdm> GetElasticNdmCollection();
|
||||
/// <summary>
|
||||
/// Return collection of primitives which contain only rebars
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
internal interface ISectionCrackedLogic : ILogic
|
||||
public interface ISectionCrackedLogic : ILogic
|
||||
{
|
||||
IForceTuple Tuple { get; set; }
|
||||
IEnumerable<INdm> NdmCollection { get; set; }
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
const double maxDiameterFactor = 40d;
|
||||
const double minLength = 0.1d;
|
||||
const double maxLength = 0.4d;
|
||||
|
||||
private const double areaFactor = 0.5d;
|
||||
readonly IAverageDiameterLogic diameterLogic;
|
||||
readonly ITensileAreaLogic tensileAreaLogic;
|
||||
IStressLogic stressLogic;
|
||||
@@ -35,7 +35,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
}
|
||||
public LengthBetweenCracksLogicSP63() :
|
||||
this
|
||||
( new AverageDiameterLogic(),
|
||||
( new EquivalentDiameterLogic(),
|
||||
new TensileAreaLogicSP63())
|
||||
{ }
|
||||
public double GetLength()
|
||||
@@ -65,18 +65,20 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
tensileAreaLogic.StrainMatrix = StrainMatrix;
|
||||
var concreteArea = tensileAreaLogic.GetTensileArea();
|
||||
TraceLogger?.AddMessage($"Concrete effective area Ac,eff = {concreteArea}(m^2)");
|
||||
var length = concreteArea / rebarArea * rebarDiameter;
|
||||
TraceLogger?.AddMessage($"Base length between cracks Lcrc = {concreteArea} / {rebarArea} * {rebarDiameter} = {length}(m)");
|
||||
var length = areaFactor * concreteArea / rebarArea * rebarDiameter;
|
||||
TraceLogger?.AddMessage($"Base length between cracks Lcrc = {areaFactor} * {concreteArea} / {rebarArea} * {rebarDiameter} = {length}(m)");
|
||||
double minLengthByDiameter = minDiameterFactor * rebarDiameter;
|
||||
TraceLogger?.AddMessage($"Minimum length by diameter Lcrc = {minDiameterFactor} * {rebarDiameter} = {minLengthByDiameter}(m)");
|
||||
TraceLogger?.AddMessage($"Minimum length Lcrc = {minLength}");
|
||||
length = new List<double> { length, minLengthByDiameter, minLength }.Max();
|
||||
TraceLogger?.AddMessage($"Minimum length Lcrc = max({length}, {minLengthByDiameter}, {minLength}) = {length}(m)");
|
||||
TraceLogger?.AddMessage($"Minimum absolute length Lcrc = {minLength}(m)");
|
||||
var restrictedByMinLength = new List<double> { length, minLengthByDiameter, minLength }.Max();
|
||||
TraceLogger?.AddMessage($"Consider minimum length restriction Lcrc = max({length}(m), {minLengthByDiameter}(m), {minLength}(m)) = {length}(m)");
|
||||
double maxLengthByDiameter = maxDiameterFactor * rebarDiameter;
|
||||
TraceLogger?.AddMessage($"Maximum length by diameter Lcrc = {maxDiameterFactor} * {rebarDiameter} = {maxLengthByDiameter}(m)");
|
||||
TraceLogger?.AddMessage($"Maximum length Lcrc = {maxLength}");
|
||||
length = new List<double> { length, maxLengthByDiameter, maxLength }.Min();
|
||||
TraceLogger?.AddMessage($"Maximun length Lcrc = min({length}, {maxLengthByDiameter}, {maxLength}) = {length}(m)");
|
||||
TraceLogger?.AddMessage($"Maximum absolute length Lcrc = {maxLength}(m)");
|
||||
var restrictedByMaxLength = new List<double> { restrictedByMinLength, maxLengthByDiameter, maxLength }.Min();
|
||||
TraceLogger?.AddMessage($"Consider maximum length restriction Lcrc = max({restrictedByMinLength}(m), {maxLengthByDiameter}(m), {maxLength}(m)) = {restrictedByMaxLength}(m)");
|
||||
length = restrictedByMaxLength;
|
||||
TraceLogger?.AddMessage($"Finally Lcrc = {length}(m)");
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
@@ -8,7 +11,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
ICrackWidthLogic crackWidthLogic = new CrackWidthLogicSP63();
|
||||
RebarCrackResult result;
|
||||
public string Name { get; set; }
|
||||
public ICrackWidthSimpleCalculatorInputData InputData { get; set; }
|
||||
public RebarCrackCalculatorInputData InputData { get; set; }
|
||||
public IResult Result => result;
|
||||
|
||||
public Action<IResult> ActionToOutputResults { get; set; }
|
||||
@@ -16,14 +19,31 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
|
||||
public void Run()
|
||||
{
|
||||
result = new() { IsValid = true};
|
||||
var crackWidthLogicType = CrackWidthLogicType.SP63;
|
||||
var logicInputData = CrackWidthLogicInputDataFactory.GetCrackWidthLogicInputData(crackWidthLogicType, InputData);
|
||||
crackWidthLogic.InputData = logicInputData;
|
||||
double crackWidth = 0d;
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
result = new()
|
||||
{
|
||||
IsValid = true
|
||||
};
|
||||
TraceLogger?.AddMessage($"Rebar primitive {InputData.RebarPrimitive.Name}");
|
||||
|
||||
//double acrc1 = GetCrackWidth()
|
||||
|
||||
|
||||
crackWidthLogic.TraceLogger = TraceLogger?.GetSimilarTraceLogger(50);
|
||||
try
|
||||
{
|
||||
crackWidth = crackWidthLogic.GetCrackWidth();
|
||||
var dataAcrc1 = GetCrackWidthInputData(InputData.LongRebarData, CalcTerms.LongTerm);
|
||||
var dataAcrc2 = GetCrackWidthInputData(InputData.LongRebarData, CalcTerms.ShortTerm);
|
||||
var dataAcrc3 = GetCrackWidthInputData(InputData.ShortRebarData, CalcTerms.ShortTerm);
|
||||
|
||||
crackWidthLogic.InputData = dataAcrc1;
|
||||
var acrc1 = crackWidthLogic.GetCrackWidth();
|
||||
|
||||
var longRebarResult = new CrackWidthTupleResult()
|
||||
{
|
||||
CrackWidth = acrc1,
|
||||
};
|
||||
result.LongTermResult = longRebarResult;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -31,10 +51,21 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
result.Description += "\n" + ex;
|
||||
}
|
||||
result.RebarPrimitive = InputData.RebarPrimitive;
|
||||
//result.CrackWidth = crackWidth;
|
||||
//result.RebarStrain = logicInputData.RebarStrain;
|
||||
//result.ConcreteStrain = logicInputData.ConcreteStrain;
|
||||
}
|
||||
|
||||
private ICrackWidthLogicInputData GetCrackWidthInputData(RebarCrackInputData inputData, CalcTerms calcTerm)
|
||||
{
|
||||
var factoryInputData = new CrackWidthLogicInputDataFactory()
|
||||
{
|
||||
CalcTerm = calcTerm,
|
||||
InputData = inputData,
|
||||
RebarPrimitive = InputData.RebarPrimitive,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
var crackWidthInputData = factoryInputData.GetCrackWidthLogicInputData();
|
||||
return crackWidthInputData;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Class of input data for rebar crack calculator
|
||||
/// </summary>
|
||||
public class RebarCrackCalculatorInputData : IInputData
|
||||
{
|
||||
/// <summary>
|
||||
/// Long term rebar data
|
||||
/// </summary>
|
||||
public RebarCrackInputData? LongRebarData { get; set; }
|
||||
/// <summary>
|
||||
/// Short term rebar data
|
||||
/// </summary>
|
||||
public RebarCrackInputData? ShortRebarData { get; set; }
|
||||
public RebarPrimitive RebarPrimitive { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
@@ -9,13 +11,10 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class RebarCrackInputData : ICrackWidthSimpleCalculatorInputData
|
||||
public class RebarCrackInputData : IInputData
|
||||
{
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public StrainTuple StrainTuple { get; set; }
|
||||
public double PsiSFactor { get; set; }
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
public ForceTuple ForceTuple { get; set; }
|
||||
public double Length { get; set; }
|
||||
public SectionStressStates StressState { get; set; }
|
||||
public RebarPrimitive RebarPrimitive { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,18 +5,20 @@ using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
internal class HoleSectionCrackedLogic : ISectionCrackedLogic
|
||||
internal class SectionCrackedLogic : ISectionCrackedLogic
|
||||
{
|
||||
static readonly IStressLogic stressLogic = new StressLogic();
|
||||
public IForceTuple Tuple { get; set; }
|
||||
public IEnumerable<INdm> CheckedNdmCollection { get; set; }
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
public Accuracy Accuracy { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public HoleSectionCrackedLogic()
|
||||
public SectionCrackedLogic()
|
||||
{
|
||||
if (Accuracy is null)
|
||||
{
|
||||
@@ -52,7 +54,16 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
throw new StructureHelperException(ErrorStrings.ResultIsNotValid + ": Result of Section Calculation is not valid");
|
||||
}
|
||||
var strainMatrix = calcResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var isSectionCracked = stressLogic.IsSectionCracked(strainMatrix, NdmCollection);
|
||||
IEnumerable<INdm> checkedNdmCollection;
|
||||
if (CheckedNdmCollection is null)
|
||||
{
|
||||
checkedNdmCollection = NdmCollection;
|
||||
}
|
||||
else
|
||||
{
|
||||
checkedNdmCollection = CheckedNdmCollection;
|
||||
}
|
||||
var isSectionCracked = stressLogic.IsSectionCracked(strainMatrix, checkedNdmCollection);
|
||||
if (isSectionCracked == true)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Cracks are appeared in cross-section for current force combination");
|
||||
@@ -21,10 +21,13 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
private List<RebarPrimitive>? rebarPrimitives;
|
||||
private IEnumerable<INdm> defaultNdms;
|
||||
private IEnumerable<INdm> fulyCrackedNdms;
|
||||
private IEnumerable<INdm> elasticNdms;
|
||||
private CrackForceResult crackForceResult;
|
||||
private StrainTuple longDefaultStrainTuple;
|
||||
private StrainTuple shortDefaultStrainTuple;
|
||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
||||
private double longLength;
|
||||
private double shortLength;
|
||||
|
||||
public string Name { get; set; }
|
||||
public TupleCrackInputData InputData { get; set; }
|
||||
@@ -66,27 +69,52 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
CheckInputData();
|
||||
Triangulate();
|
||||
longDefaultStrainTuple = CalcStrainMatrix(InputData.LongTermTuple, defaultNdms);
|
||||
shortDefaultStrainTuple = CalcStrainMatrix(InputData.LongTermTuple, defaultNdms);
|
||||
var longLength = GetLengthBetweenCracks(longDefaultStrainTuple);
|
||||
var shortLength = GetLengthBetweenCracks(shortDefaultStrainTuple);
|
||||
longDefaultStrainTuple = CalcStrainMatrix(InputData.LongTermTuple as ForceTuple, defaultNdms);
|
||||
shortDefaultStrainTuple = CalcStrainMatrix(InputData.LongTermTuple as ForceTuple, defaultNdms);
|
||||
var longElasticStrainTuple = CalcStrainMatrix(InputData.LongTermTuple as ForceTuple, elasticNdms);
|
||||
var shortElasticStrainTuple = CalcStrainMatrix(InputData.ShortTermTuple as ForceTuple, elasticNdms);
|
||||
if (result.IsValid == false) { return; }
|
||||
longLength = GetLengthBetweenCracks(longElasticStrainTuple);
|
||||
shortLength = GetLengthBetweenCracks(shortElasticStrainTuple);
|
||||
CalcCrackForce();
|
||||
var crackInputData = GetCrackInputData();
|
||||
var calculator = new RebarCrackCalculator
|
||||
foreach (var rebar in rebarPrimitives)
|
||||
{
|
||||
InputData = crackInputData,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
foreach (var item in rebarPrimitives)
|
||||
{
|
||||
crackInputData.RebarPrimitive = item;
|
||||
RebarCrackCalculatorInputData rebarCalculatorData = GetRebarCalculatorInputData(rebar);
|
||||
var calculator = new RebarCrackCalculator
|
||||
{
|
||||
InputData = rebarCalculatorData,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
calculator.Run();
|
||||
var rebarResult = calculator.Result as RebarCrackResult;
|
||||
result.RebarResults.Add(rebarResult);
|
||||
}
|
||||
}
|
||||
|
||||
private StrainTuple CalcStrainMatrix(IForceTuple forceTuple, IEnumerable<INdm> ndms)
|
||||
private RebarCrackCalculatorInputData GetRebarCalculatorInputData(RebarPrimitive rebar)
|
||||
{
|
||||
var longRebarData = new RebarCrackInputData()
|
||||
{
|
||||
NdmCollection = fulyCrackedNdms,
|
||||
ForceTuple = InputData.LongTermTuple as ForceTuple,
|
||||
Length = longLength
|
||||
};
|
||||
var shortRebarData = new RebarCrackInputData()
|
||||
{
|
||||
NdmCollection = fulyCrackedNdms,
|
||||
ForceTuple = InputData.ShortTermTuple as ForceTuple,
|
||||
Length = shortLength
|
||||
};
|
||||
var rebarCalculatorData = new RebarCrackCalculatorInputData()
|
||||
{
|
||||
RebarPrimitive = rebar,
|
||||
LongRebarData = longRebarData,
|
||||
ShortRebarData = shortRebarData
|
||||
};
|
||||
return rebarCalculatorData;
|
||||
}
|
||||
|
||||
private StrainTuple CalcStrainMatrix(ForceTuple forceTuple, IEnumerable<INdm> ndms)
|
||||
{
|
||||
IForceTupleInputData inputData = new ForceTupleInputData()
|
||||
{
|
||||
@@ -100,29 +128,20 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
};
|
||||
calculator.Run();
|
||||
var forceResult = calculator.Result as IForcesTupleResult;
|
||||
if (forceResult.IsValid == false)
|
||||
{
|
||||
result.IsValid = false;
|
||||
result.Description += forceResult.Description;
|
||||
}
|
||||
var strain = TupleConverter.ConvertToStrainTuple(forceResult.LoaderResults.StrainMatrix);
|
||||
return strain;
|
||||
}
|
||||
|
||||
private RebarCrackInputData GetCrackInputData()
|
||||
{
|
||||
lengthLogic.NdmCollection = defaultNdms;
|
||||
lengthLogic.StrainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(longDefaultStrainTuple);
|
||||
var length = lengthLogic.GetLength();
|
||||
var crackInputData = new RebarCrackInputData
|
||||
{
|
||||
PsiSFactor = crackForceResult.PsiS,
|
||||
Length = length,
|
||||
StrainTuple = longDefaultStrainTuple
|
||||
};
|
||||
return crackInputData;
|
||||
}
|
||||
|
||||
private double GetLengthBetweenCracks(StrainTuple strainTuple)
|
||||
{
|
||||
var logic = new LengthBetweenCracksLogicSP63()
|
||||
{
|
||||
NdmCollection = defaultNdms,
|
||||
NdmCollection = elasticNdms,
|
||||
TraceLogger = TraceLogger
|
||||
};
|
||||
logic.StrainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(strainTuple);
|
||||
@@ -138,6 +157,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
rebarPrimitives = triangulationLogic.GetRebarPrimitives();
|
||||
defaultNdms = triangulationLogic.GetNdmCollection();
|
||||
fulyCrackedNdms = triangulationLogic.GetCrackedNdmCollection();
|
||||
elasticNdms = triangulationLogic.GetElasticNdmCollection();
|
||||
}
|
||||
|
||||
private void CalcCrackForce()
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
public IForceTuple LongTermTuple { get; set; }
|
||||
public IForceTuple ShortTermTuple { get; set; }
|
||||
public bool IsCracked { get; set; }
|
||||
public List<RebarCrackResult> RebarResults { get; set; }
|
||||
public List<RebarCrackResult> RebarResults { get; private set; }
|
||||
public double MaxLongTermCrackWidth => IsCracked? RebarResults.Select(x => x.LongTermResult.CrackWidth).Max() : 0d;
|
||||
public double MaxShortTermCrackWidth => IsCracked? RebarResults.Select(x => x.ShortTermResult.CrackWidth).Max() : 0d;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user