curlUpdater

curlUpdater

Works with VSimBase, VSimEM, VSimPD, VSimPA, and VSimMD licenses.

Multifield updater operation that solves equations of the form:

\[\frac{\partial {\bf F}}{\partial t}=A\left(\nabla \times {\bf G}\right)+B{\bf H},\]

via the operation:

\[F_{i}\left(t+\Delta t\right) = F_{i}\left(t\right) + (c_0 + c_1 \Delta t) \left[ A \left( \nabla \times {\bf G} \right)_{c_{g}+i} + B H_{c_{h}+i} \right],\]

\({\bf F}\) is the writeFields.

\({\bf G}\) is the first readFields .

\({\bf H}\) is an optional second readFields (if missing, the coefficient B is taken to be 0).

\(i\) is the updater component.

\(c_{0}\) and \(c_{1}\) are the dtCoefficients values (represented in the form [\(c_{0}\) \(c_{1}\)])

\(A\) and \(B\) are the readFieldFactors values.

\(c_{g}\) and \(c_{h}\) are the readFieldCompShifts values (represented in the form [\(c_{g}\) \(c_{h}\)] and usually both 0, see the note following curlUpdater Parameters).

curlUpdater Differencing Definitions

Forward curlUpdater differencing definition:

(3)\[\left( \nabla \times G \right)_{i,j,k,x} = \frac{G_{i,j+1,k,z} - G_{i,j,k,z}}{\Delta y} - \frac{G_{i,j,k+1,y} - G_{i,j,k,y}}{\Delta z}\]

Backward curlUpdater differencing definition:

(4)\[\left( \nabla \times G \right)_{i,j,k,x} = \frac{G_{i,j,k,z} - G_{i,j-1,k,z}}{\Delta y} - \frac{G_{i,j,k,y} - G_{i,j,k-1,y}}{\Delta z}\]

curlUpdater Parameters

The curlUpdater takes the lowerBounds and upperBounds parameters of FieldUpdater, as well as the global region modification parameters and local region modification parameters. In addition, curlUpdater takes the following parameters:

readFields (required string vector)

A vector of either one or two strings. The first string is the name of the field to take the curl of, and if provided, the second is the name of the field (multiplied by the specified factors) to add to the result.

writeFields (required string vector)

A vector containing a single element, which is the name of the field to update.

differencing (required string)

Either forward or backward, as described above.

useVecUpdater (optional integer, default = 0 (false))

If true, the updater will update all three components of the vector field specified in writeFields, beginning with the specified component. The updated field must therefore have at least \({\tt component} + 3\) components.

component (optional integer, default = 0)

The field component to update, or if useVecUpdater is true, the first field component to update.

readFieldCompShifts (optional integer vector, default = [0 0])

This vector must have the same number of elements as readFields. It specifies the amount by which to increment the component indices of the first field and the (optional) second field. It is equal to [\(c_g\) \(c_h\)] in the description above. For example, if a magnetic field is represented by components 3–5 of the field EandB, then to calculate the curl of that magnetic field, one would specify readFields = [EandB] and readFieldCompShifts = [3].

readFieldFactors (optional float vector)

If this is specified, there must be one element for each field specified in readFields. The terms in the update for each field are multiplied by the corresponding factors; they are the coefficients \(A\) and \(B\) in the description above. If not specified, the factors use values of \(1\) for each field.

dtCoefficients (optional float vector, default = [1. 0.])

Two components [\(c_{0}\) \(c_{1}\)] as defined in the equation above. The result of the updater will be multiplied by (\(c_{0}\) + \(c_{1} \Delta t\)), where \(\Delta t\) is the current time step.

gridBoundary (optional string)

If provided, only components on the interior of the specified GridBoundary will be updated. The method to define the interior is given in the interiorness parameters.

interiorness (optional string, default = cellcenter)

If the gridBoundary parameter is specified, this is the method the used to determine whether a component is interior to the boundary. The behavior depends on the offset specified in the updated Field. One of:

  • cellcenter:

    If offset = none, or offset = edge4v and component = 0, then a cell is considered interior if its node is adjacent to at least one cell with center inside the boundary.

    If offset = edge, or offset = edge4v and component is not 0, then a cell is considered interior if the edge specified by component is adjacent to at least one cell with center inside the boundary.

    If offset = face, then a cell is considered interior if the face specified by component is adjacent to at least one cell with center inside the boundary.

    If offset = center, then a cell is considered interior if its center is inside the boundary.

  • deymittra

    If offset = none, or offset = edge4v and component = 0, then a cell is considered interior if all nodes adjacent to (i.e. displaced by a single edge from) its node are inside the boundary.

    If offset = edge, or offset = edge4v and component is not 0, then a cell is considered interior if the edge specified by component has at least one adjacent node inside the boundary, and that edge is not ignored by the Dey-Mittra algorithm given the dmFrac parameter specified in the gridBoundary.

    If offset = face, then a cell is considered interior if all nodes adjacent to the face specified by component are inside the boundary.

    This interiorness option cannot be specified with offset = center.

  • dmnodal

    This interiorness option is identical to deymittra.

lowerSkinDepth (optional integer vector)

Specifies the number of skin cells, in each direction, on the lower end of the local domain. The cells in the skin are updated before the fields specified as messageFields in the UpdateStep or InitialUpdateStep block are messaged. If not specified, the skin depth will be determined automatically.

upperSkinDepth (optional integer vector)

Specifies the number of skin cells, in each direction, on the upper end of the local domain. If not specified, the skin depth will be determined automatically.

Example Yee Ampere (Ey) Update Block

To solve the y component of Ampere’s law with Maxwell’s correction,

(5)\[\nabla \times {\bf B}=\mu_{0}{\bf J}+\mu_{0}\varepsilon_{0}\frac{\partial {\bf E}}{\partial t},\]

via the curlUpdater opperation

(6)\[E_1 (t + \Delta t) = E_1 (t) + (0 + 1 \Delta t) \left[ c^2\left( \nabla \times {\bf B} \right)_1 - \frac{1}{\epsilon_0} S_2 \right],\]

where

\({\bf E}\) is the elecField, \({\bf B}\) is the magField, \({\bf J}\) is the current density, and \({\bf S}\) is the SumRhoJ field defined by

(7)\[{\bf S}=(\rho, J_0, J_1, J_2),\]

use the following code:

<FieldUpdater ampere-y>
    kind = curlUpdater
    component = 1
    differencing = backward
    writeFields = [elecField]
    readFields = [magField SumRhoJ]
    readFieldFactors = [$c^2$ ~$(-1/\epsilon_0)$]
    dtCoefficients = [0. 1.]
    readFieldCompShifts = [0 1]
</FieldUpdater>

Adding \(S_2\) is adding \(J_1\), thus the component on the SumRhoJ field must be shifted so that \(J_1\) is added to \(E_1\).