You are on page 1of 6

'''

1. Dims
Parameter = D (Diameter)
ShapeCircularTube.D

Parameter = Radius (Radius)


ShapeCircularTube.R

Parameter = Thickness (Thickness)


ShapeCircularTube.T

Parameter = InnerRadius (Inner radius)


(ShapeCircularTube.D / 2) - ShapeCircularTube.T

Parameter = Lambda (Lambda)


Description: Diameter to thickness ratio
D / Thickness

Parameter = tDratio (tD ratio)


ShapeCircularTube.T / ShapeCircularTube.D

Parameter = Ip (Polar moment of inertia)


((PI * pow(Radius, 4)) / 2) * (1 - pow(InnerRadius, 4) / pow(Radius, 4))

Parameter = Z (Plastic section modulus)


(4 * (pow(Radius, 3) - pow(InnerRadius, 3))) / 3

Parameter = Rg (Radius of gyration)


sqrt(Izz/area)

Parameter = SlendernessY (Slenderness ratio Y)


(memberY.K * memberY.L) / Rg

Parameter = SlendernessZ (Slenderness ratio Z)


(memberZ.K * memberZ.L) / Rg

Parameter = Cc (Cc)
Description: Chapter 3.2.2.a (page 39)
sqrt((2 * pow(PI, 2) * young) / yield)

Parameter = FyMPa (Yield in Mpa)


Units.GetInMPa(yield)

2. Limits
Parameter = GeomCheckFail (GeomCheck Fail)
if(Dims.Lambda < 300 and (Units.GetInMillimeters(Dims.Thickness) >= 6), no, yes)

Parameter = BelowLimitForLB (Below Limit for LB)


if((Dims.Lambda > 60) and (Dims.Lambda < 300) and
(Units.GetInMillimeters(Dims.Thickness) >= 6), yes, no)

Parameter = Fat (Allowable tensile stress)


Description: (3.2.1-1)
0.6 * yield * Amod

Parameter = Fey (Euler stress Y)


Description: (3.2.2-1)
(12 * pow(Pi, 2) * Young / (23 * pow(Dims.SlendernessY, 2))) * Amod
Parameter = Fez (Euler stress Z)
Description: (3.2.2-1)
(12 * pow(Pi, 2) * Young / (23 * pow(Dims.SlendernessZ, 2))) * Amod

Parameter = FayBelowCc (FaY below CC)


Description: (3.2.2-1). Allowable compressive stress when slenderness below Cc
(((1 - pow(Dims.SlendernessY, 2) / (2 * pow(Dims.Cc, 2))) * Yield) / (5 / 3 + 3 *
Dims.SlendernessY / (8 * Dims.Cc) - pow(Dims.SlendernessY, 3) / (8 * pow(Dims.Cc,
3)))) * Amod

Parameter = FazBelowCc (FaZ below Cc)


Description: (3.2.2-1). Allowable compressive stress when slenderness below Cc
(((1 - pow(Dims.SlendernessZ, 2) / (2 * pow(Dims.Cc, 2))) * Yield) / (5 / 3 + 3 *
Dims.SlendernessZ / (8 * Dims.Cc) - pow(Dims.SlendernessZ, 3) / (8 * pow(Dims.Cc,
3)))) * Amod

Parameter = Fay (Allowable compressive stress Y)


Description: (3.2.2-1)
if(Dims.SlendernessY < Dims.Cc, FayBelowCc, Fey)

Parameter = Faz (Allowable axial compressive stress)


Description: (3.2.2-1)
if(Dims.SlendernessZ < Dims.Cc, FazBelowCc, Fez)

Parameter = Fxe (Fxe)


Description: (3.2.2-3). Elastic local buckling stress
if(BelowLimitForLB = yes, 2 * C * young * Dims.tDratio, 0)

Parameter = Fxc (Fxc)


Description: (3.2.2-4). Inelastic local buckling stress
if(BelowLimitForLB = yes, yield * (1.64 - 0.23 * pow(Dims.Lambda, 0.25)), 0)

Parameter = FcrLB (Fcr Local Buckling)


Description: Chapter 3.2.2.b. Critical local buckling stress
min(Fxc, Fxe)

Parameter = CcLB (Cc Local Buckling)


sqrt((2 * pow(PI, 2) * young) / FcrLB)

Parameter = FayLBbelowCcLB (FayLB below Cc Local Buckling)


Description: (3.2.2-1). Allowable compressive stress Y Local Buckling below Cc
((1 - pow(Dims.SlendernessY, 2) / (2 * pow(Dims.Cc, 2))) * FcrLB) / (5 / 3 + 3 *
Dims.SlendernessY / (8 * CcLB) - pow(Dims.SlendernessY, 3) / (8 * pow(CcLB, 3)))

Parameter = FazLBbelowCcLB (FazLB below Cc Local Buckling)


Description: (3.2.2-1). Allowable compressive stress Z Local Buckling below Cc
((1 - pow(Dims.SlendernessZ, 2) / (2 * pow(Dims.Cc, 2))) * FcrLB) / (5 / 3 + 3 *
Dims.SlendernessZ / (8 * CcLB) - pow(Dims.SlendernessZ, 3) / (8 * pow(CcLB, 3)))

Parameter = FayLB (Fay Local Buckling)


Description: (3.2.2-1), Allowable axial compressive stress Y Local Buckling
if(Dims.SlendernessY < CcLB, FayLBbelowCcLB, Fey)

Parameter = FazLB (Faz Local Buckling)


Description: (3.2.2-1), Allowable axial compressive stress Z Local Buckling
if(Dims.SlendernessZ < CcLB, FazLBbelowCcLB, Fez)

Parameter = Fba (Allowable bending stress a)


Description: (3.2.3-1a)
0.75 * yield * Amod

Parameter = Fbb (Allowable bending stress b)


Description: (3.2.3-1b)
((0.84 - 1.74 * (yield * Dims.D) / (young * Dims.Thickness)) * yield) * Amod

Parameter = Fbc (Allowable bending stress c)


Description: (3.2.3-1c)
((0.72 - 0.58 * (yield * Dims.D) / (young * Dims.Thickness)) * yield) * Amod

Parameter = Fb (Allowable bending stress)


Description: Chapter 3.2.3.
case(Dims.Lambda <= (10340 / Dims.FyMPa); Fba; Dims.Lambda <= (20680 / Dims.FyMPa);
Fbb; Dims.Lambda > (20680 / Dims.FyMPa); Fbc)

Parameter = Fv (Allowable beam shear stress)


Description: Formula 3.2.4-2. Page 40
0.4 * yield * Amod

Parameter = Fvt (Allowable Torsional Shear stress)


Description: Formula 3.2.4-4. Page 40
0.4 * yield * Amod

3. Parameter = fa (Axial Stress)


Faxial / area

Parameter = Fac (Allowable compresion stress)


Description: Chapter 3.2.2.
if(Dims.Lambda <= 60, min(Limits.Fay, Limits.Faz), min(Limits.FayLB, Limits.FazLB))

Parameter = Fat (Allowable tension stress)


Description: (3.2.1-1)
Limits.Fat

Parameter = Uf (Uf)
if(fa < 0, abs(fa / Fac), abs(fa/Limits.Fat))

4. Bending
Parameter = fby (Bending stress Y)
abs((Mbend1 * Dims.Radius) / Izz)

Parameter = fbz (Bending stress Z)


abs((Mbend2 * Dims.Radius) / Iyy)

Parameter = fb (Bending Stress)


sqrt(pow(fby, 2) + pow(fbz, 2))

Parameter = Uf (Uf)
fb / Limits.Fb

5. Shear
Parameter = fvy (Shear stress Y)
Description: (3.2.4-1)
abs(Fshear1 / (0.5 * area))

Parameter = fvz (Shear stress Z)


Description: (3.2.4-1)
abs(Fshear2 / (0.5 * area))
Parameter = fv (Shear stress)
sqrt(pow(fvy, 2) + pow(fvz, 2))

Parameter = Uf_shear (Uf Shear)


if(Limits.GeomCheckFail = yes, NotValue, fv / Limits.Fv)

Parameter = fvt (Torsion shear stress)


Description: (3.2.4-3)
(Ftorque * (Dims.D / 2)) / Dims.Ip

Parameter = Uf_torsion (Uf Torsion)


if(Limits.GeomCheckFail = yes, NotValue, fvt / Limits.Fvt)

6. Overall
Replacement = Cmy (Cmy)
if(memberY.CmType = CmTypeA, 0.85, Max(0.6 - 0.4 * Tool.M1M2Ratio_Y, 1 - 0.4 *
if(Axial.fa < 0, Axial.fa / Limits.Fey, 0), 0.85))

Replacement = Cmz (Cmz)


if(memberZ.CmType = CmTypeA, 0.85, Max(0.6 - 0.4 * Tool.M1M2Ratio_Z, 1 - 0.4 *
if(Axial.fa < 0, Axial.fa / Limits.Fez, 0), 0.85))

Parameter = fa_fe (Fa exceed Fe)


Description: if axial stress exceed elastic buckling sttress, ratio > 1
Max(Abs(Axial.fa) / Limits.Fey, Abs(Axial.fa) / Limits.Fez)

Parameter = Uf14 (Uf14)


Description: (3.3.1-4), Combined compression and bending
if(fa_fe >= 1 or Limits.GeomCheckFail = yes, NotValue, if(Axial.fa < 0,
abs(Axial.fa / Axial.Fac) + sqrt(pow((Cmy * Bending.fby) / (1 - Axial.fa /
Limits.Fey), 2) + pow((Cmz * Bending.fbz) / (1 - Axial.fa / Limits.Fez), 2)) /
Limits.Fb, 0))

Parameter = Uf12 (Uf12)


Description: (3.3.1-2). Combined axial and bending
if(Limits.GeomCheckFail = yes, NotValue, abs(Axial.fa / (0.6 * yield)) +
sqrt(pow(Bending.fby, 2) + pow(Bending.fbz, 2)) / Limits.Fb)

Parameter = Uf15 (Uf15 Cylindrical Piles)


Description: (3.3.1-5)
if(Pile = PileType.No, 0, if(Limits.GeomCheckFail = yes, NotValue, abs(Axial.fa /
(0.6 * Limits.Fxc)) + sqrt(pow(Bending.fby, 2) + pow(Bending.fbz, 2)) / Limits.Fb))

Parameter = Uf16 (Uf16 Pile Overload)


Description: (3.3.1-6)
if(Pile = PileType.No, 0, if(Limits.GeomCheckFail = yes, NotValue, (abs(Faxial) /
area) / Limits.Fxc + (2 / PI) * asin((absmax(Mbend1, Mbend2) / Dims.Z) /
Limits.Fxc)))

Parameter = Ufoverall (Uf overall)


if(Limits.GeomCheckFail = yes, NotValue, if(Axial.fa < 0, Max(Uf14, Uf12, Uf15,
Uf16), Uf12))
'''
上面是一个计算圆管截面 Ufoverall 的计算过程描述,请根据上面的过程编写一个 vb6 的函数,返回
Uf_Axial、Uf_Bending、Uf_shear、Uf_torsion 和 Ufoverall 的数值。其中
Dims,Limits,Axial,Bending,Shear 都用 type 定义数据类型,保证其变量的应用方式和计算过程中保
持一致,例如 Dims 下的变量 D,引用就是 Dims.D。不要省略代码,给出完整的函数代码
chatgpt 给出的伪代码如下:
Type Dims
D As Double
Radius As Double
Thickness As Double
InnerRadius As Double
Lambda As Double
tDratio As Double
Ip As Double
Z As Double
Rg As Double
SlendernessY As Double
SlendernessZ As Double
Cc As Double
FyMPa As Double
End Type

Type Limits
GeomCheckFail As String
BelowLimitForLB As String
Fat As Double
Fey As Double
Fez As Double
FayBelowCc As Double
FazBelowCc As Double
Fay As Double
Faz As Double
Fxe As Double
Fxc As Double
FcrLB As Double
CcLB As Double
FayLBbelowCcLB As Double
FazLBbelowCcLB As Double
FayLB As Double
FazLB As Double
Fba As Double
Fbb As Double
Fbc As Double
Fb As Double
Fv As Double
Fvt As Double
End Type

Type Axial
fa As Double
Fac As Double
End Type

Type Bending
fby As Double
fbz As Double
fb As Double
End Type

Type Shear
fvy As Double
fvz As Double
fv As Double
End Type
Function CalculateUfoverall(Dims As Dims, Limits As Limits, Axial As Axial, Bending
As Bending, Shear As Shear) As Double
Dim Uf14 As Double
Dim Uf12 As Double
Dim Uf15 As Double
Dim Uf16 As Double
Dim Ufoverall As Double

Dim Cmy As Double


Dim Cmz As Double
Dim fa_fe As Double

Cmy = IIf(memberY.CmType = CmTypeA, 0.85, Max(0.6 - 0.4 * Tool.M1M2Ratio_Y, 1 -


0.4 * IIf(Axial.fa < 0, Axial.fa / Limits.Fey, 0), 0.85))
Cmz = IIf(memberZ.CmType = CmTypeA, 0.85, Max(0.6 - 0.4 * Tool.M1M2Ratio_Z, 1 -
0.4 * IIf(Axial.fa < 0, Axial.fa / Limits.Fez, 0), 0.85))
fa_fe = Max(Abs(Axial.fa) / Limits.Fey, Abs(Axial.fa) / Limits.Fez)

Uf14 = IIf(fa_fe >= 1 Or Limits.GeomCheckFail = "yes", NotValue, IIf(Axial.fa <


0, Abs(Axial.fa / Axial.Fac) + Sqr((Cmy * Bending.fby) / (1 - Axial.fa /
Limits.Fey) ^ 2 + (Cmz * Bending.fbz) / (1 - Axial.fa / Limits.Fez) ^ 2) /
Limits.Fb, 0))
Uf12 = IIf(Limits.GeomCheckFail = "yes", NotValue, Abs(Axial.fa / (0.6 *
yield)) + Sqr(Bending.fby ^ 2 + Bending.fbz ^ 2) / Limits.Fb)

Uf15 = IIf(Pile = PileType.No, 0, IIf(Limits.GeomCheckFail = "yes", NotValue,


Abs(Axial.fa / (0.6 * Limits.Fxc)) + Sqr(Bending.fby ^ 2 + Bending.fbz ^ 2) /
Limits.Fb))
Uf16 = IIf(Pile = PileType.No, 0, IIf(Limits.GeomCheckFail = "yes", NotValue,
(Abs(Faxial) / area) / Limits.Fxc + (2 / PI) * Asin((Absmax(Mbend1, Mbend2) /
Dims.Z) / Limits.Fxc)))

Ufoverall = IIf(Limits.GeomCheckFail = "yes", NotValue, IIf(Axial.fa < 0,


Max(Uf14, Uf12, Uf15, Uf16), Uf12))

CalculateUfoverall = Ufoverall
End Function

You might also like