diff --git a/applications/solvers/combustion/dieselEngineFoam/createSpray.H b/applications/solvers/combustion/dieselEngineFoam/createSpray.H index ea4d0121b691884e8a774bb5c77e49bf836f10ac..6b78689f09094ddcfb160533fb851bc257b9f454 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 e3f9c0b118e42571d54e2ad3fa5d0ecdc0760025..709b70f7a6d73522b135933c7f675a3e4e6c6a3d 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 31337d0a77ee0dea6b686bd8f1c2b551d317329a..2bacaa91ee922e8b8663a4bc97c2ee76140b2717 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 86460c1e9a0d7296bdec7d356e737b17cbc0101a..8d5dd0d9facad1d3a6d7a7cca51458c1ab095a4e 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 9adf73cc67c167a7cbbee0474c461aea7afdafb8..8ff998217d3965354de1a5e0dcee81b74f2f953a 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 b2d007094ee3bcf2456b7b0985991fd217783998..276cac6ae01e8fe4c178db15516b490658abd83c 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<scalar> 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 a087d0c9642d5022106ebdcfc7c6c971889d929c..7cf2ab1f25b8ced12911bbfc8b6f841dc92c14c4 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<scalar>& ppsi = patch().lookupPatchField<volScalarField, scalar>("psi"); - Field<scalar> C1 = sqrt(ppsi*mathematicalConstant::pi/2.0) + Field<scalar> C1 = sqrt(ppsi*constant::math::piByTwo) *(2.0 - accommodationCoeff_)/accommodationCoeff_; Field<scalar> pnu = pmu/prho; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C index 02d220138b3be75823bf3a7adeee12a1253b1f90..03e46a5c6332ee36bfca0f7fe4e1154988deb959 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 613dbfbaef0268d2cfbc22dd2d5305031b139697..240207c8ab834f594b07a257bf22bdb736da7505 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 5eb399afbfbe71cb40bf19a3e218822f70a7dbe0..fe24603713f2ac3912b10e946f9f9f3e1fc67e64 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::volScalarField> 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 3fdd409f5bc492ea240558e77641f9c4febf9a84..2d0acca9fafd49ace0d2f56709e9f42f2e0afa6b 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::volScalarField> 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 8e555dd4871c3c045ba3dfabd843c10743de2c83..40c296f7e0463eb72779c03c04660264bcfa4f0e 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::volScalarField> 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 5a6d4aa52d79c6a72fcf1e3b7fb0c0e04ae8a0f9..dd3f3451794013a9481b96f54dfae6e5b942e04b 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 b1a127e2e56dfd6a0bc78b58a24cdc5d6425e99b..2a1c00b188d1429659ce63b1cca8a997f6f02c8e 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 8b431478959ba474d8632da6da557ac2dbfc0b91..b5e60e94c26d8fdf077e6ccd46c3289bc99a1112 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 28c2c56b07357f46e4d7a24faaf2c0da8611d98f..892319df6c65ce387ad79148333707d9d07f898d 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::volScalarField> 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 2c3a5750f37d9ab090b5287fbbd6029c1124e94c..c717f6cc1f963f9269da2040b80a0c87c7499246 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 d4d6d11539cee0aaa35b20200a3471fb85e01f91..0905771d199c1d865be6f87e424a5b9b05771ce4 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 60c94395614766a61d1e1ff49e6b039b5194846d..de7af2b077d21defaec9e20829f605c2b14a75db 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 85afb3a771998c2779ef23391a39ae5403723290..1d9c0e5b5430df6bd27a9144ef0263544d3d67c3 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 1da7ba049e4202ae5e2065fe3f9be3fd0a5502a6..996cd67d4ce6735e503482a67d41c64ee102ac2a 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 d315dce4a08fe559389119fae389f833b5413694..f1ec25a59c19f67f81fd2edfeb20f0438e36b544 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<face>::iterator iterf = pFaces[WEDGE][0].begin(); SLList<face>::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 2707469a6cd9a698fb343c5ddb6d9ce8b345c332..65dd5c952d93891bcb39ee37c3f6665f2638a82d 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 910df915d839cda42d432296690ee11c57cfc3a5..0b135188e00e173b0f92f870698762e535373157 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 886281274b6f1a859db28bcd81d192e08062f3bc..2039ffb0bbfe18e67da5d6c9b7a6f69e809f07af 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 4d5bca0e8220e2c8691ea0e914e870c6581165ea..4d7d6bc81d98d5c426ca688bb78a5e4ac66fef4a 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 5d0a3621b43c8752a1da56dfd950a41900f51e2f..07ddf34eaf83b4056d5b4a8f146093ecf4224741 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 758592590c4f632b8a09a0a8aba39c8bd816fdde..3c48f6d7d7e86b2fadd1b07dadde324ea0f95534 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 e77fbaf022409d6c7ae4b76a7d3eaff1e98a7937..c6d7b8f61eeb832985ab9769291a72355af232b6 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 e9171c330cc9d0b1de233c100273347e5f57bb4e..92e305709398933d4823f398f7122a0b6e9b78c7 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 c3243b71ae82f02347fa25c4a98cae57b8626705..78716d63c789fd9c9883f23220f128d291d2ac41 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 28ddd776c80713952171b7cbd2180f5ea7518a6c..7f25e0dfb7f0aac5c7914e777b42d5b4cfcdc4fb 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 f371e697a1a9e4022c3d505ae26abef420785ec2..a7bbf88005239266d53604d7aa633c1c1541b50c 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 29841d3ec86892fd222c2dae5f6f0864e03a7cec..01879f089f8e3ff815cc301b0d3314d4e908661e 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 8a82cc4189a1bb53e35da10828dc67fe42ecfd9e..1dafd61f61bdb0819d9bd6465a38abe54a116df5 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 a21461bc6289d3c9329bf21937e7a681b68ce575..881fb1d5202073f820d28c4e8db22703ed139038 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<Point, PointRef>::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 cd8ed8f9b5807be845170f07c834564178f41ab2..7668cfe0e9463aa69990f8db24882081b2f81ab3 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 f36589312565a9fc26d72a16299371e1b5af59d0..6ecc1da31351422682e4311569a88b2c9948e7c7 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 e782cd0fea8d516c3ea07504b310cf06d2e368ba..b817d4ab5edce6a26b1d6a5a37fd64656cf78f2f 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 c1b45e96941158175765f4773abe362ef751b5ec..0000000000000000000000000000000000000000 --- 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 33bf2b1d39f83e0a97b21498764fdca5c6f418fd..8d6657b41f915e2459ac55d787c1a755d1e4f011 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<Cmpt> transform(const tensor& tt, const Tensor<Cmpt>& 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<Cmpt> transform(const tensor& tt, const SymmTensor<Cmpt>& 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 716bdc6ddfacb967f4e97c2a2e7481327bb6af86..27ca388fe393fba545ca31481608909ed54b8af0 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 1ba66fffe93a674cf052e5c61cc8eb81efb96936..3ea198e6c4ebc2b216c6e2471495f27d504d1049 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 fad664229652a22fa4f2949b69bc226009a7abbe..ea57136c1d66f6e859c6336d103d771234f6ceb8 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 d63d527faed069cc437a7fee15cee20c2314bce7..ce3b82bfc6c91e80b5ac269a0194330f31c6d72e 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 fb0a7e2121f020576494e848ad8b6116f71fbcdd..2f3f4e60cafb2f82684a9643faea59ed2bfc551b 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::label> 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 3b1045cdb377b1baaf951325672e6fd138867737..5fa27e142a6e5e6d36790663a5d4e22e1f73a048 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<volVectorField&>(lookupObject<volVectorField>("U")); U.correctBoundaryConditions(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C index d2f0c467d2d797110f96fc70e7076c0eb1e5f7c9..1fbd323685f026335b1f1ef9326976fa9195f307 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 6d4cdc44270c661f6e8fea0feaa9c41f56dc57f7..e15523f9832c1c2b7afb69cd1f61d6faf99175eb 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 e41ed4b427edafac00abf18c574f9b0b7515747f..7329c1dd905b3f7cc51d6fcdb6b347f1721bb26c 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 e31ad4c2a13d12bf46ee972702e6ae4b78f72e13..8e705ae5258b62afa98519a4311c79f75f3a70ba 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 3572546e75bed5fea96f56a80f8dcd69b4848527..8f4a57aca7f2f3dde505f14a508267b1269a8e9e 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 15478458c9290ccd53865b9a5ad88de036c1d19f..57dd15eb545adb1c5d4477ded509b3796bab3cfb 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 37882a2cc0821ba68a7ed3181d630bb2412287a7..4fbd137526c0906aeaeab48818ce9145a0684576 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<scalar>()); reduce(sumDet, sumOp<scalar>()); reduce(nSumDet, sumOp<label>()); diff --git a/src/engine/engineTime/engineTime.C b/src/engine/engineTime/engineTime.C index 226334d308bba565458d8a625a93c507f7248da4..8756cff006047d6bd8eb600765fde9a351894d33 100644 --- a/src/engine/engineTime/engineTime.C +++ b/src/engine/engineTime/engineTime.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "engineTime.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -125,7 +125,7 @@ bool Foam::engineTime::read() Foam::scalar Foam::engineTime::degToRad(const scalar deg) const { - return mathematicalConstant::pi*deg/180.0; + return constant::math::pi*deg/180.0; } @@ -239,6 +239,4 @@ Foam::scalar Foam::engineTime::timeToUserTime(const scalar t) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/src/engine/include/StCorr.H b/src/engine/include/StCorr.H index a776fef5c3d85c636ef5b5297925ef1876fed343..21e5491f103048780ceb0a6904e1047b21622162 100644 --- a/src/engine/include/StCorr.H +++ b/src/engine/include/StCorr.H @@ -27,16 +27,16 @@ ) ); - Ak = sphereFraction*4.0*mathematicalConstant::pi + Ak = sphereFraction*4.0*constant::math::pi *pow ( 3.0*Vk - /(sphereFraction*4.0*mathematicalConstant::pi), + /(sphereFraction*4.0*constant::math::pi), 2.0/3.0 ); } break; - + case 2: { // Assume it is part-circular @@ -56,11 +56,11 @@ ) ); - Ak = circleFraction*mathematicalConstant::pi*thickness + Ak = circleFraction*constant::math::pi*thickness *sqrt ( 4.0*Vk - /(circleFraction*thickness*mathematicalConstant::pi) + /(circleFraction*thickness*constant::math::pi) ); } break; diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/rpm/rpm.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/rpm/rpm.C index d8faf3514768ca80e3adbe3e63a352a4326074ad..6eae867a24f72bd53a58db0d7b5374987a2d7afb 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/rpm/rpm.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/rpm/rpm.C @@ -22,13 +22,11 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "rpm.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -58,7 +56,7 @@ Foam::SRF::rpm::rpm rpm_(readScalar(SRFModelCoeffs_.lookup("rpm"))) { // Initialise the angular velocity - omega_.value() = axis_*rpm_*2.0*mathematicalConstant::pi/60.0; + omega_.value() = axis_*rpm_*constant::math::twoPi/60.0; } @@ -78,7 +76,7 @@ bool Foam::SRF::rpm::read() SRFModelCoeffs_.lookup("rpm") >> rpm_; // Update angular velocity - omega_.value() = axis_*rpm_*(2.0*mathematicalConstant::pi/60.0); + omega_.value() = axis_*rpm_*(constant::math::twoPi/60.0); return true; } diff --git a/src/finiteVolume/cfdTools/general/include/fvCFD.H b/src/finiteVolume/cfdTools/general/include/fvCFD.H index 95f566bb1b37e56d2558a5356aaa6d3b7b021811..05b121db80a7c3e306f4f2a83024b141f9292ae2 100644 --- a/src/finiteVolume/cfdTools/general/include/fvCFD.H +++ b/src/finiteVolume/cfdTools/general/include/fvCFD.H @@ -14,7 +14,7 @@ #include "fixedValueFvPatchFields.H" #include "adjustPhi.H" #include "findRefCell.H" -#include "mathematicalConstants.H" +#include "constants.H" #include "OSspecific.H" #include "argList.H" diff --git a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.C index bb74cddcd233de23b178fe8571dacadadeef509a..912dbf3ea35b0b129a56db7c438fd25d703010f4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "oscillatingFixedValueFvPatchField.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -39,8 +39,8 @@ scalar oscillatingFixedValueFvPatchField<Type>::currentScale() const { return 1.0 - + amplitude_* - sin(2*mathematicalConstant::pi*frequency_*this->db().time().value()); + + amplitude_ + *sin(constant::math::twoPi*frequency_*this->db().time().value()); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C index c26bc26c93b32767fd3831d0a5593114e9d54855..b6ead004e7e679f543bd016435144484dadf5337 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C @@ -32,7 +32,7 @@ Description #include "surfaceFields.H" #include "demandDrivenData.H" #include "coupledFvPatch.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -353,7 +353,7 @@ void surfaceInterpolation::makeCorrectionVectors() const (sum(magSf*mag(corrVecs))/sum(magSf)).value(), 1.0 ) - )*180.0/mathematicalConstant::pi; + )*180.0/constant::math::pi; } if (debug) diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C index 2e252fbf596518b276d552225c0fc55353f48cc1..21e51a9e63b68ba6f0c9eb05d0940164dc859255 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C @@ -25,6 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "COxidationDiffusionLimitedRate.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -123,8 +124,7 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI]; // Change in C mass [kg] - scalar dmC = - 4.0*mathematicalConstant::pi*d*D_*YO2*Tc*rhoc/(Sb_*(T + Tc))*dt; + scalar dmC = 4.0*constant::math::pi*d*D_*YO2*Tc*rhoc/(Sb_*(T + Tc))*dt; // Limit mass transfer by availability of C dmC = min(mass*fComb, dmC); diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C index 682bac3ec67c9bd4eb4634daa0e7315ea9d24140..a96c2ee507ce48b68628931336a0d520e36cef48 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C @@ -25,6 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "COxidationKineticDiffusionLimitedRate.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -137,7 +138,7 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate const scalar Rk = C2_*exp(-E_/(specie::RR*Tc)); // Particle surface area - const scalar Ap = mathematicalConstant::pi*sqr(d); + const scalar Ap = constant::math::pi*sqr(d); // Change in C mass [kg] scalar dmC = Ap*rhoc*specie::RR*Tc*YO2/WO2_*D0*Rk/(D0 + Rk); diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C index e2a1c68700d84c7f2ad2470881d5ee946ee9d127..6ee7419b8aadef98b1f132d4ba49de820926a08c 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C @@ -25,6 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "COxidationMurphyShaddix.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -133,7 +134,7 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate } // Particle surface area [m^2] - const scalar Ap = mathematicalConstant::pi*sqr(d); + const scalar Ap = constant::math::pi*sqr(d); // Calculate diffision constant at continuous phase temperature // and density [m^2/s] diff --git a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C b/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C index 9800170b7011f77cc7ff39d4476ec170e4e8c47e..ea3f54f0e01bdb2982b02750f3f414e7bc03076c 100644 --- a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C +++ b/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C @@ -27,7 +27,7 @@ License #include "commonRailInjector.H" #include "addToRunTimeSelectionTable.H" #include "Random.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -244,7 +244,7 @@ Foam::vector Foam::commonRailInjector::position { // otherwise, disc injection scalar iRadius = d_*rndGen.scalar01(); - scalar iAngle = 2.0*mathematicalConstant::pi*rndGen.scalar01(); + scalar iAngle = constant::math::twoPi*rndGen.scalar01(); return ( @@ -297,7 +297,7 @@ Foam::scalar Foam::commonRailInjector::mass // correct mass if calculation is 2D if (twoD) { - mInj *= 0.5*angleOfWedge/mathematicalConstant::pi; + mInj *= 0.5*angleOfWedge/constant::math::pi; } return mInj; @@ -404,7 +404,7 @@ void Foam::commonRailInjector::correctProfiles const scalar referencePressure ) { - scalar A = 0.25*mathematicalConstant::pi*pow(d_, 2.0); + scalar A = 0.25*constant::math::pi*sqr(d_); scalar pDummy = 1.0e+5; scalar rho = fuel.rho(pDummy, T_, X_); diff --git a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C b/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C index 7744e63addce9d8664e5873be8ffa608c7f1cf62..a9557c4f09fbab93df6f37e893c94c70b5d81af4 100644 --- a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C +++ b/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C @@ -27,7 +27,7 @@ License #include "definedInjector.H" #include "addToRunTimeSelectionTable.H" #include "Random.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -226,7 +226,7 @@ Foam::vector Foam::definedInjector::position { // otherwise, disc injection scalar iRadius = d_*rndGen.scalar01(); - scalar iAngle = 2.0*mathematicalConstant::pi*rndGen.scalar01(); + scalar iAngle = constant::math::twoPi*rndGen.scalar01(); return ( @@ -280,7 +280,7 @@ Foam::scalar Foam::definedInjector::mass // correct mass if calculation is 2D if (twoD) { - mInj *= 0.5*angleOfWedge/mathematicalConstant::pi; + mInj *= 0.5*angleOfWedge/constant::math::pi; } return mInj; @@ -374,7 +374,7 @@ void Foam::definedInjector::correctProfiles const scalar referencePressure ) { - scalar A = 0.25*mathematicalConstant::pi*pow(d_, 2.0); + scalar A = 0.25*constant::math::pi*sqr(d_); scalar pDummy = 1.0e+5; scalar rho = fuel.rho(pDummy, T_, X_); diff --git a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C b/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C index fee7eb3473d0e8deea8c3ef35fbd1ecabcf8daac..44f963f014ad7a9196a72992eb3940658b675fd8 100644 --- a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C +++ b/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C @@ -27,7 +27,7 @@ License #include "multiHoleInjector.H" #include "addToRunTimeSelectionTable.H" #include "Random.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -165,7 +165,7 @@ Foam::multiHoleInjector::~multiHoleInjector() void Foam::multiHoleInjector::setTangentialVectors() { - scalar pi180 = mathematicalConstant::pi/180.0; + scalar pi180 = constant::math::pi/180.0; scalar alpha = xyAngle_*pi180; scalar phi = zAngle_*pi180; @@ -267,7 +267,7 @@ Foam::vector Foam::multiHoleInjector::position { // otherwise, disc injection scalar iRadius = d_*rndGen.scalar01(); - scalar iAngle = 2.0*mathematicalConstant::pi*rndGen.scalar01(); + scalar iAngle = constant::math::twoPi*rndGen.scalar01(); return ( @@ -319,7 +319,7 @@ Foam::scalar Foam::multiHoleInjector::mass // correct mass if calculation is 2D if (twoD) { - mInj *= 0.5*angleOfWedge/mathematicalConstant::pi; + mInj *= 0.5*angleOfWedge/constant::math::pi; } return mInj; @@ -429,7 +429,7 @@ void Foam::multiHoleInjector::correctProfiles const scalar referencePressure ) { - scalar A = nHoles_*0.25*mathematicalConstant::pi*pow(d_, 2.0); + scalar A = nHoles_*0.25*constant::math::pi*sqr(d_); forAll(velocityProfile_, i) { diff --git a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C index ef7689614b8e7c42ce6e371a2b9b40b79df5034c..0ade2f8f0503cccc6c7bbcf8b80cc7343fd0f2a8 100644 --- a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C +++ b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C @@ -27,7 +27,7 @@ License #include "swirlInjector.H" #include "addToRunTimeSelectionTable.H" #include "Random.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -246,7 +246,7 @@ Foam::vector Foam::swirlInjector::position { // otherwise, disc injection scalar iRadius = d_*rndGen.scalar01(); - scalar iAngle = 2.0*mathematicalConstant::pi*rndGen.scalar01(); + scalar iAngle = constant::math::twoPi*rndGen.scalar01(); return ( @@ -300,7 +300,7 @@ Foam::scalar Foam::swirlInjector::mass // correct mass if calculation is 2D if (twoD) { - mInj *= 0.5*angleOfWedge/mathematicalConstant::pi; + mInj *= 0.5*angleOfWedge/constant::math::pi; } return mInj; @@ -415,7 +415,7 @@ void Foam::swirlInjector::correctProfiles const scalar referencePressure ) { - scalar A = 0.25*mathematicalConstant::pi*sqr(d_); + scalar A = 0.25*constant::math::pi*sqr(d_); scalar pDummy = 1.0e+5; scalar rho = fuel.rho(pDummy, T_, X_); diff --git a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C b/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C index 285462f67baf956112ae61f5cbeb65b102c0309e..f6439faf1128547bd28aa4b75d8bfe3976368530 100644 --- a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C +++ b/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C @@ -27,7 +27,7 @@ License #include "unitInjector.H" #include "addToRunTimeSelectionTable.H" #include "Random.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -220,7 +220,7 @@ Foam::vector Foam::unitInjector::position { // otherwise, disc injection scalar iRadius = d_*rndGen.scalar01(); - scalar iAngle = 2.0*mathematicalConstant::pi*rndGen.scalar01(); + scalar iAngle = constant::math::twoPi*rndGen.scalar01(); return ( @@ -273,7 +273,7 @@ Foam::scalar Foam::unitInjector::mass // correct mass if calculation is 2D if (twoD) { - mInj *= 0.5*angleOfWedge/mathematicalConstant::pi; + mInj *= 0.5*angleOfWedge/constant::math::pi; } return mInj; @@ -364,7 +364,7 @@ void Foam::unitInjector::correctProfiles const scalar referencePressure ) { - scalar A = 0.25*mathematicalConstant::pi*sqr(d_); + scalar A = 0.25*constant::math::pi*sqr(d_); scalar pDummy = 1.0e+5; forAll(velocityProfile_, i) diff --git a/src/lagrangian/dieselSpray/parcel/parcelFunctions.C b/src/lagrangian/dieselSpray/parcel/parcelFunctions.C index 4670185ea9813169dadc285283fc773d1f3ce578..55647326442908c14c679cc298c1898bccab8cfd 100644 --- a/src/lagrangian/dieselSpray/parcel/parcelFunctions.C +++ b/src/lagrangian/dieselSpray/parcel/parcelFunctions.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "parcel.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -102,13 +102,13 @@ scalar parcel::Pr scalar parcel::N(const scalar rho) const { - return 6.0*m_/(rho*pow(d_, 3.0)*mathematicalConstant::pi); + return 6.0*m_/(rho*pow3(d_)*constant::math::pi); } scalar parcel::Vd() const { - return pow(d_, 3.0)*mathematicalConstant::pi/6.0; + return pow3(d_)*constant::math::pi/6.0; } diff --git a/src/lagrangian/dieselSpray/spray/spray.C b/src/lagrangian/dieselSpray/spray/spray.C index 3280fefdc93939812cb05681d24f480510b66fdf..1f1945ef5dbc96f88594fd632c2035bbbb03e543 100644 --- a/src/lagrangian/dieselSpray/spray/spray.C +++ b/src/lagrangian/dieselSpray/spray/spray.C @@ -41,7 +41,7 @@ License #include "symmetryPolyPatch.H" #include "wedgePolyPatch.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -289,17 +289,17 @@ Foam::spray::spray axisOfWedgeNormal_ /= mag(axisOfWedgeNormal_); scalar arcCos = (v1 & v2)/mag(v1); - angleOfWedge_ = mathematicalConstant::pi - acos(arcCos); + angleOfWedge_ = constant::math::pi - acos(arcCos); Info<< "Calculated angle of wedge is " - << angleOfWedge_*180/mathematicalConstant::pi << " deg." + << angleOfWedge_*180/constant::math::pi << " deg." << endl; } else { if (symPlaneExist) { - angleOfWedge_ = mathematicalConstant::pi; + angleOfWedge_ = constant::math::pi; Info<< "Constructing 180 deg three dimensional spray injection." << endl; } diff --git a/src/lagrangian/dieselSpray/spray/sprayFunctions.C b/src/lagrangian/dieselSpray/spray/sprayFunctions.C index da667fc2f876973ea999abbae93a5f2f204fbac2..43b14b477816dde0b3fe2b3bbf07535e15b77d10 100644 --- a/src/lagrangian/dieselSpray/spray/sprayFunctions.C +++ b/src/lagrangian/dieselSpray/spray/sprayFunctions.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "spray.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -106,7 +106,7 @@ scalar spray::liquidMass() const if (twoD()) { - sum *= 2.0*mathematicalConstant::pi/angleOfWedge(); + sum *= constant::math::twoPi/angleOfWedge(); } reduce(sum, sumOp<scalar>()); @@ -148,7 +148,7 @@ scalar spray::liquidEnthalpy() const if (twoD()) { - sum *= 2.0*mathematicalConstant::pi/angleOfWedge(); + sum *= constant::math::twoPi/angleOfWedge(); } reduce(sum, sumOp<scalar>()); @@ -193,7 +193,7 @@ scalar spray::liquidTotalEnthalpy() const if (twoD()) { - sum *= 2.0*mathematicalConstant::pi/angleOfWedge(); + sum *= constant::math::twoPi/angleOfWedge(); } reduce(sum, sumOp<scalar>()); @@ -218,7 +218,7 @@ scalar spray::liquidKineticEnergy() const if (twoD()) { - sum *= 2.0*mathematicalConstant::pi/angleOfWedge(); + sum *= constant::math::twoPi/angleOfWedge(); } reduce(sum, sumOp<scalar>()); diff --git a/src/lagrangian/dieselSpray/spray/sprayOps.C b/src/lagrangian/dieselSpray/spray/sprayOps.C index 72e44a6bbe9c133040685091039518eb37464056..9a19041075c0d395f2d6f63d222708fc16d79ca7 100644 --- a/src/lagrangian/dieselSpray/spray/sprayOps.C +++ b/src/lagrangian/dieselSpray/spray/sprayOps.C @@ -31,7 +31,6 @@ License #include "dispersionModel.H" #include "interpolationCellPoint.H" #include "processorPolyPatch.H" -#include "mathematicalConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C index 17756e7a35c19139ca1d9f4799044ad1016f8d8e..36bbbfce715d0622035f5e09b3849a1e12fe5d27 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C @@ -27,7 +27,7 @@ License #include "LISA.H" #include "addToRunTimeSelectionTable.H" #include "basicMultiComponentMixture.H" - +#include "mathConstants.H" #include "RosinRammler.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -155,7 +155,7 @@ void LISA::atomizeParcel scalar massFlow = it.massFlowRate(max(0.0,elapsedTime-time)); - scalar hSheet = massFlow/(mathematicalConstant::pi*d*rhoFuel*mag(p.U())); + scalar hSheet = massFlow/(constant::math::pi*d*rhoFuel*mag(p.U())); p.d() = min(hSheet,p.d()); @@ -249,7 +249,7 @@ void LISA::atomizeParcel scalar kL = 1.0/(dL*sqrt(0.5 + 1.5*muFuel/sqrt(rhoFuel*sigma*dL))); - scalar dD = cbrt(3.0*mathematicalConstant::pi*sqr(dL)/kL); + scalar dD = cbrt(3.0*constant::math::pi*sqr(dL)/kL); scalar lisaExp = 0.27; scalar ambientPressure = 1.0e+5; diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C index a380a61c99fb2b091241195e453dffd5af5bdb3c..371c44cb844673c658777b097756ff6c3adc768b 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C @@ -24,12 +24,10 @@ License \*---------------------------------------------------------------------------*/ -#include "error.H" - #include "blobsSheetAtomization.H" #include "addToRunTimeSelectionTable.H" #include "basicMultiComponentMixture.H" - +#include "mathConstants.H" #include "RosinRammler.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -129,7 +127,7 @@ void blobsSheetAtomization::atomizeParcel scalar lBU = B_*sqrt ( - rhoFuel*sigma*p.d()*cos(angle_*mathematicalConstant::pi/360.0) + rhoFuel*sigma*p.d()*cos(angle_*constant::math::pi/360.0) /sqr(rhoAverage*U) ); diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.C index 98198e184fca0fa5c5fd2da971aa9d1f72d61072..bbb079469beb2e8cd31371dee4cf65d8a03b1d6f 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.C @@ -26,7 +26,7 @@ License #include "ETAB.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -128,7 +128,7 @@ void ETAB::breakupParcel scalar quad = -y2/a; if (quad < 0) { - phi = 2*mathematicalConstant::pi - phit; + phi = constant::math::twoPi - phit; } scalar tb = 0; @@ -139,11 +139,11 @@ void ETAB::breakupParcel if (theta < phi) { - if (2*mathematicalConstant::pi - theta >= phi) + if (constant::math::twoPi - theta >= phi) { theta = -theta; } - theta += 2*mathematicalConstant::pi; + theta += constant::math::twoPi; } tb = (theta-phi)*romega; diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C index 5df879fa584b0a6b3c83c42f00d3e4d28f36ef4c..879a0e0c893d773c9a1db2681453a6f090e1bd10 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C @@ -26,7 +26,7 @@ License #include "SHF.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -196,7 +196,7 @@ void SHF::breakupParcel px = x - /(2.0*sqrt(2.0*mathematicalConstant::pi)*sigma_) + /(2.0*sqrt(constant::math::twoPi)*sigma_) *exp(-0.5*sqr((x-mu_)/sigma_)); } while (y >= px); @@ -227,7 +227,7 @@ void SHF::breakupParcel px = x - /(2.0*sqrt(2.0*mathematicalConstant::pi)*sigma_) + /(2.0*sqrt(constant::math::twoPi)*sigma_) *exp(-0.5*sqr((x-mu_)/sigma_)); } while (y >= px); diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.C index 970097ec1777940772cb101d4df48670536cab59..e05b6d1bf1caa5d33d67fff1bef22d8da04522ad 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.C @@ -26,7 +26,7 @@ License #include "TAB.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -130,7 +130,7 @@ void TAB::breakupParcel scalar quad = -y2/a; if (quad < 0) { - phi = 2*mathematicalConstant::pi - phit; + phi = constant::math::twoPi - phit; } scalar tb = 0; @@ -147,11 +147,11 @@ void TAB::breakupParcel if (theta < phi) { - if (2*mathematicalConstant::pi - theta >= phi) + if (constant::math::twoPi - theta >= phi) { theta = -theta; } - theta += 2*mathematicalConstant::pi; + theta += constant::math::twoPi; } tb = (theta - phi)/omega; diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.C index 5bd8ce5f89cc50638e59f5b39323736fee4ddadd..3443e3883ea42c81079faaf84b4d2dab872a97d4 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.C @@ -26,7 +26,7 @@ License #include "reitzKHRT.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -137,7 +137,7 @@ void reitzKHRT::breakupParcel scalar KRT = sqrt(helpVariable/(3.0*sigma + VSMALL)); // wavelength of the fastest growing RT frequency - scalar lambdaRT = 2.0*mathematicalConstant::pi*cRT_/(KRT + VSMALL); + scalar lambdaRT = constant::math::twoPi*cRT_/(KRT + VSMALL); // if lambdaRT < diameter, then RT waves are growing on the surface // and we start to keep track of how long they have been growing @@ -170,7 +170,7 @@ void reitzKHRT::breakupParcel // reduce the diameter according to the rate-equation p.d() = (fraction*dc + p.d())/(1.0 + fraction); - scalar ms = rhoLiquid*Np*pow3(dc)*mathematicalConstant::pi/6.0; + scalar ms = rhoLiquid*Np*pow3(dc)*constant::math::pi/6.0; p.ms() += ms; // Total number of parcels for the whole injection event diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/ORourkeCollisionModel.C b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/ORourkeCollisionModel.C index 6ab6403b01750ddb1600e263865dfecb39a9b0be..f1983375052067efd94ede19767754300da06b73 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/ORourkeCollisionModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/ORourkeCollisionModel.C @@ -24,10 +24,9 @@ License \*---------------------------------------------------------------------------*/ -#include "error.H" - #include "ORourkeCollisionModel.H" #include "addToRunTimeSelectionTable.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/sameCell.H b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/sameCell.H index 1ee072ddad131d3485aee16f49441fe9b947f643..67085739ecbbbe56f5bfc2808bd8b3df1526dc99 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/sameCell.H +++ b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/sameCell.H @@ -31,7 +31,7 @@ scalar nMin = pMin().N(rhoMin); scalar mdMin = mMin/nMin; -scalar nu0 = 0.25*mathematicalConstant::pi*sumD*sumD*magVRel*dt/vols_[cell1]; +scalar nu0 = 0.25*constant::math::pi*sumD*sumD*magVRel*dt/vols_[cell1]; scalar nu = nMin*nu0; scalar collProb = exp(-nu); scalar xx = rndGen_.scalar01(); diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryCM.H b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryCM.H index a7cca2b7e36c99ceff987257c4c3eb1c4e8faccf..fdc520610252cdbd1f4401d7f61e3d21c820c939 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryCM.H +++ b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryCM.H @@ -40,14 +40,14 @@ if (vAlign > 0) beta /= v2Mag*dt; // is collision possible within this timestep - if ((alpha>0) && (alpha<1.0) && (beta>0) && (beta<1.0)) + if ((alpha>0) && (alpha<1.0) && (beta>0) && (beta<1.0)) { vector p1c = p1().position() + alpha*v1*dt; vector p2c = p2().position() + beta*v2*dt; scalar closestDist = mag(p1c-p2c); - scalar collProb = + scalar collProb = pow(0.5*sumD/max(0.5*sumD, closestDist), cSpace_) *exp(-cTime_*mag(alpha-beta)); @@ -90,7 +90,7 @@ if (vAlign > 0) // use mass-averaged temperature to calculate We number scalar averageTemp = (pMax().T()*mMax + pMin().T()*mMin)/mTot; // and mass averaged mole fractions ... - scalarField + scalarField Xav((pMax().m()*pMax().X()+pMin().m()*pMin().X()) /(pMax().m() + pMin().m())); @@ -99,7 +99,7 @@ if (vAlign > 0) scalar rho = spray_.fuels().rho(pc, averageTemp, Xav); scalar dMean = sqrt(dMin*dMax); - scalar WeColl = + scalar WeColl = max(1.0e-12, 0.5*rho*magVRel*magVRel*dMean/sigma); // coalescence only possible when parcels are close enoug @@ -109,7 +109,7 @@ if (vAlign > 0) scalar prob = rndGen_.scalar01(); // Coalescence - if ( prob < coalesceProb && coalescence_) + if ( prob < coalesceProb && coalescence_) { // How 'many' of the droplets coalesce scalar nProb = prob*nMin/nMax; @@ -122,18 +122,18 @@ if (vAlign > 0) scalar newMaxMass = mMax + (mMin - newMinMass); pMax().m() = newMaxMass; - pMax().T() = + pMax().T() = (averageTemp*mTot - newMinMass*pMin().T())/newMaxMass; rhoMax = spray_.fuels().rho(pc, pMax().T(), pMax().X()); - pMax().d() = + pMax().d() = pow ( - 6.0*newMaxMass/(rhoMax*mathematicalConstant::pi*nMax), + 6.0*newMaxMass/(rhoMax*constant::math::pi*nMax), 1.0/3.0 ); - pMax().U() = + pMax().U() = (momMax + (1.0-newMinMass/mMin)*momMin)/newMaxMass; // update the liquid molar fractions @@ -147,7 +147,7 @@ if (vAlign > 0) } forAll(Ynew, i) { - pMax().X()[i] = + pMax().X()[i] = Ynew[i]/(spray_.fuels().properties()[i].W()*Wlinv); } diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryModel.C b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryModel.C index f1b4ca00385a837234ae5560e3d0fe7f730c1da7..bda1b361ccaac9e1ea0f828dbc87ab4d4de891ab 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryModel.C +++ b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryModel.C @@ -26,6 +26,7 @@ License #include "trajectoryModel.H" #include "addToRunTimeSelectionTable.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C index 3de8d579a716c5bf524c06f89aaf9948ddaa3d97..fbb7d3447252a7b8b901b8b43e6d6c5a8c44a60b 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C +++ b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C @@ -28,7 +28,8 @@ License #include "RutlandFlashBoil.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -228,7 +229,7 @@ scalar RutlandFlashBoil::boilingTime for (label k=0; k < Niter; k++) { - expSum += exp(sqr(-k*mathematicalConstant::pi*sqrt(F)/2.0)); + expSum += exp(sqr(-k*constant::math::pi*sqrt(F)/2.0)); if (mag(expSum-expSumOld)/expSum < 1.0e-3) { break; @@ -256,8 +257,7 @@ scalar RutlandFlashBoil::boilingTime } scalar Gf = - 4.0*alfaS*dTLB*mathematicalConstant::pi*sqr(diameter/2.0) - /heatOfVapour; + 4.0*alfaS*dTLB*constant::math::pi*sqr(diameter/2.0)/heatOfVapour; // calculation of the heat transfer vapourization at superheated // conditions (temperature>tBoilingSurface) @@ -269,8 +269,7 @@ scalar RutlandFlashBoil::boilingTime mag((vapourFarEnthalpy-vapourSurfaceEnthalpy)/heatOfVapour); // 2.0? or 1.0? try 1! - scalar B = - 1.0*mathematicalConstant::pi*kappa/cpGas*diameter*NusseltCorr; + scalar B = 1.0*constant::math::pi*kappa/cpGas*diameter*NusseltCorr; scalar nPos = B*log(1.0 + A)/Gf + 1.0; scalar nNeg = (1.0/A)*(exp(Gf/B) - 1.0 - A) + 1.0; @@ -343,9 +342,7 @@ scalar RutlandFlashBoil::boilingTime } } - time = - ((4.0/3.0)*mathematicalConstant::pi*pow3(diameter/2.0)) - *liquidDensity/(G+Gf); + time = (constant::math::pi*pow3(diameter)/6.0)*liquidDensity/(G + Gf); time = max(VSMALL, time); } diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C index 9808fbf6cad8787ffee624b83d342c4b80640f4a..faedf5d5f92d570626cd3492372ad0d8bba6bea9 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C @@ -26,7 +26,7 @@ License #include "Chomiak.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -118,11 +118,11 @@ vector ChomiakInjector::direction scalar angle = (d - dMax)*maxSprayAngle_[n] /(dMin - dMax) - *mathematicalConstant::pi/360.0; + *constant::math::pi/360.0; scalar alpha = sin(angle); scalar dcorr = cos(angle); - scalar beta = 2.0*mathematicalConstant::pi*rndGen_.scalar01(); + scalar beta = constant::math::twoPi*rndGen_.scalar01(); // randomly distributed vector normal to the injection vector vector normal = vector::zero; @@ -132,8 +132,7 @@ vector ChomiakInjector::direction scalar reduce = 0.01; // correct beta if this is a 2D run // map it onto the 'angleOfWedge' - beta *= - (1.0-2.0*reduce)*0.5*sm_.angleOfWedge()/mathematicalConstant::pi; + beta *= (1.0-2.0*reduce)*0.5*sm_.angleOfWedge()/constant::math::pi; beta += reduce*sm_.angleOfWedge(); normal = diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C index 744ff706577460ce6d35d48953396809eb906569..80601db2d1cd73faa039551d7df004593c3c5f18 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C @@ -26,7 +26,7 @@ License #include "blobsSwirlInjector.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -112,7 +112,7 @@ scalar blobsSwirlInjector::d0 angle_ = coneAngle_[n]/2.0 + c*coneInterval_[n]; - angle_ *= mathematicalConstant::pi/180.0; + angle_ *= constant::math::pi/180.0; scalar injectedMassFlow = it.massFlowRate(t); @@ -144,7 +144,7 @@ vector blobsSwirlInjector::direction { scalar alpha = sin(angle_); scalar dcorr = cos(angle_); - scalar beta = 2.0*mathematicalConstant::pi*rndGen_.scalar01(); + scalar beta = constant::math::twoPi*rndGen_.scalar01(); // randomly distributed vector normal to the injection vector vector normal = vector::zero; @@ -155,10 +155,7 @@ vector blobsSwirlInjector::direction // correct beta if this is a 2D run // map it onto the 'angleOfWedge' - beta *= - (1.0 - 2.0*reduce) - *sm_.angleOfWedge() - /(2.0*mathematicalConstant::pi); + beta *= (1.0 - 2.0*reduce)*sm_.angleOfWedge()/(constant::math::twoPi); beta += reduce*sm_.angleOfWedge(); normal = alpha @@ -243,7 +240,7 @@ void blobsSwirlInjector::calculateHX ( (A_[inj]*cTau_[inj]*muFuel*massFlow*(1.0 + x_)) /( - mathematicalConstant::pi + constant::math::pi *injectorDiameter *rhoFuel *dPressure @@ -263,7 +260,7 @@ void blobsSwirlInjector::calculateHX ( (A_[inj]*cTau_[inj]*muFuel*massFlow*(1.0 + x_)) /( - mathematicalConstant::pi + constant::math::pi *injectorDiameter *rhoFuel *dPressure diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/constant/constInjector.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/constant/constInjector.C index ebeb7d71bb23feaac49d260662562404da4fc855..1b89c250bc26d3fdad6fd9bf626d2aa97400aec0 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/constant/constInjector.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/constant/constInjector.C @@ -26,7 +26,7 @@ License #include "constInjector.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -133,12 +133,11 @@ vector constInjector::direction v (alpha) */ - scalar angle = - rndGen_.scalar01()*sprayAngle_[n]*mathematicalConstant::pi/360.0; + scalar angle = rndGen_.scalar01()*sprayAngle_[n]*constant::math::pi/360.0; scalar alpha = sin(angle); scalar dcorr = cos(angle); - scalar beta = 2.0*mathematicalConstant::pi*rndGen_.scalar01(); + scalar beta = constant::math::twoPi*rndGen_.scalar01(); // randomly distributed vector normal to the injection vector vector normal = vector::zero; @@ -148,8 +147,7 @@ vector constInjector::direction scalar reduce = 0.01; // correct beta if this is a 2D run // map it onto the 'angleOfWedge' - beta *= - (1.0 - 2.0*reduce)*0.5*sm_.angleOfWedge()/mathematicalConstant::pi; + beta *= (1.0 - 2.0*reduce)*0.5*sm_.angleOfWedge()/constant::math::pi; beta += reduce*sm_.angleOfWedge(); normal = diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C index 2b42660b266556275fb201b032ff90d688b5fae9..78740f67daebb317404b8168fce8b7c2149005bf 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C @@ -26,7 +26,7 @@ License #include "definedHollowCone.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -163,9 +163,9 @@ vector definedHollowConeInjector::direction // use random number to generate angle between inner/outer cone angles scalar angle = angleInner + rndGen_.scalar01()*(angleOuter - angleInner); - scalar alpha = sin(angle*mathematicalConstant::pi/360.0); - scalar dcorr = cos(angle*mathematicalConstant::pi/360.0); - scalar beta = 2.0*mathematicalConstant::pi*rndGen_.scalar01(); + scalar alpha = sin(angle*constant::math::pi/360.0); + scalar dcorr = cos(angle*constant::math::pi/360.0); + scalar beta = constant::math::twoPi*rndGen_.scalar01(); // randomly distributed vector normal to the injection vector vector normal = vector::zero; @@ -176,8 +176,7 @@ vector definedHollowConeInjector::direction // correct beta if this is a 2D run // map it onto the 'angleOfWedge' - beta *= - (1.0-2.0*reduce)*sm_.angleOfWedge()/(2.0*mathematicalConstant::pi); + beta *= (1.0 - 2.0*reduce)*sm_.angleOfWedge()/(constant::math::twoPi); beta += reduce*sm_.angleOfWedge(); normal = alpha diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.C index 66a051d188ef5a511c268d235fa387895d63fa04..7257ae0a03304ad1c611a85bc6c9633305e40e55 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.C @@ -26,7 +26,7 @@ License #include "definedPressureSwirl.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -174,7 +174,7 @@ scalar definedPressureSwirlInjector::d0 // end modifications - angle_ *= mathematicalConstant::pi/360.0; + angle_ *= constant::math::pi/360.0; scalar injectedMassFlow = it.massFlowRate(t); @@ -191,7 +191,7 @@ scalar definedPressureSwirlInjector::d0 u_ = v*cosAngle; - scalar A = injectedMassFlow/(mathematicalConstant::pi*rhoFuel*u_); + scalar A = injectedMassFlow/(constant::math::pi*rhoFuel*u_); // Not using the authors definition for sheet thickness // modified by multiplying the sheet tickness for the cone angle cosinus. @@ -216,7 +216,7 @@ vector definedPressureSwirlInjector::direction { scalar alpha = sin(angle_); scalar dcorr = cos(angle_); - scalar beta = 2.0*mathematicalConstant::pi*rndGen_.scalar01(); + scalar beta = constant::math::twoPi*rndGen_.scalar01(); // randomly distributed vector normal to the injection vector vector normal = vector::zero; @@ -227,8 +227,7 @@ vector definedPressureSwirlInjector::direction // correct beta if this is a 2D run // map it onto the 'angleOfWedge' - beta *= - (1.0-2.0*reduce)*sm_.angleOfWedge()/(2.0*mathematicalConstant::pi); + beta *= (1.0 - 2.0*reduce)*sm_.angleOfWedge()/(constant::math::twoPi); beta += reduce*sm_.angleOfWedge(); normal = alpha @@ -297,7 +296,7 @@ scalar definedPressureSwirlInjector::kv scalar coneAngle = it.getTableValue(coneAngle_, t); - coneAngle *= mathematicalConstant::pi/360.0; + coneAngle *= constant::math::pi/360.0; scalar cosAngle = cos(coneAngle); scalar Tav = it.integrateTable(it.T())/(it.teoi() - it.tsoi()); @@ -310,7 +309,7 @@ scalar definedPressureSwirlInjector::kv it.getTableValue(maxKv_, t), 4.0*massFlow *sqrt(rhoFuel/2.0/dPressure) - /(mathematicalConstant::pi*sqr(injectorDiameter)*rhoFuel*cosAngle) + /(constant::math::pi*sqr(injectorDiameter)*rhoFuel*cosAngle) ); return min(1.0, kv); diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C index 0a88d280f84e5aac61f9152d10a8b24bd5bcc851..3c89eaba4fae1831d6a46da90bde9ee081cae1d3 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C @@ -26,7 +26,7 @@ License #include "hollowCone.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -130,9 +130,9 @@ vector hollowConeInjector::direction { scalar angle = innerAngle_[n] + rndGen_.scalar01()*(outerAngle_[n]-innerAngle_[n]); - scalar alpha = sin(angle*mathematicalConstant::pi/360.0); - scalar dcorr = cos(angle*mathematicalConstant::pi/360.0); - scalar beta = 2.0*mathematicalConstant::pi*rndGen_.scalar01(); + scalar alpha = sin(angle*constant::math::pi/360.0); + scalar dcorr = cos(angle*constant::math::pi/360.0); + scalar beta = constant::math::twoPi*rndGen_.scalar01(); // randomly distributed vector normal to the injection vector vector normal = vector::zero; @@ -143,8 +143,7 @@ vector hollowConeInjector::direction // correct beta if this is a 2D run // map it onto the 'angleOfWedge' - beta *= - (1.0-2.0*reduce)*sm_.angleOfWedge()/(2.0*mathematicalConstant::pi); + beta *= (1.0 - 2.0*reduce)*sm_.angleOfWedge()/(constant::math::twoPi); beta += reduce*sm_.angleOfWedge(); normal = alpha diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/pressureSwirl/pressureSwirlInjector.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/pressureSwirl/pressureSwirlInjector.C index eda82a87ef9ccad780d02939ec796d4dca524eab..c5510ecc26a829e80a101287176c92ef3d3f9d22 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/pressureSwirl/pressureSwirlInjector.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/pressureSwirl/pressureSwirlInjector.C @@ -26,7 +26,7 @@ License #include "pressureSwirlInjector.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -107,7 +107,7 @@ scalar pressureSwirlInjector::d0 scalar c = rndGen_.scalar01(); angle_ = coneAngle_[n] + 2.0*coneInterval_[n]*(0.5 - c); - angle_ *= mathematicalConstant::pi/360.0; + angle_ *= constant::math::pi/360.0; scalar injectedMassFlow = it.massFlowRate(t); @@ -122,7 +122,7 @@ scalar pressureSwirlInjector::d0 u_ = v*cosAngle; - scalar A = injectedMassFlow/(mathematicalConstant::pi*rhoFuel*u_); + scalar A = injectedMassFlow/(constant::math::pi*rhoFuel*u_); return (injectorDiameter-sqrt(pow(injectorDiameter,2)-4.0*A))/2.0; } @@ -138,7 +138,7 @@ vector pressureSwirlInjector::direction { scalar alpha = sin(angle_); scalar dcorr = cos(angle_); - scalar beta = 2.0*mathematicalConstant::pi*rndGen_.scalar01(); + scalar beta = constant::math::twoPi*rndGen_.scalar01(); // randomly distributed vector normal to the injection vector vector normal = vector::zero; @@ -149,8 +149,7 @@ vector pressureSwirlInjector::direction // correct beta if this is a 2D run // map it onto the 'angleOfWedge' - beta *= - (1.0-2.0*reduce)*sm_.angleOfWedge()/(2.0*mathematicalConstant::pi); + beta *= (1.0 - 2.0*reduce)*sm_.angleOfWedge()/(constant::math::twoPi); beta += reduce*sm_.angleOfWedge(); normal = alpha @@ -218,7 +217,7 @@ scalar pressureSwirlInjector::kv scalar coneAngle = coneAngle_[inj]; - coneAngle *= mathematicalConstant::pi/360.0; + coneAngle *= constant::math::pi/360.0; scalar cosAngle = cos(coneAngle); scalar Tav = it.integrateTable(it.T())/(it.teoi()-it.tsoi()); @@ -231,7 +230,7 @@ scalar pressureSwirlInjector::kv maxKv_[inj], 4.0*massFlow *sqrt(rhoFuel/2.0/dPressure) - /(mathematicalConstant::pi*sqr(injectorDiameter)*rhoFuel*cosAngle) + /(constant::math::pi*sqr(injectorDiameter)*rhoFuel*cosAngle) ); return min(1.0, kv); diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H index 3529702fdd6b5591a6c588a0890b0a417dbcae2d..492bc98e18d260bb8effeb949ef0bde10a805f34 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H @@ -24,6 +24,8 @@ License \*---------------------------------------------------------------------------*/ +#include "mathConstants.H" + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ParcelType> @@ -312,7 +314,7 @@ inline Foam::scalar Foam::DsmcCloud<ParcelType>::maxwellianAverageSpeed scalar mass ) const { - return 2.0*sqrt(2.0*kb*temperature/(mathematicalConstant::pi*mass)); + return 2.0*sqrt(2.0*kb*temperature/(constant::math::pi*mass)); } @@ -323,7 +325,7 @@ inline Foam::scalarField Foam::DsmcCloud<ParcelType>::maxwellianAverageSpeed scalar mass ) const { - return 2.0*sqrt(2.0*kb*temperature/(mathematicalConstant::pi*mass)); + return 2.0*sqrt(2.0*kb*temperature/(constant::math::pi*mass)); } diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C index c52d92d20fef43858cfdd7075883003e6a043b76..287a0faf2769001e6213fb9acb3aa0da1bf32474 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C @@ -25,7 +25,6 @@ License \*---------------------------------------------------------------------------*/ #include "DsmcParcel.H" -#include "dimensionedConstants.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H index af8e350e7fd8ec756ba9957eb74c4f00b9152157..d96d51584344609f421672f2f9e128450c3f7a5a 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H @@ -42,7 +42,6 @@ SourceFiles #include "IOstream.H" #include "autoPtr.H" #include "contiguous.H" -#include "mathematicalConstants.H" #include "DsmcCloud.H" diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelI.H b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelI.H index 239571ceaef99cb46f15003212de45ba09cbeb88..274d634b3f6d43f0046a582002dca68acb1b4a9e 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelI.H +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelI.H @@ -24,6 +24,8 @@ License \*---------------------------------------------------------------------------*/ +#include "mathConstants.H" + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template <class ParcelType> @@ -101,7 +103,7 @@ template <class ParcelType> inline Foam::scalar Foam::DsmcParcel<ParcelType>::constantProperties::sigmaT() const { - return mathematicalConstant::pi*d_*d_; + return constant::math::pi*d_*d_; } diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C index 69af3a855b3f2f60a81d80b1441a4028e7ac079b..3ab8c5511e1ccf6114859e479003e96b0de23443 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C @@ -25,6 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "LarsenBorgnakkeVariableHardSphere.H" +#include "mathConstants.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -156,7 +157,7 @@ Foam::scalar Foam::LarsenBorgnakkeVariableHardSphere<CloudType>::sigmaTcR // calculating cross section = pi*dPQ^2, where dPQ is from Bird, eq. 4.79 scalar sigmaTPQ = - mathematicalConstant::pi*dPQ*dPQ + constant::math::pi*dPQ*dPQ *pow(2.0*CloudType::kb*Tref_/(mR*cR*cR), omegaPQ - 0.5) /exp(Foam::lgamma(2.5 - omegaPQ)); @@ -252,7 +253,7 @@ void Foam::LarsenBorgnakkeVariableHardSphere<CloudType>::collide scalar sinTheta = sqrt(1.0 - cosTheta*cosTheta); - scalar phi = 2.0*mathematicalConstant::pi*rndGen.scalar01(); + scalar phi = constant::math::twoPi*rndGen.scalar01(); vector postCollisionRelU = cR diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C index 29b389a65ae197b866edb2019069e3667be96c07..8afc892c84b7a67234154c845c21b347693b37e1 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C @@ -25,6 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "VariableHardSphere.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -90,7 +91,7 @@ Foam::scalar Foam::VariableHardSphere<CloudType>::sigmaTcR // calculating cross section = pi*dPQ^2, where dPQ is from Bird, eq. 4.79 scalar sigmaTPQ = - mathematicalConstant::pi*dPQ*dPQ + constant::math::pi*dPQ*dPQ *pow(2.0*CloudType::kb*Tref_/(mR*cR*cR), omegaPQ - 0.5) /exp(Foam::lgamma(2.5 - omegaPQ)); @@ -125,7 +126,7 @@ void Foam::VariableHardSphere<CloudType>::collide scalar sinTheta = sqrt(1.0 - cosTheta*cosTheta); - scalar phi = 2.0*mathematicalConstant::pi*rndGen.scalar01(); + scalar phi = constant::math::twoPi*rndGen.scalar01(); vector postCollisionRelU = cR diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C index 0f0e135e4c9ab1042852cd547c000c9a00c2ae3c..5472e6c237b51f30e3c0badfc902d8ed9931a8f6 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C @@ -25,6 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "FreeStream.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -130,7 +131,7 @@ void Foam::FreeStream<CloudType>::inflow() Random& rndGen(cloud.rndGen()); - scalar sqrtPi = sqrt(mathematicalConstant::pi); + scalar sqrtPi = sqrt(constant::math::pi); label particlesInserted = 0; diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H index ee38bfd4533d18b89b1c5f7dac6188deb4fb01c7..d99c35dcfb32673931336d8c28021c21e03bb77a 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "radiationConstants.H" +#include "physicoChemicalConstants.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -229,7 +229,7 @@ Foam::ThermoCloud<ParcelType>::Ep() const Ep[cellI] += p.nParticle()*p.areaP()*pow4(p.T()); } - Ep *= epsilon*radiation::sigmaSB.value()/V; + Ep *= epsilon*constant::physicoChemical::sigma.value()/V; } return tEp; diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index cf4dc68acb02f7bf0059016e305ce0516e0aa971..c7a4b464c5b977c10243e645e6e71215b136cb92 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -25,7 +25,6 @@ License \*---------------------------------------------------------------------------*/ #include "KinematicParcel.H" -#include "dimensionedConstants.H" // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index 049ab26bac5569c8f4bf98716ef9309ff10b5f9d..04615ab6055b7761fcfeaacf2683cf87039be00d 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H @@ -49,7 +49,6 @@ SourceFiles #include "autoPtr.H" #include "interpolationCellPoint.H" #include "contiguous.H" -#include "mathematicalConstants.H" #include "KinematicCloud.H" diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H index e0d927153780af56e42ac11af2db03636bd583b0..30dc8ca1e7c22e1e2998674ede813bfe567acd0a 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H @@ -24,6 +24,8 @@ License \*---------------------------------------------------------------------------*/ +#include "mathConstants.H" + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template <class ParcelType> @@ -349,7 +351,7 @@ template <class ParcelType> inline Foam::scalar Foam::KinematicParcel<ParcelType>::volume(const scalar d) const { - return mathematicalConstant::pi/6.0*pow3(d); + return constant::math::pi/6.0*pow3(d); } @@ -379,7 +381,7 @@ template <class ParcelType> inline Foam::scalar Foam::KinematicParcel<ParcelType>::areaS(const scalar d) const { - return mathematicalConstant::pi*d*d; + return constant::math::pi*d*d; } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 682cad335ad2c0c9ad36aa89c11f5799adfc47dc..a215242cbc7f95a4e4fde5357c66bde45d804ae8 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -25,6 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "ReactingMultiphaseParcel.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -442,7 +443,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc } else { - this->d_ = cbrt(mass1/this->rho_*6.0/mathematicalConstant::pi); + this->d_ = cbrt(mass1/this->rho_*6.0/constant::math::pi); } } } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 8d388e6d6692b86d40f297bdc67397b1afc6ad42..3d534e39d44e30131a0aebb96ce48264ac33bed6 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -25,6 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "ReactingParcel.H" +#include "mathConstants.H" // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // @@ -257,7 +258,7 @@ void Foam::ReactingParcel<ParcelType>::calc } else { - this->d_ = cbrt(mass1/this->rho_*6.0/mathematicalConstant::pi); + this->d_ = cbrt(mass1/this->rho_*6.0/constant::math::pi); } } } diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index 6449b95dbacdf47a075589230aeb425d026f4bb1..8bd9a3a1268ef1e4e09f7847930a4a959b2e6374 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -25,6 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "ThermoParcel.H" +#include "physicoChemicalConstants.H" // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // @@ -188,7 +189,7 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer { const scalarField& G = td.cloud().mesh().objectRegistry::lookupObject<volScalarField>("G"); - const scalar sigma = radiation::sigmaSB.value(); + const scalar sigma = constant::physicoChemical::sigma.value(); const scalar epsilon = td.constProps().epsilon0(); ap = diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C index b7dd300b45857b920c986b79e63726db8020f478..a6297af086ff0904f872be312e425afbf9adb2b7 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C @@ -26,6 +26,7 @@ License #include "ConeInjection.H" #include "DataEntry.H" +#include "mathConstants.H" // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -200,7 +201,7 @@ void Foam::ConeInjection<CloudType>::setProperties ) { // set particle velocity - const scalar deg2Rad = mathematicalConstant::pi/180.0; + const scalar deg2Rad = constant::math::pi/180.0; scalar t = time - this->SOI_; scalar ti = thetaInner_().value(t); @@ -210,8 +211,7 @@ void Foam::ConeInjection<CloudType>::setProperties coneAngle *= deg2Rad; scalar alpha = sin(coneAngle); scalar dcorr = cos(coneAngle); - scalar beta = - 2.0*mathematicalConstant::pi*this->owner().rndGen().scalar01(); + scalar beta = constant::math::twoPi*this->owner().rndGen().scalar01(); vector normal = alpha*(tanVec1_*cos(beta) + tanVec2_*sin(beta)); vector dirVec = dcorr*direction_; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C index 8d1b57f2317001594da9a904742f28524bb93c6e..94a58b41c4f28bb2657357926e8b2ec8a55d00c4 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C @@ -26,6 +26,7 @@ License #include "ConeInjectionMP.H" #include "DataEntry.H" +#include "mathConstants.H" // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -246,7 +247,7 @@ void Foam::ConeInjectionMP<CloudType>::setProperties // set particle velocity const label i = parcelI%positions_.size(); - const scalar deg2Rad = mathematicalConstant::pi/180.0; + const scalar deg2Rad = constant::math::pi/180.0; scalar t = time - this->SOI_; scalar ti = thetaInner_().value(t); @@ -256,8 +257,7 @@ void Foam::ConeInjectionMP<CloudType>::setProperties coneAngle *= deg2Rad; scalar alpha = sin(coneAngle); scalar dcorr = cos(coneAngle); - scalar beta = - 2.0*mathematicalConstant::pi*this->owner().rndGen().scalar01(); + scalar beta = constant::math::twoPi*this->owner().rndGen().scalar01(); vector normal = alpha*(tanVec1_[i]*cos(beta) + tanVec2_[i]*sin(beta)); vector dirVec = dcorr*axes_[i]; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C index 8429ca7ca6543c88b80066ec1bfde05d61063e82..d10171de3d4bcccd13dac895e886b18e1acb5f4b 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C @@ -26,6 +26,7 @@ License #include "FieldActivatedInjection.H" #include "volFields.H" +#include "mathConstants.H" // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -129,7 +130,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection this->volumeTotal_ = nParcelsPerInjector_ *sum(pow3(diameters_)) - *mathematicalConstant::pi/6.0; + *constant::math::pi/6.0; // Set/cache the injector cells forAll(positions_, i) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index 42134dcdeddd0165892180182f72211cd61f4ffd..ccb56a47671185a7b33ae3178b7321382d5eae6e 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "InjectionModel.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "meshTools.H" // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // @@ -197,7 +197,7 @@ Foam::scalar Foam::InjectionModel<CloudType>::setNumberOfParticles { nP = volume/volumeTotal_ *massTotal_/rho - /(parcels*mathematicalConstant::pi/6.0*pow3(diameter)); + /(parcels*constant::math::pi/6.0*pow3(diameter)); break; } case pbNumber: diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C index dab3cf6f13a61c9c6c669789158c590607dbff06..d0018efbd6a4942de5762cac4da45a767b9bc568 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C @@ -25,6 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "ManualInjection.H" +#include "mathConstants.H" // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -105,7 +106,7 @@ Foam::ManualInjection<CloudType>::ManualInjection } // Determine volume of particles to inject - this->volumeTotal_ = sum(pow3(diameters_))*mathematicalConstant::pi/6.0; + this->volumeTotal_ = sum(pow3(diameters_))*constant::math::pi/6.0; } diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index 91274c245824fa7d76bd5caa3f43f8d77a49a129..324e4f80bc8f279af55a0da190caab3b796f92fc 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C @@ -26,6 +26,7 @@ License #include "LiquidEvaporation.H" #include "specie.H" +#include "mathConstants.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -148,7 +149,7 @@ void Foam::LiquidEvaporation<CloudType>::calculate scalarField Xc = calcXc(cellI); // droplet surface area - scalar A = mathematicalConstant::pi*sqr(d); + scalar A = constant::math::pi*sqr(d); // Reynolds number scalar Re = mag(Ur)*d/(nuc + ROOTVSMALL); diff --git a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C index 113fb829421dc6bc1591701c4a54c4e4cd3f05d5..40ebfba487242eb91a7e8549d3091d32958e7cc1 100644 --- a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C +++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C @@ -26,6 +26,7 @@ License #include "moleculeCloud.H" #include "fvMesh.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -623,20 +624,11 @@ void Foam::moleculeCloud::initialiseMolecules zoneDict.lookup("orientationAngles") ); - scalar phi - ( - orientationAngles.x()*mathematicalConstant::pi/180.0 - ); + scalar phi(orientationAngles.x()*constant::math::pi/180.0); - scalar theta - ( - orientationAngles.y()*mathematicalConstant::pi/180.0 - ); + scalar theta(orientationAngles.y()*constant::math::pi/180.0); - scalar psi - ( - orientationAngles.z()*mathematicalConstant::pi/180.0 - ); + scalar psi(orientationAngles.z()*constant::math::pi/180.0); const tensor R ( @@ -1002,11 +994,11 @@ void Foam::moleculeCloud::createMolecule { pi = equipartitionAngularMomentum(temperature, cP); - scalar phi(rndGen_.scalar01()*mathematicalConstant::twoPi); + scalar phi(rndGen_.scalar01()*constant::math::twoPi); - scalar theta(rndGen_.scalar01()*mathematicalConstant::twoPi); + scalar theta(rndGen_.scalar01()*constant::math::twoPi); - scalar psi(rndGen_.scalar01()*mathematicalConstant::twoPi); + scalar psi(rndGen_.scalar01()*constant::math::twoPi); Q = tensor ( diff --git a/src/lagrangian/molecularDynamics/potential/electrostaticPotential/electrostaticPotential.C b/src/lagrangian/molecularDynamics/potential/electrostaticPotential/electrostaticPotential.C index 1dff432741c4766ee3c86003af8a62f97fde9a4a..b6f5886f67bd54892a35a6abbc9712cf2d06185f 100644 --- a/src/lagrangian/molecularDynamics/potential/electrostaticPotential/electrostaticPotential.C +++ b/src/lagrangian/molecularDynamics/potential/electrostaticPotential/electrostaticPotential.C @@ -25,13 +25,13 @@ License \*---------------------------------------------------------------------------*/ #include "electrostaticPotential.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::electrostaticPotential::electrostaticPotential() : - prefactor(1.0/(4.0 * mathematicalConstant::pi * 8.854187817e-12)) + prefactor(1.0/(4.0*constant::math::pi*8.854187817e-12)) {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H index 9be12ebd0c840a0ec84e5c75f25d036586eaa338..8b2742f23455e9624e95b954b5f0f87fb0602aef 100644 --- a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H +++ b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H @@ -43,7 +43,6 @@ SourceFiles #include "List.H" #include "Pair.H" #include "Switch.H" -#include "mathematicalConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/derived/coulomb/coulomb.C b/src/lagrangian/molecularDynamics/potential/pairPotential/derived/coulomb/coulomb.C index 7dd02320322136e8f29a46ed1e0a7010c46615db..f66971bf8ed8b931474ffd9f30c44db25f68cbe0 100644 --- a/src/lagrangian/molecularDynamics/potential/pairPotential/derived/coulomb/coulomb.C +++ b/src/lagrangian/molecularDynamics/potential/pairPotential/derived/coulomb/coulomb.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "coulomb.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,7 +47,7 @@ addToRunTimeSelectionTable ); scalar coulomb::oneOverFourPiEps0 = - 1.0/(4.0 * mathematicalConstant::pi * 8.854187817e-12); + 1.0/(4.0*constant::math::pi*8.854187817e-12); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/derived/dampedCoulomb/dampedCoulomb.C b/src/lagrangian/molecularDynamics/potential/pairPotential/derived/dampedCoulomb/dampedCoulomb.C index fd771e1854e3d44980b6dd86cfa1e746a4d40b78..5fbf371f6463e1921db0fc9283d02e4891b287a4 100644 --- a/src/lagrangian/molecularDynamics/potential/pairPotential/derived/dampedCoulomb/dampedCoulomb.C +++ b/src/lagrangian/molecularDynamics/potential/pairPotential/derived/dampedCoulomb/dampedCoulomb.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "dampedCoulomb.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,7 +47,7 @@ addToRunTimeSelectionTable ); scalar dampedCoulomb::oneOverFourPiEps0 = - 1.0/(4.0 * mathematicalConstant::pi * 8.854187817e-12); + 1.0/(4.0*constant::math::pi*8.854187817e-12); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/meshTools/cellQuality/cellQuality.C b/src/meshTools/cellQuality/cellQuality.C index b1c47e8f10dd2debc2f77bf1891f7667a67e491d..19bef0e5face5e7cc6a162f1fc4d656e925cac56 100644 --- a/src/meshTools/cellQuality/cellQuality.C +++ b/src/meshTools/cellQuality/cellQuality.C @@ -26,7 +26,7 @@ License \*---------------------------------------------------------------------------*/ #include "cellQuality.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -67,7 +67,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::nonOrthogonality() const scalar cosDDotS = Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))) - *180.0/mathematicalConstant::pi; + *180.0/constant::math::pi; result[own[faceI]] = max(cosDDotS, result[own[faceI]]); @@ -76,7 +76,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::nonOrthogonality() const forAll (mesh_.boundaryMesh(), patchI) { - const unallocLabelList& faceCells = + const unallocLabelList& faceCells = mesh_.boundaryMesh()[patchI].faceCells(); const vectorField::subField faceCentres = @@ -93,7 +93,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::nonOrthogonality() const scalar cosDDotS = Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))) - *180.0/mathematicalConstant::pi; + *180.0/constant::math::pi; result[faceCells[faceI]] = max(cosDDotS, result[faceCells[faceI]]); } @@ -139,7 +139,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::skewness() const cellCtrs[own[faceI]] + (dOwn/(dOwn+dNei))*(cellCtrs[nei[faceI]] - cellCtrs[own[faceI]]); - scalar skewness = + scalar skewness = mag(faceCtrs[faceI] - faceIntersection) /(mag(cellCtrs[nei[faceI]] - cellCtrs[own[faceI]]) + VSMALL); @@ -150,7 +150,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::skewness() const forAll (mesh_.boundaryMesh(), patchI) { - const unallocLabelList& faceCells = + const unallocLabelList& faceCells = mesh_.boundaryMesh()[patchI].faceCells(); const vectorField::subField faceCentres = @@ -167,10 +167,10 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::skewness() const cellCtrs[faceCells[faceI]] + ((faceCentres[faceI] - cellCtrs[faceCells[faceI]])&n)*n; - scalar skewness = + scalar skewness = mag(faceCentres[faceI] - faceIntersection) /( - mag(faceCentres[faceI] - cellCtrs[faceCells[faceI]]) + mag(faceCentres[faceI] - cellCtrs[faceCells[faceI]]) + VSMALL ); @@ -208,7 +208,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceNonOrthogonality() const scalar cosDDotS = Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))) - *180.0/mathematicalConstant::pi; + *180.0/constant::math::pi; result[faceI] = cosDDotS; } @@ -217,7 +217,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceNonOrthogonality() const forAll (mesh_.boundaryMesh(), patchI) { - const unallocLabelList& faceCells = + const unallocLabelList& faceCells = mesh_.boundaryMesh()[patchI].faceCells(); const vectorField::subField faceCentres = @@ -234,7 +234,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceNonOrthogonality() const scalar cosDDotS = Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL))) - *180.0/mathematicalConstant::pi; + *180.0/constant::math::pi; result[globalFaceI++] = cosDDotS; } @@ -279,7 +279,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceSkewness() const cellCtrs[own[faceI]] + (dOwn/(dOwn+dNei))*(cellCtrs[nei[faceI]] - cellCtrs[own[faceI]]); - result[faceI] = + result[faceI] = mag(faceCtrs[faceI] - faceIntersection) /(mag(cellCtrs[nei[faceI]] - cellCtrs[own[faceI]]) + VSMALL); } @@ -289,7 +289,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceSkewness() const forAll (mesh_.boundaryMesh(), patchI) { - const unallocLabelList& faceCells = + const unallocLabelList& faceCells = mesh_.boundaryMesh()[patchI].faceCells(); const vectorField::subField faceCentres = @@ -306,10 +306,10 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceSkewness() const cellCtrs[faceCells[faceI]] + ((faceCentres[faceI] - cellCtrs[faceCells[faceI]])&n)*n; - result[globalFaceI++] = + result[globalFaceI++] = mag(faceCentres[faceI] - faceIntersection) /( - mag(faceCentres[faceI] - cellCtrs[faceCells[faceI]]) + mag(faceCentres[faceI] - cellCtrs[faceCells[faceI]]) + VSMALL ); } diff --git a/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.C index 963d5084dbf3addb27b6f00a4d41155709bdda1b..f3afa950ae436b5c00db0c2cd5a5765a19ba95f5 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.C @@ -27,7 +27,7 @@ License #include "EulerCoordinateRotation.H" #include "Switch.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -59,9 +59,9 @@ void Foam::EulerCoordinateRotation::calcTransform if (inDegrees) { - phi *= mathematicalConstant::pi/180.0; - theta *= mathematicalConstant::pi/180.0; - psi *= mathematicalConstant::pi/180.0; + phi *= constant::math::pi/180.0; + theta *= constant::math::pi/180.0; + psi *= constant::math::pi/180.0; } tensor::operator= diff --git a/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C index 168a25ef798bdaca541d504d2a9e67e6005fb33e..1350ed3bc56a60b8023d50b61a2482badc8a3cff 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C @@ -27,7 +27,7 @@ License #include "STARCDCoordinateRotation.H" #include "Switch.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -60,9 +60,9 @@ void Foam::STARCDCoordinateRotation::calcTransform if (inDegrees) { - x *= mathematicalConstant::pi/180.0; - y *= mathematicalConstant::pi/180.0; - z *= mathematicalConstant::pi/180.0; + x *= constant::math::pi/180.0; + y *= constant::math::pi/180.0; + z *= constant::math::pi/180.0; } tensor::operator= diff --git a/src/meshTools/coordinateSystems/cylindricalCS.C b/src/meshTools/coordinateSystems/cylindricalCS.C index 33a7455cc2d66819a6a2ccf6c707905863c5fa71..31d8456ec5d76c11c23eea6ebb2d32d4f4c28ac8 100644 --- a/src/meshTools/coordinateSystems/cylindricalCS.C +++ b/src/meshTools/coordinateSystems/cylindricalCS.C @@ -28,7 +28,7 @@ License #include "one.H" #include "Switch.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -133,7 +133,7 @@ Foam::vector Foam::cylindricalCS::localToGlobal { scalar theta ( - local.y() * ( inDegrees_ ? mathematicalConstant::pi/180.0 : 1.0 ) + local.y()*(inDegrees_ ? constant::math::pi/180.0 : 1.0) ); return coordinateSystem::localToGlobal @@ -153,7 +153,7 @@ Foam::tmp<Foam::vectorField> Foam::cylindricalCS::localToGlobal scalarField theta = ( local.component(vector::Y) - * ( inDegrees_ ? mathematicalConstant::pi/180.0 : 1.0 ) + *(inDegrees_ ? constant::math::pi/180.0 : 1.0) ); @@ -181,7 +181,7 @@ Foam::vector Foam::cylindricalCS::globalToLocal ( lc.y(), lc.x() - ) * ( inDegrees_ ? 180.0/mathematicalConstant::pi : 1.0 ), + )*(inDegrees_ ? 180.0/constant::math::pi : 1.0), lc.z() ); } @@ -212,7 +212,7 @@ Foam::tmp<Foam::vectorField> Foam::cylindricalCS::globalToLocal ( lc.component(vector::Y), lc.component(vector::X) - ) * ( inDegrees_ ? 180.0/mathematicalConstant::pi : 1.0 ) + )*(inDegrees_ ? 180.0/constant::math::pi : 1.0) ); result.replace(vector::Z, lc.component(vector::Z)); diff --git a/src/meshTools/coordinateSystems/sphericalCS.C b/src/meshTools/coordinateSystems/sphericalCS.C index 0e3f2663e5b6799c9fe42e61ef7758216c41616e..e36d0e50a78b180cc25a794c4272e5fce8429def 100644 --- a/src/meshTools/coordinateSystems/sphericalCS.C +++ b/src/meshTools/coordinateSystems/sphericalCS.C @@ -28,7 +28,7 @@ License #include "one.H" #include "Switch.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -135,12 +135,12 @@ Foam::vector Foam::sphericalCS::localToGlobal const scalar theta ( local.y() - * ( inDegrees_ ? mathematicalConstant::pi/180.0 : 1.0 ) + *(inDegrees_ ? constant::math::pi/180.0 : 1.0) ); const scalar phi ( local.z() - * ( inDegrees_ ? mathematicalConstant::pi/180.0 : 1.0 ) + *(inDegrees_ ? constant::math::pi/180.0 : 1.0) ); return coordinateSystem::localToGlobal @@ -161,12 +161,12 @@ Foam::tmp<Foam::vectorField> Foam::sphericalCS::localToGlobal const scalarField theta ( local.component(vector::Y) - * ( inDegrees_ ? mathematicalConstant::pi/180.0 : 1.0 ) + *(inDegrees_ ? constant::math::pi/180.0 : 1.0) ); const scalarField phi ( local.component(vector::Z) - * ( inDegrees_ ? mathematicalConstant::pi/180.0 : 1.0 ) + *(inDegrees_ ? constant::math::pi/180.0 : 1.0) ); vectorField lc(local.size()); @@ -193,11 +193,11 @@ Foam::vector Foam::sphericalCS::globalToLocal atan2 ( lc.y(), lc.x() - ) * ( inDegrees_ ? 180.0/mathematicalConstant::pi : 1.0 ), + )*(inDegrees_ ? 180.0/constant::math::pi : 1.0), acos ( lc.z()/(r + SMALL) - ) * ( inDegrees_ ? 180.0/mathematicalConstant::pi : 1.0 ) + )*(inDegrees_ ? 180.0/constant::math::pi : 1.0) ); } @@ -227,7 +227,7 @@ Foam::tmp<Foam::vectorField> Foam::sphericalCS::globalToLocal ( lc.component(vector::Y), lc.component(vector::X) - ) * ( inDegrees_ ? 180.0/mathematicalConstant::pi : 1.0 ) + )*(inDegrees_ ? 180.0/constant::math::pi : 1.0) ); result.replace @@ -236,7 +236,7 @@ Foam::tmp<Foam::vectorField> Foam::sphericalCS::globalToLocal acos ( lc.component(vector::Z)/(r + SMALL) - ) * ( inDegrees_ ? 180.0/mathematicalConstant::pi : 1.0 ) + )*(inDegrees_ ? 180.0/constant::math::pi : 1.0) ); return tresult; diff --git a/src/meshTools/coordinateSystems/toroidalCS.C b/src/meshTools/coordinateSystems/toroidalCS.C index 189e0e4979082509ad2211b952cc026ee833c3e8..c9d8c82f27011b341f7e97aae29b12fa4a8fd395 100644 --- a/src/meshTools/coordinateSystems/toroidalCS.C +++ b/src/meshTools/coordinateSystems/toroidalCS.C @@ -26,7 +26,7 @@ License #include "toroidalCS.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -72,8 +72,8 @@ Foam::vector Foam::toroidalCS::localToGlobal ) const { // Notation: r = local.x() - scalar theta = local.y()*mathematicalConstant::pi/180.0; - scalar phi = local.z()*mathematicalConstant::pi/180.0; + scalar theta = local.y()*constant::math::pi/180.0; + scalar phi = local.z()*constant::math::pi/180.0; scalar rprime = radius_ + local.x()*sin(phi); @@ -101,10 +101,10 @@ Foam::tmp<Foam::vectorField> Foam::toroidalCS::localToGlobal const scalarField r = local.component(vector::X); const scalarField theta = - local.component(vector::Y)*mathematicalConstant::pi/180.0; + local.component(vector::Y)*constant::math::pi/180.0; const scalarField phi = - local.component(vector::Z)*mathematicalConstant::pi/180.0; + local.component(vector::Z)*constant::math::pi/180.0; const scalarField rprime = radius_ + r*sin(phi); diff --git a/src/meshTools/primitiveMeshGeometry/primitiveMeshGeometry.C b/src/meshTools/primitiveMeshGeometry/primitiveMeshGeometry.C index 37f3c21fd0b26d5fb7fa1afc0af77ebf62465c72..56e878938e6a2e17817c65276ab796cf77bbb9c4 100644 --- a/src/meshTools/primitiveMeshGeometry/primitiveMeshGeometry.C +++ b/src/meshTools/primitiveMeshGeometry/primitiveMeshGeometry.C @@ -26,14 +26,13 @@ License #include "primitiveMeshGeometry.H" #include "pyramidPointFaceRef.H" - -namespace Foam -{ +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -defineTypeNameAndDebug(primitiveMeshGeometry, 0); - +namespace Foam +{ + defineTypeNameAndDebug(primitiveMeshGeometry, 0); } @@ -273,7 +272,7 @@ bool Foam::primitiveMeshGeometry::checkFaceDotProduct // Severe nonorthogonality threshold const scalar severeNonorthogonalityThreshold = - ::cos(orthWarn/180.0*mathematicalConstant::pi); + ::cos(orthWarn/180.0*constant::math::pi); scalar minDDotS = GREAT; @@ -305,7 +304,7 @@ bool Foam::primitiveMeshGeometry::checkFaceDotProduct << " between cells " << own[faceI] << " and " << nei[faceI] << ": Angle = " - << ::acos(dDotS)/mathematicalConstant::pi*180.0 + << ::acos(dDotS)/constant::math::pi*180.0 << " deg." << endl; } @@ -331,7 +330,7 @@ bool Foam::primitiveMeshGeometry::checkFaceDotProduct << " between cells " << own[faceI] << " and " << nei[faceI] << ": Angle = " - << ::acos(dDotS)/mathematicalConstant::pi*180.0 + << ::acos(dDotS)/constant::math::pi*180.0 << " deg." << endl; } @@ -377,9 +376,9 @@ bool Foam::primitiveMeshGeometry::checkFaceDotProduct if (neiSize > 0) { 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; } } @@ -561,7 +560,7 @@ bool Foam::primitiveMeshGeometry::checkFaceSkewness cellCentres[own[faceI]]*dNei/(dOwn+dNei) + cellCentres[nei[faceI]]*dOwn/(dOwn+dNei); - scalar skewness = + scalar skewness = mag(faceCentres[faceI] - faceIntersection) / ( mag(cellCentres[nei[faceI]]-cellCentres[own[faceI]]) @@ -781,7 +780,7 @@ bool Foam::primitiveMeshGeometry::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(); @@ -862,7 +861,7 @@ bool Foam::primitiveMeshGeometry::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" @@ -1248,7 +1247,7 @@ bool Foam::primitiveMeshGeometry::checkCellDeterminant forAll(cFaces, cFaceI) { label faceI = cFaces[cFaceI]; - + scalar magArea = mag(faceAreas[faceI]); magAreaSum += magArea; @@ -1275,7 +1274,7 @@ bool Foam::primitiveMeshGeometry::checkCellDeterminant nWarnDet++; } } - + reduce(minDet, minOp<scalar>()); reduce(sumDet, sumOp<scalar>()); reduce(nSumDet, sumOp<label>()); diff --git a/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C b/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C index c8f23570d4d9adabdbf22a4f0add95fe7581c730..ba460f73813cd85078f7906c88974e6d144c1212 100644 --- a/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C +++ b/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C @@ -26,7 +26,7 @@ License #include "shapeToCell.H" #include "polyMesh.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "hexMatcher.H" #include "cellFeatures.H" @@ -57,7 +57,7 @@ Foam::topoSetSource::addToUsageTable Foam::shapeToCell::usage_ // Angle for polys to be considered splitHexes. Foam::scalar Foam::shapeToCell::featureCos = - Foam::cos(10.0 * mathematicalConstant::pi/180.0); + Foam::cos(10.0*Foam::constant::math::pi/180.0); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C index 7ff2327196dd4b6242a20163dca54b3697725d6b..1666da5a8eb8c518f2fe14b2d6310bbc0d45298d 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C @@ -36,7 +36,7 @@ License #include "meshTools.H" #include "plane.H" #include "Random.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "treeBoundBox.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,7 +44,7 @@ License defineTypeNameAndDebug(Foam::edgeIntersections, 0); Foam::scalar Foam::edgeIntersections::alignedCos_ = - Foam::cos(89.0*Foam::mathematicalConstant::pi/180.0); + Foam::cos(89.0*Foam::constant::math::pi/180.0); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C b/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C index af3be4840a9248cb807a0c57a22766cdb47577f0..dceed6d2c991f8f9f09bc00296a120d06b81ffd1 100644 --- a/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C +++ b/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C @@ -33,6 +33,7 @@ License #include "linePointRef.H" #include "OFstream.H" #include "IFstream.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -490,11 +491,7 @@ Foam::labelList Foam::surfaceFeatures::selectFeatureEdges void Foam::surfaceFeatures::findFeatures(const scalar includedAngle) { scalar minCos = - Foam::cos - ( - (180.0-includedAngle) - * mathematicalConstant::pi/180.0 - ); + Foam::cos((180.0 - includedAngle)*constant::math::pi/180.0); const labelListList& edgeFaces = surf_.edgeFaces(); const vectorField& faceNormals = surf_.faceNormals(); diff --git a/src/randomProcesses/Kmesh/Kmesh.C b/src/randomProcesses/Kmesh/Kmesh.C index 462e8fd6d5b3d88381310a00263027810f7deb32..93091114f19559168748584733ec1f07f564afd8 100644 --- a/src/randomProcesses/Kmesh/Kmesh.C +++ b/src/randomProcesses/Kmesh/Kmesh.C @@ -27,7 +27,7 @@ License #include "Kmesh.H" #include "polyMesh.H" #include "volFields.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,14 +57,11 @@ Foam::Kmesh::Kmesh(const fvMesh& mesh) vectorField(mesh.V().size()), NN(vector::dim) { - const scalar pi = mathematicalConstant::pi; - const scalar twoPi = 2.0*pi; - boundBox box = mesh.bounds(); L = box.span(); vector cornerCellCentre = ::Foam::max(mesh.C().internalField()); - vector cellL = 2 * (box.max() - cornerCellCentre); + vector cellL = 2*(box.max() - cornerCellCentre); vector rdeltaByL; label nTot = 1; @@ -92,15 +89,15 @@ Foam::Kmesh::Kmesh(const fvMesh& mesh) for (i=0; i<NN[0]; i++) { - scalar k1 = (i - NN[0]/2)*twoPi/L[0]; + scalar k1 = (i - NN[0]/2)*constant::math::twoPi/L[0]; for (label j=0; j<NN[1]; j++) { - scalar k2 = (j - NN[1]/2)*twoPi/L[1]; + scalar k2 = (j - NN[1]/2)*constant::math::twoPi/L[1]; for (label k=0; k<NN[2]; k++) { - scalar k3 = (k - NN[2]/2)*twoPi/L[2]; + scalar k3 = (k - NN[2]/2)*constant::math::twoPi/L[2]; (*this)[rep(i, j, k, NN)] = vector(k1, k2, k3); } diff --git a/src/randomProcesses/fft/kShellIntegration.C b/src/randomProcesses/fft/kShellIntegration.C index e7dc77b0c56c34c8b8857e64b94e1887a8e49346..c007425c810dc4492310cabe2352ce5db739c33c 100644 --- a/src/randomProcesses/fft/kShellIntegration.C +++ b/src/randomProcesses/fft/kShellIntegration.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "kShellIntegration.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -51,12 +51,12 @@ graph kShellIntegration // spectra E(k). int E(k) dk is now the total energy in a box // of side 2pi - y *= sqr(x)*4.0*mathematicalConstant::pi; + y *= sqr(x)*4.0*constant::math::pi; // now scale this to get the energy in a box of side l0 - scalar l0(K.sizeOfBox()[0]*(scalar(K.nn()[0])/(scalar(K.nn()[0])-1.0))); - scalar factor = pow((l0/(2.0*mathematicalConstant::pi)),3.0); + scalar l0(K.sizeOfBox()[0]*(scalar(K.nn()[0])/(scalar(K.nn()[0]) - 1.0))); + scalar factor = pow3(l0/constant::math::twoPi); y *= factor; diff --git a/src/randomProcesses/noise/noiseFFT.C b/src/randomProcesses/noise/noiseFFT.C index e899ae0dceb01e071826a5ffcb6aa27ffcab0943..d843e871b72d97bdd38700b37e332aae3b645b68 100644 --- a/src/randomProcesses/noise/noiseFFT.C +++ b/src/randomProcesses/noise/noiseFFT.C @@ -28,7 +28,7 @@ License #include "IFstream.H" #include "DynamicList.H" #include "fft.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "SubField.H" // * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * // @@ -170,7 +170,7 @@ Foam::tmp<Foam::scalarField> Foam::noiseFFT::Hanning(const label N) const scalar T = N*deltat_; - return 2*(0.5 - 0.5*cos(2*mathematicalConstant::pi*t/T)); + return 2*(0.5 - 0.5*cos(constant::math::twoPi*t/T)); } diff --git a/src/randomProcesses/turbulence/turbGen.C b/src/randomProcesses/turbulence/turbGen.C index 1a353d04104c42ab9a3ffcf0edaf940fc0e09801..6ac9c90804dab6e86a043e93e13d847f7800f6de 100644 --- a/src/randomProcesses/turbulence/turbGen.C +++ b/src/randomProcesses/turbulence/turbGen.C @@ -29,7 +29,7 @@ License #include "Kmesh.H" #include "primitiveFields.H" #include "Ek.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -53,8 +53,6 @@ turbGen::turbGen(const Kmesh& k, const scalar EA, const scalar K0) // generate and return a velocity field vectorField turbGen::U() { - scalar pi2=2*mathematicalConstant::pi; - vectorField s(K.size()); scalarField rndPhases(K.size()); @@ -69,11 +67,13 @@ vectorField turbGen::U() s = Ek(Ea, k0, mag(K))*s; - complexVectorField up = fft::reverseTransform - ( - ComplexField(cos(pi2*rndPhases)*s, sin(pi2*rndPhases)*s), - K.nn() - ); + complexVectorField up = + fft::reverseTransform + ( + ComplexField(cos(constant::math::twoPi*rndPhases)*s, + sin(constant::math::twoPi*rndPhases)*s), + K.nn() + ); return ReImSum(up); } diff --git a/src/thermophysicalModels/radiation/Make/files b/src/thermophysicalModels/radiation/Make/files index 4e7fb1b11cbaab0879b316bb76a2bde95eb4fa0d..efa6279d30553c367e88b86c6d95f34f34956c76 100644 --- a/src/thermophysicalModels/radiation/Make/files +++ b/src/thermophysicalModels/radiation/Make/files @@ -1,6 +1,3 @@ -/* Radiation constants */ -radiationConstants/radiationConstants.C - /* Radiation model */ radiationModel/radiationModel/radiationModel.C radiationModel/radiationModel/newRadiationModel.C diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C index d6fc4a378adf4a8f7dcb27bf37063bac4b942484..f599c447f64ef24e47ab82b12c9243a981a58b7c 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C @@ -31,7 +31,7 @@ License #include "fvc.H" #include "radiationModel.H" -#include "radiationConstants.H" +#include "physicoChemicalConstants.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -79,7 +79,7 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField const scalarField& Tp = patch().lookupPatchField<volScalarField, scalar>(TName_); - refValue() = 4.0*radiation::sigmaSB.value()*pow4(Tp); + refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Tp); refGrad() = 0.0; if (dict.found("value")) @@ -152,7 +152,7 @@ void Foam::MarshakRadiationFvPatchScalarField::updateCoeffs() patch().lookupPatchField<volScalarField, scalar>(TName_); // Re-calc reference value - refValue() = 4.0*radiation::sigmaSB.value()*pow4(Tp); + refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Tp); // Diffusion coefficient - created by radiation model's ::updateCoeffs() const scalarField& gamma = diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C index d8e8957270d558e60ca0a214b4625d5fb4779d74..2620d111cba736293c376a37238fc4ca15e7affc 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C @@ -31,7 +31,7 @@ License #include "fvc.H" #include "radiationModel.H" -#include "radiationConstants.H" +#include "physicoChemicalConstants.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -79,7 +79,7 @@ MarshakRadiationFixedTMixedFvPatchScalarField Trad_("Trad", dict, p.size()), emissivity_(readScalar(dict.lookup("emissivity"))) { - refValue() = 4.0*radiation::sigmaSB.value()*pow4(Trad_); + refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Trad_); refGrad() = 0.0; if (dict.found("value")) @@ -156,7 +156,7 @@ void Foam::MarshakRadiationFixedTMixedFvPatchScalarField::updateCoeffs() } // Re-calc reference value - refValue() = 4.0*radiation::sigmaSB.value()*pow4(Trad_); + refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Trad_); // Diffusion coefficient - created by radiation model's ::updateCoeffs() const scalarField& gamma = diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index 80c3c2dc694839322ceaf2cfa40b1df6929fe6be..252bfbde1b4d8675175ccd87a78780e3515c0e7c 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -30,9 +30,9 @@ License #include "volFields.H" #include "fvDOM.H" -#include "radiationConstants.H" -#include "mathematicalConstants.H" +#include "constants.H" +using namespace Foam::constant; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -84,8 +84,7 @@ greyDiffusiveRadiationMixedFvPatchScalarField patch().lookupPatchField<volScalarField, scalar>(TName_); refValue() = - emissivity_*4.0*radiation::sigmaSB.value()*pow4(Tp) - /Foam::mathematicalConstant::pi; + emissivity_*4.0*physicoChemical::sigma.value()*pow4(Tp)/math::pi; refGrad() = 0.0; @@ -199,9 +198,9 @@ updateCoeffs() refValue()[faceI] = ( Ir*(1.0 - emissivity_) - + emissivity_*radiation::sigmaSB.value()*pow4(Tp[faceI]) + + emissivity_*physicoChemical::sigma.value()*pow4(Tp[faceI]) ) - /mathematicalConstant::pi; + /constant::math::pi; } else diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index 08dbb061ed6e9c8b63b9032c0b7e33ce8e6ee277..6201dc66ed12a003f527a45fe5ec57b52301071c 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -31,8 +31,9 @@ License #include "fvDOM.H" #include "wideBandAbsorptionEmission.H" -#include "radiationConstants.H" -#include "mathematicalConstants.H" +#include "constants.H" + +using namespace Foam::constant; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -84,8 +85,7 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField patch().lookupPatchField<volScalarField, scalar>(TName_); refValue() = - emissivity_*4.0*radiation::sigmaSB.value()*pow4(Tp) - /Foam::mathematicalConstant::pi; + emissivity_*4.0*physicoChemical::sigma.value()*pow4(Tp)/math::pi; refGrad() = 0.0; if (dict.found("value")) @@ -198,7 +198,7 @@ updateCoeffs() Ir*(1.0 - emissivity_) + emissivity_*Eb[faceI] ) - /mathematicalConstant::pi; + /math::pi; } else { diff --git a/src/thermophysicalModels/radiation/radiationConstants/radiationConstants.C b/src/thermophysicalModels/radiation/radiationConstants/radiationConstants.C deleted file mode 100644 index 0e5962910d297c970e0f32e947de103e01e019c0..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/radiation/radiationConstants/radiationConstants.C +++ /dev/null @@ -1,48 +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 - -\*---------------------------------------------------------------------------*/ - -#include "radiationConstants.H" -#include "dimensionedConstants.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -//- Stefan-Boltzmann constant (default in [J/(K4 m2 s)]) -const Foam::dimensionedScalar Foam::radiation::sigmaSB -( - Foam::dimensionedConstant - ( - "sigmaSB", - dimensionedScalar - ( - "sigmaSB", - dimensionSet(1, 0, -3, -4, 0, 0, 0), - 5.670E-08 - ) - ) -); - - -// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationConstants/radiationConstants.H b/src/thermophysicalModels/radiation/radiationConstants/radiationConstants.H deleted file mode 100644 index 2e7e5602e81cde6e8c0b8f1779aa3d1a34760371..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/radiation/radiationConstants/radiationConstants.H +++ /dev/null @@ -1,53 +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 - -InNamespace - Foam::radiation - -Description - Constants used in radiation modelling - -\*---------------------------------------------------------------------------*/ - -#ifndef radiationConstants_H -#define radiationConstants_H - -#include "dimensionedScalar.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace radiation -{ - //- Stefan-Boltzmann constant [J/(K4 m2 s)] - extern const dimensionedScalar sigmaSB; -} -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModel/P1/P1.C b/src/thermophysicalModels/radiation/radiationModel/P1/P1.C index dee96292927b8c0032fd5ab2400cfb77c1b78611..983e5cb0c7094b6d924502230e737d8e7f0a3fb5 100644 --- a/src/thermophysicalModels/radiation/radiationModel/P1/P1.C +++ b/src/thermophysicalModels/radiation/radiationModel/P1/P1.C @@ -30,8 +30,9 @@ License #include "absorptionEmissionModel.H" #include "scatterModel.H" -#include "mathematicalConstants.H" -#include "radiationConstants.H" +#include "constants.H" + +using namespace Foam::constant; // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -160,7 +161,7 @@ void Foam::radiation::P1::calculate() fvm::laplacian(gamma, G_) - fvm::Sp(a_, G_) == - - 4.0*(e_*radiation::sigmaSB*pow4(T_) + E_) + - 4.0*(e_*physicoChemical::sigma*pow4(T_) + E_) ); } @@ -180,7 +181,7 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::P1::Rp() const IOobject::NO_WRITE, false ), - 4.0*absorptionEmission_->eCont()*radiation::sigmaSB + 4.0*absorptionEmission_->eCont()*physicoChemical::sigma ) ); } diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C index bc21f3bfe0bfc027479aef047315895b4db061c4..29eb2a6513cb600a750710080044dbaef240ed37 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C @@ -25,7 +25,9 @@ License \*---------------------------------------------------------------------------*/ #include "blackBodyEmission.H" -#include "dimensionedConstants.H" +#include "physicoChemicalConstants.H" + +using namespace Foam::constant; // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -171,7 +173,7 @@ Foam::radiation::blackBodyEmission::blackBodyEmission IOobject::NO_READ, IOobject::NO_WRITE ), - radiation::sigmaSB*pow4(T) + physicoChemical::sigma*pow4(T) ) ); @@ -215,7 +217,7 @@ Foam::radiation::blackBodyEmission::EbDeltaLambdaT IOobject::NO_READ, IOobject::NO_WRITE ), - radiation::sigmaSB*pow4(T) + physicoChemical::sigma*pow4(T) ) ); diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H index 958f6d6d7e0bb1a9e6a611e625ad42f6def1b957..ab0d2e27583b66e253d07cf74a9af0a65924744d 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H @@ -41,8 +41,6 @@ SourceFiles #include "volFields.H" #include "dimensionedScalar.H" -#include "mathematicalConstants.H" -#include "radiationConstants.H" #include "interpolationTable.H" #include "Vector2D.H" diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C index bfcf1309e881dd41bea7d8f97671ca315f8d2236..81f8457ba4606ef70acb9748aca658ec28c5a9a1 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C @@ -30,8 +30,9 @@ License #include "absorptionEmissionModel.H" #include "scatterModel.H" -#include "mathematicalConstants.H" -#include "radiationConstants.H" +#include "constants.H" + +using namespace Foam::constant; // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -135,8 +136,8 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T) { nRay_ = 4*nPhi_*nTheta_; IRay_.setSize(nRay_); - scalar deltaPhi = mathematicalConstant::pi/(2.0*nPhi_); - scalar deltaTheta = mathematicalConstant::pi/nTheta_; + scalar deltaPhi = math::pi/(2.0*nPhi_); + scalar deltaTheta = math::pi/nTheta_; label i = 0; for (label n = 1; n <= nTheta_; n++) { @@ -168,11 +169,11 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T) { if (mesh_.nSolutionD() == 2) //2D (X & Y) { - scalar thetai = mathematicalConstant::pi/2.0; - scalar deltaTheta = mathematicalConstant::pi; + scalar thetai = math::piByTwo; + scalar deltaTheta = math::pi; nRay_ = 4*nPhi_; IRay_.setSize(nRay_); - scalar deltaPhi = mathematicalConstant::pi/(2.0*nPhi_); + scalar deltaPhi = math::pi/(2.0*nPhi_); label i = 0; for (label m = 1; m <= 4*nPhi_; m++) { @@ -198,11 +199,11 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T) } else //1D (X) { - scalar thetai = mathematicalConstant::pi/2.0; - scalar deltaTheta = mathematicalConstant::pi; + scalar thetai = math::piByTwo; + scalar deltaTheta = math::pi; nRay_ = 2; IRay_.setSize(nRay_); - scalar deltaPhi = mathematicalConstant::pi; + scalar deltaPhi = math::pi; label i = 0; for (label m = 1; m <= 2; m++) { @@ -329,7 +330,7 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::fvDOM::Rp() const IOobject::NO_WRITE, false ), - 4.0*a_*radiation::sigmaSB //absorptionEmission_->a() + 4.0*a_*physicoChemical::sigma //absorptionEmission_->a() ) ); } diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C index ff22c6335933fb2ba307b82cfb7093432b4f7c30..cb94ca5f9da71544d7d06787a85902d41fc546af 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C @@ -30,8 +30,7 @@ License #include "absorptionEmissionModel.H" #include "scatterModel.H" -#include "mathematicalConstants.H" -#include "radiationConstants.H" +#include "mathConstants.H" #include "radiationModel.H" #include "Vector2D.H" @@ -203,7 +202,7 @@ Foam::scalar Foam::radiation::radiativeIntensityRay::correct() fvm::div(Ji, ILambda_[lambdaI], "div(Ji,Ii_h)") + fvm::Sp(k*omega_, ILambda_[lambdaI]) == - 1.0/Foam::mathematicalConstant::pi + 1.0/constant::math::pi *( k*omega_*blackBody_.bLambda(lambdaI) + absorptionEmission_.ECont(lambdaI) diff --git a/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.C b/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.C index fc6fbc549a3e3237ba7238436db5dbc8f93e2d8f..8ef1082187e1029aed294158dc8f50717e2980de 100644 --- a/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.C +++ b/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.C @@ -24,11 +24,9 @@ License \*---------------------------------------------------------------------------*/ -#include "error.H" - #include "noRadiation.H" #include "addToRunTimeSelectionTable.H" -#include "radiationConstants.H" +#include "physicoChemicalConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -94,7 +92,7 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::noRadiation::Rp() const dimensionedScalar ( "Rp", - radiation::sigmaSB.dimensions()/dimLength, + constant::physicoChemical::sigma.dimensions()/dimLength, 0.0 ) ) diff --git a/src/thermophysicalModels/specie/specie/specie.C b/src/thermophysicalModels/specie/specie/specie.C index 03dd826197b7ea0d3358dc6a34fd7a48d4fe2f35..49709d4f36a3d39e7cde52020535a71f98165fc0 100644 --- a/src/thermophysicalModels/specie/specie/specie.C +++ b/src/thermophysicalModels/specie/specie/specie.C @@ -26,18 +26,18 @@ License #include "specie.H" #include "IOstreams.H" -#include "dimensionedConstants.H" +#include "constants.H" -/* * * * * * * * * * * * * public constants * * * * * * * * * * * * */ +/* * * * * * * * * * * * * * * public constants * * * * * * * * * * * * * * */ //- Universal gas constant (default in [J/(kmol K)]) -const Foam::scalar Foam::specie::RR = dimensionedConstant("R", 8314.51); +const Foam::scalar Foam::specie::RR = constant::physicoChemical::R.value()*1000; //- Standard pressure (default in [Pa]) -const Foam::scalar Foam::specie::Pstd = dimensionedConstant("Pstd", 1.0e5); +const Foam::scalar Foam::specie::Pstd = constant::standard::Pstd.value(); //- Standard temperature (default in [K]) -const Foam::scalar Foam::specie::Tstd = dimensionedConstant("Tstd", 298.15); +const Foam::scalar Foam::specie::Tstd = constant::standard::Tstd.value(); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/transportModels/interfaceProperties/interfaceProperties.C b/src/transportModels/interfaceProperties/interfaceProperties.C index 53c4e904964c37a6c294c155860353f2bd144bc4..22f4da24b3e31445d46ee80963dc7419bb016d75 100644 --- a/src/transportModels/interfaceProperties/interfaceProperties.C +++ b/src/transportModels/interfaceProperties/interfaceProperties.C @@ -26,7 +26,7 @@ License #include "interfaceProperties.H" #include "alphaContactAngleFvPatchScalarField.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" #include "fvcGrad.H" @@ -35,7 +35,7 @@ License // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // const Foam::scalar Foam::interfaceProperties::convertToRad = - Foam::mathematicalConstant::pi/180.0; + Foam::constant::math::pi/180.0; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C index 23a048a4d68141a3c90a93f6832a94205ca2316a..82454b8c2eb37ac89d03e5c9f197352672619533 100644 --- a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C +++ b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C @@ -43,7 +43,7 @@ Description #include "cellShape.H" #include "cellModeller.H" #include "mergePoints.H" -#include "mathematicalConstants.H" +#include "mathConstants.H" using namespace Foam; @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) fileName pointsFile(runTime.constantPath()/"points.tmp"); OFstream pFile(pointsFile); - scalar a(0.1*mathematicalConstant::pi/180.0); + scalar a(0.1*constant::math::pi/180.0); tensor rotateZ = tensor (