Skip to content
Projects

FourierSurface

The equations of simgeometry.objects.fourier_surface, declared on the code that implements them and checked by the tests.

FourierSurface

classsource

A closed toroidal surface as a Fourier series, with nfp field periods.

surface
X(θ,φ)=(Rcos⁡φ,Rsin⁡φ,Z),R=∑m,nrmnccos⁡(mθ−Nfpnφ)+rmnssin⁡(⋅),Z=∑m,nzmnssin⁡(mθ−Nfpnφ)+zmnccos⁡(⋅)X(\theta, \varphi) = (R\cos\varphi, R\sin\varphi, Z), \quad R = \sum_{m,n} r^c_{mn}\cos(m\theta - N_\mathrm{fp} n\varphi) + r^s_{mn}\sin(\cdot), \quad Z = \sum_{m,n} z^s_{mn}\sin(m\theta - N_\mathrm{fp} n\varphi) + z^c_{mn}\cos(\cdot)
normal
n=σ Xθ×Xφ∣Xθ×Xφ∣,σ=sign⁡∮X⋅(Xθ×Xφ) dθ dφn = \sigma\,\frac{X_\theta \times X_\varphi}{|X_\theta \times X_\varphi|}, \qquad \sigma = \operatorname{sign} \oint X \cdot (X_\theta \times X_\varphi)\, d\theta\, d\varphi
hit
a+td=X(θ,φ):(d−Xθ−Xφ)δ=−(a+td−X),(t,θ,φ)+=δa + t d = X(\theta, \varphi): \quad \begin{pmatrix} d & -X_\theta & -X_\varphi \end{pmatrix} \delta = -(a + t d - X), \quad (t, \theta, \varphi) \mathrel{+}= \delta
closest
min⁡θ,φ12∣X−p∣2:Hδ=−((X−p)⋅Xθ,(X−p)⋅Xφ),Hij=Xi⋅Xj+(X−p)⋅Xij\min_{\theta, \varphi} \tfrac12 |X - p|^2: \quad H \delta = -\bigl((X - p)\cdot X_\theta, (X - p)\cdot X_\varphi\bigr), \quad H_{ij} = X_i \cdot X_j + (X - p)\cdot X_{ij}
offset
X′=X+δ n,(R′,Z′) at φ′=φj refitted by least squaresX' = X + \delta\, n, \qquad (R', Z') \text{ at } \varphi' = \varphi_j \text{ refitted by least squares}
volume
V=13∮X⋅n dA,A=∮∣Xθ×Xφ∣ dθ dφ(trapezoidal rule)V = \tfrac13 \oint X \cdot n\, dA, \qquad A = \oint |X_\theta \times X_\varphi|\, d\theta\, d\varphi \quad \text{(trapezoidal rule)}
Order
2
Assumes
  • VMEC's and ConStellaration's SurfaceRZFourier: m=0…Mm = 0 \dots M, n=−N…Nn = -N \dots N, φ\varphi the cylindrical angle; each cross-section at constant φ\varphi a simple closed curve
  • membership and the hit search on the triangulation of resolution (nθ,nφ)(n_\theta, n_\varphi) points per poloidal turn and per field period, exact for the triangles (TriangleMesh)
  • refine: hits moved onto the surface by Newton steps on (t,θ,φ)(t, \theta, \varphi) from the triangle's angles, to 10−1210^{-12} of the surface's size; kept on the triangle if a step fails or leaves (10−12,1](10^{-12}, 1]
  • whether a segment hits is decided by the triangles: grazing segments within triangulation_error of the surface may differ from the exact surface
  • offset: the normal offset is a surface at distance ∣δ∣|\delta| while ∣δ∣|\delta| is below the smallest radius of curvature of the concave parts; refitted with 2M2M poloidal and 2N2N toroidal modes by default
  • the order is that of the hit fractions from the triangles alone in the angular spacing
Built from