Calculate stress along radius

Dear all,

I am simulating CNTs and trying to calculate stress along radius. there is no output for stress vector (rr) as like (xx/yy/zz) directly, so I used the command compute stress/atom :

> compute  atomS     all      stress/atom NULL
> variable atomR     atom     "sqrt(c_atomS[1]^2+c_atomS[2]^2)"  
> ### stress(rr) =sqrt(stress(xx)^2+stress(yy)^2)
> compute  PperS     all      reduce sum c_atomS[1] c_atomS[2] c_atomS[3] v_atomR
> variable Pcompt    equal    "-(c_PperS[1]+c_PperS[2]+c_PperS[3])/(3*vol)"
> variable Sxx       equal    "(c_PperS[1])/(vol)/10000"
> variable Syy       equal    "(c_PperS[2])/(vol)/10000"
> variable Szz       equal    "(c_PperS[3])/(vol)/10000"    
> variable Srr       equal    "(c_PperS[4])/(vol)/10000"

Results agree with the manual : Pcompt==Press; Sxx==Pxx(/10000); y; z, BUT Srr is only half as expected. Is the formula feasible to calculate Srr

Any help will be greatly appreciated.
Best regards,
NingN

Have you looked at compute stress/spherical?

thank you Axel!

I’ve read this command, but at the end of manual “Restrictions: These computes calculate the stress tensor contributions for pair styles only and requires pairwise force calculations not available for most many-body pair styles.” I use ARIEBO potential (many-body), so I didn’t use it before. I’ll try this and make some comparisons.

The restriction message is there for a reason, but that also means that the kind of stress you want to compute cannot easily be computed for a many-body potential and what you are doing with the per-atom stress is not likely to be correct.

Got it, thank you again Axel!