Workflow¶
Practical workflows for extending and validating relation-driven models.
Add a New Relation¶
- Place the module in the correct physics domain under
src/fusdb/.... - Declare relations with the
@relation(outputs=..., tags=...)decorator. <--# TODO: more complete steps... outputs is necessary, but inputs are read from function args --> - Add hard/soft constraints as needed (use the
constraintsargument). - Add tests covering forward evaluation and at least one verification/solve path.
Add a New Variable¶
- Add variable metadata in
src/fusdb/registry/variables.yaml. - Define default behavior and tolerances where required.
- Update registry defaults if needed.
- Ensure variable unit and dimensionality match all relations that consume it. <--# TODO: add testing for variable consistency -->
Diagnose Inconsistenciesin a Reactor¶
- Run
Reactor.run()orRelationSystem.run(mode="verify")to evaluate relations without committing solver changes. - Inspect
relation_status/variable_statusandresidualsin the result dict. - Confirm variable tolerances are realistic for the physics regime.
- If needed, constrain relation selection or order via
relation_include,relation_exclude, orrelation_orderon theReactor.
Keep Knowledge and Code Aligned¶
- When formulas or assumptions change, update both:
- relation code / tests
- Knowledge Base pages explaining coupling assumptions
- Prefer explicit naming for profile vs volume-integrated quantities.