SU2 icon indicating copy to clipboard operation
SU2 copied to clipboard

Fix shared wall-inlet corner node for compressible

Open bigfooted opened this issue 1 year ago • 12 comments

Proposed Changes

Give a brief overview of your contribution here in a few sentences. Nodes shared by an inlet and a wall show nonphysical values in the corner node for energy, temperature, pressure, density. This fixes the issue

Related Work

Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.

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.

  • [x] I am submitting my contribution to the develop branch.
  • [x] My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • [x] My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • [x] 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.

bigfooted avatar Apr 16 '24 21:04 bigfooted

@Cristopher-Morales Can you check if this fixes the issue for you? This works for the testcase that you gave me (2D compressible channel flow). There is still a (compared to develop) very small local change in pressure but I think this is because at the inlet, the radial velocity is not zero and close to the wall the radial velocity component is not negligible, this is I think why the pressure locally is still not completely homogeneous.

bigfooted avatar Apr 16 '24 21:04 bigfooted

Below is a zoom of the 2D flow in a rectangular channel. The flow is from left to right. The top side is a wall, the left side is the inlet. We are looking at the corner node shared by the inlet and the wall. Pictures showing the Pressure for old (develop) and new implementation. The local pressure changes reduce by more than one order of magnitude: 2024-04-16_23h37_19 2024-04-16_23h34_15

Old and new energy near the corner: 2024-04-16_23h35_55 2024-04-16_23h33_50

Near the corner, the y-momentum (radial velocity) is not zero: 2024-04-16_23h34_41

bigfooted avatar Apr 16 '24 21:04 bigfooted

the user defined function case: a flat plate. top is with the fix, bottom (mirrored): the old develop. udf

bigfooted avatar Apr 17 '24 19:04 bigfooted

@Cristopher-Morales can you check if bounded scalar works for you for this setup with compressible flow? I activated it and it seems to work fine for the small testcase that you sent. It is much better than scalar upwind.

bigfooted avatar Apr 20 '24 14:04 bigfooted

Poiseuille flow, top is corrected, bottom is develop. There is still a small discrepancy in the energy but this might be due to the strong velocity components close to the wall. image

bigfooted avatar Apr 20 '24 14:04 bigfooted

@Cristopher-Morales can you check if bounded scalar works for you for this setup with compressible flow? I activated it and it seems to work fine for the small testcase that you sent. It is much better than scalar upwind.

species_transport Hi, yes it works much better, specially if we refine the mesh towards the walls.

Cristopher-Morales avatar Apr 20 '24 14:04 Cristopher-Morales

@EvertBunschoten can you check specifically the bounded scalar method? not sure if I missed something, see the comments that I left in the code.

bigfooted avatar May 03 '24 14:05 bigfooted

I'm sorry to interject on this issue with what is probably a useless comment, but I wanted to ask if this issue affects you also in 1st order simulations?

In my experience MUSCL reconstruction at boundaries in SU2 is "incorrect" as it doesn't take into account the boundary condition applied and just assumed v_i = v_j, as far as I have understood from scouring the code. This usually is a small first order approximation locally, but with complex EoS or unlucky combinations of BCs and numerical settings it can cause unphysical solutions and crashes.

In a project of mine I have had some success by either disabling MUSCL outright at boundaries (very conservative and brutal solution), or disable it only at specific kinds of corners, which requires more memory unfortunately as one needs to somehow save if the node is a corner, etc.

The "real solution" would be to either save the boundary solution in ghost nodes and use it for the gradient computation, or fix gradients in post-process with a small performance penalty.

GiuSirianni avatar May 13 '24 10:05 GiuSirianni

It looks like the edge mass fluxes are not stored when running compressible RANS simulations, preventing any species convection when using BOUNDED_SCALAR. I'm looking into why this happens. Below is the species solution after 10 iterations for the passive_transport_validation test case for the RANS solver and using BOUNDED_SCALAR. The species values specified at the inlet do not progress downstream using the current settings.

bounded_scalar_compressible

EvertBunschoten avatar May 13 '24 12:05 EvertBunschoten

Hi, @GiuSirianni, The problem I am addressing here is even more basic and occurs independent on the MUSCL scheme. When a corner is shared between an inlet and a wall, the inlet has to take into account that the node is shared by a wall (it has to know about no-slip for instance). But it is good to know that MUSCL has issues at boundaries as well, this should definitely be fixed. If you can spare a couple of minutes, can you create an Issue here on github for MUSCL not being high order/robust on boundaries and share your experience?

bigfooted avatar May 13 '24 19:05 bigfooted

@bigfooted I will open an issue, thank you!

GiuSirianni avatar May 15 '24 09:05 GiuSirianni

@EvertBunschoten since bounded scalar was never implemented for compressible flow, I think we should create a separate PR for it. If the symmetry PR is merged, I will update the residuals for this PR as well.

bigfooted avatar Aug 04 '24 06:08 bigfooted

@pcarruscag Finally had some time to look into this again. Behavior is still as described above. If you have time, can you have another look?

bigfooted avatar Oct 31 '24 20:10 bigfooted

Thanks, Pedro :-)

bigfooted avatar Dec 09 '24 07:12 bigfooted