Change variable name to be different from min and max

This commit is contained in:
Hrvoje Jasak 2019-08-10 17:55:53 +01:00
parent 3164a80459
commit 8b49921bf9
2 changed files with 18 additions and 14 deletions

View file

@ -209,15 +209,15 @@ void Foam::sixDOFqODE::constrainTranslation(vector& vec) const
void Foam::sixDOFqODE::aitkensRelaxation void Foam::sixDOFqODE::aitkensRelaxation
( (
const scalar min, const scalar minRelFactor,
const scalar max const scalar maxRelFactor
) )
{ {
// Calculate translational relax factor // Calculate translational relax factor
const scalar saveOldRelFacT = oldRelaxFactorT_; const scalar saveOldRelFacT = oldRelaxFactorT_;
oldRelaxFactorT_ = relaxFactorT_; oldRelaxFactorT_ = relaxFactorT_;
if(magSqr(A_[0] - An_[1] - A_[1] - An_[2]) > SMALL) if (magSqr(A_[0] - An_[1] - A_[1] - An_[2]) > SMALL)
{ {
relaxFactorT_ = saveOldRelFacT + (saveOldRelFacT - 1)* relaxFactorT_ = saveOldRelFacT + (saveOldRelFacT - 1)*
( (
@ -228,17 +228,17 @@ void Foam::sixDOFqODE::aitkensRelaxation
} }
else else
{ {
relaxFactorT_ = min; relaxFactorT_ = minRelFactor;
} }
// Bound the relaxation factor for stability // Bound the relaxation factor for stability
if (relaxFactorT_ > max) if (relaxFactorT_ > maxRelFactor)
{ {
relaxFactorT_ = max; relaxFactorT_ = maxRelFactor;
} }
else if (relaxFactorT_ < min) else if (relaxFactorT_ < minRelFactor)
{ {
relaxFactorT_ = min; relaxFactorT_ = minRelFactor;
} }
// Calculate rotational relax factor // Calculate rotational relax factor
@ -259,17 +259,17 @@ void Foam::sixDOFqODE::aitkensRelaxation
} }
else else
{ {
relaxFactorR_ = min; relaxFactorR_ = minRelFactor;
} }
// Bound the relaxation factor for stability // Bound the relaxation factor for stability
if(relaxFactorR_ > max) if(relaxFactorR_ > maxRelFactor)
{ {
relaxFactorR_ = max; relaxFactorR_ = maxRelFactor;
} }
else if(relaxFactorR_ < min) else if(relaxFactorR_ < minRelFactor)
{ {
relaxFactorR_ = min; relaxFactorR_ = minRelFactor;
} }
} }

View file

@ -233,7 +233,11 @@ class sixDOFqODE
void constrainTranslation(vector& vec) const; void constrainTranslation(vector& vec) const;
//- Update Aitkens relaxation parameters //- Update Aitkens relaxation parameters
void aitkensRelaxation(const scalar min, const scalar max); void aitkensRelaxation
(
const scalar minRelFactor,
const scalar maxRelFactor
);
public: public: