diff --git a/applications/test/minMax2/Make/options b/applications/test/minMax2/Make/options index d27c95d033..18e6fe47af 100644 --- a/applications/test/minMax2/Make/options +++ b/applications/test/minMax2/Make/options @@ -1,7 +1,2 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -lfiniteVolume \ - -lmeshTools +/* EXE_INC = */ +/* EXE_LIBS = */ diff --git a/applications/test/minMax2/Test-minMax2.C b/applications/test/minMax2/Test-minMax2.C index ec02d21d3d..e228f0dce2 100644 --- a/applications/test/minMax2/Test-minMax2.C +++ b/applications/test/minMax2/Test-minMax2.C @@ -28,7 +28,7 @@ Description \*---------------------------------------------------------------------------*/ -#include "fvCFD.H" +#include "argList.H" #include "Time.H" #include "BitOps.H" #include "HashOps.H" diff --git a/src/ODE/ODESolvers/adaptiveSolver/adaptiveSolver.C b/src/ODE/ODESolvers/adaptiveSolver/adaptiveSolver.C index 04be67825b..529d009cbc 100644 --- a/src/ODE/ODESolvers/adaptiveSolver/adaptiveSolver.C +++ b/src/ODE/ODESolvers/adaptiveSolver/adaptiveSolver.C @@ -100,8 +100,8 @@ void Foam::adaptiveSolver::solve // If the error is small increase the step-size if (err > pow(maxScale_/safeScale_, -1.0/alphaInc_)) { - dxTry = - clamp(safeScale_*pow(err, -alphaInc_), minScale_, maxScale_)*dx; + scalar scale = safeScale_*pow(err, -alphaInc_); + dxTry = clamp(scale, minScale_, maxScale_)*dx; } else { diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H index 212cdcdc3b..21d63cd4c9 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H @@ -334,7 +334,7 @@ inline Foam::scalar Foam::triangle::circumRadius() const } const scalar a = (d1 + d2)*(d2 + d3)*(d3 + d1) / denom; - return 0.5*Foam::sqrt(clamp(a, 0, GREAT)); + return 0.5*Foam::sqrt(clamp(a, scalar(0), scalar(GREAT))); } diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.H b/src/OpenFOAM/primitives/Scalar/Scalar.H index 4fe5c81b66..ffc7d71c64 100644 --- a/src/OpenFOAM/primitives/Scalar/Scalar.H +++ b/src/OpenFOAM/primitives/Scalar/Scalar.H @@ -302,7 +302,7 @@ inline Scalar clamp(const Scalar val, const Foam::zero_one) // Fast implementation, and with scalar promotion of upper/lower limits -inline Scalar clamp(const Scalar& val, const Scalar& lower, const Scalar& upper) +inline Scalar clamp(const Scalar val, const Scalar lower, const Scalar upper) { return (val < lower) ? lower : (upper < val) ? upper : val; } diff --git a/src/OpenFOAM/primitives/Scalar/doubleFloat.H b/src/OpenFOAM/primitives/Scalar/doubleFloat.H index 5117199c8c..b4f8b74d46 100644 --- a/src/OpenFOAM/primitives/Scalar/doubleFloat.H +++ b/src/OpenFOAM/primitives/Scalar/doubleFloat.H @@ -41,12 +41,12 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define MAXMINPOW(retType, type1, type2) \ +#define MAXMINPOW(RetType, Type1, Type2) \ \ -MAXMIN(retType, type1, type2) \ +MAXMIN(RetType, Type1, Type2) \ \ /*! \brief Raise base to the power expon */ \ -inline double pow(const type1 base, const type2 expon) \ +inline double pow(const Type1 base, const Type2 expon) \ { \ return ::pow(double(base), double(expon)); \ } diff --git a/src/OpenFOAM/primitives/ints/int/int.H b/src/OpenFOAM/primitives/ints/int/int.H index 48900d3c8c..9e9af9d59b 100644 --- a/src/OpenFOAM/primitives/ints/int/int.H +++ b/src/OpenFOAM/primitives/ints/int/int.H @@ -47,16 +47,16 @@ SourceFiles namespace Foam { -#define MAXMIN(retType, type1, type2) \ +#define MAXMIN(RetType, Type1, Type2) \ \ /*! \brief Floating/integral min. Use stdFoam::min() to preserve references */ \ -inline retType min(const type1 s1, const type2 s2) \ +inline RetType min(const Type1 s1, const Type2 s2) \ { \ return (s1 < s2) ? s1 : s2; \ } \ \ /*! \brief Floating integral max. Use stdFoam::max() to preserve references */ \ -inline retType max(const type1 s1, const type2 s2) \ +inline RetType max(const Type1 s1, const Type2 s2) \ { \ return (s2 < s1) ? s1 : s2; \ } diff --git a/src/OpenFOAM/primitives/ints/uint/uint.H b/src/OpenFOAM/primitives/ints/uint/uint.H index 01e5090771..ec00595e3a 100644 --- a/src/OpenFOAM/primitives/ints/uint/uint.H +++ b/src/OpenFOAM/primitives/ints/uint/uint.H @@ -48,16 +48,16 @@ SourceFiles namespace Foam { -#define MAXMIN(retType, type1, type2) \ +#define MAXMIN(RetType, Type1, Type2) \ \ /*! \brief Floating/integral min. Use stdFoam::min() to preserve references */ \ -inline retType min(const type1 s1, const type2 s2) \ +inline RetType min(const Type1 s1, const Type2 s2) \ { \ return (s1 < s2) ? s1 : s2; \ } \ \ /*! \brief Floating/integral max. Use stdFoam::max() to preserve references */ \ -inline retType max(const type1 s1, const type2 s2) \ +inline RetType max(const Type1 s1, const Type2 s2) \ { \ return (s2 < s1) ? s1 : s2; \ } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSSTLM/kOmegaSSTLM.C b/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSSTLM/kOmegaSSTLM.C index d78511df8d..b691180936 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSSTLM/kOmegaSSTLM.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSSTLM/kOmegaSSTLM.C @@ -310,7 +310,7 @@ tmp kOmegaSSTLM::ReThetat0 } lambda = sqr(thetat)/nu[celli]*dUsds[celli]; - lambda = clamp(lambda, -0.1, 0.1); + lambda = clamp(lambda, scalar(-0.1), scalar(0.1)); lambdaErr = mag(lambda - lambda0); diff --git a/src/combustionModels/EDC/EDC.C b/src/combustionModels/EDC/EDC.C index 66ac5e9780..434a8f87ec 100644 --- a/src/combustionModels/EDC/EDC.C +++ b/src/combustionModels/EDC/EDC.C @@ -108,14 +108,17 @@ void Foam::combustionModels::EDC::correct() { const scalar nu = mu[i]/(rho[i] + SMALL); - const scalar Da = - clamp(sqrt(nu/(epsilon[i] + SMALL))/tc[i], 1e-10, 10); + const scalar Da = clamp + ( + sqrt(nu/(epsilon[i] + SMALL))/tc[i], + scalar(1e-10), scalar(10) + ); const scalar ReT = sqr(k[i])/(nu*epsilon[i] + SMALL); const scalar CtauI = min(C1_/(Da*sqrt(ReT + 1)), 2.1377); const scalar CgammaI = - clamp(C2_*sqrt(Da*(ReT + 1)), 0.4082, 5); + clamp(C2_*sqrt(Da*(ReT + 1)), scalar(0.4082), scalar(5)); const scalar gammaL = CgammaI*pow025(nu*epsilon[i]/(sqr(k[i]) + SMALL)); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C index 7de63c424d..a72d3fcb42 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C @@ -259,7 +259,7 @@ void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs() *(orientation_*sign(forceDiff)) ); - openFraction_ = clamp(openFraction_, 1e-6, 1 - 1e-6); + openFraction_ = clamp(openFraction_, scalar(1e-6), scalar(1 - 1e-6)); Info<< "openFraction = " << openFraction_ << endl; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C index c69104703d..a7fb3a6047 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C @@ -310,7 +310,7 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs() baffleActivated_ = true; } - openFraction_ = clamp(openFraction_, 1e-6, 1 - 1e-6); + openFraction_ = clamp(openFraction_, scalar(1e-6), scalar(1 - 1e-6)); if (Pstream::master()) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/SFCD/SFCD.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/SFCD/SFCD.H index a9298c1214..5daeb2c955 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/SFCD/SFCD.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/SFCD/SFCD.H @@ -82,7 +82,7 @@ public: faceFlux, phiP, phiN, gradcP, gradcN, d ); - scalar limitPhict = clamp(phict, 0, 0.5); + scalar limitPhict = clamp(phict, scalar(0), scalar(0.5)); return limitPhict/(1 - limitPhict); } }; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear/filteredLinear.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear/filteredLinear.H index d7ee786056..ff607e7867 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear/filteredLinear.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear/filteredLinear.H @@ -93,7 +93,7 @@ public: /(max(mag(dcP), mag(dcN)) + SMALL); // Limit the limiter between linear and 20% upwind - return clamp(limiter, 0.8, 1); + return clamp(limiter, scalar(0.8), scalar(1)); } }; diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C index ef4a26bfee..3334a96dd0 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C @@ -167,7 +167,8 @@ void Foam::lineSearch::reset() // step_ = 2*(oldMeritValue_-prevMeritValue_)/directionalDeriv_; // Interpolate in order to get same improvement with the previous // optimisation cycle - step_ = clamp(step_*prevMeritDeriv_/directionalDeriv_, minStep_, 1); + step_ = + clamp(step_*prevMeritDeriv_/directionalDeriv_, minStep_, scalar(1)); Info<< "\n------- Computing initial step-------" << endl; Info<< "old dphi(0) " << prevMeritDeriv_ << endl; Info<< "dphi(0) " << directionalDeriv_ << endl;