mean_stress¶
Overview
Represent cycle mean stresses and apply the DNVGL-RP-C203, Walker, SWT, or Goodman–Haigh correction.
MeanStress¶
py_fatigue.mean_stress.mean_stress.MeanStress
dataclass
¶
Bases: FatigueStress
Mean stress class.
Source code in py_fatigue/mean_stress/mean_stress.py
13 14 15 16 | |
corrections¶
py_fatigue.mean_stress.corrections ¶
The py_fatigue.mean_stress.corrections module collects all the
mean stress corrections implemented in py_fatigue.
classes.
Functions:¶
__goodman_equation ¶
__goodman_equation(
amp_out_val,
amp_in_val,
r_in_val,
r_out_val,
ult_s,
correction_exponent,
)
Implicit equation to solve for amp_out.
The quantities are:
- \(R_{in} = \sigma_{min}/\sigma_{max}\) is the input stress ratio.
- \(R_{out}\) is the output stress ratio.
- \(\sigma_{amp,in}\) is the input amplitude.
- \(\sigma_{amp,out}\) is the output amplitude.
- \(\sigma_{ult}\) is the ultimate material strength.
- \(n\) is the correction exponent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amp_out_val
|
float
|
The output amplitude value. |
required |
amp_in_val
|
float
|
The input amplitude value. |
required |
r_in_val
|
float
|
The input load ratio value. |
required |
r_out_val
|
float
|
The output load ratio value. |
required |
ult_s
|
float
|
The ultimate strength of the material. |
required |
correction_exponent
|
float
|
The correction exponent value. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The difference between the left-hand side and right-hand side of the equation. |
Source code in py_fatigue/mean_stress/corrections.py
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 | |
dnvgl_mean_stress_correction ¶
dnvgl_mean_stress_correction(
mean_stress,
stress_amplitude,
detail_factor=0.8,
plot=False,
)
Calculates the mean stress correction according to par. 2.5 of DNVGL-RP-C203, which includes an attenuation factor \(p\) for the stress ranges if the following cases:
- base material without significant residual stresses \(\rightarrow p = 0.6\). This option neglects fully compressive cycles.
- welded connections without significant residual stresses \(\rightarrow p = 0.8\). This option multiplies the stress range of fully compressive cycles by p.
Given that the stress ranges are \(\Delta \sigma\), the corrected stress ranges are:
where:
with:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mean_stress
|
ndarray
|
The mean stress of the fatigue test (\(\sigma_m\)). |
required |
stress_amplitude
|
ndarray
|
The stress amplitude of the fatigue test (\(\sigma_{amp}\)). |
required |
detail_factor
|
float
|
mean stress attenuation factor (\(p\)), defaults to 0.8 in welded connections without significant residual stresses. |
0.8
|
plot
|
bool or callable
|
Use True for a Matplotlib plot or pass a function that receives the figure. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The mean stress corrected ranges (\(\Delta \sigma_{corr}\)). |
Source code in py_fatigue/mean_stress/corrections.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
goodman_haigh_mean_stress_correction ¶
goodman_haigh_mean_stress_correction(
amp_in,
mean_in,
r_out,
ult_s,
correction_exponent,
initial_guess=None,
plot=False,
logger=None,
)
This function extends the standard Goodman-Haigh correction formula which computes the corrected stress amplitude at zero mean stress (\(R=-1\)) for a given set of input stress amplitudes and mean stresses.
The correction exponent \(n\) is a material property that can be obtained from experimental data.
The current implementation extends the standard Goodman-Haigh formula by correcting the stress amplitude from an initial load ratio \(R_{in}\) to any other load ratio \(R_{out}\), as long as the material's ultimate strength is known. The corrected stress amplitude \(\sigma_{amp, \text{out}}\) is computed using the following implicit nonlinear equation:
where:
- \(R_{in} = \sigma_{min}/\sigma_{max}\) is the input stress ratio.
- \(R_{out}\) is the output stress ratio.
- \(\sigma_{amp,in}\) is the input amplitude.
- \(\sigma_{amp,out}\) is the output amplitude.
- \(\sigma_{ult}\) is the ultimate material strength.
- \(n\) is the correction exponent.
The solver is based on the Newton-Raphson method, which is implemented
internally at the native solver,
the Newton iteration, and
__goodman_equation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amp_in
|
ndarray | list
|
Input amplitude values. |
required |
mean_in
|
ndarray | list
|
Input mean stress values. |
required |
r_out
|
float | ndarray
|
Output stress ratio values. |
required |
ult_s
|
float
|
Ultimate strength of the material. |
required |
correction_exponent
|
float
|
Mean stress correction exponent (n). |
required |
plot
|
bool or callable
|
Use True for a Matplotlib plot or pass a function that receives the figure. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
Computed amp_out values, and corresponding mean_out values. |
See Also
the native solver, the Newton iteration
Raises:
| Type | Description |
|---|---|
ValueError
|
If the input arrays have different shapes or if there are negative stress amplitude values in amp_in. |
Warning
|
If the number of points in the input arrays is too large for plotting. |
Examples:
>>> import numpy as np
>>> from py_fatigue.mean_stress.corrections import (
... goodman_haigh_mean_stress_correction
... )
>>> amp_in = np.array([100, 200, 300])
>>> mean_in = np.array([0, 0, 0])
>>> r_out = np.array([-1, 0, 0.5, 0.75, 0.9])
>>> ult_s = 1000
>>> correction_exponent = 9
>>> amp_out, mean_out = goodman_haigh_mean_stress_correction(
... amp_in, mean_in, r_out, ult_s, correction_exponent, plot=True
... )
Source code in py_fatigue/mean_stress/corrections.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | |
swt_mean_stress_correction ¶
swt_mean_stress_correction(
mean_stress, stress_amplitude, plot=False
)
Calculates the mean stress correction according to Smith-Watson-Topper model. It is equivalent to the Walker model with gamma = 0.5.
The correction is given by:
with:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mean_stress
|
ndarray
|
The mean stress of the fatigue test (\(\sigma_{mean}\)). |
required |
stress_amplitude
|
ndarray
|
The stress amplitude of the fatigue test (\(\sigma_{amp}\)). |
required |
plot
|
bool or callable
|
Use True for a Matplotlib plot or pass a function that receives the figure. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The mean stress corrected ranges (\(\Delta \sigma_{corr}\)). |
Source code in py_fatigue/mean_stress/corrections.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |
walker_mean_stress_correction ¶
walker_mean_stress_correction(
mean_stress, stress_amplitude, gamma=0.5, plot=False
)
Calculates the mean stress correction according to Walker model.
The correction is given by:
with:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mean_stress
|
ndarray
|
The mean stress of the fatigue test (\(\sigma_{mean}\)). |
required |
stress_amplitude
|
ndarray
|
The stress amplitude of the fatigue test (\(\sigma_{amp}\)). |
required |
gamma
|
float
|
The gamma Walker exponent (\(\gamma\)), defaults to 0.5. |
0.5
|
plot
|
bool or callable
|
Use True for a Matplotlib plot or pass a function that receives the figure. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The mean stress corrected ranges (\(\Delta \sigma_{corr}\)). |
Source code in py_fatigue/mean_stress/corrections.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |