ConcreteBucklingCalculator was added

This commit is contained in:
Evgeny Redikultsev
2023-01-29 20:45:42 +05:00
parent 6d1f9bae1b
commit f013ddae13
44 changed files with 924 additions and 86 deletions

View File

@@ -0,0 +1,177 @@
using LoaderCalculator.Data.Materials.MaterialBuilders;
using LoaderCalculator.Data.Ndms;
using LoaderCalculator.Logics;
using LoaderCalculator.Logics.Geometry;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Calculators;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Forces;
using StructureHelperLogics.Models.Materials;
using StructureHelperLogics.NdmCalculations.Analyses;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.Services.NdmPrimitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
public class ConcreteBucklingCalculator : IConcreteBucklingCalculator
{
private IConcreteBucklingOptions options;
private IEilerCriticalForceLogic criticalForceLogic;
private IRCStiffnessLogic stiffnessLogicX, stiffnessLogicY;
private List<INdm> ndmCollection;
private List<INdm> concreteNdms;
private List<INdm> otherNdms;
IForcesTupleResult forcesResults;
public string Name { get; set; }
public INdmResult Result { get; private set; }
public IAccuracy Accuracy { get; set; }
private (double EtaAlongX, double EtaAlongY) GetBucklingCoefficients()
{
var stiffness = GetStiffness();
criticalForceLogic.LongForce = options.CalcForceTuple.Nz;
criticalForceLogic.StiffnessEI = stiffness.DX;
criticalForceLogic.DesignLength = options.CompressedMember.GeometryLength * options.CompressedMember.LengthFactorY;
var etaAlongY = criticalForceLogic.GetEtaFactor();
criticalForceLogic.StiffnessEI = stiffness.DY;
criticalForceLogic.DesignLength = options.CompressedMember.GeometryLength * options.CompressedMember.LengthFactorX;
var etaAlongX = criticalForceLogic.GetEtaFactor();
return (etaAlongX, etaAlongY);
}
public ConcreteBucklingCalculator(IConcreteBucklingOptions options, IAccuracy accuracy)
{
this.options = options;
Accuracy = accuracy;
var allPrimitives = options.Primitives;
var concretePrimitives = GetConcretePrimitives();
var otherPrimitives = allPrimitives.Except(concretePrimitives);
ndmCollection = NdmPrimitivesService.GetNdms(allPrimitives, options.LimitState, options.CalcTerm);
concreteNdms = NdmPrimitivesService.GetNdms(concretePrimitives, options.LimitState, options.CalcTerm);
otherNdms = NdmPrimitivesService.GetNdms(otherPrimitives, options.LimitState, options.CalcTerm);
}
private (IConcreteDeltaELogic DeltaLogicX, IConcreteDeltaELogic DeltaLogicY) GetDeltaLogics()
{
IForceTuple forceTuple = options.CalcForceTuple;
if (forceTuple.Nz >= 0) { return (new ConstDeltaELogic(), new ConstDeltaELogic()); }
var eccentricityAlongX = options.CalcForceTuple.My / forceTuple.Nz;
var eccentricityAlongY = options.CalcForceTuple.Mx / forceTuple.Nz;
var sizeAlongX = ndmCollection.Max(x => x.CenterX) - ndmCollection.Min(x => x.CenterX);
var sizeAlongY = ndmCollection.Max(x => x.CenterY) - ndmCollection.Min(x => x.CenterY);
var DeltaElogicAboutX = new DeltaELogicSP63(eccentricityAlongY, sizeAlongY);
var DeltaElogicAboutY = new DeltaELogicSP63(eccentricityAlongX, sizeAlongX);
return (DeltaElogicAboutX, DeltaElogicAboutY);
}
private IEnumerable<INdmPrimitive> GetConcretePrimitives()
{
var primitives = options.Primitives.Where(x => x.HeadMaterial.HelperMaterial is IConcreteLibMaterial);
return primitives;
}
private (double DX, double DY) GetStiffness()
{
var gravityCenter = GeometryOperations.GetGravityCenter(ndmCollection);
var concreteInertia = GeometryOperations.GetMomentsOfInertiaMod(concreteNdms, gravityCenter);
var otherInertia = GeometryOperations.GetMomentsOfInertiaMod(otherNdms, gravityCenter);
var stiffnessX = stiffnessLogicX.GetStiffnessCoeffitients();
var dX = stiffnessX.Kc * concreteInertia.MomentX + stiffnessX.Ks * otherInertia.MomentX;
var stiffnessY = stiffnessLogicY.GetStiffnessCoeffitients();
var dY = stiffnessY.Kc * concreteInertia.MomentY + stiffnessY.Ks * otherInertia.MomentY;
return (dX, dY);
}
private IConcretePhiLLogic GetPhiLogic()
{
IPoint2D point = GetMostTensionedPoint();
var phiLogic = new PhiLogicSP63(options.CalcForceTuple, options.LongTermTuple, point);
return phiLogic;
}
private IPoint2D GetMostTensionedPoint()
{
var strains = forcesResults.LoaderResults.StrainMatrix;
double maxStrain = double.NegativeInfinity;
IPoint2D point = new Point2D();
var stressLogic = new StressLogic();
foreach (var item in ndmCollection)
{
var strain = stressLogic.GetTotalStrain(strains, item);
if (strain > maxStrain)
{
maxStrain = strain;
point = new Point2D() { X = item.CenterX, Y = item.CenterY };
}
}
return point;
}
private IForceTupleCalculator GetForceCalculator()
{
var tuple = options.CalcForceTuple;
IForceTupleInputData inputData = new ForceTupleInputData() { NdmCollection = ndmCollection, Tuple = tuple, Accuracy = Accuracy };
IForceTupleCalculator calculator = new ForceTupleCalculator(inputData);
return calculator;
}
public void Run()
{
var checkResult = CheckInputData();
if (checkResult != "")
{
Result = new ConcreteBucklingResult() { IsValid = false, Desctription = checkResult };
return;
}
else
{
IConcretePhiLLogic phiLLogic = GetPhiLogic();
var (DeltaLogicAboutX, DeltaLogicAboutY) = GetDeltaLogics();
stiffnessLogicX = new RCStiffnessLogicSP63(phiLLogic, DeltaLogicAboutX);
stiffnessLogicY = new RCStiffnessLogicSP63(phiLLogic, DeltaLogicAboutY);
criticalForceLogic = new EilerCriticalForceLogic();
var (EtaFactorX, EtaFactorY) = GetBucklingCoefficients();
Result = new ConcreteBucklingResult()
{
IsValid = true,
EtaFactorAlongX = EtaFactorX,
EtaFactorAlongY = EtaFactorY
};
}
}
private string CheckInputData()
{
string result = "";
IForceTupleCalculator calculator = GetForceCalculator();
calculator.Run();
forcesResults = calculator.Result as IForcesTupleResult;
if (forcesResults.IsValid != true)
{
result += "Bearind capacity of crosssection is not enough for initial forces\n";
}
return result;
}
public object Clone()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,29 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Sections;
using StructureHelperLogics.NdmCalculations.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
/// <inheritdoc/>
internal class ConcreteBucklingOptions : IConcreteBucklingOptions
{
/// <inheritdoc/>
public IForceTuple LongTermTuple { get; set; }
/// <inheritdoc/>
public ICompressedMember CompressedMember { get; set; }
/// <inheritdoc/>
public LimitStates LimitState { get; set; }
/// <inheritdoc/>
public CalcTerms CalcTerm { get; set; }
/// <inheritdoc/>
public IEnumerable<INdmPrimitive> Primitives { get; set; }
/// <inheritdoc/>
public IForceTuple CalcForceTuple { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
/// <inheritdoc/>
public class ConcreteBucklingResult : IConcreteBucklingResult
{
/// <inheritdoc/>
public bool IsValid { get; set; }
/// <inheritdoc/>
public string Desctription { get; set; }
/// <inheritdoc/>
public double EtaFactorAlongX { get; set; }
/// <inheritdoc/>
public double EtaFactorAlongY { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
public class ConstDeltaELogic : IConcreteDeltaELogic
{
public double GetDeltaE()
{
return 1.5d;
}
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
internal class ConstPhiLLogic : IConcretePhiLLogic
{
public double GetPhil()
{
return 2.0d;
}
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
internal class CriticalForceSP63Logic : ICriticalBucklingForceLogic
{
double concreteFactor, reinforcementFactor;
public double GetCriticalForce()
{
throw new NotImplementedException();
}
public double GetEtaFactor()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,36 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Strings;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
public class DeltaELogicSP63 : IConcreteDeltaELogic
{
const double deltaEMin = 0.15d;
const double deltaEMax = 1.5d;
readonly double eccentricity;
readonly double size;
public DeltaELogicSP63(double eccentricity, double size)
{
if (size <= 0 )
{
throw new StructureHelperException(ErrorStrings.SizeMustBeGreaterThanZero + $", actual size: {size}");
}
this.eccentricity = eccentricity;
this.size = size;
}
public double GetDeltaE()
{
var deltaE = Math.Abs(eccentricity) / size;
deltaE = Math.Max(deltaE, deltaEMin);
deltaE = Math.Min(deltaE, deltaEMax);
return deltaE;
}
}
}

View File

@@ -0,0 +1,35 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Strings;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
internal class EilerCriticalForceLogic : IEilerCriticalForceLogic
{
public double LongForce { get; set; }
public double StiffnessEI { get; set; }
public double DesignLength { get; set; }
public double GetCriticalForce()
{
double Ncr = - Math.Pow(Math.PI, 2) * StiffnessEI / (Math.Pow(DesignLength, 2));
return Ncr;
}
public double GetEtaFactor()
{
if (LongForce >= 0d) return 1d;
var Ncr = GetCriticalForce();
if (LongForce <= Ncr)
{
throw new StructureHelperException(ErrorStrings.LongitudinalForceMustBeLessThanCriticalForce);
}
double eta = 1 / (1 - LongForce / Ncr);
return eta;
}
}
}

View File

@@ -0,0 +1,21 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Sections;
using StructureHelperLogics.NdmCalculations.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
public interface IBucklingOptions
{
ICompressedMember CompressedMember { get; }
LimitStates LimitState { get; }
CalcTerms CalcTerm { get; }
IEnumerable<INdmPrimitive> Primitives { get; }
IForceTuple CalcForceTuple { get; }
}
}

View File

@@ -0,0 +1,15 @@
using StructureHelperCommon.Models.Calculators;
using StructureHelperLogics.NdmCalculations.Analyses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
internal interface IConcreteBucklingCalculator : INdmCalculator
{
IAccuracy Accuracy { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using StructureHelperCommon.Models.Calculators;
using StructureHelperCommon.Models.Forces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
public interface IConcreteBucklingOptions : IBucklingOptions
{
IForceTuple LongTermTuple { get; }
}
}

View File

@@ -0,0 +1,24 @@
using StructureHelperLogics.NdmCalculations.Analyses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
/// <summary>
/// Results of calculation of buckling of reinforced concrete section
/// </summary>
public interface IConcreteBucklingResult : INdmResult
{
/// <summary>
/// Factor of increasing of bending moment (p-delta effect) in the plain XOZ
/// </summary>
double EtaFactorAlongX { get; set; }
/// <summary>
/// Factor of increasing of bending moment (p-delta effect) in the plain YOZ
/// </summary>
double EtaFactorAlongY { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
internal interface IConcreteDeltaELogic
{
double GetDeltaE();
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
public interface IConcretePhiLLogic
{
double GetPhil();
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
internal interface ICriticalBucklingForceLogic
{
double GetCriticalForce();
double GetEtaFactor();
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
internal interface IEilerCriticalForceLogic : ICriticalBucklingForceLogic
{
double LongForce { get; set; }
double StiffnessEI { get; set; }
double DesignLength { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using StructureHelperLogics.NdmCalculations.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
public interface IRCStiffnessLogic
{
(double Kc, double Ks) GetStiffnessCoeffitients();
}
}

View File

@@ -0,0 +1,41 @@
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Forces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
public class PhiLogicSP63 : IConcretePhiLLogic
{
readonly IForceTuple fullForceTuple;
readonly IForceTuple longForceTuple;
readonly IPoint2D point;
public PhiLogicSP63(IForceTuple fullForceTuple, IForceTuple longForceTuple, IPoint2D point)
{
this.fullForceTuple = fullForceTuple;
this.longForceTuple = longForceTuple;
this.point = point;
}
public double GetPhil()
{
var distance = Math.Sqrt(point.X * point.X + point.Y * point.Y);
var fullMoment = GetMoment(fullForceTuple, distance);
var longMoment = GetMoment(longForceTuple, distance);
if (fullMoment == 0d) { return 2d; }
var phi = 1 + longMoment / fullMoment;
phi = Math.Max(1, phi);
phi = Math.Min(2, phi);
return phi;
}
private double GetMoment(IForceTuple forceTuple, double distance)
{
return Math.Abs(forceTuple.Nz) * distance + Math.Abs(forceTuple.Mx) + Math.Abs(forceTuple.My);
}
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Buckling
{
internal class RCStiffnessLogicSP63 : IRCStiffnessLogic
{
IConcretePhiLLogic phiLLogic { get; }
IConcreteDeltaELogic deltaELogic { get; }
public RCStiffnessLogicSP63() : this(new ConstPhiLLogic(), new ConstDeltaELogic()) { }
public RCStiffnessLogicSP63(IConcretePhiLLogic phiLLogic, IConcreteDeltaELogic deltaELogic)
{
this.phiLLogic = phiLLogic;
this.deltaELogic = deltaELogic;
}
public (double Kc, double Ks) GetStiffnessCoeffitients()
{
const double initialKs = 0.7d;
const double initialKc = 0.15d;
const double deltaEAddition = 0.3d;
double phiL = phiLLogic.GetPhil();
double deltaE = deltaELogic.GetDeltaE();
double kc = initialKc / (phiL * (deltaEAddition + deltaE));
return (kc, initialKs);
}
}
}