ENH: Added new Grimshaw and McCowan wave models - initial commit for

integration
This commit is contained in:
Gabriel Barajas 2017-06-02 09:47:31 +01:00 committed by Andrew Heather
parent 361398a64a
commit 0f230ba35b
35 changed files with 2500 additions and 0 deletions

View File

@ -6,6 +6,8 @@ waveGenerationModels/base/regularWaveModel/regularWaveModel.C
waveGenerationModels/base/solitaryWaveModel/solitaryWaveModel.C
waveGenerationModels/derived/Boussinesq/BoussinesqWaveModel.C
waveGenerationModels/derived/cnoidal/cnoidalWaveModel.C
waveGenerationModels/derived/Grimshaw/GrimshawWaveModel.C
waveGenerationModels/derived/McCowan/McCowanWaveModel.C
waveGenerationModels/derived/StokesII/StokesIIWaveModel.C
waveGenerationModels/derived/StokesI/StokesIWaveModel.C
waveGenerationModels/derived/StokesV/StokesVWaveModel.C

View File

@ -0,0 +1,282 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015 IH-Cantabria
-------------------------------------------------------------------------------
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 "GrimshawWaveModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace waveModels
{
defineTypeNameAndDebug(Grimshaw, 0);
addToRunTimeSelectionTable
(
waveModel,
Grimshaw,
patch
);
}
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
Foam::scalar Foam::waveModels::Grimshaw::alfa
(
const scalar H,
const scalar h
) const
{
scalar eps = H/h;
scalar alfa = sqrt(0.75*eps)*(1.0 - (5.0/8.0)*eps + (71.0/128.0)*eps*eps);
return alfa;
}
//- Wave height
Foam::scalar Foam::waveModels::Grimshaw::eta
(
const scalar H,
const scalar h,
const scalar x,
const scalar y,
const scalar theta,
const scalar t,
const scalar X0
) const
{
scalar eps = H/h;
scalar C = sqrt(mag(g_)*h)*sqrt(1.0+eps-(1.0/20.0)*eps*eps-(3.0/70.0)*eps*eps*eps);
scalar ts = 3.5*h/sqrt(H/h);
scalar xa = -C*t + ts - X0 + x*cos(theta) + y*sin(theta);
scalar alfa = this->alfa(H, h);
scalar s = (1.0)/(cosh(alfa*(xa/h)));
scalar q = tanh(alfa*(xa/h));
return h*(eps*s*s - 0.75*eps*eps*s*s*q*q + eps*eps*eps*((5.0/8.0)*s*s*q*q - (101.0/80.0)*s*s*s*s*q*q));
}
//- Wave velocity
Foam::vector Foam::waveModels::Grimshaw::U
(
const scalar H,
const scalar h,
const scalar x,
const scalar y,
const scalar theta,
const scalar t,
const scalar X0,
const scalar z
) const
{
scalar eps = H/h;
scalar C = sqrt(mag(g_)*h)*sqrt(1.0+eps-(1.0/20.0)*eps*eps-(3.0/70.0)*eps*eps*eps);
scalar ts = 3.5*h/sqrt(H/h);
scalar xa = -C*t + ts - X0 + x*cos(theta) + y*sin(theta);
scalar alfa = this->alfa(H, h);
scalar s = (1.0)/(cosh(alfa*(xa/h)));
scalar outa = eps*s*s - eps*eps*(-(1.0/4.0)*s*s + s*s*s*s + ((z/h)*(z/h))*((3.0/2.0)*s*s - (9.0/4.0)*s*s*s*s));
scalar outb = (19.0/40.0)*s*s + (1.0/5.0)*s*s*s*s - (6.0/5.0)*s*s*s*s*s*s;
scalar outc = ((z/h)*(z/h)) * ( -(3.0/2.0)*s*s - (15.0/4.0)*s*s*s*s + (15.0/2.0)*s*s*s*s*s*s);
scalar outd = ((z/h)*(z/h)*(z/h)*(z/h)) * ((-3.0/8.0)*s*s + (45.0/16.0)*s*s*s*s - (45.0/16.0)*s*s*s*s*s*s);
scalar u = sqrt(mag(g_)*h)*(outa - eps*eps*eps*(outb+outc+outd));
outa = eps*s*s - eps*eps*((3.0/8.0)*s*s + 2.0*s*s*s*s + ((z/h)*(z/h))*(0.5*s*s - (3.0/2.0)*s*s*s*s));
outb = (49.0/640.0)*s*s - (17.0/20.0)*s*s*s*s - (18.0/5.0)*s*s*s*s*s*s;
outc = ((z/h)*(z/h)) * ((-13.0/16.0)*s*s -(25.0/16.0)*s*s*s*s + (15.0/2.0)*s*s*s*s*s*s);
outd = ((z/h)*(z/h)*(z/h)*(z/h)) * ((-3.0/40.0)*s*s -(9.0/8.0)*s*s*s*s - (27.0/16.0)*s*s*s*s*s*s);
scalar w = sqrt(mag(g_)*h)*(outa - eps*eps*eps*(outb+outc+outd));
scalar v = u*sin(waveAngle_);
u *= cos(waveAngle_);
return vector(u, v, w);
}
void Foam::waveModels::Grimshaw::setLevel
(
const scalar t,
const scalar tCoeff,
scalarField& level
) const
{
forAll(level, paddlei)
{
const scalar eta =
this->eta
(
waveHeight_,
waterDepthRef_,
xPaddle_[paddlei],
yPaddle_[paddlei],
waveAngle_,
t,
x0_
);
level[paddlei] = waterDepthRef_ + tCoeff*eta;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::waveModels::Grimshaw::Grimshaw
(
const dictionary& dict,
const fvMesh& mesh,
const polyPatch& patch,
const bool readFields
)
:
solitaryWaveModel(dict, mesh, patch, false)
{
if (readFields)
{
read(dict);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::waveModels::Grimshaw::~Grimshaw()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::waveModels::Grimshaw::read(const dictionary& overrideDict)
{
if (solitaryWaveModel::read(overrideDict))
{
return true;
}
return false;
}
void Foam::waveModels::Grimshaw::setVelocity
(
const scalar t,
const scalar tCoeff,
const scalarField& level,
const scalar tg
)
{
forAll(U_, facei)
{
// Fraction of geometry represented by paddle - to be set
scalar fraction = 1;
// Height - to be set
scalar z = 0;
setPaddlePropeties(level, facei, fraction, z);
if (fraction > 0)
{
if ( (tg<0) || (t >= tg) )
{
const label paddlei = faceToPaddle_[facei];
const vector Uf = U
(
waveHeight_,
waterDepthRef_,
xPaddle_[paddlei],
yPaddle_[paddlei],
waveAngle_,
t,
x0_,
z
);
U_[facei] = fraction*Uf*tCoeff + fraction*UCurrent_;
}
else if ( tg>=t )
{
U_[facei] = fraction*UCurrent_;
}
}
}
}
void Foam::waveModels::Grimshaw::setVelocityAbsorption
(
const scalarField& calculatedLevel,
const scalarField& activeLevel
)
{
forAll(U_, facei)
{
const label paddlei = faceToPaddle_[facei];
scalar activeLevelMBL=activeLevel[paddlei];
scalar zMin = zMin_[facei];
//------ not needed anymore in new release
if (fabs(zMinGb_)>1.0e-3)
{
zMin = zMin - zMinGb_;
}
//------
if (zMin < activeLevelMBL)
{
scalar UCorr =
(calculatedLevel[paddlei] - activeLevel[paddlei])
*sqrt(mag(g_)/activeLevel[paddlei]);
U_[facei].x() += UCorr;
}
else
{
U_[facei].x() = 0;
}
}
}
void Foam::waveModels::Grimshaw::info(Ostream& os) const
{
solitaryWaveModel::info(os);
}
// ************************************************************************* //

View File

@ -0,0 +1,154 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015 IH-Cantabria
-------------------------------------------------------------------------------
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/>.
Class
Foam::waveModels::Grimshaw
Description
Grimshaw wave model
\*---------------------------------------------------------------------------*/
#ifndef waveModels_Grimshaw_H
#define waveModels_Grimshaw_H
#include "solitaryWaveModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace waveModels
{
/*---------------------------------------------------------------------------*\
Class Grimshaw Declaration
\*---------------------------------------------------------------------------*/
class Grimshaw
:
public solitaryWaveModel
{
protected:
// Protected Member Functions
//- Wave height
virtual scalar eta
(
const scalar H,
const scalar h,
const scalar x,
const scalar y,
const scalar theta,
const scalar t,
const scalar X0
) const;
//-
virtual scalar alfa
(
const scalar H,
const scalar h
) const;
//- Wave velocity
virtual vector U
(
const scalar H,
const scalar h,
const scalar x,
const scalar y,
const scalar theta,
const scalar t,
const scalar X0,
const scalar z
) const;
//- Set the water level
virtual void setLevel
(
const scalar t,
const scalar tCoeff,
scalarField& level
) const;
//- Calculate the wave model velocity
virtual void setVelocity
(
const scalar t,
const scalar tCoeff,
const scalarField& level,
const scalar tg
);
// Add current absorption to velocity
virtual void setCurrent
(
const scalarField& levelMBO
);
//- Calculate the wave model velocity absorption
virtual void setVelocityAbsorption
(
const scalarField& calculatedLevel,
const scalarField& activeLevel
);
public:
//- Runtime type information
TypeName("Grimshaw");
//- Constructor
Grimshaw
(
const dictionary& dict,
const fvMesh& mesh,
const polyPatch& patch,
const bool readFields = true
);
//- Destructor
virtual ~Grimshaw();
// Public Member Functions
//- Read from dictionary
virtual bool read(const dictionary& overrideDict);
//- Info
virtual void info(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace waveModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,408 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015 IH-Cantabria
-------------------------------------------------------------------------------
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 "McCowanWaveModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace waveModels
{
defineTypeNameAndDebug(McCowan, 0);
addToRunTimeSelectionTable
(
waveModel,
McCowan,
patch
);
}
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
Foam::scalar Foam::waveModels::McCowan::eta
(
const scalar H,
const scalar h,
const scalar x,
const scalar y,
const scalar theta,
const scalar t,
const scalar X0
) const
{
vector vec = this->mn(H,h);
scalar mm = vec[0];
scalar nn = vec[1];
scalar C = sqrt(((mag(g_)*h)/mm)*tan(mm));
scalar ts = 3.5*h/sqrt(H/h);
scalar Xa = -C*t + ts - X0 + x*cos(theta) + y*sin(theta);
scalar xin = 0.5*H;
scalar etas = newtonRapsonF2(xin,H,h,Xa,mm,nn);
return etas;
}
Foam::vector Foam::waveModels::McCowan::mn
(
const scalar H,
const scalar h
) const
{
//m
scalar xin = 1.0;
scalar m = newtonRapsonF1(xin,H,h);
//n
scalar c1=sin(m+(1.0+((2.0*H)/(3.0*h))));
scalar n = (2.0/3.0)*pow(c1,2);
scalar aux=n;
return vector(m, n, aux);
}
Foam::scalar Foam::waveModels::McCowan::newtonRapsonF1
(
const scalar x0,
const scalar H,
const scalar h
) const
{
scalar N=10000;
scalar eps=1.e-5;
scalar maxval = 10000.0;
scalar xn=0;
scalar x=0;
scalar c1=0;
scalar c2=0;
scalar c3=0;
scalar fx=0;
scalar fprime=0;
scalar fxn=0;
scalar fxx=0;
//define value for divergence
scalar xx=x0;
while (N>0)
{
//f
c1=sin(xx+(1.0+((2.0*H)/(3.0*h))));
fx = (2.0/3.0)*pow(c1,2) - (xx*H)/(h*tan(0.5*xx*(1.0+(H/h))));
//fprime
c2=1/tan(0.5*xx*(h/H + 1.0));
c3=1/sin(0.5*xx*(H/h + 1.0));
fprime=(4.0/3.0)*sin((2.0*H)/(3.0*h) + xx + 1.0)*cos((2.0*H)/(3.0*h) + xx + 1.0)-(h*c2)/H - (0.5*h*xx*(H/h + 1.0)*pow(c3,2))/h;
xn = xx-fx/fprime;
c1=sin(xn+(1.0+((2.0*H)/(3.0*h))));
fxn = (2.0/3.0)*pow(c1,2) - (xn*H)/(h*tan(0.5*xn*(1.0+(H/h))));
if (fabs(fxn)<eps)
{
x=xn;
return x;
}
c1=sin(xx+(1.0+((2.0*H)/(3.0*h))));
fxx = (2.0/3.0)*pow(c1,2) - (xx*H)/(h*tan(0.5*xx*(1.0+(H/h))));
if (fabs(fxx)>maxval)
{
FatalIOErrorInFunction(*this)
<< "fxx > maxval !!!"
<< exit(FatalIOError);
}
N = N - 1;
xx = xn;
}
return x;
}
Foam::scalar Foam::waveModels::McCowan::newtonRapsonF2
(
const scalar x0,
const scalar H,
const scalar h,
const scalar xa,
const scalar m,
const scalar n
) const
{
scalar N=10000;
scalar eps=1.e-5;
scalar maxval = 10000.0;
scalar xn=0;
scalar x=0;
scalar c2=0;
scalar c3=0;
scalar fx=0;
scalar fprime=0;
scalar fxn=0;
scalar fxx=0;
//define value for divergence
scalar xx=x0;
while (N>0)
{
//f
fx = xx-(h*(n/m)*((sin(m*(1.0+(xx/h))))/(cos(m*(1.0+(xx/h)))+cosh(m*(xa/h)))));
//fprime
c2=sin((m*(h + x))/h);
c3=cosh((xa*m)/h) + cos((m*(h + x))/h);
fprime = 1 - (n*cos((m*(h + x))/h))/(cosh((xa*m)/h) + cos((m*(h + x))/h)) - (n*pow(c2,2))/(pow(c3,2));
xn = xx-fx/fprime;
fxn = xn-(h*(n/m)*((sin(m*(1.0+(xn/h))))/(cos(m*(1.0+(xn/h)))+cosh(m*(xa/h)))));
if (fabs(fxn)<eps)
{
x=xn;
return x;
}
fxx = xx-(h*(n/m)*((sin(m*(1.0+(xx/h))))/(cos(m*(1.0+(xx/h)))+cosh(m*(xa/h)))));
if (fabs(fxx)>maxval)
{
FatalIOErrorInFunction(*this)
<< "fxx > maxval !!!"
<< exit(FatalIOError);
}
N = N - 1;
xx = xn;
}
return x;
}
Foam::vector Foam::waveModels::McCowan::U
(
const scalar H,
const scalar h,
const scalar x,
const scalar y,
const scalar theta,
const scalar t,
const scalar X0,
const scalar z
) const
{
vector vec = this->mn(H,h);
scalar mm = vec[0];
scalar nn = vec[1];
scalar C = sqrt(((mag(g_)*h)/mm)*tan(mm));
scalar ts = 3.5*h/sqrt(H/h);
scalar Xa = -C*t + ts - X0 + x*cos(theta) + y*sin(theta);
scalar outa = C*nn*(1.0+cos(mm*(z/h))*cosh(mm*(Xa/h)));
scalar outb = (cos(mm*(z/h))+cosh(mm*(Xa/h))) * (cos(mm*(z/h))+cosh(mm*(Xa/h)));
scalar u = outa/outb;
outa = C*nn*(sin(mm*(z/h))*sinh(mm*(Xa/h)));
outb = (cos(mm*(z/h))+cosh(mm*(Xa/h))) * (cos(mm*(z/h))+cosh(mm*(Xa/h)));
scalar w = outa/outb;
scalar v = u*sin(waveAngle_);
u *= cos(waveAngle_);
return vector(u, v, w);
}
void Foam::waveModels::McCowan::setLevel
(
const scalar t,
const scalar tCoeff,
scalarField& level
) const
{
forAll(level, paddlei)
{
const scalar eta =
this->eta
(
waveHeight_,
waterDepthRef_,
xPaddle_[paddlei],
yPaddle_[paddlei],
waveAngle_,
t,
x0_
);
level[paddlei] = waterDepthRef_ + tCoeff*eta;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::waveModels::McCowan::McCowan
(
const dictionary& dict,
const fvMesh& mesh,
const polyPatch& patch,
const bool readFields
)
:
solitaryWaveModel(dict, mesh, patch, false)
{
if (readFields)
{
read(dict);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::waveModels::McCowan::~McCowan()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::waveModels::McCowan::read(const dictionary& overrideDict)
{
if (solitaryWaveModel::read(overrideDict))
{
return true;
}
return false;
}
void Foam::waveModels::McCowan::setVelocity
(
const scalar t,
const scalar tCoeff,
const scalarField& level,
const scalar tg
)
{
forAll(U_, facei)
{
// Fraction of geometry represented by paddle - to be set
scalar fraction = 1;
// Height - to be set
scalar z = 0;
setPaddlePropeties(level, facei, fraction, z);
if (fraction > 0)
{
if ( (tg<0) || (t >= tg) )
{
const label paddlei = faceToPaddle_[facei];
const vector Uf = U
(
waveHeight_,
waterDepthRef_,
xPaddle_[paddlei],
yPaddle_[paddlei],
waveAngle_,
t,
x0_,
z
);
U_[facei] = fraction*Uf*tCoeff + fraction*UCurrent_;
}
else if ( tg>=t )
{
U_[facei] = fraction*UCurrent_;
}
}
}
}
void Foam::waveModels::McCowan::setVelocityAbsorption
(
const scalarField& calculatedLevel,
const scalarField& activeLevel
)
{
forAll(U_, facei)
{
const label paddlei = faceToPaddle_[facei];
scalar activeLevelMBL=activeLevel[paddlei];
scalar zMin = zMin_[facei];
//------ not needed anymore in new release
if (fabs(zMinGb_)>1.0e-3)
{
zMin = zMin - zMinGb_;
}
//------
if (zMin < activeLevelMBL)
{
scalar UCorr =
(calculatedLevel[paddlei] - activeLevel[paddlei])
*sqrt(mag(g_)/activeLevel[paddlei]);
U_[facei].x() += UCorr;
}
else
{
U_[facei].x() = 0;
}
}
}
void Foam::waveModels::McCowan::setCurrent
(
const scalarField& levelMBO
)
{
//No needed for generation
}
void Foam::waveModels::McCowan::info(Ostream& os) const
{
solitaryWaveModel::info(os);
}
// ************************************************************************* //

View File

@ -0,0 +1,170 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015 IH-Cantabria
-------------------------------------------------------------------------------
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/>.
Class
Foam::waveModels::McCowan
Description
McCowan wave model
\*---------------------------------------------------------------------------*/
#ifndef waveModels_McCowan_H
#define waveModels_McCowan_H
#include "solitaryWaveModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace waveModels
{
/*---------------------------------------------------------------------------*\
Class McCowan Declaration
\*---------------------------------------------------------------------------*/
class McCowan
:
public solitaryWaveModel
{
protected:
// Protected Member Functions
//- Wave height
virtual scalar eta
(
const scalar H,
const scalar h,
const scalar x,
const scalar y,
const scalar theta,
const scalar t,
const scalar X0
) const;
virtual vector mn
(
const scalar H,
const scalar h
) const;
virtual scalar newtonRapsonF1
(
const scalar x0,
const scalar H,
const scalar h
) const;
virtual scalar newtonRapsonF2
(
const scalar x0,
const scalar H,
const scalar h,
const scalar xa,
const scalar m,
const scalar n
) const;
//- Wave velocity
virtual vector U
(
const scalar H,
const scalar h,
const scalar x,
const scalar y,
const scalar theta,
const scalar t,
const scalar X0,
const scalar z
) const;
//- Set the water level
virtual void setLevel
(
const scalar t,
const scalar tCoeff,
scalarField& level
) const;
//- Calculate the wave model velocity
virtual void setVelocity
(
const scalar t,
const scalar tCoeff,
const scalarField& level,
const scalar tg
);
// Add current absorption to velocity
virtual void setCurrent
(
const scalarField& levelMBO
);
//- Calculate the wave model velocity absorption
virtual void setVelocityAbsorption
(
const scalarField& calculatedLevel,
const scalarField& activeLevel
);
public:
//- Runtime type information
TypeName("McCowan");
//- Constructor
McCowan
(
const dictionary& dict,
const fvMesh& mesh,
const polyPatch& patch,
const bool readFields = true
);
//- Destructor
virtual ~McCowan();
// Public Member Functions
//- Read from dictionary
virtual bool read(const dictionary& overrideDict);
//- Info
virtual void info(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace waveModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.x |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
left
{
type waveVelocity;
value uniform (0 0 0);
}
right
{
type waveVelocity;
value uniform (0 0 0);
}
sides
{
type slip;
}
ground
{
type noSlip;
}
top
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5-dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
left
{
type waveAlpha;
value uniform 0;
}
right
{
type zeroGradient;
}
ground
{
type zeroGradient;
}
sides
{
type zeroGradient;
}
top
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5-dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
left
{
type fixedFluxPressure;
value uniform 0;
}
right
{
type fixedFluxPressure;
value uniform 0;
}
ground
{
type fixedFluxPressure;
value uniform 0;
}
sides
{
type slip;
}
top
{
type totalPressure;
U U;
phi rhoPhi;
rho rho;
psi none;
gamma 1;
p0 uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,10 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
rm -rf 0
cleanCase

View File

@ -0,0 +1,15 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
restore0Dir
runApplication blockMesh
runApplication decomposePar
runParallel setFields
runParallel $(getApplication)

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 0 -9.81 );
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.3 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phases (water air);
water
{
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1e-06;
rho [1 -3 0 0 0 0 0] 1000;
}
air
{
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1.48e-05;
rho [1 -3 0 0 0 0 0] 1;
}
sigma [1 0 -2 0 0 0 0] 0.07;
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: http://www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object wavesProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
left
{
alpha alpha.water;
waveModel Grimshaw;
nPaddle 1;
waveHeight 0.05;
waveAngle 0.0;
activeAbsorption no;
}
right
{
alpha alpha.water;
waveModel shallowWaterAbsorption;
nPaddle 1;
}
// ************************************************************************* //

View File

@ -0,0 +1,89 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
( 0.0 0.0 0.0)
( 7.0 0.0 0.0)
( 7.0 0.55 0.0)
( 0.0 0.55 0.0)
( 0.0 0.0 0.5)
( 7.0 0.0 0.5)
( 7.0 0.55 0.5)
( 0.0 0.55 0.5)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (350 28 42) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
left
{
type patch;
faces
(
(0 4 7 3)
);
}
right
{
type patch;
faces
(
(1 5 6 2)
);
}
ground
{
type wall;
faces
(
(0 1 2 3)
);
}
top
{
type patch;
faces
(
(4 5 6 7)
);
}
sides
{
type patch;
faces
(
(0 1 5 4)
(3 2 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,143 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 7.0;
deltaT 0.1;
writeControl adjustableRunTime;
writeInterval 0.1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep on;
maxCo 0.4;
maxAlphaCo 0.4;
maxDeltaT 0.01;
functions
{
//Sensores VOF
line
{
type sets;
functionObjectLibs ("libsampling.so");
enabled true;
outputControl writeTime;
outputInterval 1;
interpolationScheme cellPoint;
setFormat raw;
sets
(
s1
{
type uniform;
axis distance;
start ( 0.865 0.275 0.0 );
end ( 0.865 0.275 0.5 );
nPoints 101;
}
s2
{
type uniform;
axis distance;
start ( 1.065 0.275 0.0 );
end ( 1.065 0.275 0.5 );
nPoints 101;
}
s3
{
type uniform;
axis distance;
start ( 4.1 0.275 0.0 );
end ( 4.1 0.275 0.5 );
nPoints 101;
}
s4
{
type uniform;
axis distance;
start ( 4.645 0.275 0.0 );
end ( 4.645 0.275 0.5 );
nPoints 101;
}
s5
{
type uniform;
axis distance;
start ( 5.2 0.275 0.0 );
end ( 5.2 0.275 0.5 );
nPoints 101;
}
s6
{
type uniform;
axis distance;
start ( 5.85 0.275 0.0 );
end ( 5.85 0.275 0.5 );
nPoints 101;
}
s7
{
type uniform;
axis distance;
start ( 6.15 0.275 0.0 );
end ( 6.15 0.275 0.5 );
nPoints 101;
}
);
fixedLocations false;
fields
(
alpha.water
);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,29 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 2;
method hierarchical;
hierarchicalCoeffs
{
n (2 1 1);
delta 0.001;
order xyz;
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
div(rhoPhi,U) Gauss linearUpwind grad(U);
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear orthogonal;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default orthogonal;
}
// ************************************************************************* //

View File

@ -0,0 +1,78 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"alpha.water.*"
{
nAlphaCorr 1;
nAlphaSubCycles 3;
cAlpha 1;
}
pcorr
{
solver PCG;
preconditioner DIC;
tolerance 1e-6;
relTol 0;
}
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-6;
relTol 0.1;
}
p_rghFinal
{
solver GAMG;
smoother DIC;
tolerance 1e-7;
relTol 0;
}
U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0.1;
}
UFinal
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0;
}
}
PIMPLE
{
momentumPredictor no;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue alpha.water 0
volVectorFieldValue U (0 0 0)
);
regions
(
boxToCell
{
box (-10 -10 -10) (100 100 0.15);
fieldValues
(
volScalarFieldValue alpha.water 1
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.x |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
left
{
type waveVelocity;
value uniform (0 0 0);
}
right
{
type waveVelocity;
value uniform (0 0 0);
}
sides
{
type slip;
}
ground
{
type noSlip;
}
top
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5-dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
left
{
type waveAlpha;
value uniform 0;
}
right
{
type zeroGradient;
}
ground
{
type zeroGradient;
}
sides
{
type zeroGradient;
}
top
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5-dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
left
{
type fixedFluxPressure;
value uniform 0;
}
right
{
type fixedFluxPressure;
value uniform 0;
}
ground
{
type fixedFluxPressure;
value uniform 0;
}
sides
{
type slip;
}
top
{
type totalPressure;
U U;
phi rhoPhi;
rho rho;
psi none;
gamma 1;
p0 uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,10 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
rm -rf 0
cleanCase

View File

@ -0,0 +1,15 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
restore0Dir
runApplication blockMesh
runApplication decomposePar
runParallel setFields
runParallel $(getApplication)

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 0 -9.81 );
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.3 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phases (water air);
water
{
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1e-06;
rho [1 -3 0 0 0 0 0] 1000;
}
air
{
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1.48e-05;
rho [1 -3 0 0 0 0 0] 1;
}
sigma [1 0 -2 0 0 0 0] 0.07;
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: http://www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object wavesProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
left
{
alpha alpha.water;
waveModel McCowan;
nPaddle 1;
waveHeight 0.05;
waveAngle 0.0;
activeAbsorption yes;
}
right
{
alpha alpha.water;
waveModel shallowWaterAbsorption;
nPaddle 1;
}
// ************************************************************************* //

View File

@ -0,0 +1,89 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
( 0.0 0.0 0.0)
( 7.0 0.0 0.0)
( 7.0 0.55 0.0)
( 0.0 0.55 0.0)
( 0.0 0.0 0.5)
( 7.0 0.0 0.5)
( 7.0 0.55 0.5)
( 0.0 0.55 0.5)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (350 28 42) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
left
{
type patch;
faces
(
(0 4 7 3)
);
}
right
{
type patch;
faces
(
(1 5 6 2)
);
}
ground
{
type wall;
faces
(
(0 1 2 3)
);
}
top
{
type patch;
faces
(
(4 5 6 7)
);
}
sides
{
type patch;
faces
(
(0 1 5 4)
(3 2 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,143 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 7.0;
deltaT 0.1;
writeControl adjustableRunTime;
writeInterval 0.1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep on;
maxCo 0.4;
maxAlphaCo 0.4;
maxDeltaT 0.01;
functions
{
//Sensores VOF
line
{
type sets;
functionObjectLibs ("libsampling.so");
enabled true;
outputControl writeTime;
outputInterval 1;
interpolationScheme cellPoint;
setFormat raw;
sets
(
s1
{
type uniform;
axis distance;
start ( 0.865 0.275 0.0 );
end ( 0.865 0.275 0.5 );
nPoints 101;
}
s2
{
type uniform;
axis distance;
start ( 1.065 0.275 0.0 );
end ( 1.065 0.275 0.5 );
nPoints 101;
}
s3
{
type uniform;
axis distance;
start ( 4.1 0.275 0.0 );
end ( 4.1 0.275 0.5 );
nPoints 101;
}
s4
{
type uniform;
axis distance;
start ( 4.645 0.275 0.0 );
end ( 4.645 0.275 0.5 );
nPoints 101;
}
s5
{
type uniform;
axis distance;
start ( 5.2 0.275 0.0 );
end ( 5.2 0.275 0.5 );
nPoints 101;
}
s6
{
type uniform;
axis distance;
start ( 5.85 0.275 0.0 );
end ( 5.85 0.275 0.5 );
nPoints 101;
}
s7
{
type uniform;
axis distance;
start ( 6.15 0.275 0.0 );
end ( 6.15 0.275 0.5 );
nPoints 101;
}
);
fixedLocations false;
fields
(
alpha.water
);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,29 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 2;
method hierarchical;
hierarchicalCoeffs
{
n (2 1 1);
delta 0.001;
order xyz;
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
div(rhoPhi,U) Gauss linearUpwind grad(U);
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear orthogonal;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default orthogonal;
}
// ************************************************************************* //

View File

@ -0,0 +1,78 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"alpha.water.*"
{
nAlphaCorr 1;
nAlphaSubCycles 3;
cAlpha 1;
}
pcorr
{
solver PCG;
preconditioner DIC;
tolerance 1e-6;
relTol 0;
}
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-6;
relTol 0.1;
}
p_rghFinal
{
solver GAMG;
smoother DIC;
tolerance 1e-7;
relTol 0;
}
U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0.1;
}
UFinal
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0;
}
}
PIMPLE
{
momentumPredictor no;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue alpha.water 0
volVectorFieldValue U (0 0 0)
);
regions
(
boxToCell
{
box (-10 -10 -10) (100 100 0.15);
fieldValues
(
volScalarFieldValue alpha.water 1
);
}
);
// ************************************************************************* //