Linear Filament¶
Fields¶
cfsem.flux_density_linear_filament ¶
flux_density_linear_filament(
xyzp: Array3xN,
xyzfil: Array3xN,
dlxyzfil: Array3xN,
ifil: NDArray[float64],
wire_radius: float | NDArray[float64] = 0.0,
par: bool = True,
output: Literal["vector", "matrix"] = "vector",
) -> tuple[
NDArray[float64], NDArray[float64], NDArray[float64]
]
Biot-Savart law calculation for B-field contributions from many filament segments to many observation points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyzp
|
Array3xN
|
[m] x,y,z coords of observation points |
required |
xyzfil
|
Array3xN
|
[m] x,y,z coords of filament segment start points |
required |
dlxyzfil
|
Array3xN
|
[m] x,y,z deltas from segment start to segment end |
required |
ifil
|
NDArray[float64]
|
[A] current in each filament segment |
required |
wire_radius
|
float | NDArray[float64]
|
[m] filament radius, scalar or array of length |
0.0
|
par
|
bool
|
Whether to use CPU parallelism |
True
|
output
|
Literal['vector', 'matrix']
|
|
'vector'
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
[T] (Bx, By, Bz) magnetic flux density at observation points, |
NDArray[float64]
|
or explicit |
Source code in cfsem/bindings.py
cfsem.flux_density_linear_filament_hierarchical
builtin
¶
flux_density_linear_filament_hierarchical(
xyzp: ArrayTriple,
xyzfil: ArrayTriple,
dlxyzfil: ArrayTriple,
ifil: FloatArray,
wire_radius: FloatArray,
theta: float = 0.05,
construction_method: str = "longest_axis",
par: bool = True,
out: ArrayTriple | None = None,
extra_diagnostics: bool = False,
) -> SolveResult
Evaluate linear-filament flux density with the hierarchical solver from Python inputs.
cfsem.vector_potential_linear_filament ¶
vector_potential_linear_filament(
xyzp: Array3xN,
xyzfil: Array3xN,
dlxyzfil: Array3xN,
ifil: NDArray[float64],
wire_radius: float | NDArray[float64] = 0.0,
par: bool = True,
output: Literal["vector", "matrix"] = "vector",
) -> tuple[
NDArray[float64], NDArray[float64], NDArray[float64]
]
Vector potential calculation for A-field contribution from many current filament segments to many observation points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyzp
|
Array3xN
|
[m] x,y,z coords of observation points |
required |
xyzfil
|
Array3xN
|
[m] x,y,z coords of filament segment start points |
required |
dlxyzfil
|
Array3xN
|
[m] x,y,z deltas from segment start to segment end |
required |
ifil
|
NDArray[float64]
|
[A] current in each filament segment |
required |
wire_radius
|
float | NDArray[float64]
|
[m] filament radius, scalar or array of length |
0.0
|
par
|
bool
|
Whether to use CPU parallelism |
True
|
output
|
Literal['vector', 'matrix']
|
|
'vector'
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
[Wb/m] or [V-s/m] (Ax, Ay, Az) magnetic vector potential at observation points, |
NDArray[float64]
|
or explicit |
Source code in cfsem/bindings.py
cfsem.vector_potential_linear_filament_hierarchical
builtin
¶
vector_potential_linear_filament_hierarchical(
xyzp: ArrayTriple,
xyzfil: ArrayTriple,
dlxyzfil: ArrayTriple,
ifil: FloatArray,
wire_radius: FloatArray,
theta: float = 0.05,
construction_method: str = "longest_axis",
par: bool = True,
out: ArrayTriple | None = None,
extra_diagnostics: bool = False,
) -> SolveResult
Evaluate linear-filament vector potential with the hierarchical solver from Python inputs.
Force¶
cfsem.body_force_density_linear_filament ¶
body_force_density_linear_filament(
xyzfil: Array3xN,
dlxyzfil: Array3xN,
ifil: NDArray[float64],
obs: Array3xN,
j: Array3xN,
wire_radius: float | NDArray[float64] = 0.0,
par: bool = True,
) -> Array3xN
JxB (Lorentz) body force density (per volume) due to a linear current filament segment at an observation point with some current density (per area).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyzfil
|
Array3xN
|
[m] x,y,z coords of current filament origins (start of segment) |
required |
dlxyzfil
|
Array3xN
|
[m] x,y,z length delta of current filaments |
required |
ifil
|
NDArray[float64]
|
[A] filament current |
required |
obs
|
Array3xN
|
[m] x,y,z coords of observation locations |
required |
j
|
Array3xN
|
[A/m^2] current density vector at observation locations |
required |
wire_radius
|
float | NDArray[float64]
|
[m] filament radius, scalar or array of length |
0.0
|
par
|
bool
|
Whether to use CPU parallelism |
True
|
Returns:
| Type | Description |
|---|---|
Array3xN
|
[N/m^3] body force density |
Source code in cfsem/bindings.py
Paths¶
cfsem.filament_coil ¶
Create an array of filaments from coil cross-section, evenly spaced inside the winding pack. No filaments are coincident with the coil surface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r
|
float
|
[m] radius, coil center |
required |
z
|
float
|
[m] axial position, coil center |
required |
w
|
float
|
[m] width of coil pack |
required |
h
|
float
|
[m] height of coil pack |
required |
nt
|
float
|
turns |
required |
nr
|
int
|
radial discretizations |
required |
nz
|
int
|
axial discretizations |
required |
Returns:
| Type | Description |
|---|---|
NDArray
|
(nr*nz) x 3, (r,z,n) of each filament |
Source code in cfsem/__init__.py
cfsem.filament_helix_path ¶
filament_helix_path(
path: Array3xN,
helix_start_offset: tuple[float, float, float],
twist_pitch: float,
angle_offset: float,
) -> Array3xN
Filamentize a helix about an arbitrary piecewise-linear path.
Assumes angle between sequential path segments is small and will fail if that angle approaches or exceeds 90 degrees.
The helix initial position vector, helix_start_offset, must be in a plane normal to the first path segment in order to produce good results. If it is not in-plane, it will be projected on to that plane and then scaled to the magnitude of its original length s.t. the distance from the helix to the path center is preserved but its orientation is not.
Description of the method:
- Translate [filament segment n-1] to the base of [path segment n] and call it [filament segment n]
- Take cross product of [path segment n] with [path segment n-1]
- Rotate [filament segment n] segment about the axis of that cross product to bring it into the plane defined by [path segment n] as a normal vector
- Rotate [filament seg. n] about [path seg. n] to continue the helix orbit
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Array3xN
|
[m] 3xN Centerline points |
required |
helix_start_offset
|
tuple[float, float, float]
|
[m] (3x1) Initial position of helix rel. to centerline path |
required |
twist_pitch
|
float
|
[m] (scalar) Centerline length per helix orbit |
required |
angle_offset
|
float
|
[rad] (scalar) Initial rotation offset about centerline |
required |
Returns:
| Type | Description |
|---|---|
Array3xN
|
[m] 3xN array of points on the helix that twists around the path |
Source code in cfsem/bindings.py
cfsem.rotate_filaments_about_path ¶
Rotate a path of point about another path.
Intended for rotating a helix generated by filament_helix_path
about the centerline that was used to generate it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Array3xN
|
[m] x,y,z Centerline points |
required |
angle_offset
|
float
|
[rad] (scalar) Initial rotation offset about centerline |
required |
fils
|
Array3xN
|
[m] x,y,z Filaments to rotate around centerline |
required |
Returns:
| Type | Description |
|---|---|
Array3xN
|
[m] 3xN array of points on the helix that twists around the path |