This model builds up phase fraction and velocity fields from multiple
first-order waves, sampled from a selectable wave spectrum.
Usage:
Property | Description | Required? | Default
----------+-------------------------------+-----------+-------------
depth | The water depth [m] | no | great
spectrum | The wave spectrum | yes |
n | The number of times to sample | yes |
| the spectrum | |
span | The fractional range across | no | (0.01 0.99)
| which to sample the spectrum | |
setFormat | The format with which to plot | no | none
| the spectrum | |
Example specification in constant/waveProperties:
waves
(
irregular
{
spectrum PiersonMoskowitz; // or JONSWAP
PiersonMoskowitzCoeffs
{
U19_5 15;
}
JONSWAPCoeffs
{
U10 10;
F 200e3;
}
n 16;
span (0.01 0.99);
}
);
64 lines
1.9 KiB
C++
64 lines
1.9 KiB
C++
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration | Website: https://openfoam.org
|
|
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
|
\\/ M anipulation |
|
|
-------------------------------------------------------------------------------
|
|
License
|
|
This file is part of OpenFOAM.
|
|
|
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
#include "waveModel.H"
|
|
|
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
|
|
namespace Foam
|
|
{
|
|
defineTypeNameAndDebug(waveModel, 0);
|
|
defineRunTimeSelectionTable(waveModel, dictionary);
|
|
}
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
|
|
Foam::waveModel::waveModel(const waveModel& wave)
|
|
:
|
|
g_(wave.g_)
|
|
{}
|
|
|
|
|
|
Foam::waveModel::waveModel(const dictionary& dict, const scalar g)
|
|
:
|
|
g_(g)
|
|
{}
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
|
|
Foam::waveModel::~waveModel()
|
|
{}
|
|
|
|
|
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
|
|
void Foam::waveModel::write(Ostream& os) const
|
|
{}
|
|
|
|
|
|
// ************************************************************************* //
|