pheromone_dispersion.diffusion_tensor module

class pheromone_dispersion.diffusion_tensor.DiffusionTensor(U, K_u, K_u_t)[source]

Bases: object

Class containing the anisotropic and inhomogeneous diffusion tensor \(\mathbf{K}(x,y,t)\).

The diffusion tensor is given by a diffusion coefficient \(K_u\) in the wind direction and a diffusion coefficient \(K_{u^\perp}\) in the crosswind direction. Hence, the anistropic diffusion tensor is given by \(\mathbf{K} = R(\vec{u})diag(K_u,K_{u^\perp})R(\vec{u})^T\) with \(R(\vec{u})\) the rotation matrice of angle \(\theta\) between the wind field and the cartesian frame.

U

The wind field \(\vec{u}(x,y,t)\).

Type:

Velocity

K_u

The diffusion coefficient in the wind direction \(K_u\).

Type:

float

K_u_t

The diffusion coefficient in the crosswind direction \(K_{u^\perp}\).

Type:

float

at_vertical_interface

The diffusion tensor \(\mathbf{K}(x,y)\) at the vertical interfaces of each cells of the mesh at the current time \(t\).

Type:

ndarray

at_horizontal_interface

The diffusion tensor \(\mathbf{K}(x,y)\) at the horizontal interfaces of each cells of the mesh at the current time \(t\).

Type:

ndarray

__init__(U, K_u, K_u_t)[source]

Constructor method

Parameters:
  • U (Velocity) – The wind field \(\vec{u}(x,y,t)\).

  • K_u (float) – The diffusion coefficient in the wind direction \(K_u\).

  • K_u_t (float) – The diffusion coefficient in the crosswind direction \(K_{u^\perp}\).

at_current_time(tc)[source]

Update all the attributes at a given time.

Parameters:

tc (float or integer) – The current time.

Notes

Updates the velocity field U and its own attributes using the method at_current_time() of the class Velocity. Then, recomputes the attributes at_vertical_interface and at_horizontal_interface from the updated velocity field using the method diffusion_tensor_from_velocity_field().

diffusion_tensor_from_velocity_field()[source]

Compute the attributes at_vertical_interface and at_horizontal_interface from the attributes U, K_u and K_u_t using the rotation formula given above.