N2PFatigueDamage Module#
- class NaxToPy.Modules.fatigue.N2PFatigueDamage.N2PFatigueDamage[source]#
Bases:
objectClass for calculating Fatigue Damage
Calculates cumulative damage caused by cyclic loading based on FEM results.
Example
>>> damage = N2PFatigueDamage() >>> damage.Model = model_n2p >>> damage.EventsFile = r"FatigueEvents.csv" >>> damage.MaterialsFile = r"Materials.csv" >>> damage.AnalysisType = 'Uniaxial' >>> damage.ResultType = 'STRESSES' >>> damage.Method = 'VON_MISES' >>> damage.ResultsPosition = 'Element' >>> damage.MaterialAssignment = {"Steel": Steel_elements_n2p} >>> damage.kts = {1.000001:kt1_elements_n2p} >>> damage.MeanStressCorrection = 'Goodman' >>> damage.CycleCountingMethod = "RAINFLOW_FOR_REPEATING_HISTORIES" >>> Damage_Results = damage.calculate()
- calculate() float[source]#
Run the full fatigue calculation.
The workflow is:
Read the events file.
Read the materials file and build the materials database.
Obtain the results and the kt factors for every combination.
Iterate over each event and its combinations.
Compute the cycles (block load) and the fatigue of each combination.
Compute the total damage of each event from its combinations.
Add up the total damage of every event to obtain the global damage.
- Returns:
Global accumulated damage, obtained as the sum of the damage of all the events.
- Return type:
float
- calculate_normal_stress(results_n2p: dict, components: list, n_planes: int = 18) dict[source]#
Compute the normal stresses sigma(theta) of a CQUAD at several plane orientations.
- Parameters:
results_n2p (dict) – Plane stresses per element, load case and component (
"XX","YY","XY"). For example,results_n2p[(elem, lc, "XX")]holds anp.ndarray.components (list) – Stress components to be processed.
n_planes (int, optional) – Number of planes to analyse. Default is 18, which gives angles of 0, 10, …, 170 degrees.
- Returns:
Same format as
results_n2p, but holding the sigma(theta) components.- Return type:
dict
- calculate_signed_von_mises(results_n2p: dict, components: list) dict[source]#
Computes the Signed Von Mises stress.
The absolute value is taken from the Von Mises stress, while the sign is assigned from the principal stress with the largest absolute magnitude.
- Parameters:
results_n2p (dict) – Dictionary containing results indexed by (lc, inc, component).
components (list) – Input components in the following order: [von_mises, maximum_principal, minimum_principal]
- Returns:
Dictionary containing the “SIGNED_VON_MISES” component for each (lc, inc) combination.
- Return type:
dict
- get_filtered_elements_by_Method()[source]#
Return the elements filtered according to the input fatigue method.
The filtering applied to each method is:
VON_MISES: no restriction, all elements are kept.CRITICAL_PLANE: limited to 2D elements (CQUAD4,CTRIA3).…
- Returns:
Elements that the input fatigue method can be applied to.
- Return type:
list
- get_solver() str[source]#
Normalize the solver name to one of the standard keys.
The standard keys are:
'Abaqus''Optistruct''Nastran''Ansys'
Variants such as
'H3DOptistruct'or'NastranBulk'are also recognized and mapped to their standard key.- Returns:
Normalized solver name.
- Return type:
str
- property AnalysisType: str#
Type of Analysis that has been chosen.
- property AverageSections: str#
Property that returns the averaging method applied to sections (e.g., ‘Max’, ‘Min’).
- property CycleCountingMethod: bool#
Property that returns the Cycle Counting Method for TimeSeries [“RAINFLOW”, “RANGE-PAIR”, “RAINFLOW_FOR_REPEATING_HISTORIES”]
- property Damage_Results#
Returns total accumulated and orientation damage per element.
- property Damage_total_global#
- property ElementList: list[N2PElement]#
Property that returns the list of N2PElement objects to be evaluated.
- property EventsFile: str#
Property that returns the Events file path.
- property FatigueEvents: FatigueEvents#
Property that returns the FatigueEvents object, which stores all Events and their combinations.
- property HDF5: HDF5_NaxTo#
Property which returns the HDF5 attribute which contains all the necessary info to create it
- property Kts: dict[slice(<class 'float'>, list[NaxToPy.Core.Classes.N2PElement.N2PElement], None)]#
Property that returns the stress concentration factors (Kt) by element or region.
- property MaterialAssignment: dict#
Returns the material-to-elements assignment provided by the user (eliminando duplicados)
- property MaterialsFile: str#
Property that returns the materials file path.
- property MeanStressCorrection: str#
Property that returns the mean stress correction method (e.g., ‘Goodman’, ‘Gerber’).
- property Method: str#
Property that returns the fatigue evaluation method (e.g., ‘VON_MISES’, ‘MAXIMUM_PRINCIPAL’).
- property Model: N2PModelContent#
Property that returns the model attribute, that is, the N2PModelContent to be analyzed.
- property ResultType: str#
Type of result that has been chosen.
- property ResultsPosition: str#
Property that returns the entity type (e.g., “ELEMENT-CENTROID”, “ELEMENT-NODE”, “NODE”) for fatigue calculation.
- property Sections: str#
Property that returns the identifiers of the sections to be analyzed (e.g., ‘Z1#Z2’).