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
Fix stress #3897
Conversation
There was a problem hiding this 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; |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
aab8ae0
to
fcb1a85
Compare
There was a problem hiding this 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.
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 of2*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: