# Zone property values not updating correctly?

**URL:** <https://forum.itascainternational.com/t/zone-property-values-not-updating-correctly/1612>\
**Category:** FLAC2D\
**Tags:** fish\
**Created:** [August 1, 2024, 11:13pm UTC](https://forum.itascainternational.com/t/zone-property-values-not-updating-correctly/1612 "2024-08-01T23:13:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdamL](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.itascainternational.com/adaml/32/1156_2.png) [@AdamL](https://forum.itascainternational.com/u/AdamL)\
**Post date:** [August 1, 2024, 11:13pm UTC](https://forum.itascainternational.com/t/zone-property-values-not-updating-correctly/1612/1 "2024-08-01T23:13:25Z")

</div>

I’m currently trying to assign shear-normal values based on a function for each zone, with the function based on vertical stress values. The result looks correct, but as a sanity check, I plotted the zone property shear-normal, and the values are constant for the whole model.

Is the below code correct? Or could there be an issue with how I am plotting the value?

fish define shear\_stiffness  
; loops through the zone list - with the current zone called adr  
loop foreach adr zone.list  
local syy = zone.stress.yy(adr) ; finds zone vertical stress  
Ks = 10 ^ (0.093 \* syy + 0.676) ; calculates shear stiffness  
shear\_m = 1 / ((2 \* (1 + p\_ratio)) / young\_plane + (1 / (Ks \* S))) ; calculates shear modulus  
zone.prop(adr, ‘shear-normal’) = shear\_m ; sets zone shear modulus value  
endloop  
end

---

<div class="post-metadata">

**Author:** ![AdamL](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.itascainternational.com/adaml/32/1156_2.png) [@AdamL](https://forum.itascainternational.com/u/AdamL)\
**Post date:** [August 1, 2024, 11:48pm UTC](https://forum.itascainternational.com/t/zone-property-values-not-updating-correctly/1612/2 "2024-08-01T23:48:58Z")

</div>

Ok, I’ve narrowed it down to the following line:

local syy = zone.stress.yy(adr) ; finds zone vertical stress

When saving this as an extra (see code below), it results in 0 at every zone when plotting, whereas it should match the stress yy plot. Stay tuned while I continue troubleshooting (at least until someone can point out my mistake).

zone.extra(adr, 4) = syy

The isotropic (Mohr-coulomb) model maps correctly, matching the stress yy plot. However, for the anisotropic models, the result is zero in every zone. My current working theory is that the model properties are out. See below—stay tuned while I work through this.

[global young\_plane=1.25e4, p\_ratio=0.25, Kn=80, S=60]

zone cmodel assign mohr-coulomb  
zone property density 2700 young [young\_plane] poisson [p\_ratio] …  
friction 50 cohesion 10.5 tension 0

zone cmodel assign anisotropic  
zone property young-plane [young\_plane] young-normal [1 / (1 / young\_plane + 1 / (Kn \* S))]  
zone property poisson-plane [p\_ratio] poisson-normal [p\_ratio] …  
shear-normal [1 / ((2 \* (1 + p\_ratio)) / young\_plane + (1 / (5.87 \* S)))]  
zone property angle 0

---

<div class="post-metadata">

**Author:** ![AdamL](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.itascainternational.com/adaml/32/1156_2.png) [@AdamL](https://forum.itascainternational.com/u/AdamL)\
**Post date:** [August 6, 2024, 12:19am UTC](https://forum.itascainternational.com/t/zone-property-values-not-updating-correctly/1612/3 "2024-08-06T00:19:55Z")

</div>

Another crisis was averted—I was calling the function in the wrong location. After applying the new shear modulus values, I had to resolve the model. It took way too long to figure that out.

---

<div class="post-metadata">

**Author:** ![paul](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.itascainternational.com/paul/32/196_2.png) [@paul](https://forum.itascainternational.com/u/paul)\
**Post date:** [August 30, 2024, 10:11am UTC](https://forum.itascainternational.com/t/zone-property-values-not-updating-correctly/1612/4 "2024-08-30T10:11:37Z")

</div>

I do this kind of things all the time! Thanks @AdamL for following up your question with the solution - it really helps other who might have the same or similar issues in the future.

Did you initialize the extra variables? Sometimes it is useful to use e.g. ‘zone initialize extra 1 [value]’ to see the value update on the contour plots, then run the FISH logic to update the specific values for each zone. Hope this helps!
