Skip to content

Add missing term to strain magnitude for 2D - #670

Merged
pcarruscag merged 11 commits into
developfrom
fix_production_in_2D
Jul 15, 2019
Merged

pcarruscag merged 11 commits into
developfrom
fix_production_in_2D

Conversation

@clarkpede

@clarkpede clarkpede commented Apr 18, 2019

Copy link
Copy Markdown
Contributor

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 nDim diagonal 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

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags).
  • My contribution is commented and consistent with SU2 style.
  • I have added a test case that demonstrates my contribution, if necessary.

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.
@economon

Copy link
Copy Markdown
Member

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?

@clarkpede

Copy link
Copy Markdown
Contributor Author

I've done a brief search. There's an almost exact duplicate of the function in the incompressible solver (SetStrainMag). But as far as I am aware, stating that a flow is incompressible means that the divergence of velocity is zero. So the extra term would be zero, and no change is necessary. But that leaves the question, "Why is the divergence of velocity included there in the first place?"

@economon

Copy link
Copy Markdown
Member

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).

@clarkpede

Copy link
Copy Markdown
Contributor Author

So I want to update the transonic_stator_2D test case with a new restart file that matches the new numerics. Since it's a transonic case, the difference in production is significant.

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.

clarkpede added 2 commits July 9, 2019 21:46
These test values are being updated to match a bugfix in the magnitude
of the deviatoric rate-of-strain tensor.
@clarkpede

Copy link
Copy Markdown
Contributor Author

For my part, this is ready to be merged in once su2code/TestCases#34 goes through. Only the transonic stator restart case is failing.

@economon

Copy link
Copy Markdown
Member

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.
@economon
economon requested a review from jayantmukho July 15, 2019 22:05

@pcarruscag pcarruscag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

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.

5 participants