jaxfluids.stencils package

Subpackages

Submodules

jaxfluids.stencils.spatial_derivative module

class jaxfluids.stencils.spatial_derivative.SpatialDerivative(nh: int, inactive_axis: List, offset: int = 0)[source]

Bases: ABC

Abstract parent class for the computation of spatial derivatives.

Calculates either the first spatial derivative wrt to axis direction (derivative_xi), or calculates the second spatial derivative wrt to axis1 and axis2 directions ( derivative_xi_xj).

abstract derivative_xi(buffer: Array, dxi: Array, axis: int) Array[source]

Calculates the derivative in the direction indicated by axis.

Parameters:
  • buffer (jnp.ndarray) – Buffer for which the derivative will be calculated

  • dxi (jnp.ndarray) – Cell sizes along axis direction

  • axis (int) – Spatial axis along which derivative is calculated

Returns:

Buffer with numerical derivative

Return type:

jnp.ndarray

derivative_xi_xj(buffer: Array, dxi: Array, dxj: Array, i: int, j: int) Array[source]

Calculates the second derivative in the directions indicated by i and j.

Parameters:
  • buffer (jnp.ndarray) – Buffer for which the second derivative will be calculated

  • dxi (jnp.ndarray) – Cell sizes along i direction

  • dxj (jnp.ndarray) – Cell sizes along j direction

  • i (int) – Spatial axis along which derivative is calculated

  • j (int) – Spatial axis along which derivative is calculated

Returns:

Buffer with numerical derivative

Return type:

jnp.ndarray

eps = 2.220446049250313e-16

jaxfluids.stencils.spatial_reconstruction module

class jaxfluids.stencils.spatial_reconstruction.SpatialReconstruction(nh: int, inactive_axis: List, offset: int = 0)[source]

Bases: ABC

This is an abstract spatial reconstruction class. SpatialReconstruction class implements functionality for cell face reconstruction from cell averaged values. The paranet class implements the domain slices (nhx, nhy, nhz). The reconstruction procedure is implemented in the child classes.

eps = 2.220446049250313e-16
abstract reconstruct_xi(buffer: Array, axis: int, j: int, dx: float | None = None, **kwargs) Array[source]

Reconstruction of buffer quantity along axis specified by axis.

Parameters:
  • buffer (jnp.ndarray) – Buffer that will be reconstructed

  • axis (int) – Spatial axis along which values are reconstructed

  • j (int) – integer which specifies whether to calculate reconstruction left (j=0) or right (j=1) of an interface

  • dx (float, optional) – cell size, defaults to None

Returns:

Buffer with cell face reconstructed values

Return type:

jnp.ndarray

set_slices_stencil() None[source]

Sets slice objects used in eigendecomposition for flux-splitting scheme. In the flux-splitting scheme, each n-point stencil has to be separately accessible as each stencil is transformed into characteristic space.

Module contents