edg_acoustics.preprocessing

This module provides preprocessing functionalities for the edg_acoustics package.

Module Contents

Classes

Flux

abstract base class for fluxes.

UpwindFlux

Calculation of upwind fluxes.

class edg_acoustics.preprocessing.Flux[source]

Bases: abc.ABC

abstract base class for fluxes.

abstract FluxP()[source]

abstract method for pressure flux.

abstract FluxVx()[source]

abstract method for flux of velocity in x-direction.

abstract FluxVy()[source]

abstract method for flux of velocity in y-direction.

abstract FluxVz()[source]

abstract method for flux of velocity in z-direction.

class edg_acoustics.preprocessing.UpwindFlux(rho0, c0, n_xyz)[source]

Bases: Flux

Calculation of upwind fluxes. :param rho0: The reference density. :type rho0: float :param c0: The reference speed of sound. :type c0: float :param n_xyz: The array representing the normal vector of the face. :type n_xyz: numpy.ndarray

Parameters:
rho0

see edg_acoustics.AcousticsSimulation.rho0.

Type:

float

c0

see edg_acoustics.AcousticsSimulation.c0.

Type:

float

n_xyz

see edg_acoustics.AcousticsSimulation.n_xyz.

Type:

numpy.ndarray

cn1s

precalculated constant for the calculation of the flux of velocity in x-direction.

Type:

numpy.ndarray

cn2s

precalculated constant for the calculation of the flux of velocity in y-direction.

Type:

numpy.ndarray

cn3s

precalculated constant for the calculation of the flux of velocity in z-direction.

Type:

numpy.ndarray

cn1n2

precalculated constant for the calculation of the flux of velocity.

Type:

numpy.ndarray

cn1n3

precalculated constant for the calculation of the flux of velocity.

Type:

numpy.ndarray

cn2n3

precalculated constant for the calculation of the flux of velocity.

Type:

numpy.ndarray

n1rho

precalculated constant for the calculation of the flux of velocity in x-direction.

Type:

numpy.ndarray

n2rho

precalculated constant for the calculation of the flux of velocity in y-direction.

Type:

numpy.ndarray

n3rho

precalculated constant for the calculation of the flux of velocity in z-direction.

Type:

numpy.ndarray

csn1rho

precalculated constant for the calculation of the pressure flux.

Type:

numpy.ndarray

csn2rho

precalculated constant for the calculation of the pressure flux.

Type:

numpy.ndarray

csn3rho

precalculated constant for the calculation of the pressure flux.

Type:

numpy.ndarray

FluxP(dvx, dvy, dvz, dp)[source]

This method calculates the pressure flux using the given input arrays.

Parameters:
  • dvx (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the x-direction.

  • dvy (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the y-direction.

  • dvz (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the z-direction.

  • dp (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in pressure.

Returns:

numpy.ndarray – The calculated pressure flux.

FluxVx(dvx, dvy, dvz, dp)[source]

This method calculates the flux of velocity in x-direction using the given input arrays.

Parameters:
  • dvx (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the x-direction.

  • dvy (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the y-direction.

  • dvz (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the z-direction.

  • dp (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in pressure.

Returns:

numpy.ndarray – The calculated flux of velocity in x-direction.

FluxVy(dvx, dvy, dvz, dp)[source]

This method calculates the flux of velocity in y-direction using the given input arrays.

Parameters:
  • dvx (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the x-direction.

  • dvy (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the y-direction.

  • dvz (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the z-direction.

  • dp (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in pressure.

Returns:

numpy.ndarray – The calculated flux of velocity in y-direction.

FluxVz(dvx, dvy, dvz, dp)[source]

This method calculates the flux of velocity in z-direction using the given input arrays.

Parameters:
  • dvx (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the x-direction.

  • dvy (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the y-direction.

  • dvz (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in velocity in the z-direction.

  • dp (numpy.ndarray) – The array representing jump values across the faces of neighboring elements in pressure.

Returns:

numpy.ndarray – The calculated flux of velocity in z-direction.