mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: more consistent use of dimensioned Zero, scalar decimal points
- use scalar(0) instead of scalar(0.0) etc
This commit is contained in:
@ -142,10 +142,10 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
|
||||
|
||||
const scalarField upLocal(uPrimeCoef*sqrt((U & CT & U)*cellWidth));
|
||||
|
||||
const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
|
||||
const scalarField deltaUp(upLocal*(max(scalar(1), pow(nr, 0.5)) - 1.0));
|
||||
|
||||
// Re use tN
|
||||
N.primitiveFieldRef() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
|
||||
N.primitiveFieldRef() = upLocal*(max(scalar(1), pow(nr, 0.5)) - 1.0);
|
||||
|
||||
return tN;
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ License
|
||||
rDeltaT = max
|
||||
(
|
||||
rDeltaT,
|
||||
(scalar(1.0) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -120,7 +120,7 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
||||
else
|
||||
{
|
||||
this->refValue() = *this;
|
||||
this->valueFraction() = scalar(1.0);
|
||||
this->valueFraction() = scalar(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
solidRegions[i],
|
||||
dimensionedScalar("1", dimless, scalar(1.0))
|
||||
dimensionedScalar("1", dimless, scalar(1))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ if (mesh.changing())
|
||||
pcorrEqn.setReferences
|
||||
(
|
||||
validCells,
|
||||
scalar(0.0),
|
||||
scalar(0),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ License
|
||||
rDeltaT = max
|
||||
(
|
||||
rDeltaT,
|
||||
(scalar(1.0) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -121,7 +121,7 @@ License
|
||||
rDeltaT = max
|
||||
(
|
||||
rDeltaT,
|
||||
(scalar(1.0) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@
|
||||
rDeltaT = max
|
||||
(
|
||||
rDeltaT,
|
||||
(scalar(1.0) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
|
||||
);
|
||||
|
||||
Info<< "Damped flow time scale min/max = "
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimless/dimTime, 0.0)
|
||||
dimensionedScalar(dimless/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
Sps.set
|
||||
@ -40,7 +40,7 @@
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimless/dimTime, 0.0)
|
||||
dimensionedScalar(dimless/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::getSpecieMassFraction
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimless, 0),
|
||||
dimensionedScalar(dimless, Zero),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
)
|
||||
);
|
||||
@ -126,7 +126,7 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::getSpecieMassFraction
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimless, 1),
|
||||
dimensionedScalar("one", dimless, 1),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
)
|
||||
);
|
||||
@ -251,7 +251,7 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::D
|
||||
p.mesh()
|
||||
),
|
||||
p.mesh(),
|
||||
dimensionedScalar("zero", dimArea/dimTime, 0)
|
||||
dimensionedScalar(dimArea/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
@ -297,7 +297,7 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::L
|
||||
p.mesh()
|
||||
),
|
||||
p.mesh(),
|
||||
dimensionedScalar("zero", dimEnergy/dimMass, 0),
|
||||
dimensionedScalar(dimEnergy/dimMass, Zero),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
)
|
||||
);
|
||||
|
||||
@ -166,7 +166,7 @@ Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimDensity, 0)
|
||||
dimensionedScalar(dimDensity, Zero)
|
||||
)
|
||||
);
|
||||
volScalarField& rhom = tRhom.ref();
|
||||
@ -184,7 +184,7 @@ Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimTemperature, 0)
|
||||
dimensionedScalar(dimTemperature, Zero)
|
||||
)
|
||||
);
|
||||
volScalarField& tDelta = tTdelta.ref();
|
||||
@ -198,7 +198,7 @@ Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>
|
||||
tDelta = max
|
||||
(
|
||||
(T*Tmask - Tactivate_),
|
||||
dimensionedScalar("T0", dimTemperature, 0.0)
|
||||
dimensionedScalar("T0", dimTemperature, Zero)
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -210,7 +210,7 @@ Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>
|
||||
tDelta = max
|
||||
(
|
||||
Tmask*(Tactivate_ - T),
|
||||
dimensionedScalar("T0", dimTemperature, 0.0)
|
||||
dimensionedScalar("T0", dimTemperature, Zero)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::MassTransferPhaseSystem
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar("zero", dimDensity/dimTime, 0)
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -95,7 +95,7 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::calculateL
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar("zero", dimEnergy/dimMass, 0)
|
||||
dimensionedScalar(dimEnergy/dimMass, Zero)
|
||||
)
|
||||
);
|
||||
volScalarField& L = tL.ref();
|
||||
@ -155,7 +155,7 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::dmdt
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar("zero", dimDensity/dimTime, 0)
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
@ -221,12 +221,7 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::heatTransfer
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar
|
||||
(
|
||||
"zero",
|
||||
dimDensity/dimTime,
|
||||
0
|
||||
)
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
volScalarField& dmdtNetki = tdmdtNetki.ref();
|
||||
|
||||
@ -60,7 +60,7 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel
|
||||
fluid.mesh()
|
||||
),
|
||||
fluid.mesh(),
|
||||
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0)
|
||||
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
|
||||
)
|
||||
{}
|
||||
|
||||
@ -127,7 +127,7 @@ diffNo() const
|
||||
U_.mesh()
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar("0", dimless, 0.0)
|
||||
dimensionedScalar(dimless, Zero)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ Foam::StaticPhaseModel<BasePhaseModel>::StaticPhaseModel
|
||||
fluid.mesh()
|
||||
),
|
||||
fluid.mesh(),
|
||||
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0)
|
||||
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
|
||||
),
|
||||
alphaPhi_
|
||||
(
|
||||
@ -63,7 +63,7 @@ Foam::StaticPhaseModel<BasePhaseModel>::StaticPhaseModel
|
||||
fluid.mesh()
|
||||
),
|
||||
fluid.mesh(),
|
||||
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0)
|
||||
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
|
||||
)
|
||||
{}
|
||||
|
||||
@ -90,7 +90,7 @@ Foam::StaticPhaseModel<BasePhaseModel>::phi() const
|
||||
U_.mesh()
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0)
|
||||
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
|
||||
);
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ template<class BasePhaseModel>
|
||||
const Foam::surfaceScalarField&
|
||||
Foam::StaticPhaseModel<BasePhaseModel>::phi()
|
||||
{
|
||||
phi_ = dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0);
|
||||
phi_ = dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero);
|
||||
return phi_;
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ Foam::StaticPhaseModel<BasePhaseModel>::alphaPhi() const
|
||||
U_.mesh()
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0)
|
||||
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -129,7 +129,7 @@ template<class BasePhaseModel>
|
||||
Foam::surfaceScalarField&
|
||||
Foam::StaticPhaseModel<BasePhaseModel>::alphaPhi()
|
||||
{
|
||||
alphaPhi_ = dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0);
|
||||
alphaPhi_ = dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero);
|
||||
return alphaPhi_;
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ Foam::StaticPhaseModel<BasePhaseModel>::U() const
|
||||
U_.mesh()
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedVector("zero", dimVelocity, vector::zero)
|
||||
dimensionedVector(dimVelocity, Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ Foam::phaseSystem::phaseSystem
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", dimVolume/dimTime, 0.0)
|
||||
dimensionedScalar(dimVolume/dimTime, Zero)
|
||||
),
|
||||
rhoPhi_
|
||||
(
|
||||
@ -234,7 +234,7 @@ Foam::phaseSystem::phaseSystem
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", dimMass/dimTime, 0.0)
|
||||
dimensionedScalar(dimMass/dimTime, Zero)
|
||||
),
|
||||
phaseModels_(generatePhaseModels(phaseNames_)),
|
||||
phasePairs_(),
|
||||
@ -945,12 +945,7 @@ Foam::phaseSystem::surfaceTensionForce() const
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar
|
||||
(
|
||||
"surfaceTensionForce",
|
||||
dimensionSet(1, -2, -2, 0, 0),
|
||||
0.0
|
||||
)
|
||||
dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), Zero)
|
||||
)
|
||||
);
|
||||
|
||||
@ -1118,7 +1113,7 @@ Foam::tmp<Foam::volScalarField> Foam::phaseSystem::nearInterface() const
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", dimless, 0.0)
|
||||
dimensionedScalar(dimless, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -355,7 +355,7 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::rho
|
||||
|
||||
return
|
||||
(
|
||||
alpha1p*rho1().value() + (scalar(1.0) - alpha1p)*rho2().value()
|
||||
alpha1p*rho1().value() + (scalar(1) - alpha1p)*rho2().value()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
pcorrEqn.setReferences
|
||||
(
|
||||
validCells,
|
||||
scalar(0.0),
|
||||
scalar(0),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
@ -129,9 +129,9 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::linear::f1
|
||||
(
|
||||
(phase1 - maxFullAlpha)
|
||||
/(maxPartAlpha - maxFullAlpha + SMALL),
|
||||
scalar(0.0)
|
||||
scalar(0)
|
||||
),
|
||||
scalar(1.0)
|
||||
scalar(1)
|
||||
);
|
||||
}
|
||||
|
||||
@ -154,9 +154,9 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::linear::f2
|
||||
(
|
||||
(maxPartAlpha - phase2)
|
||||
/(maxPartAlpha - maxFullAlpha + SMALL),
|
||||
scalar(0.0)
|
||||
scalar(0)
|
||||
),
|
||||
scalar(1.0)
|
||||
scalar(1)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ scalar getMergeDistance
|
||||
args.readIfPresent("mergeTol", mergeTol);
|
||||
|
||||
scalar writeTol =
|
||||
Foam::pow(scalar(10.0), -scalar(IOstream::defaultPrecision()));
|
||||
Foam::pow(scalar(10), -scalar(IOstream::defaultPrecision()));
|
||||
|
||||
Info<< "Merge tolerance : " << mergeTol << nl
|
||||
<< "Write tolerance : " << writeTol << endl;
|
||||
|
||||
@ -554,7 +554,7 @@ scalar getMergeDistance(const polyMesh& mesh, const scalar mergeTol)
|
||||
{
|
||||
const scalar writeTol = std::pow
|
||||
(
|
||||
scalar(10.0),
|
||||
scalar(10),
|
||||
-scalar(IOstream::defaultPrecision())
|
||||
);
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ void Foam::writeFields
|
||||
(
|
||||
radToDeg
|
||||
(
|
||||
Foam::acos(min(scalar(1.0), faceOrthogonality))
|
||||
Foam::acos(min(scalar(1), faceOrthogonality))
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@ scalar getMergeDistance
|
||||
args.readIfPresent("mergeTol", mergeTol);
|
||||
|
||||
const scalar writeTol =
|
||||
Foam::pow(scalar(10.0), -scalar(IOstream::defaultPrecision()));
|
||||
Foam::pow(scalar(10), -scalar(IOstream::defaultPrecision()));
|
||||
|
||||
Info<< "Merge tolerance : " << mergeTol << nl
|
||||
<< "Write tolerance : " << writeTol << endl;
|
||||
|
||||
Reference in New Issue
Block a user