# Handling fluid systems in MTK

**URL:** <https://discourse.julialang.org/t/handling-fluid-systems-in-mtk/65305>\
**Category:** Modelling & Simulations\
**Tags:** question, modelingtoolkit\
**Created:** [July 26, 2021, 2:06pm UTC](https://discourse.julialang.org/t/handling-fluid-systems-in-mtk/65305 "2021-07-26T14:06:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [July 26, 2021, 2:06pm UTC](https://discourse.julialang.org/t/handling-fluid-systems-in-mtk/65305/1 "2021-07-26T14:06:16Z")

</div>

In Modelica a fluid Connector has a `medium` property, see [1].  
Is this possible with the existing parameter system in MTK?  
As I understand it it has to be a subtype of `Real`, which a medium would not.

If a large fluid system is modelled it is very inconvenient to have to specify the media type for every component.

A medium might also be represented via a `ODESystem` with e.g temperature and so on as states, but how can I dispatch a method on it for e.g. calculating the density?

[1] [Modelica.Fluid.Interfaces](https://www.maplesoft.com/documentation_center/online_manuals/modelica/Modelica_Fluid_Interfaces.html#Modelica.Fluid.Interfaces.FluidPort_a)

---

<div class="post-metadata">

**Author:** ![Brad\_Carman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brad_carman/32/17631_2.png) [@Brad\_Carman](https://discourse.julialang.org/u/Brad_Carman)\
**Post date:** [August 4, 2021, 1:50am UTC](https://discourse.julialang.org/t/handling-fluid-systems-in-mtk/65305/2 "2021-08-04T01:50:45Z")

</div>

I’m also interested in this feature. You can see my previous discussion [here](https://discourse.julialang.org/t/how-to-create-global-parameters-in-modelingtoolkit-jl/60065). I also opened an issue for Global parameters with ModelingToolkit, which is probably the easiest way to get there, but I think eventually there will need to be the concept of domains like SimScape has, which I’m assuming is like medium for Modelica.
