INT: Initial commit of new wave-maker BCs based on mesh motion

waveMakerFlap: creates waves using a flapping motion
waveMakerPiston: creates waves using a piston motion
This commit is contained in:
Gabriel Barajas
2018-11-15 08:29:54 +00:00
committed by Andrew Heather
parent 9abe97bb7b
commit 6e1e854cbc
32 changed files with 2509 additions and 0 deletions

View File

@ -0,0 +1,250 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 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 "waveMakerFlapPointPatchVectorField.H"
#include "mathematicalConstants.H"
#include "pointPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "Time.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::waveMakerFlapPointPatchVectorField::
waveMakerFlapPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF
)
:
fixedValuePointPatchField<vector>(p, iF),
initialDepth_(0.0),
wavePeriod_(0.0),
waveHeigth_(0.0),
waveLength_(0.0),
wavePhase_(0.0),
waveNumber_(0.0),
rampTime_(0.0),
g_(Zero),
secondOrder_(false)
{}
Foam::waveMakerFlapPointPatchVectorField::
waveMakerFlapPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF,
const dictionary& dict
)
:
fixedValuePointPatchField<vector>(p, iF, dict),
initialDepth_(readScalar(dict.lookup("initialDepth"))),
wavePeriod_(readScalar(dict.lookup("wavePeriod"))),
waveHeigth_(readScalar(dict.lookup("waveHeigth"))),
waveLength_(readScalar(dict.lookup("waveLength"))),
wavePhase_(readScalar(dict.lookup("wavePhase"))),
waveNumber_(readScalar(dict.lookup("waveNumber"))),
rampTime_(readScalar(dict.lookup("rampTime"))),
g_(dict.lookup("g")),
secondOrder_(dict.lookupOrDefault<bool>("secondOrder",false))
{
if (!dict.found("value"))
{
updateCoeffs();
}
}
Foam::waveMakerFlapPointPatchVectorField::
waveMakerFlapPointPatchVectorField
(
const waveMakerFlapPointPatchVectorField& ptf,
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF,
const pointPatchFieldMapper& mapper
)
:
fixedValuePointPatchField<vector>(ptf, p, iF, mapper),
initialDepth_(ptf.initialDepth_),
wavePeriod_(ptf.wavePeriod_),
waveHeigth_(ptf.waveHeigth_),
waveLength_(ptf.waveLength_),
wavePhase_(ptf.wavePhase_),
waveNumber_(ptf.waveNumber_),
rampTime_(ptf.rampTime_),
g_(ptf.g_),
secondOrder_(ptf.secondOrder_)
{}
Foam::waveMakerFlapPointPatchVectorField::
waveMakerFlapPointPatchVectorField
(
const waveMakerFlapPointPatchVectorField& ptf,
const DimensionedField<vector, pointMesh>& iF
)
:
fixedValuePointPatchField<vector>(ptf, iF),
initialDepth_(ptf.initialDepth_),
wavePeriod_(ptf.wavePeriod_),
waveHeigth_(ptf.waveHeigth_),
waveLength_(ptf.waveLength_),
wavePhase_(ptf.wavePhase_),
waveNumber_(ptf.waveNumber_),
rampTime_(ptf.rampTime_),
g_(ptf.g_),
secondOrder_(ptf.secondOrder_)
{}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
Foam::scalar Foam::waveMakerFlapPointPatchVectorField::waveLength
(
const scalar h,
const scalar T
)
{
const scalar L0 = mag(g_)*T*T/(constant::mathematical::twoPi);
scalar L = L0;
for(int i=1; i<=100; i++)
{
L = L0*tanh(constant::mathematical::twoPi*h/L);
}
return L;
}
Foam::scalar Foam::waveMakerFlapPointPatchVectorField::timeCoeff
(
const scalar t
) const
{
return max(0, min(t/rampTime_, 1));
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::waveMakerFlapPointPatchVectorField::updateCoeffs()
{
if (this->updated())
{
return;
}
const polyMesh& mesh = this->internalField().mesh()();
const Time& t = mesh.time();
// Time ramp weight
const scalar tCoeff = timeCoeff(t.value());
vectorField localPoints_ = this->patch().localPoints();
vectorField waveBoardMotion_ = 0.0*localPoints_;
waveLength_ = waveLength (initialDepth_, wavePeriod_);
const scalar waveK = constant::mathematical::twoPi/waveLength_;
const scalar sigma_ = (2.0*constant::mathematical::pi) / wavePeriod_;
//First order
if (secondOrder_== false)
{
forAll (localPoints_, labelP)
{
scalar waveBoardStroke_ = (sinh(2.0*waveK*initialDepth_)
+ 2.0*waveK*initialDepth_)
/ (4.0*sinh(waveK*initialDepth_))
* (1.0 / ( sinh(waveK*initialDepth_)
+ (1.0-cosh(waveK*initialDepth_))
/ (waveK*initialDepth_) ) ) * waveHeigth_;
waveBoardMotion_[labelP].component(0) = tCoeff
* (1.0+(localPoints_[labelP].component(2)-initialDepth_)
/ (initialDepth_))*(waveBoardStroke_/2.0)*sin(sigma_*t.value());
}
Field<vector>::operator=
(
waveBoardMotion_
);
}
else if ( secondOrder_ == true)
{
scalar m1_;
forAll (localPoints_, labelP)
{
m1_ = ((4.0*sinh(waveK*initialDepth_))
/ (sinh(2.0*waveK*initialDepth_)+2.0*waveK*initialDepth_))
* ( sinh(waveK*initialDepth_) + 1.0/(waveK*initialDepth_)
* (1.0-cosh(waveK*initialDepth_)));
waveBoardMotion_[labelP].component(0) = waveHeigth_/(2.0*m1_)*sin(sigma_*t.value())
+ pow(waveHeigth_,2)/(16.0*initialDepth_)*(3.0*cosh(waveK*initialDepth_)
/ pow(sinh(waveK*initialDepth_),3) -2.0/m1_)*sin(2.0*sigma_*t.value());
waveBoardMotion_[labelP].component(0) = tCoeff
* (1.0+(localPoints_[labelP].component(2)-initialDepth_)
/ (initialDepth_)) * waveBoardMotion_[labelP].component(0);
}
Field<vector>::operator=
(
waveBoardMotion_
);
}
fixedValuePointPatchField<vector>::updateCoeffs();
}
void Foam::waveMakerFlapPointPatchVectorField::write(Ostream& os) const
{
pointPatchField<vector>::write(os);
os.writeEntry("initialDepth", initialDepth_);
os.writeEntry("wavePeriod", wavePeriod_);
os.writeEntry("waveHeigth", waveHeigth_);
os.writeEntry("waveLength", waveLength_);
os.writeEntry("wavePhase", wavePhase_);
os.writeEntry("waveNumber", waveNumber_);
os.writeEntry("rampTime", rampTime_);
os.writeEntry("g", g_);
os.writeEntry("secondOrder", secondOrder_);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePointPatchTypeField
(
pointPatchVectorField,
waveMakerFlapPointPatchVectorField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,179 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 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/>.
Class
Foam::waveMakerFlapPointPatchVectorField
Description
Foam::waveMakerFlapPointPatchVectorField
SourceFiles
waveMakerFlapPointPatchVectorField.C
\*---------------------------------------------------------------------------*/
#ifndef waveMakerFlapPointPatchVectorField_H
#define waveMakerFlapPointPatchVectorField_H
#include "fixedValuePointPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class waveMakerFlapPointPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class waveMakerFlapPointPatchVectorField
:
public fixedValuePointPatchField<vector>
{
// Private data
//inital water depth
scalar initialDepth_;
//wave period
scalar wavePeriod_;
//wave heigth
scalar waveHeigth_;
//wavelength
scalar waveLength_;
//wave phase
scalar wavePhase_;
//wave number
scalar waveNumber_;
//ramp time
scalar rampTime_;
// gravity vector
vector g_;
//on/off second order generation
scalar secondOrder_;
// Protected Member Functions
// Dispersion equation
virtual scalar waveLength(const scalar h, const scalar T);
//- Return the time scaling coefficient
virtual scalar timeCoeff(const scalar t) const;
public:
//- Runtime type information
TypeName("waveMakerFlap");
// Constructors
//- Construct from patch and internal field
waveMakerFlapPointPatchVectorField
(
const pointPatch&,
const DimensionedField<vector, pointMesh>&
);
//- Construct from patch, internal field and dictionary
waveMakerFlapPointPatchVectorField
(
const pointPatch&,
const DimensionedField<vector, pointMesh>&,
const dictionary&
);
//- Construct by mapping given patchField<vector> onto a new patch
waveMakerFlapPointPatchVectorField
(
const waveMakerFlapPointPatchVectorField&,
const pointPatch&,
const DimensionedField<vector, pointMesh>&,
const pointPatchFieldMapper&
);
//- Construct and return a clone
virtual autoPtr<pointPatchField<vector>> clone() const
{
return autoPtr<pointPatchField<vector>>
(
new waveMakerFlapPointPatchVectorField
(
*this
)
);
}
//- Construct as copy setting internal field reference
waveMakerFlapPointPatchVectorField
(
const waveMakerFlapPointPatchVectorField&,
const DimensionedField<vector, pointMesh>&
);
//- Construct and return a clone setting internal field reference
virtual autoPtr<pointPatchField<vector>> clone
(
const DimensionedField<vector, pointMesh>& iF
) const
{
return autoPtr<pointPatchField<vector>>
(
new waveMakerFlapPointPatchVectorField
(
*this,
iF
)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,238 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 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 "waveMakerPistonPointPatchVectorField.H"
#include "mathematicalConstants.H"
#include "pointPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "Time.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::waveMakerPistonPointPatchVectorField::
waveMakerPistonPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF
)
:
fixedValuePointPatchField<vector>(p, iF),
initialDepth_(0.0),
wavePeriod_(0.0),
waveHeigth_(0.0),
waveLength_(0.0),
wavePhase_(0.0),
waveNumber_(0.0),
rampTime_(0.0),
g_(Zero),
secondOrder_(false)
{}
Foam::waveMakerPistonPointPatchVectorField::
waveMakerPistonPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF,
const dictionary& dict
)
:
fixedValuePointPatchField<vector>(p, iF, dict),
initialDepth_(readScalar(dict.lookup("initialDepth"))),
wavePeriod_(readScalar(dict.lookup("wavePeriod"))),
waveHeigth_(readScalar(dict.lookup("waveHeigth"))),
waveLength_(readScalar(dict.lookup("waveLength"))),
wavePhase_(readScalar(dict.lookup("wavePhase"))),
waveNumber_(readScalar(dict.lookup("waveNumber"))),
rampTime_(readScalar(dict.lookup("rampTime"))),
g_(dict.lookup("g")),
secondOrder_(dict.lookupOrDefault<bool>("secondOrder",false))
{
if (!dict.found("value"))
{
updateCoeffs();
}
}
Foam::waveMakerPistonPointPatchVectorField::
waveMakerPistonPointPatchVectorField
(
const waveMakerPistonPointPatchVectorField& ptf,
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF,
const pointPatchFieldMapper& mapper
)
:
fixedValuePointPatchField<vector>(ptf, p, iF, mapper),
initialDepth_(ptf.initialDepth_),
wavePeriod_(ptf.wavePeriod_),
waveHeigth_(ptf.waveHeigth_),
waveLength_(ptf.waveLength_),
wavePhase_(ptf.wavePhase_),
waveNumber_(ptf.waveNumber_),
rampTime_(ptf.rampTime_),
g_(ptf.g_),
secondOrder_(ptf.secondOrder_)
{}
Foam::waveMakerPistonPointPatchVectorField::
waveMakerPistonPointPatchVectorField
(
const waveMakerPistonPointPatchVectorField& ptf,
const DimensionedField<vector, pointMesh>& iF
)
:
fixedValuePointPatchField<vector>(ptf, iF),
initialDepth_(ptf.initialDepth_),
wavePeriod_(ptf.wavePeriod_),
waveHeigth_(ptf.waveHeigth_),
waveLength_(ptf.waveLength_),
wavePhase_(ptf.wavePhase_),
waveNumber_(ptf.waveNumber_),
rampTime_(ptf.rampTime_),
g_(ptf.g_),
secondOrder_(ptf.secondOrder_)
{}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
Foam::scalar Foam::waveMakerPistonPointPatchVectorField::waveLength
(
const scalar h,
const scalar T
)
{
const scalar L0 = mag(g_)*T*T/(constant::mathematical::twoPi);
scalar L = L0;
for(int i=1; i<=100; i++)
{
L = L0*tanh(constant::mathematical::twoPi*h/L);
}
return L;
}
Foam::scalar Foam::waveMakerPistonPointPatchVectorField::timeCoeff
(
const scalar t
) const
{
return max(0, min(t/rampTime_, 1));
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::waveMakerPistonPointPatchVectorField::updateCoeffs()
{
if (this->updated())
{
return;
}
const polyMesh& mesh = this->internalField().mesh()();
const Time& t = mesh.time();
// Time ramp weight
const scalar tCoeff = timeCoeff(t.value());
vectorField localPoints_ = this->patch().localPoints();
vectorField auxPoints = 0.0*localPoints_;
waveLength_ = waveLength (initialDepth_, wavePeriod_);
const scalar waveK = constant::mathematical::twoPi/waveLength_;
vector waveBoardMotion_(0,0,0);
const scalar sigma_ = (2.0*constant::mathematical::pi) / wavePeriod_;
//first order
if ( secondOrder_ == false)
{
scalar waveBoardStroke_ = (sinh(2.0*waveK*initialDepth_)
+ 2.0*waveK*initialDepth_)
/ (2.0*(cosh(2.0*waveK*initialDepth_)
- 1.0)) * waveHeigth_;
waveBoardMotion_.component(0)= tCoeff*(waveBoardStroke_/2.0)
* sin(sigma_*t.value());
Field<vector>::operator=
(
waveBoardMotion_
);
}
//second order
else if ( secondOrder_ == true)
{
scalar m1_ = (2.0*(cosh(2.0*waveK*initialDepth_)-1.0))
/ (sinh(2.0*waveK*initialDepth_)
+ 2.0*waveK*initialDepth_);
waveBoardMotion_.component(0) = tCoeff * (waveHeigth_/(2.0*m1_)
* sin(sigma_*t.value()) + pow(waveHeigth_,2)
/ (32.0*initialDepth_)*(3.0*cosh(waveK*initialDepth_)
/ pow(sinh(waveK*initialDepth_),3)-2.0/m1_)
* sin(2.0*sigma_*t.value()));
Field<vector>::operator=
(
waveBoardMotion_
);
}
fixedValuePointPatchField<vector>::updateCoeffs();
}
void Foam::waveMakerPistonPointPatchVectorField::write(Ostream& os) const
{
pointPatchField<vector>::write(os);
os.writeEntry("initialDepth", initialDepth_);
os.writeEntry("wavePeriod", wavePeriod_);
os.writeEntry("waveHeigth", waveHeigth_);
os.writeEntry("waveLength", waveLength_);
os.writeEntry("wavePhase", wavePhase_);
os.writeEntry("waveNumber", waveNumber_);
os.writeEntry("rampTime", rampTime_);
os.writeEntry("g", g_);
os.writeEntry("secondOrder", secondOrder_);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePointPatchTypeField
(
pointPatchVectorField,
waveMakerPistonPointPatchVectorField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,179 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 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/>.
Class
Foam::waveMakerPistonPointPatchVectorField
Description
Foam::waveMakerPistonPointPatchVectorField
SourceFiles
waveMakerPistonPointPatchVectorField.C
\*---------------------------------------------------------------------------*/
#ifndef waveMakerPistonPointPatchVectorField_H
#define waveMakerPistonPointPatchVectorField_H
#include "fixedValuePointPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class waveMakerPistonPointPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class waveMakerPistonPointPatchVectorField
:
public fixedValuePointPatchField<vector>
{
// Private data
//inital water depth
scalar initialDepth_;
//wave period
scalar wavePeriod_;
//wave heigth
scalar waveHeigth_;
//wavelength
scalar waveLength_;
//wave phase
scalar wavePhase_;
//wave number
scalar waveNumber_;
//ramp time
scalar rampTime_;
// gravity vector
vector g_;
//on/off second order generation
scalar secondOrder_;
// Protected Member Functions
// Dispersion equation
virtual scalar waveLength(const scalar h, const scalar T);
//- Return the time scaling coefficient
virtual scalar timeCoeff(const scalar t) const;
public:
//- Runtime type information
TypeName("waveMakerPiston");
// Constructors
//- Construct from patch and internal field
waveMakerPistonPointPatchVectorField
(
const pointPatch&,
const DimensionedField<vector, pointMesh>&
);
//- Construct from patch, internal field and dictionary
waveMakerPistonPointPatchVectorField
(
const pointPatch&,
const DimensionedField<vector, pointMesh>&,
const dictionary&
);
//- Construct by mapping given patchField<vector> onto a new patch
waveMakerPistonPointPatchVectorField
(
const waveMakerPistonPointPatchVectorField&,
const pointPatch&,
const DimensionedField<vector, pointMesh>&,
const pointPatchFieldMapper&
);
//- Construct and return a clone
virtual autoPtr<pointPatchField<vector>> clone() const
{
return autoPtr<pointPatchField<vector>>
(
new waveMakerPistonPointPatchVectorField
(
*this
)
);
}
//- Construct as copy setting internal field reference
waveMakerPistonPointPatchVectorField
(
const waveMakerPistonPointPatchVectorField&,
const DimensionedField<vector, pointMesh>&
);
//- Construct and return a clone setting internal field reference
virtual autoPtr<pointPatchField<vector>> clone
(
const DimensionedField<vector, pointMesh>& iF
) const
{
return autoPtr<pointPatchField<vector>>
(
new waveMakerPistonPointPatchVectorField
(
*this,
iF
)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ 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
{
bottom1
{
type fixedValue;
value uniform (0 0 0);
}
bottom2
{
type fixedValue;
value uniform (0 0 0);
}
leftwall
{
type movingWallVelocity;
value uniform (0 0 0);
}
back
{
type empty;
}
front
{
type empty;
}
rightwall
{
type waveVelocity;
value uniform (0 0 0);
}
top
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- 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
{
bottom1
{
type zeroGradient;
}
bottom2
{
type zeroGradient;
}
front
{
type empty;
}
back
{
type empty;
}
leftwall
{
type zeroGradient;
}
rightwall
{
type zeroGradient;
}
top
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,65 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
bottom1
{
type fixedFluxPressure;
value uniform 0;
}
bottom2
{
type fixedFluxPressure;
value uniform 0;
}
front
{
type empty;
}
back
{
type empty;
}
leftwall
{
type fixedFluxPressure;
value uniform 0;
}
rightwall
{
type fixedFluxPressure;
value uniform 0;
}
top
{
type totalPressure;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
p0 uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,72 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
bottom1
{
type zeroGradient;
}
bottom2
{
type fixedValue;
value uniform (0 0 0);
}
leftwall
{
type waveMakerFlap;
value uniform (0 0 0);
waveBoardStroke 0.0;
waveHeigth 0.06;
g (0 0 -9.81);
initialDepth 0.25;
wavePeriod 2.0;
rampTime 2.0;
waveLength 0;
wavePhase 0;
waveNumber 0.0;
secondOrder false;
}
back
{
type empty;
}
front
{
type empty;
}
rightwall
{
type fixedValue;
value uniform (0 0 0);
}
top
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,29 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("libfvMotionSolvers.so");
solver displacementLaplacian;
displacementLaplacianCoeffs
{
diffusivity inverseDistance (leftwall);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / 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: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phases (water air);
water
{
transportModel Newtonian;
nu 1e-06;
rho 1000;
}
air
{
transportModel Newtonian;
nu 1.48e-05;
rho 1;
}
sigma 0.07;
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- 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 "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / 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 "constant";
object wavesProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
rightwall
{
alpha alpha.water;
waveModel shallowWaterAbsorption;
nPaddle 1;
}
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
vertices
(
(0 0 0)
(2 0 0)
(2 0 0.7)
(0 0 0.7)
(0 0.01 0)
(2 0.01 0)
(2 0.01 0.7)
(0 0.01 0.7)
(4 0 0)
(4 0 0.7)
(4 0.01 0.7)
(4 0.01 0)
);
blocks
(
hex (0 1 5 4 3 2 6 7) (200 1 140) simpleGrading (1 1 1)
hex (1 8 11 5 2 9 10 6) (200 1 140) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
bottom1
{
type wall;
faces
(
(0 1 5 4)
);
}
bottom2
{
type wall;
faces
(
(1 8 11 5)
);
}
front
{
type empty;
faces
(
(0 1 2 3)
(1 8 9 2)
);
}
back
{
type empty;
faces
(
(4 5 6 7)
(5 11 10 6)
);
}
leftwall
{
type patch;
faces
(
(0 4 7 3)
);
}
rightwall
{
type patch;
faces
(
(8 11 10 9)
);
}
top
{
type wall;
faces
(
(3 2 6 7)
(2 9 10 6)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,139 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interDyMFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 40;
deltaT 0.005;
writeControl adjustableRunTime;
writeInterval 0.1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.65;
maxAlphaCo 0.65;
maxDeltaT 0.05;
functions
{
line
{
type sets;
libs ("libsampling.so");
enabled true;
writeControl writeTime;
interpolationScheme cellPoint;
setFormat raw;
sets
(
s1
{
type uniform;
axis distance;
start ( 0.5 0.005 0.0 );
end ( 0.5 0.005 0.7 );
nPoints 1001;
}
s2
{
type uniform;
axis distance;
start ( 1.0 0.005 0.0 );
end ( 1.0 0.005 0.7 );
nPoints 1001;
}
s3
{
type uniform;
axis distance;
start ( 1.5 0.005 0.0 );
end ( 1.5 0.005 0.7 );
nPoints 1001;
}
s4
{
type uniform;
axis distance;
start ( 2.0 0.005 0.0 );
end ( 2.0 0.005 0.7 );
nPoints 1001;
}
s5
{
type uniform;
axis distance;
start ( 2.5 0.005 0.0 );
end ( 2.5 0.005 0.7 );
nPoints 1001;
}
s6
{
type uniform;
axis distance;
start ( 3.0 0.005 0.0 );
end ( 3.0 0.005 0.7 );
nPoints 1001;
}
s7
{
type uniform;
axis distance;
start ( 4.0 0.005 0.0 );
end ( 4.0 0.005 0.7 );
nPoints 1001;
}
);
fixedLocations false;
fields (alpha.water);
}
}
// ************************************************************************* /

View File

@ -0,0 +1,64 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ 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 interfaceCompression;
div(phi,R) Gauss upwind;
div(R) Gauss linear;
div(phi,nuTilda) Gauss upwind;
div((muEff*dev(T(grad(U))))) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p_rgh;
pcorr;
alpha;
}
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*--------------------------------*- 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 "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"(cellDisplacement|cellDisplacementFinal)"
{
solver GAMG;
tolerance 1e-5;
relTol 0;
smoother GaussSeidel;
cacheAgglomeration false;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
"alpha.water.*"
{
nAlphaCorr 1;
nAlphaSubCycles 3;
cAlpha 1;
}
"(pcorr|pcorrFinal)"
{
solver PCG;
preconditioner DIC;
tolerance 1e-10;
relTol 0;
}
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-07;
relTol 0.05;
}
p_rghFinal
{
$p_rgh;
tolerance 1e-07;
relTol 0;
}
U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
}
R
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}
nuTilda
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-03;
relTol 0;
}
}
PIMPLE
{
momentumPredictor no;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
nAlphaCorr 1;
nAlphaSubCycles 2;
cAlpha 1;
}
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.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
);
regions
(
boxToCell
{
box ( -100 -100 -1 ) ( 100.0 100.0 0.25 );
fieldValues ( volScalarFieldValue alpha.water 1 );
}
);
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ 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
{
bottom1
{
type fixedValue;
value uniform (0 0 0);
}
bottom2
{
type fixedValue;
value uniform (0 0 0);
}
leftwall
{
type movingWallVelocity;
value uniform (0 0 0);
}
back
{
type empty;
}
front
{
type empty;
}
rightwall
{
type waveVelocity;
value uniform (0 0 0);
}
top
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- 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
{
bottom1
{
type zeroGradient;
}
bottom2
{
type zeroGradient;
}
front
{
type empty;
}
back
{
type empty;
}
leftwall
{
type zeroGradient;
}
rightwall
{
type zeroGradient;
}
top
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,65 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
bottom1
{
type fixedFluxPressure;
value uniform 0;
}
bottom2
{
type fixedFluxPressure;
value uniform 0;
}
front
{
type empty;
}
back
{
type empty;
}
leftwall
{
type fixedFluxPressure;
value uniform 0;
}
rightwall
{
type fixedFluxPressure;
value uniform 0;
}
top
{
type totalPressure;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
p0 uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,72 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
bottom1
{
type zeroGradient;
}
bottom2
{
type fixedValue;
value uniform (0 0 0);
}
leftwall
{
type waveMakerPiston;
value uniform (0 0 0);
waveBoardStroke 0;
waveHeigth 0.06;
g (0 0 -9.81);
waterDepthRef 0.25;
initialDepth 0.25;
wavePeriod 2.0;
rampTime 2.0;
waveLength 0;
wavePhase 0;
waveNumber 0.0;
secondOrder false;
}
back
{
type empty;
}
front
{
type empty;
}
rightwall
{
type fixedValue;
value uniform (0 0 0);
}
top
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,29 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("libfvMotionSolvers.so");
solver displacementLaplacian;
displacementLaplacianCoeffs
{
diffusivity inverseDistance (leftwall);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / 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: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phases (water air);
water
{
transportModel Newtonian;
nu 1e-06;
rho 1000;
}
air
{
transportModel Newtonian;
nu 1.48e-05;
rho 1;
}
sigma 0.07;
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- 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 "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / 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 "constant";
object wavesProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
rightwall
{
alpha alpha.water;
waveModel shallowWaterAbsorption;
nPaddle 1;
}
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
vertices
(
(0 0 0)
(2 0 0)
(2 0 0.7)
(0 0 0.7)
(0 0.01 0)
(2 0.01 0)
(2 0.01 0.7)
(0 0.01 0.7)
(4 0 0)
(4 0 0.7)
(4 0.01 0.7)
(4 0.01 0)
);
blocks
(
hex (0 1 5 4 3 2 6 7) (100 1 140) simpleGrading (1 1 1)
hex (1 8 11 5 2 9 10 6) (300 1 140) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
bottom1
{
type wall;
faces
(
(0 1 5 4)
);
}
bottom2
{
type wall;
faces
(
(1 8 11 5)
);
}
front
{
type empty;
faces
(
(0 1 2 3)
(1 8 9 2)
);
}
back
{
type empty;
faces
(
(4 5 6 7)
(5 11 10 6)
);
}
leftwall
{
type patch;
faces
(
(0 4 7 3)
);
}
rightwall
{
type patch;
faces
(
(8 11 10 9)
);
}
top
{
type wall;
faces
(
(3 2 6 7)
(2 9 10 6)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,139 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interDyMFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 40;
deltaT 0.005;
writeControl adjustableRunTime;
writeInterval 0.1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.65;
maxAlphaCo 0.65;
maxDeltaT 0.05;
functions
{
line
{
type sets;
libs ("libsampling.so");
enabled true;
writeControl writeTime;
interpolationScheme cellPoint;
setFormat raw;
sets
(
s1
{
type uniform;
axis distance;
start ( 0.5 0.005 0.0 );
end ( 0.5 0.005 0.7 );
nPoints 1001;
}
s2
{
type uniform;
axis distance;
start ( 1.0 0.005 0.0 );
end ( 1.0 0.005 0.7 );
nPoints 1001;
}
s3
{
type uniform;
axis distance;
start ( 1.5 0.005 0.0 );
end ( 1.5 0.005 0.7 );
nPoints 1001;
}
s4
{
type uniform;
axis distance;
start ( 2.0 0.005 0.0 );
end ( 2.0 0.005 0.7 );
nPoints 1001;
}
s5
{
type uniform;
axis distance;
start ( 2.5 0.005 0.0 );
end ( 2.5 0.005 0.7 );
nPoints 1001;
}
s6
{
type uniform;
axis distance;
start ( 3.0 0.005 0.0 );
end ( 3.0 0.005 0.7 );
nPoints 1001;
}
s7
{
type uniform;
axis distance;
start ( 4.0 0.005 0.0 );
end ( 4.0 0.005 0.7 );
nPoints 1001;
}
);
fixedLocations false;
fields (alpha.water);
}
}
// ************************************************************************* /

View File

@ -0,0 +1,64 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ 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 interfaceCompression;
div(phi,R) Gauss upwind;
div(R) Gauss linear;
div(phi,nuTilda) Gauss upwind;
div((muEff*dev(T(grad(U))))) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p_rgh;
pcorr;
alpha;
}
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*--------------------------------*- 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 "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"(cellDisplacement|cellDisplacementFinal)"
{
solver GAMG;
tolerance 1e-5;
relTol 0;
smoother GaussSeidel;
cacheAgglomeration false;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
"alpha.water.*"
{
nAlphaCorr 1;
nAlphaSubCycles 3;
cAlpha 1;
}
"(pcorr|pcorrFinal)"
{
solver PCG;
preconditioner DIC;
tolerance 1e-10;
relTol 0;
}
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-07;
relTol 0.05;
}
p_rghFinal
{
$p_rgh;
tolerance 1e-07;
relTol 0;
}
U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
}
R
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}
nuTilda
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-03;
relTol 0;
}
}
PIMPLE
{
momentumPredictor no;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
nAlphaCorr 1;
nAlphaSubCycles 2;
cAlpha 1;
}
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.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
);
regions
(
boxToCell
{
box ( -100 -100 -1 ) ( 100.0 100.0 0.25 );
fieldValues ( volScalarFieldValue alpha.water 1 );
}
);
// ************************************************************************* //