diff --git a/src/loadbearing_wall/wall_model.py b/src/loadbearing_wall/wall_model.py index a7ed536..b47d103 100644 --- a/src/loadbearing_wall/wall_model.py +++ b/src/loadbearing_wall/wall_model.py @@ -13,6 +13,7 @@ class LinearWallModel(BaseModel): length: float vertical_spread_angle: float = 0.0 minimum_point_spread: float = 0.5 + distribute_loads_full_length: bool = False distributed_loads: dict = Field(default={}) point_loads: dict = Field(default={}) gravity_dir: str = "z" @@ -43,6 +44,8 @@ class LinearWallModel(BaseModel): your context and the length unit system you are using. In other words, all applied point loads will be converted to distributed loads spread over this distance unless a vertical spread angle is applied. + 'distribute_loads_full_length': If True, will override both 'vertical_spread_angle' and + 'minimum_point_spread' and will distribute all loads evenly across the whole wall panel. 'distributed_loads': A dictionary of loads. Can be set directly or using the .add_dist_load() methods 'point_loads': A dictionary of loads. Can be set directly or using the .add_point_load() @@ -189,6 +192,16 @@ def spread_loads(self) -> None: x1: projected_load[3], } ) + elif self.distribute_loads_full_length: + w0_value = dist_load[w0] + w1_value = dist_load[w1] + x0_value = dist_load[x0] + x1_value = dist_load[x1] + total_load = (w0_value + w1_value) / 2 * (x1_value - x0_value) + w_full = total_load / self.length + proj[load_dir][load_case].append( + {w0: w_full, w1: w_full, x0: 0.0, x1: self.length} + ) else: proj[load_dir][load_case].append(dist_load) @@ -222,6 +235,12 @@ def spread_loads(self) -> None: x1: projected_load[3], } ) + elif self.distribute_loads_full_length: + total_load = point_load[p] + w_full = total_load / self.length + proj[load_dir][load_case].append( + {w0: w_full, w1: w_full, x0: 0.0, x1: self.length} + ) else: projected_load = geom.apply_minimum_width( point_load[p], diff --git a/tests/test_wall_model.py b/tests/test_wall_model.py index fff64f3..52e9711 100644 --- a/tests/test_wall_model.py +++ b/tests/test_wall_model.py @@ -90,6 +90,42 @@ def test_45_spread(WM1): }, ] +def test_full_load_dist(WM0): + WM0.distribute_loads_full_length = True + rxn = WM0.get_reactions(flattened=False) + assert rxn['Fz']['D'] == [ + { + 'dir': 'Fz', + 'case': 'D', + 'w1': -30, + 'w2': -30, + 'x1': 0.0, + 'x2': 4.0 + } + ] + WM0.distribute_loads_full_length = True + rxn = WM0.get_reactions(flattened=False) + assert rxn['Fz']['L'] == [ + { + 'dir': 'Fz', + 'case': 'L', + 'w1': -32.5, + 'w2': -32.5, + 'x1': 0.0, + 'x2': 4.0 + } + ] + assert rxn['Fx']['W'] == [ + { + 'dir': 'Fx', + 'case': 'W', + 'w1': -500.0, + 'w2': -500.0, + 'x1': 0.0, + 'x2': 4.0 + } + ] + def test_serialization(WM0): serialized_dict = WM0.dump_dict()