Skip to content

Possible duplicate/canceling terms in hypoelastic stress rate (m_hypoelastic.fpp) #1343

@sbryngelson

Description

@sbryngelson

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-226tau_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-232tau_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-239tau_22 update: q_prim_vf(strxb + 1)%sf * dv_dx_hypo appears twice with the same sign.

Lines 240-241tau_22 update: q_prim_vf(strxb + 2)%sf * dv_dy_hypo appears three times (+, +, -).

Possible explanations

These could be:

  1. Copy-paste errors in the Jaumann/upper-convected derivative expansion
  2. Intentional (some stress rate formulations have symmetric contributions)
  3. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions