Skip to content

Properties, presets and models

Properties define semantic state.

property Thermal {
temperature: Float [0.0, 1.0] = 0.25;
conductivity: Float [0.0, 1.0];
heat_capacity: Float [0.0, 10.0];
}

Field syntax:

name: Type [optional_minimum, optional_maximum] = optional_default;

The type is mandatory. Bounds and the = default clause are independently optional. Bounds always include both endpoints. Float precision comes from the selected solver profile; there is no field precision annotation.

A property field without a default must be initialized by a preset or inline model block. Current scalar types are Float, Int and Bool. Fields also support structs, fixed-size arrays, enums, and aliases; see value types. The initialization requirement applies equally to these compound fields.

Presets define reusable initial values for one property.

preset WaterThermal for Thermal {
conductivity = 0.55;
heat_capacity = 4.20;
}

Presets may initialize all fields or only some fields. Property defaults fill any defaulted fields that the preset does not mention.

Named presets are best for configurations that are useful across models or simulations. One-off model tuning should usually be written inline in the model.

Models are simulation-scoped cell definitions composed from properties.

model Water :
Liquid {WaterBody}+
Thermal {WaterThermal}+
MoistureCarrier {
moisture = 1.0;
}+
LbmD3Q7;

Model entries may use a property as-is:

model Smoke :
HeatSource;

This is valid only when all fields of HeatSource have defaults.

A model may use a named preset:

model Fire :
Combustible {VolatileFuel};

A model may use an inline anonymous preset:

model Grass :
MoistureCarrier {
moisture = 0.65;
};

Inline preset blocks are local to that model and are not importable as public presets.

A published model can include suggested preview schedule, visual binding and required context as well as fields and defaults. Importing that model keeps those definitions together. Add explicit runs in main.hyle to execute behaviors. A preset changes starting values; it does not define the world, create initial cells or schedule a behavior.

Hyle Astro