Gridded wind¶
A wind is a tracerax velocity, wind(t, position), with one velocity per particle. wind_from_speed_direction makes a steady, uniform one. gridded_wind_from_met and gridded_wind_from_prescribed put a MetField or a PrescribedWindField on the les_fvm C-grid (U at x + Δx/2, V at y + Δy/2, W at T-points) as a tracerax.velocity.GriddedVelocity: trilinear in space, piecewise-linear in time, edge value held beyond the walls. tracerax.velocity.uniform and uniform_in_space make the others. Pass a wind as wind to simulate_lagrangian or compute_footprint, or inside a tracerax.advect.Langevin to tracerax.advect.integrate. Tier II.
wind_interp
¶
The winds of plumax as velocities for particles (implementation in plumax.lagrangian._src.wind_interp).
gridded_wind_from_met
¶
The wind of a :class:~plumax.met.MetField, for particles.
MetField already stores u, v, w on the C-grid with a time
axis, so no value changes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
MetField
|
Meteorology on an analysis grid. |
required |
Returns:
| Type | Description |
|---|---|
GriddedVelocity
|
The wind on |
Source code in src/plumax/lagrangian/_src/wind_interp.py
gridded_wind_from_prescribed
¶
gridded_wind_from_prescribed(wind_field: PrescribedWindField, times: Num[ArrayLike, ' time']) -> GriddedVelocity
Sample a les_fvm :class:~plumax.les_fvm.wind.PrescribedWindField.
The field is evaluated at each of times; between them the particles see
the piecewise-linear interpolant, so times should resolve the field's
own time variation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wind_field
|
PrescribedWindField
|
The Eulerian solver's wind. |
required |
times
|
Num[ArrayLike, ' time']
|
Times [s] to sample it at, strictly increasing. |
required |
Returns:
| Type | Description |
|---|---|
GriddedVelocity
|
The wind on |
Source code in src/plumax/lagrangian/_src/wind_interp.py
wind_from_speed_direction
¶
Constant wind from speed + meteorological direction (degrees from North).
direction_deg = 270 is a wind from the west (flowing east), matching the
convention used by :func:plumax.gauss_plume.simulate_plume.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
speed
|
float
|
Wind speed [m/s]. |
required |
direction_deg
|
float
|
Direction the wind blows from [degrees from north]. |
required |
w
|
float
|
Vertical wind [m/s]. |
0.0
|
Returns:
| Type | Description |
|---|---|
Velocity
|
The wind, as a |
Examples:
>>> import jax.numpy as jnp
>>> wind = wind_from_speed_direction(5.0, 270.0)
>>> bool(jnp.allclose(wind(0.0, jnp.zeros((1, 3)))[0, 0], 5.0))
True