Physical Fields

physics

strain_from_vel(vel, space_dims, vec_dim, new_dim='c2', make_traceless=True, grad_operator=<function grad_vector>)[source]

compute rate of strain from velocity

Parameters:
  • vel (Dataset | Iterable[DataArray]) – input velocity array (on collocated grid)

  • space_dims (Iterable[str]) – labels of spacial dimensions

  • vec_dim (str) – label of vector dimension

  • new_dim (str) – label of new dimension indexing derivatives

  • make_traceless (bool) – should we make the strain traceless

  • grad_operator (Callable) – operator that computes vector gradient (To be replaced by a grid)

Return type:

DataArray

omega_from_vel(vel, space_dims, vec_dim, new_dim='c2', grad_operator=<function grad_vector>)[source]

compute rate of rotation tensor from velocity

Parameters:
  • vel (Dataset | Iterable[DataArray]) – input velocity array (on collocated grid)

  • space_dims (Iterable[str]) – labels of spacial dimensions

  • vec_dim (str) – label of vector dimension

  • new_dim (str) – label of new dimension indexing derivatives

  • grad_operator (Callable) – operator that computes vector gradient (To be replaced by a grid)

Return type:

DataArray

vertical_heat_flux(vert_vel, pot_temperature, hor_axes)[source]

compute vertical heat flux \(w' \theta'\) from \(w\) and \(\theta\)

Parameters:
  • vert_vel (DataArray) – vertical velocity field \(w\)

  • pot_temperature (DataArray) – potential temperature \(\theta\)

  • hor_axes (Collection[str]) – labels of horizontal dimensions (w.r.t which to compute the fluctuations)

Return type:

DataArray

Reynolds_fluct_stress(u, v, w, target_dims, fluctuation_axes)[source]

compute Reynolds stress \(\mathbf{u}'_i \mathbf{u}'_j\)

Parameters:
  • u (DataArray) – velocity field component 1

  • v (DataArray) – velocity field component 2

  • w (DataArray) – velocity field component 3

  • target_dims (list[str]) – axes on which the interpolate the stress – must be contained among the coordinates of u, v, w

  • fluctuation_axes (Collection[str]) – labels of dimensions w.r.t which to compute the fluctuations. Subset of target_dims.

Return type:

DataArray

Note: First performs an interpolation to target_dims

and then computes the fluctuations w.r.t. fluctuation_axes. There can be a commutation error when the interpolation happens along dimensions other than fluctuation_axes.

Fluct_TKE(u, v, w, target_dims, fluctuation_axes)[source]

compute fluctuating TKE \(\mathbf{u}'_i \mathbf{u}'_i / 2\)

Parameters:
  • u (DataArray) – velocity field component 1

  • v (DataArray) – velocity field component 2

  • w (DataArray) – velocity field component 3

  • target_dims (list[str]) – axes on which the interpolate the stress – must be contained among the coordinates of u, v, w

  • fluctuation_axes (Collection[str]) – labels of dimensions w.r.t which to compute the fluctuations. Subset of target_dims.

Return type:

DataArray

Note: First performs an interpolation to target_dims and then computes the fluctuations w.r.t. fluctuation_axes and then square. There can be a commutation error when the interpolation happens along dimensions other than fluctuation_axes. There is uncertainty from whether the interpolation happens before/after the squaring.