diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C index 627dd41b6f..9b064b14c6 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C @@ -34,6 +34,7 @@ License #include "fvcFlux.H" #include "fvcMeshPhi.H" #include "surfaceInterpolate.H" +#include "unitConversion.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -43,10 +44,6 @@ namespace Foam } -const Foam::scalar Foam::multiphaseMixtureThermo::convertToRad = - Foam::constant::mathematical::pi/180.0; - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::multiphaseMixtureThermo::calcAlphas() @@ -855,7 +852,7 @@ void Foam::multiphaseMixtureThermo::correctContactAngle bool matched = (tp.key().first() == alpha1.name()); - scalar theta0 = convertToRad*tp().theta0(matched); + const scalar theta0 = degToRad(tp().theta0(matched)); scalarField theta(boundary[patchi].size(), theta0); scalar uTheta = tp().uTheta(); @@ -863,8 +860,8 @@ void Foam::multiphaseMixtureThermo::correctContactAngle // Calculate the dynamic contact angle if required if (uTheta > SMALL) { - scalar thetaA = convertToRad*tp().thetaA(matched); - scalar thetaR = convertToRad*tp().thetaR(matched); + const scalar thetaA = degToRad(tp().thetaA(matched)); + const scalar thetaR = degToRad(tp().thetaR(matched)); // Calculated the component of the velocity parallel to the wall vectorField Uwall diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H index 7c8c5b6f03..1fd4e40639 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H @@ -144,9 +144,6 @@ private: //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - //- Conversion factor for degrees into radians - static const scalar convertToRad; - // Private member functions diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C index 644c3b25a0..b5495dd6ae 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C @@ -30,12 +30,7 @@ License #include "fvcDiv.H" #include "fvcGrad.H" #include "fvcSnGrad.H" - -// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // - -const Foam::scalar Foam::threePhaseInterfaceProperties::convertToRad = - Foam::constant::mathematical::pi/180.0; - +#include "unitConversion.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -83,7 +78,7 @@ void Foam::threePhaseInterfaceProperties::correctContactAngle scalarField theta ( - convertToRad + degToRad() * ( twoPhaseAlpha2*(180 - a2cap.theta(U[patchi], nHatp)) + twoPhaseAlpha3*(180 - a3cap.theta(U[patchi], nHatp)) diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H index 826d6658d9..482a8a1a8e 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H @@ -91,10 +91,6 @@ class threePhaseInterfaceProperties public: - //- Conversion factor for degrees into radians - static const scalar convertToRad; - - // Constructors //- Construct from volume fraction field alpha and IOdictionary diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index de3084f69f..425be38063 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -35,12 +35,7 @@ License #include "fvcDiv.H" #include "fvcFlux.H" #include "fvcAverage.H" - -// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // - -const Foam::scalar Foam::multiphaseSystem::convertToRad = - Foam::constant::mathematical::pi/180.0; - +#include "unitConversion.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -290,7 +285,7 @@ void Foam::multiphaseSystem::correctContactAngle bool matched = (tp.key().first() == phase1.name()); - scalar theta0 = convertToRad*tp().theta0(matched); + const scalar theta0 = degToRad(tp().theta0(matched)); scalarField theta(boundary[patchi].size(), theta0); scalar uTheta = tp().uTheta(); @@ -298,8 +293,8 @@ void Foam::multiphaseSystem::correctContactAngle // Calculate the dynamic contact angle if required if (uTheta > SMALL) { - scalar thetaA = convertToRad*tp().thetaA(matched); - scalar thetaR = convertToRad*tp().thetaR(matched); + const scalar thetaA = degToRad(tp().thetaA(matched)); + const scalar thetaR = degToRad(tp().thetaR(matched)); // Calculated the component of the velocity parallel to the wall vectorField Uwall diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H index 02b56684da..0094c2c164 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H @@ -187,9 +187,6 @@ private: //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - //- Conversion factor for degrees into radians - static const scalar convertToRad; - // Private member functions diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index b6144051a4..63a2776db4 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -33,12 +33,7 @@ License #include "fvcSnGrad.H" #include "fvcDiv.H" #include "fvcFlux.H" - -// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // - -const Foam::scalar Foam::multiphaseMixture::convertToRad = - Foam::constant::mathematical::pi/180.0; - +#include "unitConversion.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -456,7 +451,7 @@ void Foam::multiphaseMixture::correctContactAngle bool matched = (tp.key().first() == alpha1.name()); - scalar theta0 = convertToRad*tp().theta0(matched); + const scalar theta0 = degToRad(tp().theta0(matched)); scalarField theta(boundary[patchi].size(), theta0); scalar uTheta = tp().uTheta(); @@ -464,8 +459,8 @@ void Foam::multiphaseMixture::correctContactAngle // Calculate the dynamic contact angle if required if (uTheta > SMALL) { - scalar thetaA = convertToRad*tp().thetaA(matched); - scalar thetaR = convertToRad*tp().thetaR(matched); + const scalar thetaA = degToRad(tp().thetaA(matched)); + const scalar thetaR = degToRad(tp().thetaR(matched)); // Calculated the component of the velocity parallel to the wall vectorField Uwall diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H index 44150c9d2b..0183652ffc 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H @@ -154,9 +154,6 @@ private: //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - //- Conversion factor for degrees into radians - static const scalar convertToRad; - // Private member functions diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 627af1db87..1f8f83599b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -40,6 +40,8 @@ License #include "fvmLaplacian.H" #include "fvmSup.H" +#include "unitConversion.H" + // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // namespace Foam @@ -48,9 +50,6 @@ namespace Foam defineRunTimeSelectionTable(multiphaseSystem, dictionary); } -const Foam::scalar Foam::multiphaseSystem::convertToRad = - Foam::constant::mathematical::pi/180.0; - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -399,7 +398,7 @@ void Foam::multiphaseSystem::correctContactAngle bool matched = (tp.key().first() == phase1.name()); - scalar theta0 = convertToRad*tp().theta0(matched); + const scalar theta0 = degToRad(tp().theta0(matched)); scalarField theta(boundary[patchi].size(), theta0); scalar uTheta = tp().uTheta(); @@ -407,8 +406,8 @@ void Foam::multiphaseSystem::correctContactAngle // Calculate the dynamic contact angle if required if (uTheta > SMALL) { - scalar thetaA = convertToRad*tp().thetaA(matched); - scalar thetaR = convertToRad*tp().thetaR(matched); + const scalar thetaA = degToRad(tp().thetaA(matched)); + const scalar thetaR = degToRad(tp().thetaR(matched)); // Calculated the component of the velocity parallel to the wall vectorField Uwall diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H index 57a5afcb41..0c43f6dd8f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H @@ -65,9 +65,6 @@ class multiphaseSystem //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - //- Conversion factor for degrees into radians - static const scalar convertToRad; - // Private member functions diff --git a/applications/utilities/mesh/conversion/datToFoam/datToFoam.C b/applications/utilities/mesh/conversion/datToFoam/datToFoam.C index ec4b6e994f..06564cd80f 100644 --- a/applications/utilities/mesh/conversion/datToFoam/datToFoam.C +++ b/applications/utilities/mesh/conversion/datToFoam/datToFoam.C @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) fileName pointsFile(runTime.constantPath()/"points.tmp"); OFstream pFile(pointsFile); - scalar a(degToRad(0.1)); + const scalar a = 0.1_deg; tensor rotateZ = tensor ( diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index 6b5fa8621c..8db1bdfec8 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -419,7 +419,7 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size()) { // Distribute the points to be +/- 2.5deg from the x-z plane - scalar tanTheta = Foam::tan(degToRad(2.5)); + const scalar tanTheta = Foam::tan(2.5_deg); SLList::iterator iterf = pFaces[WEDGE][0].begin(); SLList::iterator iterb = pFaces[WEDGE][1].begin(); diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C index 9567b8886b..df009f3083 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C @@ -33,10 +33,10 @@ License using namespace Foam::vectorTools; const Foam::scalar Foam::conformalVoronoiMesh::searchConeAngle - = Foam::cos(degToRad(30)); + = Foam::cos(30.0_deg); const Foam::scalar Foam::conformalVoronoiMesh::searchAngleOppositeSurface - = Foam::cos(degToRad(150)); + = Foam::cos(150.0_deg); // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/unitConversion/unitConversion.H b/src/OpenFOAM/global/unitConversion/unitConversion.H index 499ecd6aab..1308947e2d 100644 --- a/src/OpenFOAM/global/unitConversion/unitConversion.H +++ b/src/OpenFOAM/global/unitConversion/unitConversion.H @@ -53,6 +53,18 @@ inline constexpr scalar radToDeg(const scalar rad) noexcept return (rad*180.0/M_PI); } +//- Multiplication factor for degrees to radians conversion +inline constexpr scalar degToRad() noexcept +{ + return (M_PI/180.0); +} + +//- Multiplication factor for radians to degrees conversion +inline constexpr scalar radToDeg() noexcept +{ + return (180.0/M_PI); +} + //- Conversion from atm to Pa inline constexpr scalar atmToPa(const scalar atm) noexcept { diff --git a/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C b/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C index 70a1347169..97f35afa23 100644 --- a/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C @@ -43,7 +43,7 @@ namespace Foam } // Angle for polys to be considered splitHexes. -const Foam::scalar Foam::topoCellLooper::featureCos = Foam::cos(degToRad(10.0)); +const Foam::scalar Foam::topoCellLooper::featureCos = Foam::cos(10.0_deg); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C index 71623907fd..689d112f67 100644 --- a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C +++ b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C @@ -184,7 +184,7 @@ Foam::undoableMeshCutter::undoableMeshCutter faceRemover_ ( mesh, - Foam::cos(degToRad(30.0)) + Foam::cos(30.0_deg) ) {} diff --git a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C index 683e356b23..a8c5d41858 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C @@ -204,7 +204,7 @@ Foam::targetCoeffTrim::targetCoeffTrim nIter_(50), tol_(1e-8), relax_(1.0), - dTheta_(degToRad(0.1)), + dTheta_(0.1_deg), alpha_(1.0) { read(dict); diff --git a/src/lumpedPointMotion/lumpedPointState.C b/src/lumpedPointMotion/lumpedPointState.C index 22d2fe9648..0ef9f5a48f 100644 --- a/src/lumpedPointMotion/lumpedPointState.C +++ b/src/lumpedPointMotion/lumpedPointState.C @@ -178,12 +178,12 @@ void Foam::lumpedPointState::relax if (prev.degrees_) { // Was degrees, now radians - convert = degToRad(1); + convert = degToRad(); } else { // Was radians, now degrees - convert = radToDeg(1); + convert = radToDeg(); } } diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C index cae319df79..931501b342 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C @@ -148,14 +148,14 @@ Foam::label Foam::meshRefinement::createBaffle // { // return true; // } -// else if (mag(n1&n2) > cos(degToRad(30))) +// else if (mag(n1&n2) > cos(30.0_deg)) // { // // Both normals aligned. Check that test vector perpendicularish to // // surface normal // scalar magTestDir = mag(testDir); // if (magTestDir > VSMALL) // { -// if (mag(n1&(testDir/magTestDir)) < cos(degToRad(45))) +// if (mag(n1&(testDir/magTestDir)) < cos(45.0_deg)) // { // //Pout<< "** disabling baffling face " // // << mesh_.faceCentres()[faceI] << endl; diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementGapRefine.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementGapRefine.C index d7b175703b..6b301662ee 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementGapRefine.C +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementGapRefine.C @@ -526,7 +526,7 @@ Foam::label Foam::meshRefinement::markSurfaceGapRefinement // const indexedOctree& tree = s.tree(); // // -// const scalar searchCos(Foam::cos(degToRad(30))); +// const scalar searchCos = Foam::cos(30.0_deg); // // // Normals for ray shooting and inside/outside detection // vectorField nearNormal; diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C index c9dba90ec0..f46eaf6ca8 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C @@ -1632,7 +1632,7 @@ bool Foam::meshRefinement::isNormalGap d /= magD; // Check average normal with respect to intersection locations - if (mag(avg&d) > Foam::cos(degToRad(45))) + if (mag(avg&d) > Foam::cos(45.0_deg)) { return true; } diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C index 05adb3e125..140b4f0c2d 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C @@ -1134,7 +1134,7 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine // } //} - const scalar oppositeCos = Foam::cos(Foam::degToRad(135)); + const scalar oppositeCos = Foam::cos(135.0_deg); forAllConstIter(cellSet, transitionCells, iter) { @@ -1861,8 +1861,8 @@ void Foam::snappyRefineDriver::mergePatchFaces { meshRefiner_.mergePatchFacesUndo ( - Foam::cos(degToRad(45.0)), - Foam::cos(degToRad(45.0)), + Foam::cos(45.0_deg), + Foam::cos(45.0_deg), meshRefiner_.meshedPatches(), motionDict, labelList(mesh.nFaces(), -1) @@ -1873,8 +1873,8 @@ void Foam::snappyRefineDriver::mergePatchFaces // Still merge refined boundary faces if all four are on same patch meshRefiner_.mergePatchFaces ( - Foam::cos(degToRad(45.0)), - Foam::cos(degToRad(45.0)), + Foam::cos(45.0_deg), + Foam::cos(45.0_deg), 4, // only merge faces split into 4 meshRefiner_.meshedPatches() ); @@ -1885,7 +1885,7 @@ void Foam::snappyRefineDriver::mergePatchFaces meshRefiner_.checkData(); } - meshRefiner_.mergeEdgesUndo(Foam::cos(degToRad(45.0)), motionDict); + meshRefiner_.mergeEdgesUndo(Foam::cos(45.0_deg), motionDict); if (debug) { diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C index 1e5552f4d1..39a637d84c 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C @@ -1117,7 +1117,7 @@ void Foam::snappySnapDriver::detectNearSurfaces //// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // //{ - // const scalar cos45 = Foam::cos(degToRad(45)); + // const scalar cos45 = Foam::cos(45.0_deg); // vector n(cos45, cos45, cos45); // n /= mag(n); // diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C index 2846704f80..8f9ec62cc7 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C @@ -2839,7 +2839,7 @@ void Foam::snappySnapDriver::determineBaffleFeatures // Detect baffle edges. Assume initial mesh will have 0,90 or 180 // (baffle) degree angles so smoothing should make 0,90 // to be less than 90. Choose reasonable value - const scalar baffleFeatureCos = Foam::cos(degToRad(110)); + const scalar baffleFeatureCos = Foam::cos(110.0_deg); autoPtr baffleEdgeStr; diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C index 76b39fa700..9511881b8a 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C @@ -301,7 +301,7 @@ void Foam::AMIMethod::appendNbrFaces scalar cosI = n1 & n2; - if (cosI > Foam::cos(degToRad(89.0))) + if (cosI > Foam::cos(89.0_deg)) { faceIDs.append(nbrFacei); } diff --git a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C index 8758a9662a..43adc8695d 100644 --- a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C +++ b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C @@ -85,8 +85,7 @@ Foam::extendedEdgeMesh::sideVolumeTypeNames_ }; -Foam::scalar Foam::extendedEdgeMesh::cosNormalAngleTol_ = - Foam::cos(degToRad(0.1)); +Foam::scalar Foam::extendedEdgeMesh::cosNormalAngleTol_ = Foam::cos(0.1_deg); Foam::label Foam::extendedEdgeMesh::convexStart_ = 0; diff --git a/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C b/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C index a6c033a84d..1c1b4bf174 100644 --- a/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C +++ b/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C @@ -55,7 +55,7 @@ Foam::topoSetSource::addToUsageTable Foam::shapeToCell::usage_ // Angle for polys to be considered splitHexes. -Foam::scalar Foam::shapeToCell::featureCos = Foam::cos(degToRad(10.0)); +Foam::scalar Foam::shapeToCell::featureCos = Foam::cos(10.0_deg); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C index 851898de7e..cc77026b92 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C @@ -41,10 +41,10 @@ License namespace Foam { defineTypeNameAndDebug(edgeIntersections, 0); - -scalar edgeIntersections::alignedCos_ = cos(degToRad(89.0)); } +Foam::scalar Foam::edgeIntersections::alignedCos_ = Foam::cos(89.0_deg); + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C b/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C index c727121a60..a251d856a3 100644 --- a/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C +++ b/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C @@ -41,7 +41,7 @@ namespace Foam { defineTypeNameAndDebug(surfaceFeatures, 0); - const scalar surfaceFeatures::parallelTolerance = sin(degToRad(1.0)); + const scalar surfaceFeatures::parallelTolerance = sin(1.0_deg); //! \cond fileScope diff --git a/src/transportModels/interfaceProperties/interfaceProperties.C b/src/transportModels/interfaceProperties/interfaceProperties.C index f017fccca8..7fcc2629e9 100644 --- a/src/transportModels/interfaceProperties/interfaceProperties.C +++ b/src/transportModels/interfaceProperties/interfaceProperties.C @@ -30,12 +30,7 @@ License #include "fvcDiv.H" #include "fvcGrad.H" #include "fvcSnGrad.H" - -// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // - -const Foam::scalar Foam::interfaceProperties::convertToRad = - Foam::constant::mathematical::pi/180.0; - +#include "unitConversion.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -72,7 +67,7 @@ void Foam::interfaceProperties::correctContactAngle fvsPatchVectorField& nHatp = nHatb[patchi]; const scalarField theta ( - convertToRad*acap.theta(U_.boundaryField()[patchi], nHatp) + degToRad() * acap.theta(U_.boundaryField()[patchi], nHatp) ); const vectorField nf diff --git a/src/transportModels/interfaceProperties/interfaceProperties.H b/src/transportModels/interfaceProperties/interfaceProperties.H index 81c08948ca..88d0f82361 100644 --- a/src/transportModels/interfaceProperties/interfaceProperties.H +++ b/src/transportModels/interfaceProperties/interfaceProperties.H @@ -96,10 +96,6 @@ class interfaceProperties public: - //- Conversion factor for degrees into radians - static const scalar convertToRad; - - // Constructors //- Construct from volume fraction field gamma and IOdictionary