josie.euler.schemes package

Submodules

josie.euler.schemes.hllx module

class josie.euler.schemes.hllx.HLL(eos)

Bases: josie.euler.schemes.scheme.EulerScheme

This class implements the HLL scheme. See [Tor09] for a detailed view on compressible schemes.

F(cells, neighs)

This is the convective flux implementation of the scheme. See [Tor09] for a great overview on numerical methods for hyperbolic problems.

A general problem can be written in a compact way:

\pdeFull

The convective term is discretized as follows:

\numConvectiveFull

A concrete implementation of this method needs to implement the discretization of the numerical flux on one face of a cell. It needs to implement the term \numConvective

Parameters
  • cells (MeshCellSet) – A MeshCellSet containing the state of the mesh cells

  • neighs (NeighboursCellSet) – A NeighboursCellSet containing data of neighbour cells corresponding to the values

Returns

The value of the numerical convective flux multiplied by the surface value \numConvective

Return type

F

static compute_sigma(U_L, U_R, c_L, c_R)

Returns the value of the :math:`sigma`(i.e. the wave velocity) for the the HLL and HLLC scheme.

\sigma_L = \min{\qty(\norm{\vb{u}_L} - c_L,
    \norm{\vb{u}_R} - c_R)}

\sigma_R = \max{\qty(\norm{\vb{u}_L} + c_L,
    \norm{\vb{u}_R} + c_R)}

Parameters
  • U_L (ndarray) – The value of scalar velocity for each cell. Array dimensions N_x \times N_y \times 1

  • U_R (ndarray) – The value of scalar velocity for each cell neighbour. Array dimensions N_x \times N_y \times 1

  • c_L (ndarray) – The value of sound velocity for each cell

  • c_R (ndarray) – The value of sound velocity for each cell neighbour

Return type

Tuple[ndarray, ndarray]

Returns

  • sigma_L – A Nx \times Ny \times 1 containing the value of the \sigma_L per each cell

  • sigma_R – A Nx \times Ny \times 1 containing the value of the \sigma_R per each cell

problem: EulerProblem
class josie.euler.schemes.hllx.HLLC(eos)

Bases: josie.euler.schemes.hllx.HLL

This class implements the HLLC scheme. See [Tor09] for a detailed view on compressible schemes.

F(cells, neighs)

This is the convective flux implementation of the scheme. See [Tor09] for a great overview on numerical methods for hyperbolic problems.

A general problem can be written in a compact way:

\pdeFull

The convective term is discretized as follows:

\numConvectiveFull

A concrete implementation of this method needs to implement the discretization of the numerical flux on one face of a cell. It needs to implement the term \numConvective

Parameters
  • cells (MeshCellSet) – A MeshCellSet containing the state of the mesh cells

  • neighs (NeighboursCellSet) – A NeighboursCellSet containing data of neighbour cells corresponding to the values

Returns

The value of the numerical convective flux multiplied by the surface value \numConvective

Return type

F

problem: EulerProblem

josie.euler.schemes.rusanov module

class josie.euler.schemes.rusanov.Rusanov(eos)

Bases: josie.euler.schemes.scheme.EulerScheme

This class implements the Rusanov scheme. See [Tor09] for a detailed view on compressible schemes. The Rusanov scheme is discretized by:

\numConvective  =
    \frac{1}{2} \qty[%
    \qty|\pdeConvective|_{i+1} + \qty|\pdeConvective|_{i}
    - \sigma \qty(\pdeState_{i+1} - \pdeState_{i})
    ] S_f

F(cells, neighs)

This is the convective flux implementation of the scheme. See [Tor09] for a great overview on numerical methods for hyperbolic problems.

A general problem can be written in a compact way:

\pdeFull

The convective term is discretized as follows:

\numConvectiveFull

A concrete implementation of this method needs to implement the discretization of the numerical flux on one face of a cell. It needs to implement the term \numConvective

Parameters
  • cells (MeshCellSet) – A MeshCellSet containing the state of the mesh cells

  • neighs (NeighboursCellSet) – A NeighboursCellSet containing data of neighbour cells corresponding to the values

Returns

The value of the numerical convective flux multiplied by the surface value \numConvective

Return type

F

static compute_sigma(U_L, U_R, c_L, c_R)

Returns the value of the :math:`sigma`(i.e. the wave velocity) for the the Rusanov scheme.

\sigma = \max_{L, R}{\qty(\norm{\vb{u}} + c, \norm{\vb{u}} - c)}

Parameters
  • U_L (ndarray) – The value of scalar velocity for each cell. Array dimensions N_x \times N_y \times 1

  • U_R (ndarray) – The value of scalar velocity for each cell neighbour. Array dimensions N_x \times N_y \times 1

  • c_L (ndarray) – The value of sound velocity for each cell

  • c_R (ndarray) – The value of sound velocity for each cell neighbour

Returns

A Nx \times Ny \times 1 containing the value of the sigma per each cell

Return type

sigma

problem: EulerProblem

josie.euler.schemes.scheme module

class josie.euler.schemes.scheme.EulerScheme(eos)

Bases: josie.scheme.convective.ConvectiveScheme

A general base class for Euler schemes

CFL(cells, CFL_value)

This method returns the optimal dt value that fulfills the CFL condition for the concrete the given scheme

Parameters
  • cells (MeshCellSet) – A MeshCellSet containing the cell data at the current time step

  • CFL_value (float) – The value of the CFL coefficient to impose

Returns

The Optimal dt fulfilling the CFL condition for the given CFL number

Return type

dt

static compute_U_norm(values, normals)

Returns the value of the normal velocity component to the given normals.

Parameters
  • values (SingleFluidState) – A np.ndarray that has dimension Nx \times Ny \times
N_\text{fields} containing the values for all the states in all the mesh points

  • normals (np.ndarray) – A np.ndarray that has the dimensions Nx \times Ny
\times N_\text{centroids} \times 2 containing the values of the normals to the faces of the cell

Returns

Return type

The value of the normal velocity

post_step(cells)

During the step we update the conservative values. After the step we update the non-conservative variables. This method updates the values of the non-conservative (auxiliary) variables using the EOS

problem: EulerProblem

Module contents