# How to calculate normal stress

**URL:** https://discourse.paraview.org/t/how-to-calculate-normal-stress/13939
**Category:** ParaView Support
**Created:** [February 14, 2024, 12:43pm UTC](https://discourse.paraview.org/t/how-to-calculate-normal-stress/13939 "2024-02-14T12:43:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ali1990dashti](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali1990dashti/32/12099_2.png) [@Ali1990dashti](https://discourse.paraview.org/u/Ali1990dashti)
#### Post date: [February 14, 2024, 12:43pm UTC](https://discourse.paraview.org/t/how-to-calculate-normal-stress/13939/1 "2024-02-14T12:43:00Z")

</div>

Dear Cummunity,

I want to do some post processing in paraview.  
In my exodus file I have 9 stress components stored both as the vectors and scalers. As the vector I have variables named as `stress_x`, `stress_y`, and `stress_z`. But as the scaler I have `stress_x_X`, `stress_x_Y`, `stress_x_Z`, `stress_y_X`, `stress_y_Y`, `stress_y_Z`, `stress_z_X`, `stress_z_Y`, and `stress_z_Z`. On one of the (2D) surfaces (named as `fault`) in domain I want to calculate the normal stress. The first thing is that I should find the three components of the normal on the surface (`fault`). I followed [this discussion](https://discourse.paraview.org/t/unit-normal-vector-fluid-interface/7316/14) but I could find a solution for it. In each triangle on the surface I need to calculate the three coefficients whoen in the following figures as `n1`, `n2` and `n3`. Then, the following matrix multiplication will allow to run a matrix calculation:

 ![t_vector](https://discourse.paraview.org/uploads/default/original/2X/a/accbf271d471f80ce6f9867c613e0b8896610516.jpeg)

The `t_vector` can be finally used to calculate the normal stress value as a scaler (by the dot production of `t_vector` and normal coefficients):  
 ![stress](https://discourse.paraview.org/uploads/default/original/2X/7/74cb5deccfc2fcade9afa9201bca687bd2f96833.jpeg)

I have also uploaded a zipped exodus file [here](https://github.com/Ali1990dashti/model_file).  
Thanks a lot for any support regarding my issue for normal stress calculation. At the end I should have one normal stress value for each triangle of the surface.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 19, 2024, 9:31am UTC](https://discourse.paraview.org/t/how-to-calculate-normal-stress/13939/2 "2024-02-19T09:31:09Z")

</div>

Hi @Ali1990dashti

Use PythonCalculator or Calculator for this task, but first reconstruct the vector using MergeVectorComponents.

---

<div class="post-metadata">

### Author: ![Ali1990dashti](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali1990dashti/32/12099_2.png) [@Ali1990dashti](https://discourse.paraview.org/u/Ali1990dashti)
#### Post date: [February 19, 2024, 9:55am UTC](https://discourse.paraview.org/t/how-to-calculate-normal-stress/13939/3 "2024-02-19T09:55:08Z")

</div>

Hi @mwestphal ,  
Thanks for the hint.
