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

Fix stress #3897

Merged
merged 7 commits into from Nov 20, 2020
Merged

Fix stress #3897

merged 7 commits into from Nov 20, 2020

Conversation

anne-glerum
Copy link
Contributor

@anne-glerum anne-glerum commented Nov 19, 2020

As first mentioned on the forum by Sungho, the stress should be computed as 2*eta*strain_rate-P*I or -2*eta*strain_rate+P*I, instead of 2*eta*strain_rate+P*I as is currently done in the visualization postprocessors that output stresses. Here I fixed the sign, sticking to the convention of positive compressive stresses, so -2*eta*strain_rate+P*I.

See also discussion in #3878 .

For all pull requests:

For new features/models or changes of existing features:

  • I have tested my new feature locally to ensure it is correct.
  • I have created a testcase for the new feature/benchmark in the tests/ directory.
  • I have added a changelog entry in the doc/modules/changes directory that will inform other users of my change.

Copy link
Contributor

@naliboff naliboff left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @anne-glerum! The only key remaining item would be to update the test output.

A general questions: Is there somewhere in the manual that discusses visualizing stress that should be updated?

Once merged, the forum post should also be updated.

@@ -73,7 +73,8 @@ namespace aspect

const double eta = out.viscosities[q];

const SymmetricTensor<2,dim> shear_stress = 2*eta*compressible_strain_rate;
// Compressive stress is positive in geoscience applications
const SymmetricTensor<2,dim> shear_stress = -2.*eta*compressible_strain_rate;
Copy link
Member

Choose a reason for hiding this comment

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

The "compressible_strain_rate" variable is actually the incompressible part of the strain rate. Ditto for the other two files. Suggest changing the name to incompressible_strain_rate?

This is my only quibble :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for having a look. It depends on what the material model returns for (this->get_material_model().is_compressible() whether the strain rate in compressible_strain_rate is in fact compressible or the incompressible part. So the name is not always correct. But that's not really related to this PR, so I'll leave that for now, OK?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, the relevant code above is:

= (this->get_material_model().is_compressible()
?
strain_rate - 1./3 * trace(strain_rate) * unit_symmetric_tensor()
:
strain_rate);

Even if the material is compressible, the pressure is removed (-1/3 * trace(strain_rate)) and thus you have the deviatoric strain rate. If an incompressible formulation is used, then should the strain rate by default be deviatoric?

If the above is correct, would deviatoric_strain_rate be the most accurate name?

No preference on whether this is resolved now or in a follow-up PR, but will leave that up to @bobmyhill.

Copy link
Member

Choose a reason for hiding this comment

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

@naliboff Yes, that's what I was trying to say. Thanks for clarifying!
I'm fine for the rename to be a separate PR.

@anne-glerum
Copy link
Contributor Author

  • Alright, I've checked that the failing tests failed because of the stress postprocessors and updated the results.
  • I couldn't find an instance in the manual about stress visualization that needs to be updated.
  • I'll update the forum post when this is merged.

Copy link
Contributor

@naliboff naliboff left a comment

Choose a reason for hiding this comment

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

@anne-glerum - This is good to go, thanks! I'll make a follow-up PR that renames compressible_strain_rate to 'deviatoric_strain_rate', per @bobmyhill suggestion.

@naliboff naliboff merged commit 78fbda9 into geodynamics:master Nov 20, 2020
@naliboff naliboff mentioned this pull request Nov 22, 2020
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants