Problem simulating simple geometries (negative pressures)

Provides a system for patient-specific cardiovascular modeling and simulation.
User avatar
Florian Gartner
Posts: 12
Joined: Tue Dec 12, 2023 7:13 am

Problem simulating simple geometries (negative pressures)

Post by Florian Gartner » Tue Apr 16, 2024 7:59 am

I encounter a problem simulating some very simple geometries.
Specifically, I try to simulate a tube of length 5cm that expands linearly from radius r1 = 1cm at the one end to a slightly larger radius r2 = 1.2 cm at the other end (see picture).
Bildschirmfoto 2024-04-16 um 15.58.28.png
tube geometry
Bildschirmfoto 2024-04-16 um 15.58.28.png (18.63 KiB) Viewed 2173 times

To simulate this expanding tube, I simply create a path consisting of two points, x1=(0,0,0) and x2= (0,0,5). For the segmentation I manually create two circular contours with radii r1=1 around x1 and r2=1.2 around x2 (I didn't load any image for this). I mesh the model with "Global Max Edge Size" set to 0.2 (but I also tried smaller values like 0.1 without success). I choose the wall to be rigid and the following constant flow data saved in a separate .txt file to define the (parabolic) inflow at the r1 end of the tube:
0.0 -125
5.0 -125
At the r2 end, I choose resistance boundary conditions with resistance 0.
I tried various different parameter settings for the Solver, among these also the settings used in the online tutorials on youtube (Time Step Size= 0.001, Step Construction=4, svLS type = NS, Tolerance Momentum Eq = 0.001, Tolerance Continuity Eq = 0.01, Tolerance NS Solver=0.01, Max Num of Iterations Momentum loop/NS solver = 10). But whatever I do, I always get negative pressure values at the r1 end (and pressure values close to 0 at the r2 end), which doesn't make any sense as the flow goes from r1 to r2, so there should be a positive pressure difference.
The velocity profile and its values, however, appear quite reasonable. Here is an example of what my pressure output file looks like:

Bildschirmfoto 2024-04-16 um 16.49.49.png
pressure data with negative pressures at inlet
Bildschirmfoto 2024-04-16 um 16.49.49.png (53.46 KiB) Viewed 2173 times

and this is the corresponding flow data:

Bildschirmfoto 2024-04-16 um 16.45.37.png
flow data looks ok
Bildschirmfoto 2024-04-16 um 16.45.37.png (37.27 KiB) Viewed 2173 times

Interestingly, I get similar behavior both with Simvascular 2023.03 on Windows 10 (both with and without using MPI) and with SimVascular 2021.09 on macOS 10.14 (where I couldn't use MPI so far due to problems with the installation).

Can anybody reproduce this behavior? Why does this simple geometry with rigid walls and constant flow make such problems and what can be done to obtain correct pressure results? Any help is highly appreciated! Thank you!

User avatar
David Parker
Posts: 1624
Joined: Tue Aug 23, 2005 2:43 pm

Re: Problem simulating simple geometries (negative pressures)

Post by David Parker » Tue Apr 16, 2024 2:41 pm

Hello,

Why do you think a negative pressure is incorrect?

Cheers,
Dave

User avatar
Florian Gartner
Posts: 12
Joined: Tue Dec 12, 2023 7:13 am

Re: Problem simulating simple geometries (negative pressures)

Post by Florian Gartner » Tue Apr 16, 2024 3:13 pm

Hallo Dave,

I just think that if the fluid goes in at cap_1 and goes out at cap_2, the pressure at cap_1 must be larger than the pressure at cap_2. Otherwise the flow would go in the other direction, wouldn't it?

Negative pressures would, in principle, be ok since the pressure is only determined up to an additive constant. But it is the pressure difference that doesn't make sense here, right? In other words, the pressure data and the flow data above cannot be consistent, can they?

Also, depending on the solver parameters I choose, I sometimes also get other (negative) values for the pressures. Furthermore, the NS solver always breaks up if I let the simulation run for long times with the error message "singular matrix" showing up in the log file. So something seems to go wrong here.

Cheers,
Flo

User avatar
Ranjan kumar
Posts: 9
Joined: Fri Aug 25, 2023 12:56 am

Re: Problem simulating simple geometries (negative pressures)

Post by Ranjan kumar » Wed Apr 17, 2024 1:03 am

I am facing same problem but my model is right coronary artery and flow is pulsatile.

User avatar
David Parker
Posts: 1624
Joined: Tue Aug 23, 2005 2:43 pm

Re: Problem simulating simple geometries (negative pressures)

Post by David Parker » Wed Apr 17, 2024 6:18 pm

Hi Flo,

I did not read the details of your first post closely enough, just responded to negative pressures, sorry!

Your flow results look fine but your pressure results do indeed look odd. And if the solver is failing with a singular matrix error then your simulation is not well-defined.

Upload all of the simulation files (including the mesh-complete directory) someplace I can download them and I'll have look.

Cheers,
Dave

User avatar
Florian Gartner
Posts: 12
Joined: Tue Dec 12, 2023 7:13 am

Re: Problem simulating simple geometries (negative pressures)

Post by Florian Gartner » Fri Apr 19, 2024 2:43 am

Hi Dave,

that would be fantastic if you could have a look at it! Thank you very much in advance!
I uploaded the project here:

https://cloud.physik.lmu.de/index.php/s/tAgwZHsTgfBid89

The folder "Results" contains the output files of my simulation if I run it under macOS with SimVascular 2021.09.
As I stated above, I get the same error on Windows with SimVascualar 2023.03.

Looking forward to your response!
Cheers,
Flo

User avatar
David Parker
Posts: 1624
Joined: Tue Aug 23, 2005 2:43 pm

Re: Problem simulating simple geometries (negative pressures)

Post by David Parker » Fri Apr 19, 2024 3:19 pm

Hi Flo,

I reran a simulation with default solver parameters (e.g. Maximum Number of Iterations for svLS Momentum Loop=2 rather than what you had originally had Maximum Number of Iterations for svLS Momentum Loop=10) and the results were ok.

I think the Maximum Number of Iterations for svLS -type parameters are for CMM (deformable wall) simulations and should not be used for rigid wall simulations.

Cheers,
Dave

User avatar
Florian Gartner
Posts: 12
Joined: Tue Dec 12, 2023 7:13 am

Re: Problem simulating simple geometries (negative pressures)

Post by Florian Gartner » Mon Apr 22, 2024 7:53 am

Hi Dave,

Thanks a lot for trying out! That's strange, if I run the simulation with default parameters and a small time step size 0.001, I still get similar negative pressure values as posted above, and with a larger time step size 0.03 the simulation breaks up ("FATAL ERROR: Residual has exceeded tolerance").
Which time step size did you use?
I get the same behavior on macOS and on Windows.
I updated the project file I uploaded ( https://cloud.physik.lmu.de/index.php/s/tAgwZHsTgfBid89 ) to include the simulation jobs using default parameters with small and medium time step sizes, respectively, together with the corresponding output. Could you please have a look at it again and tell me what I could possibly be doing wrong here? Thank you so much!

Cheers,
Flo

User avatar
David Parker
Posts: 1624
Joined: Tue Aug 23, 2005 2:43 pm

Re: Problem simulating simple geometries (negative pressures)

Post by David Parker » Mon Apr 22, 2024 4:25 pm

Hi Flo,

I renamed the inlet and outlet faces so I could better understand the model face names and inadvertently switched the inlet to be the face with the larger area.

Cheers,
Dave

User avatar
Florian Gartner
Posts: 12
Joined: Tue Dec 12, 2023 7:13 am

Re: Problem simulating simple geometries (negative pressures)

Post by Florian Gartner » Tue Apr 23, 2024 8:09 am

Hi Dave,

indeed, if I switch the inlet and the outlet, I also obtain reasonable results with the default parameters, whereas the original problem with the tube expanding in flow direction still doesn't work. So, you also don't have any solution for the original problem, do you?

I really don't get why this can't be simulated. In particular, the log file indicates small residuals at the end (although residuals may be large initially). How can the residuals for the stationary solution be small when the simulation produces such nonsense pressure values?

Cheers,
Flo

POST REPLY