Source code for viiapackage.viiaTools

### ===================================================================================================================
###  MODULE viiaTools
### ===================================================================================================================
# This module ``viiaTools`` contains the functions available for the user to use tools.

# Module is based on:
# VIIA_QE_R376 Basis of Design Retrofit Advice NLTH, v12.0, d.d. 10 December 2024
# VIIA_QE_R376 Basis of Design Step-by-Step MRS, v1.0, d.d. 21 January 2022
# VIIA_QE_R1674 Uitgangspuntenrapport engineering NLPO, v1.0, d.d. 1 August 2019

# This script was based upon the Constitution For Python At VIIA
# Copyright ©2026 Haskoning Nederland B.V.
# For use by VIIA

### ===================================================================================================================
###  1. Import modules
### ===================================================================================================================

# General imports
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING, Optional, Literal

# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
    from viiapackage.viiaStatus import ViiaProject
from viiapackage.wind_comparison.viia_wind_comparison import viia_create_wind_comparison_report


### ===================================================================================================================
###  2. Wind Comparison Tool
### ===================================================================================================================

[docs]def viia_wind_comparison( project: ViiaProject, height: float, width: float, depth: float, year: Optional[int] = None, roof_type: Literal['flat', 'duopitch'] = 'flat', roof_angle: Optional[float] = None, orientation_angle: float = 0) -> Optional[Path]: """ This function is used to execute the seismic assessment of the structure based on the wind comparison procedure. Currently, the wind part of this comparison is available in an automated workflow. User should still copy the relevant data to the NCG template and include the lateral force part for the seismic part of the comparison. Future developments will further assist the user in this workflow. .. note:: Function is only available in Python version 3.11 and higher. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - height (float): The height of the (simplified) building structure, in [m]. - width (float): The width of the (simplified) building structure, in [m]. This is the dimension perpendicular to the wind at 0 degrees. The specification of the front facade aligns with EN1991-1-4 for different roof-types. - depth (float): The depth of the (simplified) building structure, in [m]. This is the dimension in the direction of the wind at 0 degrees. The specification of the front facade aligns with EN1991-1-4 for different roof-types. - year (int): Optional input for the original construction year (or relevant year of extension). Default value is None, in which case the original construction year is retrieved from MYVIIA (preferred workflow). If year is incorrect, inform the projectleader. The year is used to determine the wind velocity that has occurred on the load resisting structure (note, check for changes in the load bearing structure). User can overrule the original construction year by providing any other year (before 2026). - roof_type (str): Select the type of roof for the building structure. Select from 'flat' or 'duopitch'. Default value is 'flat'. - roof_angle (float): For duopitch roofs, the angle of the roof should be provided, in [degrees]. The input is ignored for roof-type 'flat'. Default value is None. - orientation_angle (float): Rotation of the building, in [deg]. Default value is 0. Input is used for the sections of the terrain roughness calculation. 0 degrees is a front facade facing South. Output: - Returns the file-path of the generated report with the wind part of the comparison. """ # If the year of construction is not provided, the value will be retrieved from MYVIIA if year is None and ( 'oorspronkelijk_bouwjaar' not in project.project_information or not isinstance(project.project_information['oorspronkelijk_bouwjaar'], int)): raise ValueError( "ERROR: Retrieving the original building year from MYVIIA failed. Please check the database or provide the " "year manually.") elif year is None: year = project.project_information['oorspronkelijk_bouwjaar'] # Create the report for the wind part of the comparison return viia_create_wind_comparison_report( project=project, height=height, width=width, depth=depth, year=year, roof_type=roof_type, roof_angle=roof_angle, orientation_angle=orientation_angle)
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================