Example #1
0
 def solve_JTG(self):
     # 基本组合
     lc = calla.JTG.loads.load_combination
     forces_fu = wrapforces(lc.combinate(self.bottom_forces, lc.uls_fu))
     forces_fu.Fx -= lc.uls_fu['dead']*self.weight # 轴力
     self.forces_fu = forces_fu
     # 偶然组合
     lc = calla.JTG.loads.load_combination
     forces_ac = wrapforces(lc.combinate(self.bottom_forces, lc.uls_ac))
     forces_ac.Fx -= lc.uls_fu['dead']*self.weight # 轴力
     self.forces_ac = forces_ac
     # 长期作用(准永久组合)
     forces_qp = wrapforces(lc.combinate(self.bottom_forces, lc.sls_qp))
     forces_qp.Fx -= lc.sls_qp['dead']*self.weight
     self.forces_qp = forces_qp
     # 短期作用(频遇组合)
     forces_fr = wrapforces(lc.combinate(self.bottom_forces, lc.sls_fr))
     forces_fr.Fx -= lc.sls_fr['dead']*self.weight
     self.forces_fr = forces_fr
Example #2
0
 def bottom_force(cls, load, H):
     '''
     计算柱底荷载
     load:荷载
     H:柱高
     '''
     loadtype = load[0]
     h = load[1]
     if h<0:
         h = abs(h)
         if h > 1:
             raise InputError(cls, 'loads', '相对长度绝对值不能大于1')
         h = h*H
     f = wrapforces(load[2])
     f.Mz += f.Fy*h
     f.My += f.Fz*h
     return (loadtype, f.forces)
Example #3
0
 def solve_TB(self):
     lc = calla.JTG.loads.load_combination
     forces_tb = wrapforces(lc.combinate(self.bottom_forces, lc.sls_ch))
     forces_tb.Fx -= lc.sls_qp['dead']*self.weight
     self.forces_tb = forces_tb
Example #4
0
    def solve_GB_JTG(self):
        paras = self.inputs
        # 荷载基本组合或偶然组合
        lc = calla.JTG.loads.load_combination
        forces_fu = self.forces_fu
        forces_ac = self.forces_ac
        forces_uls = wrapforces([max(abs(f1),abs(f2)) for f1,f2 in zip(forces_fu, forces_ac)])

        if self.section == 'rectangle':
            self.A = self.b*self.h #mm2
            bc = calla.JTG.bearing_capacity.eccentric_compression(**paras) if self.code == 'JTG' else \
                calla.GB.compressive_capacity.eccentric_compression(**paras)
        elif self.section == 'Tshape':
            self.A = self.b*(self.h - self.hf)+self.bf*self.hf
            bc = calla.JTG.bearing_capacity.eccentric_compression_Ishape(**paras) if self.code == 'JTG' else \
                calla.GB.compressive_capacity.eccentric_compression_Ishape(**paras)
        elif self.section == 'round':
            self.A = pi/4*self.d**2
            bc = calla.JTG.bearing_capacity.bc_round(**paras) if self.code == 'JTG' else \
                calla.GB.flexural_capacity.fc_round(**paras)
            bc.r = self.d/2
            bc.rs = self.d/2 - self.a_s
        else:
            raise NameError('section type {} is not defined'.format(self.section))

        # 确定两个方向的钢筋面积
        def _seperate(param:str):
            a = getattr(self, param)
            if a == None:
                return None
            if isinstance(a, float) or isinstance(a, int):
                ax = ay = a
            elif isinstance(a, tuple) or isinstance(a, list):
                n = len(a)
                if n >0 and n < 1:
                    ax = ay = a
                elif n > 1:
                    ax = a[0]
                    ay = a[1]
                else:
                    raise InputError(self,param,'无法识别的输入')
            else:
                raise InputError(self,param,'无法识别的输入')
            return (ax, ay)

        if isinstance(self.As, float) or isinstance(self.As, int):
            Asx = Asy = self.As
        elif isinstance(self.As, tuple) or isinstance(self.As, list):
            n = len(self.As)
            if n >0 and n < 1:
                Asx = Asy = self.As
            elif n > 1:
                Asx = self.As[0]
                Asy = self.As[1]
            else:
                raise InputError(self,'As','无法识别的输入')
        else:
            raise InputError(self,'As','无法识别的输入')
        Asx_, Asy_ = _seperate('As_')
        if isinstance(self.Ap, float) or isinstance(self.Ap, int):
            Apx = Apy = self.Ap
        elif isinstance(self.Ap, tuple) or isinstance(self.Ap, list):
            n = len(self.Ap)
            if n >0 and n < 1:
                Apx = Apy = self.Ap
            elif n > 1:
                Apx = self.Ap[0]
                Apy = self.Ap[1]
            else:
                raise InputError(self,'Ap','无法识别的输入')
        else:
            raise InputError(self,'Ap','无法识别的输入')

        # 轴心受压承载力
        ac = calla.JTG.bearing_capacity.axial_compression(**paras) if self.code == 'JTG' else \
            calla.GB.compressive_capacity.axial_compression(**paras)
        ac.Nd = forces_uls.Fx
        ac.A = self.A
        ac.As_ = Asx+Asy
        ac.solve()

        # 偏心受压承载力
        bc.fcuk = calla.JTG.concrete.fcuk(self.concrete)
        # bc.fcd = calla.JTG.concrete.fcd(self.concrete)
        # bc.fsd=bc.fsd_=calla.JTG.rebar.fsd(self.rebar)
        bc.option = 'review'
        Nd = forces_uls.Fx
        #choseX = forces_uls[0] > forces_uls[1]
        bcs = []
        # z方向偏心弯曲验算,对于圆截面则是合力方向计算
        if self.section == 'round':
            Md = sqrt(forces_uls.Mz**2+forces_uls.My**2)
        else:
            Md = forces_uls.My
        if self.code == 'GB':
            bc.N = abs(Nd)
            bc.M = abs(Md)
        else:
            bc.Nd = abs(Nd)
            bc.Md = abs(Md)
        bc.b = self.h
        bc.h = self.b
        bc.h0 = self.b - self.as_
        bc.l0 = self.k*self.l
        bc.As = Asx
        bc.As_ = Asx_
        bc.Ap = Apx
        bc.solve()
        bcs.append(bc)
        # y方向偏心弯曲验算
        if self.section != 'round':
            bcy = copy.copy(bc)
            Md = abs(forces_uls.Mz)
            if self.code == 'GB':
                bc.M = Md
            else:
                bc.Md = Md
            bcy.b = self.b
            bcy.h = self.h
            bcy.h0 = self.h - self.as_
            bcy.As = Asy
            bcy.As_ = Asy_
            bcy.Ap = Apy
            bcy.solve()
            bcs.append(bcy)

        #双向偏心受压承载力
        if self.section != 'round' and self.code == 'JTG':
            be = calla.JTG.bearing_capacity.biaxial_eccentric(**paras) # TODO: support GB
            be.Nd = forces_uls.Fx
            be.Nu0 = ac.Nud
            be.Nux = bcs[0].Nu
            be.Nuy = bcs[1].Nu
            be.solve()

        # 裂缝宽度
        cw = calla.JTG.crack_width.crack_width(**paras) if self.code == 'JTG' else \
            calla.GB.crack_width.crack_width(**paras)
        if self.section == 'round':
            cw.case = 'round'
            cw.r = self.d/2
            cw.rs = self.d/2 - self.a_s
        else:
            cw.case = 'rect'
            cw.b = self.h
            cw.h = self.b
            cw.h0 = cw.h-self.a_s
            cw.ys = cw.h/2-self.a_s
            cw.C3 = 0.9
        cw.l0 = self.k*self.l
        cw.d = self.deq
        cw.C1 = 1.4 if self.rebar.startswith('HPB') else 1.0
        # 内力计算
        # 长期作用(准永久组合)
        forces_l=wrapforces(self.forces_qp)
        cw.Nl = abs(forces_l.Fx)
        # 短期作用(频遇组合)
        forces_s = wrapforces(self.forces_fr)
        cw.Ns = abs(forces_s.Fx)
        # z方向验算
        cw.As = Asx
        if self.section == 'round':
            cw.Ml = sqrt(forces_l.Mz**2+forces_l.My**2)
            cw.Ms = sqrt(forces_s.Mz**2+forces_s.My**2)
        else:
            cw.Ml = abs(forces_l.My)
            cw.Ms = abs(forces_s.My)
        # y方向验算
        cws = []
        cws.append(cw)
        if self.section != 'round':
            cws.append(copy.copy(cw))
            cws[1].b = self.b
            cws[1].h = self.h
            cws[1].h0 = cws[1].h-cws[1].a_s
            cws[1].As = Asy
            cws[1].ys = cws[1].h/2-cws[1].a_s
            cws[1].Ml = abs(forces_l.Mz)
            cws[1].Ms = abs(forces_s.Mz)
        for f in cws:
            if f.Ns == 0:
                f.force_type = 'BD'
            else:
                if f.Ms == 0:
                    f.force_type = 'AT' if forces_l.Fx > 0 else 'AC'
                else:
                    f.force_type = 'EC' if forces_l.Fx < 0 else 'ET'
                    f.Ns = abs(f.Ns)
            if f.force_type != 'AC':
                f.solve()
        # 保存计算器
        self.ac = ac
        self.bcs = bcs
        if self.section != 'round':
            self.be = be
        self.cws = cws
Example #5
0
    def solve(self):
        #self.positive_check('As')
        params = self.inputs
        pw = pile_width(**params)
        pw.solve()
        pe = pile_effects(**params)
        pe.b1 = pw.b1
        # 基本组合
        lc = loads.load_combination
        forces_fu = wrapforces(self.forces_fu)

        def _fMax(force):
            '计算桩中最大弯矩及所在位置'
            # y方向
            pe.H0 = force.Fy
            pe.M0 = force.Mz
            pe.solve()
            Mymax = pe.Mmax
            zy = pe.z_Mmax
            # z方向
            pe.H0 = force.Fz
            pe.M0 = force.My
            pe.solve()
            Mzmax = pe.Mmax
            zz = pe.z_Mmax
            Mmax = max(
                abs(Mymax),
                abs(Mzmax))  # max(Mymax, Mzmax) # sqrt(Mymax**2 + Mzmax**2)
            z = zy if Mymax > Mzmax else zz
            return (Mmax, z)

        M, z = _fMax(forces_fu)

        # 偏心受压承载力
        r = self.d / 2 * 1e3  # mm
        l0 = 4 / pe.α  # m
        if l0 > self.h:
            l0 = self.h
        l0 = l0 * 1e3  # mm
        bc = bc_round(option='review',
                      r=r,
                      rs=r - 60,
                      l0=l0,
                      Md=abs(M),
                      Nd=abs(forces_fu.Fx) + lc.uls_fu['dead'] *
                      (z * pi / 4 * self.d**2 * material.concrete.density),
                      **params)
        bc.As = self.As
        bc.solve()
        self.bc = bc

        # 偶然组合
        if tuple(self.forces_ac) != (0, 0, 0, 0, 0, 0):
            # forces_ac = lc.combinate(bottom_forces, lc.uls_ac)
            forces_ac = wrapforces(self.forces_ac)
            M, z = _fMax(forces_ac)

            # 偏心受压承载力
            bc = bc_round(option='review',
                          r=r,
                          rs=r - 60,
                          l0=l0,
                          Md=M,
                          Nd=abs(forces_ac.Fx) + lc.uls_ac['dead'] *
                          (z * pi / 4 * self.d**2 * material.concrete.density),
                          **params)
            bc.As = self.As
            bc.solve()
            if self.bc.Mud < bc.Mud:
                self.bc = bc

        # 长期作用(准永久组合)
        # forces_l = lc.combinate(bottom_forces, lc.sls_qp)
        forces_l = wrapforces(self.forces_qp)
        Ml, z = _fMax(forces_l)

        # 短期作用(频遇组合)
        # forces_s = lc.combinate(bottom_forces, lc.sls_fr)
        forces_s = wrapforces(self.forces_fr)
        Ms, z = _fMax(forces_s)

        # 裂缝宽度计算
        cw = crack_width(
            option='review',
            case='round',
            force_type='EC',
            Es=material.rebar.Es(self.rebar),
            fcuk=material.concrete.fcuk(self.concrete),
            d=self.de,
            c=self.c,
            a_s=self.a_s,
            r=r,
            rs=r - self.a_s,
            l=self.h,
            l0=l0,
            As=self.As,
            Nl=abs(forces_l.Fx),  # 暂不考虑桩基重力
            Ml=abs(Ml),
            Ns=abs(forces_s.Fx),
            Ms=abs(Ms),
            wlim=0.2,
            C1=1.0)
        cw.solve()

        # 桩基竖向承载力计算
        pc = end_bearing_pile_capacity(**params) if self.bottom_fixed\
        else friction_pile_capacity(**params)
        pc.u = pi * self.d
        pc.Ap = pi / 4 * self.d**2
        pc.L = self.h
        # 标准组合
        # pc.R0 = abs(wrapforces(self.forces_ch).Fx)
        pc.solve()

        self.bc = bc
        self.cw = cw
        self.pc = pc