Change medium properties in Altair Activate Modelica Thermal

Tomas Tienstra
Tomas Tienstra New Altair Community Member
edited January 2024 in Community Q&A

Hello,

I am unable to find how to use a custom Media while using the thermal library in Activate. Documentation is limited.

For example, I would like to change the density of a Medium. In Diagram:
Medium = FromModelica('Modelica.Thermal.FluidHeatFlow.Media.Gylcol50_20degC')

This works fine however, how do I modify the parameters? Variable browser only shows a class.

Adding a Media block and changing the parameters there does nothing, default values are used, record block does nothing.  

 

Kind Regards,

Tomas Tienstra

Best Answer

  • RSGarciarivas
    RSGarciarivas
    Altair Employee
    edited January 2024 Answer ✓

    Hi Tomas,

    Custom media can be declared using the Medium block and referencing it in all the thermal blocks.

    Look at the example I've attached and notice the block called Custom Medium and how all the thermal blocks reference it with "FromModelica('/Custom Medium')". If you play around with any medium parameter, you'll see changes in the simulation.

    Hope this helps.

    Rafael

Answers

  • RSGarciarivas
    RSGarciarivas
    Altair Employee
    edited January 2024 Answer ✓

    Hi Tomas,

    Custom media can be declared using the Medium block and referencing it in all the thermal blocks.

    Look at the example I've attached and notice the block called Custom Medium and how all the thermal blocks reference it with "FromModelica('/Custom Medium')". If you play around with any medium parameter, you'll see changes in the simulation.

    Hope this helps.

    Rafael

  • Tomas Tienstra
    Tomas Tienstra New Altair Community Member
    edited January 2024

    Thanks for the example. 

    Changing in the Diagram: "Medium = FromModelica('/Medium')"

    Made my original model work. 

  • RoKet
    RoKet
    Altair Employee
    edited January 2024

    A further simplification of Rafael's suggestion is the use of a variable that is defined in model (or diagram) context and used in any component. This makes it easier to change the medium.

    image

    image