Add missing term to strain magnitude for 2D - #670
Conversation
When summing over the diagonal components of the deviatoric rate-of-strain tensor, only the first two diagonal components are summed in 2D. This creates problems, because the third component is *not* zero. The third component of the rate-of-strain tensor in a 2D is zero (i.e. S_33 = 0). But the deviatoric rate-of-strain tensor has a nonzero third diagonal component. So in 2D, the third diagonal component must be explicitly added. This should only make significant impacts on problems where the divergence of velocity is non-negligible when compared to the diagonal components of the rate-of-strain tensor.
|
Thanks, @clarkpede, it might be that we are missing this in other places too, such as in the numerics classes possibly. Did you already have a look elsewhere in the code? |
|
I've done a brief search. There's an almost exact duplicate of the function in the incompressible solver ( |
|
Thanks for checking, @clarkpede. The reason that the full stress tensor (and divergence of velocity) appear still in the incompressible solver is for the situation when the density is allowed to vary with the ideal gas law (low Mach formulation). Here, the density can vary with temperature, which leads to the divergence of velocity being a function of temperature (instead of zero). |
Due to bugfix in how the strain magnitude is calculated, any tests involving SST have a slightly different production and slightly different test values.
See the previous commit for an explanation.
|
So I want to update the But what was the stopping criteria used while generating the restart file in TestCases/turbomachinery/transonic_stator_2D? Was it the same stopping criteria used in the non-restart cfg file? For that case, the solver stops at 2001 external iterations. |
These test values are being updated to match a bugfix in the magnitude of the deviatoric rate-of-strain tensor.
|
For my part, this is ready to be merged in once su2code/TestCases#34 goes through. Only the transonic stator restart case is failing. |
|
Just merged the test. Let's get this merged next once it passes. |
The previous test values of the transonic stator case were based on a 1-task MPI job (not a true serial code), so the actual test values are slighly different. This is part of the "fix production in 2D" series of bugfixes.
Proposed Changes
For 2D problems, the calculation for the magnitude of the rate-of-strain tensor is missing a term.
When summing over the diagonal components of the deviatoric rate-of-strain tensor, the code loops over
nDimdiagonal components. In 2D, that means it only adds the first two diagonal components. This creates problems, because the third component is not zero, even for 2D flow. While third component of the rate-of-strain tensor in 2D is zero (i.e. S_33 = 0), the deviatoric rate-of-strain tensor has a nonzero third diagonal component. So in 2D, the third diagonal component must be explicitly added.This should only make significant impacts on problems where the divergence of velocity is non-negligible when compared to the diagonal components of the rate-of-strain tensor (i.e. for higher Mach cases).
Related Work
None that I know of.
PR Checklist