Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
henry
2009-09-01 10:44:48 +01:00
245 changed files with 3279 additions and 2419 deletions

View File

@ -30,7 +30,7 @@ scalar gasMass0 = fvc::domainIntegrate(rho).value();
if (dieselSpray.twoD()) if (dieselSpray.twoD())
{ {
gasMass0 *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge(); gasMass0 *= constant::math::twoPi/dieselSpray.angleOfWedge();
} }
gasMass0 -= gasMass0 -=

View File

@ -43,6 +43,7 @@ Description
#include "OFstream.H" #include "OFstream.H"
#include "volPointInterpolation.H" #include "volPointInterpolation.H"
#include "thermoPhysicsTypes.H" #include "thermoPhysicsTypes.H"
#include "mathConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -20,7 +20,7 @@
if (dieselSpray.twoD()) if (dieselSpray.twoD())
{ {
gasMass *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge(); gasMass *= constant::math::twoPi/dieselSpray.angleOfWedge();
} }
scalar addedMass = gasMass - gasMass0; scalar addedMass = gasMass - gasMass0;

View File

@ -41,6 +41,7 @@ Description
#include "IFstream.H" #include "IFstream.H"
#include "OFstream.H" #include "OFstream.H"
#include "Switch.H" #include "Switch.H"
#include "mathConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -58,6 +58,7 @@ Description
#include "ignition.H" #include "ignition.H"
#include "Switch.H" #include "Switch.H"
#include "OFstream.H" #include "OFstream.H"
#include "mathConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -28,7 +28,7 @@ License
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -182,7 +182,7 @@ void smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
} }
Field<scalar> C2 = pmu/prho 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*gamma_/Pr.value()/(gamma_ + 1.0)
*(2.0 - accommodationCoeff_)/accommodationCoeff_; *(2.0 - accommodationCoeff_)/accommodationCoeff_;

View File

@ -28,7 +28,7 @@ Description
#include "maxwellSlipUFvPatchVectorField.H" #include "maxwellSlipUFvPatchVectorField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
@ -147,7 +147,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
const fvPatchField<scalar>& ppsi = const fvPatchField<scalar>& ppsi =
patch().lookupPatchField<volScalarField, scalar>("psi"); 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_; *(2.0 - accommodationCoeff_)/accommodationCoeff_;
Field<scalar> pnu = pmu/prho; Field<scalar> pnu = pmu/prho;

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "SchnerrSauer.H" #include "SchnerrSauer.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -77,7 +77,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::rRb
{ {
return pow return pow
( (
((4*mathematicalConstant::pi*n_)/3) ((4*constant::math::pi*n_)/3)
*limitedAlpha1/(1.0 + alphaNuc() - limitedAlpha1), *limitedAlpha1/(1.0 + alphaNuc() - limitedAlpha1),
1.0/3.0 1.0/3.0
); );
@ -87,7 +87,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::rRb
Foam::dimensionedScalar Foam::dimensionedScalar
Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::alphaNuc() const 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); return Vnuc/(1 + Vnuc);
} }

View File

@ -29,11 +29,12 @@ License
#include "Time.H" #include "Time.H"
#include "subCycle.H" #include "subCycle.H"
#include "fvCFD.H" #include "fvCFD.H"
#include "mathConstants.H"
// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
const scalar Foam::multiphaseMixture::convertToRad = const scalar Foam::multiphaseMixture::convertToRad =
Foam::mathematicalConstant::pi/180.0; Foam::constant::math::pi/180.0;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "GidaspowConductivity.H" #include "GidaspowConductivity.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -69,7 +69,7 @@ Foam::tmp<Foam::volScalarField> Foam::GidaspowConductivity::kappa
const dimensionedScalar& e const dimensionedScalar& e
) const ) const
{ {
const scalar sqrtPi = sqrt(mathematicalConstant::pi); const scalar sqrtPi = sqrt(constant::math::pi);
return rhoa*da*sqrt(Theta)* return rhoa*da*sqrt(Theta)*
( (

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "HrenyaSinclairConductivity.H" #include "HrenyaSinclairConductivity.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -74,7 +74,7 @@ Foam::tmp<Foam::volScalarField> Foam::HrenyaSinclairConductivity::kappa
const dimensionedScalar& e const dimensionedScalar& e
) const ) 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_; scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_;

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "SyamlalConductivity.H" #include "SyamlalConductivity.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -69,7 +69,7 @@ Foam::tmp<Foam::volScalarField> Foam::SyamlalConductivity::kappa
const dimensionedScalar& e const dimensionedScalar& e
) const ) const
{ {
const scalar sqrtPi = sqrt(mathematicalConstant::pi); const scalar sqrtPi = sqrt(constant::math::pi);
return rhoa*da*sqrt(Theta)* return rhoa*da*sqrt(Theta)*
( (

View File

@ -26,7 +26,7 @@ License
#include "kineticTheoryModel.H" #include "kineticTheoryModel.H"
#include "surfaceInterpolate.H" #include "surfaceInterpolate.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "fvCFD.H" #include "fvCFD.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -204,7 +204,7 @@ void Foam::kineticTheoryModel::solve()
volScalarField alpha = alpha_; volScalarField alpha = alpha_;
alpha.max(1.0e-6); 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_); surfaceScalarField phi = 1.5*rhoa_*phia_*fvc::interpolate(alpha_);

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "GidaspowViscosity.H" #include "GidaspowViscosity.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -70,7 +70,7 @@ Foam::kineticTheoryModels::GidaspowViscosity::mua
const dimensionedScalar& e const dimensionedScalar& e
) const ) const
{ {
const scalar sqrtPi = sqrt(mathematicalConstant::pi); const scalar sqrtPi = sqrt(constant::math::pi);
return rhoa*da*sqrt(Theta)* return rhoa*da*sqrt(Theta)*
( (

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "HrenyaSinclairViscosity.H" #include "HrenyaSinclairViscosity.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -77,7 +77,7 @@ Foam::kineticTheoryModels::HrenyaSinclairViscosity::mua
const dimensionedScalar& e const dimensionedScalar& e
) const ) 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_; scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_;

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "SyamlalViscosity.H" #include "SyamlalViscosity.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -69,7 +69,7 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::SyamlalViscosity::mua
const dimensionedScalar& e const dimensionedScalar& e
) const ) const
{ {
const scalar sqrtPi = sqrt(mathematicalConstant::pi); const scalar sqrtPi = sqrt(constant::math::pi);
return rhoa*da*sqrt(Theta)* return rhoa*da*sqrt(Theta)*
( (

View File

@ -32,7 +32,7 @@ Description
#include "graph.H" #include "graph.H"
#include "OFstream.H" #include "OFstream.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
using namespace Foam; using namespace Foam;
@ -50,7 +50,7 @@ int main()
scalarField b = 0.5*(1.0 + erf(x)); scalarField b = 0.5*(1.0 + erf(x));
scalarField c = 1.0 - b; 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; scalarField lapb = -2*x*gradb;
r = lapb*b*c/(gradb*gradb); r = lapb*b*c/(gradb*gradb);

View File

@ -47,7 +47,7 @@ Description
#include "polyTopoChanger.H" #include "polyTopoChanger.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "mapPolyMesh.H" #include "mapPolyMesh.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "PackedBoolList.H" #include "PackedBoolList.H"
#include "SortableList.H" #include "SortableList.H"
@ -467,7 +467,7 @@ int main(int argc, char *argv[])
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])())); scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
bool overwrite = args.optionFound("overwrite"); 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 Info<< "Merging:" << nl
<< " edges with length less than " << minLen << " meters" << nl << " edges with length less than " << minLen << " meters" << nl

View File

@ -53,7 +53,7 @@ Description
#include "removePoints.H" #include "removePoints.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "mapPolyMesh.H" #include "mapPolyMesh.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
using namespace Foam; using namespace Foam;
@ -445,12 +445,12 @@ int main(int argc, char *argv[])
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); 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; scalar concaveAngle = defaultConcaveAngle;
args.optionReadIfPresent("concaveAngle", concaveAngle); 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 snapMeshDict = args.optionFound("snapMesh");
bool overwrite = args.optionFound("overwrite"); bool overwrite = args.optionFound("overwrite");

View File

@ -49,7 +49,7 @@ Description
#include "cellSet.H" #include "cellSet.H"
#include "cellModeller.H" #include "cellModeller.H"
#include "meshCutter.H" #include "meshCutter.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "geomCellLooper.H" #include "geomCellLooper.H"
#include "plane.H" #include "plane.H"
#include "edgeVertex.H" #include "edgeVertex.H"
@ -539,7 +539,7 @@ int main(int argc, char *argv[])
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); 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 minCos = Foam::cos(radAngle);
scalar minSin = Foam::sin(radAngle); scalar minSin = Foam::sin(radAngle);

View File

@ -43,7 +43,7 @@ Description
#include "symmetryPolyPatch.H" #include "symmetryPolyPatch.H"
#include "wedgePolyPatch.H" #include "wedgePolyPatch.H"
#include "cyclicPolyPatch.H" #include "cyclicPolyPatch.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
using namespace Foam; using namespace Foam;

View File

@ -434,7 +434,7 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size())
{ {
// Distribute the points to be +/- 2.5deg from the x-z plane // 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 iterf = pFaces[WEDGE][0].begin();
SLList<face>::iterator iterb = pFaces[WEDGE][1].begin(); SLList<face>::iterator iterb = pFaces[WEDGE][1].begin();

View File

@ -59,7 +59,7 @@ Usage
#include "Time.H" #include "Time.H"
#include "timeSelector.H" #include "timeSelector.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "polyTopoChange.H" #include "polyTopoChange.H"
#include "mapPolyMesh.H" #include "mapPolyMesh.H"
#include "PackedBoolList.H" #include "PackedBoolList.H"
@ -91,7 +91,7 @@ void simpleMarkFeatures
labelList& multiCellFeaturePoints 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(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
@ -387,7 +387,7 @@ int main(int argc, char *argv[])
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); 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 Info<< "Feature:" << featureAngle << endl
<< "minCos :" << minCos << endl << "minCos :" << minCos << endl

View File

@ -33,7 +33,7 @@ Description
#include "IOmanip.H" #include "IOmanip.H"
#include "boundBox.H" #include "boundBox.H"
#include "Map.H" #include "Map.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -99,7 +99,7 @@ void starMesh::createCoupleMatches()
<< coupleI << ". STAR couple ID: " << coupleI << ". STAR couple ID: "
<< couples_[coupleI].coupleID() << endl << couples_[coupleI].coupleID() << endl
<< "The angle between face normals is " << "The angle between face normals is "
<< Foam::acos(faceAreaAngle)/mathematicalConstant::pi*180 << Foam::acos(faceAreaAngle)/constant::math::pi*180
<< " deg." << endl << " deg." << endl
<< "master cell: " << fp.masterCell() << "master cell: " << fp.masterCell()
<< " STAR number: " << starCellID_[fp.masterCell()] << " STAR number: " << starCellID_[fp.masterCell()]

View File

@ -29,7 +29,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "arcEdge.H" #include "arcEdge.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -78,7 +78,7 @@ Foam::cylindricalCS Foam::arcEdge::calcAngle()
// find angles // find angles
scalar tmp = (r3&r1)/(mag(r3)*mag(r1)); 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 // check if the vectors define an exterior or an interior arcEdge
if (((r1 ^ r2)&(r1 ^ r3)) < 0.0) angle_ = 360 - angle_; 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 //- Return the length of the curve
Foam::scalar Foam::arcEdge::length() const Foam::scalar Foam::arcEdge::length() const
{ {
return angle_*radius_*mathematicalConstant::pi/180.0; return angle_*radius_*constant::math::pi/180.0;
} }

View File

@ -39,7 +39,6 @@ Description
#include "polyTopoChange.H" #include "polyTopoChange.H"
#include "polyTopoChanger.H" #include "polyTopoChanger.H"
#include "edgeCollapser.H" #include "edgeCollapser.H"
#include "mathematicalConstants.H"
#include "globalMeshData.H" #include "globalMeshData.H"
#include "perfectInterface.H" #include "perfectInterface.H"
#include "addPatchCellLayer.H" #include "addPatchCellLayer.H"

View File

@ -26,7 +26,7 @@ License
#include "wedge.H" #include "wedge.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,7 +52,7 @@ wedge::wedge(const dictionary& dict)
angle_ angle_
( (
readScalar(coeffDict_.lookup("angle")) readScalar(coeffDict_.lookup("angle"))
*mathematicalConstant::pi/180.0 *constant::math::pi/180.0
) )
{} {}

View File

@ -33,7 +33,7 @@ Description
#include "Time.H" #include "Time.H"
#include "boundaryMesh.H" #include "boundaryMesh.H"
#include "repatchPolyTopoChanger.H" #include "repatchPolyTopoChanger.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "OFstream.H" #include "OFstream.H"
#include "ListOps.H" #include "ListOps.H"
@ -93,7 +93,7 @@ int main(int argc, char *argv[])
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
bool overwrite = args.optionFound("overwrite"); 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 Info<< "Feature:" << featureAngle << endl
<< "minCos :" << minCos << endl << "minCos :" << minCos << endl

View File

@ -67,9 +67,10 @@ Usage
#include "transformField.H" #include "transformField.H"
#include "transformGeometricField.H" #include "transformGeometricField.H"
#include "IStringStream.H" #include "IStringStream.H"
#include "mathConstants.H"
using namespace Foam; using namespace Foam;
using namespace Foam::mathematicalConstant; using namespace Foam::constant::math;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,6 +1,8 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lpdf -lpdf \
-lsampling

View File

@ -2,7 +2,7 @@
( (
IOobject IOobject
( (
"pdfDictionary", "pdfDict",
runTime.constant(), runTime.constant(),
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -10,20 +10,9 @@
) )
); );
label nIntervals label nIntervals(readLabel(pdfDictionary.lookup("nIntervals")));
(
readLabel(pdfDictionary.lookup("nIntervals"))
);
label nSamples label nSamples(readLabel(pdfDictionary.lookup("nSamples")));
(
readLabel(pdfDictionary.lookup("nSamples"))
);
label samples[nIntervals]; scalarField samples(nIntervals, 0);
for(label i=0;i<nIntervals;i++)
{
samples[i] = 0;
}

View File

@ -0,0 +1,35 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object pdfDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Number of intervals/bins in pdf plot
nIntervals 20;
// Number of samples
nSamples 10000;
// Type of pdf
pdfType RosinRammler;
RosinRammlerPDF
{
minValue 1e-06;
maxValue 200e-06;
d (60.0e-06);
n (0.8);
}
// ************************************************************************* //

View File

@ -23,50 +23,60 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Generates an .obj file to plot a probability distribution function Generates a graph of a probability distribution function
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "pdf.H" #include "pdf.H"
#include "OFstream.H" #include "makeGraph.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program: // Main program:
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "setRootCase.H"
#include "createTime.H"
#include "createFields.H"
# include "setRootCase.H" fileName pdfPath = runTime.path()/"pdf";
# include "createTime.H" mkDir(pdfPath);
# include "createFields.H"
OFstream objFileNew("s.m");
Random rndGen(label(0)); Random rndGen(label(0));
autoPtr<pdf> p autoPtr<pdf> p(pdf::New(pdfDictionary, rndGen));
(
pdf::New(pdfDictionary, rndGen)
);
scalar xMin = p->minValue(); scalar xMin = p->minValue();
scalar xMax = p->maxValue(); scalar xMax = p->maxValue();
for(label i=0;i<nSamples;i++) label iCheck = 100;
for (label i=1; i<=nSamples; i++)
{ {
scalar ps = p->sample(); scalar ps = p->sample();
label n = label((ps-xMin)*nIntervals/(xMax-xMin)); label n = label((ps - xMin)*nIntervals/(xMax - xMin));
//Info << "p[" << i << "] = " << ps << ", n = " << n << endl;
samples[n]++; samples[n]++;
if (i % iCheck == 0)
{
Info<< " processed " << i << " samples" << endl;
if (i == 10*iCheck)
{
iCheck *= 10;
}
}
} }
for(label i=0;i<nIntervals;i++) scalarField x(nIntervals);
forAll(x, i)
{ {
scalar x = xMin + i*(xMax-xMin)/(nIntervals-1); x[i] = xMin + i*(xMax - xMin)/(nIntervals - 1);
objFileNew << x << " \t" << samples[i] << endl;
} }
makeGraph(x, samples, p->type(), pdfPath, runTime.graphFormat());
Info << "End\n" << endl; Info << "End\n" << endl;
return 0; return 0;

View File

@ -31,7 +31,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #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 b1 = j1(swirlProfile).value();
scalar b2 = 2.0*b1/swirlProfile.value() - j0(swirlProfile).value(); scalar b2 = 2.0*b1/swirlProfile.value() - j0(swirlProfile).value();

View File

@ -37,14 +37,22 @@ Description
using namespace Foam; using namespace Foam;
template<class GeoField> template<class Type>
void setFieldType bool setFieldType
( (
const word& fieldTypeDesc,
const fvMesh& mesh, const fvMesh& mesh,
const labelList& selectedCells, const labelList& selectedCells,
Istream& fieldValueStream Istream& fieldValueStream
) )
{ {
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
if (fieldTypeDesc != fieldType::typeName + "Value")
{
return false;
}
word fieldName(fieldValueStream); word fieldName(fieldValueStream);
IOobject fieldHeader IOobject fieldHeader
@ -61,15 +69,9 @@ void setFieldType
Info<< " Setting " << fieldHeader.headerClassName() Info<< " Setting " << fieldHeader.headerClassName()
<< " " << fieldName << endl; << " " << fieldName << endl;
GeoField field(fieldHeader, mesh); fieldType field(fieldHeader, mesh);
typename GeoField::value_type value const Type& value = pTraits<Type>(fieldValueStream);
(
static_cast<const typename GeoField::value_type&>
(
pTraits<typename GeoField::value_type>(fieldValueStream)
)
);
if (selectedCells.size() == field.size()) if (selectedCells.size() == field.size())
{ {
@ -100,6 +102,8 @@ void setFieldType
"Istream& fieldValueStream)" "Istream& fieldValueStream)"
) << "Field " << fieldName << " not found" << endl; ) << "Field " << fieldName << " not found" << endl;
} }
return true;
} }
@ -133,32 +137,21 @@ public:
{ {
word fieldType(fieldValues); word fieldType(fieldValues);
if (fieldType == "volScalarFieldValue") if
{ (
setFieldType<volScalarField> !(
(mesh_, selectedCells_, fieldValues); setFieldType<scalar>
} (fieldType, mesh_, selectedCells_, fieldValues)
else if (fieldType == "volVectorFieldValue") || setFieldType<vector>
{ (fieldType, mesh_, selectedCells_, fieldValues)
setFieldType<volVectorField> || setFieldType<sphericalTensor>
(mesh_, selectedCells_, fieldValues); (fieldType, mesh_, selectedCells_, fieldValues)
} || setFieldType<symmTensor>
else if (fieldType == "volSphericalTensorFieldValue") (fieldType, mesh_, selectedCells_, fieldValues)
{ || setFieldType<tensor>
setFieldType<volSphericalTensorField> (fieldType, mesh_, selectedCells_, fieldValues)
(mesh_, selectedCells_, fieldValues); )
} )
else if (fieldType == "volSymmTensorFieldValue")
{
setFieldType<volSymmTensorField>
(mesh_, selectedCells_, fieldValues);
}
else if (fieldType == "volTensorFieldValue")
{
setFieldType<volTensorField>
(mesh_, selectedCells_, fieldValues);
}
else
{ {
WarningIn("setField::iNew::operator()(Istream& is)") WarningIn("setField::iNew::operator()(Istream& is)")
<< "field type " << fieldType << " not currently supported" << "field type " << fieldType << " not currently supported"

View File

@ -43,9 +43,10 @@ Description
#include "transformField.H" #include "transformField.H"
#include "Pair.H" #include "Pair.H"
#include "quaternion.H" #include "quaternion.H"
#include "mathConstants.H"
using namespace Foam; using namespace Foam;
using namespace Foam::mathematicalConstant; using namespace Foam::constant::math;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -54,8 +54,8 @@ int main(int argc, char *argv[])
OFstream reactionsFile(FOAMChemistryFileName); OFstream reactionsFile(FOAMChemistryFileName);
reactionsFile reactionsFile
<< "species" << cr.species() << ';' << endl << endl << "species" << cr.species() << token::END_STATEMENT << nl << nl
<< "reactions" << cr.reactions() << ';' << endl; << "reactions" << cr.reactions() << token::END_STATEMENT << endl;
OFstream thermoFile(FOAMThermodynamicsFileName); OFstream thermoFile(FOAMThermodynamicsFileName);
thermoFile<< cr.speciesThermo() << endl; thermoFile<< cr.speciesThermo() << endl;

View File

@ -877,34 +877,68 @@ OptimisationSwitches
DimensionedConstants DimensionedConstants
{ {
// SI units unitSet SI; // USCS
//- Universal gas constant [J/(kmol K)] SICoeffs
R 8314.51; {
universal
//- Standard pressure [Pa] {
Pstd 1.0e5; c c [ 0 1 -1 0 0 0 0 ] 2.99792e+08;
G G [ -1 3 -2 0 0 0 0 ] 6.67429e-11;
//- Standard temperature [K] h h [ 1 2 -1 0 0 0 0 ] 6.62607e-34;
Tstd 298.15; }
electromagnetic
//- Stefan-Boltzmann constant [J/(K4 m2 s)] {
sigmaSB sigmaSB [1 0 -3 -4 0 0 0] 5.670e-08; e e [ 0 0 -1 0 0 1 0 ] 1.60218e-19;
}
/* USCS units atomic
{
//- Universal gas constant [lbm ft2/(s2 kmol R)] me me [ 1 0 0 0 0 0 0 ] 9.10938e-31;
R 3406.78; mp mp [ 1 0 0 0 0 0 0 ] 1.67262e-27;
}
//- Standard pressure [lbm/(ft2)] physicoChemical
Pstd 2088.6; {
mu mu [ 1 0 0 0 0 0 0 ] 1.66054e-27;
//- Standard temperature [degR] k k [ 1 2 -2 -1 0 0 0 ] 1.38065e-23;
Tstd 536.67; }
standard
//- Stefan-Boltzmann constant [lbm /(degR4 ft s)] {
sigmaSB sigmaSB [1 0 -3 -4 0 0 0] 8.2292e-08; //- Standard pressure [Pa]
*/ Pstd Pstd [ 1 -1 -2 0 0 0 0 ] 100000;
//- Standard temperature [degK]
Tstd Tstd [ 0 0 0 1 0 0 0 ] 298.15;
}
}
USCSCoeffs
{
universal
{
c c [ 0 1 -1 0 0 0 0 ] 9.83558e+08;
G G [ -1 3 -2 0 0 0 0 ] 1.06909e-09;
h h [ 1 2 -1 0 0 0 0 ] 1.57234e-32;
}
electromagnetic
{
e e [ 0 0 -1 0 0 1 0 ] 1.60218e-19;
}
atomic
{
me me [ 1 0 0 0 0 0 0 ] 2.00825e-30;
mp mp [ 1 0 0 0 0 0 0 ] 3.68746e-27;
}
physicoChemical
{
mu mu [ 1 0 0 0 0 0 0 ] 3.66083e-27;
k k [ 1 2 -2 -1 0 0 0 ] 1.82012e-22;
}
standard
{
//- Standard pressure [lbm/ft^2]
Pstd Pstd [ 1 -1 -2 0 0 0 0 ] 2088.6;
//- Standard temperature [degR]
Tstd Tstd [ 0 0 0 1 0 0 0 ] 536.67;
}
}
} }

View File

@ -1,5 +1,6 @@
global/global.Cver global/global.Cver
global/dimensionedConstants/dimensionedConstants.C global/dimensionedConstants/dimensionedConstants.C
global/dimensionedConstants/constants/constants.C
global/argList/argList.C global/argList/argList.C
global/clock/clock.C global/clock/clock.C

View File

@ -0,0 +1,132 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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 "mathConstants.H"
#include "universalConstants.H"
#include "electromagneticConstants.H"
#include "atomicConstants.H"
#include "dimensionedConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const char* Foam::constant::atomic::group = "atomic";
const Foam::dimensionedScalar Foam::constant::atomic::alpha
(
dimensionedConstant
(
group,
"alpha",
dimensionedScalar
(
"alpha",
sqr(constant::electromagnetic::e)
/(
dimensionedScalar("C", dimless, 2.0)
*constant::electromagnetic::epsilon0
*constant::universal::h
*constant::universal::c
)
)
)
);
const Foam::dimensionedScalar Foam::constant::atomic::Rinf
(
dimensionedConstant
(
group,
"Rinf",
dimensionedScalar
(
"Rinf",
sqr(alpha)*me*constant::universal::c
/(dimensionedScalar("C", dimless, 2.0)*constant::universal::h)
)
)
);
const Foam::dimensionedScalar Foam::constant::atomic::a0
(
dimensionedConstant
(
group,
"a0",
dimensionedScalar
(
"a0",
alpha
/(dimensionedScalar("C", dimless, 4.0*constant::math::pi)*Rinf)
)
)
);
const Foam::dimensionedScalar Foam::constant::atomic::re
(
dimensionedConstant
(
group,
"re",
dimensionedScalar
(
"re",
sqr(constant::electromagnetic::e)
/(
dimensionedScalar("C", dimless, 4.0*constant::math::pi)
*constant::electromagnetic::epsilon0
*me
*sqr(constant::universal::c)
)
)
)
);
const Foam::dimensionedScalar Foam::constant::atomic::Eh
(
dimensionedConstant
(
group,
"Eh",
dimensionedScalar
(
"Eh",
dimensionedScalar("C", dimless, 2.0)
*Rinf*constant::universal::h*constant::universal::c
)
)
);
// ************************************************************************* //

View File

@ -0,0 +1,81 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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::constant::atom
Description
Atomic constants
\*---------------------------------------------------------------------------*/
#ifndef atomicConstants_H
#define atomicConstants_H
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace constant
{
namespace atomic
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Group name for atomic constants
extern const char* group;
//- Fine-structure constant: default SI units: []
extern const dimensionedScalar alpha;
//- Rydberg constant: default SI units: [1/m]
extern const dimensionedScalar Rinf;
//- Bohr radius: default SI units: [m]
extern const dimensionedScalar a0;
//- Classical electron radius: default SI units: [m]
extern const dimensionedScalar re;
//- Hartree energy: default SI units: [J]
extern const dimensionedScalar Eh;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace atomic
} // end namespace constant
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,32 +22,21 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
InNamespace
Foam::radiation
Description Description
Constants used in radiation modelling Collection of dimensioned constants
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef radiationConstants_H
#define radiationConstants_H
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam // Constants supplied in the main controlDict
{ #include "fundamentalConstants.C"
namespace radiation
{
//- Stefan-Boltzmann constant [J/(K4 m2 s)]
extern const dimensionedScalar sigmaSB;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Derived constants
#include "universalConstants.C"
#include "electromagneticConstants.C"
#include "atomicConstants.C"
#include "physicoChemicalConstants.C"
#endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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::constant
Description
Collection of constants
\*---------------------------------------------------------------------------*/
#ifndef constants_H
#define constants_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Dimensionless coefficents
// Mathematical constants
#include "mathConstants.H"
// Dimensioned constants
// Fundamental constants
#include "fundamentalConstants.H"
// Derived constants
#include "universalConstants.H"
#include "electromagneticConstants.H"
#include "atomicConstants.H"
#include "physicoChemicalConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,164 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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 "mathConstants.H"
#include "universalConstants.H"
#include "electromagneticConstants.H"
#include "atomicConstants.H"
#include "dimensionedConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const char* Foam::constant::electromagnetic::group = "electromagnetic";
const Foam::dimensionedScalar Foam::constant::electromagnetic::mu0
(
dimensionedConstant
(
group,
"mu0",
dimensionedScalar
(
"mu0",
dimless,
4.0*constant::math::pi*1e-07
)
)
);
const Foam::dimensionedScalar Foam::constant::electromagnetic::epsilon0
(
dimensionedConstant
(
group,
"epsilon0",
dimensionedScalar
(
"epsilon0",
dimensionedScalar("C", dimless, 1.0)
/(mu0*sqr(constant::universal::c))
)
)
);
const Foam::dimensionedScalar Foam::constant::electromagnetic::Z0
(
dimensionedConstant
(
group,
"Z0",
dimensionedScalar
(
"Z0",
mu0*constant::universal::c
)
)
);
const Foam::dimensionedScalar Foam::constant::electromagnetic::kappa
(
dimensionedConstant
(
group,
"kappa",
dimensionedScalar
(
"kappa",
dimensionedScalar("C", dimless, 1.0/(4.0*constant::math::pi))
/epsilon0
)
)
);
const Foam::dimensionedScalar Foam::constant::electromagnetic::G0
(
dimensionedConstant
(
group,
"G0",
dimensionedScalar
(
"G0",
dimensionedScalar("C", dimless, 2)*sqr(e)/constant::universal::h
)
)
);
const Foam::dimensionedScalar Foam::constant::electromagnetic::KJ
(
dimensionedConstant
(
group,
"KJ",
dimensionedScalar
(
"KJ",
dimensionedScalar("C", dimless, 2)*e/constant::universal::h
)
)
);
const Foam::dimensionedScalar Foam::constant::electromagnetic::phi0
(
dimensionedConstant
(
group,
"phi0",
dimensionedScalar
(
"phi0",
constant::universal::h/(dimensionedScalar("C", dimless, 2)*e)
)
)
);
const Foam::dimensionedScalar Foam::constant::electromagnetic::RK
(
dimensionedConstant
(
group,
"RK",
dimensionedScalar
(
"RK",
constant::universal::h/sqr(e)
)
)
);
// ************************************************************************* //

View File

@ -0,0 +1,89 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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::constant::em
Description
Electromagnetic constants
\*---------------------------------------------------------------------------*/
#ifndef electromagneticConstants_H
#define electromagneticConstants_H
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace constant
{
namespace electromagnetic
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Group name for electromagnetic constants
extern const char* group;
//- Magnetic constant/permeability of free space: default SI units: [H/m]
extern const dimensionedScalar mu0;
//- Electric constant: default SI units: [F/m]
extern const dimensionedScalar epsilon0;
//- Characteristic impedance of a vacuum: default SI units: [ohm]
extern const dimensionedScalar Z0;
//- Coulomb constant: default SI units: [N.m2/C2]
extern const dimensionedScalar kappa;
//- Conductance quantum: default SI units: [S]
extern const dimensionedScalar G0;
//- Josephson constant: default SI units: [Hz/V]
extern const dimensionedScalar KJ;
//- Magnetic flux quantum: default SI units: [Wb]
extern const dimensionedScalar phi0;
//- von Klitzing constant: default SI units: [ohm]
extern const dimensionedScalar RK;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace electromagnetic
} // end namespace constant
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,128 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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
Description
Fundamental dimensioned constants
\*---------------------------------------------------------------------------*/
#include "fundamentalConstants.H"
#include "universalConstants.H"
#include "electromagneticConstants.H"
#include "atomicConstants.H"
#include "physicoChemicalConstants.H"
#include "dimensionedConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Universal constants
const Foam::dimensionedScalar Foam::constant::universal::c
(
dimensionedConstant(universal::group, "c")
);
const Foam::dimensionedScalar Foam::constant::universal::G
(
dimensionedConstant(universal::group, "G")
);
const Foam::dimensionedScalar Foam::constant::universal::h
(
dimensionedConstant(universal::group, "h")
);
// Electromagnetic
const Foam::dimensionedScalar Foam::constant::electromagnetic::e
(
dimensionedConstant(electromagnetic::group, "e")
);
// Atomic
const Foam::dimensionedScalar Foam::constant::atomic::me
(
dimensionedConstant(atomic::group, "me")
);
const Foam::dimensionedScalar Foam::constant::atomic::mp
(
dimensionedConstant(atomic::group, "mp")
);
// Physico-chemical
const Foam::dimensionedScalar Foam::constant::physicoChemical::mu
(
dimensionedConstant(physicoChemical::group, "mu")
);
const Foam::dimensionedScalar Foam::constant::physicoChemical::NA
(
// dimensionedConstant(physicoChemical::group, "NA")
dimensionedConstant
(
physicoChemical::group,
"NA",
dimensionedScalar
(
"NA",
dimless/dimMoles,
6.0221417930e+23
)
)
);
const Foam::dimensionedScalar Foam::constant::physicoChemical::k
(
dimensionedConstant(physicoChemical::group, "k")
);
// Standard
const Foam::dimensionedScalar Foam::constant::standard::Pstd
(
dimensionedConstant("standard", "Pstd")
);
const Foam::dimensionedScalar Foam::constant::standard::Tstd
(
dimensionedConstant("standard", "Tstd")
);
// ************************************************************************* //

View File

@ -0,0 +1,101 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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
Description
Fundamental dimensioned constants
\*---------------------------------------------------------------------------*/
#ifndef fundamentalConstants_H
#define fundamentalConstants_H
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace constant
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace universal
{
//- Speed of light in a vacuum
extern const dimensionedScalar c;
//- Newtonian constant of gravitation
extern const dimensionedScalar G;
//- Planck constant
extern const dimensionedScalar h;
}
namespace electromagnetic
{
//- Elementary charge
extern const dimensionedScalar e;
}
namespace atomic
{
//- Electron mass
extern const dimensionedScalar me;
//- Proton mass
extern const dimensionedScalar mp;
}
namespace physicoChemical
{
//- Atomic mass unit
extern const dimensionedScalar mu;
//- Avagadro number
extern const dimensionedScalar NA;
//- Boltzmann constant
extern const dimensionedScalar k;
}
namespace standard
{
//- Standard pressure
extern const dimensionedScalar Pstd;
//- Standard temperature
extern const dimensionedScalar Tstd;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace constant
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,15 +23,15 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Namespace Namespace
Foam::mathematicalConstant Foam::constant::math
Description Description
Mathematical constants such as pi, e. mathematical constants
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef mathematicalConstants_H #ifndef mathConstants_H
#define mathematicalConstants_H #define mathConstants_H
#include "scalar.H" #include "scalar.H"
@ -39,19 +39,24 @@ Description
namespace Foam namespace Foam
{ {
namespace constant
{
namespace math
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace mathematicalConstant static word group = "math";
{
const scalar e(M_E); const scalar e(M_E);
const scalar pi(M_PI); const scalar pi(M_PI);
const scalar twoPi(2*pi); const scalar twoPi(2*pi);
const scalar piByTwo(0.5*pi); const scalar piByTwo(0.5*pi);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace math
} // end namespace constant
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,3 +64,6 @@ namespace mathematicalConstant
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,132 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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 "mathConstants.H"
#include "universalConstants.H"
#include "electromagneticConstants.H"
#include "physicoChemicalConstants.H"
#include "dimensionedConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const char* Foam::constant::physicoChemical::group = "physicoChemical";
const Foam::dimensionedScalar Foam::constant::physicoChemical::R
(
dimensionedConstant
(
group,
"R",
dimensionedScalar
(
"R",
NA*k
)
)
);
const Foam::dimensionedScalar Foam::constant::physicoChemical::F
(
dimensionedConstant
(
group,
"F",
dimensionedScalar
(
"F",
NA*constant::electromagnetic::e
)
)
);
const Foam::dimensionedScalar Foam::constant::physicoChemical::sigma
(
dimensionedConstant
(
group,
"sigma",
dimensionedScalar
(
"sigma",
dimensionedScalar("C", dimless, sqr(constant::math::pi)/60.0)
*pow4(k)/(pow3(constant::universal::hr)*sqr(constant::universal::c))
)
)
);
const Foam::dimensionedScalar Foam::constant::physicoChemical::b
(
dimensionedConstant
(
group,
"b",
dimensionedScalar
(
"b",
(constant::universal::h*constant::universal::c/k)
/dimensionedScalar("C", dimless, 4.965114231)
)
)
);
const Foam::dimensionedScalar Foam::constant::physicoChemical::c1
(
dimensionedConstant
(
group,
"c1",
dimensionedScalar
(
"c1",
dimensionedScalar("C", dimless, constant::math::twoPi)
*constant::universal::h*sqr(constant::universal::c)
)
)
);
const Foam::dimensionedScalar Foam::constant::physicoChemical::c2
(
dimensionedConstant
(
group,
"c2",
dimensionedScalar
(
"c2",
constant::universal::h*constant::universal::c/k
)
)
);
// ************************************************************************* //

View File

@ -0,0 +1,85 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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::constant::phys
Description
Physico-chemical constants
\*---------------------------------------------------------------------------*/
#ifndef physicoChemicalConstants_H
#define physicoChemicalConstants_H
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace constant
{
namespace physicoChemical
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Group name for physico-chemical constants
extern const char* group;
//- Universal gas constant: default SI units: [J/mol/K]
extern const dimensionedScalar R;
//- Faraday constant: default SI units: [C/mol]
extern const dimensionedScalar F;
//- Stefan-Boltzmann constant: default SI units: [W/m2/K4]
extern const dimensionedScalar sigma;
//- Wien displacement law constant: default SI units: [m.K]
extern const dimensionedScalar b;
//- First radiation constant: default SI units: [W/m2]
extern const dimensionedScalar c1;
//- Second radiation constant: default SI units: [m.K]
extern const dimensionedScalar c2;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace physicoChemical
} // end namespace constant
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,25 +24,30 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "radiationConstants.H" #include "universalConstants.H"
#include "mathConstants.H"
#include "dimensionedConstants.H" #include "dimensionedConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Stefan-Boltzmann constant (default in [J/(K4 m2 s)]) const char* Foam::constant::universal::group = "universal";
const Foam::dimensionedScalar Foam::radiation::sigmaSB
const Foam::dimensionedScalar Foam::constant::universal::hr
( (
Foam::dimensionedConstant dimensionedConstant
( (
"sigmaSB", group,
"hr",
dimensionedScalar dimensionedScalar
( (
"sigmaSB", "hr",
dimensionSet(1, 0, -3, -4, 0, 0, 0), h/(dimensionedScalar("C", dimless, constant::math::twoPi))
5.670E-08
) )
) )
); );
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-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::constant::uni
Description
Universal constants
\*---------------------------------------------------------------------------*/
#ifndef universalConstants_H
#define universalConstants_H
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace constant
{
namespace universal
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Group name for universal constants
extern const char* group;
//- Reduced Planck constant: default SI units: [J/s]
extern const dimensionedScalar hr;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace universal
} // End namespace constant
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -44,6 +44,25 @@ dictionary& dimensionedConstants()
); );
} }
dimensionedScalar dimensionedConstant
(
const word& group,
const word& varName
)
{
dictionary& dict = dimensionedConstants();
const word unitSet(dict.lookup("unitSet"));
dictionary& unitDict(dict.subDict(unitSet + "Coeffs"));
dictionary& groupDict = unitDict.subDict(group);
return dimensionedScalar(groupDict.lookup(varName));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -40,6 +40,7 @@ SourceFiles
#define dimensionedConstants_H #define dimensionedConstants_H
#include "dictionary.H" #include "dictionary.H"
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,20 +51,42 @@ namespace Foam
dictionary& dimensionedConstants(); dictionary& dimensionedConstants();
dimensionedScalar dimensionedConstant(const word& group, const word& varName);
template<class T> template<class T>
T dimensionedConstant T dimensionedConstant
( (
const char* switchName, const word& group,
const T defaultValue const word& varName,
const T& defaultValue
) )
{ {
if (dimensionedConstants().found(switchName)) dictionary& dict = dimensionedConstants();
const word unitSet(dict.lookup("unitSet"));
dictionary& unitDict(dict.subDict(unitSet + "Coeffs"));
if (unitDict.found(group))
{ {
return pTraits<T>(dimensionedConstants().lookup(switchName)); dictionary& groupDict = unitDict.subDict(group);
if (groupDict.found(varName))
{
return pTraits<T>(groupDict.lookup(varName));
}
else
{
groupDict.add(varName, defaultValue);
return defaultValue;
}
} }
else else
{ {
dimensionedConstants().add(switchName, defaultValue); unitDict.add(group, dictionary::null);
unitDict.subDict(group).add(varName, defaultValue);
return defaultValue; return defaultValue;
} }
} }

View File

@ -27,7 +27,7 @@ License
#include "face.H" #include "face.H"
#include "triFace.H" #include "triFace.H"
#include "triPointRef.H" #include "triPointRef.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -99,13 +99,13 @@ Foam::label Foam::face::mostConcaveAngle
if ((edgeNormal & n) > 0) if ((edgeNormal & n) > 0)
{ {
// Concave angle. // Concave angle.
angle = mathematicalConstant::pi + edgeAngle; angle = constant::math::pi + edgeAngle;
} }
else else
{ {
// Convex angle. Note '-' to take into account that rightEdge // Convex angle. Note '-' to take into account that rightEdge
// and leftEdge are head-to-tail connected. // and leftEdge are head-to-tail connected.
angle = mathematicalConstant::pi - edgeAngle; angle = constant::math::pi - edgeAngle;
} }
if (angle > maxAngle) if (angle > maxAngle)
@ -214,7 +214,7 @@ Foam::label Foam::face::split
label index = fcIndex(fcIndex(startIndex)); label index = fcIndex(fcIndex(startIndex));
label minIndex = index; label minIndex = index;
scalar minDiff = Foam::mathematicalConstant::pi; scalar minDiff = constant::math::pi;
for(label i = 0; i < size() - 3; i++) for(label i = 0; i < size() - 3; i++)
{ {

View File

@ -27,7 +27,7 @@ License
#include "primitiveMesh.H" #include "primitiveMesh.H"
#include "pyramidPointFaceRef.H" #include "pyramidPointFaceRef.H"
#include "ListOps.H" #include "ListOps.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "SortableList.H" #include "SortableList.H"
@ -410,7 +410,7 @@ bool Foam::primitiveMesh::checkFaceOrthogonality
// Severe nonorthogonality threshold // Severe nonorthogonality threshold
const scalar severeNonorthogonalityThreshold = const scalar severeNonorthogonalityThreshold =
::cos(nonOrthThreshold_/180.0*mathematicalConstant::pi); ::cos(nonOrthThreshold_/180.0*constant::math::pi);
scalar minDDotS = GREAT; scalar minDDotS = GREAT;
@ -472,9 +472,9 @@ bool Foam::primitiveMesh::checkFaceOrthogonality
if (debug || report) if (debug || report)
{ {
Info<< " Mesh non-orthogonality Max: " Info<< " Mesh non-orthogonality Max: "
<< ::acos(minDDotS)/mathematicalConstant::pi*180.0 << ::acos(minDDotS)/constant::math::pi*180.0
<< " average: " << << " average: " <<
::acos(sumDDotS/neiSize)/mathematicalConstant::pi*180.0 ::acos(sumDDotS/neiSize)/constant::math::pi*180.0
<< endl; << endl;
} }
} }
@ -839,7 +839,7 @@ bool Foam::primitiveMesh::checkFaceAngles
<< exit(FatalError); << 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 pointField& p = points();
const faceList& fcs = faces(); const faceList& fcs = faces();
@ -916,7 +916,7 @@ bool Foam::primitiveMesh::checkFaceAngles
{ {
scalar maxConcaveDegr = scalar maxConcaveDegr =
Foam::asin(Foam::min(1.0, maxEdgeSin)) Foam::asin(Foam::min(1.0, maxEdgeSin))
*180.0/mathematicalConstant::pi; *180.0/constant::math::pi;
if (debug || report) if (debug || report)
{ {

View File

@ -31,7 +31,7 @@ Description
#include "primitiveMesh.H" #include "primitiveMesh.H"
#include "pyramidPointFaceRef.H" #include "pyramidPointFaceRef.H"
#include "cell.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 " ) << "Severe non-orthogonality in mesh motion for face "
<< faceI << faceI
<< " between cells " << own[faceI] << " and " << nei[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; << " deg." << endl;
nDotProductErrors++; nDotProductErrors++;

View File

@ -26,7 +26,7 @@ License
#include "IOstreams.H" #include "IOstreams.H"
#include "pointHit.H" #include "pointHit.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -307,9 +307,9 @@ inline scalar triangle<Point, PointRef>::quality() const
return return
mag() mag()
/ ( / (
mathematicalConstant::pi constant::math::pi
* Foam::sqr(circumRadius()) *Foam::sqr(circumRadius())
* 0.413497 *0.413497
+ VSMALL + VSMALL
); );
} }

View File

@ -25,7 +25,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "labelSymmTensor.H" #include "labelSymmTensor.H"
#include "mathematicalConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "tensor.H" #include "tensor.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -150,10 +150,8 @@ vector eigenValues(const tensor& t)
scalar aBy3 = a/3; scalar aBy3 = a/3;
i = m2SqrtQ*cos(theta/3) - aBy3; i = m2SqrtQ*cos(theta/3) - aBy3;
ii = m2SqrtQ*cos((theta + mathematicalConstant::twoPi)/3) ii = m2SqrtQ*cos((theta + constant::math::twoPi)/3) - aBy3;
- aBy3; iii = m2SqrtQ*cos((theta - constant::math::twoPi)/3) - aBy3;
iii = m2SqrtQ*cos((theta - mathematicalConstant::twoPi)/3)
- aBy3;
} }
else else
{ {
@ -345,10 +343,8 @@ vector eigenValues(const symmTensor& t)
scalar aBy3 = a/3; scalar aBy3 = a/3;
i = m2SqrtQ*cos(theta/3) - aBy3; i = m2SqrtQ*cos(theta/3) - aBy3;
ii = m2SqrtQ*cos((theta + mathematicalConstant::twoPi)/3) ii = m2SqrtQ*cos((theta + constant::math::twoPi)/3) - aBy3;
- aBy3; iii = m2SqrtQ*cos((theta - constant::math::twoPi)/3) - aBy3;
iii = m2SqrtQ*cos((theta - mathematicalConstant::twoPi)/3)
- aBy3;
} }
else else
{ {

View File

@ -25,7 +25,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "tensor2D.H" #include "tensor2D.H"
#include "mathematicalConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -34,7 +34,7 @@ Description
#define transform_H #define transform_H
#include "tensor.H" #include "tensor.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -205,11 +205,11 @@ inline scalar pseudoAngle
if (sin < -SMALL) if (sin < -SMALL)
{ {
return (3.0 + cos)*mathematicalConstant::piByTwo; return (3.0 + cos)*constant::math::piByTwo;
} }
else else
{ {
return (1.0 - cos)*mathematicalConstant::piByTwo; return (1.0 - cos)*constant::math::piByTwo;
} }
} }

View File

@ -34,7 +34,7 @@ Description
#include "removePoints.H" #include "removePoints.H"
#include "pointFields.H" #include "pointFields.H"
#include "motionSmoother.H" #include "motionSmoother.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "pointSet.H" #include "pointSet.H"
#include "faceSet.H" #include "faceSet.H"
#include "cellSet.H" #include "cellSet.H"
@ -2479,17 +2479,11 @@ void Foam::autoLayerDriver::mergePatchFacesUndo
const dictionary& motionDict const dictionary& motionDict
) )
{ {
scalar minCos = Foam::cos scalar minCos =
( Foam::cos(layerParams.featureAngle()*constant::math::pi/180.0);
layerParams.featureAngle()
* mathematicalConstant::pi/180.0
);
scalar concaveCos = Foam::cos scalar concaveCos =
( Foam::cos(layerParams.concaveAngle()*constant::math::pi/180.0);
layerParams.concaveAngle()
* mathematicalConstant::pi/180.0
);
Info<< nl Info<< nl
<< "Merging all faces of a cell" << nl << "Merging all faces of a cell" << nl
@ -2588,7 +2582,7 @@ void Foam::autoLayerDriver::addLayers
( (
pp, pp,
meshEdges, meshEdges,
layerParams.featureAngle()*mathematicalConstant::pi/180.0, layerParams.featureAngle()*constant::math::pi/180.0,
patchDisp, patchDisp,
patchNLayers, patchNLayers,

View File

@ -35,6 +35,7 @@ License
#include "refinementSurfaces.H" #include "refinementSurfaces.H"
#include "shellSurfaces.H" #include "shellSurfaces.H"
#include "mapDistributePolyMesh.H" #include "mapDistributePolyMesh.H"
#include "mathConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -678,8 +679,8 @@ void Foam::autoRefineDriver::mergePatchFaces
meshRefiner_.mergePatchFaces meshRefiner_.mergePatchFaces
( (
Foam::cos(45*mathematicalConstant::pi/180.0), Foam::cos(45*constant::math::pi/180.0),
Foam::cos(45*mathematicalConstant::pi/180.0), Foam::cos(45*constant::math::pi/180.0),
meshRefiner_.meshedPatches() meshRefiner_.meshedPatches()
); );
@ -688,7 +689,7 @@ void Foam::autoRefineDriver::mergePatchFaces
meshRefiner_.checkData(); meshRefiner_.checkData();
} }
meshRefiner_.mergeEdges(Foam::cos(45*mathematicalConstant::pi/180.0)); meshRefiner_.mergeEdges(Foam::cos(45*constant::math::pi/180.0));
if (debug) if (debug)
{ {

View File

@ -26,7 +26,7 @@ License
#include "layerParameters.H" #include "layerParameters.H"
#include "polyBoundaryMesh.H" #include "polyBoundaryMesh.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "refinementSurfaces.H" #include "refinementSurfaces.H"
#include "searchableSurfaces.H" #include "searchableSurfaces.H"
#include "regExp.H" #include "regExp.H"
@ -192,12 +192,7 @@ Foam::layerParameters::layerParameters
), ),
layerTerminationCos_ layerTerminationCos_
( (
Foam::cos Foam::cos(0.5*featureAngle_*constant::math::pi/180.0)
(
0.5
* featureAngle_
* mathematicalConstant::pi/180.
)
), ),
maxThicknessToMedialRatio_ maxThicknessToMedialRatio_
( (
@ -206,7 +201,7 @@ Foam::layerParameters::layerParameters
minMedianAxisAngleCos_ minMedianAxisAngleCos_
( (
Foam::cos(readScalar(dict.lookup("minMedianAxisAngle"))) Foam::cos(readScalar(dict.lookup("minMedianAxisAngle")))
* mathematicalConstant::pi/180. *constant::math::pi/180.0
), ),
nBufferCellsNoExtrude_ nBufferCellsNoExtrude_
( (
@ -274,12 +269,7 @@ Foam::layerParameters::layerParameters
), ),
layerTerminationCos_ layerTerminationCos_
( (
Foam::cos Foam::cos(0.5*featureAngle_*constant::math::pi/180.0)
(
0.5
* featureAngle_
* mathematicalConstant::pi/180.
)
), ),
maxThicknessToMedialRatio_ maxThicknessToMedialRatio_
( (
@ -288,7 +278,7 @@ Foam::layerParameters::layerParameters
minMedianAxisAngleCos_ minMedianAxisAngleCos_
( (
Foam::cos(readScalar(dict.lookup("minMedianAxisAngle"))) Foam::cos(readScalar(dict.lookup("minMedianAxisAngle")))
* mathematicalConstant::pi/180. *constant::math::pi/180.0
), ),
nBufferCellsNoExtrude_ nBufferCellsNoExtrude_
( (

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "refinementParameters.H" #include "refinementParameters.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "globalIndex.H" #include "globalIndex.H"
@ -63,7 +63,7 @@ Foam::refinementParameters::refinementParameters(const dictionary& dict)
} }
else else
{ {
curvature_ = Foam::cos(featAngle*mathematicalConstant::pi/180.0); curvature_ = Foam::cos(featAngle*constant::math::pi/180.0);
} }
} }

View File

@ -37,6 +37,7 @@ License
#include "searchableSurfaces.H" #include "searchableSurfaces.H"
#include "polyMeshGeometry.H" #include "polyMeshGeometry.H"
#include "IOmanip.H" #include "IOmanip.H"
#include "mathConstants.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -246,10 +247,7 @@ Foam::Map<Foam::label> Foam::meshRefinement::findEdgeConnectedProblemCells
nearestRegion[i] nearestRegion[i]
); );
scalar angle = scalar angle = perpendicularAngle[region]/180.0*constant::math::pi;
perpendicularAngle[region]
/ 180.0
* mathematicalConstant::pi;
if (angle >= 0) if (angle >= 0)
{ {

View File

@ -27,7 +27,7 @@ License
#include "dynamicInkJetFvMesh.H" #include "dynamicInkJetFvMesh.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "volFields.H" #include "volFields.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -90,7 +90,7 @@ Foam::dynamicInkJetFvMesh::~dynamicInkJetFvMesh()
bool Foam::dynamicInkJetFvMesh::update() bool Foam::dynamicInkJetFvMesh::update()
{ {
scalar scalingFunction = 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: " Info<< "Mesh scaling. Time = " << time().value() << " scaling: "
<< scalingFunction << endl; << scalingFunction << endl;

View File

@ -26,9 +26,9 @@ License
#include "SDA.H" #include "SDA.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
using namespace Foam::mathematicalConstant; using namespace Foam::constant::math;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -70,18 +70,18 @@ Foam::septernion Foam::solidBodyMotionFunctions::SDA::transformation() const
scalar time = time_.value(); scalar time = time_.value();
scalar Tpi = Tp_ + dTp_*(time/dTi_); // Current roll period [sec] 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] // Current Phase for roll [rad]
scalar r = dTp_/dTi_; scalar r = dTp_/dTi_;
scalar u = Tp_ + r*time; 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] // Current Phase for Sway [rad]
scalar phs = phr + pi; scalar phs = phr + pi;
// Current Phase for Heave [rad] // 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_); scalar rollA = max(rollAmax_*exp(-sqr(Tpi - Tpn_)/(2*Q_)), rollAmin_);

View File

@ -29,9 +29,9 @@ License
#include "Tuple2.H" #include "Tuple2.H"
#include "IFstream.H" #include "IFstream.H"
#include "interpolateXY.H" #include "interpolateXY.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
using namespace Foam::mathematicalConstant; using namespace Foam::constant::math;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -27,11 +27,8 @@ License
#include "solidBodyMotionFvMesh.H" #include "solidBodyMotionFvMesh.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "volFields.H" #include "volFields.H"
#include "mathematicalConstants.H"
#include "transformField.H" #include "transformField.H"
using namespace Foam::mathematicalConstant;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam

View File

@ -28,7 +28,6 @@ License
#include "cellFeatures.H" #include "cellFeatures.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "cellModeller.H" #include "cellModeller.H"
#include "mathematicalConstants.H"
#include "plane.H" #include "plane.H"
#include "ListOps.H" #include "ListOps.H"
#include "meshTools.H" #include "meshTools.H"
@ -36,18 +35,12 @@ License
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(hexCellLooper, 0); defineTypeNameAndDebug(hexCellLooper, 0);
addToRunTimeSelectionTable(cellLooper, hexCellLooper, word); addToRunTimeSelectionTable(cellLooper, hexCellLooper, word);
} }

View File

@ -27,7 +27,7 @@ License
#include "topoCellLooper.H" #include "topoCellLooper.H"
#include "cellFeatures.H" #include "cellFeatures.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "DynamicList.H" #include "DynamicList.H"
#include "ListOps.H" #include "ListOps.H"
#include "meshTools.H" #include "meshTools.H"
@ -35,9 +35,8 @@ License
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(topoCellLooper, 0); defineTypeNameAndDebug(topoCellLooper, 0);
@ -46,7 +45,7 @@ namespace Foam
// Angle for polys to be considered splitHexes. // Angle for polys to be considered splitHexes.
const Foam::scalar Foam::topoCellLooper::featureCos = 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 * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -32,16 +32,14 @@ License
#include "cellCuts.H" #include "cellCuts.H"
#include "splitCell.H" #include "splitCell.H"
#include "mapPolyMesh.H" #include "mapPolyMesh.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
#include "meshTools.H" #include "meshTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(undoableMeshCutter, 0); defineTypeNameAndDebug(undoableMeshCutter, 0);
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -194,7 +192,7 @@ Foam::undoableMeshCutter::undoableMeshCutter
faceRemover_ faceRemover_
( (
mesh, mesh,
Foam::cos(30./180. * mathematicalConstant::pi) Foam::cos(30.0/180.0*constant::math::pi)
) )
{} {}

View File

@ -27,6 +27,7 @@ License
#include "polyMeshGeometry.H" #include "polyMeshGeometry.H"
#include "pyramidPointFaceRef.H" #include "pyramidPointFaceRef.H"
#include "syncTools.H" #include "syncTools.H"
#include "mathConstants.H"
namespace Foam namespace Foam
{ {
@ -247,7 +248,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
<< " between cells " << mesh.faceOwner()[faceI] << " between cells " << mesh.faceOwner()[faceI]
<< " and " << nei << " and " << nei
<< ": Angle = " << ": Angle = "
<< ::acos(dDotS)/mathematicalConstant::pi*180.0 << ::acos(dDotS)/constant::math::pi*180.0
<< " deg." << endl; << " deg." << endl;
} }
@ -268,7 +269,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
<< " between cells " << mesh.faceOwner()[faceI] << " between cells " << mesh.faceOwner()[faceI]
<< " and " << nei << " and " << nei
<< ": Angle = " << ": Angle = "
<< ::acos(dDotS)/mathematicalConstant::pi*180.0 << ::acos(dDotS)/constant::math::pi*180.0
<< " deg." << endl; << " deg." << endl;
} }
@ -368,7 +369,7 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct
// Severe nonorthogonality threshold // Severe nonorthogonality threshold
const scalar severeNonorthogonalityThreshold = const scalar severeNonorthogonalityThreshold =
::cos(orthWarn/180.0*mathematicalConstant::pi); ::cos(orthWarn/180.0*constant::math::pi);
// Calculate coupled cell centre // Calculate coupled cell centre
@ -503,9 +504,9 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct
if (nDDotS > 0) if (nDDotS > 0)
{ {
Info<< "Mesh non-orthogonality Max: " Info<< "Mesh non-orthogonality Max: "
<< ::acos(minDDotS)/mathematicalConstant::pi*180.0 << ::acos(minDDotS)/constant::math::pi*180.0
<< " average: " << << " average: " <<
::acos(sumDDotS/nDDotS)/mathematicalConstant::pi*180.0 ::acos(sumDDotS/nDDotS)/constant::math::pi*180.0
<< endl; << endl;
} }
} }
@ -1257,7 +1258,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles
<< abort(FatalError); << 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(); const faceList& fcs = mesh.faces();
@ -1338,7 +1339,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles
{ {
scalar maxConcaveDegr = scalar maxConcaveDegr =
Foam::asin(Foam::min(1.0, maxEdgeSin)) Foam::asin(Foam::min(1.0, maxEdgeSin))
* 180.0/mathematicalConstant::pi; *180.0/constant::math::pi;
Info<< "There are " << nConcave Info<< "There are " << nConcave
<< " faces with concave angles between consecutive" << " faces with concave angles between consecutive"

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "engineTime.H" #include "engineTime.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -125,7 +125,7 @@ bool Foam::engineTime::read()
Foam::scalar Foam::engineTime::degToRad(const scalar deg) const 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
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* // // ************************************************************************* //

View File

@ -27,11 +27,11 @@
) )
); );
Ak = sphereFraction*4.0*mathematicalConstant::pi Ak = sphereFraction*4.0*constant::math::pi
*pow *pow
( (
3.0*Vk 3.0*Vk
/(sphereFraction*4.0*mathematicalConstant::pi), /(sphereFraction*4.0*constant::math::pi),
2.0/3.0 2.0/3.0
); );
} }
@ -56,11 +56,11 @@
) )
); );
Ak = circleFraction*mathematicalConstant::pi*thickness Ak = circleFraction*constant::math::pi*thickness
*sqrt *sqrt
( (
4.0*Vk 4.0*Vk
/(circleFraction*thickness*mathematicalConstant::pi) /(circleFraction*thickness*constant::math::pi)
); );
} }
break; break;

View File

@ -22,13 +22,11 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "rpm.H" #include "rpm.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -58,7 +56,7 @@ Foam::SRF::rpm::rpm
rpm_(readScalar(SRFModelCoeffs_.lookup("rpm"))) rpm_(readScalar(SRFModelCoeffs_.lookup("rpm")))
{ {
// Initialise the angular velocity // 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_; SRFModelCoeffs_.lookup("rpm") >> rpm_;
// Update angular velocity // Update angular velocity
omega_.value() = axis_*rpm_*(2.0*mathematicalConstant::pi/60.0); omega_.value() = axis_*rpm_*(constant::math::twoPi/60.0);
return true; return true;
} }

View File

@ -14,7 +14,7 @@
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"
#include "adjustPhi.H" #include "adjustPhi.H"
#include "findRefCell.H" #include "findRefCell.H"
#include "mathematicalConstants.H" #include "constants.H"
#include "OSspecific.H" #include "OSspecific.H"
#include "argList.H" #include "argList.H"

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "oscillatingFixedValueFvPatchField.H" #include "oscillatingFixedValueFvPatchField.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,8 +39,8 @@ scalar oscillatingFixedValueFvPatchField<Type>::currentScale() const
{ {
return return
1.0 1.0
+ amplitude_* + amplitude_
sin(2*mathematicalConstant::pi*frequency_*this->db().time().value()); *sin(constant::math::twoPi*frequency_*this->db().time().value());
} }

View File

@ -32,7 +32,7 @@ Description
#include "surfaceFields.H" #include "surfaceFields.H"
#include "demandDrivenData.H" #include "demandDrivenData.H"
#include "coupledFvPatch.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(), (sum(magSf*mag(corrVecs))/sum(magSf)).value(),
1.0 1.0
) )
)*180.0/mathematicalConstant::pi; )*180.0/constant::math::pi;
} }
if (debug) if (debug)

View File

@ -25,6 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "COxidationDiffusionLimitedRate.H" #include "COxidationDiffusionLimitedRate.H"
#include "mathConstants.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -123,8 +124,7 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI]; const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
// Change in C mass [kg] // Change in C mass [kg]
scalar dmC = scalar dmC = 4.0*constant::math::pi*d*D_*YO2*Tc*rhoc/(Sb_*(T + Tc))*dt;
4.0*mathematicalConstant::pi*d*D_*YO2*Tc*rhoc/(Sb_*(T + Tc))*dt;
// Limit mass transfer by availability of C // Limit mass transfer by availability of C
dmC = min(mass*fComb, dmC); dmC = min(mass*fComb, dmC);

View File

@ -25,6 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "COxidationKineticDiffusionLimitedRate.H" #include "COxidationKineticDiffusionLimitedRate.H"
#include "mathConstants.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -137,7 +138,7 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
const scalar Rk = C2_*exp(-E_/(specie::RR*Tc)); const scalar Rk = C2_*exp(-E_/(specie::RR*Tc));
// Particle surface area // Particle surface area
const scalar Ap = mathematicalConstant::pi*sqr(d); const scalar Ap = constant::math::pi*sqr(d);
// Change in C mass [kg] // Change in C mass [kg]
scalar dmC = Ap*rhoc*specie::RR*Tc*YO2/WO2_*D0*Rk/(D0 + Rk); scalar dmC = Ap*rhoc*specie::RR*Tc*YO2/WO2_*D0*Rk/(D0 + Rk);

View File

@ -25,6 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "COxidationMurphyShaddix.H" #include "COxidationMurphyShaddix.H"
#include "mathConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -133,7 +134,7 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
} }
// Particle surface area [m^2] // 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 // Calculate diffision constant at continuous phase temperature
// and density [m^2/s] // and density [m^2/s]

View File

@ -27,22 +27,20 @@ License
#include "commonRailInjector.H" #include "commonRailInjector.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "Random.H" #include "Random.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(commonRailInjector, 0);
defineTypeNameAndDebug(commonRailInjector, 0); addToRunTimeSelectionTable
(
addToRunTimeSelectionTable injectorType,
( commonRailInjector,
injectorType, dictionary
commonRailInjector, );
dictionary
);
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -71,38 +69,58 @@ Foam::commonRailInjector::commonRailInjector
averageParcelMass_(mass_/nParcels_), averageParcelMass_(mass_/nParcels_),
pressureIndependentVelocity_(false) pressureIndependentVelocity_(false)
{ {
// convert CA to real time // convert CA to real time
forAll(massFlowRateProfile_, i) forAll(massFlowRateProfile_, i)
{ {
massFlowRateProfile_[i][0] = t.userTimeToTime(massFlowRateProfile_[i][0]); massFlowRateProfile_[i][0] =
t.userTimeToTime(massFlowRateProfile_[i][0]);
velocityProfile_[i][0] = t.userTimeToTime(massFlowRateProfile_[i][0]); velocityProfile_[i][0] = t.userTimeToTime(massFlowRateProfile_[i][0]);
} }
forAll(injectionPressureProfile_, i) forAll(injectionPressureProfile_, i)
{ {
injectionPressureProfile_[i][0] = t.userTimeToTime(injectionPressureProfile_[i][0]); injectionPressureProfile_[i][0] =
t.userTimeToTime(injectionPressureProfile_[i][0]);
} }
if (mag(injectionPressureProfile_[0][0]-massFlowRateProfile_[0][0]) > SMALL) if
(
mag(injectionPressureProfile_[0][0] - massFlowRateProfile_[0][0])
> SMALL
)
{ {
FatalError << "commonRailInjector::commonRailInjector(const time& t, const dictionary dict) " << endl FatalErrorIn
<< " start-time entries for injectionPressureProfile and massFlowRateProfile do no match" (
<< abort(FatalError); "commonRailInjector::commonRailInjector"
"(const time& t, const dictionary dict)"
) << " start-time entries for injectionPressureProfile and "
<< "massFlowRateProfile do no match"
<< abort(FatalError);
} }
Info << "injectionPressureProfile_.size() = " << injectionPressureProfile_.size() Info<< "injectionPressureProfile_.size() = "
<< injectionPressureProfile_.size()
<< ", massFlowRateProfile_.size() = " << massFlowRateProfile_.size() << ", massFlowRateProfile_.size() = " << massFlowRateProfile_.size()
<< endl; << endl;
if (mag(injectionPressureProfile_[injectionPressureProfile_.size()-1][0]-massFlowRateProfile_[massFlowRateProfile_.size()-1][0]) > SMALL) if
(
mag(injectionPressureProfile_[injectionPressureProfile_.size()-1][0]
- massFlowRateProfile_[massFlowRateProfile_.size()-1][0])
> SMALL
)
{ {
FatalError << "commonRailInjector::commonRailInjector(const time& t, const dictionary dict) " << endl FatalErrorIn
<< " end-time entries for injectionPressureProfile and massFlowRateProfile do no match" (
<< abort(FatalError); "commonRailInjector::commonRailInjector"
"(const time& t, const dictionary dict)"
) << "End-time entries for injectionPressureProfile and "
<< "massFlowRateProfile do no match"
<< abort(FatalError);
} }
scalar integratedMFR = integrateTable(massFlowRateProfile_); scalar integratedMFR = integrateTable(massFlowRateProfile_);
scalar integratedP = integrateTable(injectionPressureProfile_)/(teoi()-tsoi()); scalar integratedP =
integrateTable(injectionPressureProfile_)/(teoi() - tsoi());
forAll(massFlowRateProfile_, i) forAll(massFlowRateProfile_, i)
{ {
@ -113,7 +131,6 @@ Foam::commonRailInjector::commonRailInjector
TProfile_[i][1] = T_; TProfile_[i][1] = T_;
CdProfile_[i][0] = massFlowRateProfile_[i][0]; CdProfile_[i][0] = massFlowRateProfile_[i][0];
} }
forAll(injectionPressureProfile_, i) forAll(injectionPressureProfile_, i)
@ -134,18 +151,22 @@ Foam::commonRailInjector::commonRailInjector
if (mag(Xsum - 1.0) > SMALL) if (mag(Xsum - 1.0) > SMALL)
{ {
Info << "Warning!!!\n commonRailInjector::commonRailInjector(const time& t, Istream& is)" WarningIn
<< "X does not add up to 1.0, correcting molar fractions." (
"commonRailInjector::commonRailInjector"
"(const time& t, const dictionary dict)"
) << "X does not add up to 1.0, correcting molar fractions."
<< endl; << endl;
forAll(X_, i) forAll(X_, i)
{ {
X_[i] /= Xsum; X_[i] /= Xsum;
} }
} }
Info << "end constructor. in commonRail" << endl;
Info << "end constructor. in commonRail" << endl;
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::commonRailInjector::~commonRailInjector() Foam::commonRailInjector::~commonRailInjector()
@ -181,17 +202,20 @@ Foam::label Foam::commonRailInjector::nParcelsToInject
) const ) const
{ {
scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); scalar mInj =
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
label nParcels = label(mInj/averageParcelMass_ + 0.49); label nParcels = label(mInj/averageParcelMass_ + 0.49);
return nParcels; return nParcels;
} }
const Foam::vector Foam::commonRailInjector::position(const label n) const const Foam::vector Foam::commonRailInjector::position(const label n) const
{ {
return position_; return position_;
} }
Foam::vector Foam::commonRailInjector::position Foam::vector Foam::commonRailInjector::position
( (
const label n, const label n,
@ -220,33 +244,35 @@ Foam::vector Foam::commonRailInjector::position
{ {
// otherwise, disc injection // otherwise, disc injection
scalar iRadius = d_*rndGen.scalar01(); scalar iRadius = d_*rndGen.scalar01();
scalar iAngle = 2.0*mathematicalConstant::pi*rndGen.scalar01(); scalar iAngle = constant::math::twoPi*rndGen.scalar01();
return return
( (
position_ position_
+ iRadius + iRadius
* ( *(
tangentialInjectionVector1_*cos(iAngle) tangentialInjectionVector1_*cos(iAngle)
+ tangentialInjectionVector2_*sin(iAngle) + tangentialInjectionVector2_*sin(iAngle)
) )
); );
} }
return position_; return position_;
} }
Foam::label Foam::commonRailInjector::nHoles() const Foam::label Foam::commonRailInjector::nHoles() const
{ {
return 1; return 1;
} }
Foam::scalar Foam::commonRailInjector::d() const Foam::scalar Foam::commonRailInjector::d() const
{ {
return d_; return d_;
} }
const Foam::vector& Foam::commonRailInjector::direction const Foam::vector& Foam::commonRailInjector::direction
( (
const label i, const label i,
@ -256,6 +282,7 @@ const Foam::vector& Foam::commonRailInjector::direction
return direction_; return direction_;
} }
Foam::scalar Foam::commonRailInjector::mass Foam::scalar Foam::commonRailInjector::mass
( (
const scalar time0, const scalar time0,
@ -264,47 +291,55 @@ Foam::scalar Foam::commonRailInjector::mass
const scalar angleOfWedge const scalar angleOfWedge
) const ) const
{ {
scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); scalar mInj =
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
// correct mass if calculation is 2D // correct mass if calculation is 2D
if (twoD) if (twoD)
{ {
mInj *= 0.5*angleOfWedge/mathematicalConstant::pi; mInj *= 0.5*angleOfWedge/constant::math::pi;
} }
return mInj; return mInj;
} }
Foam::scalar Foam::commonRailInjector::mass() const Foam::scalar Foam::commonRailInjector::mass() const
{ {
return mass_; return mass_;
} }
const Foam::scalarField& Foam::commonRailInjector::X() const const Foam::scalarField& Foam::commonRailInjector::X() const
{ {
return X_; return X_;
} }
Foam::List<Foam::commonRailInjector::pair> Foam::commonRailInjector::T() const Foam::List<Foam::commonRailInjector::pair> Foam::commonRailInjector::T() const
{ {
return TProfile_; return TProfile_;
} }
Foam::scalar Foam::commonRailInjector::T(const scalar time) const Foam::scalar Foam::commonRailInjector::T(const scalar time) const
{ {
return T_; return T_;
} }
Foam::scalar Foam::commonRailInjector::tsoi() const Foam::scalar Foam::commonRailInjector::tsoi() const
{ {
return massFlowRateProfile_[0][0]; return massFlowRateProfile_[0][0];
} }
Foam::scalar Foam::commonRailInjector::teoi() const Foam::scalar Foam::commonRailInjector::teoi() const
{ {
return massFlowRateProfile_[massFlowRateProfile_.size()-1][0]; return massFlowRateProfile_[massFlowRateProfile_.size()-1][0];
} }
Foam::scalar Foam::commonRailInjector::massFlowRate Foam::scalar Foam::commonRailInjector::massFlowRate
( (
const scalar time const scalar time
@ -313,6 +348,7 @@ Foam::scalar Foam::commonRailInjector::massFlowRate
return getTableValue(massFlowRateProfile_, time); return getTableValue(massFlowRateProfile_, time);
} }
Foam::scalar Foam::commonRailInjector::injectionPressure Foam::scalar Foam::commonRailInjector::injectionPressure
( (
const scalar time const scalar time
@ -321,6 +357,7 @@ Foam::scalar Foam::commonRailInjector::injectionPressure
return getTableValue(injectionPressureProfile_, time); return getTableValue(injectionPressureProfile_, time);
} }
Foam::scalar Foam::commonRailInjector::velocity Foam::scalar Foam::commonRailInjector::velocity
( (
const scalar time const scalar time
@ -329,11 +366,14 @@ Foam::scalar Foam::commonRailInjector::velocity
return getTableValue(velocityProfile_, time); return getTableValue(velocityProfile_, time);
} }
Foam::List<Foam::commonRailInjector::pair> Foam::commonRailInjector::CdProfile() const
Foam::List<Foam::commonRailInjector::pair> Foam::commonRailInjector::CdProfile()
const
{ {
return CdProfile_; return CdProfile_;
} }
Foam::scalar Foam::commonRailInjector::Cd Foam::scalar Foam::commonRailInjector::Cd
( (
const scalar time const scalar time
@ -342,11 +382,13 @@ Foam::scalar Foam::commonRailInjector::Cd
return getTableValue(CdProfile_, time); return getTableValue(CdProfile_, time);
} }
Foam::scalar Foam::commonRailInjector::fractionOfInjection(const scalar time) const Foam::scalar Foam::commonRailInjector::fractionOfInjection(const scalar time) const
{ {
return integrateTable(massFlowRateProfile_, time)/mass_; return integrateTable(massFlowRateProfile_, time)/mass_;
} }
Foam::scalar Foam::commonRailInjector::injectedMass Foam::scalar Foam::commonRailInjector::injectedMass
( (
const scalar t const scalar t
@ -362,13 +404,14 @@ void Foam::commonRailInjector::correctProfiles
const scalar referencePressure 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 pDummy = 1.0e+5;
scalar rho = fuel.rho(pDummy, T_, X_); scalar rho = fuel.rho(pDummy, T_, X_);
forAll(velocityProfile_, i) forAll(velocityProfile_, i)
{ {
scalar Pinj = getTableValue(injectionPressureProfile_, velocityProfile_[i][0]); scalar Pinj =
getTableValue(injectionPressureProfile_, velocityProfile_[i][0]);
scalar Vinj = sqrt(2.0*(Pinj - referencePressure)/rho); scalar Vinj = sqrt(2.0*(Pinj - referencePressure)/rho);
scalar mfr = massFlowRateProfile_[i][1]/(rho*A); scalar mfr = massFlowRateProfile_[i][1]/(rho*A);
scalar Cd = mfr/Vinj; scalar Cd = mfr/Vinj;
@ -377,14 +420,17 @@ void Foam::commonRailInjector::correctProfiles
} }
} }
Foam::vector Foam::commonRailInjector::tan1(const label n) const Foam::vector Foam::commonRailInjector::tan1(const label n) const
{ {
return tangentialInjectionVector1_; return tangentialInjectionVector1_;
} }
Foam::vector Foam::commonRailInjector::tan2(const label n) const Foam::vector Foam::commonRailInjector::tan2(const label n) const
{ {
return tangentialInjectionVector2_; return tangentialInjectionVector2_;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -47,7 +47,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class commonRailInjector Declaration Class commonRailInjector Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class commonRailInjector class commonRailInjector
@ -110,16 +110,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from components
commonRailInjector commonRailInjector(const Time& t, const dictionary& dict);
(
const Time& t,
const dictionary& dict
);
// Destructor //- Destructor
virtual ~commonRailInjector();
~commonRailInjector();
// Member Functions // Member Functions
@ -227,7 +222,6 @@ public:
{ {
return pressureIndependentVelocity_; return pressureIndependentVelocity_;
} }
}; };

View File

@ -27,21 +27,19 @@ License
#include "definedInjector.H" #include "definedInjector.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "Random.H" #include "Random.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(definedInjector, 0);
defineTypeNameAndDebug(definedInjector, 0); addToRunTimeSelectionTable
(
addToRunTimeSelectionTable injectorType,
( definedInjector,
injectorType, dictionary
definedInjector, );
dictionary
);
} }
@ -73,12 +71,13 @@ Foam::definedInjector::definedInjector
// convert CA to real time - mass flow rate profile // convert CA to real time - mass flow rate profile
forAll(massFlowRateProfile_, i) forAll(massFlowRateProfile_, i)
{ {
massFlowRateProfile_[i][0] = t.userTimeToTime(massFlowRateProfile_[i][0]); massFlowRateProfile_[i][0] =
// dummy t.userTimeToTime(massFlowRateProfile_[i][0]);
injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0]; // dummy
injectionPressureProfile_[i][1] = 0.0; injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0];
CdProfile_[i][0] = massFlowRateProfile_[i][0]; injectionPressureProfile_[i][1] = 0.0;
CdProfile_[i][1] = 1.0; CdProfile_[i][0] = massFlowRateProfile_[i][0];
CdProfile_[i][1] = 1.0;
} }
forAll(velocityProfile_, i) forAll(velocityProfile_, i)
@ -89,15 +88,28 @@ Foam::definedInjector::definedInjector
// check if time entries match // check if time entries match
if (mag(massFlowRateProfile_[0][0]-velocityProfile_[0][0]) > SMALL) if (mag(massFlowRateProfile_[0][0]-velocityProfile_[0][0]) > SMALL)
{ {
FatalError << "definedInjector::definedInjector(const time& t, const dictionary dict) " << endl FatalErrorIn
<< " start-times do not match for velocityProfile and massFlowRateProfile." (
"definedInjector::definedInjector"
"(const time& t, const dictionary dict)"
) << "Start-times do not match for velocityProfile and "
<< "massFlowRateProfile." << nl
<< abort(FatalError); << abort(FatalError);
} }
if (mag(massFlowRateProfile_[massFlowRateProfile_.size()-1][0]-velocityProfile_[velocityProfile_.size()-1][0]) > SMALL) if
(
mag(massFlowRateProfile_[massFlowRateProfile_.size()-1][0]
- velocityProfile_[velocityProfile_.size()-1][0])
> SMALL
)
{ {
FatalError << "definedInjector::definedInjector(const time& t, const dictionary dict) " << endl FatalErrorIn
<< " end-times do not match for velocityProfile and massFlowRateProfile." (
"definedInjector::definedInjector"
"(const time& t, const dictionary dict)"
) << "End-times do not match for velocityProfile and "
<< "massFlowRateProfile."
<< abort(FatalError); << abort(FatalError);
} }
@ -126,7 +138,8 @@ Foam::definedInjector::definedInjector
{ {
WarningIn WarningIn
( (
"definedInjector::definedInjector(const time& t, Istream& is)" "definedInjector::definedInjector"
"(const time& t, const dictionary dict)"
) << "X does not add up to 1.0, correcting molar fractions." ) << "X does not add up to 1.0, correcting molar fractions."
<< endl; << endl;
@ -178,11 +191,13 @@ Foam::label Foam::definedInjector::nParcelsToInject
return nParcels; return nParcels;
} }
const Foam::vector Foam::definedInjector::position(const label n) const const Foam::vector Foam::definedInjector::position(const label n) const
{ {
return position_; return position_;
} }
Foam::vector Foam::definedInjector::position Foam::vector Foam::definedInjector::position
( (
const label n, const label n,
@ -211,7 +226,7 @@ Foam::vector Foam::definedInjector::position
{ {
// otherwise, disc injection // otherwise, disc injection
scalar iRadius = d_*rndGen.scalar01(); scalar iRadius = d_*rndGen.scalar01();
scalar iAngle = 2.0*mathematicalConstant::pi*rndGen.scalar01(); scalar iAngle = constant::math::twoPi*rndGen.scalar01();
return return
( (
@ -228,16 +243,19 @@ Foam::vector Foam::definedInjector::position
return position_; return position_;
} }
Foam::label Foam::definedInjector::nHoles() const Foam::label Foam::definedInjector::nHoles() const
{ {
return 1; return 1;
} }
Foam::scalar Foam::definedInjector::d() const Foam::scalar Foam::definedInjector::d() const
{ {
return d_; return d_;
} }
const Foam::vector& Foam::definedInjector::direction const Foam::vector& Foam::definedInjector::direction
( (
const label i, const label i,
@ -247,6 +265,7 @@ const Foam::vector& Foam::definedInjector::direction
return direction_; return direction_;
} }
Foam::scalar Foam::definedInjector::mass Foam::scalar Foam::definedInjector::mass
( (
const scalar time0, const scalar time0,
@ -255,62 +274,73 @@ Foam::scalar Foam::definedInjector::mass
const scalar angleOfWedge const scalar angleOfWedge
) const ) const
{ {
scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); scalar mInj =
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
// correct mass if calculation is 2D // correct mass if calculation is 2D
if (twoD) if (twoD)
{ {
mInj *= 0.5*angleOfWedge/mathematicalConstant::pi; mInj *= 0.5*angleOfWedge/constant::math::pi;
} }
return mInj; return mInj;
} }
Foam::scalar Foam::definedInjector::mass() const Foam::scalar Foam::definedInjector::mass() const
{ {
return mass_; return mass_;
} }
Foam::scalar Foam::definedInjector::massFlowRate(const scalar time) const Foam::scalar Foam::definedInjector::massFlowRate(const scalar time) const
{ {
return getTableValue(massFlowRateProfile_, time); return getTableValue(massFlowRateProfile_, time);
} }
Foam::scalar Foam::definedInjector::injectionPressure(const scalar time) const Foam::scalar Foam::definedInjector::injectionPressure(const scalar time) const
{ {
return getTableValue(injectionPressureProfile_, time); return getTableValue(injectionPressureProfile_, time);
} }
Foam::scalar Foam::definedInjector::Cd(const scalar time) const Foam::scalar Foam::definedInjector::Cd(const scalar time) const
{ {
return getTableValue(CdProfile_, time); return getTableValue(CdProfile_, time);
} }
const Foam::scalarField& Foam::definedInjector::X() const const Foam::scalarField& Foam::definedInjector::X() const
{ {
return X_; return X_;
} }
Foam::List<Foam::definedInjector::pair> Foam::definedInjector::T() const Foam::List<Foam::definedInjector::pair> Foam::definedInjector::T() const
{ {
return TProfile_; return TProfile_;
} }
Foam::scalar Foam::definedInjector::T(const scalar time) const Foam::scalar Foam::definedInjector::T(const scalar time) const
{ {
return T_; return T_;
} }
Foam::scalar Foam::definedInjector::tsoi() const Foam::scalar Foam::definedInjector::tsoi() const
{ {
return massFlowRateProfile_[0][0]; return massFlowRateProfile_[0][0];
} }
Foam::scalar Foam::definedInjector::teoi() const Foam::scalar Foam::definedInjector::teoi() const
{ {
return massFlowRateProfile_[massFlowRateProfile_.size()-1][0]; return massFlowRateProfile_[massFlowRateProfile_.size()-1][0];
} }
Foam::scalar Foam::definedInjector::fractionOfInjection Foam::scalar Foam::definedInjector::fractionOfInjection
( (
const scalar time const scalar time
@ -319,6 +349,7 @@ Foam::scalar Foam::definedInjector::fractionOfInjection
return integrateTable(massFlowRateProfile_, time)/mass_; return integrateTable(massFlowRateProfile_, time)/mass_;
} }
Foam::scalar Foam::definedInjector::velocity Foam::scalar Foam::definedInjector::velocity
( (
const scalar time const scalar time
@ -327,6 +358,7 @@ Foam::scalar Foam::definedInjector::velocity
return getTableValue(velocityProfile_, time); return getTableValue(velocityProfile_, time);
} }
Foam::scalar Foam::definedInjector::injectedMass Foam::scalar Foam::definedInjector::injectedMass
( (
const scalar t const scalar t
@ -335,13 +367,14 @@ Foam::scalar Foam::definedInjector::injectedMass
return mass_*fractionOfInjection(t); return mass_*fractionOfInjection(t);
} }
void Foam::definedInjector::correctProfiles void Foam::definedInjector::correctProfiles
( (
const liquidMixture& fuel, const liquidMixture& fuel,
const scalar referencePressure 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 pDummy = 1.0e+5;
scalar rho = fuel.rho(pDummy, T_, X_); scalar rho = fuel.rho(pDummy, T_, X_);
@ -354,14 +387,17 @@ void Foam::definedInjector::correctProfiles
} }
} }
Foam::vector Foam::definedInjector::tan1(const label n) const Foam::vector Foam::definedInjector::tan1(const label n) const
{ {
return tangentialInjectionVector1_; return tangentialInjectionVector1_;
} }
Foam::vector Foam::definedInjector::tan2(const label n) const Foam::vector Foam::definedInjector::tan2(const label n) const
{ {
return tangentialInjectionVector2_; return tangentialInjectionVector2_;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -46,7 +46,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class definedInjector Declaration Class definedInjector Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class definedInjector class definedInjector
@ -69,8 +69,8 @@ private:
scalar T_; scalar T_;
label nParcels_; label nParcels_;
scalarField X_; scalarField X_;
List<pair> massFlowRateProfile_; // aj List<pair> massFlowRateProfile_;
List<pair> velocityProfile_; // aj List<pair> velocityProfile_;
List<pair> injectionPressureProfile_; List<pair> injectionPressureProfile_;
List<pair> CdProfile_; List<pair> CdProfile_;
List<pair> TProfile_; List<pair> TProfile_;
@ -101,6 +101,7 @@ private:
//- Return the instantaneous injection velocity //- Return the instantaneous injection velocity
scalar injectionVelocity(const scalar) const; scalar injectionVelocity(const scalar) const;
public: public:
//- Runtime type information //- Runtime type information
@ -110,16 +111,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from components
definedInjector definedInjector(const Time& t, const dictionary& dict);
(
const Time& t,
const dictionary& dict
);
// Destructor //- Destructor
virtual ~definedInjector();
~definedInjector();
// Member Functions // Member Functions
@ -231,7 +227,6 @@ public:
{ {
return pressureIndependentVelocity_; return pressureIndependentVelocity_;
} }
}; };

View File

@ -31,10 +31,9 @@ License
namespace Foam namespace Foam
{ {
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// No code
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -47,7 +47,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class injector Declaration Class injector Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class injector class injector

View File

@ -30,10 +30,8 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(injectorType, 0);
defineTypeNameAndDebug(injectorType, 0); defineRunTimeSelectionTable(injectorType, dictionary);
defineRunTimeSelectionTable(injectorType, dictionary);
} }
@ -47,6 +45,7 @@ Foam::injectorType::injectorType
) )
{} {}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::injectorType> Foam::injectorType::New Foam::autoPtr<Foam::injectorType> Foam::injectorType::New
@ -55,30 +54,25 @@ Foam::autoPtr<Foam::injectorType> Foam::injectorType::New
const dictionary& dict const dictionary& dict
) )
{ {
word injectorTypeName word injectorTypeName(dict.lookup("injectorType"));
(
dict.lookup("injectorType")
);
Info<< "Selecting injectorType " Info<< "Selecting injectorType " << injectorTypeName << endl;
<< injectorTypeName << endl;
dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(injectorTypeName); dictionaryConstructorTablePtr_->find(injectorTypeName);
if (cstrIter == dictionaryConstructorTablePtr_->end()) if (cstrIter == dictionaryConstructorTablePtr_->end())
{ {
FatalError FatalErrorIn("injectorType::New(const dictionary&)")
<< "injectorType::New(const dictionary&) : " << endl << "Unknown injectorType type "
<< " unknown injectorType type "
<< injectorTypeName << injectorTypeName
<< ", constructor not in hash table" << endl << endl << ", constructor not in hash table" << nl << nl
<< " Valid injector types are :" << endl; << " Valid injector types are:" << nl
Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); << dictionaryConstructorTablePtr_->sortedToc()
<< abort(FatalError);
} }
return autoPtr<injectorType>(cstrIter()(t, dict)); return autoPtr<injectorType>(cstrIter()(t, dict));
} }
@ -87,6 +81,7 @@ Foam::autoPtr<Foam::injectorType> Foam::injectorType::New
Foam::injectorType::~injectorType() Foam::injectorType::~injectorType()
{} {}
Foam::scalar Foam::injectorType::getTableValue Foam::scalar Foam::injectorType::getTableValue
( (
const List<pair>& table, const List<pair>& table,
@ -126,6 +121,7 @@ Foam::scalar Foam::injectorType::getTableValue
} }
} }
Foam::scalar Foam::injectorType::integrateTable Foam::scalar Foam::injectorType::integrateTable
( (
const List<pair>& table, const List<pair>& table,
@ -162,6 +158,7 @@ Foam::scalar Foam::injectorType::integrateTable
return sum; return sum;
} }
Foam::scalar Foam::injectorType::integrateTable Foam::scalar Foam::injectorType::integrateTable
( (
const List<pair>& table const List<pair>& table
@ -178,4 +175,5 @@ Foam::scalar Foam::injectorType::integrateTable
return integratedTable; return integratedTable;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -53,12 +53,12 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class injectorType Declaration Class injectorType Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class injectorType class injectorType
{ {
typedef VectorSpace<Vector<scalar>, scalar, 2> pair; typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
public: public:
@ -83,11 +83,7 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from components
injectorType injectorType(const Time& t, const dictionary& dict);
(
const Time& t,
const dictionary& dict
);
// Selectors // Selectors
@ -99,9 +95,8 @@ public:
); );
// Destructor //- Destructor
virtual ~injectorType();
virtual ~injectorType();
// Member Functions // Member Functions
@ -197,10 +192,12 @@ public:
virtual bool pressureIndependentVelocity() const = 0; virtual bool pressureIndependentVelocity() const = 0;
//- Return a vector perpendicular to the injection direction and tan2 for hole n //- Return a vector perpendicular to the injection direction and tan2
// for hole n
virtual vector tan1(const label n) const = 0; virtual vector tan1(const label n) const = 0;
//- Return a vector perpendicular to the injection direction and tan1 for hole n //- Return a vector perpendicular to the injection direction and tan1
// for hole n
virtual vector tan2(const label n) const = 0; virtual vector tan2(const label n) const = 0;
scalar getTableValue scalar getTableValue
@ -225,7 +222,6 @@ public:
const liquidMixture& fuel, const liquidMixture& fuel,
const scalar referencePressure const scalar referencePressure
) = 0; ) = 0;
}; };

View File

@ -27,22 +27,20 @@ License
#include "multiHoleInjector.H" #include "multiHoleInjector.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "Random.H" #include "Random.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(multiHoleInjector, 0);
defineTypeNameAndDebug(multiHoleInjector, 0); addToRunTimeSelectionTable
(
addToRunTimeSelectionTable injectorType,
( multiHoleInjector,
injectorType, dictionary
multiHoleInjector, );
dictionary
);
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -79,27 +77,39 @@ Foam::multiHoleInjector::multiHoleInjector
tangentialInjectionVector1_(nHoles_), tangentialInjectionVector1_(nHoles_),
tangentialInjectionVector2_(nHoles_) tangentialInjectionVector2_(nHoles_)
{ {
// check if time entries for soi and eoi match // check if time entries for soi and eoi match
if (mag(massFlowRateProfile_[0][0]-TProfile_[0][0]) > SMALL) if (mag(massFlowRateProfile_[0][0] - TProfile_[0][0]) > SMALL)
{ {
FatalError << "multiHoleInjector::multiHoleInjector(const time& t, const dictionary dict) " << endl FatalErrorIn
<< " start-times do not match for TemperatureProfile and massFlowRateProfile." (
"multiHoleInjector::multiHoleInjector"
"(const time& t, const dictionary dict)"
) << "Start-times do not match for TemperatureProfile and "
<< "massFlowRateProfile."
<< abort(FatalError); << abort(FatalError);
} }
if (mag(massFlowRateProfile_[massFlowRateProfile_.size()-1][0]-TProfile_[TProfile_.size()-1][0]) > SMALL) if
(
mag(massFlowRateProfile_[massFlowRateProfile_.size()-1][0]
- TProfile_[TProfile_.size()-1][0])
> SMALL
)
{ {
FatalError << "multiHoleInjector::multiHoleInjector(const time& t, const dictionary dict) " << endl FatalErrorIn
<< " end-times do not match for TemperatureProfile and massFlowRateProfile." (
"multiHoleInjector::multiHoleInjector"
"(const time& t, const dictionary dict)"
) << "End-times do not match for TemperatureProfile and "
<< "massFlowRateProfile."
<< abort(FatalError); << abort(FatalError);
} }
// convert CA to real time // convert CA to real time
forAll(massFlowRateProfile_, i) forAll(massFlowRateProfile_, i)
{ {
massFlowRateProfile_[i][0] = t.userTimeToTime(massFlowRateProfile_[i][0]); massFlowRateProfile_[i][0] =
t.userTimeToTime(massFlowRateProfile_[i][0]);
velocityProfile_[i][0] = massFlowRateProfile_[i][0]; velocityProfile_[i][0] = massFlowRateProfile_[i][0];
injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0]; injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0];
} }
@ -131,17 +141,20 @@ Foam::multiHoleInjector::multiHoleInjector
if (mag(Xsum - 1.0) > SMALL) if (mag(Xsum - 1.0) > SMALL)
{ {
Info << "Warning!!!\n multiHoleInjector::multiHoleInjector(const time& t, Istream& is)" WarningIn
<< "X does not add up to 1.0, correcting molar fractions." (
"multiHoleInjector::multiHoleInjector"
"(const time& t, const dictionary dict)"
) << "X does not add up to 1.0, correcting molar fractions."
<< endl; << endl;
forAll(X_, i) forAll(X_, i)
{ {
X_[i] /= Xsum; X_[i] /= Xsum;
} }
} }
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::multiHoleInjector::~multiHoleInjector() Foam::multiHoleInjector::~multiHoleInjector()
@ -152,7 +165,7 @@ Foam::multiHoleInjector::~multiHoleInjector()
void Foam::multiHoleInjector::setTangentialVectors() void Foam::multiHoleInjector::setTangentialVectors()
{ {
scalar pi180 = mathematicalConstant::pi/180.0; scalar pi180 = constant::math::pi/180.0;
scalar alpha = xyAngle_*pi180; scalar alpha = xyAngle_*pi180;
scalar phi = zAngle_*pi180; scalar phi = zAngle_*pi180;
@ -172,7 +185,7 @@ void Foam::multiHoleInjector::setTangentialVectors()
scalar angle = 0.0; scalar angle = 0.0;
scalar u = umbrellaAngle_*pi180/2.0; scalar u = umbrellaAngle_*pi180/2.0;
for(label i=0; i<nHoles_; i++) for (label i=0; i<nHoles_; i++)
{ {
angle += angleSpacing_[i]; angle += angleSpacing_[i];
scalar v = angle*pi180; scalar v = angle*pi180;
@ -183,12 +196,11 @@ void Foam::multiHoleInjector::setTangentialVectors()
dp /= mag(dp); dp /= mag(dp);
} }
position_[i] = centerPosition_ + 0.5*nozzleTipDiameter_*dp; position_[i] = centerPosition_ + 0.5*nozzleTipDiameter_*dp;
// Info << "i = " << i << ", dir = " << direction_[i] << ", pos = " << position_[i] << endl;
} }
Random rndGen(label(0)); Random rndGen(label(0));
for(label i=0; i<nHoles_; i++) for (label i=0; i<nHoles_; i++)
{ {
vector tangent(vector::zero); vector tangent(vector::zero);
scalar magV = 0; scalar magV = 0;
@ -201,8 +213,8 @@ void Foam::multiHoleInjector::setTangentialVectors()
} }
tangentialInjectionVector1_[i] = tangent/magV; tangentialInjectionVector1_[i] = tangent/magV;
tangentialInjectionVector2_[i] = direction_[i] ^ tangentialInjectionVector1_[i]; tangentialInjectionVector2_[i] =
direction_[i] ^ tangentialInjectionVector1_[i];
} }
} }
@ -213,18 +225,20 @@ Foam::label Foam::multiHoleInjector::nParcelsToInject
const scalar time1 const scalar time1
) const ) const
{ {
scalar mInj =
scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
label nParcels = label(mInj/averageParcelMass_ + 0.49); label nParcels = label(mInj/averageParcelMass_ + 0.49);
return nParcels; return nParcels;
} }
const Foam::vector Foam::multiHoleInjector::position(const label n) const const Foam::vector Foam::multiHoleInjector::position(const label n) const
{ {
return position_[n]; return position_[n];
} }
Foam::vector Foam::multiHoleInjector::position Foam::vector Foam::multiHoleInjector::position
( (
const label n, const label n,
@ -253,7 +267,7 @@ Foam::vector Foam::multiHoleInjector::position
{ {
// otherwise, disc injection // otherwise, disc injection
scalar iRadius = d_*rndGen.scalar01(); scalar iRadius = d_*rndGen.scalar01();
scalar iAngle = 2.0*mathematicalConstant::pi*rndGen.scalar01(); scalar iAngle = constant::math::twoPi*rndGen.scalar01();
return return
( (
@ -264,21 +278,23 @@ Foam::vector Foam::multiHoleInjector::position
+ tangentialInjectionVector2_[n]*sin(iAngle) + tangentialInjectionVector2_[n]*sin(iAngle)
) )
); );
} }
return position_[0]; return position_[0];
} }
Foam::label Foam::multiHoleInjector::nHoles() const Foam::label Foam::multiHoleInjector::nHoles() const
{ {
return nHoles_; return nHoles_;
} }
Foam::scalar Foam::multiHoleInjector::d() const Foam::scalar Foam::multiHoleInjector::d() const
{ {
return d_; return d_;
} }
const Foam::vector& Foam::multiHoleInjector::direction const Foam::vector& Foam::multiHoleInjector::direction
( (
const label i, const label i,
@ -288,6 +304,7 @@ const Foam::vector& Foam::multiHoleInjector::direction
return direction_[i]; return direction_[i];
} }
Foam::scalar Foam::multiHoleInjector::mass Foam::scalar Foam::multiHoleInjector::mass
( (
const scalar time0, const scalar time0,
@ -296,47 +313,55 @@ Foam::scalar Foam::multiHoleInjector::mass
const scalar angleOfWedge const scalar angleOfWedge
) const ) const
{ {
scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); scalar mInj =
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
// correct mass if calculation is 2D // correct mass if calculation is 2D
if (twoD) if (twoD)
{ {
mInj *= 0.5*angleOfWedge/mathematicalConstant::pi; mInj *= 0.5*angleOfWedge/constant::math::pi;
} }
return mInj; return mInj;
} }
Foam::scalar Foam::multiHoleInjector::mass() const Foam::scalar Foam::multiHoleInjector::mass() const
{ {
return mass_; return mass_;
} }
const Foam::scalarField& Foam::multiHoleInjector::X() const const Foam::scalarField& Foam::multiHoleInjector::X() const
{ {
return X_; return X_;
} }
Foam::List<Foam::multiHoleInjector::pair> Foam::multiHoleInjector::T() const Foam::List<Foam::multiHoleInjector::pair> Foam::multiHoleInjector::T() const
{ {
return TProfile_; return TProfile_;
} }
Foam::scalar Foam::multiHoleInjector::T(const scalar time) const Foam::scalar Foam::multiHoleInjector::T(const scalar time) const
{ {
return getTableValue(TProfile_, time); return getTableValue(TProfile_, time);
} }
Foam::scalar Foam::multiHoleInjector::tsoi() const Foam::scalar Foam::multiHoleInjector::tsoi() const
{ {
return massFlowRateProfile_[0][0]; return massFlowRateProfile_[0][0];
} }
Foam::scalar Foam::multiHoleInjector::teoi() const Foam::scalar Foam::multiHoleInjector::teoi() const
{ {
return massFlowRateProfile_[massFlowRateProfile_.size()-1][0]; return massFlowRateProfile_[massFlowRateProfile_.size()-1][0];
} }
Foam::scalar Foam::multiHoleInjector::massFlowRate Foam::scalar Foam::multiHoleInjector::massFlowRate
( (
const scalar time const scalar time
@ -345,6 +370,7 @@ Foam::scalar Foam::multiHoleInjector::massFlowRate
return getTableValue(massFlowRateProfile_, time); return getTableValue(massFlowRateProfile_, time);
} }
Foam::scalar Foam::multiHoleInjector::injectionPressure Foam::scalar Foam::multiHoleInjector::injectionPressure
( (
const scalar time const scalar time
@ -353,6 +379,7 @@ Foam::scalar Foam::multiHoleInjector::injectionPressure
return getTableValue(injectionPressureProfile_, time); return getTableValue(injectionPressureProfile_, time);
} }
Foam::scalar Foam::multiHoleInjector::velocity Foam::scalar Foam::multiHoleInjector::velocity
( (
const scalar time const scalar time
@ -361,11 +388,14 @@ Foam::scalar Foam::multiHoleInjector::velocity
return getTableValue(velocityProfile_, time); return getTableValue(velocityProfile_, time);
} }
Foam::List<Foam::multiHoleInjector::pair> Foam::multiHoleInjector::CdProfile() const
Foam::List<Foam::multiHoleInjector::pair> Foam::multiHoleInjector::CdProfile()
const
{ {
return CdProfile_; return CdProfile_;
} }
Foam::scalar Foam::multiHoleInjector::Cd Foam::scalar Foam::multiHoleInjector::Cd
( (
const scalar time const scalar time
@ -374,11 +404,16 @@ Foam::scalar Foam::multiHoleInjector::Cd
return Cd_; return Cd_;
} }
Foam::scalar Foam::multiHoleInjector::fractionOfInjection(const scalar time) const
Foam::scalar Foam::multiHoleInjector::fractionOfInjection
(
const scalar time
) const
{ {
return integrateTable(massFlowRateProfile_, time)/mass_; return integrateTable(massFlowRateProfile_, time)/mass_;
} }
Foam::scalar Foam::multiHoleInjector::injectedMass Foam::scalar Foam::multiHoleInjector::injectedMass
( (
const scalar t const scalar t
@ -394,8 +429,7 @@ void Foam::multiHoleInjector::correctProfiles
const scalar referencePressure const scalar referencePressure
) )
{ {
scalar A = nHoles_*0.25*constant::math::pi*sqr(d_);
scalar A = nHoles_*0.25*mathematicalConstant::pi*pow(d_, 2.0);
forAll(velocityProfile_, i) forAll(velocityProfile_, i)
{ {
@ -407,14 +441,17 @@ void Foam::multiHoleInjector::correctProfiles
} }
} }
Foam::vector Foam::multiHoleInjector::tan1(const label n) const Foam::vector Foam::multiHoleInjector::tan1(const label n) const
{ {
return tangentialInjectionVector1_[n]; return tangentialInjectionVector1_[n];
} }
Foam::vector Foam::multiHoleInjector::tan2(const label n) const Foam::vector Foam::multiHoleInjector::tan2(const label n) const
{ {
return tangentialInjectionVector2_[n]; return tangentialInjectionVector2_[n];
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -47,7 +47,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class multiHoleInjector Declaration Class multiHoleInjector Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class multiHoleInjector class multiHoleInjector
@ -123,9 +123,8 @@ public:
); );
// Destructor //- Destructor
virtual ~multiHoleInjector();
~multiHoleInjector();
// Member Functions // Member Functions
@ -233,7 +232,6 @@ public:
{ {
return pressureIndependentVelocity_; return pressureIndependentVelocity_;
} }
}; };

View File

@ -27,7 +27,7 @@ License
#include "swirlInjector.H" #include "swirlInjector.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "Random.H" #include "Random.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -83,13 +83,18 @@ Foam::swirlInjector::swirlInjector
} }
// check if time entries match // check if time entries match
if (mag(massFlowRateProfile_[0][0]-injectionPressureProfile_[0][0]) > SMALL) if
(
mag(massFlowRateProfile_[0][0] - injectionPressureProfile_[0][0])
> SMALL
)
{ {
FatalErrorIn FatalErrorIn
( (
"swirlInjector::swirlInjector(const time& t, const dictionary dict)" "swirlInjector::swirlInjector"
"(const time& t, const dictionary dict)"
) << "Start-times do not match for " ) << "Start-times do not match for "
"injectionPressureProfile and massFlowRateProfile." << "injectionPressureProfile and massFlowRateProfile."
<< abort(FatalError); << abort(FatalError);
} }
@ -105,9 +110,10 @@ Foam::swirlInjector::swirlInjector
{ {
FatalErrorIn FatalErrorIn
( (
"swirlInjector::swirlInjector(const time& t, const dictionary dict)" "swirlInjector::swirlInjector"
"(const time& t, const dictionary dict)"
) << "End-times do not match for " ) << "End-times do not match for "
"injectionPressureProfile and massFlowRateProfile." << "injectionPressureProfile and massFlowRateProfile."
<< abort(FatalError); << abort(FatalError);
} }
@ -152,7 +158,8 @@ Foam::swirlInjector::swirlInjector
{ {
WarningIn WarningIn
( (
"swirlInjector::swirlInjector(const time& t, const dictionary dict)" "swirlInjector::swirlInjector"
"(const time& t, const dictionary dict)"
) << "X does not add up to 1.0, correcting molar fractions." << endl; ) << "X does not add up to 1.0, correcting molar fractions." << endl;
forAll(X_, i) forAll(X_, i)
@ -186,9 +193,10 @@ void Foam::swirlInjector::setTangentialVectors()
} }
tangentialInjectionVector1_ = tangent/magV; tangentialInjectionVector1_ = tangent/magV;
tangentialInjectionVector2_ = direction_ ^ tangentialInjectionVector1_; tangentialInjectionVector2_ = direction_^tangentialInjectionVector1_;
} }
Foam::label Foam::swirlInjector::nParcelsToInject Foam::label Foam::swirlInjector::nParcelsToInject
( (
const scalar time0, const scalar time0,
@ -196,17 +204,20 @@ Foam::label Foam::swirlInjector::nParcelsToInject
) const ) const
{ {
scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); scalar mInj =
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
label nParcels = label(mInj/averageParcelMass_ + 0.49); label nParcels = label(mInj/averageParcelMass_ + 0.49);
return nParcels; return nParcels;
} }
const Foam::vector Foam::swirlInjector::position(const label n) const const Foam::vector Foam::swirlInjector::position(const label n) const
{ {
return position_; return position_;
} }
Foam::vector Foam::swirlInjector::position Foam::vector Foam::swirlInjector::position
( (
const label n, const label n,
@ -235,7 +246,7 @@ Foam::vector Foam::swirlInjector::position
{ {
// otherwise, disc injection // otherwise, disc injection
scalar iRadius = d_*rndGen.scalar01(); scalar iRadius = d_*rndGen.scalar01();
scalar iAngle = 2.0*mathematicalConstant::pi*rndGen.scalar01(); scalar iAngle = constant::math::twoPi*rndGen.scalar01();
return return
( (
@ -252,16 +263,19 @@ Foam::vector Foam::swirlInjector::position
return position_; return position_;
} }
Foam::label Foam::swirlInjector::nHoles() const Foam::label Foam::swirlInjector::nHoles() const
{ {
return 1; return 1;
} }
Foam::scalar Foam::swirlInjector::d() const Foam::scalar Foam::swirlInjector::d() const
{ {
return d_; return d_;
} }
const Foam::vector& Foam::swirlInjector::direction const Foam::vector& Foam::swirlInjector::direction
( (
const label i, const label i,
@ -271,6 +285,7 @@ const Foam::vector& Foam::swirlInjector::direction
return direction_; return direction_;
} }
Foam::scalar Foam::swirlInjector::mass Foam::scalar Foam::swirlInjector::mass
( (
const scalar time0, const scalar time0,
@ -279,95 +294,112 @@ Foam::scalar Foam::swirlInjector::mass
const scalar angleOfWedge const scalar angleOfWedge
) const ) const
{ {
scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); scalar mInj =
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
// correct mass if calculation is 2D // correct mass if calculation is 2D
if (twoD) if (twoD)
{ {
mInj *= 0.5*angleOfWedge/mathematicalConstant::pi; mInj *= 0.5*angleOfWedge/constant::math::pi;
} }
return mInj; return mInj;
} }
Foam::scalar Foam::swirlInjector::mass() const Foam::scalar Foam::swirlInjector::mass() const
{ {
return mass_; return mass_;
} }
Foam::List<Foam::swirlInjector::pair> Foam::List<Foam::swirlInjector::pair>
Foam::swirlInjector::massFlowRateProfile() const Foam::swirlInjector::massFlowRateProfile() const
{ {
return massFlowRateProfile_; return massFlowRateProfile_;
} }
Foam::scalar Foam::swirlInjector::massFlowRate(const scalar time) const Foam::scalar Foam::swirlInjector::massFlowRate(const scalar time) const
{ {
return getTableValue(massFlowRateProfile_, time); return getTableValue(massFlowRateProfile_, time);
} }
Foam::List<Foam::swirlInjector::pair> Foam::List<Foam::swirlInjector::pair>
Foam::swirlInjector::injectionPressureProfile() const Foam::swirlInjector::injectionPressureProfile() const
{ {
return injectionPressureProfile_; return injectionPressureProfile_;
} }
Foam::scalar Foam::swirlInjector::injectionPressure(const scalar time) const Foam::scalar Foam::swirlInjector::injectionPressure(const scalar time) const
{ {
return getTableValue(injectionPressureProfile_, time); return getTableValue(injectionPressureProfile_, time);
} }
Foam::List<Foam::swirlInjector::pair> Foam::List<Foam::swirlInjector::pair>
Foam::swirlInjector::velocityProfile() const Foam::swirlInjector::velocityProfile() const
{ {
return velocityProfile_; return velocityProfile_;
} }
Foam::scalar Foam::swirlInjector::velocity(const scalar time) const Foam::scalar Foam::swirlInjector::velocity(const scalar time) const
{ {
return getTableValue(velocityProfile_, time); return getTableValue(velocityProfile_, time);
} }
Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::CdProfile() const Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::CdProfile() const
{ {
return CdProfile_; return CdProfile_;
} }
Foam::scalar Foam::swirlInjector::Cd(const scalar time) const Foam::scalar Foam::swirlInjector::Cd(const scalar time) const
{ {
return getTableValue(CdProfile_, time); return getTableValue(CdProfile_, time);
} }
const Foam::scalarField& Foam::swirlInjector::X() const const Foam::scalarField& Foam::swirlInjector::X() const
{ {
return X_; return X_;
} }
Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::T() const Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::T() const
{ {
return TProfile_; return TProfile_;
} }
Foam::scalar Foam::swirlInjector::T(const scalar time) const Foam::scalar Foam::swirlInjector::T(const scalar time) const
{ {
return T_; return T_;
} }
Foam::scalar Foam::swirlInjector::tsoi() const Foam::scalar Foam::swirlInjector::tsoi() const
{ {
return massFlowRateProfile_[0][0]; return massFlowRateProfile_[0][0];
} }
Foam::scalar Foam::swirlInjector::teoi() const Foam::scalar Foam::swirlInjector::teoi() const
{ {
return massFlowRateProfile_[massFlowRateProfile_.size()-1][0]; return massFlowRateProfile_[massFlowRateProfile_.size()-1][0];
} }
Foam::scalar Foam::swirlInjector::fractionOfInjection(const scalar time) const Foam::scalar Foam::swirlInjector::fractionOfInjection(const scalar time) const
{ {
return integrateTable(massFlowRateProfile_, time)/mass_; return integrateTable(massFlowRateProfile_, time)/mass_;
} }
Foam::scalar Foam::swirlInjector::injectedMass Foam::scalar Foam::swirlInjector::injectedMass
( (
const scalar t const scalar t
@ -376,14 +408,14 @@ Foam::scalar Foam::swirlInjector::injectedMass
return mass_*fractionOfInjection(t); return mass_*fractionOfInjection(t);
} }
void Foam::swirlInjector::correctProfiles void Foam::swirlInjector::correctProfiles
( (
const liquidMixture& fuel, const liquidMixture& fuel,
const scalar referencePressure const scalar referencePressure
) )
{ {
scalar A = 0.25*constant::math::pi*sqr(d_);
scalar A = 0.25*mathematicalConstant::pi*pow(d_, 2.0);
scalar pDummy = 1.0e+5; scalar pDummy = 1.0e+5;
scalar rho = fuel.rho(pDummy, T_, X_); scalar rho = fuel.rho(pDummy, T_, X_);
@ -401,11 +433,13 @@ void Foam::swirlInjector::correctProfiles
} }
} }
Foam::vector Foam::swirlInjector::tan1(const label n) const Foam::vector Foam::swirlInjector::tan1(const label n) const
{ {
return tangentialInjectionVector1_; return tangentialInjectionVector1_;
} }
Foam::vector Foam::swirlInjector::tan2(const label n) const Foam::vector Foam::swirlInjector::tan2(const label n) const
{ {
return tangentialInjectionVector2_; return tangentialInjectionVector2_;

View File

@ -104,17 +104,15 @@ private:
//- Return the fraction of the total injected liquid //- Return the fraction of the total injected liquid
scalar fractionOfInjection(const scalar time) const; scalar fractionOfInjection(const scalar time) const;
/* /*
//- Return the average injection velocity //- Return the average injection velocity
scalar averageInjectionVelocityTime(const scalar liquidDensity) const; scalar averageInjectionVelocityTime(const scalar liquidDensity) const;
//- Return the instantaneous injection velocity //- Return the instantaneous injection velocity
scalar injectionVelocity(const scalar, const scalar liquidDensity) const; scalar injectionVelocity(const scalar, const scalar liquidDensity) const;
*/ */
public: public:
//- Runtime type information //- Runtime type information
@ -124,16 +122,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from components
swirlInjector swirlInjector(const Time& t, const dictionary& dict);
(
const Time& t,
const dictionary& dict
);
// Destructor //- Destructor
virtual ~swirlInjector();
~swirlInjector();
// Member Functions // Member Functions

View File

@ -27,7 +27,7 @@ License
#include "unitInjector.H" #include "unitInjector.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "Random.H" #include "Random.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -77,8 +77,8 @@ Foam::unitInjector::unitInjector
FatalErrorIn FatalErrorIn
( (
"unitInjector::unitInjector(const time& t, const dictionary dict)" "unitInjector::unitInjector(const time& t, const dictionary dict)"
)<< "start-times do not match for TemperatureProfile and " ) << "start-times do not match for TemperatureProfile and "
<< " massFlowRateProfile." << nl << exit (FatalError); << " massFlowRateProfile." << nl << exit (FatalError);
} }
if if
@ -91,8 +91,8 @@ Foam::unitInjector::unitInjector
FatalErrorIn FatalErrorIn
( (
"unitInjector::unitInjector(const time& t, const dictionary dict)" "unitInjector::unitInjector(const time& t, const dictionary dict)"
)<< "end-times do not match for TemperatureProfile and " ) << "end-times do not match for TemperatureProfile and "
<< "massFlowRateProfile." << nl << exit(FatalError); << "massFlowRateProfile." << nl << exit(FatalError);
} }
// convert CA to real time // convert CA to real time
@ -145,6 +145,7 @@ Foam::unitInjector::unitInjector
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::unitInjector::~unitInjector() Foam::unitInjector::~unitInjector()
@ -169,7 +170,6 @@ void Foam::unitInjector::setTangentialVectors()
tangentialInjectionVector1_ = tangent/magV; tangentialInjectionVector1_ = tangent/magV;
tangentialInjectionVector2_ = direction_ ^ tangentialInjectionVector1_; tangentialInjectionVector2_ = direction_ ^ tangentialInjectionVector1_;
} }
@ -179,7 +179,8 @@ Foam::label Foam::unitInjector::nParcelsToInject
const scalar time1 const scalar time1
) const ) const
{ {
scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); scalar mInj =
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
label nParcels = label(mInj/averageParcelMass_ + 0.49); label nParcels = label(mInj/averageParcelMass_ + 0.49);
return nParcels; return nParcels;
} }
@ -219,7 +220,7 @@ Foam::vector Foam::unitInjector::position
{ {
// otherwise, disc injection // otherwise, disc injection
scalar iRadius = d_*rndGen.scalar01(); scalar iRadius = d_*rndGen.scalar01();
scalar iAngle = 2.0*mathematicalConstant::pi*rndGen.scalar01(); scalar iAngle = constant::math::twoPi*rndGen.scalar01();
return return
( (
@ -230,7 +231,6 @@ Foam::vector Foam::unitInjector::position
+ tangentialInjectionVector2_*sin(iAngle) + tangentialInjectionVector2_*sin(iAngle)
) )
); );
} }
return position_; return position_;
@ -267,12 +267,13 @@ Foam::scalar Foam::unitInjector::mass
const scalar angleOfWedge const scalar angleOfWedge
) const ) const
{ {
scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); scalar mInj =
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
// correct mass if calculation is 2D // correct mass if calculation is 2D
if (twoD) if (twoD)
{ {
mInj *= 0.5*angleOfWedge/mathematicalConstant::pi; mInj *= 0.5*angleOfWedge/constant::math::pi;
} }
return mInj; return mInj;
@ -363,7 +364,7 @@ void Foam::unitInjector::correctProfiles
const scalar referencePressure 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 pDummy = 1.0e+5;
forAll(velocityProfile_, i) forAll(velocityProfile_, i)

View File

@ -109,16 +109,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from components
unitInjector unitInjector(const Time& t, const dictionary& dict);
(
const Time& t,
const dictionary& dict
);
// Destructor //- Destructor
virtual ~unitInjector();
~unitInjector();
// Member Functions // Member Functions
@ -226,7 +221,6 @@ public:
{ {
return pressureIndependentVelocity_; return pressureIndependentVelocity_;
} }
}; };

View File

@ -459,7 +459,6 @@ void Foam::parcel::updateParcelProperties
scalar Tnew = T(); scalar Tnew = T();
// NN.
// first calculate the new temperature and droplet mass, // first calculate the new temperature and droplet mass,
// then calculate the energy source and correct the // then calculate the energy source and correct the
// gaseous temperature, Tg, and mass fraction, Yfg, // gaseous temperature, Tg, and mass fraction, Yfg,

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "parcel.H" #include "parcel.H"
#include "mathematicalConstants.H" #include "mathConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -102,13 +102,13 @@ scalar parcel::Pr
scalar parcel::N(const scalar rho) const 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 scalar parcel::Vd() const
{ {
return pow(d_, 3.0)*mathematicalConstant::pi/6.0; return pow3(d_)*constant::math::pi/6.0;
} }

Some files were not shown because too many files have changed in this diff Show More