Operators

Operators

Difference operators

δx!(g::RegularCartesianGrid, f::CellField, δxf::FaceField)

Compute the difference $\delta_x(f) = f_E - f_W$ between the eastern and western cells of a cell-centered field f and store it in a face-centered field δxf, assuming both fields are defined on a regular Cartesian grid g with periodic boundary condition in the $x$-direction.

source
δx!(g::RegularCartesianGrid, f::FaceField, δxf::CellField)

Compute the difference $\delta_x(f) = f_E - f_W$ between the eastern and western faces of a face-centered field f and store it in a cell-centered field δxf, assuming both fields are defined on a regular Cartesian grid g with periodic boundary conditions in the $x$-direction.

source
δy!(g::RegularCartesianGrid, f::CellField, δyf::FaceField)

Compute the difference $\delta_y(f) = f_N - f_S$ between the northern and southern cells of a cell-centered field f and store it in a face-centered field δyf, assuming both fields are defined on a regular Cartesian grid g with periodic boundary condition in the $y$-direction.

source
δy!(g::RegularCartesianGrid, f::FaceField, δyf::CellField)

Compute the difference $\delta_y(f) = f_N - f_S$ between the northern and southern faces of a face-centered field f and store it in a cell-centered field δyf, assuming both fields are defined on a regular Cartesian grid g with periodic boundary condition in the $y$-direction.

source
δz!(g::RegularCartesianGrid, f::CellField, δzf::FaceField)

Compute the difference $\delta_z(f) = f_T - f_B$ between the top and bottom cells of a cell-centered field f and store it in a face-centered field δzf, assuming both fields are defined on a regular Cartesian grid g with Neumann boundary condition in the $z$-direction.

source
δz!(g::RegularCartesianGrid, f::FaceField, δzf::CellField)

Compute the difference $\delta_z(f) = f_T - f_B$ between the top and bottom faces of a face-centered field f and store it in a cell-centered field δzf, assuming both fields are defined on a regular Cartesian grid g with Neumann boundary condition in the $z$-direction.

source

Averaging operators

avgx!(g::RegularCartesianGrid, f::CellField, favgx::FaceField)

Compute the average $\overline{\;f\;}^x = \frac{f_E + f_W}{2}$ between the eastern and western cells of a cell-centered field f and store it in a g face-centered field favgx, assuming both fields are defined on a regular Cartesian grid g with periodic boundary conditions in the $x$-direction.

source

Divergence operators

Building on top of the differencing operators we can define operators that compute the divergence

\[\nabla\cdotp\mathbf{f} = \frac{1}{V} \left[ \delta_x \left( A_x f_x \right) + \delta_y\left( A_y f_y \right) + \delta_z\left( A_z f_z \right)\right]\]
div!(g, fx, fy, fz, div, tmp)

Compute the divergence.

source