# A question of postprocessing total stress tensor

**URL:** <https://community.geodynamics.org/t/a-question-of-postprocessing-total-stress-tensor/938>\
**Category:** ASPECT\
**Created:** [November 27, 2019, 12:19pm UTC](https://community.geodynamics.org/t/a-question-of-postprocessing-total-stress-tensor/938 "2019-11-27T12:19:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sungho](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/sungho/32/365_2.png) [@sungho](https://community.geodynamics.org/u/sungho)\
**Post date:** [November 27, 2019, 12:19pm UTC](https://community.geodynamics.org/t/a-question-of-postprocessing-total-stress-tensor/938/1 "2019-11-27T12:19:34Z")

</div>

Hello.

This is Sungho.

I have a quick question.

In the manual of ASPECT, stress tensor is defined by tau + p (here tau is 2_eta_strain rate) in p. 476.  
I have checked this expression in stress.cc (~/aspect/source/postprocess/visualization).

I think total stress should be defined by either “- tau + pI” or “tau - pI”?!  
If we follow the present expression (tau + p ) for stress tensor, laterally outward velocity\_x (tension) in 2D makes compression because positive strain increases total stress\_xx.

How do you think?

Thanks

---

<div class="post-metadata">

**Author:** ![jbnaliboff](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jbnaliboff](https://community.geodynamics.org/u/jbnaliboff)\
**Post date:** [November 30, 2019, 9:15pm UTC](https://community.geodynamics.org/t/a-question-of-postprocessing-total-stress-tensor/938/2 "2019-11-30T21:15:47Z")

</div>

Hi Sungho,

If I understand correctly, your broad point is how to define the sign of tension verse compression.

Pressure (compression) is defined as positive, but the deviatoric stress is defined as positive during tension as well.

Perhaps we can have a flag that allows one to reserve the sign of the deviatoric stresses before adding them to the pressure?

Thoughts from others?

Cheers,  
John

---

<div class="post-metadata">

**Author:** ![gassmoeller](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/gassmoeller/32/11_2.png) [@gassmoeller](https://community.geodynamics.org/u/gassmoeller)\
**Post date:** [December 2, 2019, 9:14pm UTC](https://community.geodynamics.org/t/a-question-of-postprocessing-total-stress-tensor/938/3 "2019-12-02T21:14:22Z")

</div>

Hi all,  
I checked the equation and I think you are right @sungho. No matter whether pressure is defined inward or outward it should have the opposite sign of the stress. Do you want to make a fix for the documentation and formula and open a pull request? If not, please open an issue on github and one of us will get to it in time.

Best,  
Rene

---

<div class="post-metadata">

**Author:** ![anne-glerum](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/anne-glerum/32/283_2.png) [@anne-glerum](https://community.geodynamics.org/u/anne-glerum)\
**Post date:** [December 5, 2019, 10:17am UTC](https://community.geodynamics.org/t/a-question-of-postprocessing-total-stress-tensor/938/4 "2019-12-05T10:17:07Z")

</div>

Hi all,  
Thanks for bringing this up @sungho!

Coincidentally I was just computing differential stress profiles, and they were quite off from what I was expecting. Instead of the tau+PI that the postprocessor does currently, it is tau-PI for the definition of P=-1/3sigma\_kk used in continuum mechanics (compression positive). As such, to correct the output of the diagonal stress tensor elements, I can subtract twice the pressure. Agreed?  
(BTW, this won’t help with the differential stress).

Cheers,  
Anne

---

<div class="post-metadata">

**Author:** ![sungho](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/sungho/32/365_2.png) [@sungho](https://community.geodynamics.org/u/sungho)\
**Post date:** [December 5, 2019, 11:44am UTC](https://community.geodynamics.org/t/a-question-of-postprocessing-total-stress-tensor/938/5 "2019-12-05T11:44:38Z")

</div>

Yep, It would be helpful for others, it is trivial though 🙂

---

<div class="post-metadata">

**Author:** ![sungho](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/sungho/32/365_2.png) [@sungho](https://community.geodynamics.org/u/sungho)\
**Post date:** [December 5, 2019, 11:57am UTC](https://community.geodynamics.org/t/a-question-of-postprocessing-total-stress-tensor/938/6 "2019-12-05T11:57:13Z")

</div>

Hi Anne 🙂

Differential stress is not affected by the sign of tau because of definition of differential stress. So, I think it was not a problem for you Anne 🙂

In addition, as you know, the stress tensor is not primary variables and does not affect the model results and integrity of ASPECT as a fluid solver at all.

For me, however, I classified stress regimes (i.e. normal, strike, reverse) using directions of principal stress calculated from total stress tensor.

But it was confusing me to understand the results before I found that incorrect expression.

Best

Sungho

---

<div class="post-metadata">

**Author:** ![anne-glerum](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/anne-glerum/32/283_2.png) [@anne-glerum](https://community.geodynamics.org/u/anne-glerum)\
**Post date:** [December 5, 2019, 2:54pm UTC](https://community.geodynamics.org/t/a-question-of-postprocessing-total-stress-tensor/938/7 "2019-12-05T14:54:32Z")

</div>

Hi Sungho,

I could have phrased it better. I realized it wouldn’t help me with the differential stress, but we use the stress output for other postprocessing as well and it’s more efficient to correct the output than to rerun. So I just wanted to document the correction here with you and Rene 🙂

Would be great if you could make a PR!

Cheers,  
Anne

---

<div class="post-metadata">

**Author:** ![jbnaliboff](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jbnaliboff](https://community.geodynamics.org/u/jbnaliboff)\
**Post date:** [November 20, 2020, 8:17pm UTC](https://community.geodynamics.org/t/a-question-of-postprocessing-total-stress-tensor/938/8 "2020-11-20T20:17:28Z")

</div>

Hi all,

This issue has been resolved by the following PR by @anne-glerum :

> <https://github.com/geodynamics/aspect/pull/3897>

On a related note, @gassmoeller has also made a new post processor the computes principal stress directions:

> <https://github.com/geodynamics/aspect/pull/3878>

Thanks Anne and Rene!

Cheers,  
John
