CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Non-planar initial free surface with setFields (http://www.cfd-online.com/Forums/openfoam-pre-processing/119466-non-planar-initial-free-surface-setfields.html)

roenby June 18, 2013 04:29

Non-planar initial free surface with setFields
 
2 Attachment(s)
I want to share a problem I've had and its solution:

I am running interFoam in a 3D wave tank, initially setting the water surface to be completely planar at y=0 using setFields, e.g. with a system/setFieldsDict containing:

boxToCell
{
box (-1e10 -1e10 -1e10) (1e10 0 1e10);

fieldValues
(
volScalarFieldValue alpha1 1
);
}

I have noted that this sometimes gives rise to small holes in the initial horizontal surface like the ones shown in the first attached picture.

The explanation is that my blockMesh generated mesh has cells with centres lying just around y=0 plus/minus round-off errors.

The rings in the water set up by these holes can make the solver run very slow initially.

The obvious solution is to replace the line:

box (-1e10 -1e10 -1e10) (1e10 0 1e10);

in system/setFieldsDict with something like:

box (-1e10 -1e10 -1e10) (1e10 0.00001 1e10);

(Depending on your grid resolution, of course) which for me resultet in the completely planar initial free surface shown in the 2nd attached picture.

Hope this is useful to others as well.

Johan


All times are GMT -4. The time now is 17:30.