Fatigue API: Fatigue data objects
Module defining classes handling different kinds of fatigue data.
- class owimetadatabase_preprocessor.fatigue.data_objects.SNCurve(json_file: Dict[str, None | str | int64 | float64], api_object=None)
Bases:
object
Class to store and handle retrieved SN curves.
Each SN curve data requires an API call to the Fatigue API to retrieve the necessary data through Owimetadatabase. SNCurve instances should be created by the FatigueAPI class.
- __init__(json_file: Dict[str, None | str | int64 | float64], api_object=None) None
Constructor for the SNCurve class.
- Parameters:
json_file – The JSON object containing the SN curve data.
api_object – The FatigueAPI instance that created the SNCurve instance.
- property m: list | ndarray
m parameter of the SN-Curve.
- property log_a: list | ndarray
log_a parameter of the SN-Curve.
- property n_knee: float
Knee point of the SN-Curve.
- property name: str
Name of the SN-Curve
- property color_str: str
Returns the color attribute as a string suitable for plot.ly (hex).
- Returns:
str of color
- n(sigma: List[float64] | ndarray) float64 | ndarray
Return the number of cycles for a certain stress range.
- Parameters:
sigma – Stress ranges for which the maximum number of cycles is to be calculated
- sigma(n: List[float64] | ndarray) float64 | ndarray
Return the stress ranges for a certain number of n.
- Parameters:
n – Number of cycles for which the stress ranges have to be calculated
- plotly(n: List[float64] | ndarray | None = None, sigma: List[float64] | ndarray | None = None, show: bool = True) Tuple[List[Scattergl], Layout]
Use plotly to plot the SN curve
- Parameters:
n – Number of cycles for which the stress ranges have to be calculated and the plot shown.
sigma – Stress ranges for which the maximum number of cycles is to be calculated and the plot shown.
show – If True, the plot will be shown.
- Returns:
data, layout
- as_dict() Dict[str, Any]
Returns the SN curve description as a dictionary.
- as_df() DataFrame
Returns the SN curve description as a DataFrame.
- class owimetadatabase_preprocessor.fatigue.data_objects.FatigueDetail(json_file: Dict[str, None | str | int64 | float64], api_object=None, subassembly: SubAssembly | None = None)
Bases:
object
Class to store the fatigue data of turbine elements.
Each fatigue detail data requires an API call to the FatigueAPI class to retrieve the necessary data through Owimetadatabase. FatigueDetail instances should be created by the FatigueAPI class.
- Parameters:
name – The name of the detail.
projectsite – The project site of the detail.
fd_type – The type of the detail.
title – The title of the detail.
description – The description of the detail.
modeldefinition – The model definition of the detail.
fatiguelifein – The fatigue life of the detail.
fatiguelifeout – The fatigue life of the detail.
scfin – The SCF of the detail.
scfout – The SCF of the detail.
materialsafatyfactor – The material safety factor of the detail.
scaleeffect – The scale effect of the detail.
sncurves – The SN curves of the detail.
material – The material of the detail.
buildingblock – The building block of the detail.
height – The height of the detail.
- __init__(json_file: Dict[str, None | str | int64 | float64], api_object=None, subassembly: SubAssembly | None = None) None
Constructor for the FatigueDetail class.
- Parameters:
json – The JSON object containing the fatigue data.
api_object – The FatigueAPI instance that created the FatigueDetail instance.
subassembly – The SubAssembly instance that created the FatigueDetail instance.
- property sncurves: Dict[Dict[str, str], SNCurve]
SN curves of the detail.
- Returns:
Dictionary with SN curves of the detail.
- property buildingblock: BuildingBlock
Building block to which the detail belongs.
- property buildingblocktop
Top building block.
- property wall_thickness: List[float]
Wall thickness.
- property height: float
Height of the detail.
- property marker
- property line
- as_dict(identify_sncurves: bool = False) Dict[str, Any]
Returns the fatigue detail description as a dictionary.
- as_df() DataFrame
Returns the fatigue detail description as a DataFrame.
- class owimetadatabase_preprocessor.fatigue.data_objects.FatigueSubAssembly(json: Dict[str, None | str | int64 | float64], api_object=None)
Bases:
object
Class storing/operating fatigue data related to specific subassembly-turbine cobination.
Each subassembly data requires an API call to the FatigueAPI to retrieve the necessary data through Owimetadatabase. FatigueSubAssembly instances should be created by the FatigueAPI class.
- Parameters:
api – FatigueAPI instance.
id – Subassembly ID.
title – The title of the subassembly.
description – The description of the subassembly.
position – The position of the subassembly.
sa_type – The type of the subassembly (‘TP’, ‘MP’, ‘TW’, etc.).
source – The source of the subassembly.
asset – The parent turbine of the subassembly (e.g. ‘BBA01’).
subassembly – The SubAssembly object.
fatiguedetails – A list of FatigueDetail instances.
height – The height of the subassembly.
color – The color-code of the subassembly (for plotting purpose).
absolute_bottom – The absolute bottom of the subassembly.
absolute_top – The absolute top of the subassembly.
properties – A dictionary of the subassembly properties.
- __init__(json: Dict[str, None | str | int64 | float64], api_object=None) None
Constructor for the FatigueSubAssembly class.
- Parameters:
json – The JSON object containing the geometry data of the subassembly.
api_object – The FatigueAPI instance that created the FatigueSubAssembly instance.
- property asset
Turbine name.
- property subassembly
Subassembly object.
- property color
Color for the subassembly.
- property height: float
Height of the subassembly.
- property fatiguedetails: List[FatigueDetail]
Fatigue details of the subassembly.
- plotly(x_offset: float = 0.0, y_offset: float = 0.0, x_step: float = 10000.0, showlegend: bool = True, showmudline: bool = True, showplot: bool = True) Dict[str, Any]
Use plotly to plot the subassembly.
- as_df(include_absolute_postion: bool = True, identify_sncurves: bool = False) DataFrame
Returns the subassembly fatigue data as a DataFrame.
- property absolute_bottom: float
Absolute bottom.
- property absolute_top: float
Absolute top.
- property properties: Dict[str, float]
Subassembly properties.