Toolbox for Structural Calculation (pyfacade.strcals)
Module pyfacade.strcals provides some utility functions based on other modules of this package,
for structural calculation and verification works.
- pyfacade.strcals.eqslds(I1, I2, alpha, E)
Calculate equivalent slenderness of a section.
- Parameters:
I1 – float, moment of inertia about major axis of the section.
I2 – float, moment of inertia about major axis of the section.
alpha – float, angle between major aixs and x-axis, in radians.
E – float, modulus of elasticity of the section material.
- Returns:
tuple of float, (k_yx, k_yy, k_xx, k_xy), where k_ij represents equivalent slenderness about i-axis under force in j-direction.
- pyfacade.strcals.biabend(section_prop, Mx, My, full_output=False)
Calculate maximum normal stress on section due to biaxial bending.
- Parameters:
section_prop – sub-dict for a section extracted from the dict created by
pyacad.Acad.seclib.Mx – float, bending moment about x-axis, unit = N*mm.
My – float, bending moment about y-axis, unit = N*mm.
full_output – bool, output all the calculation parameter.
- Returns:
tuple, in the form of (s_min, s_max, theta, Mn, In, dn)
s_min - float, minimum stress on the section, unit = N/mm 2.s_max - float, maximum stress on the section, unit = N/mm 2.theta - float, angle between neutral axis and x-axis, in radians.Mn - float, resultant effective moment about neutral axis, unit = N*mm.In - float, moment of inertia of section about neutral axis, unit = mm 4.dn - tuple of float (d_min, d_max), minimum and maximum relative distance from the most critical points to neutral axis.The last 4 items are excluded when full_output = False.
- pyfacade.strcals.combsec(sec_lib, sec_mat, combinations)
Group sections, calculate matrix of load sharing and equivalent slenderness according to combination cases.
- Parameters:
sec_lib – nested dict stats section properties in the form of {sec_name_1: {‘I1’:.., ‘I2’:..,’alpha’:..}, sec_name_2:…}.
sec_mat – dict, material of involved sections, {sec_name_1: material_1, sec_name_2: material_2, …}.
combinations –
nested list, relation of section combinations, [[sec_name_1, sec_name_2, comb_indicator],…] The comb_indicator is one of below:
’x’, ‘X’ or 1 - combine in x-direction’y’, ‘Y’ or 2 - combine in y-direction’xy’, ‘XY’ or 0 - combine in both directions
- Returns:
tuple, (section group in x-direction, section group in y-direction, matrix of force sharing, matrix of moment sharing, matrix of equivalent slenderness).
- pyfacade.strcals.check_transoms(section_lib, section_mat, section_comb, span, h1, h2, load_app, wl, dl1, dl2=0.0, wlf=0.0, imp=0.0, imq=0.0, feature=0.0, wlf_flip=True, four_side1=True, four_side2=True, ds1=0.0, ds2=0.0, wlc=0.5, summary=False)
Verification of transom of combined sections.
- Parameters:
section_lib – str or dict, section library stating section properties and boundary information. In form of str as path and name of json file created by
pyacad.Acad.seclib, or a nested dict in the same form.section_mat – dict, material of involved sections, {sec_name_1: material_1, sec_name_2: material_2, …}
section_comb –
nested list, relation of section combinations, [[sec_name_1, sec_name_2, comb_indicator],…]. The comb_indicator is one of below:
’x’, ‘X’ or 1 - combine in x-direction.’y’, ‘Y’ or 2 - combine in y-direction.’xy’, ‘XY’ or 0 - combine in both directions.span – float, span of transom, unit = mm.
h1 – float, height of upper panel, unit = mm.
h2 – float, height of lower panel, unit = mm.
load_app –
list of str, name of sections take loads [for_wl1, for_wl2, for_wlf, for_imp, for_dl1, for_dl2].
for_wl1 - name of section taking wind load from upper panel.for_wl2 - name of section taking wind load from lower panel.for_wlf - name of section taking wind load from horizontal feature, if any.for_imp - name of section taking vertical imposed load, if any.for_dl1 - name of section taking dead load from upper panel, if any.for_dl2 - name of section taking dead load from lower panel, if any.the last four items can be
Nonewhen corresponding load does not exist.wl – list of float, design wind load on panel, [pressure, suction], unit = kPa, positive as pressure, negative as suction.
dl1 – float, design weight of upper panel, unit = N.
dl2 – float, design weight of lower panel, unit = N.
wlf – float, design wind load on feature, unit = kPa, positive as uplifting, negative as downward.
imp – float, design imposed point load, unit = N, positive as uplifting, negative as downward.
imq – float, design imposed linear load, unit = N/mm, positive as uplifting, negative as downward.
feature – float, windward breadth of horizontal feature, unit = mm.
wlf_flip – bool, also check the case that wind load direction on feature is flipped.
four_side1 – bool, load path of upper panel is considered as 4-side-supported.
four_side2 – bool, load path of lower panel is considered as 4-side-supported.
ds1 – float, distance from ends to apply location of upper panel weight. unit = mm. Apply panel weight as udl if ds1 = 0.
ds2 – float, distance from ends to apply location of lower panel weight. unit = mm. Apply panel weight as udl if ds1 = 0.
wlc – float, combination factor of wind load when combine with imposed load.
summary – bool, output the summary of verification only.
- Returns:
namedtuple
Transom_summaryif summary = True. Otherwise return namedtupleTransom_output.
Refer to explanations to Namedtuples for Output of Transom Check
- pyfacade.strcals.check_mullions(section_lib, section_mat, section_comb, height, b1, b2, load_app, wl, panel_dens1, panel_dens2, support1, support2=None, support2_lateral=False, wlvf=0.0, wlhf=0.0, bvf=0.0, bhf=0.0, hf_gap=0.0, hf_loc=None, wlvf_flip=True, wlhf_flip=True, summary=False)
Verification of mullion of consistently combined sections.
- Parameters:
section_lib – str or dict, section library stating section properties and boundary information. In form of str as path and name of json file created by
pyacad.Acad.seclib, or a nested dict in the same form.section_mat – dict, material of involved sections, {sec_name_1: material_1, sec_name_2: material_2, …}
section_comb –
list, relationship of section combinations, [[sec_name_1, sec_name_2, comb_indicator],…]. The comb_indicator is one of below:
’x’, ‘X’ or 1 - combine in x-direction’y’, ‘Y’ or 2 - combine in y-direction’xy’, ‘XY’ or 0 - combine in both directionsheight – list of float, height of mullions from lower to upper, unit = mm
b1 – float, width of panel at left side of mullion, unit = mm
b2 – float, width of panel at right side of mullion, unit = mm
load_app –
list of str, name of sections take loads [for_wl1, for_wl2, for_dl1, for_dl2, for_wlvf, for_wlhf1, for_wlhf2]
for_wl1 - name of section taking wind load from left panel.for_wl2 - name of section taking wind load from right panel.for_dl1 - name of section taking dead load from left panel.for_dl2 - name of section taking dead load from right panel.for_wlvf - name of section taking wind load from vertical feature, if any.for_wlhf1 - name of section taking wind load from horizontal feature at left side, if any.for_wlhf2 - name of section taking wind load from horizontal feature at right side, if any.the last three items can be
Nonewhen corresponding load does not existwl – list of float, design wind load on panel, [pressure, suction], unit = kPa, positive as pressure, negative as suction.
panel_dens1 – float, design area density of panel at left side of mullion, unit = kN/m 2.
panel_dens2 – float, design area density of panel at right side of mullion, unit = kN/m 2.
support1 – list of float, distance from top end of mullion to primary support, unit = mm.
support2 – list of float, distance from primary support to secondary support, unit = mm. No secondary support in that span if corresponding item in list is 0.
support2_lateral – bool, secondary support also provides lateral restrain.
wlvf – float, design wind load on vertical feature, unit = kPa, positive as rightward, negative as leftward.
wlhf – float, design wind load on horizontal feature, unit = kPa, positive as uplifting, negative as downward.
bvf – float, windward breadth of vertical feature, unit = mm.
bhf – float, windward breadth of horizontal feature, unit = mm.
hf_gap – float, gap between horizontal feature and centroid of connected section, unit = mm.
hf_loc – list, distance of horizontal features to top end of mullion at each span, unit = mm. No horizontal feature in that span if corresponding item in list is 0.
wlvf_flip – bool, also check the case that wind load direction on vertical feature is flipped.
wlhf_flip – bool, also check the case that wind load direction on horizontal feature is flipped.
summary – bool, output the summary of verification only.
- Returns:
if summary = True, return a namedtuple
Mullion_summary. otherwise return 3 namedtuple,Mullion_model,Mullion_verifyandMullion_critical.
Refer to explanations to Namedtuples for Output of Mullion Check
- pyfacade.strcals.check_mullions_varsec(section_lib, section_mat, section_combs, height, b1, b2, load_app, wl, panel_dens1, panel_dens2, support1, support2=None, support2_lateral=False, wlvf=0.0, wlhf=0.0, bvf=0.0, bhf=0.0, hf_gap=0.0, hf_loc=None, wlvf_flip=True, wlhf_flip=True, summary=False)
Verification of mullion of combined sections inconsistently.
- Parameters:
section_lib – str or dict, section library stating section properties and boundary information. In form of str as path and name of json file created by
pyacad.Acad.seclib, or a nested dict in the same form.section_mat – dict, material of involved sections, {sec_name_1: material_1, sec_name_2: material_2, …}
section_combs –
nested list of section combinations, [comb1, comb2, comb3 …] in same order as mullion span from Bottom to Top, each combination is in the form of [[sec_name_1, sec_name_2, comb_indicator],…]. The comb_indicator is one of below:
’x’, ‘X’ or 1 - combine in x-direction’y’, ‘Y’ or 2 - combine in y-direction’xy’, ‘XY’ or 0 - combine in both directionsheight – list of float, height of mullions from lower to upper, unit = mm.
b1 – float, width of panel at left side of mullion, unit = mm.
b2 – float, width of panel at right side of mullion, unit = mm.
load_app – list of str, name of sections takes loads [for_wl1, for_wl2, for_dl1, for_dl2, for_wlvf, for_wlhf1, for_wlhf2] the last three can be ‘None’ when corresponding load does not exist
wl – list of float, design wind load on panel, [pressure, suction], unit = kPa, positive as pressure, negative as suction
panel_dens1 – float, design area density of panel at left side of mullion, unit = kN/m 2.
panel_dens2 – float, design area density of panel at right side of mullion, unit = kN/m 2.
support1 – list of float, distance from top end of mullion to primary support, unit = mm.
support2 – list of float, distance from primary support to secondary support, unit = mm. No secondary support in that span if corresponding item in list is 0.
support2_lateral – bool, secondary support also provides lateral restrain.
wlvf – float, design wind load on vertical feature, unit = kPa, positive as rightward, negative as leftward.
wlhf – float, design wind load on horizontal feature, unit = kPa, positive as uplifting, negative as downward.
bvf – float, windward breadth of vertical feature, unit = mm.
bhf – float, windward breadth of horizontal feature, unit = mm.
hf_gap – float, gap between horizontal feature and centroid of connected section, unit = mm.
hf_loc – list, distance of horizontal features to top end of mullion at each span, unit = mm. No horizontal feature in that span if corresponding item in list is 0.
wlvf_flip – bool, also check the case that wind load direction on vertical feature is flipped.
wlhf_flip – bool, also check the case that wind load direction on horizontal feature is flipped.
summary – bool, output the verification summary only.
- Returns:
if summary = True, return a namedtuple
Mullion_summary. otherwise return 3 namedtuple,Mullion_model,Mullion_verifyandMullion_critical.
Refer to explanations to Namedtuples for Output of Mullion Check
- pyfacade.strcals.build_frame(drawing=None, sec_mod=None, sec_area=None, sec_inert=None, auto_assign=False, geoacc=4, file_name=None)
Interactively build 2D frame model through AutoCAD.
- Parameters:
drawing – str. file name (and path) with extension of .dwg to open and operate on. Activate the specified file if it is opened already. Otherwise, try to open the file from specified path.
sec_mod – list of float, modulus of elasticity of each beam. unit = N/mm 2. If not given, use unit value (1) as default.
sec_area – list of float, section area of each beam, unit = mm 2. If not given, use unit value (1) as default.
sec_inert – list of float, moment of inertia of each beam, unit = mm 4. If not given, use unit value (1) as default.
auto_assign – bool. Automatically assign the provide modulus of elasticity, section area and moment of inertia to beams in order. If the size of provided list is not enough, the last value in list will be repeated. If False, interactive keyborad inputting will be requested.
geoacc – int. number of decimal place to be kept when getting the nodes’ coordinates.
file_name – str, file name for exporting model information, with extension of ‘.json’. If not specified, exporting procedure will be skipped.
- Returns:
tuple. (
pyfacade.pyeng.Beam2object,pyfacade.pyeng.Bsolverobject)
- pyfacade.strcals.load_frame(file_name, build=True)
Load 2D frame model from file saved by
build_frame.- Parameters:
file_name – str, file name with extension of ‘.json’ to be loaded.
build – bool, build 2D frame based on loaded model information.
- Returns:
If build = True, return a tuple (
pyfacade.pyeng.Beam2object,pyfacade.pyeng.Bsolverobject). Otherwise, return a namedtupleFrame_model.
Refer to explanations to Namedtuples for Output of Loading Frame
Namedtuples for Output of Transom Check
Transom_summary, including 3 fields:max_stress: a tuple in the form of (max. stress in alum. member, max. stress in steel member), presents max. stress on the entire model produced by most critical factored load combinations.
max_deflection_wl: a tuple in the form of (max. deflection in x-axis, max deflection in y-axis), presents max. deflection of the entire model produced by nominal wind load.
max_deflection_dl: a tuple in the form of (max. deflection in x-axis, max deflection in y-axis), presents max. deflection of the entire model produced by nominal dead load.
Transom_output, including 4 fields:shear: dict of max shear (shear in x-axis, shear in y-axis) due to factored load combinations on each section. Unit=N.
stress: dict of max stress (compressive, tensile) due to factored load combinations on each sections. Unit=MPa.
deflection_wl: dict of (max deflection in x-axis, max deflection in y-axis) due to nominal wind load combinations on each section. Unit=mm.
deflection_dl: dict of (max deflection in x-axis, max deflection in y-axis) due to nominal dead load combinations on each section. Unit=mm.
Namedtuples for Output of Mullion Check
Mullion_summary, including 2 fields,max_stress: a tuple in the form of (max. stress in alum. member, max. stress in steel member), presents max. stress on the entire model produced by most critical factored load combinations.
max_deflection: a tuple in the form of (max. deflection in x-axis, max deflection in y-axis), presents max. deflection of the entire model produced by most critical nominal load combination.
Mullion_model, including 5 fields:N: overall matrix of non-factored max axial force due to load cases
V: overall matrix of non-factored max shear force due to load cases
Mn: overall matrix of non-factored bending moment at support due to load cases
Mp: overall matrix of non-factored bending moment in span due to load cases
D: overall matrix of deflection due to load cases
Mullion_verify, including 6 fields:axial: dict of factored (max compression, max tension) on each section. Unit=N.
shear: dict of (max shear in x-axis, max shear in y-axis) due to factored load combinations on each section. Unit=N.
moment_n: dict of factored moments pair (about x-axis, about y-axis) causing max. compressive bending stress under load combinations on each section. Unit=N*mm.
moment_p: dict of factored moments pair (about x-axis, about y-axis) causing max. tensile bending stress under load combinations on each section. Unit=N*mm.
stress: dict of max stress (compressive, tensile) due to factored load combinations on each sections. Unit=MPa.
deflection: dict of (max deflection in x-axis, max deflection in y-axis) due to nominal load combinations on each section. Unit=mm.
Mullion_critical, including 4 fields:N: location occurs (max compression, max tension)
V: location occurs (max shear in x-axis, max shear in y-axis)
S: location occurs (max compressive stress, max tensile stress)
D: location occurs (max deflection in x-axis, max deflection in y-axis)
Where, location is a tuple in the form of (relative_position_on_member, member_number).
Namedtuples for Output of Loading Frame
Frame_model, including 9 fields:nodes: nested list, coordinates of all nodes in model. Unit = mm.
beams: nested list, beam sets of index pair of start and end nodes of each beam.
A: list, section area of each beam. Unit = mm 2
I: list, moment of inertia of each beam. Unit = mm 4
E: list, modulus of elasticity of each beam. Unit = N/mm 2
restrain: dict, definition of structural restrain.
release: dict, definition of release condition of beams.
udl: dict, applied uniformly distributed load on beams.
pl: dict, applied concentrated load on nodes.