Many times in multiphasic simulations (e.g. interFoam) of hydraulic problems, only the results of the water fraction are of interest, but due to poor mesh quality or non-optimal case setups, high velocities develop in the lighter air fraction. These often increase computational times, and might potentially lead to instabilities.
For those cases, I have developed a custom sink term for the momentum equation called airVelocityAttenuation, which is available on GitHub:
https://github.com/nicolasbadano/airVelocityAttenuation
This sink term helps reduce velocities in the air by making momentum dissipate. The rate of dissipation, as well as the volume fraction threshold below which momentum is dissipated can be conveniently changed at runtime.
The dissipation term is implemented implicitly, so it’s really stable.
No explicit compilation is required. Just copy the fvOptions file on the constant directory of the case and edit if needed.
On the attached figure I ran the “weirOverflow” OpenFOAM example with different attenuation rates. Notice how air velocities, which are very noisy in the original case, tend to calm down smoothly.
Disclaimer: always check that modifying the velocities on the air doesn’t actually affect the quality of the “important” results. Most of the times it’s just better to fix the mesh and/or case setup to avoid spurious velocities in the first place.
The sink term has the following expression:
where is the attenuation rate (1/s) and is a function which has a value of zero in the water fraction, and one in the air fraction: