Skip to content

Circular Filament

Fields

cfsem.flux_density_circular_filament

flux_density_circular_filament(
    ifil: NDArray[float64],
    rfil: NDArray[float64],
    zfil: NDArray[float64],
    rprime: NDArray[float64],
    zprime: NDArray[float64],
    par: bool = True,
) -> tuple[NDArray[float64], NDArray[float64]]

Off-axis Br,Bz components for a circular current filament in vacuum.

Near-exact formula (except numerically-evaluated elliptic integrals) See eqns. 12, 13 pg. 34 in [1], eqn 9.8.7 in [2], and all of [3].

Note the formula for Br as given by [1] is incorrect and does not satisfy the constraints of the calculation without correcting by a factor of (\(z / r\)).

References

[1] D. B. Montgomery and J. Terrell, “Some Useful Information For The Design Of Aircore Solenoids, Part I. Relationships Between Magnetic Field, Power, Ampere-Turns And Current Density. Part II. Homogeneous Magnetic Fields,” Massachusetts Inst. Of Tech. Francis Bitter National Magnet Lab, Cambridge, MA, Nov. 1961. Accessed: May 18, 2021. [Online]. Available: https://apps.dtic.mil/sti/citations/tr/AD0269073

[2] 8.02 Course Notes. Available: https://web.mit.edu/8.02t/www/802TEAL3D/visualizations/coursenotes/modules/guide09.pdf

[3] Eric Dennyson, "Magnet Formulas". Available: https://tiggerntatie.github.io/emagnet-py/offaxis/off_axis_loop.html

Parameters:

Name Type Description Default
ifil NDArray[float64]

[A] filament current

required
rfil NDArray[float64]

[m] filament R-coord

required
zfil NDArray[float64]

[m] filament Z-coord

required
rprime NDArray[float64]

[m] Observation point R-coord

required
zprime NDArray[float64]

[m] Observation point Z-coord

required
par bool

Whether to use CPU parallelism

True

Returns:

Type Description
tuple[NDArray[float64], NDArray[float64]]

[T] (Br, Bz) flux density components

Source code in cfsem/bindings.py
def flux_density_circular_filament(
    ifil: NDArray[float64],
    rfil: NDArray[float64],
    zfil: NDArray[float64],
    rprime: NDArray[float64],
    zprime: NDArray[float64],
    par: bool = True,
) -> tuple[NDArray[float64], NDArray[float64]]:
    """
    Off-axis Br,Bz components for a circular current filament in vacuum.

    Near-exact formula (except numerically-evaluated elliptic integrals)
    See eqns. 12, 13 pg. 34 in [1], eqn 9.8.7 in [2], and all of [3].

    Note the formula for Br as given by [1] is incorrect and does not satisfy the
    constraints of the calculation without correcting by a factor of ($z / r$).

    References:
        [1] D. B. Montgomery and J. Terrell,
            “Some Useful Information For The Design Of Aircore Solenoids,
            Part I. Relationships Between Magnetic Field, Power, Ampere-Turns
            And Current Density. Part II. Homogeneous Magnetic Fields,”
            Massachusetts Inst. Of Tech. Francis Bitter National Magnet Lab, Cambridge, MA,
            Nov. 1961. Accessed: May 18, 2021. [Online].
            Available: <https://apps.dtic.mil/sti/citations/tr/AD0269073>

        [2] 8.02 Course Notes. Available:
        <https://web.mit.edu/8.02t/www/802TEAL3D/visualizations/coursenotes/modules/guide09.pdf>

        [3] Eric Dennyson, "Magnet Formulas". Available:
        <https://tiggerntatie.github.io/emagnet-py/offaxis/off_axis_loop.html>

    Args:
        ifil: [A] filament current
        rfil: [m] filament R-coord
        zfil: [m] filament Z-coord
        rprime: [m] Observation point R-coord
        zprime: [m] Observation point Z-coord
        par: Whether to use CPU parallelism

    Returns:
        [T] (Br, Bz) flux density components
    """
    ifil, rfil, zfil = _3tup_contig((ifil, rfil, zfil))
    rprime, zprime = _2tup_contig((rprime, zprime))
    br, bz = em_flux_density_circular_filament(ifil, rfil, zfil, rprime, zprime, par)
    return br, bz  # [T]

cfsem.flux_density_circular_filament_cartesian

flux_density_circular_filament_cartesian(
    ifil: NDArray[float64],
    rfil: NDArray[float64],
    zfil: NDArray[float64],
    xyzp: Array3xN,
    par: bool = True,
) -> Array3xN

Flux density of a circular filament in cartesian form at a set of locations given in cartesian coordinates.

Parameters:

Name Type Description Default
ifil NDArray[float64]

[A] filament current

required
rfil NDArray[float64]

[m] filament R-coord

required
zfil NDArray[float64]

[m] filament Z-coord

required
xyzp Array3xN

[m] x,y,z coords of observation points

required
par bool

Whether to use CPU parallelism

True

Returns:

Type Description
Array3xN

[T] flux density

Source code in cfsem/bindings.py
def flux_density_circular_filament_cartesian(
    ifil: NDArray[float64],
    rfil: NDArray[float64],
    zfil: NDArray[float64],
    xyzp: Array3xN,
    par: bool = True,
) -> Array3xN:
    """
    Flux density of a circular filament in cartesian form
    at a set of locations given in cartesian coordinates.

    Args:
        ifil: [A] filament current
        rfil: [m] filament R-coord
        zfil: [m] filament Z-coord
        xyzp: [m] x,y,z coords of observation points
        par: Whether to use CPU parallelism

    Returns:
        [T] flux density
    """
    ifil, rfil, zfil = _3tup_contig((ifil, rfil, zfil))
    xyzp = _3tup_contig(xyzp)
    bx, by, bz = em_flux_density_circular_filament_cartesian(ifil, rfil, zfil, xyzp, par)  # [T]

    return bx, by, bz

cfsem.vector_potential_circular_filament

vector_potential_circular_filament(
    ifil: NDArray[float64],
    rfil: NDArray[float64],
    zfil: NDArray[float64],
    rprime: NDArray[float64],
    zprime: NDArray[float64],
    par: bool = True,
) -> NDArray[float64]

Vector potential contributions from some circular filaments to some observation points. Off-axis A_phi component for a circular current filament in vacuum.

The vector potential of a loop has zero r- and z- components due to symmetry, and does not vary in the phi-direction.

Note that to recover the B-field as the curl of A, the curl operator for cylindrical coordinates must be used with the output of this function incorporated into a full 3D A-field like [A_r, A_phi, A_z].

References

[1] J. C. Simpson, J. E. Lane, C. D. Immer, R. C. Youngquist, and T. Steinrock, “Simple Analytic Expressions for the Magnetic Field of a Circular Current Loop,” Jan. 01, 2001. Accessed: Sep. 06, 2022. [Online]. Available: https://ntrs.nasa.gov/citations/20010038494

Parameters:

Name Type Description Default
ifil NDArray[float64]

[A] filament current

required
rfil NDArray[float64]

[m] filament R-coord

required
zfil NDArray[float64]

[m] filament Z-coord

required
rprime NDArray[float64]

[m] Observation point R-coord

required
zprime NDArray[float64]

[m] Observation point Z-coord

required
par bool

Whether to use CPU parallelism

True

Returns:

Type Description
NDArray[float64]

[Wb/m] or [V-s/m] a_phi, vector potential in the toroidal direction

Source code in cfsem/bindings.py
def vector_potential_circular_filament(
    ifil: NDArray[float64],
    rfil: NDArray[float64],
    zfil: NDArray[float64],
    rprime: NDArray[float64],
    zprime: NDArray[float64],
    par: bool = True,
) -> NDArray[float64]:
    """
    Vector potential contributions from some circular filaments to some observation points.
    Off-axis A_phi component for a circular current filament in vacuum.

    The vector potential of a loop has zero r- and z- components due to symmetry,
    and does not vary in the phi-direction.

    Note that to recover the B-field as the curl of A, the curl operator for cylindrical
    coordinates must be used with the output of this function incorporated into a full
    3D A-field like [A_r, A_phi, A_z].

    References:
        [1] J. C. Simpson, J. E. Lane, C. D. Immer, R. C. Youngquist, and T. Steinrock,
            “Simple Analytic Expressions for the Magnetic Field of a Circular Current Loop,”
            Jan. 01, 2001. Accessed: Sep. 06, 2022. [Online]. Available: <https://ntrs.nasa.gov/citations/20010038494>

    Args:
        ifil: [A] filament current
        rfil: [m] filament R-coord
        zfil: [m] filament Z-coord
        rprime: [m] Observation point R-coord
        zprime: [m] Observation point Z-coord
        par: Whether to use CPU parallelism

    Returns:
        [Wb/m] or [V-s/m] a_phi, vector potential in the toroidal direction
    """
    ifil, rfil, zfil = _3tup_contig((ifil, rfil, zfil))
    rprime, zprime = _2tup_contig((rprime, zprime))
    a_phi = em_vector_potential_circular_filament(ifil, rfil, zfil, rprime, zprime, par)
    return a_phi  # [Wb/m] or [V-s/m]

Force

cfsem.body_force_density_circular_filament_cartesian

body_force_density_circular_filament_cartesian(
    ifil: NDArray[float64],
    rfil: NDArray[float64],
    zfil: NDArray[float64],
    obs: Array3xN,
    j: Array3xN,
    par: bool = True,
) -> Array3xN

JxB (Lorentz) body force density (per volume) in cartesian form due to a circular current filament segment at an observation point in cartesian form with some current density (per area).

Parameters:

Name Type Description Default
ifil NDArray[float64]

[A] filament current

required
rfil NDArray[float64]

[m] filament R-coord

required
zfil NDArray[float64]

[m] filament Z-coord

required
obs Array3xN

[m] x,y,z coords of observation locations

required
j Array3xN

[A/m^2] current density vector at observation locations

required
par bool

Whether to use CPU parallelism

True

Returns:

Type Description
Array3xN

[N/m^3] body force density

Source code in cfsem/bindings.py
def body_force_density_circular_filament_cartesian(
    ifil: NDArray[float64],
    rfil: NDArray[float64],
    zfil: NDArray[float64],
    obs: Array3xN,
    j: Array3xN,
    par: bool = True,
) -> Array3xN:
    """
    JxB (Lorentz) body force density (per volume) in cartesian form due to a circular current
    filament segment at an observation point in cartesian form with some current density (per area).

    Args:
        ifil: [A] filament current
        rfil: [m] filament R-coord
        zfil: [m] filament Z-coord
        obs: [m] x,y,z coords of observation locations
        j: [A/m^2] current density vector at observation locations
        par: Whether to use CPU parallelism

    Returns:
        [N/m^3] body force density
    """
    ifil, rfil, zfil = _3tup_contig((ifil, rfil, zfil))
    obs = _3tup_contig(obs)
    j = _3tup_contig(j)
    jxbx, jxby, jxbz = em_body_force_density_circular_filament_cartesian(
        ifil, rfil, zfil, obs, j, par
    )  # [N/m^3]

    return jxbx, jxby, jxbz