-
Notifications
You must be signed in to change notification settings - Fork 134
Possible duplicate/canceling terms in hypoelastic stress rate (m_hypoelastic.fpp) #1343
Description
Description
While auditing compiler warnings, I noticed suspicious duplicate and canceling terms in s_compute_hypoelastic_rhs in src/simulation/m_hypoelastic.fpp, in the idir == 2 (y-direction) block (lines ~220-243).
Specific concerns
Lines 225-226 — tau_11 update: q_prim_vf(strxb + 1)%sf * du_dy_hypo appears twice with the same sign, effectively doubling the term:
rhs_vf(strxb)%sf(k, l, q) = rhs_vf(strxb)%sf(k, l, q) + rho_K_field(k, l, q)*(
q_prim_vf(strxb + 1)%sf(k, l, q)*du_dy_hypo(k, l, q) + &
q_prim_vf(strxb + 1)%sf(k, l, q)*du_dy_hypo(k, l, q) - ...Lines 231-232 — tau_12 update: q_prim_vf(strxb + 1)%sf * du_dx_hypo appears twice with opposite signs, canceling out:
q_prim_vf(strxb + 1)%sf(k, l, q)*du_dx_hypo(k, l, q) + ... &
- q_prim_vf(strxb + 1)%sf(k, l, q)*du_dx_hypo(k, l, q) + ...Lines 238-239 — tau_22 update: q_prim_vf(strxb + 1)%sf * dv_dx_hypo appears twice with the same sign.
Lines 240-241 — tau_22 update: q_prim_vf(strxb + 2)%sf * dv_dy_hypo appears three times (+, +, -).
Possible explanations
These could be:
- Copy-paste errors in the Jaumann/upper-convected derivative expansion
- Intentional (some stress rate formulations have symmetric contributions)
- Correct but hard to read due to line wrapping
Request
Could someone with hypoelastic expertise verify whether these terms are correct? The idir == 1 and idir == 3 blocks may have similar patterns worth checking.
cc @mrodrig6