Details
The bigger your fluid model becomes, the more sensitive it is to the fluid properties you use, flow dynamics, components your systems consists off etc - all those things we neglect when we model 20 pipes, we have to reconsider when our models grow to 200, 2000...
Such modeling decisions usually result in overcalculation of results, slow calculation time and generally model overcomplication. In this section we present some of the tips that will help you to improve the CPU time of your model, speed up the simulation and make the results of your simulation more stable.
1. Use modular pipes
If there re parts of the system which you don t need to access but only see an impact of the total pressure drop given by that part, you can use modular piping. For example, you have a big hydraulic circuit and for a branches of it you only need to know what s the results pressure drop of the entire branch, use a dedicated modular piping component from the library and describe this branch using only 1 component - this will save simulation time, reduce number of variables that are calculated, and make your huge model much more readable.
2. Right size for the task
Usually we don t advise building giant models in Simcenter Amesim. We advise to replace parts of it with a simplified components of total pressure drop etc. For this we have submodel of the orifice which can be defined as Q=dP functions. Use it to introduce test results into the system you have and also to replace big parts of that system you don't need a detailed look on.
This will optimize the branch modeling even more (essentially this is a second step of branch model reduction)
The same story can be done for parallel branches. If you have the same ones you can recalculate equivalent hydraulic diameter and use one component to represent 5 orifices/branches. Some orifice submodels also allow you to directly define how many parallel orifices are there inside this one component.
3. Wave effect and pipe submodels
Building a model with inertia pipes is very sensitive to the number of nodes you define. The more nodes you choose the higher observable frequency of the flow you ll see (due to wave effect). Those very high frequencies might be unnecessary calculated in your system. For example, if you see that in your case 5 nodes give 1000Hz of visible pressure waves (you can use FFT to understand that) and the frequency of interest you have is only up to 50Hz, and the rest is considered damped, go ahead and reduce the number of nodes to make your model run faster.
You can also use "Line selection assistant" you can find in the Parameter window of the pipe which can help to define the submodel of the pipe you need. Based on its properties and frequency range you're interested in you'll get an advice on how many nodes to choose and which pipe submodel to use.
4. Performance Analyzer
For any model that is slow to run we advise using Performance Analyzer - an app which you can find in the top tray when you're in the Simulation mode.
Some of the basics of using it is to look at the State contributions list this gives the idea which variable defines the integration step the most (the bigger the value, the smaller integration step needed for the variable to be calculated) and Discontinuities (if there re any components with big number of it in particular, then discontinuities must be removed for those).
By looking at first, you can get a better idea what and why happens in your model. Have a closer look at this variable and at the system around it. What's happening there? Under which condition this components behaves? Are there any extraordinary results? Very high frequencies? By fixing that you can significantly improve the CPU time of the model.
Second tab will give an idea about struggle points for solver. Look for components which take 50,60...% of the discontinuities. If there're 3 components in the list, 2 of them give 20 disc. each, and one gives 500 - then there's a problem and you need to understand why it happens in that very component. Typical issues here are division by 0, very sharp dynamics of the input signals (tables), non obvious solutions (when you use x>y instead of x>=y and values x is too close to y) etc.
5. CAD Import
Instead of building a huge model, it's much more efficient to import it from CAD (if there's one). This will help you also to avoid adding unnecessary pipes (due to causality) and it will automatically detect modular pipes segments in your network if you select this option.
6. Sources, sensors and control dynamics
Often neglected, but very useful component to use is a first order lag which introduces 1st order dynamics to the input/output.
Just like in real life, it's really important to consider delays/dynamics in inputs/outputs of the components. Even if dynamics is super small it makes a huge difference for solver in many cases. For example, you measure a flow and based on that measure you control pressure/orifice opening/... and making a direct link with sources/sensors will create a very high dynamic system which will detect all the smallest changes etc. By introducing a first order lag component with time constant 0.01s. almost won't visibly change results for you, but will make a huge ease for the solver and CPU time.
Same way we avoid sharp input signals (steps), smooth out PID loops, avoid algebraic loops etc.
7. Still slow
You did all that, but your fluid system model is still slow. What's next?
If you see that in Performance analyzer there're some parts of the system slow down the model, you can check your fluid model for following things below. Note: to troubleshoot and see if the problem lies in one of them, give it a try and try to fix it (increase/decrease the value, remove part of the system that fits the description etc). This will get you closer to the solution.
a. Avoid "small" volumes those generate unnecessary high frequencies in the system. Small volume is a very fuzzy term here, it all depends on the system you have. For some systems 0.01L is considered small, for some 1L is insignificant.
b. Avoid too low Reynolds number (In most systems should be at least 1000 or more)
c. Always define zero point at dP/Q tables for orifices defined with tables. Good rule is that basically all tables should have the (0,0) point defined (x,y);
d. Reduce Bulk modulus below 13000bars or use Standard cavitation and increase air content to 1,2..5% or more. Doing that make sure model results don t change drastically. Result of it is that this will decrease stiffness of the system and reduce high frequencies that you might have.
e. Use Acc! or Set! Component or parameters to set Discontinuities handling to inactive especially for parts/systems where dP oscillates around 0 (valves). You can also control other parameters like accuracy of calculation.
f. Small hysteresis in valves of such systems will help to increase CPU performance at dP transition times. This will prevent dP from jumping around 0 point.
g. Zero flows should be avoided. When some loop of system require to have 0 flow, it s advised to disconnect them from main circuit (with closed orifice for example) from all connected sides (Note: for two-phase systems disconnect only from 1 side)
h. Replace specific, detailed models (AC) with functional (Cooling library components can replace detailed thermal model and give better CPU efficiency).
With that we want to conclude the article and if you passed all the steps - great job, you did a lot of CPU time improvement by yourself which we're sure you already noticed. There're other technics which were not mentioned in this article: model reduction, solver settings and more.
If you still face the difficulty simulating your model and need to improve your CPU time even after following this guide, feel free to open a Support Ticket.