Skip to content

hyper_cleaning psi initialization only covers z=0 plane in 3D #1221

@sbryngelson

Description

@sbryngelson

Bug

In src/pre_process/m_start_up.fpp lines 789-795, the MHD hyperbolic divergence cleaning psi field initialization hardcodes the third array index to 0:

if (hyper_cleaning) then
    do j = 0, m
        do k = 0, n
            q_cons_vf(psi_idx)%sf(j, k, 0) = 1d-2*exp(-(x_cc(j)**2 + y_cc(k)**2)/(2.0*0.05**2))
            q_prim_vf(psi_idx)%sf(j, k, 0) = q_cons_vf(psi_idx)%sf(j, k, 0)
        end do
    end do
end if

In 3D simulations (p > 0), only the first z-plane gets initialized. All other z-planes keep whatever value they had (zero or garbage), corrupting the divergence cleaning field. Needs an outer do l = 0, p loop with z_cc(l) in the Gaussian exponent.

Fix

PR #1217

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions