mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: waveModel - using class varaiable instead of a static to update the model
This commit is contained in:
@ -276,6 +276,7 @@ Foam::waveModel::waveModel
|
|||||||
waterDepthRef_(0),
|
waterDepthRef_(0),
|
||||||
initialDepth_(0),
|
initialDepth_(0),
|
||||||
rampTime_(VSMALL),
|
rampTime_(VSMALL),
|
||||||
|
currTimeIndex_(-1),
|
||||||
activeAbsorption_(false),
|
activeAbsorption_(false),
|
||||||
U_(patch.size(), vector::zero),
|
U_(patch.size(), vector::zero),
|
||||||
alpha_(patch.size(), 0)
|
alpha_(patch.size(), 0)
|
||||||
@ -338,9 +339,7 @@ bool Foam::waveModel::read()
|
|||||||
|
|
||||||
void Foam::waveModel::correct(const scalar t)
|
void Foam::waveModel::correct(const scalar t)
|
||||||
{
|
{
|
||||||
static label timeIndex = -1;
|
if (mesh_.time().timeIndex() != currTimeIndex_)
|
||||||
|
|
||||||
if (mesh_.time().timeIndex() != timeIndex)
|
|
||||||
{
|
{
|
||||||
Info<< "Updating " << type() << " wave model for patch "
|
Info<< "Updating " << type() << " wave model for patch "
|
||||||
<< patch_.name() << endl;
|
<< patch_.name() << endl;
|
||||||
@ -394,7 +393,7 @@ void Foam::waveModel::correct(const scalar t)
|
|||||||
// Transform velocity into global co-ordinate system
|
// Transform velocity into global co-ordinate system
|
||||||
U_ = Rlg_ & U_;
|
U_ = Rlg_ & U_;
|
||||||
|
|
||||||
timeIndex = mesh_.time().timeIndex();
|
currTimeIndex_ = mesh_.time().timeIndex();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -114,9 +114,13 @@ protected:
|
|||||||
//- Ramp time
|
//- Ramp time
|
||||||
scalar rampTime_;
|
scalar rampTime_;
|
||||||
|
|
||||||
|
//- Time index used for updating
|
||||||
|
label currTimeIndex_;
|
||||||
|
|
||||||
//- Active wave absorption switch
|
//- Active wave absorption switch
|
||||||
bool activeAbsorption_;
|
bool activeAbsorption_;
|
||||||
|
|
||||||
|
|
||||||
// Current values
|
// Current values
|
||||||
|
|
||||||
//- Velocity field
|
//- Velocity field
|
||||||
|
|||||||
Reference in New Issue
Block a user