Updraft¶
Updraft speed specification. ParcelModel accepts a scalar (constant speed), a
ConstantV instance, or an InterpolatedUpdraft for time-varying profiles.
All types are JAX pytrees and are compatible with jax.grad and jax.vmap.
AbstractUpdraft ¶
Bases: Module
Base class for updraft models. Subclasses implement __call__(t) -> V.
ConstantV ¶
InterpolatedUpdraft ¶
Bases: AbstractUpdraft
A tabulated, piecewise-linear V(t) profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ts
|
array
|
Strictly increasing knot times (s). |
required |
vs
|
array
|
Updraft speeds (m/s) at |
required |
Source code in pyrcel/updraft.py
as_updraft ¶
Coerce V to an AbstractUpdraft.
Accepts an existing updraft (returned as-is) or a scalar (wrapped in
ConstantV). Plain Python callables are not accepted here: model an
arbitrary profile as an AbstractUpdraft so the vector field
stays a pure,
jit-able pytree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
V
|
float or AbstractUpdraft
|
Updraft speed (m/s) or an existing AbstractUpdraft instance. |
required |
Returns:
| Type | Description |
|---|---|
AbstractUpdraft
|
The original updraft, or |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |