diff --git a/applications/solvers/combustion/dieselEngineFoam/createSpray.H b/applications/solvers/combustion/dieselEngineFoam/createSpray.H index ea4d0121b6..6b78689f09 100644 --- a/applications/solvers/combustion/dieselEngineFoam/createSpray.H +++ b/applications/solvers/combustion/dieselEngineFoam/createSpray.H @@ -30,7 +30,7 @@ scalar gasMass0 = fvc::domainIntegrate(rho).value(); if (dieselSpray.twoD()) { - gasMass0 *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge(); + gasMass0 *= constant::math::twoPi/dieselSpray.angleOfWedge(); } gasMass0 -= diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C index e3f9c0b118..709b70f7a6 100644 --- a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C +++ b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C @@ -43,6 +43,7 @@ Description #include "OFstream.H" #include "volPointInterpolation.H" #include "thermoPhysicsTypes.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/dieselEngineFoam/spraySummary.H b/applications/solvers/combustion/dieselEngineFoam/spraySummary.H index 31337d0a77..2bacaa91ee 100644 --- a/applications/solvers/combustion/dieselEngineFoam/spraySummary.H +++ b/applications/solvers/combustion/dieselEngineFoam/spraySummary.H @@ -20,7 +20,7 @@ if (dieselSpray.twoD()) { - gasMass *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge(); + gasMass *= constant::math::twoPi/dieselSpray.angleOfWedge(); } scalar addedMass = gasMass - gasMass0; diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C index 86460c1e9a..8d5dd0d9fa 100644 --- a/applications/solvers/combustion/dieselFoam/dieselFoam.C +++ b/applications/solvers/combustion/dieselFoam/dieselFoam.C @@ -41,6 +41,7 @@ Description #include "IFstream.H" #include "OFstream.H" #include "Switch.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/engineFoam/engineFoam.C b/applications/solvers/combustion/engineFoam/engineFoam.C index 9adf73cc67..8ff998217d 100644 --- a/applications/solvers/combustion/engineFoam/engineFoam.C +++ b/applications/solvers/combustion/engineFoam/engineFoam.C @@ -58,6 +58,7 @@ Description #include "ignition.H" #include "Switch.H" #include "OFstream.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C index b2d007094e..276cac6ae0 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C @@ -28,7 +28,7 @@ License #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -182,7 +182,7 @@ void smoluchowskiJumpTFvPatchScalarField::updateCoeffs() } Field C2 = pmu/prho - *sqrt(ppsi*mathematicalConstant::pi/2.0) + *sqrt(ppsi*constant::math::piByTwo) *2.0*gamma_/Pr.value()/(gamma_ + 1.0) *(2.0 - accommodationCoeff_)/accommodationCoeff_; diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index a087d0c964..7cf2ab1f25 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -28,7 +28,7 @@ Description #include "maxwellSlipUFvPatchVectorField.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "surfaceFields.H" @@ -147,7 +147,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() const fvPatchField& ppsi = patch().lookupPatchField("psi"); - Field C1 = sqrt(ppsi*mathematicalConstant::pi/2.0) + Field C1 = sqrt(ppsi*constant::math::piByTwo) *(2.0 - accommodationCoeff_)/accommodationCoeff_; Field pnu = pmu/prho; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C index 02d220138b..03e46a5c63 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "SchnerrSauer.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -77,7 +77,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::rRb { return pow ( - ((4*mathematicalConstant::pi*n_)/3) + ((4*constant::math::pi*n_)/3) *limitedAlpha1/(1.0 + alphaNuc() - limitedAlpha1), 1.0/3.0 ); @@ -87,7 +87,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::rRb Foam::dimensionedScalar Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::alphaNuc() const { - dimensionedScalar Vnuc = n_*mathematicalConstant::pi*pow3(dNuc_)/6; + dimensionedScalar Vnuc = n_*constant::math::pi*pow3(dNuc_)/6; return Vnuc/(1 + Vnuc); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 613dbfbaef..240207c8ab 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -29,11 +29,12 @@ License #include "Time.H" #include "subCycle.H" #include "fvCFD.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // const scalar Foam::multiphaseMixture::convertToRad = - Foam::mathematicalConstant::pi/180.0; + Foam::constant::math::pi/180.0; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C index 5eb399afbf..fe24603713 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "GidaspowConductivity.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -69,13 +69,13 @@ Foam::tmp Foam::GidaspowConductivity::kappa const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(mathematicalConstant::pi); + const scalar sqrtPi = sqrt(constant::math::pi); return rhoa*da*sqrt(Theta)* ( 2.0*sqr(alpha)*g0*(1.0 + e)/sqrtPi + (9.0/8.0)*sqrtPi*g0*0.5*(1.0 + e)*sqr(alpha) - + (15.0/16.0)*sqrtPi*alpha + + (15.0/16.0)*sqrtPi*alpha + (25.0/64.0)*sqrtPi/((1.0 + e)*g0) ); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index 3fdd409f5b..2d0acca9fa 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "HrenyaSinclairConductivity.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -74,9 +74,9 @@ Foam::tmp Foam::HrenyaSinclairConductivity::kappa const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(mathematicalConstant::pi); + const scalar sqrtPi = sqrt(constant::math::pi); - volScalarField lamda = + volScalarField lamda = scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_; return rhoa*da*sqrt(Theta)* diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C index 8e555dd487..40c296f7e0 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "SyamlalConductivity.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -69,7 +69,7 @@ Foam::tmp Foam::SyamlalConductivity::kappa const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(mathematicalConstant::pi); + const scalar sqrtPi = sqrt(constant::math::pi); return rhoa*da*sqrt(Theta)* ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 5a6d4aa52d..dd3f345179 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -26,7 +26,7 @@ License #include "kineticTheoryModel.H" #include "surfaceInterpolate.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "fvCFD.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -204,7 +204,7 @@ void Foam::kineticTheoryModel::solve() volScalarField alpha = alpha_; alpha.max(1.0e-6); - const scalar sqrtPi = sqrt(mathematicalConstant::pi); + const scalar sqrtPi = sqrt(constant::math::pi); surfaceScalarField phi = 1.5*rhoa_*phia_*fvc::interpolate(alpha_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C index b1a127e2e5..2a1c00b188 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "GidaspowViscosity.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -70,7 +70,7 @@ Foam::kineticTheoryModels::GidaspowViscosity::mua const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(mathematicalConstant::pi); + const scalar sqrtPi = sqrt(constant::math::pi); return rhoa*da*sqrt(Theta)* ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index 8b43147895..b5e60e94c2 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "HrenyaSinclairViscosity.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -77,7 +77,7 @@ Foam::kineticTheoryModels::HrenyaSinclairViscosity::mua const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(mathematicalConstant::pi); + const scalar sqrtPi = sqrt(constant::math::pi); volScalarField lamda = scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C index 28c2c56b07..892319df6c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "SyamlalViscosity.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -69,7 +69,7 @@ Foam::tmp Foam::kineticTheoryModels::SyamlalViscosity::mua const dimensionedScalar& e ) const { - const scalar sqrtPi = sqrt(mathematicalConstant::pi); + const scalar sqrtPi = sqrt(constant::math::pi); return rhoa*da*sqrt(Theta)* ( diff --git a/applications/test/graphXi/graphXi.C b/applications/test/graphXi/graphXi.C index 2c3a5750f3..c717f6cc1f 100644 --- a/applications/test/graphXi/graphXi.C +++ b/applications/test/graphXi/graphXi.C @@ -32,7 +32,7 @@ Description #include "graph.H" #include "OFstream.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" using namespace Foam; @@ -50,7 +50,7 @@ int main() scalarField b = 0.5*(1.0 + erf(x)); scalarField c = 1.0 - b; - scalarField gradb = (1/::sqrt(mathematicalConstant::pi))*exp(-sqr(x)); + scalarField gradb = (1/::sqrt(constant::math::pi))*exp(-sqr(x)); scalarField lapb = -2*x*gradb; r = lapb*b*c/(gradb*gradb); diff --git a/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C b/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C index d4d6d11539..0905771d19 100644 --- a/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C +++ b/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C @@ -47,7 +47,7 @@ Description #include "polyTopoChanger.H" #include "polyMesh.H" #include "mapPolyMesh.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "PackedBoolList.H" #include "SortableList.H" @@ -467,7 +467,7 @@ int main(int argc, char *argv[]) scalar angle(readScalar(IStringStream(args.additionalArgs()[1])())); bool overwrite = args.optionFound("overwrite"); - scalar maxCos = Foam::cos(angle*180/mathematicalConstant::pi); + scalar maxCos = Foam::cos(angle*180/constant::math::pi); Info<< "Merging:" << nl << " edges with length less than " << minLen << " meters" << nl diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C index 60c9439561..de7af2b077 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -53,7 +53,7 @@ Description #include "removePoints.H" #include "polyMesh.H" #include "mapPolyMesh.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" using namespace Foam; @@ -445,12 +445,12 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - scalar minCos = Foam::cos(featureAngle*mathematicalConstant::pi/180.0); + scalar minCos = Foam::cos(featureAngle*constant::math::pi/180.0); scalar concaveAngle = defaultConcaveAngle; args.optionReadIfPresent("concaveAngle", concaveAngle); - scalar concaveSin = Foam::sin(concaveAngle*mathematicalConstant::pi/180.0); + scalar concaveSin = Foam::sin(concaveAngle*constant::math::pi/180.0); bool snapMeshDict = args.optionFound("snapMesh"); bool overwrite = args.optionFound("overwrite"); diff --git a/applications/utilities/mesh/advanced/splitCells/splitCells.C b/applications/utilities/mesh/advanced/splitCells/splitCells.C index 85afb3a771..1d9c0e5b54 100644 --- a/applications/utilities/mesh/advanced/splitCells/splitCells.C +++ b/applications/utilities/mesh/advanced/splitCells/splitCells.C @@ -49,7 +49,7 @@ Description #include "cellSet.H" #include "cellModeller.H" #include "meshCutter.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "geomCellLooper.H" #include "plane.H" #include "edgeVertex.H" @@ -539,7 +539,7 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - scalar radAngle = featureAngle * mathematicalConstant::pi/180.0; + scalar radAngle = featureAngle*constant::math::pi/180.0; scalar minCos = Foam::cos(radAngle); scalar minSin = Foam::sin(radAngle); diff --git a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C index 1da7ba049e..996cd67d4c 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C +++ b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C @@ -43,7 +43,7 @@ Description #include "symmetryPolyPatch.H" #include "wedgePolyPatch.H" #include "cyclicPolyPatch.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" using namespace Foam; diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index d315dce4a0..f1ec25a59c 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -223,7 +223,7 @@ const char* kivaPatchNames[nBCs] = "cylinderHead", "axis", "wedge", - "inflow", + "inflow", "outflow", "presin", "presout", @@ -434,7 +434,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(2.5*mathematicalConstant::pi/180.0); + scalar tanTheta = Foam::tan(2.5*constant::math::pi/180.0); SLList::iterator iterf = pFaces[WEDGE][0].begin(); SLList::iterator iterb = pFaces[WEDGE][1].begin(); diff --git a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C index 2707469a6c..65dd5c952d 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C @@ -59,7 +59,7 @@ Usage #include "Time.H" #include "timeSelector.H" #include "fvMesh.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "polyTopoChange.H" #include "mapPolyMesh.H" #include "PackedBoolList.H" @@ -91,7 +91,7 @@ void simpleMarkFeatures labelList& multiCellFeaturePoints ) { - scalar minCos = Foam::cos(featureAngle * mathematicalConstant::pi/180.0); + scalar minCos = Foam::cos(featureAngle*constant::math::pi/180.0); const polyBoundaryMesh& patches = mesh.boundaryMesh(); @@ -387,7 +387,7 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - scalar minCos = Foam::cos(featureAngle * mathematicalConstant::pi/180.0); + scalar minCos = Foam::cos(featureAngle*constant::math::pi/180.0); Info<< "Feature:" << featureAngle << endl << "minCos :" << minCos << endl diff --git a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C b/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C index 910df915d8..0b135188e0 100644 --- a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C +++ b/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C @@ -33,7 +33,7 @@ Description #include "IOmanip.H" #include "boundBox.H" #include "Map.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -99,7 +99,7 @@ void starMesh::createCoupleMatches() << coupleI << ". STAR couple ID: " << couples_[coupleI].coupleID() << endl << "The angle between face normals is " - << Foam::acos(faceAreaAngle)/mathematicalConstant::pi*180 + << Foam::acos(faceAreaAngle)/constant::math::pi*180 << " deg." << endl << "master cell: " << fp.masterCell() << " STAR number: " << starCellID_[fp.masterCell()] diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/arcEdge.C b/applications/utilities/mesh/generation/blockMesh/curvedEdges/arcEdge.C index 886281274b..2039ffb0bb 100644 --- a/applications/utilities/mesh/generation/blockMesh/curvedEdges/arcEdge.C +++ b/applications/utilities/mesh/generation/blockMesh/curvedEdges/arcEdge.C @@ -29,7 +29,7 @@ Description \*---------------------------------------------------------------------------*/ #include "arcEdge.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -78,7 +78,7 @@ Foam::cylindricalCS Foam::arcEdge::calcAngle() // find angles scalar tmp = (r3&r1)/(mag(r3)*mag(r1)); - angle_ = acos(tmp)*180.0/mathematicalConstant::pi; + angle_ = acos(tmp)*180.0/constant::math::pi; // check if the vectors define an exterior or an interior arcEdge if (((r1 ^ r2)&(r1 ^ r3)) < 0.0) angle_ = 360 - angle_; @@ -162,7 +162,7 @@ Foam::vector Foam::arcEdge::position(const scalar lambda) const //- Return the length of the curve Foam::scalar Foam::arcEdge::length() const { - return angle_*radius_*mathematicalConstant::pi/180.0; + return angle_*radius_*constant::math::pi/180.0; } diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C index 4d5bca0e82..4d7d6bc81d 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C @@ -39,7 +39,6 @@ Description #include "polyTopoChange.H" #include "polyTopoChanger.H" #include "edgeCollapser.H" -#include "mathematicalConstants.H" #include "globalMeshData.H" #include "perfectInterface.H" #include "addPatchCellLayer.H" diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C index 5d0a3621b4..07ddf34eaf 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C @@ -26,7 +26,7 @@ License #include "wedge.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,7 +52,7 @@ wedge::wedge(const dictionary& dict) angle_ ( readScalar(coeffDict_.lookup("angle")) - *mathematicalConstant::pi/180.0 + *constant::math::pi/180.0 ) {} diff --git a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C index 758592590c..3c48f6d7d7 100644 --- a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C +++ b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C @@ -33,7 +33,7 @@ Description #include "Time.H" #include "boundaryMesh.H" #include "repatchPolyTopoChanger.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "OFstream.H" #include "ListOps.H" @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); bool overwrite = args.optionFound("overwrite"); - scalar minCos = Foam::cos(featureAngle * mathematicalConstant::pi/180.0); + scalar minCos = Foam::cos(featureAngle*constant::math::pi/180.0); Info<< "Feature:" << featureAngle << endl << "minCos :" << minCos << endl diff --git a/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C b/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C index e77fbaf022..c6d7b8f61e 100644 --- a/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C +++ b/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C @@ -67,9 +67,10 @@ Usage #include "transformField.H" #include "transformGeometricField.H" #include "IStringStream.H" +#include "mathConstants.H" using namespace Foam; -using namespace Foam::mathematicalConstant; +using namespace Foam::constant::math; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/utilities/preProcessing/engineSwirl/engineSwirl.C b/applications/utilities/preProcessing/engineSwirl/engineSwirl.C index e9171c330c..92e3057093 100644 --- a/applications/utilities/preProcessing/engineSwirl/engineSwirl.C +++ b/applications/utilities/preProcessing/engineSwirl/engineSwirl.C @@ -31,7 +31,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - scalar Vphi = (mathematicalConstant::pi*swirlRPMRatio*rpm/30).value(); + scalar Vphi = (constant::math::pi*swirlRPMRatio*rpm/30).value(); scalar b1 = j1(swirlProfile).value(); scalar b2 = 2.0*b1/swirlProfile.value() - j0(swirlProfile).value(); diff --git a/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C b/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C index c3243b71ae..78716d63c7 100644 --- a/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C +++ b/applications/utilities/surface/surfaceTransformPoints/surfaceTransformPoints.C @@ -43,9 +43,10 @@ Description #include "transformField.H" #include "Pair.H" #include "quaternion.H" +#include "mathConstants.H" using namespace Foam; -using namespace Foam::mathematicalConstant; +using namespace Foam::constant::math; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/physicoChemical/physicoChemicalConstants.H b/src/OpenFOAM/global/dimensionedConstants/constants/physicoChemical/physicoChemicalConstants.H index 28ddd776c8..7f25e0dfb7 100644 --- a/src/OpenFOAM/global/dimensionedConstants/constants/physicoChemical/physicoChemicalConstants.H +++ b/src/OpenFOAM/global/dimensionedConstants/constants/physicoChemical/physicoChemicalConstants.H @@ -49,7 +49,7 @@ namespace physicoChemical //- Group name for physico-chemical constants extern const char* group; - //- Universal gas constant: default SI units: [J/kg/K] + //- Universal gas constant: default SI units: [J/mol/K] extern const dimensionedScalar R; //- Faraday constant: default SI units: [C/mol] diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C index f371e697a1..a7bbf88005 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.C +++ b/src/OpenFOAM/meshes/meshShapes/face/face.C @@ -27,7 +27,7 @@ License #include "face.H" #include "triFace.H" #include "triPointRef.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -99,13 +99,13 @@ Foam::label Foam::face::mostConcaveAngle if ((edgeNormal & n) > 0) { // Concave angle. - angle = mathematicalConstant::pi + edgeAngle; + angle = constant::math::pi + edgeAngle; } else { // Convex angle. Note '-' to take into account that rightEdge // and leftEdge are head-to-tail connected. - angle = mathematicalConstant::pi - edgeAngle; + angle = constant::math::pi - edgeAngle; } if (angle > maxAngle) @@ -214,7 +214,7 @@ Foam::label Foam::face::split label index = fcIndex(fcIndex(startIndex)); label minIndex = index; - scalar minDiff = Foam::mathematicalConstant::pi; + scalar minDiff = constant::math::pi; for(label i = 0; i < size() - 3; i++) { diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C index 29841d3ec8..01879f089f 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C @@ -27,7 +27,7 @@ License #include "primitiveMesh.H" #include "pyramidPointFaceRef.H" #include "ListOps.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "SortableList.H" @@ -410,7 +410,7 @@ bool Foam::primitiveMesh::checkFaceOrthogonality // Severe nonorthogonality threshold const scalar severeNonorthogonalityThreshold = - ::cos(nonOrthThreshold_/180.0*mathematicalConstant::pi); + ::cos(nonOrthThreshold_/180.0*constant::math::pi); scalar minDDotS = GREAT; @@ -472,9 +472,9 @@ bool Foam::primitiveMesh::checkFaceOrthogonality if (debug || report) { Info<< " Mesh non-orthogonality Max: " - << ::acos(minDDotS)/mathematicalConstant::pi*180.0 + << ::acos(minDDotS)/constant::math::pi*180.0 << " average: " << - ::acos(sumDDotS/neiSize)/mathematicalConstant::pi*180.0 + ::acos(sumDDotS/neiSize)/constant::math::pi*180.0 << endl; } } @@ -839,7 +839,7 @@ bool Foam::primitiveMesh::checkFaceAngles << exit(FatalError); } - const scalar maxSin = Foam::sin(maxDeg/180.0*mathematicalConstant::pi); + const scalar maxSin = Foam::sin(maxDeg/180.0*constant::math::pi); const pointField& p = points(); const faceList& fcs = faces(); @@ -916,7 +916,7 @@ bool Foam::primitiveMesh::checkFaceAngles { scalar maxConcaveDegr = Foam::asin(Foam::min(1.0, maxEdgeSin)) - *180.0/mathematicalConstant::pi; + *180.0/constant::math::pi; if (debug || report) { diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C index 8a82cc4189..1dafd61f61 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C @@ -31,7 +31,7 @@ Description #include "primitiveMesh.H" #include "pyramidPointFaceRef.H" #include "cell.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -200,7 +200,7 @@ bool Foam::primitiveMesh::checkMeshMotion ) << "Severe non-orthogonality in mesh motion for face " << faceI << " between cells " << own[faceI] << " and " << nei[faceI] - << ": Angle = " << ::acos(dDotS)/mathematicalConstant::pi*180.0 + << ": Angle = " << ::acos(dDotS)/constant::math::pi*180.0 << " deg." << endl; nDotProductErrors++; diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H index a21461bc62..881fb1d520 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H @@ -26,7 +26,7 @@ License #include "IOstreams.H" #include "pointHit.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -307,9 +307,9 @@ inline scalar triangle::quality() const return mag() / ( - mathematicalConstant::pi - * Foam::sqr(circumRadius()) - * 0.413497 + constant::math::pi + *Foam::sqr(circumRadius()) + *0.413497 + VSMALL ); } diff --git a/src/OpenFOAM/primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C b/src/OpenFOAM/primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C index cd8ed8f9b5..7668cfe0e9 100644 --- a/src/OpenFOAM/primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C +++ b/src/OpenFOAM/primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C @@ -25,7 +25,6 @@ License \*---------------------------------------------------------------------------*/ #include "labelSymmTensor.H" -#include "mathematicalConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/Tensor/tensor/tensor.C b/src/OpenFOAM/primitives/Tensor/tensor/tensor.C index f365893125..6ecc1da313 100644 --- a/src/OpenFOAM/primitives/Tensor/tensor/tensor.C +++ b/src/OpenFOAM/primitives/Tensor/tensor/tensor.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "tensor.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -150,10 +150,8 @@ vector eigenValues(const tensor& t) scalar aBy3 = a/3; i = m2SqrtQ*cos(theta/3) - aBy3; - ii = m2SqrtQ*cos((theta + mathematicalConstant::twoPi)/3) - - aBy3; - iii = m2SqrtQ*cos((theta - mathematicalConstant::twoPi)/3) - - aBy3; + ii = m2SqrtQ*cos((theta + constant::math::twoPi)/3) - aBy3; + iii = m2SqrtQ*cos((theta - constant::math::twoPi)/3) - aBy3; } else { @@ -345,10 +343,8 @@ vector eigenValues(const symmTensor& t) scalar aBy3 = a/3; i = m2SqrtQ*cos(theta/3) - aBy3; - ii = m2SqrtQ*cos((theta + mathematicalConstant::twoPi)/3) - - aBy3; - iii = m2SqrtQ*cos((theta - mathematicalConstant::twoPi)/3) - - aBy3; + ii = m2SqrtQ*cos((theta + constant::math::twoPi)/3) - aBy3; + iii = m2SqrtQ*cos((theta - constant::math::twoPi)/3) - aBy3; } else { diff --git a/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C b/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C index e782cd0fea..b817d4ab5e 100644 --- a/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C +++ b/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C @@ -25,7 +25,6 @@ License \*---------------------------------------------------------------------------*/ #include "tensor2D.H" -#include "mathematicalConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/mathematicalConstants/mathematicalConstants.H b/src/OpenFOAM/primitives/mathematicalConstants/mathematicalConstants.H deleted file mode 100644 index c1b45e9694..0000000000 --- a/src/OpenFOAM/primitives/mathematicalConstants/mathematicalConstants.H +++ /dev/null @@ -1,61 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Namespace - Foam::mathematicalConstant - -Description - Mathematical constants such as pi, e. - -\*---------------------------------------------------------------------------*/ - -#ifndef mathematicalConstants_H -#define mathematicalConstants_H - -#include "scalar.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace mathematicalConstant -{ - const scalar e(M_E); - const scalar pi(M_PI); - const scalar twoPi(2*pi); - const scalar piByTwo(0.5*pi); -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/transform/transform.H b/src/OpenFOAM/primitives/transform/transform.H index 33bf2b1d39..8d6657b41f 100644 --- a/src/OpenFOAM/primitives/transform/transform.H +++ b/src/OpenFOAM/primitives/transform/transform.H @@ -34,7 +34,7 @@ Description #define transform_H #include "tensor.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -104,7 +104,7 @@ inline Tensor transform(const tensor& tt, const Tensor& t) (tt.yx()*t.xx() + tt.yy()*t.yx() + tt.yz()*t.zx())*tt.zx() + (tt.yx()*t.xy() + tt.yy()*t.yy() + tt.yz()*t.zy())*tt.zy() + (tt.yx()*t.xz() + tt.yy()*t.yz() + tt.yz()*t.zz())*tt.zz(), - + (tt.zx()*t.xx() + tt.zy()*t.yx() + tt.zz()*t.zx())*tt.xx() + (tt.zx()*t.xy() + tt.zy()*t.yy() + tt.zz()*t.zy())*tt.xy() + (tt.zx()*t.xz() + tt.zy()*t.yz() + tt.zz()*t.zz())*tt.xz(), @@ -155,7 +155,7 @@ inline SymmTensor transform(const tensor& tt, const SymmTensor& st) (tt.yx()*st.xx() + tt.yy()*st.xy() + tt.yz()*st.xz())*tt.zx() + (tt.yx()*st.xy() + tt.yy()*st.yy() + tt.yz()*st.yz())*tt.zy() + (tt.yx()*st.xz() + tt.yy()*st.yz() + tt.yz()*st.zz())*tt.zz(), - + (tt.zx()*st.xx() + tt.zy()*st.xy() + tt.zz()*st.xz())*tt.zx() + (tt.zx()*st.xy() + tt.zy()*st.yy() + tt.zz()*st.yz())*tt.zy() + (tt.zx()*st.xz() + tt.zy()*st.yz() + tt.zz()*st.zz())*tt.zz() @@ -205,11 +205,11 @@ inline scalar pseudoAngle if (sin < -SMALL) { - return (3.0 + cos)*mathematicalConstant::piByTwo; + return (3.0 + cos)*constant::math::piByTwo; } else { - return (1.0 - cos)*mathematicalConstant::piByTwo; + return (1.0 - cos)*constant::math::piByTwo; } } diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index 716bdc6ddf..27ca388fe3 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -34,7 +34,7 @@ Description #include "removePoints.H" #include "pointFields.H" #include "motionSmoother.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "pointSet.H" #include "faceSet.H" #include "cellSet.H" @@ -2479,17 +2479,11 @@ void Foam::autoLayerDriver::mergePatchFacesUndo const dictionary& motionDict ) { - scalar minCos = Foam::cos - ( - layerParams.featureAngle() - * mathematicalConstant::pi/180.0 - ); + scalar minCos = + Foam::cos(layerParams.featureAngle()*constant::math::pi/180.0); - scalar concaveCos = Foam::cos - ( - layerParams.concaveAngle() - * mathematicalConstant::pi/180.0 - ); + scalar concaveCos = + Foam::cos(layerParams.concaveAngle()*constant::math::pi/180.0); Info<< nl << "Merging all faces of a cell" << nl @@ -2588,7 +2582,7 @@ void Foam::autoLayerDriver::addLayers ( pp, meshEdges, - layerParams.featureAngle()*mathematicalConstant::pi/180.0, + layerParams.featureAngle()*constant::math::pi/180.0, patchDisp, patchNLayers, diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C index 1ba66fffe9..3ea198e6c4 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C @@ -35,6 +35,7 @@ License #include "refinementSurfaces.H" #include "shellSurfaces.H" #include "mapDistributePolyMesh.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -678,8 +679,8 @@ void Foam::autoRefineDriver::mergePatchFaces meshRefiner_.mergePatchFaces ( - Foam::cos(45*mathematicalConstant::pi/180.0), - Foam::cos(45*mathematicalConstant::pi/180.0), + Foam::cos(45*constant::math::pi/180.0), + Foam::cos(45*constant::math::pi/180.0), meshRefiner_.meshedPatches() ); @@ -688,7 +689,7 @@ void Foam::autoRefineDriver::mergePatchFaces meshRefiner_.checkData(); } - meshRefiner_.mergeEdges(Foam::cos(45*mathematicalConstant::pi/180.0)); + meshRefiner_.mergeEdges(Foam::cos(45*constant::math::pi/180.0)); if (debug) { diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C index fad6642296..ea57136c1d 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C @@ -26,7 +26,7 @@ License #include "layerParameters.H" #include "polyBoundaryMesh.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "refinementSurfaces.H" #include "searchableSurfaces.H" #include "regExp.H" @@ -192,12 +192,7 @@ Foam::layerParameters::layerParameters ), layerTerminationCos_ ( - Foam::cos - ( - 0.5 - * featureAngle_ - * mathematicalConstant::pi/180. - ) + Foam::cos(0.5*featureAngle_*constant::math::pi/180.0) ), maxThicknessToMedialRatio_ ( @@ -206,7 +201,7 @@ Foam::layerParameters::layerParameters minMedianAxisAngleCos_ ( Foam::cos(readScalar(dict.lookup("minMedianAxisAngle"))) - * mathematicalConstant::pi/180. + *constant::math::pi/180.0 ), nBufferCellsNoExtrude_ ( @@ -274,12 +269,7 @@ Foam::layerParameters::layerParameters ), layerTerminationCos_ ( - Foam::cos - ( - 0.5 - * featureAngle_ - * mathematicalConstant::pi/180. - ) + Foam::cos(0.5*featureAngle_*constant::math::pi/180.0) ), maxThicknessToMedialRatio_ ( @@ -288,7 +278,7 @@ Foam::layerParameters::layerParameters minMedianAxisAngleCos_ ( Foam::cos(readScalar(dict.lookup("minMedianAxisAngle"))) - * mathematicalConstant::pi/180. + *constant::math::pi/180.0 ), nBufferCellsNoExtrude_ ( diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C index d63d527fae..ce3b82bfc6 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "refinementParameters.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "polyMesh.H" #include "globalIndex.H" @@ -63,7 +63,7 @@ Foam::refinementParameters::refinementParameters(const dictionary& dict) } else { - curvature_ = Foam::cos(featAngle*mathematicalConstant::pi/180.0); + curvature_ = Foam::cos(featAngle*constant::math::pi/180.0); } } diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C index fb0a7e2121..2f3f4e60ca 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C @@ -37,6 +37,7 @@ License #include "searchableSurfaces.H" #include "polyMeshGeometry.H" #include "IOmanip.H" +#include "mathConstants.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -246,10 +247,7 @@ Foam::Map Foam::meshRefinement::findEdgeConnectedProblemCells nearestRegion[i] ); - scalar angle = - perpendicularAngle[region] - / 180.0 - * mathematicalConstant::pi; + scalar angle = perpendicularAngle[region]/180.0*constant::math::pi; if (angle >= 0) { @@ -306,7 +304,7 @@ bool Foam::meshRefinement::isCollapsedFace vector d = ownCc - mesh_.cellCentres()[nei]; scalar dDotS = (d & s)/(mag(d)*magS + VSMALL); - + if (dDotS < maxNonOrtho) { return true; diff --git a/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C b/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C index 3b1045cdb3..5fa27e142a 100644 --- a/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C +++ b/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C @@ -27,7 +27,7 @@ License #include "dynamicInkJetFvMesh.H" #include "addToRunTimeSelectionTable.H" #include "volFields.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -90,7 +90,7 @@ Foam::dynamicInkJetFvMesh::~dynamicInkJetFvMesh() bool Foam::dynamicInkJetFvMesh::update() { scalar scalingFunction = - 0.5*(::cos(2*mathematicalConstant::pi*frequency_*time().value()) - 1.0); + 0.5*(::cos(constant::math::twoPi*frequency_*time().value()) - 1.0); Info<< "Mesh scaling. Time = " << time().value() << " scaling: " << scalingFunction << endl; @@ -113,7 +113,7 @@ bool Foam::dynamicInkJetFvMesh::update() fvMesh::movePoints(newPoints); - volVectorField& U = + volVectorField& U = const_cast(lookupObject("U")); U.correctBoundaryConditions(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C index d2f0c467d2..1fbd323685 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C @@ -26,9 +26,9 @@ License #include "SDA.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" -using namespace Foam::mathematicalConstant; +using namespace Foam::constant::math; // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -70,18 +70,18 @@ Foam::septernion Foam::solidBodyMotionFunctions::SDA::transformation() const scalar time = time_.value(); scalar Tpi = Tp_ + dTp_*(time/dTi_); // Current roll period [sec] - scalar wr = 2*pi/Tpi; // Current Freq [/sec] + scalar wr = twoPi/Tpi; // Current Freq [/sec] // Current Phase for roll [rad] scalar r = dTp_/dTi_; scalar u = Tp_ + r*time; - scalar phr = 2*pi*((Tp_/u - 1) + log(mag(u)) - log(Tp_))/r; + scalar phr = twoPi*((Tp_/u - 1) + log(mag(u)) - log(Tp_))/r; // Current Phase for Sway [rad] scalar phs = phr + pi; // Current Phase for Heave [rad] - scalar phh = phr + pi/2; + scalar phh = phr + piByTwo; scalar rollA = max(rollAmax_*exp(-sqr(Tpi - Tpn_)/(2*Q_)), rollAmin_); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SKA/SKA.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SKA/SKA.C index 6d4cdc4427..e15523f983 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SKA/SKA.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SKA/SKA.C @@ -29,9 +29,9 @@ License #include "Tuple2.H" #include "IFstream.H" #include "interpolateXY.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" -using namespace Foam::mathematicalConstant; +using namespace Foam::constant::math; // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C index e41ed4b427..7329c1dd90 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C @@ -27,11 +27,8 @@ License #include "solidBodyMotionFvMesh.H" #include "addToRunTimeSelectionTable.H" #include "volFields.H" -#include "mathematicalConstants.H" #include "transformField.H" -using namespace Foam::mathematicalConstant; - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam diff --git a/src/dynamicMesh/meshCut/cellLooper/hexCellLooper.C b/src/dynamicMesh/meshCut/cellLooper/hexCellLooper.C index e31ad4c2a1..8e705ae525 100644 --- a/src/dynamicMesh/meshCut/cellLooper/hexCellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/hexCellLooper.C @@ -28,7 +28,6 @@ License #include "cellFeatures.H" #include "polyMesh.H" #include "cellModeller.H" -#include "mathematicalConstants.H" #include "plane.H" #include "ListOps.H" #include "meshTools.H" @@ -36,18 +35,12 @@ License #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - defineTypeNameAndDebug(hexCellLooper, 0); - addToRunTimeSelectionTable(cellLooper, hexCellLooper, word); - - } diff --git a/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C b/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C index 3572546e75..8f4a57aca7 100644 --- a/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C @@ -27,7 +27,7 @@ License #include "topoCellLooper.H" #include "cellFeatures.H" #include "polyMesh.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "DynamicList.H" #include "ListOps.H" #include "meshTools.H" @@ -35,9 +35,8 @@ License #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + namespace Foam { defineTypeNameAndDebug(topoCellLooper, 0); @@ -46,7 +45,7 @@ namespace Foam // Angle for polys to be considered splitHexes. const Foam::scalar Foam::topoCellLooper::featureCos = - Foam::cos(10.0 * mathematicalConstant::pi/180.0); + Foam::cos(10.0*constant::math::pi/180.0); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C index 15478458c9..57dd15eb54 100644 --- a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C +++ b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C @@ -32,16 +32,14 @@ License #include "cellCuts.H" #include "splitCell.H" #include "mapPolyMesh.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "meshTools.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(undoableMeshCutter, 0); - } // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -193,8 +191,8 @@ Foam::undoableMeshCutter::undoableMeshCutter liveSplitCells_(mesh.nCells()/100 + 100), faceRemover_ ( - mesh, - Foam::cos(30./180. * mathematicalConstant::pi) + mesh, + Foam::cos(30.0/180.0*constant::math::pi) ) {} diff --git a/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C b/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C index 37882a2cc0..4fbd137526 100644 --- a/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C +++ b/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C @@ -27,6 +27,7 @@ License #include "polyMeshGeometry.H" #include "pyramidPointFaceRef.H" #include "syncTools.H" +#include "mathConstants.H" namespace Foam { @@ -247,7 +248,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho << " between cells " << mesh.faceOwner()[faceI] << " and " << nei << ": Angle = " - << ::acos(dDotS)/mathematicalConstant::pi*180.0 + << ::acos(dDotS)/constant::math::pi*180.0 << " deg." << endl; } @@ -268,7 +269,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho << " between cells " << mesh.faceOwner()[faceI] << " and " << nei << ": Angle = " - << ::acos(dDotS)/mathematicalConstant::pi*180.0 + << ::acos(dDotS)/constant::math::pi*180.0 << " deg." << endl; } @@ -368,7 +369,7 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct // Severe nonorthogonality threshold const scalar severeNonorthogonalityThreshold = - ::cos(orthWarn/180.0*mathematicalConstant::pi); + ::cos(orthWarn/180.0*constant::math::pi); // Calculate coupled cell centre @@ -503,9 +504,9 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct if (nDDotS > 0) { Info<< "Mesh non-orthogonality Max: " - << ::acos(minDDotS)/mathematicalConstant::pi*180.0 + << ::acos(minDDotS)/constant::math::pi*180.0 << " average: " << - ::acos(sumDDotS/nDDotS)/mathematicalConstant::pi*180.0 + ::acos(sumDDotS/nDDotS)/constant::math::pi*180.0 << endl; } } @@ -1170,7 +1171,7 @@ bool Foam::polyMeshGeometry::checkVolRatio { label face0 = baffles[i].first(); label face1 = baffles[i].second(); - + scalar ownVol = mag(cellVolumes[own[face0]]); scalar neiVol = mag(cellVolumes[own[face1]]); @@ -1257,7 +1258,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles << abort(FatalError); } - const scalar maxSin = Foam::sin(maxDeg/180.0*mathematicalConstant::pi); + const scalar maxSin = Foam::sin(maxDeg/180.0*constant::math::pi); const faceList& fcs = mesh.faces(); @@ -1338,7 +1339,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles { scalar maxConcaveDegr = Foam::asin(Foam::min(1.0, maxEdgeSin)) - * 180.0/mathematicalConstant::pi; + *180.0/constant::math::pi; Info<< "There are " << nConcave << " faces with concave angles between consecutive" @@ -1823,7 +1824,7 @@ bool Foam::polyMeshGeometry::checkCellDeterminant forAll(cFaces, cFaceI) { label faceI = cFaces[cFaceI]; - + scalar magArea = mag(faceAreas[faceI]); magAreaSum += magArea; @@ -1850,7 +1851,7 @@ bool Foam::polyMeshGeometry::checkCellDeterminant nWarnDet++; } } - + reduce(minDet, minOp()); reduce(sumDet, sumOp()); reduce(nSumDet, sumOp