mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
INT: streamFunction wave model updates
This commit is contained in:
@ -66,8 +66,9 @@ Foam::scalar Foam::waveModels::streamFunction::eta
|
|||||||
scalar strfnAux = 0.0;
|
scalar strfnAux = 0.0;
|
||||||
forAll(Ejs_, iterSF)
|
forAll(Ejs_, iterSF)
|
||||||
{
|
{
|
||||||
strfnAux += Ejs_[iterSF]*cos((iterSF + 1)
|
strfnAux +=
|
||||||
*(kx*x + ky*y - omega*t + phase));
|
Ejs_[iterSF]*cos((iterSF + 1)
|
||||||
|
*(kx*x + ky*y - omega*t + phase));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (1/k)*strfnAux;
|
return (1/k)*strfnAux;
|
||||||
@ -95,14 +96,16 @@ Foam::vector Foam::waveModels::streamFunction::Uf
|
|||||||
|
|
||||||
forAll(Bjs_, iterSF2)
|
forAll(Bjs_, iterSF2)
|
||||||
{
|
{
|
||||||
u += (iterSF2 + 1)*Bjs_[iterSF2] *cosh((iterSF2 + 1)*k*z)
|
u +=
|
||||||
/cosh((iterSF2 + 1)*k*h)*cos((iterSF2 + 1)*phaseTot);
|
(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)
|
w +=
|
||||||
/cosh((iterSF2 + 1)*k*h)*sin((iterSF2 + 1)*phaseTot);
|
(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;
|
w = sqrt(mag(g_)/k)*w;
|
||||||
|
|
||||||
scalar v = u*sin(waveAngle_);
|
scalar v = u*sin(waveAngle_);
|
||||||
@ -122,7 +125,7 @@ void Foam::waveModels::streamFunction::setLevel
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const scalar waveOmega = mathematical::twoPi/wavePeriod_;
|
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 waveKx = waveK*cos(waveAngle_);
|
||||||
const scalar waveKy = waveK*sin(waveAngle_);
|
const scalar waveKy = waveK*sin(waveAngle_);
|
||||||
|
|
||||||
@ -132,12 +135,12 @@ void Foam::waveModels::streamFunction::setLevel
|
|||||||
this->eta
|
this->eta
|
||||||
(
|
(
|
||||||
waterDepthRef_,
|
waterDepthRef_,
|
||||||
waveKx,
|
waveKx,
|
||||||
waveKy,
|
waveKy,
|
||||||
wavePeriod_,
|
wavePeriod_,
|
||||||
xPaddle_[paddlei],
|
xPaddle_[paddlei],
|
||||||
yPaddle_[paddlei],
|
yPaddle_[paddlei],
|
||||||
waveOmega,
|
waveOmega,
|
||||||
t,
|
t,
|
||||||
wavePhase_
|
wavePhase_
|
||||||
);
|
);
|
||||||
@ -155,7 +158,7 @@ void Foam::waveModels::streamFunction::setVelocity
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const scalar waveOmega = mathematical::twoPi/wavePeriod_;
|
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 waveKx = waveK*cos(waveAngle_);
|
||||||
const scalar waveKy = waveK*sin(waveAngle_);
|
const scalar waveKy = waveK*sin(waveAngle_);
|
||||||
|
|
||||||
@ -181,7 +184,7 @@ void Foam::waveModels::streamFunction::setVelocity
|
|||||||
wavePeriod_,
|
wavePeriod_,
|
||||||
xPaddle_[paddlei],
|
xPaddle_[paddlei],
|
||||||
yPaddle_[paddlei],
|
yPaddle_[paddlei],
|
||||||
waveOmega,
|
waveOmega,
|
||||||
t,
|
t,
|
||||||
wavePhase_,
|
wavePhase_,
|
||||||
z
|
z
|
||||||
@ -205,9 +208,8 @@ Foam::waveModels::streamFunction::streamFunction
|
|||||||
:
|
:
|
||||||
regularWaveModel(dict, mesh, patch, false),
|
regularWaveModel(dict, mesh, patch, false),
|
||||||
uMean_(0),
|
uMean_(0),
|
||||||
waveLengthSF_(0),
|
Bjs_(),
|
||||||
Bjs_( List<scalar> (1, -1.0) ),
|
Ejs_()
|
||||||
Ejs_( List<scalar> (1, -1.0) )
|
|
||||||
{
|
{
|
||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
@ -228,10 +230,10 @@ bool Foam::waveModels::streamFunction::readDict(const dictionary& overrideDict)
|
|||||||
{
|
{
|
||||||
if (regularWaveModel::readDict(overrideDict))
|
if (regularWaveModel::readDict(overrideDict))
|
||||||
{
|
{
|
||||||
lookup("uMean") >> uMean_;
|
overrideDict.lookup("uMean") >> uMean_;
|
||||||
lookup("waveLengthSF") >> waveLengthSF_;
|
overrideDict.lookup("waveLength") >> waveLength_;
|
||||||
lookup("Bjs") >> Bjs_;
|
overrideDict.lookup("Bjs") >> Bjs_;
|
||||||
lookup("Ejs") >> Ejs_;
|
overrideDict.lookup("Ejs") >> Ejs_;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -245,9 +247,10 @@ void Foam::waveModels::streamFunction::info(Ostream& os) const
|
|||||||
regularWaveModel::info(os);
|
regularWaveModel::info(os);
|
||||||
|
|
||||||
os << " uMean : " << uMean_ << nl
|
os << " uMean : " << uMean_ << nl
|
||||||
<< " wave Length streamFunction : " << waveLengthSF_ << nl
|
<< " Stream function wavelength : " << waveLength_ << nl
|
||||||
<< " Bj coefficients : " << Bjs_ << nl
|
<< " Bj coefficients : " << Bjs_ << nl
|
||||||
<< " Ej coefficients : " << Ejs_ << nl;
|
<< " Ej coefficients : " << Ejs_ << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -42,7 +42,7 @@ namespace waveModels
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class streamFunction Declaration
|
Class streamFunction Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class streamFunction
|
class streamFunction
|
||||||
@ -51,8 +51,6 @@ class streamFunction
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Wave height
|
//- Wave height
|
||||||
@ -92,9 +90,6 @@ protected:
|
|||||||
//- Mean fluid speed in frame of reference (stream function)
|
//- Mean fluid speed in frame of reference (stream function)
|
||||||
scalar uMean_;
|
scalar uMean_;
|
||||||
|
|
||||||
//-Stream waveLength
|
|
||||||
scalar waveLengthSF_;
|
|
||||||
|
|
||||||
//- Stream Function Bj coefficients
|
//- Stream Function Bj coefficients
|
||||||
scalarList Bjs_;
|
scalarList Bjs_;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: plus |
|
| \\ / O peration | Version: plus |
|
||||||
@ -35,38 +35,36 @@ inlet
|
|||||||
|
|
||||||
uMean 2.0825;
|
uMean 2.0825;
|
||||||
|
|
||||||
waveLengthSF 6.2832;
|
waveLength 6.2832;
|
||||||
|
|
||||||
Bjs
|
Bjs
|
||||||
10
|
|
||||||
(
|
(
|
||||||
8.6669014e-002
|
8.6669014e-002
|
||||||
2.4849799e-002
|
2.4849799e-002
|
||||||
7.7446850e-003
|
7.7446850e-003
|
||||||
2.3355420e-003
|
2.3355420e-003
|
||||||
6.4497731e-004
|
6.4497731e-004
|
||||||
1.5205114e-004
|
1.5205114e-004
|
||||||
2.5433769e-005
|
2.5433769e-005
|
||||||
-2.2045436e-007
|
-2.2045436e-007
|
||||||
-2.8711504e-006
|
-2.8711504e-006
|
||||||
-1.2287334e-006
|
-1.2287334e-006
|
||||||
);
|
);
|
||||||
|
|
||||||
Ejs
|
Ejs
|
||||||
10
|
|
||||||
(
|
(
|
||||||
5.6009609e-002
|
5.6009609e-002
|
||||||
3.1638171e-002
|
3.1638171e-002
|
||||||
1.5375952e-002
|
1.5375952e-002
|
||||||
7.1743178e-003
|
7.1743178e-003
|
||||||
3.3737077e-003
|
3.3737077e-003
|
||||||
1.6324880e-003
|
1.6324880e-003
|
||||||
8.2331980e-004
|
8.2331980e-004
|
||||||
4.4403497e-004
|
4.4403497e-004
|
||||||
2.7580059e-004
|
2.7580059e-004
|
||||||
2.2810557e-004
|
2.2810557e-004
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
@ -80,5 +78,3 @@ outlet
|
|||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -115,7 +115,7 @@ functions
|
|||||||
start ( 10.0 0.005 0.0 );
|
start ( 10.0 0.005 0.0 );
|
||||||
end ( 10.0 0.005 1.0 );
|
end ( 10.0 0.005 1.0 );
|
||||||
nPoints 1001;
|
nPoints 1001;
|
||||||
}
|
}
|
||||||
line7
|
line7
|
||||||
{
|
{
|
||||||
type uniform;
|
type uniform;
|
||||||
@ -123,7 +123,7 @@ functions
|
|||||||
start ( 12.0 0.005 0.0 );
|
start ( 12.0 0.005 0.0 );
|
||||||
end ( 12.0 0.005 1.0 );
|
end ( 12.0 0.005 1.0 );
|
||||||
nPoints 1001;
|
nPoints 1001;
|
||||||
}
|
}
|
||||||
line8
|
line8
|
||||||
{
|
{
|
||||||
type uniform;
|
type uniform;
|
||||||
|
|||||||
Reference in New Issue
Block a user