Crack width calculation was added
This commit is contained in:
@@ -83,7 +83,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
|||||||
private bool IsSectionCracked(IPoint2D point2D)
|
private bool IsSectionCracked(IPoint2D point2D)
|
||||||
{
|
{
|
||||||
logger?.TraceLoggerEntries.Clear();
|
logger?.TraceLoggerEntries.Clear();
|
||||||
var logic = new HoleSectionCrackedLogic();
|
var logic = new SectionCrackedLogic();
|
||||||
var point3D = ConvertLogic.GetPoint3D(point2D);
|
var point3D = ConvertLogic.GetPoint3D(point2D);
|
||||||
tuple = new()
|
tuple = new()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
{
|
{
|
||||||
public class CrackForceCalculator : ICalculator
|
public class CrackForceCalculator : ICalculator
|
||||||
{
|
{
|
||||||
static readonly CrackedLogic crackedLogic = new();
|
private CrackedLogic crackedLogic;
|
||||||
ExpSofteningLogic softeningLogic = new();
|
ExpSofteningLogic softeningLogic = new();
|
||||||
static readonly CrackStrainLogic crackStrainLogic = new();
|
static readonly CrackStrainLogic crackStrainLogic = new();
|
||||||
static readonly SofteningFactorLogic softeningFactorLogic = new();
|
static readonly SofteningFactorLogic softeningFactorLogic = new();
|
||||||
@@ -30,13 +30,14 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
|
|
||||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
public CrackForceCalculator(IForceTupleCalculator forceTupleCalculator)
|
public CrackForceCalculator(CrackedLogic crackedLogic)
|
||||||
{
|
{
|
||||||
StartTuple ??= new ForceTuple();
|
StartTuple ??= new ForceTuple();
|
||||||
Accuracy ??= new Accuracy() { IterationAccuracy = 0.0001d, MaxIterationCount = 10000 };
|
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(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||||
TraceLogger?.AddMessage("Method of crack width calculation based on SP 63.13330.2018");
|
TraceLogger?.AddMessage("Method of crack width calculation based on SP 63.13330.2018");
|
||||||
CheckOptions();
|
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
|
//check if strain of concrete greater than strain of rebar
|
||||||
if (inputData.ConcreteStrain > inputData.RebarStrain) { return 0d; }
|
double rebarElongation = inputData.RebarStrain - inputData.ConcreteStrain;
|
||||||
double width = (inputData.RebarStrain - inputData.ConcreteStrain) * inputData.Length;
|
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;
|
width *= inputData.TermFactor * inputData.BondFactor * inputData.StressStateFactor * inputData.PsiSFactor;
|
||||||
|
TraceLogger?.AddMessage($"Width of crack a,crc = {width}(m)");
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,34 +49,33 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
inputData = InputData as CrackWidthLogicInputDataSP63;
|
inputData = InputData as CrackWidthLogicInputDataSP63;
|
||||||
if (inputData.Length <=0d)
|
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)
|
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)
|
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)
|
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)
|
if (inputData.PsiSFactor <= 0d)
|
||||||
{
|
{
|
||||||
errorString = ErrorStrings.DataIsInCorrect + $": PsiS factor {inputData.PsiSFactor} must be greate than zero";
|
errorString = ErrorStrings.DataIsInCorrect + $": PsiS factor {inputData.PsiSFactor} must be greate than zero";
|
||||||
|
|
||||||
}
|
}
|
||||||
if (errorString != string.Empty)
|
if (errorString != string.Empty)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||||
throw new StructureHelperException(errorString);
|
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
|
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||||
{
|
{
|
||||||
internal class CrackedLogic : ICrackedLogic
|
public class CrackedLogic : ICrackedLogic
|
||||||
{
|
{
|
||||||
ISectionCrackedLogic sectionCrackedLogic;
|
private ISectionCrackedLogic sectionCrackedLogic;
|
||||||
public IForceTuple StartTuple { get; set; }
|
public IForceTuple StartTuple { get; set; }
|
||||||
public IForceTuple EndTuple { get; set; }
|
public IForceTuple EndTuple { get; set; }
|
||||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||||
@@ -23,16 +23,14 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
{
|
{
|
||||||
sectionCrackedLogic = sectionLogic;
|
sectionCrackedLogic = sectionLogic;
|
||||||
}
|
}
|
||||||
public CrackedLogic() : this (new HoleSectionCrackedLogic())
|
public CrackedLogic() : this (new SectionCrackedLogic())
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
public bool IsSectionCracked(double factor)
|
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);
|
var actualTuple = ForceTupleService.InterpolateTuples(EndTuple, StartTuple, factor);
|
||||||
sectionCrackedLogic.Tuple = actualTuple;
|
sectionCrackedLogic.Tuple = actualTuple;
|
||||||
sectionCrackedLogic.NdmCollection = NdmCollection;
|
sectionCrackedLogic.NdmCollection = NdmCollection;
|
||||||
|
|||||||
@@ -78,5 +78,19 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
TraceLogger?.AddMessage($"Obtained {rebarPrimitives.Count} rebar primitives");
|
TraceLogger?.AddMessage($"Obtained {rebarPrimitives.Count} rebar primitives");
|
||||||
return rebarPrimitives;
|
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
|
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||||
{
|
{
|
||||||
public class AverageDiameterLogic : IAverageDiameterLogic
|
public class EquivalentDiameterLogic : IAverageDiameterLogic
|
||||||
{
|
{
|
||||||
public IEnumerable<RebarNdm> Rebars { get; set; }
|
public IEnumerable<RebarNdm> Rebars { get; set; }
|
||||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
@@ -21,13 +21,13 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
Check();
|
Check();
|
||||||
var rebarArea = Rebars
|
var rebarArea = Rebars
|
||||||
.Sum(x => x.Area);
|
.Sum(x => x.Area);
|
||||||
TraceLogger?.AddMessage($"Summary rebar area As = {rebarArea}");
|
TraceLogger?.AddMessage($"Summary rebar area As = {rebarArea}(m^2)");
|
||||||
var rebarCount = Rebars.Count();
|
var rebarCount = Rebars.Count();
|
||||||
TraceLogger?.AddMessage($"Rebar count n = {rebarCount}");
|
TraceLogger?.AddMessage($"Rebar count n = {rebarCount}");
|
||||||
var averageArea = rebarArea / rebarCount;
|
var averageArea = rebarArea / rebarCount;
|
||||||
TraceLogger?.AddMessage($"Average rebar area As = {averageArea}");
|
TraceLogger?.AddMessage($"Equivalent rebar area As,eq = {averageArea}");
|
||||||
var diameter = Math.Sqrt(averageArea / Math.PI);
|
var diameter = 2d * Math.Sqrt(averageArea / Math.PI);
|
||||||
TraceLogger?.AddMessage($"Average rebar diameter ds = {diameter}");
|
TraceLogger?.AddMessage($"Equivalent rebar diameter ds,eq = 2 * Sqrt( PI / As,eq) = 2 * Sqrt( PI / {averageArea}) = {diameter}(m)");
|
||||||
return diameter;
|
return diameter;
|
||||||
}
|
}
|
||||||
private void Check()
|
private void Check()
|
||||||
@@ -1,53 +1,164 @@
|
|||||||
using LoaderCalculator.Logics;
|
using LoaderCalculator.Data.Ndms;
|
||||||
|
using LoaderCalculator.Logics;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Models.Calculators;
|
||||||
|
using StructureHelperCommon.Models;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperCommon.Services.Forces;
|
using StructureHelperCommon.Services.Forces;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Loggers;
|
||||||
|
using LoaderCalculator.Data.Materials;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||||
{
|
{
|
||||||
internal enum CrackWidthLogicType
|
internal class CrackWidthLogicInputDataFactory : ILogic
|
||||||
{
|
{
|
||||||
SP63
|
private IStressLogic stressLogic => new StressLogic();
|
||||||
}
|
|
||||||
internal static class CrackWidthLogicInputDataFactory
|
private const double minimumPsiSFactor = 0.2d;
|
||||||
{
|
private INdm concreteNdm;
|
||||||
static IStressLogic stressLogic => new StressLogic();
|
private INdm rebarNdm;
|
||||||
public static ICrackWidthLogicInputData GetCrackWidthLogicInputData(CrackWidthLogicType logicType, ICrackWidthSimpleCalculatorInputData inputData)
|
private StrainTuple strainTupleActual;
|
||||||
{
|
private double rebarStrainActual;
|
||||||
if (logicType == CrackWidthLogicType.SP63)
|
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()
|
||||||
{
|
{
|
||||||
|
GetNdms();
|
||||||
CrackWidthLogicInputDataSP63 data = new();
|
CrackWidthLogicInputDataSP63 data = new();
|
||||||
ProcessBaseProps(inputData, data);
|
if (CalcTerm == CalcTerms.LongTerm)
|
||||||
if (inputData.CalcTerm == CalcTerms.LongTerm) { data.TermFactor = 1.4d; }
|
{
|
||||||
else { data.TermFactor = 1d; }
|
data.TermFactor = 1.4d;
|
||||||
data.PsiSFactor = inputData.PsiSFactor;
|
|
||||||
data.StressStateFactor = inputData.StressState is SectionStressStates.Tension ? 1.2d : 1.0d;
|
|
||||||
data.BondFactor = 0.5;
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
else
|
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 void GetNdms()
|
||||||
|
|
||||||
private static void ProcessBaseProps(ICrackWidthSimpleCalculatorInputData inputData, ICrackWidthLogicInputData data)
|
|
||||||
{
|
{
|
||||||
var strainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(inputData.StrainTuple);
|
var options = new TriangulationOptions()
|
||||||
var triangulationOptions = new TriangulationOptions { LimiteState = LimitStates.SLS, CalcTerm = inputData.CalcTerm };
|
{
|
||||||
var ndms = inputData.RebarPrimitive.GetNdms(triangulationOptions).ToArray();
|
CalcTerm = CalcTerms.ShortTerm,
|
||||||
var concreteNdm = ndms[0];
|
LimiteState = LimitStates.SLS,
|
||||||
var rebarNdm = ndms[1];
|
};
|
||||||
data.ConcreteStrain = concreteNdm.Prestrain;// stressLogic.GetTotalStrain(strainMatrix, concreteNdm) - stressLogic.GetTotalStrainWithPresrain(strainMatrix, concreteNdm);
|
concreteNdm = RebarPrimitive.GetConcreteNdm(options);
|
||||||
data.RebarStrain = stressLogic.GetTotalStrainWithPrestrain(strainMatrix, rebarNdm);
|
concreteNdm.StressScale = 1d;
|
||||||
data.Length = inputData.Length;
|
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>
|
/// <returns></returns>
|
||||||
List<INdm> GetCrackedNdmCollection();
|
List<INdm> GetCrackedNdmCollection();
|
||||||
/// <summary>
|
/// <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
|
/// Return collection of primitives which contain only rebars
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||||
{
|
{
|
||||||
internal interface ISectionCrackedLogic : ILogic
|
public interface ISectionCrackedLogic : ILogic
|
||||||
{
|
{
|
||||||
IForceTuple Tuple { get; set; }
|
IForceTuple Tuple { get; set; }
|
||||||
IEnumerable<INdm> NdmCollection { get; set; }
|
IEnumerable<INdm> NdmCollection { get; set; }
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
const double maxDiameterFactor = 40d;
|
const double maxDiameterFactor = 40d;
|
||||||
const double minLength = 0.1d;
|
const double minLength = 0.1d;
|
||||||
const double maxLength = 0.4d;
|
const double maxLength = 0.4d;
|
||||||
|
private const double areaFactor = 0.5d;
|
||||||
readonly IAverageDiameterLogic diameterLogic;
|
readonly IAverageDiameterLogic diameterLogic;
|
||||||
readonly ITensileAreaLogic tensileAreaLogic;
|
readonly ITensileAreaLogic tensileAreaLogic;
|
||||||
IStressLogic stressLogic;
|
IStressLogic stressLogic;
|
||||||
@@ -35,7 +35,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
}
|
}
|
||||||
public LengthBetweenCracksLogicSP63() :
|
public LengthBetweenCracksLogicSP63() :
|
||||||
this
|
this
|
||||||
( new AverageDiameterLogic(),
|
( new EquivalentDiameterLogic(),
|
||||||
new TensileAreaLogicSP63())
|
new TensileAreaLogicSP63())
|
||||||
{ }
|
{ }
|
||||||
public double GetLength()
|
public double GetLength()
|
||||||
@@ -65,18 +65,20 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
tensileAreaLogic.StrainMatrix = StrainMatrix;
|
tensileAreaLogic.StrainMatrix = StrainMatrix;
|
||||||
var concreteArea = tensileAreaLogic.GetTensileArea();
|
var concreteArea = tensileAreaLogic.GetTensileArea();
|
||||||
TraceLogger?.AddMessage($"Concrete effective area Ac,eff = {concreteArea}(m^2)");
|
TraceLogger?.AddMessage($"Concrete effective area Ac,eff = {concreteArea}(m^2)");
|
||||||
var length = concreteArea / rebarArea * rebarDiameter;
|
var length = areaFactor * concreteArea / rebarArea * rebarDiameter;
|
||||||
TraceLogger?.AddMessage($"Base length between cracks Lcrc = {concreteArea} / {rebarArea} * {rebarDiameter} = {length}(m)");
|
TraceLogger?.AddMessage($"Base length between cracks Lcrc = {areaFactor} * {concreteArea} / {rebarArea} * {rebarDiameter} = {length}(m)");
|
||||||
double minLengthByDiameter = minDiameterFactor * rebarDiameter;
|
double minLengthByDiameter = minDiameterFactor * rebarDiameter;
|
||||||
TraceLogger?.AddMessage($"Minimum length by diameter Lcrc = {minDiameterFactor} * {rebarDiameter} = {minLengthByDiameter}(m)");
|
TraceLogger?.AddMessage($"Minimum length by diameter Lcrc = {minDiameterFactor} * {rebarDiameter} = {minLengthByDiameter}(m)");
|
||||||
TraceLogger?.AddMessage($"Minimum length Lcrc = {minLength}");
|
TraceLogger?.AddMessage($"Minimum absolute length Lcrc = {minLength}(m)");
|
||||||
length = new List<double> { length, minLengthByDiameter, minLength }.Max();
|
var restrictedByMinLength = new List<double> { length, minLengthByDiameter, minLength }.Max();
|
||||||
TraceLogger?.AddMessage($"Minimum length Lcrc = max({length}, {minLengthByDiameter}, {minLength}) = {length}(m)");
|
TraceLogger?.AddMessage($"Consider minimum length restriction Lcrc = max({length}(m), {minLengthByDiameter}(m), {minLength}(m)) = {length}(m)");
|
||||||
double maxLengthByDiameter = maxDiameterFactor * rebarDiameter;
|
double maxLengthByDiameter = maxDiameterFactor * rebarDiameter;
|
||||||
TraceLogger?.AddMessage($"Maximum length by diameter Lcrc = {maxDiameterFactor} * {rebarDiameter} = {maxLengthByDiameter}(m)");
|
TraceLogger?.AddMessage($"Maximum length by diameter Lcrc = {maxDiameterFactor} * {rebarDiameter} = {maxLengthByDiameter}(m)");
|
||||||
TraceLogger?.AddMessage($"Maximum length Lcrc = {maxLength}");
|
TraceLogger?.AddMessage($"Maximum absolute length Lcrc = {maxLength}(m)");
|
||||||
length = new List<double> { length, maxLengthByDiameter, maxLength }.Min();
|
var restrictedByMaxLength = new List<double> { restrictedByMinLength, maxLengthByDiameter, maxLength }.Min();
|
||||||
TraceLogger?.AddMessage($"Maximun length Lcrc = min({length}, {maxLengthByDiameter}, {maxLength}) = {length}(m)");
|
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;
|
return length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Models;
|
||||||
using StructureHelperCommon.Models.Calculators;
|
using StructureHelperCommon.Models.Calculators;
|
||||||
|
using StructureHelperCommon.Models.Loggers;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||||
{
|
{
|
||||||
@@ -8,7 +11,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
ICrackWidthLogic crackWidthLogic = new CrackWidthLogicSP63();
|
ICrackWidthLogic crackWidthLogic = new CrackWidthLogicSP63();
|
||||||
RebarCrackResult result;
|
RebarCrackResult result;
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public ICrackWidthSimpleCalculatorInputData InputData { get; set; }
|
public RebarCrackCalculatorInputData InputData { get; set; }
|
||||||
public IResult Result => result;
|
public IResult Result => result;
|
||||||
|
|
||||||
public Action<IResult> ActionToOutputResults { get; set; }
|
public Action<IResult> ActionToOutputResults { get; set; }
|
||||||
@@ -16,14 +19,31 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
result = new() { IsValid = true};
|
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||||
var crackWidthLogicType = CrackWidthLogicType.SP63;
|
result = new()
|
||||||
var logicInputData = CrackWidthLogicInputDataFactory.GetCrackWidthLogicInputData(crackWidthLogicType, InputData);
|
{
|
||||||
crackWidthLogic.InputData = logicInputData;
|
IsValid = true
|
||||||
double crackWidth = 0d;
|
};
|
||||||
|
TraceLogger?.AddMessage($"Rebar primitive {InputData.RebarPrimitive.Name}");
|
||||||
|
|
||||||
|
//double acrc1 = GetCrackWidth()
|
||||||
|
|
||||||
|
|
||||||
|
crackWidthLogic.TraceLogger = TraceLogger?.GetSimilarTraceLogger(50);
|
||||||
try
|
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)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -31,10 +51,21 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
result.Description += "\n" + ex;
|
result.Description += "\n" + ex;
|
||||||
}
|
}
|
||||||
result.RebarPrimitive = InputData.RebarPrimitive;
|
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()
|
public object Clone()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
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 StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
using System;
|
using System;
|
||||||
@@ -9,13 +11,10 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||||
{
|
{
|
||||||
public class RebarCrackInputData : ICrackWidthSimpleCalculatorInputData
|
public class RebarCrackInputData : IInputData
|
||||||
{
|
{
|
||||||
public CalcTerms CalcTerm { get; set; }
|
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||||
public StrainTuple StrainTuple { get; set; }
|
public ForceTuple ForceTuple { get; set; }
|
||||||
public double PsiSFactor { get; set; }
|
|
||||||
public double Length { 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.Calculators;
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||||
|
using System.Diagnostics.Eventing.Reader;
|
||||||
|
|
||||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||||
{
|
{
|
||||||
internal class HoleSectionCrackedLogic : ISectionCrackedLogic
|
internal class SectionCrackedLogic : ISectionCrackedLogic
|
||||||
{
|
{
|
||||||
static readonly IStressLogic stressLogic = new StressLogic();
|
static readonly IStressLogic stressLogic = new StressLogic();
|
||||||
public IForceTuple Tuple { get; set; }
|
public IForceTuple Tuple { get; set; }
|
||||||
|
public IEnumerable<INdm> CheckedNdmCollection { get; set; }
|
||||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||||
public Accuracy Accuracy { get; set; }
|
public Accuracy Accuracy { get; set; }
|
||||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
public HoleSectionCrackedLogic()
|
public SectionCrackedLogic()
|
||||||
{
|
{
|
||||||
if (Accuracy is null)
|
if (Accuracy is null)
|
||||||
{
|
{
|
||||||
@@ -52,7 +54,16 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
throw new StructureHelperException(ErrorStrings.ResultIsNotValid + ": Result of Section Calculation is not valid");
|
throw new StructureHelperException(ErrorStrings.ResultIsNotValid + ": Result of Section Calculation is not valid");
|
||||||
}
|
}
|
||||||
var strainMatrix = calcResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
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)
|
if (isSectionCracked == true)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage($"Cracks are appeared in cross-section for current force combination");
|
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 List<RebarPrimitive>? rebarPrimitives;
|
||||||
private IEnumerable<INdm> defaultNdms;
|
private IEnumerable<INdm> defaultNdms;
|
||||||
private IEnumerable<INdm> fulyCrackedNdms;
|
private IEnumerable<INdm> fulyCrackedNdms;
|
||||||
|
private IEnumerable<INdm> elasticNdms;
|
||||||
private CrackForceResult crackForceResult;
|
private CrackForceResult crackForceResult;
|
||||||
private StrainTuple longDefaultStrainTuple;
|
private StrainTuple longDefaultStrainTuple;
|
||||||
private StrainTuple shortDefaultStrainTuple;
|
private StrainTuple shortDefaultStrainTuple;
|
||||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
private ITriangulatePrimitiveLogic triangulateLogic;
|
||||||
|
private double longLength;
|
||||||
|
private double shortLength;
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public TupleCrackInputData InputData { get; set; }
|
public TupleCrackInputData InputData { get; set; }
|
||||||
@@ -66,27 +69,52 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
{
|
{
|
||||||
CheckInputData();
|
CheckInputData();
|
||||||
Triangulate();
|
Triangulate();
|
||||||
longDefaultStrainTuple = CalcStrainMatrix(InputData.LongTermTuple, defaultNdms);
|
longDefaultStrainTuple = CalcStrainMatrix(InputData.LongTermTuple as ForceTuple, defaultNdms);
|
||||||
shortDefaultStrainTuple = CalcStrainMatrix(InputData.LongTermTuple, defaultNdms);
|
shortDefaultStrainTuple = CalcStrainMatrix(InputData.LongTermTuple as ForceTuple, defaultNdms);
|
||||||
var longLength = GetLengthBetweenCracks(longDefaultStrainTuple);
|
var longElasticStrainTuple = CalcStrainMatrix(InputData.LongTermTuple as ForceTuple, elasticNdms);
|
||||||
var shortLength = GetLengthBetweenCracks(shortDefaultStrainTuple);
|
var shortElasticStrainTuple = CalcStrainMatrix(InputData.ShortTermTuple as ForceTuple, elasticNdms);
|
||||||
|
if (result.IsValid == false) { return; }
|
||||||
|
longLength = GetLengthBetweenCracks(longElasticStrainTuple);
|
||||||
|
shortLength = GetLengthBetweenCracks(shortElasticStrainTuple);
|
||||||
CalcCrackForce();
|
CalcCrackForce();
|
||||||
var crackInputData = GetCrackInputData();
|
foreach (var rebar in rebarPrimitives)
|
||||||
|
{
|
||||||
|
RebarCrackCalculatorInputData rebarCalculatorData = GetRebarCalculatorInputData(rebar);
|
||||||
var calculator = new RebarCrackCalculator
|
var calculator = new RebarCrackCalculator
|
||||||
{
|
{
|
||||||
InputData = crackInputData,
|
InputData = rebarCalculatorData,
|
||||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||||
};
|
};
|
||||||
foreach (var item in rebarPrimitives)
|
|
||||||
{
|
|
||||||
crackInputData.RebarPrimitive = item;
|
|
||||||
calculator.Run();
|
calculator.Run();
|
||||||
var rebarResult = calculator.Result as RebarCrackResult;
|
var rebarResult = calculator.Result as RebarCrackResult;
|
||||||
result.RebarResults.Add(rebarResult);
|
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()
|
IForceTupleInputData inputData = new ForceTupleInputData()
|
||||||
{
|
{
|
||||||
@@ -100,29 +128,20 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
};
|
};
|
||||||
calculator.Run();
|
calculator.Run();
|
||||||
var forceResult = calculator.Result as IForcesTupleResult;
|
var forceResult = calculator.Result as IForcesTupleResult;
|
||||||
|
if (forceResult.IsValid == false)
|
||||||
|
{
|
||||||
|
result.IsValid = false;
|
||||||
|
result.Description += forceResult.Description;
|
||||||
|
}
|
||||||
var strain = TupleConverter.ConvertToStrainTuple(forceResult.LoaderResults.StrainMatrix);
|
var strain = TupleConverter.ConvertToStrainTuple(forceResult.LoaderResults.StrainMatrix);
|
||||||
return strain;
|
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)
|
private double GetLengthBetweenCracks(StrainTuple strainTuple)
|
||||||
{
|
{
|
||||||
var logic = new LengthBetweenCracksLogicSP63()
|
var logic = new LengthBetweenCracksLogicSP63()
|
||||||
{
|
{
|
||||||
NdmCollection = defaultNdms,
|
NdmCollection = elasticNdms,
|
||||||
TraceLogger = TraceLogger
|
TraceLogger = TraceLogger
|
||||||
};
|
};
|
||||||
logic.StrainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(strainTuple);
|
logic.StrainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(strainTuple);
|
||||||
@@ -138,6 +157,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
rebarPrimitives = triangulationLogic.GetRebarPrimitives();
|
rebarPrimitives = triangulationLogic.GetRebarPrimitives();
|
||||||
defaultNdms = triangulationLogic.GetNdmCollection();
|
defaultNdms = triangulationLogic.GetNdmCollection();
|
||||||
fulyCrackedNdms = triangulationLogic.GetCrackedNdmCollection();
|
fulyCrackedNdms = triangulationLogic.GetCrackedNdmCollection();
|
||||||
|
elasticNdms = triangulationLogic.GetElasticNdmCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CalcCrackForce()
|
private void CalcCrackForce()
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
|||||||
public IForceTuple LongTermTuple { get; set; }
|
public IForceTuple LongTermTuple { get; set; }
|
||||||
public IForceTuple ShortTermTuple { get; set; }
|
public IForceTuple ShortTermTuple { get; set; }
|
||||||
public bool IsCracked { 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 MaxLongTermCrackWidth => IsCracked? RebarResults.Select(x => x.LongTermResult.CrackWidth).Max() : 0d;
|
||||||
public double MaxShortTermCrackWidth => IsCracked? RebarResults.Select(x => x.ShortTermResult.CrackWidth).Max() : 0d;
|
public double MaxShortTermCrackWidth => IsCracked? RebarResults.Select(x => x.ShortTermResult.CrackWidth).Max() : 0d;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using LoaderCalculator.Data.Ndms;
|
using LoaderCalculator.Data.Ndms;
|
||||||
|
using StructureHelper.Models.Materials;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
@@ -31,13 +32,27 @@ namespace StructureHelperLogics.Services.NdmPrimitives
|
|||||||
List<INdm> ndmCollection = new();
|
List<INdm> ndmCollection = new();
|
||||||
if (Primitive.HeadMaterial.HelperMaterial is ICrackedMaterial)
|
if (Primitive.HeadMaterial.HelperMaterial is ICrackedMaterial)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage($"Primitive {Primitive.Name} is crackable primitive", TraceLogStatuses.Service);
|
ProcessICracked(ndmCollection);
|
||||||
var newPrimititve = Primitive.Clone() as INdmPrimitive;
|
|
||||||
SetNewMaterial(newPrimititve);
|
|
||||||
List<INdm> ndms = GetNdms(newPrimititve);
|
|
||||||
ndmCollection.AddRange(ndms);
|
|
||||||
}
|
}
|
||||||
else if (Primitive is RebarPrimitive rebar)
|
else if (Primitive is RebarPrimitive rebar)
|
||||||
|
{
|
||||||
|
ProcessRebar(ndmCollection, rebar);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ProcessNonCracked(ndmCollection);
|
||||||
|
}
|
||||||
|
return ndmCollection;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProcessNonCracked(List<INdm> ndmCollection)
|
||||||
|
{
|
||||||
|
TraceLogger?.AddMessage($"Primitive {Primitive.Name} is non-crackable primitive", TraceLogStatuses.Service);
|
||||||
|
List<INdm> ndms = GetNdms(Primitive);
|
||||||
|
ndmCollection.AddRange(ndms);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProcessRebar(List<INdm> ndmCollection, RebarPrimitive rebar)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage($"Primitive {Primitive.Name} is rebar primitive", TraceLogStatuses.Service);
|
TraceLogger?.AddMessage($"Primitive {Primitive.Name} is rebar primitive", TraceLogStatuses.Service);
|
||||||
var newPrimititve = rebar.Clone() as RebarPrimitive;
|
var newPrimititve = rebar.Clone() as RebarPrimitive;
|
||||||
@@ -47,22 +62,25 @@ namespace StructureHelperLogics.Services.NdmPrimitives
|
|||||||
List<INdm> ndms = GetNdms(newPrimititve);
|
List<INdm> ndms = GetNdms(newPrimititve);
|
||||||
ndmCollection.AddRange(ndms);
|
ndmCollection.AddRange(ndms);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
private void ProcessICracked(List<INdm> ndmCollection)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage($"Primitive {Primitive.Name} is non-crackable primitive", TraceLogStatuses.Service);
|
TraceLogger?.AddMessage($"Primitive {Primitive.Name} is crackable primitive", TraceLogStatuses.Service);
|
||||||
List<INdm> ndms = GetNdms(Primitive);
|
var newPrimititve = Primitive.Clone() as INdmPrimitive;
|
||||||
|
SetNewMaterial(newPrimititve);
|
||||||
|
List<INdm> ndms = GetNdms(newPrimititve);
|
||||||
ndmCollection.AddRange(ndms);
|
ndmCollection.AddRange(ndms);
|
||||||
}
|
}
|
||||||
return ndmCollection;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetNewMaterial(INdmPrimitive? newPrimititve)
|
private void SetNewMaterial(INdmPrimitive? newPrimititve)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage($"Process material {newPrimititve.HeadMaterial.Name} has started");
|
TraceLogger?.AddMessage($"Process material {newPrimititve.HeadMaterial.Name} has started");
|
||||||
var newMaterial = newPrimititve.HeadMaterial.HelperMaterial.Clone() as ICrackedMaterial;
|
var newHeadMaterial = newPrimititve.HeadMaterial.Clone() as IHeadMaterial;
|
||||||
|
var newMaterial = newHeadMaterial.HelperMaterial.Clone() as ICrackedMaterial;
|
||||||
TraceLogger?.AddMessage($"Set work in tension zone for material {newPrimititve.HeadMaterial.Name}");
|
TraceLogger?.AddMessage($"Set work in tension zone for material {newPrimititve.HeadMaterial.Name}");
|
||||||
newMaterial.TensionForSLS = false;
|
newMaterial.TensionForSLS = false;
|
||||||
newPrimititve.HeadMaterial.HelperMaterial = newMaterial as IHelperMaterial;
|
newHeadMaterial.HelperMaterial = newMaterial as IHelperMaterial;
|
||||||
|
newPrimititve.HeadMaterial = newHeadMaterial;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<INdm> GetNdms(INdmPrimitive primitive)
|
private List<INdm> GetNdms(INdmPrimitive primitive)
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
using LoaderCalculator.Data.Ndms;
|
||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Models;
|
||||||
|
using StructureHelperCommon.Models.Loggers;
|
||||||
|
using StructureHelperLogics.Models.Primitives;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
|
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Services.NdmPrimitives
|
||||||
|
{
|
||||||
|
internal class MeshElasticLogic : IMeshPrimitiveLogic
|
||||||
|
{
|
||||||
|
private IMeshPrimitiveLogic regularMeshLogic;
|
||||||
|
public INdmPrimitive Primitive { get; set; }
|
||||||
|
public ITriangulationOptions TriangulationOptions { get; set; }
|
||||||
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
|
public List<INdm> MeshPrimitive()
|
||||||
|
{
|
||||||
|
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||||
|
CheckInputData();
|
||||||
|
List<INdm> ndms = new();
|
||||||
|
regularMeshLogic = new MeshPrimitiveLogic()
|
||||||
|
{
|
||||||
|
Primitive = Primitive,
|
||||||
|
TriangulationOptions = TriangulationOptions,
|
||||||
|
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||||
|
};
|
||||||
|
ndms.AddRange(regularMeshLogic.MeshPrimitive());
|
||||||
|
foreach (var ndm in ndms)
|
||||||
|
{
|
||||||
|
var material = ndm.Material;
|
||||||
|
var materialFunc = material.Diagram;
|
||||||
|
var newMaterialFunc = (IEnumerable<double> parameters, double strain) => strain * material.InitModulus;
|
||||||
|
var existingPrestrain = ndm.Prestrain;
|
||||||
|
var newPrestrain = materialFunc(null, existingPrestrain) / material.InitModulus;
|
||||||
|
ndm.Material.Diagram = newMaterialFunc;
|
||||||
|
ndm.Prestrain = newPrestrain;
|
||||||
|
}
|
||||||
|
return ndms;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckInputData()
|
||||||
|
{
|
||||||
|
if (Primitive is null)
|
||||||
|
{
|
||||||
|
string errorMessage = string.Intern(ErrorStrings.ParameterIsNull);
|
||||||
|
TraceLogger?.AddMessage(errorMessage, TraceLogStatuses.Error);
|
||||||
|
throw new StructureHelperException(errorMessage);
|
||||||
|
}
|
||||||
|
if (TriangulationOptions.LimiteState is not LimitStates.SLS)
|
||||||
|
{
|
||||||
|
string errorMessage = string.Intern(ErrorStrings.DataIsInCorrect + $": Limit state for cracking must correspondent limit state of serviceability");
|
||||||
|
TraceLogger?.AddMessage(errorMessage, TraceLogStatuses.Error);
|
||||||
|
throw new StructureHelperException(errorMessage);
|
||||||
|
}
|
||||||
|
if (TriangulationOptions.CalcTerm is not CalcTerms.ShortTerm)
|
||||||
|
{
|
||||||
|
string errorMessage = string.Intern(ErrorStrings.DataIsInCorrect + $": Calc term for cracked concrete must correspondent short term");
|
||||||
|
TraceLogger?.AddMessage(errorMessage, TraceLogStatuses.Error);
|
||||||
|
throw new StructureHelperException(errorMessage);
|
||||||
|
}
|
||||||
|
TraceLogger?.AddMessage($"Primitive check is ok");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user