Bug in wave absorption for interFoam
Summary
There seems to be a bug in the active wave absorption at the wave generation patch in interFoam.
Steps to reproduce
Modify one of the waves tutorials (I tested with Cnoidal) to a shorter domain (to speed up the simulation) and a fully reflective outlet (wall) to have large reflected waves propagating back to the inlet.
./0.orig/U:
outlet
{
type fixedValue;
value uniform (0 0 0);
}
./system/blockMeshDict
vertices
(
( 0.0 0.0 0.0)
( 3.0 0.0 0.0)
( 3.0 0.04 0.0)
( 0.0 0.04 0.0)
( 0.0 0.0 0.7)
( 3.0 0.0 0.7)
( 3.0 0.04 0.7)
( 0.0 0.04 0.7)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (75 1 70) simpleGrading (1 1 1)
);
Run the case and it will crash at 11.2949 s due to large velocities and volume fractions larger than 1.
What is the current bug behaviour?
The reflected wave is not fully absorbed at the wave generation patch when the activeLevel[paddlei] is higher than the calculatedLevel[paddlei] (positive reflected wave). There seems to be an incompatibility in volume fraction between the values on the inlet patch and the values in the first rows of cells next to it. You can clearly see this at t = 10.989 s (use layout001.pvsm in which the inlet patch values are shown next to the internal field values of the volume fraction)
What is the expected correct behavior?
The volume fraction (alpha.water) must be set to 1 (or zero gradient) in between the activeLevel[paddlei] and the calculatedLevel[paddlei] instead of 0. Then you have a volume fraction equal to 1 between the bottom of the domain and the activeLevel[paddlei]. This makes sense as the correction velocity UCorr is also set between the bottom of the domain and the activeLevel[paddlei], see $FOAM_SRC/waveModels/waveModel/waveModel.C (line 379-400)
if (activeAbsorption_)
{
const scalarField activeLevel(this->waterLevel());
forAll(U_, facei)
{
const label paddlei = faceToPaddle_[facei];
if (zMin_[facei] - zMin0_ < activeLevel[paddlei])
{
scalar UCorr =
(calculatedLevel[paddlei] - activeLevel[paddlei])
*sqrt(mag(g_)/activeLevel[paddlei]);
U_[facei].x() += UCorr;
}
else
{
U_[facei].x() = 0;
}
}
}
This has also been published in https://doi.org/10.1016/j.coastaleng.2012.07.002 Higuera__Lara__Losada_-2013-_Realistic_wave_generation_and_active_wave_absorption_for_Navier-Stokes_models._Application_to_OpenFOAM.pdf
Environment information
OpenFOAM-v2206
Possible fixes
Change the boundary condition for the volume fraction between the activeLevel[paddlei] and the calculatedLevel[paddlei].