SimVascular / SimVascular/svMultiPhysics

Slow convergence in porous media flow

Open
#357 11 comments 0 reactions 2 assignees View on GitHub

@hanzhao2020 is already working on this.

Since Sep 23, 2025.

bug
Dominant language
C++
Stars
45
Forks
60
Avg merge
5d 23h
Merged PRs (30d)
11

Description

Description

The fluid equations were updated to add Brinkman porous media in #293 (see #236 and #292). The associated integration test test_driven_cavity_2d_porous takes 208s, 88s, and 68s on 1, 3, and 4 procs. This is long for a 2D test case. Looking at a recent pipeline, this is the output from test_driven_cavity_2d_porous[1]:

---------------------------------------------------------------------
 Eq     N-i     T       dB  Ri/R1   Ri/R0    R/Ri     lsIt   dB  %t
---------------------------------------------------------------------
 NS 1-1  2.502e+01  [0 1.000e+00 1.000e+00 2.082e-08]  [2606 -4 97]
 NS 1-2  4.759e+01  [-29 3.250e-02 3.250e-02 6.397e-07]  [2339 -3 97]
 NS 1-3  6.582e+01  [-49 3.542e-03 3.542e-03 5.869e-06]  [1894 -7 96]
 NS 1-4  7.875e+01  [-69 3.332e-04 3.332e-04 6.251e-05]  [1325 -3 94]
 NS 1-5  8.926e+01  [-85 5.375e-05 5.375e-05 3.856e-04]  [1069 -5 93]
 NS 1-6  9.596e+01  [-98 1.245e-05 1.245e-05 1.669e-03]  [673 -12 88]
 NS 1-7  9.997e+01  [-109 3.256e-06 3.256e-06 6.390e-03]  [397 -7 80]
 NS 1-8  1.010e+02  [-121 8.760e-07 8.760e-07 2.371e-02]  [81 -37 26]
 NS 1-9  1.018e+02  [-132 2.379e-07 2.379e-07 8.671e-02]  [22 -24 4]
 NS 1-10  1.026e+02  [-143 6.767e-08 6.767e-08 3.041e-01]  [8 -12 1]
 NS 1-11  1.034e+02  [-151 2.728e-08 2.728e-08 7.570e-01]  [3 -3 0]
 NS 1-12  1.042e+02  [-153 2.136e-08 2.136e-08 9.660e-01]  [2 0 0]
 NS 1-13  1.050e+02  [-153 2.076e-08 2.076e-08 1.000e+00]  !0 0 0!  WARNING: The linear system solution has not converged
 NS 1-14  1.058e+02  [-153 2.053e-08 2.053e-08 1.000e+00]  !0 0 0!  WARNING: The linear system solution has not converged
 NS 1-15s 1.067e+02  [-153 2.046e-08 2.046e-08 1.000e+00]  !0 0 0!  WARNING: The linear system solution has not converged
 NS 2-1  1.339e+02  [0 1.000e+00 4.803e-01 4.320e-08]  [2767 0 97]
 NS 2-2  1.541e+02  [-30 2.862e-02 1.374e-02 1.511e-06]  [2097 -4 96]
 NS 2-3  1.702e+02  [-51 2.580e-03 1.239e-03 1.675e-05]  [1669 -10 95]
 NS 2-4  1.830e+02  [-69 3.202e-04 1.538e-04 1.351e-04]  [1259 0 94]
 NS 2-5  1.921e+02  [-84 5.638e-05 2.708e-05 7.678e-04]  [930 -10 91]
 NS 2-6  1.979e+02  [-98 1.232e-05 5.918e-06 3.511e-03]  [573 -4 86]
 NS 2-7  2.014e+02  [-110 3.135e-06 1.506e-06 1.383e-02]  [347 -4 78]
 NS 2-8  2.026e+02  [-121 8.277e-07 3.975e-07 5.236e-02]  [88 -29 29]
 NS 2-9  2.034e+02  [-132 2.256e-07 1.083e-07 1.918e-01]  [17 -17 2]
 NS 2-10  2.042e+02  [-142 7.382e-08 3.546e-08 5.862e-01]  [5 -5 1]
 NS 2-11  2.049e+02  [-146 4.639e-08 2.228e-08 9.274e-01]  [3 -1 0]
 NS 2-12  2.057e+02  [-147 4.340e-08 2.085e-08 9.872e-01]  [2 0 0]
 NS 2-13  2.065e+02  [-147 4.293e-08 2.062e-08 1.000e+00]  !0 0 0!  WARNING: The linear system solution has not converged
 NS 2-14  2.073e+02  [-147 4.264e-08 2.048e-08 1.000e+00]  !0 0 0!  WARNING: The linear system solution has not converged
 NS 2-15s 2.082e+02  [-147 4.248e-08 2.040e-08 1.000e+00]  !0 0 0!  WARNING: The linear system solution has not converged

The convergence is linear and extremely slow, and the residual stagnates around 1e-8. The linearization of the porous flow is likely not correct.

Reproduction

Run pytest -k porous.

Expected behavior

Always quadratic convergence

Additional context

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct and Contributing Guidelines

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.