The vector updater computes a range of first derivatives of quanties defined on the USim computational mesh using a least squares gradient method. This updater differs from the firstOrderMusclUpdater (1d, 2d, 3d), classicMusclUpdater (1d, 2d, 3d), unstructMusclUpdater (1d, 2d, 3d) and thirdOrderMusclUpdater (1d, 2d, 3d) updaters in that no upwinding is performed here. As such, the vector updater is only suitable for problems that do not require upwind stabilization.
The vector updater accepts the parameters below, in addition to those required by Updater.
in
(string vector, required)out
(string vector, required)orderAccuracy
(integer, required)numberOfInterpolationPoints
(integer, required)Number of points to be considerd for the least squares fit. This parameter varies from mesh to mesh and should be determined by computing a known function on the mesh.
The numberOfInterpolationPoints must be greater than (or equal to) the number of coefficients in the polynomial approximation. This means that in 1d the value is 4, in 2D the value is at least 6 and in 3D the value is at least 10.
These choices do not guarantee that a matrix inverse will be found. The following values though appear to be adequate in general: in 1D 4; in 2D 8 and in 3D 20.
coefficient
(float, required)derivative
(string, required)
gradient
(derivative = gradient)Computes \(c\nabla \phi\) where \(\phi\) is a scalar quantity defined on the grid and c is a constant coefficient. When derivative = gradient is specified, the following input and output variables should be specified:
in
- \(\phi\) (nodalArray, 1-component, required): scalar quantity to compute the gradient of.
out
- \(c\nabla \phi\) (nodalArray, 3-components, required): gradient of \(\phi\)
curl
(derivative = curl)Computes \(c\nabla \times \mathbf{v}\) where \(\mathbf{v}\) is a vector quantity defined on the grid and c is a constant coefficient. When derivative = curl is specified, the following input and output variables should be specified:
in
- \(\mathbf{v}\) (nodalArray, 3-components, required): vector quantity to compute the curl of.
out
- \(c\nabla \times \mathbf{v}\) (nodalArray, 3-components, required): curl of \(\mathbf{v}\)
divergence
(derivative = divergence)Computes \(c\nabla \cdot \mathbf{v}\) where \(\mathbf{v}\) is a vector quantity defined on the grid and c is a constant coefficient. When derivative = divergence is specified, the following input and output variables should be specified:
in
- \(\mathbf{v}\) (nodalArray, 3-components, required); vector quantity to compute the divergence of.
out
- \(c\nabla \cdot \mathbf{v}\) (nodalArray, 3-components, required); divergence of \(\mathbf{v}\)
The following code block demonstrates the least squares gradient operator for computing the gradient of a scalar quantity:
<Updater derivative>
kind = vector2d
derivative = gradient
coefficient = 1.0
numberOfInterpolationPoints = 8
orderAccuracy = 2
onGrid = domain
in = [phi]
out = [gradPhi]
</Updater>
The following code block demonstrates the least squares curl operator for computing the curl of a vector quantity:
<Updater copier>
kind = vector2d
onGrid = domain
derivative = curl
coefficient = 1.0
orderAccuracy = 1
numberOfInterpolationPoints = 5
in = [q]
out = [qnew]
</Updater>
The following code block demonstrates the least squares divergence operator for computing the divergence of a vector quantity:
<Updater copier>
kind = vector2d
onGrid = domain
derivative = divergence
orderAccuracy = 2
coefficient = 1.0
numberOfInterpolationPoints = 8 # 7 for 1st degree polynomial
in = [q]
out = [qnew]
</Updater>