From 8b49921bf9b9d162e233a08129a3e4b5e0404fb9 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Sat, 10 Aug 2019 17:55:53 +0100 Subject: [PATCH] Change variable name to be different from min and max --- src/ODE/sixDOF/sixDOFqODE/sixDOFqODE.C | 26 +++++++++++++------------- src/ODE/sixDOF/sixDOFqODE/sixDOFqODE.H | 6 +++++- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/ODE/sixDOF/sixDOFqODE/sixDOFqODE.C b/src/ODE/sixDOF/sixDOFqODE/sixDOFqODE.C index 2aa0fa477..17d9cd70d 100644 --- a/src/ODE/sixDOF/sixDOFqODE/sixDOFqODE.C +++ b/src/ODE/sixDOF/sixDOFqODE/sixDOFqODE.C @@ -209,15 +209,15 @@ void Foam::sixDOFqODE::constrainTranslation(vector& vec) const void Foam::sixDOFqODE::aitkensRelaxation ( - const scalar min, - const scalar max + const scalar minRelFactor, + const scalar maxRelFactor ) { // Calculate translational relax factor const scalar saveOldRelFacT = oldRelaxFactorT_; 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)* ( @@ -228,17 +228,17 @@ void Foam::sixDOFqODE::aitkensRelaxation } else { - relaxFactorT_ = min; + relaxFactorT_ = minRelFactor; } // 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 @@ -259,17 +259,17 @@ void Foam::sixDOFqODE::aitkensRelaxation } else { - relaxFactorR_ = min; + relaxFactorR_ = minRelFactor; } // 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; } } diff --git a/src/ODE/sixDOF/sixDOFqODE/sixDOFqODE.H b/src/ODE/sixDOF/sixDOFqODE/sixDOFqODE.H index a945c6c93..496d9c240 100644 --- a/src/ODE/sixDOF/sixDOFqODE/sixDOFqODE.H +++ b/src/ODE/sixDOF/sixDOFqODE/sixDOFqODE.H @@ -233,7 +233,11 @@ class sixDOFqODE void constrainTranslation(vector& vec) const; //- Update Aitkens relaxation parameters - void aitkensRelaxation(const scalar min, const scalar max); + void aitkensRelaxation + ( + const scalar minRelFactor, + const scalar maxRelFactor + ); public: