using BritishStandard.App_Class;
public static void Main()
ConcreteMaterial bdcm = new ConcreteMaterial();
ConcreteFactors bdcf = new ConcreteFactors();
ConcreteDimensions bdcd = new ConcreteDimensions();
CrackWidthCalculation bdcw = new CrackWidthCalculation();
bdcm.ConcreteGrade_fcu = 35.0;
bdcm.MainReinforcementGrade_fy = 460.0;
bdcm.ShearReinforcementGrade_fyv = 460.0;
bdcm.ModulusElasticityofSteel_Es = 2.0E5;
bdcf.ConcreteCompression_gmc = 1.5;
bdcf.ConcreteinShear_gmcs = 1.25;
bdcf.Reinforcement_gms = 1.15;
bdcd.EffectiveTensionCover_Ct = 25.0+8.0+10.0;
bdcd.EffectiveCompressionCover_Cc = 25.0+8.0+8.0;
bdcw.SetConcreteMaterial = bdcm;
bdcw.SetConcreteFactors = bdcf;
bdcw.SetConcreteDimensions = bdcd;
bdcw.SetBarSpacing = (300.0-50.0-2.0*8.0-20.0)/2.0;
bdcw.SetServiceMoment = 100.0E6;
bdcw.SetClearCover_CO = 25.0 + 8.0;
Console.WriteLine(bdcw.GetConcreteModulus_Ec);
Console.WriteLine(bdcw.GetTensionSteelRatio_p);
Console.WriteLine(bdcw.GetCompressionSteelRatio_pdash);
Console.WriteLine(bdcw.GetModularRatio_m);
Console.WriteLine(bdcw.GetNeutralAxis_x);
Console.WriteLine(bdcw.GetLeverArm_z);
Console.WriteLine(bdcw.GetK1);
Console.WriteLine(bdcw.GetK2);
Console.WriteLine(bdcw.GetK3);
Console.WriteLine(bdcw.GetReinforcementStress_fs);
Console.WriteLine(bdcw.GetConcreteStress_fc);
Console.WriteLine(bdcw.GetStrainSoffit_e1);
Console.WriteLine(bdcw.GetStrainStiffening_e2);
Console.WriteLine(bdcw.GetAverageStrain_em);
Console.WriteLine(bdcw.GetCrackDistance_acr);
Console.WriteLine(bdcw.GetCrackWidth_wcr);
namespace BritishStandard.App_Class
public struct ConcreteMaterial
public double ConcreteGrade_fcu, MainReinforcementGrade_fy, ShearReinforcementGrade_fyv, ModulusElasticityofSteel_Es;
public struct ConcreteFactors
public double ConcreteCompression_gmc, ConcreteinShear_gmcs, Reinforcement_gms;
public struct ConcreteDimensions
public double Breadth_b, Height_h, EffectiveTensionCover_Ct, EffectiveCompressionCover_Cc;
public class BeamReinforcementCalculation
private ConcreteMaterial cm = new ConcreteMaterial();
private ConcreteFactors cf = new ConcreteFactors();
private ConcreteDimensions cd = new ConcreteDimensions();
private double K, Kdash, As2Req, AsMom, z, AsMin, AsMax;
private bool IsCalculationReady = false;
private double d, b, h, d2, fcu, fy, fvy, Es, gmc, gmcs, gms;
private double M, Beta = 1.0;
public ConcreteMaterial SetConcreteMaterial { get { return cm; } set { cm = value; IsCalculationReady = false; } }
public ConcreteFactors SetConcreteFactors { get { return cf; } set { cf = value; IsCalculationReady = false; } }
public ConcreteDimensions SetConcreteDimensions { get { return cd; } set { cd = value; IsCalculationReady = false; } }
public double SetMoment { get { return M; } set { M = value; IsCalculationReady = false; } }
public double SetBeta { get { return Beta; } set { Beta = value; IsCalculationReady = false; } }
public double GetK { get { if (IsCalculationReady == false) Calculate(); return K; } private set { } }
public double GetKdash { get { if (IsCalculationReady == false) Calculate(); return Kdash; } private set { } }
public double GetAs2Req { get { if (IsCalculationReady == false) Calculate(); return As2Req; } private set { } }
public double GetAsMom { get { if (IsCalculationReady == false) Calculate(); return AsMom; } private set { } }
public double Getz { get { if (IsCalculationReady == false) Calculate(); return z; } private set { } }
public double GetAsMin { get { if (IsCalculationReady == false) Calculate(); return AsMin; } private set { } }
public double GetAsMax { get { if (IsCalculationReady == false) Calculate(); return AsMax; } private set { } }
Kdash = 0.546 * Beta - 0.18 * Math.Pow(Beta, 2.0) - 0.1896;
K = M / (b * Math.Pow(d, 2.0) * fcu);
z = Math.Min(d * (0.5 + Math.Pow(0.25 - K / 0.9, 0.5)), 0.95 * d);
z = Math.Min(d * (0.5 + Math.Pow(0.25 - Kdash / 0.9, 0.5)), 0.95 * d);
As2Req = (K - Kdash) * fcu * b * Math.Pow(d, 2) / ((fy / gms) * (d - d2));
AsMom = M / (fy * z / gms);
AsMom = Kdash * fcu * b * d * d / (fy * z / gms) + As2Req;
IsCalculationReady = true;
private void Initialize()
fcu = cm.ConcreteGrade_fcu;
fy = cm.MainReinforcementGrade_fy;
fvy = cm.ShearReinforcementGrade_fyv;
Es = cm.ModulusElasticityofSteel_Es;
gmc = cf.ConcreteCompression_gmc;
gmcs = cf.ConcreteinShear_gmcs;
gms = cf.Reinforcement_gms;
d = h - cd.EffectiveTensionCover_Ct;
d2 = cd.EffectiveCompressionCover_Cc;
public class OnewayShearCalculation
private ConcreteMaterial cm = new ConcreteMaterial();
private ConcreteFactors cf = new ConcreteFactors();
private ConcreteDimensions cd = new ConcreteDimensions();
private double v, vc, vmax, vs;
private bool IsCalculationReady = false;
private double b, h, d, d2, fcu, fy, fvy, Es, gmc, gmcs, gms;
public ConcreteMaterial SetConcreteMaterial { get { return cm; } set { cm = value; IsCalculationReady = false; } }
public ConcreteFactors SetConcreteFactors { get { return cf; } set { cf = value; IsCalculationReady = false; } }
public ConcreteDimensions SetConcreteDimensions { get { return cd; } set { cd = value; IsCalculationReady = false; } }
public double SetShearForce { get { return V; } set { V = value; IsCalculationReady = false; } }
public double SetAst { get { return Ast; } set { Ast = value; IsCalculationReady = false; } }
public double GetShearStress_v { get { if (IsCalculationReady == false) Calculate(); return v; } private set { } }
public double GetConcreteShearStress_vc { get { if (IsCalculationReady == false) Calculate(); return vc; } private set { } }
public double GetAllowableShearStress_vmax { get { if (IsCalculationReady == false) Calculate(); return vmax; } private set { } }
public double GetRequiredShearStrength_vs { get { if (IsCalculationReady == false) Calculate(); return vs; } private set { } }
vc = 0.79 * Math.Min(3.0, Math.Pow(Pt, 1.0 / 3.0)) * Math.Max(1.0, Math.Pow(400.0 / d, 1.0 / 4.0)) * Math.Pow(Math.Min(fcu, 40.0) / 25.0, 1.0 / 3.0) / gmcs;
vmax = (Math.Min(0.8 * Math.Pow(fcu, 0.5), 5.0));
vs = Math.Max(v - vc, 0.4);
IsCalculationReady = true;
private void Initialize()
fcu = cm.ConcreteGrade_fcu;
fy = cm.MainReinforcementGrade_fy;
fvy = cm.ShearReinforcementGrade_fyv;
Es = cm.ModulusElasticityofSteel_Es;
gmc = cf.ConcreteCompression_gmc;
gmcs = cf.ConcreteinShear_gmcs;
gms = cf.Reinforcement_gms;
d = h - cd.EffectiveTensionCover_Ct;
d2 = cd.EffectiveCompressionCover_Cc;
public class CrackWidthCalculation
private ConcreteMaterial cm = new ConcreteMaterial();
private ConcreteFactors cf = new ConcreteFactors();
private ConcreteDimensions cd = new ConcreteDimensions();
private double Ec,m,p,pdash,x,z;
private double K1, K2, K3;
private double fs, fc, e1, e2, em, acr;
private bool IsCalculationReady = false;
private double b, h, d, d2, fcu, fy, fvy, Es, gmc, gmcs, gms;
private double Asc = 0.0;
public ConcreteMaterial SetConcreteMaterial { get { return cm; } set { cm = value; IsCalculationReady = false; } }
public ConcreteFactors SetConcreteFactors { get { return cf; } set { cf = value; IsCalculationReady = false; } }
public ConcreteDimensions SetConcreteDimensions { get { return cd; } set { cd = value; IsCalculationReady = false; } }
public double SetServiceMoment { get { return Ms; } set { Ms = value; IsCalculationReady = false; } }
public double SetAxialLoad { get { return N; } set { N = value; IsCalculationReady = false; } }
public double SetAst { get { return Ast; } set { Ast = value; IsCalculationReady = false; } }
public double SetAsc { get { return Asc; } set { Asc = value; IsCalculationReady = false; } }
public double SetClearCover_CO { get { return CO; } set { CO = value; IsCalculationReady = false; } }
public double SetBarDia { get { return Dia; } set { Dia = value; IsCalculationReady = false; } }
public double SetBarSpacing { get { return S; } set { S = value; IsCalculationReady = false; } }
public double GetTensionSteelRatio_p { get { if (IsCalculationReady == false) Calculate(); return p; } private set { } }
public double GetCompressionSteelRatio_pdash { get { if (IsCalculationReady == false) Calculate(); return pdash; } private set { } }
public double GetConcreteModulus_Ec { get { if (IsCalculationReady == false) Calculate(); return Ec; } private set { } }
public double GetModularRatio_m { get { if (IsCalculationReady == false) Calculate(); return m; } private set { } }
public double GetNeutralAxis_x { get { if (IsCalculationReady == false) Calculate(); return x; } private set { } }
public double GetLeverArm_z { get { if (IsCalculationReady == false) Calculate(); return z; } private set { } }
public double GetK1 { get { if (IsCalculationReady == false) Calculate(); return K1; } private set { } }
public double GetK2 { get { if (IsCalculationReady == false) Calculate(); return K2; } private set { } }
public double GetK3 { get { if (IsCalculationReady == false) Calculate(); return K3; } private set { } }
public double GetReinforcementStress_fs { get { if (IsCalculationReady == false) Calculate(); return fs; } private set { } }
public double GetConcreteStress_fc { get { if (IsCalculationReady == false) Calculate(); return fc; } private set { } }
public double GetStrainSoffit_e1 { get { if (IsCalculationReady == false) Calculate(); return e1; } private set { } }
public double GetStrainStiffening_e2 { get { if (IsCalculationReady == false) Calculate(); return e2; } private set { } }
public double GetAverageStrain_em { get { if (IsCalculationReady == false) Calculate(); return em; } private set { } }
public double GetCrackDistance_acr { get { if (IsCalculationReady == false) Calculate(); return acr; } private set { } }
public double GetCrackWidth_wcr { get { if (IsCalculationReady == false) Calculate(); return wcr; } private set { } }
Ec = (20000.0 + (200.0 * fcu)) / 2.0;
x = d * (Math.Pow(Math.Pow((m * p + (m - 1.0) * pdash), 2.0) + 2.0 * (m * p + (m - 1.0) * (d2 / d) *pdash), 0.5) - ((m * p) + (m - 1.0) * pdash));
g = ((0.5 * q * x) + (m * Ast * d) + ((m - 1.0) * Asc * d2)) / (q + (m * Ast) + ((m - 1.0) * Asc));
K2 = (x / (2.0 * d)) * (1.0 - (x / (3.0 * d)));
K3 = (m - 1.0) * (1.0 - (d2 / x));
fc = Ms / ((K2 * b * d * d) + (K3 * Asc * (1.0 - (d2 / d))));
K1 = ((e - g) / d) + 1.0;
fc = (N * K1) / ((K2 * b * d) + (K3 * Asc * (1.0 - (d2 / d))));
fs = (fc * ((0.5 * q) + (K3 * Asc)) - N) / Ast;
xcheck = d / (1.0 + (fs / (m * fc)));
} while (Math.Abs((xcheck - x) / x) > 0.001);
e1 = fs / Es * (h - x) / (d - x);
e2 = ((b * Math.Pow(h - x, 2.0)) / (3.0 * (Es) * Ast * (d - x)));
acr = Math.Pow(Math.Pow(S / 2.0, 2.0) + Math.Pow(CO + Dia / 2.0, 2), 0.5) - (Dia / 2.0);
wcr = (3.0 * acr * em) / (1 + (2.0 * ((acr - CO) / (h - x))));
private void Initialize()
fcu = cm.ConcreteGrade_fcu;
fy = cm.MainReinforcementGrade_fy;
fvy = cm.ShearReinforcementGrade_fyv;
Es = cm.ModulusElasticityofSteel_Es;
gmc = cf.ConcreteCompression_gmc;
gmcs = cf.ConcreteinShear_gmcs;
gms = cf.Reinforcement_gms;
d = h - cd.EffectiveTensionCover_Ct;
d2 = cd.EffectiveCompressionCover_Cc;