OpenFOAM: Rationalized the naming of scalar limits

In early versions of OpenFOAM the scalar limits were simple macro replacements and the
names were capitalized to indicate this.  The scalar limits are now static
constants which is a huge improvement on the use of macros and for consistency
the names have been changed to camel-case to indicate this and improve
readability of the code:

    GREAT -> great
    ROOTGREAT -> rootGreat
    VGREAT -> vGreat
    ROOTVGREAT -> rootVGreat
    SMALL -> small
    ROOTSMALL -> rootSmall
    VSMALL -> vSmall
    ROOTVSMALL -> rootVSmall

The original capitalized are still currently supported but their use is
deprecated.
This commit is contained in:
Henry Weller
2018-01-25 09:46:37 +00:00
parent 2c882ab4a7
commit fc2b2d0c05
729 changed files with 2822 additions and 2809 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -291,7 +291,7 @@ Foam::functionObjects::fieldAverage::fieldAverage
restartOnRestart_(false),
restartOnOutput_(false),
periodicRestart_(false),
restartPeriod_(GREAT),
restartPeriod_(great),
initialised_(false),
faItems_(),
totalIter_(),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -338,7 +338,7 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::combineMeshGeometry
bool hasMerged = mergePoints
(
points,
SMALL,
small,
false,
oldToNew,
newPoints
@ -614,7 +614,7 @@ processValues
case opSumDirection:
{
vector n(dict_.lookup("direction"));
n /= mag(n) + ROOTVSMALL;
n /= mag(n) + rootVSmall;
const scalarField nv(n & values);
return sum(pos0(nv)*n*(nv));
@ -622,7 +622,7 @@ processValues
case opSumDirectionBalance:
{
vector n(dict_.lookup("direction"));
n /= mag(n) + ROOTVSMALL;
n /= mag(n) + rootVSmall;
const scalarField nv(n & values);
return sum(pos0(nv)*n*(nv));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,7 +57,7 @@ bool Foam::functionObjects::flowType::calc()
volScalarField magD(mag(symm(gradU)));
volScalarField magOmega (mag(skew(gradU)));
dimensionedScalar smallMagD("smallMagD", magD.dimensions(), SMALL);
dimensionedScalar smallMagD("smallMagD", magD.dimensions(), small);
const volTensorField SSplusWW
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -175,7 +175,7 @@ bool Foam::functionObjects::histogram::write()
{
const scalar sumVol = sum(volFrac);
if (sumVol > SMALL)
if (sumVol > small)
{
volFrac /= sumVol;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -83,7 +83,7 @@ void Foam::functionObjects::interfaceHeight::writePositions()
);
// Find the height of the location above the boundary
scalar hLB = set.size() ? - gHat & (locations_[li] - set[0]) : - VGREAT;
scalar hLB = set.size() ? - gHat & (locations_[li] - set[0]) : - vGreat;
reduce(hLB, maxOp<scalar>());
// Calculate the integrals of length and length*alpha along the sampling

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -144,7 +144,7 @@ Foam::functionObjects::pressure::coeff
pCoeff -= dimensionedScalar("pInf", dimPressure, pInf_);
const dimensionedScalar pSmall("pSmall", dimPressure, SMALL);
const dimensionedScalar pSmall("pSmall", dimPressure, small);
const dimensionedVector U("U", dimVelocity, UInf_);
const dimensionedScalar rho("rho", dimDensity, rhoInf_);
@ -243,7 +243,7 @@ bool Foam::functionObjects::pressure::read(const dictionary& dict)
scalar zeroCheck = 0.5*rhoInf_*magSqr(UInf_) + pInf_;
if (mag(zeroCheck) < ROOTVSMALL)
if (mag(zeroCheck) < rootVSmall)
{
WarningInFunction
<< type() << " " << name() << ": "

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -125,7 +125,7 @@ Foam::tmp<Foam::pointScalarField> Foam::functionObjects::streamFunction::calc
{
if
(
magSqr(phi.boundaryField()[patchi][facei]) < SMALL
magSqr(phi.boundaryField()[patchi][facei]) < small
)
{
const labelList& zeroPoints = bouFaces[facei];
@ -270,7 +270,7 @@ Foam::tmp<Foam::pointScalarField> Foam::functionObjects::streamFunction::calc
vector nHat = unitAreas[facei];
if (edgeHat.y() > VSMALL)
if (edgeHat.y() > vSmall)
{
visitedPoint[curBPoints[pointi]] = 1;
nVisited++;
@ -280,7 +280,7 @@ Foam::tmp<Foam::pointScalarField> Foam::functionObjects::streamFunction::calc
+ phi.boundaryField()[patchNo][faceNo]
*sign(nHat.x());
}
else if (edgeHat.y() < -VSMALL)
else if (edgeHat.y() < -vSmall)
{
visitedPoint[curBPoints[pointi]] = 1;
nVisited++;
@ -292,7 +292,7 @@ Foam::tmp<Foam::pointScalarField> Foam::functionObjects::streamFunction::calc
}
else
{
if (edgeHat.x() > VSMALL)
if (edgeHat.x() > vSmall)
{
visitedPoint[curBPoints[pointi]] = 1;
nVisited++;
@ -302,7 +302,7 @@ Foam::tmp<Foam::pointScalarField> Foam::functionObjects::streamFunction::calc
+ phi.boundaryField()[patchNo][faceNo]
*sign(nHat.y());
}
else if (edgeHat.x() < -VSMALL)
else if (edgeHat.x() < -vSmall)
{
visitedPoint[curBPoints[pointi]] = 1;
nVisited++;
@ -363,7 +363,7 @@ Foam::tmp<Foam::pointScalarField> Foam::functionObjects::streamFunction::calc
vector nHat = unitAreas[facei];
if (edgeHat.y() > VSMALL)
if (edgeHat.y() > vSmall)
{
visitedPoint[curPoints[pointi]] = 1;
nVisited++;
@ -372,7 +372,7 @@ Foam::tmp<Foam::pointScalarField> Foam::functionObjects::streamFunction::calc
currentStream
+ phi[facei]*sign(nHat.x());
}
else if (edgeHat.y() < -VSMALL)
else if (edgeHat.y() < -vSmall)
{
visitedPoint[curPoints[pointi]] = 1;
nVisited++;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -267,9 +267,9 @@ void Foam::functionObjects::streamLine::track()
);
// Set very large dt. Note: cannot use GREAT since 1/GREAT is SMALL
// Set very large dt. Note: cannot use great since 1/great is small
// which is a trigger value for the tracking...
const scalar trackTime = Foam::sqrt(GREAT);
const scalar trackTime = Foam::sqrt(great);
// Track
particles.move(particles, td, trackTime);
@ -348,7 +348,7 @@ bool Foam::functionObjects::streamLine::read(const dictionary& dict)
nSubCycle_ = 1;
if (dict.readIfPresent("nSubCycle", nSubCycle_))
{
trackLength_ = VGREAT;
trackLength_ = vGreat;
if (nSubCycle_ < 1)
{
nSubCycle_ = 1;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -178,7 +178,7 @@ bool Foam::streamLineParticle::move
scalar magU = mag(U);
if (magU < SMALL)
if (magU < small)
{
// Stagnant particle. Might as well stop
lifeTime_ = 0;
@ -187,7 +187,7 @@ bool Foam::streamLineParticle::move
U /= magU;
if (td.trackLength_ < GREAT)
if (td.trackLength_ < great)
{
// No sub-cycling. Track a set length on each step.
dt = td.trackLength_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -548,7 +548,7 @@ Foam::functionObjects::forces::forces
rhoName_(word::null),
directForceDensity_(false),
fDName_(""),
rhoRef_(VGREAT),
rhoRef_(vGreat),
pRef_(0),
coordSys_(),
localSystem_(false),
@ -556,7 +556,7 @@ Foam::functionObjects::forces::forces
nBin_(1),
binDir_(Zero),
binDx_(0.0),
binMin_(GREAT),
binMin_(great),
binPoints_(),
binCumulative_(true),
initialised_(false)
@ -583,7 +583,7 @@ Foam::functionObjects::forces::forces
rhoName_(word::null),
directForceDensity_(false),
fDName_(""),
rhoRef_(VGREAT),
rhoRef_(vGreat),
pRef_(0),
coordSys_(),
localSystem_(false),
@ -591,7 +591,7 @@ Foam::functionObjects::forces::forces
nBin_(1),
binDir_(Zero),
binDx_(0.0),
binMin_(GREAT),
binMin_(great),
binPoints_(),
binCumulative_(true),
initialised_(false)
@ -691,8 +691,8 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
binDict.lookup("direction") >> binDir_;
binDir_ /= mag(binDir_);
binMin_ = GREAT;
scalar binMax = -GREAT;
binMin_ = great;
scalar binMax = -great;
forAllConstIter(labelHashSet, patchSet_, iter)
{
label patchi = iter.key();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -130,7 +130,7 @@ bool Foam::functionObjects::dsmcFields::write()
fDMeanName
);
if (min(mag(rhoNMean)).value() > VSMALL)
if (min(mag(rhoNMean)).value() > vSmall)
{
Info<< "Calculating dsmcFields." << endl;