Skip to content

THINC/MTHINC: int_comp incompatible with viscosity and surface tension (reconstruction split silently disables compression) #1396

@sbryngelson

Description

@sbryngelson

Summary

When int_comp > 0 is combined with viscous = T or surface_tension = T, interface compression is silently disabled — no error, no warning, no sharpening.

Root cause

In m_rhs.fpp, the reconstruction path splits into multiple s_reconstruct_cell_boundary_values calls with disjoint variable index ranges when viscosity or surface tension is enabled:

# Viscous case (Re_size > 0):
call s_reconstruct(vf(1 : cont%end), ...)       ! partial densities only
call s_reconstruct(vf(E   : sys_size), ...)      ! energy + adv (volume fractions)

# Surface tension case:
call s_reconstruct(vf(1   : E-1), ...)           ! cont + mom
call s_reconstruct_first_order(vf(E), ...)       ! energy
call s_reconstruct(vf(E+1 : sys_size), ...)      ! adv (volume fractions)

Inside s_weno and s_muscl, compression is guarded by:

if (int_comp > 0 .and. v_size >= eqn_idx%adv%end) then
    call s_thinc_compression(...)
end if

v_size = ubound(v_vf, 1) for the current slice. In the split paths, no single slice contains both cont (needed for density ratios) and adv (volume fractions), so v_size >= eqn_idx%adv%end is never true and compression never fires.

Current mitigation (merged in PR #1303)

check_interface_compression in toolchain/mfc/case_validator.py now prohibits these combinations explicitly:

self.prohibit(int_comp != 0 and viscous,
    "int_comp > 0 is not supported with viscosity (reconstruction is split; compression would be silently skipped)")
self.prohibit(int_comp != 0 and surface_tension,
    "int_comp > 0 is not supported with surface tension (reconstruction is split; compression would be silently skipped)")

This turns a silent wrong result into a clear error at validation time.

What full support would require

To actually support int_comp with viscosity or surface tension, the reconstruction in m_rhs would need to be restructured so that cont and adv variables are always reconstructed together in a single WENO/MUSCL call when int_comp > 0, allowing s_thinc_compression to access both sets of variables at once. This is non-trivial and warrants its own PR.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working or doesn't seem rightsimulation

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