Clear Filters
Clear Filters

Simscape Gas Inertia block

6 views (last 30 days)
Caleb McFarlane
Caleb McFarlane on 29 Feb 2024
Answered: Yifeng Tang on 27 Mar 2024
I’m trying to model gas acoustics in a pipe network, similar to the work Travis Weins has done for fluids but for gas. Has anyone made a gas inertia block similar to the one for Simscape Hydraulics? How would I go about creating my own?

Answers (2)

Abhinaya Kennedy
Abhinaya Kennedy on 27 Mar 2024
Hi Caleb,
I see that you would like to create a gas inertia block, I have found a link to MathWorks documentation that details out the step-by-step process of creating a custom Simscape block with examples:
You can also look at the link below that talks about upgrading custom hydraulic blocks to use the isothermal liquid domain. This might help in modelling similar blocks and upgrading them to the gas inertia domain.
Additionally, this page gives you an overview of the whole process:
Hope this helps!

Yifeng Tang
Yifeng Tang on 27 Mar 2024
Hi Caleb,
"Fluid inertia is negligible." is one of the model assumption of the Pipe (G) block.
You may be able to modify the code the Pipe (G) block by adding the m_dotdot term to the momentum balance equation. You can find the equation in the doc page of e.g. Pipe (IL) block. The source code for these blocks are visible so you can use them as starting points.
That said, it's still an open question how many pipe blocks you'll need to track the travel of the pressure fluctuations (sounds). In general, we'd want to avoid to use Simscape in a CFD fashion.
Another thing to consider: are you just interested in the acoustics or it's acoustics + flow dynamics inside the pipe. If it's the former, a custom acoustic physical domain may be a more appropriate approach. Still lots of work though.


Find more on Gas Models in Help Center and File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!