Skip to content

y-velocity perturbation uses already-modified x-velocity #1222

@sbryngelson

Description

@sbryngelson

Bug

In src/pre_process/m_perturbation.fpp lines 86-87, the x-velocity is modified in place before the y-velocity reads it:

q_prim_vf(mom_idx%beg)%sf(i,j,k) = (1 + r) * vx       ! line 86: x-vel overwritten
q_prim_vf(mom_idx%end)%sf(i,j,k) = r * vx_modified      ! line 87: reads (1+r)*vx instead of vx

The y-velocity perturbation ends up as r * (1+r) * vx_original instead of the intended r * vx_original, introducing an unintended (1+r) coupling factor. The fix is to swap the two lines so y-velocity is computed from the original x-velocity before x-velocity is modified.

Fix

PR #1216

Metadata

Metadata

Assignees

No one assigned

    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