Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
6bc98cc
addition of ParaterFrame dataclasses for classes in case_TF.py
kj5248 Aug 21, 2025
43d562d
addition of ParaterFrame dataclasses for classes in cable.py
kj5248 Aug 21, 2025
67631c7
addition of ParaterFrame dataclasses for classes in conductor.py
kj5248 Aug 21, 2025
92f5e8f
addition of ParaterFrame dataclasses for classes in fatigue.py
kj5248 Aug 21, 2025
77d0ab8
addition of ParaterFrame dataclasses for classes in strand.py
kj5248 Aug 21, 2025
7210fbd
reduced duplication in utils.py by replacing specific serie_r, serie_…
kj5248 Aug 21, 2025
92e5437
replaced old summation functions with new general summations in cable…
kj5248 Aug 21, 2025
003e780
addition of ParaterFrame dataclasses for classes in winding_pack.py
kj5248 Aug 21, 2025
433e4b4
add param details to docstring of class they are used in
kj5248 Aug 21, 2025
30ab237
removal of default values for certain parameters and added dataclass …
kj5248 Aug 21, 2025
3aa987c
remove unused _shape in cable
kj5248 Aug 21, 2025
409483f
remove superfluous calcs that = 1 such as dx / dy when dx = dy
kj5248 Aug 21, 2025
65f725d
small changes to some functions and left comments against some parts
kj5248 Aug 21, 2025
97c26a4
🔥 Remove dummy classes
je-cook Aug 22, 2025
b0439ac
🎨 More
je-cook Aug 23, 2025
b1c8444
🎨 Docstrings etc
je-cook Aug 27, 2025
f31dd32
add OptVariablesFrame for geometry parameterisations for Trapezoidal …
kj5248 Aug 27, 2025
c1ebf2a
consolidate some of the stiffness calculations in case_tf
kj5248 Aug 27, 2025
54614c9
remove unnecessary function for cable K when can just call it directly
kj5248 Aug 27, 2025
4dd6c7a
make dx and dy's consistent with rest of bluemira to mean half-width …
kj5248 Aug 27, 2025
3da7a07
remove _mat_ins_y_modulus and _mat_jacket_y_modulus and just called t…
kj5248 Aug 27, 2025
fe7ece4
First pass at a TFCoilXYDesigner class that breaks up creation of str…
kj5248 Aug 28, 2025
3ef1a64
rename and reshuffling of some params
kj5248 Aug 28, 2025
da0b5e4
remove parameter frames from module classes ie strand, cable etc and …
kj5248 Sep 2, 2025
789f7ac
ammended the designer to work better with multiple input WPs
kj5248 Sep 2, 2025
0ad7abe
fix to handling of materials in designer
kj5248 Sep 2, 2025
b45e249
✨ Get class
je-cook Sep 2, 2025
bd710a2
creation of new example to go with designer and fixes to classes to d…
kj5248 Sep 2, 2025
606ac5e
small fixes to resolve errors when running example
kj5248 Sep 3, 2025
abdc3d2
final fixes for simple example to work
kj5248 Sep 3, 2025
e9849f9
fix to mistake in how winding packs are handled within case geometry
kj5248 Sep 4, 2025
7aae41c
🔥 Remove youngs modulus extra func
je-cook Sep 10, 2025
f668574
🎨 More half width changes and ov useage
je-cook Sep 10, 2025
a233a74
🐛 Deal with strand init
je-cook Sep 10, 2025
2352ada
🚧 Undo proper dx dy
je-cook Sep 10, 2025
0c20cee
💬 Spelling
je-cook Sep 10, 2025
b33f667
🎨 Put back functions
je-cook Sep 10, 2025
4ac0d7b
🎨 More undo dx
je-cook Sep 10, 2025
fa41552
🎨 Move 4 diff
je-cook Sep 10, 2025
0c3f66d
🎨 Remove extra opt variables
je-cook Sep 10, 2025
e7a1274
🎨 Move 4 diff
je-cook Sep 10, 2025
a40be26
🔥 Remove pf
je-cook Sep 10, 2025
b523b0e
🎨 Cleanup
je-cook Sep 10, 2025
4c4da73
🎨 Reorganise
je-cook Sep 11, 2025
686cfe7
🔥 Remove while loop
je-cook Sep 11, 2025
d4f22a6
🎨 Small changes
je-cook Sep 11, 2025
8776200
🚚 Rearrange2
je-cook Sep 11, 2025
4bd7013
🚚 Rearrange3
je-cook Sep 11, 2025
0e81ebc
🚚 Rearrange4
je-cook Sep 11, 2025
9bfb0f3
rearrange5
je-cook Sep 11, 2025
68f5278
🚚 Rearrange6
je-cook Sep 11, 2025
643493a
🔥 Remove test file
je-cook Sep 11, 2025
fa8866b
💬 Spelling
je-cook Sep 11, 2025
3612121
🎨 Optimisation config
je-cook Sep 11, 2025
2a2e940
🔥 Remove some unneeded dictionary stuff
je-cook Sep 12, 2025
1690510
🚧 Possible differences
je-cook Sep 12, 2025
173b40f
🎨 Cleanup with units
je-cook Sep 12, 2025
bd4f43e
🎨 Make tests pass
je-cook Sep 12, 2025
85ac2b9
🎨 Simplifications and typing
je-cook Sep 15, 2025
8c8e131
🐛 Missing underscore
je-cook Sep 16, 2025
f8dd078
🔥 Remove old examples
je-cook Sep 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,344 changes: 265 additions & 1,079 deletions bluemira/magnets/cable.py

Large diffs are not rendered by default.

1,359 changes: 338 additions & 1,021 deletions bluemira/magnets/case_tf.py

Large diffs are not rendered by default.

634 changes: 152 additions & 482 deletions bluemira/magnets/conductor.py

Large diffs are not rendered by default.

49 changes: 29 additions & 20 deletions bluemira/magnets/fatigue.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
Paris Law fatigue model with FE-inspired analytical crack propagation
"""

from __future__ import annotations

import abc
from dataclasses import dataclass
from typing import Final

import numpy as np

Expand Down Expand Up @@ -87,7 +90,7 @@ def _boundary_correction_factor(

Returns
-------
float
:
Boundary correction factor F.
"""
return (m1 + m2 * a_d_t**2 + m3 * a_d_t**4) * g * f_phi * f_w
Expand All @@ -99,7 +102,7 @@ def _bending_correction_factor(h1: float, h2: float, p: float, phi: float) -> fl

Returns
-------
float
:
Bending correction factor.
"""
return h1 + (h2 - h1) * np.sin(phi) ** p
Expand All @@ -111,7 +114,7 @@ def _ellipse_shape_factor(ratio: float) -> float:

Returns
-------
float
:
Shape factor Q.
"""
return 1.0 + 1.464 * ratio**1.65
Expand All @@ -123,7 +126,7 @@ def _angular_location_correction(a: float, c: float, phi: float) -> float:

Returns
-------
float
:
Angular correction factor f_phi.
"""
if a <= c:
Expand All @@ -137,7 +140,7 @@ def _finite_width_correction(a_d_t: float, c: float, w: float) -> float:

Returns
-------
float
:
Finite width correction factor.
"""
return 1.0 / np.sqrt(np.cos(np.sqrt(a_d_t) * np.pi * c / (2 * w))) # (11)
Expand All @@ -155,20 +158,18 @@ class Crack(abc.ABC):
Crack width along the plate length direction
"""

alpha = None

def __init__(self, depth: float, width: float):
self.depth = depth # a
self.width = width # c
def __init__(self, depth, width):
self.depth = depth
self.width = width

@classmethod
def from_area(cls, area: float, aspect_ratio: float):
def from_area(cls, area: float, aspect_ratio: float) -> Crack:
"""
Instatiate a crack from an area and aspect ratio

Returns
-------
Crack
:
New instance of the crack geometry.
"""
depth = np.sqrt(area / (cls.alpha * np.pi * aspect_ratio))
Expand All @@ -182,11 +183,15 @@ def area(self) -> float:

Returns
-------
float
:
Area [m²].
"""
return self.alpha * np.pi * self.depth * self.width

@property
@abc.abstractmethod
def alpha(self) -> float: ...

@abc.abstractmethod
def stress_intensity_factor(
self,
Expand Down Expand Up @@ -215,7 +220,7 @@ class QuarterEllipticalCornerCrack(Crack):
Crack width along the plate length direction
"""

alpha = 0.25
alpha: Final[float] = 0.25

def stress_intensity_factor( # noqa: PLR6301
self,
Expand Down Expand Up @@ -249,7 +254,8 @@ def stress_intensity_factor( # noqa: PLR6301

Returns
-------
Stress intensity factor
:
Stress intensity factor

Notes
-----
Expand Down Expand Up @@ -315,7 +321,7 @@ class SemiEllipticalSurfaceCrack(Crack):
Crack width along the plate length direction
"""

alpha = 0.5
alpha: Final[float] = 0.5

def stress_intensity_factor( # noqa: PLR6301
self,
Expand Down Expand Up @@ -349,7 +355,8 @@ def stress_intensity_factor( # noqa: PLR6301

Returns
-------
Stress intensity factor
:
Stress intensity factor

Notes
-----
Expand Down Expand Up @@ -406,7 +413,7 @@ class EllipticalEmbeddedCrack(Crack):
Crack width along the plate length direction
"""

alpha = 1.0
alpha: Final[float] = 1.0

def stress_intensity_factor( # noqa: PLR6301
self,
Expand Down Expand Up @@ -440,7 +447,8 @@ def stress_intensity_factor( # noqa: PLR6301

Returns
-------
Stress intensity factor
:
Stress intensity factor

Notes
-----
Expand Down Expand Up @@ -495,7 +503,8 @@ def calculate_n_pulses(

Returns
-------
Number of plasma pulses
:
Number of plasma pulses

Notes
-----
Expand Down
68 changes: 0 additions & 68 deletions bluemira/magnets/init_magnets_registry.py

This file was deleted.

Loading
Loading