Icons were added
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class AverageDiameterLogic : IAverageDiameterLogic
|
||||
{
|
||||
public IEnumerable<RebarNdm> Rebars { get; set; }
|
||||
|
||||
public double GetAverageDiameter()
|
||||
{
|
||||
Check();
|
||||
var rebarArea = Rebars
|
||||
.Sum(x => x.Area);
|
||||
var rebarCount = Rebars.Count();
|
||||
var averageArea = rebarArea / rebarCount;
|
||||
var diameter = Math.Sqrt(averageArea / Math.PI);
|
||||
return diameter;
|
||||
}
|
||||
private void Check()
|
||||
{
|
||||
if (!Rebars.Any())
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": rebars count must be greater then zero");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CrackWidthLogicSP63 : ICrackWidthLogic
|
||||
{
|
||||
public double RebarStrain { get; set; }
|
||||
public double ConcreteStrain { get; set; }
|
||||
public double Length { get; set; }
|
||||
public double TermFactor { get; set; }
|
||||
public double BondFactor { get; set; }
|
||||
public double StressStateFactor { get; set; }
|
||||
public double PsiSFactor { get; set; }
|
||||
public double GetCrackWidth()
|
||||
{
|
||||
CheckOptions();
|
||||
//check if strain of concrete greater than strain of rebar
|
||||
if (ConcreteStrain > RebarStrain) { return 0d; }
|
||||
double width = (RebarStrain - ConcreteStrain) * Length;
|
||||
width *= TermFactor * BondFactor * StressStateFactor * PsiSFactor;
|
||||
return width;
|
||||
}
|
||||
|
||||
private void CheckOptions()
|
||||
{
|
||||
if (Length <=0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": length between cracks L={Length} must be greate than zero");
|
||||
}
|
||||
if (TermFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Term factor {TermFactor} must be greate than zero");
|
||||
}
|
||||
if (BondFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Bond factor {BondFactor} must be greate than zero");
|
||||
}
|
||||
if (StressStateFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Bond factor {StressStateFactor} must be greate than zero");
|
||||
}
|
||||
if (PsiSFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": PsiS factor {PsiSFactor} must be greate than zero");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface IAverageDiameterLogic
|
||||
{
|
||||
IEnumerable<RebarNdm> Rebars { get; set; }
|
||||
double GetAverageDiameter();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Logic for calculating width of crack
|
||||
/// </summary>
|
||||
public interface ICrackWidthLogic
|
||||
{
|
||||
/// <summary>
|
||||
/// strain of rebar, dimensionless
|
||||
/// </summary>
|
||||
double RebarStrain { get; set; }
|
||||
/// <summary>
|
||||
/// strain of concrete, dimensionless
|
||||
/// </summary>
|
||||
double ConcreteStrain { get; set; }
|
||||
/// <summary>
|
||||
/// Length between cracks in meters
|
||||
/// </summary>
|
||||
double Length { get; set; }
|
||||
/// <summary>
|
||||
/// return width of crack in meters
|
||||
/// </summary>
|
||||
double GetCrackWidth();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface ILengthBetweenCracksLogic
|
||||
{
|
||||
IEnumerable<INdm> NdmCollection { get; set; }
|
||||
IStrainMatrix StrainMatrix { get; set; }
|
||||
double GetLength();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Logic fo calculating of tensile area of RC crosssection
|
||||
/// </summary>
|
||||
public interface ITensileAreaLogic
|
||||
{
|
||||
IEnumerable<INdm> NdmCollection { get; set; }
|
||||
IStrainMatrix StrainMatrix { get; set; }
|
||||
double GetTensileArea();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class LengthBetweenCracksLogicSP63 : ILengthBetweenCracksLogic
|
||||
{
|
||||
const double minDiameterFactor = 10d;
|
||||
const double maxDiameterFactor = 40d;
|
||||
const double minLength = 0.1d;
|
||||
const double maxLength = 0.4d;
|
||||
|
||||
readonly IAverageDiameterLogic diameterLogic;
|
||||
readonly ITensileAreaLogic tensileAreaLogic;
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
public IStrainMatrix StrainMatrix { get; set; }
|
||||
public LengthBetweenCracksLogicSP63(IAverageDiameterLogic diameterLogic, ITensileAreaLogic tensileAreaLogic)
|
||||
{
|
||||
this.diameterLogic = diameterLogic;
|
||||
this.tensileAreaLogic = tensileAreaLogic;
|
||||
}
|
||||
public LengthBetweenCracksLogicSP63() :
|
||||
this
|
||||
( new AverageDiameterLogic(),
|
||||
new TensileAreaLogicSP63())
|
||||
{ }
|
||||
public double GetLength()
|
||||
{
|
||||
var rebars = NdmCollection
|
||||
.Where(x => x is RebarNdm)
|
||||
.Select(x => x as RebarNdm);
|
||||
var rebarArea = rebars.Sum(x => x.Area * x.StressScale);
|
||||
diameterLogic.Rebars = rebars;
|
||||
var rebarDiameter = diameterLogic.GetAverageDiameter();
|
||||
tensileAreaLogic.NdmCollection = NdmCollection;
|
||||
tensileAreaLogic.StrainMatrix = StrainMatrix;
|
||||
var concreteArea = tensileAreaLogic.GetTensileArea();
|
||||
var length = concreteArea / rebarArea * rebarDiameter;
|
||||
length = new List<double> { length, minDiameterFactor * rebarDiameter, minLength }.Max();
|
||||
length = new List<double> { length, maxDiameterFactor * rebarDiameter, maxLength }.Min();
|
||||
return length;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Logics;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class TensileAreaLogicSP63 : ITensileAreaLogic
|
||||
{
|
||||
const double maxConcreteFactor = 0.5d;
|
||||
const double minConcreteFactor = 0.1d;
|
||||
const double minRebarFactor = 3d;
|
||||
private static IStressLogic stressLogic => new StressLogic();
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
public IStrainMatrix StrainMatrix { get; set; }
|
||||
|
||||
public double GetTensileArea()
|
||||
{
|
||||
var rebarCollection = NdmCollection
|
||||
.Where(x => x is RebarNdm);
|
||||
var rebarArea = rebarCollection.
|
||||
Sum(x => x.Area * x.StressScale);
|
||||
var concreteCollection = NdmCollection
|
||||
.Where(x => x.Material is ConcreteMaterial);
|
||||
var concreteArea = concreteCollection
|
||||
.Sum(x => x.Area * x.StressScale);
|
||||
var concreteTensileArea = concreteCollection
|
||||
.Where(x => stressLogic.GetTotalStrainWithPresrain(StrainMatrix, x) > 0d)
|
||||
.Sum(x => x.Area * x.StressScale);
|
||||
|
||||
concreteTensileArea = Math.Max(concreteTensileArea, rebarArea * minRebarFactor);
|
||||
concreteTensileArea = Math.Max(concreteTensileArea, concreteArea * minConcreteFactor);
|
||||
concreteTensileArea = Math.Min(concreteTensileArea, concreteArea * maxConcreteFactor);
|
||||
|
||||
return concreteTensileArea;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user