Column#

../../_images/column.png

Description

  • Create a new model

  • Set model base data (activate addons, select standard, …)

  • Define and create model objects

  • Perform stability analysis

  • Define steel desgin configuration and steel effective length

  • Perform steel design

from math import inf
from dlubal.api import rfem


def define_structure() -> list:
    """Define and return a list of structural objects."""

    return [
        # Define material
        rfem.structure_core.Material(
            no=1,
            name='S235',
        ),

        # Define section
        rfem.structure_core.Section(
            no=1,
            name='HEB 300',
            material=1,
            shear_stiffness_deactivated=True,
        ),

        # Define nodes
        rfem.structure_core.Node(
            no=1,
        ),
        rfem.structure_core.Node(
            no=2,
            coordinate_3=10.0,
        ),

        # Define member
        rfem.structure_core.Member(
            no = 1,
            line = 1,
            node_start=1,
            node_end=2,
            section_start = 1
        ),

        # Define nodal support at Node 1
        rfem.types_for_nodes.NodalSupport(
            no=1,
            nodes=[1],
            spring_x=inf,
            spring_y=inf,
            spring_z=inf,
            rotational_restraint_x=5000000,
            rotational_restraint_y=5000000,
            rotational_restraint_z=inf,
        ),

        # Define nodal support at Node 2
        rfem.types_for_nodes.NodalSupport(
            no=2,
            nodes=[2],
            spring_x=inf,
            spring_y=inf,
            spring_z=0,
            rotational_restraint_x=0,
            rotational_restraint_y=0,
            rotational_restraint_z=inf,
        ),
    ]

def define_loading() -> list:
    """Define and return a list of loading objects."""

    return [
        # Static analysis settings
        rfem.loading.StaticAnalysisSettings(
            no=1,
            analysis_type=rfem.loading.StaticAnalysisSettings.ANALYSIS_TYPE_GEOMETRICALLY_LINEAR
        ),

        # Stability analysis settings
        rfem.loading.StabilityAnalysisSettings(
            no=1,
            analysis_type=rfem.loading.StabilityAnalysisSettings.ANALYSIS_TYPE_EIGENVALUE_METHOD,
            number_of_lowest_eigenvalues=2,
        ),

        # Define load cases
        rfem.loading.LoadCase(
            no=1,
            stability_analysis_settings=1,
            calculate_critical_load=True,
            self_weight_active=False,
        ),

        # Define nodal loads
        rfem.loads.NodalLoad(
            no=1,
            load_case=1,
            nodes=[2],
            load_type=rfem.loads.NodalLoad.LOAD_TYPE_COMPONENTS,
            components_force_z=-1000000,  # Force in Z direction (N)
        ),

        # Define design situation
        rfem.loading.DesignSituation(
            no=1,
            design_situation_type=rfem.loading.DesignSituation.DESIGN_SITUATION_TYPE_STR_PERMANENT_AND_TRANSIENT_6_10,
        ),

        # Define load combination
        rfem.loading.LoadCombination(
            no=1,
            name='CO1',
            items =  rfem.loading.LoadCombination.ItemsTable(
                    rows=[
                        rfem.loading.LoadCombination.ItemsRow(
                            load_case=1,
                            factor=1,
                        ),
                    ]
            ),
            design_situation=1,
        ),


    ]

def define_steel_design() -> list:
    """Define and return a list of steel design objects."""

    return [
        # Define steel design configuration
        rfem.steel_design_objects.SteelDesignUlsConfiguration(
            no=1,
            assigned_to_all_members=True,
        ),

        # Set steel effective length from stability analysis
        rfem.types_for_steel_design.SteelEffectiveLengths(
            no=1,
            members=[1],
            import_from_stability_analysis_enabled=True,
            stability_import_data_loading_y=rfem.ObjectId(
                no=1, object_type =
                rfem.OBJECT_TYPE_LOAD_CASE
            ),
            stability_import_data_loading_z=rfem.ObjectId(
                no=1, object_type =
                rfem.OBJECT_TYPE_LOAD_CASE
            ),
            stability_import_data_mode_number_y=2,
            stability_import_data_mode_number_z=1,
            stability_import_data_member_y=1,
            stability_import_data_member_z=1,
        ),
    ]


"""Runs the structural analysis example."""

with rfem.Application() as rfem_app:

    # Step 1: Create a new model
    rfem_app.close_all_models(save_changes=False)
    rfem_app.create_model(name='column_stability')

    # Step 2: Set model base data
    base_data = rfem_app.get_base_data()

    base_data.general_settings.global_axes_orientation = rfem.BaseData.GeneralSettings.GLOBAL_AXES_ORIENTATION_ZUP
    base_data.addons.structure_stability_active = True
    base_data.addons.steel_design_active = True
    base_data.standards.steel_design_standard = rfem.BaseData.Standards.STEEL_DESIGN_NATIONAL_ANNEX_AND_EDITION_EN_1993_DIN_2020_11_STANDARD

    rfem_app.set_base_data(base_data=base_data)

    # Step 3: Define and create model objects
    rfem_app.delete_all_objects()
    objects = define_structure() + define_loading()
    rfem_app.create_object_list(objects)

    # Step 4: Perform stability analysis
    stability_analysis = rfem_app.calculate_all(skip_warnings=True)
    print(f"\nStability Analysis:\n{stability_analysis}")

    # Step 5: Define steel desgin configuration incl effective length
    objects = define_steel_design()
    rfem_app.create_object_list(objects)

    # Step 6: Perform steel design
    steel_design = rfem_app.calculate_all(skip_warnings=True)
    print(f"\nSteel Design:\n{steel_design}")