Contribute a library material¶
The SimScale material library is a set of material components in the
workflow-components repository, bound to the curated schemas under
simscale.materials.schemas. This recipe covers where a material goes
and what a contribution must carry.
Layout¶
data-types/materials/schemas/<family>/ simscale.materials.schemas:<family>
materials/fluids/<id>/<id>.material.kts simscale.materials.library.fluids:<id>
materials/solids/<id>/<id>.material.kts simscale.materials.library.solids:<id>
materials/legacy-converter/ the generator of the library materials, and its report
One directory per material, named after the component id; the file
name is the id in snake case. Component tests sit next to the material
as <id>.material.test.kts.
Generated and hand-authored materials¶
Most library materials are generated by
materials/legacy-converter/convert.py from the library's source
records. Do not edit those files by hand: change the generator and
re-run it, so the whole set stays reproducible and its report stays
true. A hand-authored material lives next to the generated ones in the
same layout and follows the same schema; it simply carries no generator
provenance.
Provenance¶
A generated material records where its values come from as custom metadata:
metadata {
reference = "simscale.materials.library.fluids:water:1.0.0"
name = "Water"
description = "…"
customMetadata("sourceKey", "builtInWater")
customMetadata("sourceTags", "fluid,acoustic,cavitation,humidity")
customMetadata("derivedProperties", "thermalConductivity") // computed from the recorded properties, not recorded
customMetadata("defaultedProperties", "heatOfFormation") // taken from the schema default
}
A hand-authored material should state its source in the description
(handbook, datasheet, measurement) and, where a value is computed
from others, list it under derivedProperties in the same way.
Domain and organization materials¶
Materials of a domain team or an organization do not go into
simscale.materials.library.*; they live in the team's or
organization's own component groups, bound either to the curated
schemas or to a schema of their own that embeds the same property
fragments. Because slots project by field name, such a material fits
any slot whose declared properties it covers.
Build and test¶
simkit component build data-types/materials/schemas materials
simkit component test data-types/materials/schemas materials
Passing the schemas and the materials in one invocation lets the build order them by dependency and publish the schemas into the local repository the materials resolve from. Release the schema before the materials bound to it (see Release a component).
Cross-references¶
- Author a material schema.
- Build your first material.
materials/README.mdin theworkflow-componentsrepository — the schemas' variants, the converter and its report.