waves: Split mean flow from wave perturbation modelling

In order to increase the flexibility of the wave library, the mean flow
handling has been removed from the waveSuperposition class. This makes
waveSuperposition work purely in terms of perturbations to a mean
background flow.

The input has also been split, with waves now defined as region-wide
settings in constant/waveProperties. The mean flow parameters are sill
defined by the boundary conditions.

The new format of the velocity boundary is much simpler. Only a mean
flow velocity is required.

    In 0/U:

        boundaryField
        {
            inlet
            {
                type            waveVelocity;
                UMean           (2 0 0);
            }
            // etc ...
        }

Other wave boundary conditions have not changed.

The constant/waveProperties file contains the wave model selections and
the settings to define the associated coordinate system and scaling
functions:

    In constant/waveProperties:

        origin          (0 0 0);
        direction       (1 0 0);
        waves
        (
            Airy
            {
                length      300;
                amplitude   2.5;
                phase       0;
                angle       0;
            }
        );
        scale           table ((1200 1) (1800 0));
        crossScale      constant 1;

setWaves has been changed to use a system/setWavesDict file rather than
relying on command-line arguments. It also now requires a mean velocity
to be specified in order to prevent ambiguities associated with multiple
inlet patches. An example is shown below:

    In system/setWavesDict:

        alpha   alpha.water;
        U       U;
        liquid  true;
        UMean   (1 0 0);
This commit is contained in:
Will Bainbridge
2018-12-06 12:05:07 +00:00
parent bd2f275e09
commit 967edc9425
25 changed files with 490 additions and 473 deletions

View File

@ -29,20 +29,7 @@ boundaryField
inlet
{
type waveVelocity;
origin (0 0 0.244);
direction (-1 0 0);
speed $UMean;
waves
(
Stokes2
{
length 3;
amplitude 0.04;
phase 0;
angle 0;
}
);
scale table ((4 1) (12 0));
UMean (#neg $UMean 0 0);
}
outlet

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object waveProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
origin (0 0 0.244);
direction (-1 0 0);
waves
(
Stokes2
{
length 3;
amplitude 0.04;
phase 0;
angle 0;
}
);
scale table ((4 1) (12 0));
// ************************************************************************* //

View File

@ -0,0 +1,27 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setWavesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
U.orig
{
#include "$FOAM_CASE/0/U.orig";
}
alpha alpha.water;
UMean $U.orig.boundaryField.inlet.UMean;
// ************************************************************************* //

View File

@ -17,7 +17,7 @@ FoamFile
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
internalField uniform (2 0 0);
boundaryField
{
@ -26,21 +26,7 @@ boundaryField
left
{
type waveVelocity;
origin (0 0 0);
direction (1 0 0);
speed 2;
waves
(
Airy
{
length 300;
amplitude 2.5;
phase 0;
angle 0;
}
);
scale table ((1200 1) (1800 0));
crossScale constant 1;
UMean (2 0 0);
}
right
{

View File

@ -0,0 +1,38 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object waveProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
origin (0 0 0);
direction (1 0 0);
waves
(
Airy
{
length 300;
amplitude 2.5;
phase 0;
angle 0;
}
);
scale table ((1200 1) (1800 0));
crossScale constant 1;
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setWavesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
alpha alpha.water;
UMean (2 0 0);
// ************************************************************************* //