SpectraSim Documentation
Parameter · 02 Geometry

Model units

geometry.units Step 02 · Geometry

The length unit in which the coordinates of the CAD file are written. The program converts the model to metres with this unit before any other operation; the unit is never taken from the file alone.

Last updated

Theory

A STEP, IGES or STL file stores plain coordinates. A STEP file usually also declares a unit in its header, but the CAD reader (the OpenCASCADE kernel inside Gmsh) does not apply it: the coordinates are read as written, so two STEP files that both declare millimetres can be read with bounding boxes 1000 times apart. An STL file carries no unit at all. A wrong unit scales every length by a factor of 10 to 1000, and with it the velocity resulting from a flow rate, the Reynolds number and the acoustic frequencies. The unit must therefore always be confirmed by the user.

As guidance, the step shows:

  • the raw bounding-box diagonal;
  • the unit declared in the file header (a hint only);
  • a suggestion based on the model size: a muffler is typically 0.05-3 m across, so a raw diagonal between 0.05 and 3 suggests metres and one between 50 and 3000 suggests millimetres; any other value is "uncertain".

After confirmation, every coordinate is multiplied by the factor of equation (1); areas, volumes and hydraulic diameters shown later are in SI units.

Equations

xm=s xfile,s=0.001 (mm), 0.01 (cm), 1 (m), 0.0254 (in)x_{\mathrm{m}} = s\,x_{\mathrm{file}}, \qquad s = 0.001\ (\mathrm{mm}),\ 0.01\ (\mathrm{cm}),\ 1\ (\mathrm{m}),\ 0.0254\ (\mathrm{in})
(1)
wheremeaningunit
xfilex_{\mathrm{file}}A coordinate as written in the filefile unit
xmx_{\mathrm{m}}The same coordinate in the modelm
ssScale factor of the confirmed unitm per file unit

Default and rule

Default
none: the unit must be confirmed; the suggestion comes from the model's size
Rule

No unit is applied without confirmation. The list is preselected with the suggestion from the bounding-box size (or, when a model is replaced, with the unit of the previous model), and the unit must be confirmed before the surfaces are listed.

Source

The size rule is the program's own heuristic. That the STEP header unit is not applied by the reader was established on test files.

Valid range mm, cm, m, in

Choices

Millimetres, centimetres, metres, inches.

Check the size

After confirming, compare a known dimension (a pipe diameter in the surface table, the hydraulic diameter column) with the drawing. An error by a factor of 10 or 1000 is not detected by any later check.