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
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.
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.
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!