Skip to content

FMU unit error for models containing valves #4455

@ohly87

Description

@ohly87

Describe the bug
When exporting models containing valves from Dymola 2025 to fmu, they cannot be run with FMPy 0.3.27 because the unit of the flow coefficient (m(1/2).kg(1/2)) is missing in the modelDescription.xml.

To Reproduce
Steps to reproduce the behavior:

  1. Open model 'Buildings.Fluid.Actuators.Valves.Examples.TwoWayValves'
  2. Export FMU (tried 2.0 and 3.0)
  3. Run python script:
    from fmpy import simulate_fmu
    simulate_fmu('TwoWayValves.fmu')
  4. See the error:
    ValidationError: Failed to validate modelDescription.xml:
    • The unit "m(1/2).kg(1/2)" of variable "valLin.Kv_SI" (line 667) is not defined.
      [...]

Expected behavior
No error should occur. The missing unit can manually be added in the modelDescription.xml to avert the error :
<Unit
name="m(1/2).kg(1/2)"/>

Version

  • Modelica Buildings Library: 12.1.0
  • Modelica simulation environment: Dymola 2025x Refresh 1
  • FMPy 0.3.27
  • Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions