note on incorporating b-normal evolution in nimrod · d τ ∫dτ ' (2) *3 ∂ ∂ ......

5
1/5 Note on Incorporating B-normal Evolution in NIMROD CRS, 9/2/13 Introduction The spatial representation for magnetic field in NIMROD is not free of divergence. The field-advance includes a diffusive term for ∇⋅ B , which maintains low divergence error provided that the surface-integral of B ˆ n is zero and that the polynomial representation in each element is of sufficient order to allow effective separation of the longitudinal and solenoidal parts of the vector-space. When applying time-dependent boundary conditions on B ˆ n , the representation requires specification of both B ˆ n as an essential condition and E tang in a surface-integral/ natural condition. Here, we describe how to obtain the rate of change of B ˆ n from E tang in cases such as a resistive wall, where E tang is not known analytically. We derive a separate set of 2- vector algebraic systems for the R and Z components of ΔB at each node and for each toroidal Fourier component along the surface of the domain. Equation (10) below summarizes the result. Background As with locations in the interior of the domain, the evolution of magnetic field at the surface of the domain is governed by Faraday's law, B = −∇ × E . Derivatives of E are not available, but the situation is analogous to computations for the interior of the domain, where we rely on weak forms of each equation. To arrive at an expression that can be evaluated, start from the expansion used for vector fields in NIMROD, B R, Z, φ, t ( ) = B k, n,ν t () A k, n,ν R, Z, φ ( ) k, n,ν , (1) where A k,n, ν are the vector finite-element/Fourier bases. They are A k, n,ν R, Z, φ ( ) = α k ξ R, Z ( ) , η R, Z ( ) ! " # $ e in φ ˆ e ν φ () , (2) where α k is a 2D finite/spectral-element basis function, and ˆ e ν φ () are the basic cylindrical unit vectors (ν = 1,2,3) in non-standard order ˆ e 1 = ˆ R φ () ˆ e 2 = Z ˆ e 3 = ˆ φ φ () (3) used in the right-handed sense. The 'logical' element coordinates ξ and η in (2) are only known implicitly as inverses of the mapping functions R ξ , η ( ) and Z ξ , η ( ) that are defined for each element. While elements are used to assemble global algebraic systems for coefficients, element labels do not appear explicitly in expansion (2). Typically, there are many k-indexed bases per element and some extend over more than one element. Note that coefficients for vector fields are just numbers, not Euclidean vectors. Euclidean basis information is best left as part of vector bases. The surface-normal relation that we need here will couple the ν = 1 and ν = 2 coefficients at each finite-element node along the surface of

Upload: others

Post on 03-Jan-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Note on Incorporating B-normal Evolution in NIMROD · d τ ∫dτ ' (2) *3 ∂ ∂ ... Ignoring it may be an acceptable approximation in many applications. Thus, the terms that Andi

1/5

Note on Incorporating B-normal Evolution in NIMROD CRS, 9/2/13

Introduction The spatial representation for magnetic field in NIMROD is not free of divergence. The

field-advance includes a diffusive term for ∇⋅B , which maintains low divergence error provided that the surface-integral of B ⋅ n is zero and that the polynomial representation in each element is of sufficient order to allow effective separation of the longitudinal and solenoidal parts of the vector-space. When applying time-dependent boundary conditions on B ⋅ n , the representation requires specification of both B ⋅ n as an essential condition and Etang in a surface-integral/ natural condition. Here, we describe how to obtain the rate of change of B ⋅ n from Etang in cases such as a resistive wall, where Etang is not known analytically. We derive a separate set of 2-vector algebraic systems for the R and Z components of ΔB at each node and for each toroidal Fourier component along the surface of the domain. Equation (10) below summarizes the result.

Background As with locations in the interior of the domain, the evolution of magnetic field at the surface

of the domain is governed by Faraday's law, B = −∇×E . Derivatives of E are not available, but the situation is analogous to computations for the interior of the domain, where we rely on weak forms of each equation. To arrive at an expression that can be evaluated, start from the expansion used for vector fields in NIMROD,

B R,Z,φ, t( ) = Bk,n,ν t( )Ak,n,ν R,Z,φ( )k,n,ν∑

, (1)

where Ak,n,ν are the vector finite-element/Fourier bases. They are

Ak,n,ν R,Z,φ( ) =αk ξ R,Z( ),η R,Z( )!" #$einφ eν φ( ) ,

(2)

where αk is a 2D finite/spectral-element basis function, and eν φ( ) are the basic cylindrical unit vectors (ν = 1,2,3) in non-standard order

e1 = R φ( )e2 =Z

e3 = φ φ( )

(3)

used in the right-handed sense. The 'logical' element coordinates ξ and η in (2) are only known implicitly as inverses of the mapping functions R ξ,η( ) and Z ξ,η( ) that are defined for each element. While elements are used to assemble global algebraic systems for coefficients, element labels do not appear explicitly in expansion (2). Typically, there are many k-indexed bases per element and some extend over more than one element.

Note that coefficients for vector fields are just numbers, not Euclidean vectors. Euclidean basis information is best left as part of vector bases. The surface-normal relation that we need here will couple the ν = 1 and ν = 2 coefficients at each finite-element node along the surface of

Page 2: Note on Incorporating B-normal Evolution in NIMROD · d τ ∫dτ ' (2) *3 ∂ ∂ ... Ignoring it may be an acceptable approximation in many applications. Thus, the terms that Andi

2/5

the domain. The tangential and normal unit vectors are defined from the mapping functions in each element,

t = ∂R

∂τ

"

#$

%

&'2+∂Z∂τ

"

#$

%

&'2(

)**

+

,--

−1/2∂R∂τe1+

∂Z∂τe2

"

#$

%

&'

n = t× φ

(4)

where τ may be ±ξ or ±η, depending on which side of an element runs along the domain boundary. In general, these unit vectors are not well defined at element corners and particularly at corners in a physical domain. For convenience, NIMROD saves components of these vectors at node locations, and their saved values at element corners are based on information averaged from the two adjacent element-sides.

Surface computation

In our NIMROD computations to date, we have prescribed the normal component of magnetic field with either time-independent or time-dependent conditions. The resistive-wall implementation will be unique in that the evolution of the normal component depends on the evolving dependent fields in the computation.

Using Stokes's theorem directly seems like a logical approach, but it doesn't lead to a unique prescription for the evolution of coefficients in a finite-element expansion. On the other hand, because we only want the separate systems to affect coefficients for nodes along the surface, they are constructed from integrals over the surface, where bases associated with other coefficients vanish. Another unusual aspect for NIMROD is that projection requires us to insert nn in the surface integral to test the relation with respect to the surface-normal direction, i.e. from the strong form of Faraday's law, apply A∗"k , "n , "ν ⋅ nn ⋅ and integrate over the surface,

A∗"k , "n , "ν ⋅ n( ) n ⋅ ∂∂t BdS∫ = − A∗"k , "n , "ν ⋅ n( ) n ⋅∇×EdS∫ , (5)

for all !n , !ν and just the k' bases that are nonzero along the surface. This forms an algebraic system. Primed indices are associated with row indices in the algebraic system. Nonzero contributions only arise for !n = n , due to the orthogonality of the Fourier bases, and for !ν =1,2 due to the symmetry of NIMROD domains. The left side of (5) and the expansion for B define the matrix in an algebraic system for each Fourier component n,

A∗"k ,n, "ν ⋅ n( ) n ⋅ ∂∂t BdS∫ → α "kαkn "ν nν dS∫'( )*∂∂tBk,n,ν

+

,-

.

/0

k,ν∑

= 2π α "kαkn "ν nνRdldτ

dτ∫'

(2)

*3∂∂tBk,n,ν

+

,-

.

/0

k,ν∑ , (6)

where the subscripted nν are spatially varying components, and l is an arc length in the poloidal plane. The numerical integrals are most easily accomplish using Gauss-Lobatto-Legrendre (GLL) integration with the same number of integration points as used for the nodal GLL bases αk

Page 3: Note on Incorporating B-normal Evolution in NIMROD · d τ ∫dτ ' (2) *3 ∂ ∂ ... Ignoring it may be an acceptable approximation in many applications. Thus, the terms that Andi

3/5

used in NIMROD. The resulting matrix is block-diagonal with 2×2 blocks from the components of the unit normal.

To avoid differentiating E, use vector identities in the right side of (5). Prior to carrying out integration, the right side for the n-th Fourier component is

− α "k e−inφ n "ν( ) n ⋅∇×EdS∫ = n ⋅ ∇ α "k e

−inφ n "ν( )×E−∇× α "k e−inφ n "ν E( )'

()*+,dS∫

. (7)

The appearance of unit normal vectors on the right side makes this more complicated than the relations for the interior of the domain. However, this form does allow us to apply Stokes's theorem to the second term,

− n ⋅∇× α %k e−inφ n %ν E( )dS∫ = − α %k e

−inφ n %ν E ⋅dl∫ . (8)

While the entire surface is closed, the integral should be considered one element-side at a time for the element-sides that contact the domain surface. As illustrated in the rough sketch below, the contour integration 1) extends toroidally by 2π at one surface-corner of an element, 2) turns for a poloidal segment toward the other surface-corner of the element, 3) extends toroidally by 2π in the other direction, and 4) turns back along the same poloidal segment as step 2 but in the opposite direction. The periodic nature of the electric field and bases implies that 2) and 4) cancel. The results from segments 1) and 3) affect only the coefficients of B whose finite-element bases (α !k ) are nonzero at the element corners (viewed in the poloidal plane). Here the

integrals are just 2πRα !k n !ν Eφn , where the superscript indicates Fourier component. In the

algebraic system from the surface integral, there are contributions from the two element-sides that share the corner location, and the two element-sides contribute with opposite signs. If the components n1 and n2 have the same values in the two adjacent element-sides, the contributions cancel. This is obviously not the case at a physical corner. Because the mappings are defined element-by-element and are not smooth across element borders, it is generally not the case even when the boundary of the physical domain is a smooth surface.

Sketch of the contribution from one element to the path integral in Eq. (8).

1

2

3 4

edge of one 2D element swept over φ

Page 4: Note on Incorporating B-normal Evolution in NIMROD · d τ ∫dτ ' (2) *3 ∂ ∂ ... Ignoring it may be an acceptable approximation in many applications. Thus, the terms that Andi

4/5

We next consider the first term on the right side of (7).

n ⋅∇ α #k e−inφ n #ν( )×EdS∫ = n× n #ν ∇α #k − i

nRα #k n #ν φ +α #k ∇n #ν

(

)*

+

,-e−inφ ⋅EdS∫

(9)

Information for the first two contributions to the integral on the right side is readily available in NIMROD once Etang is known. For the third term, components of the unit normal are defined in terms of derivatives of the mapping functions [see Eq. (4)], so their gradients are not computed in the present implementation. The first and third terms only sense Eφ , and the third is expected to be smaller than the first by the ratio of the node spacing and the surface-curvature scale. Ignoring it may be an acceptable approximation in many applications. Thus, the terms that Andi Montgomery has already implemented [for example, see slide 6 of https://nimrodteam.org/meetings/team_mtg_8_13/ALM-nim-Aug13.pdf] should be the dominant components on the right side for a domain with a smooth surface.

Use in NIMROD

Assembling the contributions from the previous section for an advance of the surface-normal components of B produces

2π α !kαkn !ν nνRdldτ

dτ∫#

$%&

'(ΔBk,n,ν( )

k,ν∑ =

Δt n× n !ν ∇α !k − inRα !k n !ν φ +α !k ∇n !ν

/

01

2

34e−inφ ⋅EdS∫ +σ 2πRα !k n !ν Eφ

n#

$%

&

'(

, (10)

where Δt is the time-step and

σ =

−1, node "k is at the most counter-clockwise end of the element side,+1, node "k is at the most clockwise end of the element side, 0, node "k is not at an element corner.

#

$%

&%

As noted previously, with GLL numerical integration with the same number of nodes as NIMROD's nodal GLL expansion, the left side effectively has a Kronecker delta, δ !k k , and a Dirac delta, δ τ −τ k( ) , in the integral. The integration weight must be factored into the product, however.

It may be acceptable to simplify the right side of (10). Where the radius of curvature of the cross-section boundary is large relative to the node spacing, max n×α "k ∇n "ν <<max n× n "ν ∇α "k , and the third term can be dropped. If the surface of the problem domain is smooth, meaning that the poloidal cross-section has no corners, then contributions to the last term in (10) will cancel with increasing poloidal resolution, and it can be dropped.

When diffusion through the wall is slow relative to other physical processes, the evolution of the normal component of B along the surface can be treated explicitly and time-split from the

Page 5: Note on Incorporating B-normal Evolution in NIMROD · d τ ∫dτ ' (2) *3 ∂ ∂ ... Ignoring it may be an acceptable approximation in many applications. Thus, the terms that Andi

5/5

rest of the field-advance. During each time-step, we can solve a separate algebraic system (or systems) for the change in B ⋅ n along the surface and add this contribution before the B-advance. In this implementation, the field-advance proceeds in the usual way, where the normal component is prescribed with the new information, and the consistent Etang is used in its surface integral. For cases where diffusion through the wall is not slow, it should be possible to use (10) in a simultaneous advance of B in the interior and exterior regions. The remainder of this note focuses on the explicit implementation.

The relation (10) does not provide an invertible relation for a time-split computation of ΔB ⋅ n at each node along the surface, because is does not specify how the tangential projection should change. Algebraically, if θ is the angle between the R and n directions (in the poloidal plane) at some surface-node k,

n !ν nν =cos2θ cosθ sinθcosθ sinθ sin2θ

"

#

$$

%

&

'' ,

which does not have an inverse. This can be addressed with the constraint of no change in the tangential projection of B along the surface during the time-split surface-normal update. With λ as the Lagrange multiplier, incorporating this constraint in Eq. (10) produces

2π α !kαk n !ν nν +λt !ν tν( )R dldτ

dτ∫#

$%&

'(ΔBk,n,ν( )

k,ν∑ =

Δt n× n !ν ∇α !k − inRα !k n !ν φ +α !k ∇n !ν

/

01

2

34e−inφ ⋅EdS∫ +σ 2πRα !k n !ν Eφ

n#

$%

&

'(

. (11)

The resulting 2×2 relation for each Fourier component n and each node k can be inverted independently for ΔBk,n,ν=1,2 , provided that λ ≠ 0 .

Each 2×2 matrix in (11) is proportional to n !ν nν +λt !ν tν( ) , so each algebraic system can be

expressed as

cos2θ cosθ sinθcosθ sinθ sin2θ

!

"

##

$

%

&&+λ sin2θ −cosθ sinθ

−cosθ sinθ cos2θ

!

"

##

$

%

&&

(

)

**

+

,

--

ΔBν=1ΔBν=2

!

"

##

$

%

&&=

r1r2

!

"

##

$

%

&&. (12)

Solving and projecting the solution in the n direction shows that the normal component of ΔB is independent of λ, r1cosθ + r2 sinθ . However, the tangential projection scales inversely with λ,

λ−1 r2 cosθ − r1sinθ( ) . Two possible approaches are: 1) make λ as large as safely possible with

double-precision math, say 108, and add ΔB directly to the R and Z components of B before the field advance; or 2) multiply the normal projection by the stored unit normal vectors at each node and add that to B. The first option generates small numerical errors. The nonzero tangential part will have some minor effect in the explicit terms for the field-advance, but the tangential components will evolve during the field-advance, anyway. The second option allows setting λ =1 to make the matrix in (12) the 2×2 identity, but using the stored unit normal vectors at physical corners of domains that are not smooth may generate significant local errors.