Case schema
This page lists every field of a case file. It is generated from the
case_schema field of cfd-craft describe, whose descriptions are the doc
comments of the Rust types. The schema dialect is JSON Schema draft-07.
Units are in the field names; see units and conventions.
Tables are sorted by field name. The order in a case file does not matter.
Case
A complete native case, schema version cfd-craft.case/0.1. Nothing outside the case configures the solver. Unknown fields are rejected; the lists default to empty when omitted. Deserialization checks only the types: the semantic checks (ranges, units, budgets, geometry) are those of cfd-craft check, which reports coded diagnostics with field paths.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
boundaries | Boundaries | required | |
building_roughness_m | number or null | optional | Optional aerodynamic roughness of building walls in meters, independent of cell width. Omission reproduces the legacy wall recipe (CFD-E085). |
constituents | array of Constituent | default [] | Passive gases transported by the flow. Default: empty, which solves the flow only. |
domain | Domain | required | |
flow | Flow | required | |
geometry | array of Block | default [] | Axis-aligned solid boxes (buildings, obstacles). A cell is solid when its center lies inside a box. Not allowed with prescribed_uniform flow (CFD-E013). Optional footprint_m selects polygon prisms. Masked multigrid is supported. Default: empty. |
geometry_min_passage_cells | integer or null (>= 0) | optional | Warn if a represented street between solids is narrower than this number of horizontal cells. Omitted for legacy cases (CFD-W011). |
grid | GridSpec | required | |
initial_conditions | array of Initial | default [] | Initial concentration fields, at most one per constituent (CFD-E018); a constituent without one starts at zero. Default: empty. |
moving_walls | array of MovingWall | default [] | Tangentially moving wall faces of the domain, such as a cavity lid; laminar flow only (CFD-E021). Default: empty. |
name | string | required | Nonempty experiment label (CFD-E002), copied into the result. It is excluded from the physics hash, so renaming keeps checkpoints compatible. |
numerics | Numerics | required | |
output | Output | required | |
receptors | array of Receptor | default [] | Named concentration samples, reported for every constituent in the result’s receptors_kg_m3 and in probes.csv. Default: empty. |
run | Run | required | |
schema_version | string | required | Contract version; must be cfd-craft.case/0.1 (CFD-E001). |
sources | array of Source | default [] | Continuous emissions into the constituents. Default: empty. |
vegetation | array of Vegetation | optional | Opt-in porous canopy boxes; zero leaf density has no numerical effect. |
Advection
Advection scheme of the constituents. linear_upwind is first-order upwind; it is linear in the concentrations, so responses to sources superpose exactly in a fixed flow. muscl adds a second-order slope with the bounded monotonized-central limiter; it is nonlinear, so superposition is not exact.
Allowed values: linear_upwind, muscl.
Block
An axis-aligned solid box. Cells whose centers lie inside it (lower bound inclusive, upper bound exclusive) are solid; boxes may overlap. The bounds must increase on every axis and lie inside the domain (CFD-E014), and the box must contain at least one cell center (CFD-E028). Fewer than ten cells across its height draws warning CFD-W001.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
footprint_m | array or null | optional | Optional simple footprint polygon in local x/y meters. With this field the shape is a prism between min_m[2] and max_m[2]; the other bounds must equal the footprint bounds. Holes and self-intersections are rejected (CFD-E084). Omission selects the original box. |
id | string | required | Unique nonempty ID (CFD-E014); the key of the box’s cell count in geometry.json. |
max_m | array of 3 number | required | Upper corner [x, y, z] in meters. |
min_m | array of 3 number | required | Lower corner [x, y, z] in meters. |
Boundaries
Boundary conditions of the domain: x, y and z each set the condition of the two domain faces normal to that axis (west and east, south and north, ground and top).
Unknown fields are rejected.
Boundary
Boundary condition of the pair of domain faces normal to one axis. periodic identifies the two faces. open lets flow in or out: each face is an inlet or an outlet by the sign of the case flow’s normal velocity there; inlets prescribe that velocity and a zero concentration increment, outlets fix the pressure level, and faces without normal flow are slip faces. wall is impermeable and no-slip (a rough wall with neutral_rans). slip is impermeable and stress-free. ground_open_top (z only, CFD-E005) is a rough ground with a top that applies the boundary-layer shear stress; neutral_rans requires it (CFD-E011) and laminar flow may not use it (CFD-E023).
Allowed values: periodic, open, wall, slip, ground_open_top.
CanopyClosure
Published canopy source-coefficient set; the ambient k-epsilon constants are unchanged. Both alternatives are unvalidated in this urban solver.
| Value | Description |
|---|---|
green1992 | Green (1992): beta_p=1, beta_d=4, C_e4=C_e5=1.5. |
sanz2003 | Sanz/Katul: beta_p=1, beta_d=5.1, C_e4=C_e5=0.9. |
Constituent
A passive gas: transported and diffused by the flow without affecting it. Concentrations are in kg/m3.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
diffusivity_m2_s | number | required | Molecular diffusivity in m2/s, finite and nonnegative (CFD-E015). With neutral_rans the turbulent diffusivity nu_t/Sc_t is added. |
id | string | required | Unique nonempty ID (CFD-E015), referenced by sources and initial conditions and used in the result. |
particle | ParticleBin or null | optional | Optional spherical aerosol bin. Omitted for gases, preserving old hashes. |
Domain
Physical extent of the domain: a box from the origin to size_m.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
size_m | array of 3 number | required | Lengths along x (east), y (north) and z (up) in meters, each finite and within 1e-6..1e9 (CFD-E003). |
Flow
Flow model, selected by kind: prescribed_uniform (a fixed uniform velocity; only the constituents are solved), laminar (incompressible flow with constant viscosity) or neutral_rans (a neutral atmospheric boundary layer with the k-epsilon model). The numeric fields are checked as CFD-E012.
Flow, kind prescribed_uniform
A fixed uniform velocity with no flow solve. Its normal component must be zero at impermeable boundaries (CFD-E024), and solid boxes are not allowed (CFD-E013).
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
kind | prescribed_uniform | required | |
velocity_m_s | array of 3 number | required | Velocity [u, v, w] in m/s, finite. |
Flow, kind laminar
Incompressible laminar flow with constant kinematic viscosity, started from a uniform velocity.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
acceleration_m_s2 | array of 3 number | default [0.0, 0.0, 0.0] | Uniform body acceleration [x, y, z] in m/s2, for example the pressure-gradient drive of a periodic channel. Default: zero. |
initial_velocity_m_s | array of 3 number | required | Uniform initial velocity [u, v, w] in m/s, finite. It also sets the velocity of open inlet faces and decides which open faces are inlets or outlets. |
kind | laminar | required | |
viscosity_m2_s | number | required | Kinematic viscosity in m2/s, finite and positive. |
Flow, kind neutral_rans
Neutral atmospheric boundary layer with the k-epsilon model (C_mu 0.09, C_epsilon1 1.44, C_epsilon2 1.92, kappa 0.4). Inflow and initial fields are the logarithmic equilibrium profiles U = u*/kappa ln((z + z0)/z0), k = u*^2/sqrt(C_mu) and epsilon = u*^3/(kappa (z + z0)), with u* set by speed_m_s at reference_height_m. Requires boundaries.z = ground_open_top (CFD-E011).
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
direction_deg_from | number | required | Meteorological wind direction in degrees: where the wind blows from, clockwise from north. 270 blows toward +x (east), 180 toward +y (north). Finite; any value is accepted. |
kind | neutral_rans | required | |
reference_height_m | number | required | Height of speed_m_s above the ground in meters, positive and not above the domain top. It is also the length scale of the normalized checks. |
roughness_m | number | required | Aerodynamic roughness length z0 of the ground in meters, positive. Building and other wall faces use min(z0, 0.001 cell width), which ties that wall roughness to the grid (see the flow model card). |
speed_m_s | number | required | Mean wind speed at reference_height_m in m/s, finite and positive. It is also the velocity scale of the normalized checks. |
turbulent_schmidt | number | required | Turbulent Schmidt number Sc_t, positive: constituents diffuse with their molecular diffusivity plus nu_t / Sc_t. |
viscosity_m2_s | number | required | Molecular kinematic viscosity in m2/s, positive; the eddy viscosity C_mu k^2/epsilon is added to it. |
GridSpec
Uniform Cartesian grid: the cell size along an axis is the domain length divided by the cell count.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
cells | array of 3 integer (>= 0) | required | Cell counts along x, y and z: 2..4096 per axis, or 1..4096 on a periodic axis, which makes a two-dimensional run (CFD-E004). The total enters the memory estimate and may not exceed 1e8 cells (CFD-E006). |
Initial
Initial concentration of one constituent, selected by kind. Each constituent has at most one (CFD-E018); without one it starts at zero. Solid cells always hold zero.
Initial, kind uniform
The same concentration in every fluid cell.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
concentration_kg_m3 | number | required | Concentration in kg/m3, finite and nonnegative (CFD-E025). |
constituent | string | required | ID of the initialized constituent. |
kind | uniform | required |
Initial, kind periodic_gaussian
A Gaussian puff, periodized over the domain, integrated per cell and scaled to exactly total_mass_kg of fluid mass. Needs periodic boundaries on all three axes (CFD-E026); used by the transport verification fixtures.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
center_m | array of 3 number | required | Center [x, y, z] in meters, inside the domain. |
constituent | string | required | ID of the initialized constituent. |
kind | periodic_gaussian | required | |
sigma_m | array of 3 number | required | Standard deviations along x, y and z in meters, each positive and at most twice the domain length. |
total_mass_kg | number | required | Mass of the puff in kg, positive. |
Mode
Run mode. steady iterates in pseudo-time until every steady check passes; run.end_time_s does not bound it. transient integrates the physical interval up to run.end_time_s.
Allowed values: steady, transient.
MomentumAdvection
Momentum advection on the staggered grid. Donor-cell (advective form) is the default; the others are conservative flux forms with an upwind-biased reconstruction of the transported component (van Leer’s MUSCL in Sweby’s notation).
| Value | Description |
|---|---|
donor_cell | First-order donor-cell upwind in advective form (default). |
second_order_upwind | Unlimited second-order upwind: face value 1.5 phi_U - 0.5 phi_UU. Not bounded. |
limited_upwind | Second-order upwind with the limiter in numerics.momentum_limiter. |
MomentumLimiter
Limiter of limited_upwind momentum advection, in Sweby’s notation s(a, b) with a and b the upwind and downwind differences: van_albada s = ab(a + b)/(a^2 + b^2), van_leer s = 2ab/(a + b), or monotonized_central s = sign(b) min(2|a|, |a + b|/2, 2|b|). Each is zero where a and b differ in sign.
Allowed values: van_albada, van_leer, monotonized_central.
MovingWall
A tangential velocity of one wall face of the domain, such as a cavity lid. Laminar flow only, at most one per face, and the velocity component normal to the wall must be zero (CFD-E021).
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
axis | integer (>= 0) | required | Axis normal to the wall: 0 (x), 1 (y) or 2 (z). That axis must have wall boundaries. |
upper | boolean | required | True for the face at the upper end of the axis (for example z = Lz), false for the face at 0. |
velocity_m_s | array of 3 number | required | Wall velocity [u, v, w] in m/s, finite; the component along axis must be zero. |
Numerics
Discretization choices, tolerances and the steady monitor window. The optional selections pressure_preconditioner, momentum_advection, momentum_limiter and steady_algorithm are left out of the normalized case when they have their default, so cases written before they existed keep their case and physics hashes.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
advective_cfl_max | number | required | Stability factor of explicit steps, 0 < CFL <= 0.45 (CFD-E010): with the explicit algorithm and for constituent sub-steps, dt = CFL / (sum of max|u|/dx + 2 D sum of 1/dx^2), D the largest viscosity or diffusivity. implicit_viscous applies it to advection only; implicit_projection uses its own CFL ramp for the flow. |
max_time_step_s | number | required | Upper bound of the time step in seconds, finite and positive (CFD-E009). The step is the smaller of this and the stability limit; in transient mode the last step is clipped to end at run.end_time_s. |
momentum_advection | MomentumAdvection | optional | Momentum advection: donor_cell (default), second_order_upwind or limited_upwind. Omitted from the normalized case when donor_cell, which keeps existing case and checkpoint hashes. |
momentum_limiter | MomentumLimiter or null | optional | Limiter of limited_upwind: required with it and rejected otherwise (CFD-E037). Omitted when absent. |
monitor_window | integer (>= 0) | required | Steps per monitor window, 2..100000 (CFD-E008). A steady run assesses its checks every monitor_window steps and needs three full windows before monitor_stability can pass. |
pressure_max_iterations | integer (>= 0) | required | PCG iteration limit of each pressure solve, nonzero (CFD-E008). Reaching it fails the step with CFD-E033. |
pressure_preconditioner | PressurePreconditioner | optional | Preconditioner of the pressure solve: ic0 (default) or multigrid. Omitted from the normalized case when ic0, which keeps existing case and checkpoint hashes. |
pressure_relative_tolerance | number | required | Relative residual target of each pressure solve, finite and positive (CFD-E009). A solve is accepted when the recomputed residual is within 10 times this plus 1e-12. A loose value changes the path to a steady state, not the steady checks. |
steady_algorithm | SteadyAlgorithm | optional | Pseudo-time algorithm of steady runs: explicit (default), implicit_viscous (laminar only) or implicit_projection (laminar or neutral_rans). The implicit options need run.mode = steady (CFD-E045) and a solved flow (CFD-E047). Omitted from the normalized case when explicit, which keeps existing hashes. |
steady_monitor_tolerance | number | required | Threshold of monitor_stability, the largest relative change between the means of three successive monitor windows; finite and positive (CFD-E009). Steady mode only. |
steady_residual_tolerance | number | required | Threshold of the normalized steady equation residuals (momentum, turbulence and each constituent), finite and positive (CFD-E009). Steady mode only. |
transport | Advection | required |
Output
Which optional artifacts a run archive keeps, and its output budget.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
checkpoint | boolean | required | Write checkpoint.json, a checksummed restart state. |
fields | boolean | required | Write fields.json, the full final state including the native face velocities. |
max_total_mib | integer (>= 0) | required | Budget for all artifacts in MiB. The preflight estimate must fit (CFD-E007); at publication, fields and checkpoint are omitted and listed in the manifest when they would exceed it (CFD-E061). |
ParticleBin
Dilute spherical particle bin, with no feedback, chemistry or resuspension. The declared deposition velocities exclude gravitational settling, which is added separately on upward-facing ground and roofs.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
density_kg_m3 | number | required | Particle material density in kg/m3, above the reference air density. |
diameter_m | number | required | Geometric diameter in meters (1e-8..1e-4). |
ground_deposition_velocity_m_s | number | default 0.0 | Additional ground deposition speed, in m/s, excluding settling. |
roof_deposition_velocity_m_s | number | default 0.0 | Additional roof deposition speed, in m/s, excluding settling. |
settling_velocity_m_s | number or null | optional | Direct nonnegative settling speed, bypassing the Stokes validity gate. |
PressurePreconditioner
Preconditioner of the pressure PCG solve. ic0 (the default) is an incomplete Cholesky factor built once per grid and works on every grid. multigrid is a fixed symmetric multigrid cycle. On an unmasked grid it is geometric, and strongly anisotropic spacings select line or plane smoothing. With geometry it aggregates connected fluid cells and uses point smoothing only, so strong anisotropy can make it slower than ic0. Strong anisotropy draws warning CFD-W004 in both cases. Both preconditioners solve the same equation to the same tolerance and recomputed residual.
Allowed values: ic0, multigrid.
Receptor
A named concentration sample, selected by kind and reported in kg/m3 for every constituent (receptors_kg_m3 of the result, probes.csv). IDs are unique and nonempty (CFD-E019); the support is nondegenerate and inside the domain (CFD-E027) and may not sample a solid cell (CFD-E042).
Receptor, kind point
Trilinear interpolation between the eight surrounding cell centers, clamped at the domain boundary.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | required | Unique nonempty receptor ID (CFD-E019). |
kind | point | required | |
point_m | array of 3 number | required | Position [x, y, z] in meters, inside the domain. |
Receptor, kind volume_average
The average over a box, weighted by the exact overlap of each cell with the box. Not a point sample or a peak bound.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | required | Unique nonempty receptor ID (CFD-E019). |
kind | volume_average | required | |
max_m | array of 3 number | required | Upper corner [x, y, z] in meters; every bound above min_m and inside the domain. |
min_m | array of 3 number | required | Lower corner [x, y, z] in meters. |
Receptor, kind path
Polyline sampling at a constant height. Samples are equally spaced in arc length, including both endpoints, with spacing at most the declared maximum. The receptor mean is normalized trapezoidal quadrature.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
height_m | number | required | Constant sample height above flat ground, in meters. |
id | string | required | Unique nonempty receptor ID (CFD-E019). |
kind | path | required | |
polyline_m | array of array of 2 number | required | Local metric x/y vertices; 2..4097, without repeated neighbors. |
sample_spacing_m | number | required | Positive finite maximum arc-length spacing, in meters. |
Run
Mode, endpoint and execution budgets. The whole group is excluded from the physics hash, so budgets can change between a run and its restart.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
end_time_s | number | required | Physical end time of a transient run in seconds: finite, positive and at most 1e12 (CFD-E009, CFD-E022). It does not bound a steady run. |
max_steps | integer (>= 0) | required | Maximum number of retained steps (outer iterations with an implicit steady algorithm), counted from the cold start including the steps of a restart checkpoint; nonzero (CFD-E008). Reaching it ends the run as iteration_limit. |
memory_limit_mib | integer (>= 0) | required | Memory budget in MiB for the preflight estimate (CFD-E006); a restart checkpoint may be at most half of it (CFD-E065). An estimate check, not an enforced process limit. |
mode | Mode | required | |
threads | integer (>= 0) | required | Worker threads, 1..64 (CFD-E008). The CLI and the Python binding solve on a pool of this size; the Rust library does not create one. |
wall_time_limit_s | number | required | Wall-time allowance in seconds: finite, positive and at most seven days (CFD-E009, CFD-E022). The CLI and the Python binding enforce it; a Rust caller passes it, or its own limit, to Control::new. |
Source
A continuous emission into one constituent, selected by kind. Rates are finite and nonnegative (CFD-E016); the support is nondegenerate and inside the domain (CFD-E017). The integrated rate is distributed over the cells the support covers. Support touching a solid cell is rejected (CFD-E040), as is a steady source in a fluid region without an outlet (CFD-E043, and CFD-E020 when no boundary is open).
Source, kind point
A point emission, deposited in the cell that contains the point.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
constituent | string | required | ID of the emitted constituent (CFD-E016). |
id | string | required | Unique nonempty source ID (CFD-E016). |
kind | point | required | |
point_m | array of 3 number | required | Position [x, y, z] in meters, inside the domain (each coordinate at least 0 and below the domain length). |
rate_kg_s | number | required | Emission rate in kg/s. |
Source, kind line
A straight line emission. The integrated rate is rate_kg_s_m times the line length, distributed over the cells the segment crosses in proportion to its length in each.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
constituent | string | required | ID of the emitted constituent (CFD-E016). |
from_m | array of 3 number | required | Start point [x, y, z] in meters, inside the domain. |
id | string | required | Unique nonempty source ID (CFD-E016). |
kind | line | required | |
rate_kg_s_m | number | required | Emission rate per meter of line, kg/(s m). |
to_m | array of 3 number | required | End point [x, y, z] in meters, inside the domain and different from from_m. |
Source, kind volume
A uniform emission over a box. The integrated rate is rate_kg_s_m3 times the box volume, distributed over the cells by their exact overlap with the box.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
constituent | string | required | ID of the emitted constituent (CFD-E016). |
id | string | required | Unique nonempty source ID (CFD-E016). |
kind | volume | required | |
max_m | array of 3 number | required | Upper corner [x, y, z] in meters; every bound above min_m and inside the domain. |
min_m | array of 3 number | required | Lower corner [x, y, z] in meters. |
rate_kg_s_m3 | number | required | Emission rate per cubic meter, kg/(s m3). |
SteadyAlgorithm
Steady pseudo-time algorithm. explicit is the SSPRK2 march of the earlier release. The implicit options solve for a correction driven by the full steady residual (delta form), so they share its fixed point.
| Value | Description |
|---|---|
explicit | SSPRK2 pseudo-time steps with a projection per stage, limited by advection and diffusion together (default). |
implicit_viscous | SSPRK2 stages with an implicit viscous term: (I − Δτ L_ν) δ = Δτ R. |
implicit_projection | One implicit correction per outer iteration, A δ = R with a Picard first-order upwind and viscous Jacobian and a CFL ramp, followed by a projection at the pseudo-time step (a SIMPLEC-type coupling). |
Vegetation
Flat-ground porous vegetation volume. Box membership uses cell centers, lower-inclusive and upper-exclusive, exactly as building masks.
Unknown fields are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
drag_coefficient | number | required | Dimensionless form-drag coefficient. |
id | string | required | Unique nonempty volume ID. |
leaf_area_density_m2_m3 | number | required | Leaf area per air volume, in m2/m3 (inverse meters). |
leaf_deposition_velocity_m_s | number | default 0.0 | Particle collection velocity per leaf area, m/s; excludes settling. |
max_m | array of 3 number | required | Box upper corner in meters. |
min_m | array of 3 number | required | Box lower corner in meters. |
turbulence_closure | CanopyClosure | default "green1992" | Canopy k-epsilon source coefficient set. |