Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symmetry BC not working #2390

Open
rois1995 opened this issue Dec 4, 2024 · 14 comments
Open

Symmetry BC not working #2390

rois1995 opened this issue Dec 4, 2024 · 14 comments
Labels

Comments

@rois1995
Copy link
Contributor

rois1995 commented Dec 4, 2024

Hi all,

I am simulating a 2D channel with two triangular bumps in a Mach = 2.0 inviscid flow. When slicing the solution along x-normal planes, I can see that the symmetry condition does not lead to zero-gradients in the normal direction at the euler wall. Only the pressure variable has a zero-gradient at the wall. The situations doesn't change if I try with Roe, AUSMPLUSUP or JST schemes, nor if I change the way gradients are computed. Also refining the mesh does not improve the solution. I tried running the same case reverting SU2 to the commit previous to the implementation of the new symmetry BC and it works fine. The euler walls are the top and the bottom ones.

Here is the general flow solution colored by the Mach number
Cuts

Here the solution with the new symmetry BC
Density_Roe

Here the solution with the old symmetry BC
Density_Roe

I have also tried with a subsonic flow and the result is the same. Notice how before the triangular bump the gradients are zero at the euler walls (red line).

All the simulations have converged to a RMS of the residual density of $10^{-13}$.

Here you can find the mesh and the config file.
https://polimi365-my.sharepoint.com/:f:/g/personal/10507725_polimi_it/Em_r77HJAJpOiceuw5YSeAMB2CDPDoI5RJT_4CTe9fj7Aw?e=zz2jBN

I think that the problem is that when setting the normal gradients to 0 in the code then we are unable to reconstruct the primitive variables at the mid-point of the wall normal edges.

Desktop (please complete the following information):

  • OS: Ubuntu
  • C++ compiler and version: gcc 9.4.0
  • MPI implementation and version: 4.0.3
  • SU2 Version: v8, commit 77fed34
@rois1995 rois1995 added the bug label Dec 4, 2024
@bigfooted
Copy link
Contributor

It looks like the energy also has nonzero normal gradients at the wall...
Gradients are corrected in the correctGradientsSymmetry routine, called from green-gauss or least-squares. We get the local normal and then make a call to correctGradient, where we remove the normal component. All solver variables are corrected here, so not sure what is going on here. Any ideas, @pcarruscag ?

@rois1995
Copy link
Contributor Author

rois1995 commented Dec 4, 2024

If the gradient is set to 0 then it is not possible to correctly reconstruct the variable at the mid point of the edge. What if we also set the variable to be equal to the one of the normal neighbor (for scalar quantities)?

@bigfooted
Copy link
Contributor

Which lines in the code are you referring to now?

@rois1995
Copy link
Contributor Author

rois1995 commented Dec 4, 2024

I am talking about the ComputeFlux function in numerics_simd/flow/convection/roe.hpp, where the primitives are reconstructed.

@rois1995
Copy link
Contributor Author

rois1995 commented Dec 4, 2024

Maybe I got it. The problem seems to be the fact that not all of the euler walls are aligned. Indeed, when I try to simulate a channel flow with only the upper bumps, the bottom euler wall (Y = 0) has gradients equal to 0.

Mach

Density_Roe

Maybe it has to do with normals and we get back to #2383 .

@pcarruscag
Copy link
Member

This may be due to some of the dissipation terms that were kept for stability

@pcarruscag
Copy link
Member

/*--- Compute the residual using an upwind scheme. ---*/
    auto residual = conv_numerics->ComputeResidual(config);

    /*--- We include an update of the continuity and energy here, this is important for stability since
     * these fluxes include numerical diffusion. ---*/
    for (auto iVar = 0u; iVar < nVar; iVar++) {
      if (iVar < iVel || iVar >= iVel + nDim) LinSysRes(iPoint, iVar) += residual.residual[iVar];
    }

@rois1995
Copy link
Contributor Author

rois1995 commented Dec 4, 2024

I have already tried removing those but the gradients were still not 0. I think the problem might be with the computations of the normals.

@bigfooted
Copy link
Contributor

We do not strongly enforce the gradients at the walls. I think the normal computations are fine, it is I think the more complex boundary layer after the bump that causes strong gradients close to the surface. It is then more difficult to weakly enforce the gradients to be zero when the initial gradients are large. I wouldn't directly modify the values at the nodes, this is bad for convergence.

@rois1995
Copy link
Contributor Author

rois1995 commented Dec 5, 2024

What do you mean that you do not strongly enforce the gradients at the wall? Isn't the correctGradientsSymmetry function doing exactly that? Plus, it is an euler simulation, thus no boundary layer is present.

Maybe something strange happens when a symmetry boundary condition is not aligned with the principal axes. I say this because when I tried removing the bumps on the lower boundary then the symmetry condition worked just fine on that boundary. On the other hand, the top boundary was still affected by the problem.

@bigfooted
Copy link
Contributor

The gradients are corrected at the level of the green-gauss routine, and that is fed to the Euler equations. So we have the correct gradients in a field called gradients, and then we modify the linear solver residuals based on a normal correction. But we do not directly force the gradients of the solution of the Euler equations to zero like what you suggest, where we force the first points in the domain normal to the wall to have the wall value.
With boundary layer I mean the first cell(s) above the wall . Where the shock hits the wall and then reflects, you have large gradients in e.g. energy, which then have to modified.
btw, do you have literature results for this case?

@rois1995
Copy link
Contributor Author

rois1995 commented Dec 5, 2024

I see what you mean.

I've found this case in the Nishikawa's limiters paper (https://arc.aiaa.org/doi/10.2514/6.2022-1374) and he doesn't seem to have this problem (Figure 14b, page 34)

@bigfooted
Copy link
Contributor

Thanks for the paper. In the paper, the inlet density is 1, we have 2, is this just a nondimensionalization? If I simply scale the density by 2 then the results looks pretty similar to the result in the paper. It is difficult to see if Nishikawa has nonzero normal gradients of density close to the wall.

@rois1995
Copy link
Contributor Author

rois1995 commented Dec 5, 2024

I also have density equal to 1 at the inlet in my simulations. Our simulations are non-dimensionalized. Also re-scaling the colorbar and the density to align with the paper's results, as you said, the problem is barely visible. But my point is that I don't understand why this happens with the new implementation of the symmetry BC whereas it was not happening before. Plus, it seems wrong as the gradients at the boundaries are not zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants