Commit b85a38dc authored by Andrew Heather's avatar Andrew Heather
Browse files

INT: streamFunction wave model updates

parent 700e17bd
......@@ -66,8 +66,9 @@ Foam::scalar Foam::waveModels::streamFunction::eta
scalar strfnAux = 0.0;
forAll(Ejs_, iterSF)
{
strfnAux += Ejs_[iterSF]*cos((iterSF + 1)
*(kx*x + ky*y - omega*t + phase));
strfnAux +=
Ejs_[iterSF]*cos((iterSF + 1)
*(kx*x + ky*y - omega*t + phase));
}
return (1/k)*strfnAux;
......@@ -95,14 +96,16 @@ Foam::vector Foam::waveModels::streamFunction::Uf
forAll(Bjs_, iterSF2)
{
u += (iterSF2 + 1)*Bjs_[iterSF2] *cosh((iterSF2 + 1)*k*z)
/cosh((iterSF2 + 1)*k*h)*cos((iterSF2 + 1)*phaseTot);
u +=
(iterSF2 + 1)*Bjs_[iterSF2]*cosh((iterSF2 + 1)*k*z)
/cosh((iterSF2 + 1)*k*h)*cos((iterSF2 + 1)*phaseTot);
w += (iterSF2 + 1)*Bjs_[iterSF2]*sinh((iterSF2 + 1)*k*z)
/cosh((iterSF2 + 1)*k*h)*sin((iterSF2 + 1)*phaseTot);
w +=
(iterSF2 + 1)*Bjs_[iterSF2]*sinh((iterSF2 + 1)*k*z)
/cosh((iterSF2 + 1)*k*h)*sin((iterSF2 + 1)*phaseTot);
}
u = waveLengthSF_/T - uMean_ + sqrt(mag(g_)/k)*u;
u = waveLength_/T - uMean_ + sqrt(mag(g_)/k)*u;
w = sqrt(mag(g_)/k)*w;
scalar v = u*sin(waveAngle_);
......@@ -122,7 +125,7 @@ void Foam::waveModels::streamFunction::setLevel
) const
{
const scalar waveOmega = mathematical::twoPi/wavePeriod_;
const scalar waveK = mathematical::twoPi/waveLengthSF_;
const scalar waveK = mathematical::twoPi/waveLength_;
const scalar waveKx = waveK*cos(waveAngle_);
const scalar waveKy = waveK*sin(waveAngle_);
......@@ -132,12 +135,12 @@ void Foam::waveModels::streamFunction::setLevel
this->eta
(
waterDepthRef_,
waveKx,
waveKx,
waveKy,
wavePeriod_,
xPaddle_[paddlei],
yPaddle_[paddlei],
waveOmega,
waveOmega,
t,
wavePhase_
);
......@@ -155,7 +158,7 @@ void Foam::waveModels::streamFunction::setVelocity
)
{
const scalar waveOmega = mathematical::twoPi/wavePeriod_;
const scalar waveK = mathematical::twoPi/waveLengthSF_;
const scalar waveK = mathematical::twoPi/waveLength_;
const scalar waveKx = waveK*cos(waveAngle_);
const scalar waveKy = waveK*sin(waveAngle_);
......@@ -181,7 +184,7 @@ void Foam::waveModels::streamFunction::setVelocity
wavePeriod_,
xPaddle_[paddlei],
yPaddle_[paddlei],
waveOmega,
waveOmega,
t,
wavePhase_,
z
......@@ -205,9 +208,8 @@ Foam::waveModels::streamFunction::streamFunction
:
regularWaveModel(dict, mesh, patch, false),
uMean_(0),
waveLengthSF_(0),
Bjs_( List<scalar> (1, -1.0) ),
Ejs_( List<scalar> (1, -1.0) )
Bjs_(),
Ejs_()
{
if (readFields)
{
......@@ -228,10 +230,10 @@ bool Foam::waveModels::streamFunction::readDict(const dictionary& overrideDict)
{
if (regularWaveModel::readDict(overrideDict))
{
lookup("uMean") >> uMean_;
lookup("waveLengthSF") >> waveLengthSF_;
lookup("Bjs") >> Bjs_;
lookup("Ejs") >> Ejs_;
overrideDict.lookup("uMean") >> uMean_;
overrideDict.lookup("waveLength") >> waveLength_;
overrideDict.lookup("Bjs") >> Bjs_;
overrideDict.lookup("Ejs") >> Ejs_;
return true;
}
......@@ -245,9 +247,10 @@ void Foam::waveModels::streamFunction::info(Ostream& os) const
regularWaveModel::info(os);
os << " uMean : " << uMean_ << nl
<< " wave Length streamFunction : " << waveLengthSF_ << nl
<< " Stream function wavelength : " << waveLength_ << nl
<< " Bj coefficients : " << Bjs_ << nl
<< " Ej coefficients : " << Ejs_ << nl;
}
// ************************************************************************* //
......@@ -42,7 +42,7 @@ namespace waveModels
{
/*---------------------------------------------------------------------------*\
Class streamFunction Declaration
Class streamFunction Declaration
\*---------------------------------------------------------------------------*/
class streamFunction
......@@ -51,8 +51,6 @@ class streamFunction
{
private:
// Private Member Functions
//- Wave height
......@@ -92,9 +90,6 @@ protected:
//- Mean fluid speed in frame of reference (stream function)
scalar uMean_;
//-Stream waveLength
scalar waveLengthSF_;
//- Stream Function Bj coefficients
scalarList Bjs_;
......
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
......@@ -35,38 +35,36 @@ inlet
uMean 2.0825;
waveLengthSF 6.2832;
waveLength 6.2832;
Bjs
10
(
8.6669014e-002
2.4849799e-002
7.7446850e-003
2.3355420e-003
6.4497731e-004
1.5205114e-004
2.5433769e-005
-2.2045436e-007
-2.8711504e-006
-1.2287334e-006
8.6669014e-002
2.4849799e-002
7.7446850e-003
2.3355420e-003
6.4497731e-004
1.5205114e-004
2.5433769e-005
-2.2045436e-007
-2.8711504e-006
-1.2287334e-006
);
Ejs
10
(
5.6009609e-002
3.1638171e-002
1.5375952e-002
7.1743178e-003
3.3737077e-003
1.6324880e-003
8.2331980e-004
4.4403497e-004
2.7580059e-004
2.2810557e-004
5.6009609e-002
3.1638171e-002
1.5375952e-002
7.1743178e-003
3.3737077e-003
1.6324880e-003
8.2331980e-004
4.4403497e-004
2.7580059e-004
2.2810557e-004
);
}
outlet
......@@ -80,5 +78,3 @@ outlet
// ************************************************************************* //
......@@ -115,7 +115,7 @@ functions
start ( 10.0 0.005 0.0 );
end ( 10.0 0.005 1.0 );
nPoints 1001;
}
}
line7
{
type uniform;
......@@ -123,7 +123,7 @@ functions
start ( 12.0 0.005 0.0 );
end ( 12.0 0.005 1.0 );
nPoints 1001;
}
}
line8
{
type uniform;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment