1212
1313import abc
1414from dataclasses import dataclass
15- from typing import TYPE_CHECKING , Final
15+ from typing import Final
1616
1717import numpy as np
1818
19- from bluemira .base .parameter_frame import Parameter , ParameterFrame
20-
21- if TYPE_CHECKING :
22- from bluemira .base .parameter_frame .typed import ParameterFrameLike
23-
2419__all__ = [
2520 "ConductorInfo" ,
2621 "EllipticalEmbeddedCrack" ,
3328
3429
3530@dataclass
36- class ConductorInfo ( ParameterFrame ) :
31+ class ConductorInfo :
3732 """
3833 Cable in conduit conductor information for Paris fatigue model
3934 """
4035
41- tk_radial : Parameter [ float ] # [m] in the loaded direction
42- width : Parameter [ float ] # [m] in the loaded direction
43- max_hoop_stress : Parameter [ float ] # [Pa]
44- residual_stress : Parameter [ float ] # [Pa]
45- walker_coeff : Parameter [ float ]
36+ tk_radial : float # [m] in the loaded direction
37+ width : float # [m] in the loaded direction
38+ max_hoop_stress : float # [Pa]
39+ residual_stress : float # [Pa]
40+ walker_coeff : float
4641
4742
4843@dataclass
49- class ParisFatigueMaterial ( ParameterFrame ) :
44+ class ParisFatigueMaterial :
5045 """
5146 Material properties for the Paris fatigue model
5247 """
5348
54- C : Parameter [ float ] # Paris law material constant
55- m : Parameter [ float ] # Paris law material exponent
56- K_ic : Parameter [ float ] # Fracture toughness [Pa/m^(1/2)]
49+ C : float # Paris law material constant
50+ m : float # Paris law material exponent
51+ K_ic : float # Fracture toughness [Pa/m^(1/2)]
5752
5853
5954@dataclass
60- class ParisFatigueSafetyFactors ( ParameterFrame ) :
55+ class ParisFatigueSafetyFactors :
6156 """
6257 Safety factors for the Paris fatigue model
6358 """
6459
65- sf_n_cycle : Parameter [float ]
66- sf_depth_crack : Parameter [float ]
67- sf_width_crack : Parameter [float ]
68- sf_fracture : Parameter [float ]
69-
70-
71- @dataclass
72- class CrackParams (ParameterFrame ):
73- """
74- Parameters for the crack class
75- """
76-
77- width : Parameter [float ]
78- """Crack width along the plate length direction"""
79- depth : Parameter [float ]
80- """Crack depth in the plate thickness direction"""
60+ sf_n_cycle : float
61+ sf_depth_crack : float
62+ sf_width_crack : float
63+ sf_fracture : float
8164
8265
8366def _stress_intensity_factor (
@@ -175,10 +158,9 @@ class Crack(abc.ABC):
175158 Crack width along the plate length direction
176159 """
177160
178- param_cls : type [CrackParams ] = CrackParams
179-
180- def __init__ (self , params : ParameterFrameLike ):
181- self .params = params
161+ def __init__ (self , depth , width ):
162+ self .depth = depth
163+ self .width = width
182164
183165 @classmethod
184166 def from_area (cls , area : float , aspect_ratio : float ) -> Crack :
@@ -190,9 +172,9 @@ def from_area(cls, area: float, aspect_ratio: float) -> Crack:
190172 :
191173 New instance of the crack geometry.
192174 """
193- cls . params . depth . value = np .sqrt (area / (cls .alpha * np .pi * aspect_ratio ))
194- cls . params . width . value = aspect_ratio * cls . params . depth . value
195- return cls (cls . params . depth . value , cls . params . width . value )
175+ depth = np .sqrt (area / (cls .alpha * np .pi * aspect_ratio ))
176+ width = aspect_ratio * depth
177+ return cls (depth , width )
196178
197179 @property
198180 def area (self ) -> float :
@@ -204,7 +186,7 @@ def area(self) -> float:
204186 :
205187 Area [m²].
206188 """
207- return self .alpha * np .pi * self .params . depth . value * self .params . width . value
189+ return self .alpha * np .pi * self .depth * self .width
208190
209191 @property
210192 @abc .abstractmethod
@@ -541,8 +523,8 @@ def calculate_n_pulses(
541523 max_crack_width = conductor .width / safety .sf_width_crack
542524 max_stress_intensity = material .K_ic / safety .sf_fracture
543525
544- a = crack .params . depth . value
545- c = crack .params . width . value
526+ a = crack .depth
527+ c = crack .width
546528 K_max = 0.0 # noqa: N806
547529 n_cycles = 0
548530
0 commit comments