Skip to content

Conversation

@bigfooted
Copy link
Contributor

@bigfooted bigfooted commented Jun 16, 2025

Proposed Changes

Only use the damping factor on the target massflow when dP is relatively large compared to P. This greatly improves the convergence rate and prevents stalling of the massflow rate.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the incompressible solver, do we solve for gauge pressure or absolute pressure?

@bigfooted
Copy link
Contributor Author

In the incompressible solver, do we solve for gauge pressure or absolute pressure?

We solve for gauge pressure, so our target massflow implementation is the same as in Fluent:
https://www.afs.enea.it/project/neptunius/docs/fluent/html/ug/node244.htm

@bigfooted
Copy link
Contributor Author

our entire incompressible ideal gas:
image

@pcarruscag
Copy link
Member

Then two equivalent incompressible cases with just a different pressure level will behave differently with this change, right?
Perhaps a criterion based on the range of pressures would be more invariant.

@bigfooted
Copy link
Contributor Author

bigfooted commented Jun 18, 2025

Then two equivalent incompressible cases with just a different pressure level will behave differently with this change, right? Perhaps a criterion based on the range of pressures would be more invariant.

Do you mean the reference pressure? Yes, if you choose a different reference pressure, and add 1 Pa or 1e6 Pa to it, it will behave differently. So I could take into account p_0 as well.

@bigfooted
Copy link
Contributor Author

I checked and we never actually add a reference pressure anywhere, and the thermodynamic pressure is only used to compute the (incompressible ideal gas) density. So I think it's fine the way it is currently done.

@pcarruscag
Copy link
Member

If you set up a case where you put all your pressures as absolute, and another where you put them as relative (to ambient, or to one of the inlets, or outlets) they will not behave the same with this logic.
One solution is to use a reference based on the difference between min and max pressure in the domain, this quantity should be the same regardless of whether you use relative or absolute pressures.
This is what the Venkat-Wang limiter does to scale the limiter constant.

@bigfooted
Copy link
Contributor Author

OK, thanks, I understand. I can loop over all inlets and outlets and get the P_max/P_min ratio

@pcarruscag
Copy link
Member

For preconditioning we already determine the maximum velocity, you can extend that to the the min and max pressure.
Note that what is invariant is max - min, not max / min

@bigfooted
Copy link
Contributor Author

Is it sufficient here to subtract the minimum pressure in the domain and use that as the reference pressure, so we compare the update pressure dp to the local pressure (P-P_min_global)

@pcarruscag
Copy link
Member

From the invariance perspective, yes, whether it is a good enough way of deriving a reference value, I don't know.

Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a test that uses this?

@pcarruscag pcarruscag changed the title [ WIP] Fix damping mass outlet Fix damping mass outlet Jul 17, 2025
bigfooted and others added 4 commits July 17, 2025 21:14
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
@bigfooted
Copy link
Contributor Author

bigfooted commented Jul 17, 2025

Do we have a test that uses this?

Yes, the nozzle case that is failing in the regression tests.

@bigfooted
Copy link
Contributor Author

The existing nozzle case in the regression test stalls at 99.90% target mass flow rate, the new implementation goes to 99.99%.
Not a large difference for the existing case, other cases show a more dramatic improvement.
For the target mass flow rate, the inlet pressure damping factor sometimes has to be lowered to 0.10 -> 0.04 or so.

@bigfooted bigfooted merged commit 764b3be into develop Jul 19, 2025
36 of 37 checks passed
@bigfooted bigfooted deleted the fix_damping_mass_outlet branch July 19, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants