STYLE: use degToRad() instead of pi/180

This commit is contained in:
Mark Olesen
2019-04-26 11:48:27 +02:00
committed by Andrew Heather
parent 5f40a738d3
commit e1609d16d1
16 changed files with 60 additions and 79 deletions

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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation | Copyright (C) 2011-2017 OpenFOAM Foundation
@ -27,7 +27,7 @@ License
#include "JohnsonJacksonFrictionalStress.H" #include "JohnsonJacksonFrictionalStress.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -66,7 +66,7 @@ JohnsonJackson
phi_("phi", dimless, coeffDict_), phi_("phi", dimless, coeffDict_),
alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_) alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_)
{ {
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
} }
@ -139,7 +139,7 @@ bool Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::read()
p_.read(coeffDict_); p_.read(coeffDict_);
phi_.read(coeffDict_); phi_.read(coeffDict_);
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
alphaDeltaMin_.read(coeffDict_); alphaDeltaMin_.read(coeffDict_);

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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2016-2017 OpenFOAM Foundation | Copyright (C) 2016-2017 OpenFOAM Foundation
@ -27,7 +27,7 @@ License
#include "JohnsonJacksonSchaefferFrictionalStress.H" #include "JohnsonJacksonSchaefferFrictionalStress.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -66,7 +66,7 @@ JohnsonJacksonSchaeffer::JohnsonJacksonSchaeffer
phi_("phi", dimless, coeffDict_), phi_("phi", dimless, coeffDict_),
alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_) alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_)
{ {
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
} }
@ -199,7 +199,7 @@ JohnsonJacksonSchaeffer::read()
p_.read(coeffDict_); p_.read(coeffDict_);
phi_.read(coeffDict_); phi_.read(coeffDict_);
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
alphaDeltaMin_.read(coeffDict_); alphaDeltaMin_.read(coeffDict_);

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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation | Copyright (C) 2011-2017 OpenFOAM Foundation
@ -27,6 +27,7 @@ License
#include "SchaefferFrictionalStress.H" #include "SchaefferFrictionalStress.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -60,7 +61,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::Schaeffer
coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), coeffDict_(dict.optionalSubDict(typeName + "Coeffs")),
phi_("phi", dimless, coeffDict_) phi_("phi", dimless, coeffDict_)
{ {
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
} }
@ -183,7 +184,7 @@ bool Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::read()
coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs");
phi_.read(coeffDict_); phi_.read(coeffDict_);
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
return true; return true;
} }

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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation | Copyright (C) 2011-2017 OpenFOAM Foundation
@ -27,7 +27,7 @@ License
#include "JohnsonJacksonFrictionalStress.H" #include "JohnsonJacksonFrictionalStress.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -66,7 +66,7 @@ JohnsonJackson
phi_("phi", dimless, coeffDict_), phi_("phi", dimless, coeffDict_),
alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_) alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_)
{ {
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
} }
@ -139,7 +139,7 @@ bool Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::read()
p_.read(coeffDict_); p_.read(coeffDict_);
phi_.read(coeffDict_); phi_.read(coeffDict_);
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
alphaDeltaMin_.read(coeffDict_); alphaDeltaMin_.read(coeffDict_);

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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2016-2017 OpenFOAM Foundation | Copyright (C) 2016-2017 OpenFOAM Foundation
@ -27,7 +27,7 @@ License
#include "JohnsonJacksonSchaefferFrictionalStress.H" #include "JohnsonJacksonSchaefferFrictionalStress.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -66,7 +66,7 @@ JohnsonJacksonSchaeffer::JohnsonJacksonSchaeffer
phi_("phi", dimless, coeffDict_), phi_("phi", dimless, coeffDict_),
alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_) alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_)
{ {
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
} }
@ -199,7 +199,7 @@ JohnsonJacksonSchaeffer::read()
p_.read(coeffDict_); p_.read(coeffDict_);
phi_.read(coeffDict_); phi_.read(coeffDict_);
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
alphaDeltaMin_.read(coeffDict_); alphaDeltaMin_.read(coeffDict_);

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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation | Copyright (C) 2011-2017 OpenFOAM Foundation
@ -27,6 +27,7 @@ License
#include "SchaefferFrictionalStress.H" #include "SchaefferFrictionalStress.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -60,7 +61,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::Schaeffer
coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), coeffDict_(dict.optionalSubDict(typeName + "Coeffs")),
phi_("phi", dimless, coeffDict_) phi_("phi", dimless, coeffDict_)
{ {
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
} }
@ -183,7 +184,7 @@ bool Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::read()
coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs");
phi_.read(coeffDict_); phi_.read(coeffDict_);
phi_ *= constant::mathematical::pi/180.0; phi_ *= degToRad();
return true; return true;
} }

View File

@ -199,13 +199,13 @@ int main(int argc, char *argv[])
<< Ra << Ra
( (
axisAngle.first() / mag(axisAngle.first()), axisAngle.first() / mag(axisAngle.first()),
axisAngle.second() * constant::mathematical::pi/180.0 degToRad(axisAngle.second())
) << nl; ) << nl;
Info<< "-ve Ra = " Info<< "-ve Ra = "
<< Ra << Ra
( (
axisAngle.first() / mag(axisAngle.first()), axisAngle.first() / mag(axisAngle.first()),
-axisAngle.second() * constant::mathematical::pi/180.0 degToRad(-axisAngle.second())
) << nl; ) << nl;
} }

View File

@ -73,10 +73,9 @@ Usage
#include "pointFields.H" #include "pointFields.H"
#include "transformField.H" #include "transformField.H"
#include "transformGeometricField.H" #include "transformGeometricField.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
using namespace Foam; using namespace Foam;
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -310,7 +309,7 @@ int main(int argc, char *argv[])
const quaternion quat const quaternion quat
( (
axisAngle.first(), axisAngle.first(),
axisAngle.second() * pi/180.0 // degToRad degToRad(axisAngle.second())
); );
Info<< "Rotating points by quaternion " << quat << endl; Info<< "Rotating points by quaternion " << quat << endl;
@ -328,8 +327,7 @@ int main(int argc, char *argv[])
<< " pitch " << v.y() << nl << " pitch " << v.y() << nl
<< " yaw " << v.z() << nl; << " yaw " << v.z() << nl;
// degToRad v *= degToRad();
v *= pi/180.0;
const quaternion quat(quaternion::rotationSequence::XYZ, v); const quaternion quat(quaternion::rotationSequence::XYZ, v);
@ -348,8 +346,7 @@ int main(int argc, char *argv[])
<< " pitch " << v.y() << nl << " pitch " << v.y() << nl
<< " roll " << v.z() << nl; << " roll " << v.z() << nl;
// degToRad v *= degToRad();
v *= pi/180.0;
const quaternion quat(quaternion::rotationSequence::ZYX, v); const quaternion quat(quaternion::rotationSequence::ZYX, v);

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) 2017 OpenCFD Ltd. \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation | Copyright (C) 2011-2016 OpenFOAM Foundation
@ -49,12 +49,11 @@ Description
#include "Pair.H" #include "Pair.H"
#include "Tuple2.H" #include "Tuple2.H"
#include "quaternion.H" #include "quaternion.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
#include "MeshedSurfaces.H" #include "MeshedSurfaces.H"
using namespace Foam; using namespace Foam;
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -200,7 +199,7 @@ int main(int argc, char *argv[])
const quaternion quat const quaternion quat
( (
axisAngle.first(), axisAngle.first(),
axisAngle.second() * pi/180.0 // degToRad degToRad(axisAngle.second())
); );
Info<< "Rotating points by quaternion " << quat << endl; Info<< "Rotating points by quaternion " << quat << endl;
@ -213,8 +212,7 @@ int main(int argc, char *argv[])
<< " pitch " << v.y() << nl << " pitch " << v.y() << nl
<< " yaw " << v.z() << nl; << " yaw " << v.z() << nl;
// degToRad v *= degToRad();
v *= pi/180.0;
const quaternion quat(quaternion::rotationSequence::XYZ, v); const quaternion quat(quaternion::rotationSequence::XYZ, v);
@ -228,8 +226,7 @@ int main(int argc, char *argv[])
<< " pitch " << v.y() << nl << " pitch " << v.y() << nl
<< " roll " << v.z() << nl; << " roll " << v.z() << nl;
// degToRad v *= degToRad();
v *= pi/180.0;
const quaternion quat(quaternion::rotationSequence::ZYX, v); const quaternion quat(quaternion::rotationSequence::ZYX, v);

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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation | Copyright (C) 2011-2016 OpenFOAM Foundation
@ -27,9 +27,7 @@ License
#include "oscillatingRotatingMotion.H" #include "oscillatingRotatingMotion.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -81,7 +79,7 @@ transformation() const
vector eulerAngles = amplitude_*sin(omega_*t); vector eulerAngles = amplitude_*sin(omega_*t);
// Convert the rotational motion from deg to rad // Convert the rotational motion from deg to rad
eulerAngles *= pi/180.0; eulerAngles *= degToRad();
quaternion R(quaternion::XYZ, eulerAngles); quaternion R(quaternion::XYZ, eulerAngles);
septernion TR(septernion(-origin_)*R*septernion(origin_)); septernion TR(septernion(-origin_)*R*septernion(origin_));

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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation | Copyright (C) 2011-2016 OpenFOAM Foundation
@ -30,9 +30,8 @@ License
#include "Tuple2.H" #include "Tuple2.H"
#include "IFstream.H" #include "IFstream.H"
#include "interpolateSplineXY.H" #include "interpolateSplineXY.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -104,7 +103,7 @@ Foam::solidBodyMotionFunctions::tabulated6DoFMotion::transformation() const
); );
// Convert the rotational motion from deg to rad // Convert the rotational motion from deg to rad
TRV[1] *= pi/180.0; TRV[1] *= degToRad();
quaternion R(quaternion::XYZ, TRV[1]); quaternion R(quaternion::XYZ, TRV[1]);
septernion TR(septernion(-CofG_ + -TRV[0])*R*septernion(CofG_)); septernion TR(septernion(-CofG_ + -TRV[0])*R*septernion(CofG_));

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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation | Copyright (C) 2011-2017 OpenFOAM Foundation
@ -185,7 +185,7 @@ void Foam::ParticleErosion<CloudType>::postPatch
const vector Udir = U/magU; const vector Udir = U/magU;
// determine impact angle, alpha // determine impact angle, alpha
const scalar alpha = mathematical::pi/2.0 - acos(nw & Udir); const scalar alpha = mathematical::piByTwo - acos(nw & Udir);
const scalar coeff = p.nParticle()*p.mass()*sqr(magU)/(p_*psi_*K_); const scalar coeff = p.nParticle()*p.mass()*sqr(magU)/(p_*psi_*K_);

View File

@ -27,7 +27,7 @@ License
#include "ConeNozzleInjection.H" #include "ConeNozzleInjection.H"
#include "TimeFunction1.H" #include "TimeFunction1.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
#include "distributionModel.H" #include "distributionModel.H"
using namespace Foam::constant; using namespace Foam::constant;
@ -417,14 +417,11 @@ void Foam::ConeNozzleInjection<CloudType>::setProperties
Random& rndGen = this->owner().rndGen(); Random& rndGen = this->owner().rndGen();
// Set particle velocity // Set particle velocity
const scalar deg2Rad = mathematical::pi/180.0;
scalar t = time - this->SOI_; scalar t = time - this->SOI_;
scalar ti = thetaInner_.value(t); scalar ti = thetaInner_.value(t);
scalar to = thetaOuter_.value(t); scalar to = thetaOuter_.value(t);
scalar coneAngle = rndGen.sample01<scalar>()*(to - ti) + ti; scalar coneAngle = degToRad(rndGen.sample01<scalar>()*(to - ti) + ti);
coneAngle *= deg2Rad;
scalar alpha = sin(coneAngle); scalar alpha = sin(coneAngle);
scalar dcorr = cos(coneAngle); scalar dcorr = cos(coneAngle);

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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation | Copyright (C) 2011-2017 OpenFOAM Foundation
@ -27,7 +27,7 @@ License
#include "ThermoSurfaceFilm.H" #include "ThermoSurfaceFilm.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
#include "Pstream.H" #include "Pstream.H"
using namespace Foam::constant::mathematical; using namespace Foam::constant::mathematical;
@ -114,7 +114,7 @@ Foam::vector Foam::ThermoSurfaceFilm<CloudType>::splashDirection
const scalar phiSi = twoPi*rndGen_.sample01<scalar>(); const scalar phiSi = twoPi*rndGen_.sample01<scalar>();
// Ejection angle [rad] // Ejection angle [rad]
const scalar thetaSi = pi/180.0*(rndGen_.sample01<scalar>()*(50 - 5) + 5); const scalar thetaSi = degToRad(rndGen_.sample01<scalar>()*(50 - 5) + 5);
// Direction vector of new parcel // Direction vector of new parcel
const scalar alpha = sin(thetaSi); const scalar alpha = sin(thetaSi);
@ -311,7 +311,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::wetSplashInteraction
else if ((We >= 2) && (We < 20)) // Bounce else if ((We >= 2) && (We < 20)) // Bounce
{ {
// Incident angle of impingement // Incident angle of impingement
const scalar theta = pi/2 - acos(U/mag(U) & nf); const scalar theta = piByTwo - acos(U/mag(U) & nf);
// Restitution coefficient // Restitution coefficient
const scalar epsilon = 0.993 - theta*(1.76 - theta*(1.56 - theta*0.49)); const scalar epsilon = 0.993 - theta*(1.76 - theta*(1.56 - theta*0.49));

View File

@ -27,9 +27,7 @@ License
#include "moleculeCloud.H" #include "moleculeCloud.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -610,11 +608,9 @@ void Foam::moleculeCloud::initialiseMolecules
zoneDict.get<vector>("orientationAngles") zoneDict.get<vector>("orientationAngles")
); );
scalar phi(orientationAngles.x()*pi/180.0); const scalar phi(degToRad(orientationAngles.x()));
const scalar theta(degToRad(orientationAngles.y()));
scalar theta(orientationAngles.y()*pi/180.0); const scalar psi(degToRad(orientationAngles.z()));
scalar psi(orientationAngles.z()*pi/180.0);
const tensor R const tensor R
( (
@ -984,11 +980,9 @@ void Foam::moleculeCloud::createMolecule
{ {
pi = equipartitionAngularMomentum(temperature, cP); pi = equipartitionAngularMomentum(temperature, cP);
scalar phi(rndGen_.sample01<scalar>()*twoPi); const scalar phi(rndGen_.sample01<scalar>()*mathematical::twoPi);
const scalar theta(rndGen_.sample01<scalar>()*mathematical::twoPi);
scalar theta(rndGen_.sample01<scalar>()*twoPi); const scalar psi(rndGen_.sample01<scalar>()*mathematical::twoPi);
scalar psi(rndGen_.sample01<scalar>()*twoPi);
Q = tensor Q = tensor
( (

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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation | Copyright (C) 2011-2016 OpenFOAM Foundation
@ -32,7 +32,7 @@ License
#include "polyMesh.H" #include "polyMesh.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "word.H" #include "word.H"
#include "mathematicalConstants.H" #include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -72,7 +72,7 @@ void Foam::circleSet::calcSamples
} }
// Add remaining points // Add remaining points
const scalar alpha = constant::mathematical::pi/180.0*dTheta_; const scalar alpha = degToRad(dTheta_);
const scalar sinAlpha = sin(alpha); const scalar sinAlpha = sin(alpha);
const scalar cosAlpha = cos(alpha); const scalar cosAlpha = cos(alpha);
@ -107,10 +107,7 @@ void Foam::circleSet::calcSamples
samplingCells.append(celli); samplingCells.append(celli);
samplingFaces.append(-1); samplingFaces.append(-1);
samplingSegments.append(nPoint); samplingSegments.append(nPoint);
samplingCurveDist.append samplingCurveDist.append(radius*degToRad(theta));
(
radius*constant::mathematical::pi/180.0*theta
);
++nPoint; ++nPoint;
} }