Tests of crack calculator were added
This commit is contained in:
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CheckCrackForceCalculatorInputData : ICheckInputDataLogic<ICrackForceCalculatorInputData>
|
||||
public class CheckCrackForceCalculatorInputDataLogic : ICheckInputDataLogic<ICrackForceCalculatorInputData>
|
||||
{
|
||||
private string checkResult;
|
||||
private bool result;
|
||||
@@ -0,0 +1,78 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CheckCrackWidthSP63InputDataLogic : ICheckInputDataLogic<CrackWidthLogicInputDataSP63>
|
||||
{
|
||||
private string checkResult;
|
||||
private bool result;
|
||||
|
||||
public CrackWidthLogicInputDataSP63 InputData { get; set; }
|
||||
|
||||
public string CheckResult => checkResult;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public CheckCrackWidthSP63InputDataLogic(IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public CheckCrackWidthSP63InputDataLogic() :this(null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
result = true;
|
||||
checkResult = string.Empty;
|
||||
string errorString;
|
||||
if (InputData.LengthBetweenCracks <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": length between cracks Lcrc={InputData.LengthBetweenCracks} must be greater than zero";
|
||||
TraceMessage(errorString);
|
||||
result = false;
|
||||
}
|
||||
if (InputData.TermFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Term factor fi1 {InputData.TermFactor} must be greater than zero";
|
||||
TraceMessage(errorString);
|
||||
result = false;
|
||||
}
|
||||
if (InputData.BondFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Bond factor fi2 {InputData.BondFactor} must be greater than zero";
|
||||
TraceMessage(errorString);
|
||||
result = false;
|
||||
}
|
||||
if (InputData.StressStateFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Stress factor fi3 factor {InputData.StressStateFactor} must be greater than zero";
|
||||
TraceMessage(errorString);
|
||||
result = false;
|
||||
}
|
||||
if (InputData.PsiSFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": PsiS factor {InputData.PsiSFactor} must be greater than zero";
|
||||
TraceMessage(errorString);
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString + "\n";
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
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.NdmCalculations.Cracking
|
||||
{
|
||||
public class CheckRebarCrackCalculatorInputDataLogic : ICheckInputDataLogic<IRebarCrackCalculatorInputData>
|
||||
{
|
||||
private string checkResult;
|
||||
private bool result;
|
||||
|
||||
public IRebarCrackCalculatorInputData InputData { get; set; }
|
||||
|
||||
public string CheckResult => checkResult;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
result = true;
|
||||
checkResult = string.Empty;
|
||||
if (InputData is null)
|
||||
{
|
||||
TraceMessage(ErrorStrings.ParameterIsNull + ": input data");
|
||||
result = false;
|
||||
}
|
||||
if (InputData.LongRebarData is null)
|
||||
{
|
||||
TraceMessage(ErrorStrings.ParameterIsNull + ": long term input data for rebar");
|
||||
result = false;
|
||||
}
|
||||
if (InputData.ShortRebarData is null)
|
||||
{
|
||||
TraceMessage(ErrorStrings.ParameterIsNull + ": short term input data for rebar");
|
||||
result = false;
|
||||
}
|
||||
if (InputData.RebarPrimitive is null)
|
||||
{
|
||||
TraceMessage(ErrorStrings.ParameterIsNull + ": rebar primitive");
|
||||
result = false;
|
||||
}
|
||||
if (InputData.UserCrackInputData is null)
|
||||
{
|
||||
TraceMessage(ErrorStrings.ParameterIsNull + ": user crack input data");
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString + "\n";
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ using System.Threading.Tasks;
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class CheckTupleCalculatorInputData : ICheckInputDataLogic<TupleCrackInputData>
|
||||
public class CheckTupleCalculatorInputDataLogic : ICheckInputDataLogic<TupleCrackInputData>
|
||||
{
|
||||
const string userDataIsNull = "User crack input data is null";
|
||||
private const string CollectionOfPrimitivesIsNull = "Collection does not have any primitives";
|
||||
@@ -45,7 +45,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
forceTupleCalculator = new ForceTupleCalculator();
|
||||
InputData = new CrackForceCalculatorInputData();
|
||||
}
|
||||
public CrackForceBynarySearchCalculator() : this(new IsSectionCrackedByFactorLogic(), new CheckCrackForceCalculatorInputData())
|
||||
public CrackForceBynarySearchCalculator() : this(new IsSectionCrackedByFactorLogic(), new CheckCrackForceCalculatorInputDataLogic())
|
||||
{
|
||||
|
||||
}
|
||||
@@ -195,7 +195,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
ForceTupleInputData inputData = new();
|
||||
inputData.NdmCollection = InputData.SectionNdmCollection;
|
||||
inputData.Tuple = forceTuple;
|
||||
inputData.ForceTuple = forceTuple;
|
||||
forceTupleCalculator.InputData = inputData;
|
||||
forceTupleCalculator.Run();
|
||||
var result = forceTupleCalculator.Result as IForcesTupleResult;
|
||||
|
||||
@@ -9,19 +9,54 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Result of crack calculation
|
||||
/// </summary>
|
||||
public class CrackForceResult : IResult
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool IsValid { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// True when section is cracked
|
||||
/// </summary>
|
||||
public bool IsSectionCracked { get; set; }
|
||||
/// <summary>
|
||||
/// Factor of load beetwen start tuple and end tuple when cracks are appeared
|
||||
/// </summary>
|
||||
public double FactorOfCrackAppearance { get; set; }
|
||||
/// <summary>
|
||||
/// Start force tuple of range where force of cracking is looking for
|
||||
/// </summary>
|
||||
public IForceTuple StartTuple { get; set; }
|
||||
/// <summary>
|
||||
/// End force tuple of range where force of cracking is looking for
|
||||
/// </summary>
|
||||
public IForceTuple EndTuple { get; set; }
|
||||
/// <summary>
|
||||
/// Force tuple which correspondent to first crack appearence
|
||||
/// </summary>
|
||||
public IForceTuple TupleOfCrackAppearance { get; set; }
|
||||
/// <summary>
|
||||
/// General curvature in cracked section
|
||||
/// </summary>
|
||||
public StrainTuple CrackedStrainTuple { get; set; }
|
||||
/// <summary>
|
||||
/// Average general curvature with considering of cracking
|
||||
/// </summary>
|
||||
public StrainTuple ReducedStrainTuple { get; set; }
|
||||
/// <summary>
|
||||
/// Factor of softening of stifness with considering of cracks
|
||||
/// </summary>
|
||||
public StrainTuple SofteningFactors { get; set; }
|
||||
/// <summary>
|
||||
/// Collection of ndms which crack properties looking for
|
||||
/// </summary>
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
/// <summary>
|
||||
/// Common softening factor
|
||||
/// </summary>
|
||||
public double PsiS { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CrackInputDataUpdateStrategy : IUpdateStrategy<CrackCalculatorInputData>
|
||||
{
|
||||
private IUpdateStrategy<UserCrackInputData> userCrackInputDataUpdateStrategy;
|
||||
public CrackInputDataUpdateStrategy(IUpdateStrategy<UserCrackInputData> userCrackInputDataUpdateStrategy)
|
||||
private IUpdateStrategy<IUserCrackInputData> userCrackInputDataUpdateStrategy;
|
||||
public CrackInputDataUpdateStrategy(IUpdateStrategy<IUserCrackInputData> userCrackInputDataUpdateStrategy)
|
||||
{
|
||||
this.userCrackInputDataUpdateStrategy = userCrackInputDataUpdateStrategy;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CrackWidthCalculationLogic : ICrackWidthCalculationLogic
|
||||
{
|
||||
private ICrackWidthLogic crackWidthLogic;
|
||||
private RebarCrackResult result;
|
||||
private ICrackSofteningLogic crackSofteningLogic;
|
||||
private RebarStressResult rebarStressResult;
|
||||
private ICrackWidthLogicInputData acrc2InputData;
|
||||
private ICrackWidthLogicInputData acrc1InputData;
|
||||
private ICrackWidthLogicInputData acrc3InputData;
|
||||
/// <summary>
|
||||
/// Width of crack from long term loads with long term properties of concrete
|
||||
/// </summary>
|
||||
private double longTermLoadLongTermConcreteCrackWidth;
|
||||
/// <summary>
|
||||
/// Width of crack from full (include short term) loads with short term properties of concrete
|
||||
/// </summary>
|
||||
private double fullLoadShortConcreteCrackWidth;
|
||||
/// <summary>
|
||||
/// Width of crack from long term loads with short term properties of concrete
|
||||
/// </summary>
|
||||
private double longTermLoadShortConcreteWidth;
|
||||
private IRebarStressCalculator rebarStressCalculator;
|
||||
|
||||
public IRebarCrackCalculatorInputData InputData { get; set; }
|
||||
public RebarCrackResult Result => result;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public CrackWidthCalculationLogic(IRebarStressCalculator rebarStressCalculator, ICrackWidthLogic crackWidthLogic, IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.rebarStressCalculator = rebarStressCalculator;
|
||||
this.crackWidthLogic = crackWidthLogic;
|
||||
this.TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public CrackWidthCalculationLogic() : this (new RebarStressCalculator(), new CrackWidthLogicSP63(), null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
PrepareNewResult();
|
||||
ProcessCrackWidthCalculation();
|
||||
}
|
||||
|
||||
private void PrepareNewResult()
|
||||
{
|
||||
result = new()
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
private void ProcessCrackWidthCalculation()
|
||||
{
|
||||
CrackWidthRebarTupleResult longRebarResult = ProcessLongTermCalculations();
|
||||
CrackWidthRebarTupleResult shortRebarResult = ProcessShortTermCalculations();
|
||||
result.LongTermResult = longRebarResult;
|
||||
result.ShortTermResult = shortRebarResult;
|
||||
}
|
||||
|
||||
public CrackWidthRebarTupleResult ProcessShortTermCalculations()
|
||||
{
|
||||
crackSofteningLogic = GetSofteningLogic(InputData.ShortRebarData);
|
||||
rebarStressResult = GetRebarStressResult(InputData.ShortRebarData);
|
||||
acrc2InputData = GetCrackWidthInputData(crackSofteningLogic, InputData.ShortRebarData, CalcTerms.ShortTerm);
|
||||
|
||||
crackWidthLogic.InputData = acrc3InputData;
|
||||
longTermLoadShortConcreteWidth = crackWidthLogic.GetCrackWidth();
|
||||
crackWidthLogic.InputData = acrc2InputData;
|
||||
fullLoadShortConcreteCrackWidth = crackWidthLogic.GetCrackWidth();
|
||||
|
||||
double acrcShort = longTermLoadLongTermConcreteCrackWidth + fullLoadShortConcreteCrackWidth - longTermLoadShortConcreteWidth;
|
||||
TraceLogger?.AddMessage($"Short crack width acrc = acrc,1 + acrc,2 - acrc,3 = {longTermLoadLongTermConcreteCrackWidth} + {fullLoadShortConcreteCrackWidth} - {longTermLoadShortConcreteWidth} = {acrcShort}(m)");
|
||||
var shortRebarResult = new CrackWidthRebarTupleResult()
|
||||
{
|
||||
CrackWidth = acrcShort,
|
||||
UltimateCrackWidth = InputData.UserCrackInputData.UltimateShortCrackWidth,
|
||||
RebarStressResult = rebarStressResult,
|
||||
SofteningFactor = crackSofteningLogic.GetSofteningFactor()
|
||||
};
|
||||
TraceCrackResult(shortRebarResult);
|
||||
return shortRebarResult;
|
||||
}
|
||||
|
||||
public CrackWidthRebarTupleResult ProcessLongTermCalculations()
|
||||
{
|
||||
crackSofteningLogic = GetSofteningLogic(InputData.LongRebarData);
|
||||
rebarStressResult = GetRebarStressResult(InputData.LongRebarData);
|
||||
acrc1InputData = GetCrackWidthInputData(crackSofteningLogic, InputData.LongRebarData, CalcTerms.LongTerm);
|
||||
acrc3InputData = GetCrackWidthInputData(crackSofteningLogic, InputData.LongRebarData, CalcTerms.ShortTerm);
|
||||
crackWidthLogic.InputData = acrc1InputData;
|
||||
longTermLoadLongTermConcreteCrackWidth = crackWidthLogic.GetCrackWidth();
|
||||
var longRebarResult = new CrackWidthRebarTupleResult()
|
||||
{
|
||||
CrackWidth = longTermLoadLongTermConcreteCrackWidth,
|
||||
UltimateCrackWidth = InputData.UserCrackInputData.UltimateLongCrackWidth,
|
||||
RebarStressResult = rebarStressResult,
|
||||
SofteningFactor = crackSofteningLogic.GetSofteningFactor()
|
||||
};
|
||||
TraceLogger?.AddMessage($"Long crack width acrc = acrc,1 = {longTermLoadLongTermConcreteCrackWidth}(m)");
|
||||
TraceLogger?.AddMessage($"Ultimate long crack width acrc,ult = {longRebarResult.UltimateCrackWidth}(m)");
|
||||
TraceCrackResult(longRebarResult);
|
||||
return longRebarResult;
|
||||
}
|
||||
|
||||
private void TraceCrackResult(CrackWidthRebarTupleResult rebarResult)
|
||||
{
|
||||
if (rebarResult.IsCrackLessThanUltimate == false)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Checking crack width is failure, actual crack width acrc = {rebarResult.CrackWidth} > ultimate crack width acrc,ult = {rebarResult.UltimateCrackWidth}", TraceLogStatuses.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger?.AddMessage($"Checking crack width is ok, actual crack width acrc = {rebarResult.CrackWidth} <= ultimate crack width acrc,ult = {rebarResult.UltimateCrackWidth}");
|
||||
}
|
||||
}
|
||||
|
||||
private ICrackSofteningLogic GetSofteningLogic(IRebarCrackInputData rebarData)
|
||||
{
|
||||
ICrackSofteningLogic crackSofteningLogic;
|
||||
if (InputData.UserCrackInputData.SetSofteningFactor == true)
|
||||
{
|
||||
crackSofteningLogic = new StabSoftetingLogic(InputData.UserCrackInputData.SofteningFactor)
|
||||
{
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
crackSofteningLogic = new RebarStressSofteningLogic()
|
||||
{
|
||||
RebarPrimitive = InputData.RebarPrimitive,
|
||||
InputData = rebarData,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
}
|
||||
return crackSofteningLogic;
|
||||
}
|
||||
|
||||
private ICrackWidthLogicInputData GetCrackWidthInputData(ICrackSofteningLogic crackSofteningLogic, IRebarCrackInputData inputData, CalcTerms calcTerm)
|
||||
{
|
||||
|
||||
var factoryInputData = new CrackWidthLogicInputDataFactory(crackSofteningLogic)
|
||||
{
|
||||
CalcTerm = calcTerm,
|
||||
InputData = inputData,
|
||||
RebarStrain = rebarStressResult.RebarStrain,
|
||||
ConcreteStrain = rebarStressResult.ConcreteStrain,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
var crackWidthInputData = factoryInputData.GetCrackWidthLogicInputData();
|
||||
return crackWidthInputData;
|
||||
}
|
||||
|
||||
public RebarStressResult GetRebarStressResult(IRebarCrackInputData inputData)
|
||||
{
|
||||
rebarStressCalculator.InputData.ForceTuple = inputData.ForceTuple;
|
||||
rebarStressCalculator.InputData.NdmCollection = inputData.CrackedNdmCollection;
|
||||
rebarStressCalculator.InputData.RebarPrimitive = InputData.RebarPrimitive;
|
||||
rebarStressCalculator.Run();
|
||||
var result = rebarStressCalculator.Result as RebarStressResult;
|
||||
if (result.IsValid == false)
|
||||
{
|
||||
string errorString = LoggerStrings.CalculationError + result.Description;
|
||||
TraceLogger?.AddMessage($"Rebar name: {InputData.RebarPrimitive.Name}\n" + errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public double RebarStrain { get; set; }
|
||||
public double ConcreteStrain { get; set; }
|
||||
public double Length { get; set; }
|
||||
public double LengthBetweenCracks { get; set; }
|
||||
public double TermFactor { get; set; }
|
||||
public double BondFactor { get; set; }
|
||||
public double StressStateFactor { get; set; }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using System;
|
||||
@@ -6,76 +7,85 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Documents;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CrackWidthLogicSP63 : ICrackWidthLogic
|
||||
{
|
||||
CrackWidthLogicInputDataSP63 inputData;
|
||||
private double widthOfCrack;
|
||||
private ICheckInputDataLogic<CrackWidthLogicInputDataSP63> checkInputDataLogic;
|
||||
|
||||
public ICrackWidthLogicInputData InputData {get;set;}
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public CrackWidthLogicSP63(ICheckInputDataLogic<CrackWidthLogicInputDataSP63> checkInputDataLogic, IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.checkInputDataLogic = checkInputDataLogic;
|
||||
this.TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public CrackWidthLogicSP63() : this (new CheckCrackWidthSP63InputDataLogic(), null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public double GetCrackWidth()
|
||||
{
|
||||
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.TermFactor}", 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);
|
||||
TraceLogger?.AddMessage("Method of crack width calculation based on SP 63.13330.2018");
|
||||
TraceInputData();
|
||||
//check if strain of concrete greater than strain of rebar
|
||||
CalculateWidthOfCrack();
|
||||
return widthOfCrack;
|
||||
}
|
||||
|
||||
private void CalculateWidthOfCrack()
|
||||
{
|
||||
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");
|
||||
return 0d;
|
||||
widthOfCrack = 0d;
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger?.AddMessage($"Rebar elongation Epsilon = {inputData.RebarStrain} - {inputData.ConcreteStrain} = {rebarElongation}(dimensionless)");
|
||||
widthOfCrack = rebarElongation * inputData.LengthBetweenCracks;
|
||||
widthOfCrack *= inputData.TermFactor * inputData.BondFactor * inputData.StressStateFactor * inputData.PsiSFactor;
|
||||
TraceLogger?.AddMessage($"Width of crack a,crc = {inputData.TermFactor} * {inputData.BondFactor} * {inputData.StressStateFactor} * {inputData.PsiSFactor} * {rebarElongation} * {inputData.LengthBetweenCracks}(m) = {widthOfCrack}(m)");
|
||||
}
|
||||
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 = {inputData.TermFactor} * {inputData.BondFactor} * {inputData.StressStateFactor} * {inputData.PsiSFactor} * {rebarElongation} * {inputData.Length}(m) = {width}(m)");
|
||||
return width;
|
||||
}
|
||||
|
||||
private void CheckOptions()
|
||||
private void TraceInputData()
|
||||
{
|
||||
TraceLogger?.AddMessage($"Term factor fi1 = {inputData.TermFactor}", 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.LengthBetweenCracks}", TraceLogStatuses.Service);
|
||||
}
|
||||
|
||||
private bool CheckOptions()
|
||||
{
|
||||
string errorString = string.Empty;
|
||||
if (InputData is not CrackWidthLogicInputDataSP63)
|
||||
{
|
||||
errorString = ErrorStrings.ExpectedWas(typeof(CrackWidthLogicInputDataSP63), InputData.GetType());
|
||||
}
|
||||
inputData = InputData as CrackWidthLogicInputDataSP63;
|
||||
if (inputData.Length <=0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": length between cracks Lcrc={inputData.Length} must be greater than zero";
|
||||
}
|
||||
if (inputData.TermFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Term factor fi1 {inputData.TermFactor} must be greater than zero";
|
||||
|
||||
}
|
||||
if (inputData.BondFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Bond factor fi2 {inputData.BondFactor} must be greater than zero";
|
||||
|
||||
}
|
||||
if (inputData.StressStateFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Stress factor fi3 factor {inputData.StressStateFactor} must be greater than zero";
|
||||
|
||||
}
|
||||
if (inputData.PsiSFactor <= 0d)
|
||||
{
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": PsiS factor {inputData.PsiSFactor} must be greater than zero";
|
||||
}
|
||||
if (errorString != string.Empty)
|
||||
{
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
inputData = InputData as CrackWidthLogicInputDataSP63;
|
||||
checkInputDataLogic.InputData = inputData;
|
||||
checkInputDataLogic.TraceLogger = TraceLogger;
|
||||
if (checkInputDataLogic.Check() != true)
|
||||
{
|
||||
throw new StructureHelperException(errorString);
|
||||
return false;
|
||||
}
|
||||
TraceLogger?.AddMessage($"Checking parameters has done succefully", TraceLogStatuses.Service);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
public double ConcreteStrain { get; set;}
|
||||
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public RebarCrackInputData InputData { get; set; }
|
||||
public IRebarCrackInputData InputData { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public CrackWidthLogicInputDataFactory(ICrackSofteningLogic softeningLogic)
|
||||
@@ -58,7 +58,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
data.PsiSFactor = softeningLogic.GetSofteningFactor();
|
||||
data.StressStateFactor = stressStateFactorLogic.GetStressStateFactor();
|
||||
data.BondFactor = 0.5d;
|
||||
data.Length = InputData.LengthBeetwenCracks;
|
||||
data.LengthBetweenCracks = InputData.LengthBeetwenCracks;
|
||||
data.ConcreteStrain = ConcreteStrain;
|
||||
data.RebarStrain = RebarStrain;
|
||||
return data;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface ICrackWidthCalculationLogic : ILogic
|
||||
{
|
||||
IRebarCrackCalculatorInputData InputData { get; set; }
|
||||
RebarCrackResult Result { get; }
|
||||
|
||||
void Run();
|
||||
CrackWidthRebarTupleResult ProcessLongTermCalculations();
|
||||
CrackWidthRebarTupleResult ProcessShortTermCalculations();
|
||||
RebarStressResult GetRebarStressResult(IRebarCrackInputData inputData);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -6,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface ICrackWidthLogicInputData
|
||||
public interface ICrackWidthLogicInputData : IInputData
|
||||
{
|
||||
/// <summary>
|
||||
/// strain of rebar, dimensionless
|
||||
@@ -19,6 +20,6 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// <summary>
|
||||
/// Length between cracks in meters
|
||||
/// </summary>
|
||||
double Length { get; set; }
|
||||
double LengthBetweenCracks { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Input data for rebar crack calculator
|
||||
/// </summary>
|
||||
public interface IRebarCrackCalculatorInputData : IInputData
|
||||
{
|
||||
/// <summary>
|
||||
/// Long term rebar data
|
||||
/// </summary>
|
||||
IRebarCrackInputData? LongRebarData { get; set; }
|
||||
/// <summary>
|
||||
/// Short term rebar data
|
||||
/// </summary>
|
||||
IRebarCrackInputData? ShortRebarData { get; set; }
|
||||
/// <summary>
|
||||
/// Rebar primitive
|
||||
/// </summary>
|
||||
IRebarPrimitive RebarPrimitive { get; set; }
|
||||
/// <summary>
|
||||
/// User settings for crack calculations
|
||||
/// </summary>
|
||||
IUserCrackInputData UserCrackInputData { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Input data for calculating of width of crack by ndm collection
|
||||
/// </summary>
|
||||
public interface IRebarCrackInputData : IInputData
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection of ndms where work of crackable material in tension was assigned according to material properties
|
||||
/// </summary>
|
||||
IEnumerable<INdm> CrackableNdmCollection { get; set; }
|
||||
/// <summary>
|
||||
/// Collection of ndms where work of concrete is disabled
|
||||
/// </summary>
|
||||
IEnumerable<INdm> CrackedNdmCollection { get; set; }
|
||||
/// <summary>
|
||||
/// Force tuple for calculation
|
||||
/// </summary>
|
||||
ForceTuple ForceTuple { get; set; }
|
||||
/// <summary>
|
||||
/// Base length beetwen cracks
|
||||
/// </summary>
|
||||
double LengthBeetwenCracks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface IRebarStressCalculator : ICalculator
|
||||
{
|
||||
IRebarStressCalculatorInputData InputData { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// Input data for rebar stress calculator
|
||||
/// </summary>
|
||||
public interface IRebarStressCalculatorInputData : IInputData
|
||||
{
|
||||
/// <summary>
|
||||
/// Force tuple for calculting
|
||||
/// </summary>
|
||||
ForceTuple ForceTuple { get; set; }
|
||||
/// <summary>
|
||||
/// Collection of ndms of cross-section (as usual without concrete tensile strength)
|
||||
/// </summary>
|
||||
IEnumerable<INdm> NdmCollection { get; set; }
|
||||
/// <summary>
|
||||
/// Rebar which stress and strain will be obtained for
|
||||
/// </summary>
|
||||
IRebarPrimitive RebarPrimitive { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface IUserCrackInputData : IInputData
|
||||
{
|
||||
double LengthBetweenCracks { get; set; }
|
||||
bool SetLengthBetweenCracks { get; set; }
|
||||
bool SetSofteningFactor { get; set; }
|
||||
double SofteningFactor { get; set; }
|
||||
double UltimateLongCrackWidth { get; set; }
|
||||
double UltimateShortCrackWidth { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
var inputData = new ForceTupleInputData()
|
||||
{
|
||||
Accuracy = Accuracy,
|
||||
Tuple = Tuple,
|
||||
ForceTuple = Tuple,
|
||||
NdmCollection = SectionNdmCollection
|
||||
};
|
||||
var calculator = new ForceTupleCalculator() { InputData = inputData };
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
@@ -10,10 +11,9 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class RebarCrackCalculator : IRebarCrackCalculator
|
||||
{
|
||||
private ICrackSofteningLogic crackSofteningLogic;
|
||||
private ICrackWidthLogic crackWidthLogic = new CrackWidthLogicSP63();
|
||||
private ICrackWidthCalculationLogic crackWidthCalculationLogic;
|
||||
private RebarCrackResult result;
|
||||
private RebarStressResult rebarStressResult;
|
||||
private ICheckInputDataLogic<IRebarCrackCalculatorInputData> checkInputDataLogic;
|
||||
|
||||
public string Name { get; set; }
|
||||
public RebarCrackCalculatorInputData InputData { get; set; }
|
||||
@@ -22,139 +22,89 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
public Action<IResult> ActionToOutputResults { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public RebarCrackCalculator(ICheckInputDataLogic<IRebarCrackCalculatorInputData> checkInputDataLogic,
|
||||
ICrackWidthCalculationLogic crackWidthCalculationLogic,
|
||||
IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.checkInputDataLogic = checkInputDataLogic;
|
||||
this.crackWidthCalculationLogic = crackWidthCalculationLogic;
|
||||
this.TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public RebarCrackCalculator()
|
||||
: this(new CheckRebarCrackCalculatorInputDataLogic(),
|
||||
new CrackWidthCalculationLogic(),
|
||||
null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Debug);
|
||||
result = new()
|
||||
{
|
||||
IsValid = true
|
||||
};
|
||||
TraceLogger?.AddMessage($"Rebar primitive {InputData.RebarPrimitive.Name}");
|
||||
PrepareNewResult();
|
||||
if (CheckInputData() != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//double acrc1 = GetCrackWidth()
|
||||
|
||||
|
||||
crackWidthLogic.TraceLogger = TraceLogger?.GetSimilarTraceLogger(50);
|
||||
try
|
||||
{
|
||||
GetSofteningLogic(InputData.LongRebarData);
|
||||
rebarStressResult = GetRebarStressResult(InputData.LongRebarData);
|
||||
var dataAcrc1 = GetCrackWidthInputData(InputData.LongRebarData, CalcTerms.LongTerm);
|
||||
var dataAcrc3 = GetCrackWidthInputData(InputData.LongRebarData, CalcTerms.ShortTerm);
|
||||
crackWidthLogic.InputData = dataAcrc1;
|
||||
var acrc1 = crackWidthLogic.GetCrackWidth();
|
||||
var longRebarResult = new CrackWidthRebarTupleResult()
|
||||
{
|
||||
CrackWidth = acrc1,
|
||||
UltimateCrackWidth = InputData.UserCrackInputData.UltimateLongCrackWidth,
|
||||
RebarStressResult = rebarStressResult,
|
||||
SofteningFactor = crackSofteningLogic.GetSofteningFactor()
|
||||
};
|
||||
TraceLogger?.AddMessage($"Long crack width acrc = acrc,1 = {acrc1}(m)");
|
||||
TraceLogger?.AddMessage($"Ultimate long crack width acrc,ult = {longRebarResult.UltimateCrackWidth}(m)");
|
||||
TraceCrackResult(longRebarResult);
|
||||
|
||||
|
||||
GetSofteningLogic(InputData.ShortRebarData);
|
||||
rebarStressResult = GetRebarStressResult(InputData.ShortRebarData);
|
||||
var dataAcrc2 = GetCrackWidthInputData(InputData.ShortRebarData, CalcTerms.ShortTerm);
|
||||
|
||||
crackWidthLogic.InputData = dataAcrc3;
|
||||
var acrc3 = crackWidthLogic.GetCrackWidth();
|
||||
crackWidthLogic.InputData = dataAcrc2;
|
||||
var acrc2 = crackWidthLogic.GetCrackWidth();
|
||||
|
||||
double acrcShort = acrc1 + acrc2 - acrc3;
|
||||
TraceLogger?.AddMessage($"Short crack width acrc = acrc,1 + acrc,2 - acrc,3 = {acrc1} + {acrc2} - {acrc3} = {acrcShort}(m)");
|
||||
var shortRebarResult = new CrackWidthRebarTupleResult()
|
||||
{
|
||||
CrackWidth = acrcShort,
|
||||
UltimateCrackWidth = InputData.UserCrackInputData.UltimateShortCrackWidth,
|
||||
RebarStressResult = rebarStressResult,
|
||||
SofteningFactor = crackSofteningLogic.GetSofteningFactor()
|
||||
};
|
||||
TraceCrackResult(shortRebarResult);
|
||||
result.LongTermResult = longRebarResult;
|
||||
result.ShortTermResult = shortRebarResult;
|
||||
ProcessCrackWidthCalculation();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Error of crack width calculation {ex}", TraceLogStatuses.Error);
|
||||
result.IsValid = false;
|
||||
result.Description += "\n" + ex;
|
||||
ProcessIncorrectCalculation(ex);
|
||||
}
|
||||
result.RebarPrimitive = InputData.RebarPrimitive;
|
||||
}
|
||||
|
||||
private void TraceCrackResult(CrackWidthRebarTupleResult rebarResult)
|
||||
private bool CheckInputData()
|
||||
{
|
||||
if (rebarResult.IsCrackLessThanUltimate == false)
|
||||
checkInputDataLogic.InputData = InputData;
|
||||
checkInputDataLogic.TraceLogger = TraceLogger;
|
||||
if (checkInputDataLogic.Check() == true)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Checking crack width is failure, actual crack width acrc = {rebarResult.CrackWidth} > ultimate crack width acrc,ult = {rebarResult.UltimateCrackWidth}", TraceLogStatuses.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger?.AddMessage($"Checking crack width is ok, actual crack width acrc = {rebarResult.CrackWidth} <= ultimate crack width acrc,ult = {rebarResult.UltimateCrackWidth}");
|
||||
return true;
|
||||
}
|
||||
result.IsValid = false;
|
||||
result.Description += checkInputDataLogic.CheckResult;
|
||||
return false;
|
||||
}
|
||||
|
||||
private void GetSofteningLogic(RebarCrackInputData rebarData)
|
||||
private void ProcessIncorrectCalculation(Exception ex)
|
||||
{
|
||||
if (InputData.UserCrackInputData.SetSofteningFactor == true)
|
||||
{
|
||||
crackSofteningLogic = new StabSoftetingLogic(InputData.UserCrackInputData.SofteningFactor)
|
||||
{
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
crackSofteningLogic = new RebarStressSofteningLogic()
|
||||
{
|
||||
RebarPrimitive = InputData.RebarPrimitive,
|
||||
InputData = rebarData,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
}
|
||||
TraceLogger?.AddMessage($"Error of crack width calculation {ex}", TraceLogStatuses.Error);
|
||||
result.IsValid = false;
|
||||
result.Description += "\n" + ex;
|
||||
}
|
||||
|
||||
private ICrackWidthLogicInputData GetCrackWidthInputData(RebarCrackInputData inputData, CalcTerms calcTerm)
|
||||
private void ProcessCrackWidthCalculation()
|
||||
{
|
||||
|
||||
var factoryInputData = new CrackWidthLogicInputDataFactory(crackSofteningLogic)
|
||||
crackWidthCalculationLogic.TraceLogger = TraceLogger;
|
||||
crackWidthCalculationLogic.InputData = InputData;
|
||||
crackWidthCalculationLogic.Run();
|
||||
if (crackWidthCalculationLogic.Result.IsValid == true)
|
||||
{
|
||||
CalcTerm = calcTerm,
|
||||
InputData = inputData,
|
||||
RebarStrain = rebarStressResult.RebarStrain,
|
||||
ConcreteStrain = rebarStressResult.ConcreteStrain,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
result = crackWidthCalculationLogic.Result;
|
||||
return;
|
||||
}
|
||||
result.IsValid = false;
|
||||
result.Description += crackWidthCalculationLogic.Result.Description;
|
||||
}
|
||||
|
||||
private void PrepareNewResult()
|
||||
{
|
||||
result = new()
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty,
|
||||
};
|
||||
var crackWidthInputData = factoryInputData.GetCrackWidthLogicInputData();
|
||||
return crackWidthInputData;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private RebarStressResult GetRebarStressResult(RebarCrackInputData inputData)
|
||||
{
|
||||
var calculator = new RebarStressCalculator()
|
||||
{
|
||||
ForceTuple = inputData.ForceTuple,
|
||||
NdmCollection = inputData.CrackedNdmCollection,
|
||||
RebarPrimitive = InputData.RebarPrimitive
|
||||
};
|
||||
calculator.Run();
|
||||
var result = calculator.Result as RebarStressResult;
|
||||
if (result.IsValid == false)
|
||||
{
|
||||
string errorString = LoggerStrings.CalculationError + result.Description;
|
||||
TraceLogger?.AddMessage($"Rebar name: {InputData.RebarPrimitive.Name}\n" + errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,17 +12,15 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// <summary>
|
||||
/// Class of input data for rebar crack calculator
|
||||
/// </summary>
|
||||
public class RebarCrackCalculatorInputData : IInputData
|
||||
public class RebarCrackCalculatorInputData : IRebarCrackCalculatorInputData
|
||||
{
|
||||
/// <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; }
|
||||
public UserCrackInputData UserCrackInputData { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public IRebarCrackInputData? LongRebarData { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public IRebarCrackInputData? ShortRebarData { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public IRebarPrimitive RebarPrimitive { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public IUserCrackInputData? UserCrackInputData { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,23 +11,16 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class RebarCrackInputData : IInputData
|
||||
/// <inheritdoc/>
|
||||
public class RebarCrackInputData : IRebarCrackInputData
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection of ndms where work of crackable material in tension was assigned according to material properties
|
||||
/// </summary>
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<INdm> CrackableNdmCollection { get; set; }
|
||||
/// <summary>
|
||||
/// Collection of ndms where work of concrete is disabled
|
||||
/// </summary>
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<INdm> CrackedNdmCollection { get; set; }
|
||||
/// <summary>
|
||||
/// Force tuple for calculation
|
||||
/// </summary>
|
||||
/// <inheritdoc/>
|
||||
public ForceTuple ForceTuple { get; set; }
|
||||
/// <summary>
|
||||
/// Base length beetwen cracks
|
||||
/// </summary>
|
||||
/// <inheritdoc/>
|
||||
public double LengthBeetwenCracks { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// <summary>
|
||||
/// Specific rebar primitive
|
||||
/// </summary>
|
||||
public RebarPrimitive RebarPrimitive { get; set; }
|
||||
public IRebarPrimitive RebarPrimitive { get; set; }
|
||||
/// <summary>
|
||||
/// Result of calculation of crack for long term
|
||||
/// </summary>
|
||||
|
||||
@@ -12,28 +12,75 @@ using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class RebarStressCalculator : ICalculator
|
||||
public class RebarStressCalculator : IRebarStressCalculator
|
||||
{
|
||||
private const CalcTerms termOfLoadForCrackCalculation = CalcTerms.ShortTerm;
|
||||
private const LimitStates limitStateForCrackCalcultion = LimitStates.SLS;
|
||||
private IStressLogic stressLogic;
|
||||
private Ndm concreteNdm;
|
||||
private RebarNdm rebarNdm;
|
||||
private RebarStressResult result;
|
||||
|
||||
public ForceTuple ForceTuple { get; set; }
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
public RebarPrimitive RebarPrimitive { get; set; }
|
||||
public IRebarStressCalculatorInputData InputData { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public IResult Result => result;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public StrainTuple GetStrainTuple()
|
||||
|
||||
public RebarStressCalculator(IStressLogic stressLogic)
|
||||
{
|
||||
this.stressLogic = stressLogic;
|
||||
InputData = new RebarStressCalculatorInputData();
|
||||
}
|
||||
public RebarStressCalculator() : this(new StressLogic())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void Run()
|
||||
{
|
||||
PrepareNewResult();
|
||||
if (CheckInputData() != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
GetNdmCollectionByPrimitives();
|
||||
ProcessResult();
|
||||
}
|
||||
|
||||
private bool CheckInputData()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private void ProcessResult()
|
||||
{
|
||||
var strainTuple = GetStrainTuple();
|
||||
result.StrainTuple = strainTuple;
|
||||
var strainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(strainTuple);
|
||||
result.RebarStrain = stressLogic.GetSectionStrain(strainMatrix, rebarNdm);
|
||||
result.RebarStress = stressLogic.GetStress(strainMatrix, rebarNdm);
|
||||
result.ConcreteStrain = -concreteNdm.Prestrain;
|
||||
}
|
||||
|
||||
private void PrepareNewResult()
|
||||
{
|
||||
result = new RebarStressResult()
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty
|
||||
};
|
||||
}
|
||||
|
||||
private StrainTuple GetStrainTuple()
|
||||
{
|
||||
IForceTupleInputData inputData = new ForceTupleInputData()
|
||||
{
|
||||
NdmCollection = NdmCollection,
|
||||
Tuple = ForceTuple
|
||||
NdmCollection = InputData.NdmCollection,
|
||||
ForceTuple = InputData.ForceTuple
|
||||
};
|
||||
IForceTupleCalculator calculator = new ForceTupleCalculator()
|
||||
{
|
||||
@@ -50,45 +97,19 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
var strain = TupleConverter.ConvertToStrainTuple(forceResult.LoaderResults.StrainMatrix);
|
||||
return strain;
|
||||
}
|
||||
public RebarStressCalculator(IStressLogic stressLogic)
|
||||
{
|
||||
this.stressLogic = stressLogic;
|
||||
}
|
||||
public RebarStressCalculator() : this(new StressLogic())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void Run()
|
||||
{
|
||||
GetNdmCollectionFromPrimitives();
|
||||
result = new RebarStressResult()
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty
|
||||
};
|
||||
var strainTuple = GetStrainTuple();
|
||||
result.StrainTuple = strainTuple;
|
||||
var strainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(strainTuple);
|
||||
result.RebarStrain = stressLogic.GetSectionStrain(strainMatrix, rebarNdm);
|
||||
result.RebarStress = stressLogic.GetStress(strainMatrix, rebarNdm);
|
||||
result.ConcreteStrain = - concreteNdm.Prestrain;
|
||||
}
|
||||
|
||||
|
||||
private void GetNdmCollectionFromPrimitives()
|
||||
private void GetNdmCollectionByPrimitives()
|
||||
{
|
||||
var options = new TriangulationOptions()
|
||||
{
|
||||
CalcTerm = CalcTerms.ShortTerm,
|
||||
LimiteState = LimitStates.SLS,
|
||||
CalcTerm = termOfLoadForCrackCalculation,
|
||||
LimiteState = limitStateForCrackCalcultion,
|
||||
};
|
||||
concreteNdm = RebarPrimitive.GetConcreteNdm(options);
|
||||
concreteNdm = InputData.RebarPrimitive.GetConcreteNdm(options);
|
||||
concreteNdm.StressScale = 1d;
|
||||
rebarNdm = RebarPrimitive.GetRebarNdm(options);
|
||||
rebarNdm = InputData.RebarPrimitive.GetRebarNdm(options);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
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
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class RebarStressCalculatorInputData : IRebarStressCalculatorInputData
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public ForceTuple ForceTuple { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public IRebarPrimitive RebarPrimitive { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,15 +8,30 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Result of calculation of stress and strain in rebar
|
||||
/// </summary>
|
||||
public class RebarStressResult : IResult
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool IsValid { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public string? Description { get; set; }
|
||||
/// <summary>
|
||||
/// Strain tuple which stress and strain is obtained for
|
||||
/// </summary>
|
||||
public StrainTuple StrainTuple { get; set; }
|
||||
/// <summary>
|
||||
/// Stress in rebar, Pa
|
||||
/// </summary>
|
||||
public double RebarStress { get; set; }
|
||||
/// <summary>
|
||||
/// Strain in rebar, dimensionless
|
||||
/// </summary>
|
||||
public double RebarStrain { get; set; }
|
||||
/// <summary>
|
||||
/// Strain in fake concrete ndm-part which rounds rebas and locatade at axis of rebar (refrence strain in concrete)
|
||||
/// </summary>
|
||||
public double ConcreteStrain { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// Rebar resul for actual force combination
|
||||
/// </summary>
|
||||
private RebarStressResult actualRebarResult;
|
||||
|
||||
|
||||
private TriangulationOptions options;
|
||||
private INdm? concreteNdm;
|
||||
private INdm? rebarNdm;
|
||||
|
||||
@@ -38,8 +37,8 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
private double rebarActualStress;
|
||||
private double softeningFactor;
|
||||
private double minValueOfFactor = 0.2d;
|
||||
private RebarPrimitive rebarPrimitive;
|
||||
private RebarCrackInputData inputData;
|
||||
private IRebarPrimitive rebarPrimitive;
|
||||
private IRebarCrackInputData inputData;
|
||||
|
||||
public double MinValueOfFactor
|
||||
{
|
||||
@@ -49,7 +48,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
IsResultActual = false;
|
||||
}
|
||||
}
|
||||
public RebarPrimitive RebarPrimitive
|
||||
public IRebarPrimitive RebarPrimitive
|
||||
{
|
||||
get => rebarPrimitive; set
|
||||
{
|
||||
@@ -57,7 +56,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
IsResultActual = false;
|
||||
}
|
||||
}
|
||||
public RebarCrackInputData InputData
|
||||
public IRebarCrackInputData InputData
|
||||
{
|
||||
get => inputData; set
|
||||
{
|
||||
@@ -72,7 +71,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
if (IsResultActual == false)
|
||||
{
|
||||
GetNdms();
|
||||
GetRebarAndConcreteNdms();
|
||||
softeningFactor = GetPsiSFactor(InputData.ForceTuple, InputData.CrackableNdmCollection);
|
||||
IsResultActual = true;
|
||||
}
|
||||
@@ -80,9 +79,9 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
|
||||
}
|
||||
|
||||
private void GetNdms()
|
||||
private void GetRebarAndConcreteNdms()
|
||||
{
|
||||
var options = new TriangulationOptions()
|
||||
options = new TriangulationOptions()
|
||||
{
|
||||
CalcTerm = CalcTerms.ShortTerm,
|
||||
LimiteState = LimitStates.SLS,
|
||||
@@ -92,10 +91,10 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
rebarNdm = RebarPrimitive.GetRebarNdm(options);
|
||||
}
|
||||
|
||||
private double GetPsiSFactor(ForceTuple forceTuple, IEnumerable<INdm> crackableNndms)
|
||||
private double GetPsiSFactor(ForceTuple forceTuple, IEnumerable<INdm> crackableNdms)
|
||||
{
|
||||
|
||||
var crackResult = calculateCrackTuples(forceTuple, crackableNndms);
|
||||
var crackResult = calculateCrackTuples(forceTuple, crackableNdms);
|
||||
if (crackResult.IsValid == false)
|
||||
{
|
||||
string errorString = LoggerStrings.CalculationError + crackResult.Description;
|
||||
@@ -103,7 +102,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
|
||||
actualRebarResult = GetRebarStressResult(forceTuple);
|
||||
actualRebarResult = GetRebarStressResultByForceTuple(forceTuple);
|
||||
rebarActualStrain = actualRebarResult.RebarStrain;
|
||||
rebarActualStress = actualRebarResult.RebarStress;
|
||||
TraceLogger?.AddMessage($"Actual strain of rebar EpsilonS = {rebarActualStrain}(dimensionless)");
|
||||
@@ -120,7 +119,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
TraceLogger?.AddMessage($"Section is cracked in start force combination, PsiS = 1.0");
|
||||
return 1d;
|
||||
}
|
||||
crackRebarResult = GetRebarStressResult(crackResult.TupleOfCrackAppearance as ForceTuple);
|
||||
crackRebarResult = GetRebarStressResultByForceTuple(crackResult.TupleOfCrackAppearance as ForceTuple);
|
||||
|
||||
var stressInCracking = crackRebarResult.RebarStress;
|
||||
TraceLogger?.AddMessage($"Stress in rebar immediately after cracking Sigma,scrc = {stressInCracking}(Pa)");
|
||||
@@ -165,14 +164,12 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
return calculator.Result as CrackForceResult;
|
||||
}
|
||||
|
||||
private RebarStressResult GetRebarStressResult(ForceTuple forceTuple)
|
||||
private RebarStressResult GetRebarStressResultByForceTuple(ForceTuple forceTuple)
|
||||
{
|
||||
var calculator = new RebarStressCalculator()
|
||||
{
|
||||
ForceTuple = forceTuple,
|
||||
NdmCollection = InputData.CrackedNdmCollection,
|
||||
RebarPrimitive = RebarPrimitive
|
||||
};
|
||||
var calculator = new RebarStressCalculator();
|
||||
calculator.InputData.ForceTuple = forceTuple;
|
||||
calculator.InputData.NdmCollection = InputData.CrackedNdmCollection;
|
||||
calculator.InputData.RebarPrimitive = RebarPrimitive;
|
||||
calculator.Run();
|
||||
var result = calculator.Result as RebarStressResult;
|
||||
if (result.IsValid == false)
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
this.checkInputDataLogic = checkInputDataLogic;
|
||||
}
|
||||
|
||||
public TupleCrackCalculator() : this (new CheckTupleCalculatorInputData())
|
||||
public TupleCrackCalculator() : this (new CheckTupleCalculatorInputDataLogic())
|
||||
{
|
||||
|
||||
}
|
||||
@@ -155,7 +155,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
IForceTupleInputData inputData = new ForceTupleInputData()
|
||||
{
|
||||
NdmCollection = ndms,
|
||||
Tuple = forceTuple
|
||||
ForceTuple = forceTuple
|
||||
};
|
||||
IForceTupleCalculator calculator = new ForceTupleCalculator()
|
||||
{
|
||||
|
||||
@@ -10,24 +10,24 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// <summary>
|
||||
/// Settings for crack calculations assigned by user
|
||||
/// </summary>
|
||||
public class UserCrackInputData : IInputData
|
||||
public class UserCrackInputData : IUserCrackInputData
|
||||
{
|
||||
/// <summary>
|
||||
/// Flag of assigning of user value of softening factor
|
||||
/// </summary>
|
||||
public bool SetSofteningFactor {get;set;}
|
||||
public bool SetSofteningFactor { get; set; }
|
||||
/// <summary>
|
||||
/// User value of softening factor, dimensionless
|
||||
/// </summary>
|
||||
public double SofteningFactor {get;set;}
|
||||
public double SofteningFactor { get; set; }
|
||||
/// <summary>
|
||||
/// Flag of assigning of user value of length between cracks
|
||||
/// </summary>
|
||||
public bool SetLengthBetweenCracks {get;set;}
|
||||
public bool SetLengthBetweenCracks { get; set; }
|
||||
/// <summary>
|
||||
/// Length between cracks, m
|
||||
/// </summary>
|
||||
public double LengthBetweenCracks {get;set;}
|
||||
public double LengthBetweenCracks { get; set; }
|
||||
/// <summary>
|
||||
/// Ultimate long-term crack width, m
|
||||
/// </summary>
|
||||
|
||||
@@ -8,9 +8,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
internal class UserCrackInputDataUpdateStrategy : IUpdateStrategy<UserCrackInputData>
|
||||
internal class UserCrackInputDataUpdateStrategy : IUpdateStrategy<IUserCrackInputData>
|
||||
{
|
||||
public void Update(UserCrackInputData targetObject, UserCrackInputData sourceObject)
|
||||
public void Update(IUserCrackInputData targetObject, IUserCrackInputData sourceObject)
|
||||
{
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
CheckObject.CompareTypes(targetObject, sourceObject);
|
||||
|
||||
Reference in New Issue
Block a user