def __init__(self, fb, hz, sl, fd, ip_axis='length', horz2vert_mass=None): super(AssessedSFSIRCFrame, self).__init__(fb, hz) # run parent class initialiser function self.sl.__dict__.update(sl.__dict__) if fd.ftype == "raft": self.fd = sm.RaftFoundation() if fd.ftype == "pad": self.fd = sm.PadFoundation() self.fd.__dict__.update(fd.__dict__) self.k_f0_shear = geofound.stiffness.calc_shear_via_gazetas_1991( self.sl, self.fd, ip_axis=ip_axis) self.k_f_0 = geofound.stiffness.calc_rotational_via_gazetas_1991( self.sl, self.fd, ip_axis=ip_axis) if self.fd.ftype == "raft": #self.k_f_0 = nf.rotational_stiffness(self.fd.width, self.fd.length, self.sl.g_mod, self.sl.poissons_ratio) self.alpha = 4.0 else: #self.k_f_0 = nf.rotational_stiffness(self.fd.width, self.fd.length, self.sl.g_mod, self.sl.poissons_ratio) / 2 self.alpha = 3.0 self.zeta = 1.5 if horz2vert_mass is not None: self.horz2vert_mass = horz2vert_mass assert fb.material.type == 'rc_material' self.concrete = fb.material
def test_link_building_and_soil(): number_of_storeys = 6 interstorey_height = 3.4 # m n_bays = 3 fb = models.FrameBuilding(number_of_storeys, n_bays) fb.id = 1 fb.interstorey_heights = interstorey_height * np.ones(number_of_storeys) fb.floor_length = 18.0 # m fb.floor_width = 16.0 # m fd = models.RaftFoundation() fd.length = 4 fd.width = 6 fd.height = 0.0 fd.density = 3 fd2 = models.RaftFoundation() fd2.length = 14 fd2.width = 16 fd2.height = 10.0 fd2.density = 13 # link building to foundation fd.set_building(fb, two_way=False) assert fd.building.n_bays == 3 assert fb.foundation is None fd.set_building(fb, two_way=True) assert fb.foundation.length == 4 # one way link fb.set_foundation(fd2, two_way=False) assert fb.foundation.length == 14 assert fd2.building is None fb.set_foundation(fd2, two_way=True) assert fb.foundation.length == 14 assert np.isclose(fd2.building.floor_width, 16.0) structure = models.SDOFBuilding() structure.set_foundation(fd, two_way=True) assert structure.foundation.width == 6 assert isinstance(fd.building, models.SDOFBuilding)
class DesignedSFSIRCFrame(DesignedRCFrame): sl = sm.Soil() fd = sm.RaftFoundation() total_weight = 0.0 theta_f = 0.0 axial_load_ratio = 0.0 theta_pseudo_up = 0.0 def __init__(self, fb, hz, sl, fd, ip_axis='length', horz2vert_mass=None): super(DesignedSFSIRCFrame, self).__init__(fb, hz) # run parent class initialiser function self.sl.__dict__.update(sl.__dict__) # self.fd.__dict__.update(fd.__dict__) self.fd = fd.deepcopy() self.k_f0_shear = geofound.stiffness.calc_shear_via_gazetas_1991( self.sl, self.fd, ip_axis=ip_axis) self.k_f_0 = geofound.stiffness.calc_rotational_via_gazetas_1991( self.sl, self.fd, ip_axis=ip_axis) if self.fd.ftype == "raft": self.alpha = 4.0 else: self.alpha = 3.0 self.zeta = 1.5 if horz2vert_mass is not None: self.horz2vert_mass = horz2vert_mass self.beam_group_size = 2 def static_values(self): self.total_weight = self.horz2vert_mass * (sum(self.storey_masses) + self.fd.mass) * self.g if hasattr(self.fd, 'pad'): self.soil_q = geofound.capacity_salgado_2008(sl=self.sl, fd=self.fd.pad) else: self.soil_q = geofound.capacity_salgado_2008(sl=self.sl, fd=self.fd) # Deal with both raft and pad foundations bearing_capacity = nf.bearing_capacity(self.fd.area, self.soil_q) weight_per_frame = self.horz2vert_mass * sum(self.storey_masses) / ( self.n_seismic_frames + self.n_gravity_frames) * self.g self.axial_load_ratio = bearing_capacity / self.total_weight self.fd_bearing_capacity = bearing_capacity self.theta_pseudo_up = nf.calculate_pseudo_uplift_angle( self.total_weight, self.fd.width, self.k_f_0, self.axial_load_ratio, self.alpha, self.zeta)
def test_save_and_load_w_linked_building_and_soil(): number_of_storeys = 6 interstorey_height = 3.4 # m wb = models.WallBuilding(number_of_storeys) wb.id = 1 wb.interstorey_heights = interstorey_height * np.ones(number_of_storeys) wb.floor_length = 18.0 # m wb.floor_width = 16.0 # m fd = models.RaftFoundation() fd.length = 4 fd.width = 6 fd.height = 0.0 fd.density = 3 fd.id = 1 # link building to foundation fd.set_building(wb, two_way=False) assert fd.building.n_storeys == number_of_storeys assert wb.foundation is None fd.set_building(wb, two_way=True) assert wb.foundation.length == 4 ecp_output = sm.Output() ecp_output.add_to_dict(wb) ecp_output.add_to_dict(fd) ecp_output.name = "a single wall building" ecp_output.units = "N, kg, m, s" ecp_output.comments = "" p_str = json.dumps(ecp_output.to_dict(), skipkeys=["__repr__"], indent=4) objs = sm.loads_json(p_str) building = objs["building"][1] foundation = objs["foundation"][1] assert foundation.width == 6 assert building.foundation.width == 6, building.fd assert np.isclose(building.floor_length, 18.0)
class DesignedSFSIRCWall(DesignedRCWall): sl = sm.Soil() fd = sm.RaftFoundation() total_weight = 0.0 theta_f = 0.0 axial_load_ratio = 0.0 bearing_capacity = 0.0 theta_pseudo_up = 0.0 def __init__(self, wb, hz, sl, fd): super(DesignedSFSIRCWall, self).__init__(wb, hz) # run parent class initialiser function self.sl.__dict__.update(sl.__dict__) self.fd.__dict__.update(fd.__dict__) self.k_f0_shear = geofound.stiffness.calc_shear_via_gazetas_1991( self.sl, self.fd, ip_axis='length') if self.fd.ftype == "raft": self.alpha = 4.0 else: self.alpha = 3.0 self.k_f_0 = geofound.stiffness.calc_rotational_via_gazetas_1991( self.sl, self.fd, ip_axis='length') self.zeta = 1.5 def static_values(self): self.total_weight = (sum(self.storey_masses) + self.fd.mass) * self.g soil_q = geofound.capacity_salgado_2008(sl=self.sl, fd=self.fd) # Deal with both raft and pad foundations self.bearing_capacity = nf.bearing_capacity(self.fd.area, soil_q) self.axial_load_ratio = self.bearing_capacity / self.total_weight self.theta_pseudo_up = nf.calculate_pseudo_uplift_angle( self.total_weight, self.fd.width, self.k_f_0, self.axial_load_ratio, self.alpha, self.zeta)