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 (
Union[Dataset,Iterable[DataArray]]) – input velocity array (on collocated grid)space_dims (
Iterable[str]) – labels of spacial dimensionsvec_dim (
str) – label of vector dimensionnew_dim (
str) – label of new dimension indexing derivativesmake_traceless (
bool) – should we make the strain tracelessgrad_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 (
Union[Dataset,Iterable[DataArray]]) – input velocity array (on collocated grid)space_dims (
Iterable[str]) – labels of spacial dimensionsvec_dim (
str) – label of vector dimensionnew_dim (
str) – label of new dimension indexing derivativesgrad_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 1v (
DataArray) – velocity field component 2w (
DataArray) – velocity field component 3target_dims (
list[str]) – axes on which the interpolate the stress – must be contained among the coordinates ofu, v, wfluctuation_axes (
Collection[str]) – labels of dimensions w.r.t which to compute the fluctuations. Subset oftarget_dims.
- Return type:
DataArray
Note: First performs an interpolation to
target_dimsand then computes the fluctuations w.r.t.fluctuation_axes. There can be a commutation error when the interpolation happens along dimensions other thanfluctuation_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 1v (
DataArray) – velocity field component 2w (
DataArray) – velocity field component 3target_dims (
list[str]) – axes on which the interpolate the stress – must be contained among the coordinates ofu, v, wfluctuation_axes (
Collection[str]) – labels of dimensions w.r.t which to compute the fluctuations. Subset oftarget_dims.
- Return type:
DataArray
Note: First performs an interpolation to
target_dimsand then computes the fluctuations w.r.t.fluctuation_axesand then square. There can be a commutation error when the interpolation happens along dimensions other thanfluctuation_axes. There is uncertainty from whether the interpolation happens before/after the squaring.