Rationalize the "pos" function

"pos" now returns 1 if the argument is greater than 0, otherwise it returns 0.
This is consistent with the common mathematical definition of the "pos" function:

https://en.wikipedia.org/wiki/Sign_(mathematics)

However the previous implementation in which 1 was also returned for a 0
argument is useful in many situations so the "pos0" has been added which returns
1 if the argument is greater or equal to 0.  Additionally the "neg0" has been
added which returns 1 if if the argument is less than or equal to 0.
This commit is contained in:
Henry Weller 2017-06-22 14:32:18 +01:00 committed by Andrew Heather
parent 639305e960
commit 56bfc75949
96 changed files with 269 additions and 196 deletions

View File

@ -73,8 +73,8 @@
rDeltaT.ref() = max
(
rDeltaT(),
pos(alpha1Bar() - alphaSpreadMin)
*pos(alphaSpreadMax - alpha1Bar())
pos0(alpha1Bar() - alphaSpreadMin)
*pos0(alphaSpreadMax - alpha1Bar())
*fvc::surfaceSum(mag(phi))()()
/((2*maxAlphaCo)*mesh.V())
);

View File

@ -183,8 +183,8 @@
solve(fvm::ddt(alpha1) + fvc::div(alphaPhi1));
// Create the diffusion coefficients for alpha2<->alpha3
volScalarField Dc23(D23*max(alpha3, scalar(0))*pos(alpha2));
volScalarField Dc32(D23*max(alpha2, scalar(0))*pos(alpha3));
volScalarField Dc23(D23*max(alpha3, scalar(0))*pos0(alpha2));
volScalarField Dc32(D23*max(alpha2, scalar(0))*pos0(alpha3));
// Add the diffusive flux for alpha3->alpha2
alphaPhi2 -= fvc::interpolate(Dc32)*mesh.magSf()*fvc::snGrad(alpha1);

View File

@ -214,8 +214,8 @@ Foam::threePhaseInterfaceProperties::nearInterface() const
{
return max
(
pos(mixture_.alpha1() - 0.01)*pos(0.99 - mixture_.alpha1()),
pos(mixture_.alpha2() - 0.01)*pos(0.99 - mixture_.alpha2())
pos0(mixture_.alpha1() - 0.01)*pos0(0.99 - mixture_.alpha1()),
pos0(mixture_.alpha2() - 0.01)*pos0(0.99 - mixture_.alpha2())
);
}

View File

@ -87,7 +87,7 @@ Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotP() const
return Pair<tmp<volScalarField>>
(
mcCoeff_*sqr(limitedAlpha1)*(1.0 - limitedAlpha1)
*pos(p - pSat())/max(p - pSat(), 0.01*pSat()),
*pos0(p - pSat())/max(p - pSat(), 0.01*pSat()),
(-mvCoeff_)*limitedAlpha1*neg(p - pSat())
);

View File

@ -83,7 +83,7 @@ Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotP() const
return Pair<tmp<volScalarField>>
(
mcCoeff_*(1.0 - limitedAlpha1)*pos(p - pSat()),
mcCoeff_*(1.0 - limitedAlpha1)*pos0(p - pSat()),
(-mvCoeff_)*limitedAlpha1*neg(p - pSat())
);
}

View File

@ -136,7 +136,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotP() const
return Pair<tmp<volScalarField>>
(
Cc_*(1.0 - limitedAlpha1)*pos(p - pSat())*apCoeff,
Cc_*(1.0 - limitedAlpha1)*pos0(p - pSat())*apCoeff,
(-Cv_)*(1.0 + alphaNuc() - limitedAlpha1)*neg(p - pSat())*apCoeff
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,13 +78,13 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::GidaspowErgunWenYu::K
volScalarField Cds
(
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
+ pos(Re - 1000)*0.44
+ pos0(Re - 1000)*0.44
);
// Wen and Yu (1966)
return
(
pos(alpha2 - 0.8)
pos0(alpha2 - 0.8)
*(0.75*Cds*phase2_.rho()*Ur*bp/d)
+ neg(alpha2 - 0.8)
*(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,7 +77,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::GidaspowSchillerNaumann::K
volScalarField Cds
(
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
+ pos(Re - 1000)*0.44
+ pos0(Re - 1000)*0.44
);
return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,7 +74,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::SchillerNaumann::K
volScalarField Cds
(
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
+ pos(Re - 1000)*0.44
+ pos0(Re - 1000)*0.44
);
return 0.75*Cds*phase2_.rho()*Ur/phase1_.d();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,7 +75,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::K
volScalarField B
(
neg(alpha2 - 0.85)*(0.8*pow(alpha2, 1.28))
+ pos(alpha2 - 0.85)*(pow(alpha2, 2.65))
+ pos0(alpha2 - 0.85)*(pow(alpha2, 2.65))
);
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,7 +77,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::WenYu::K
volScalarField Cds
(
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
+ pos(Re - 1000)*0.44
+ pos0(Re - 1000)*0.44
);
return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d();

View File

@ -846,7 +846,8 @@ Foam::multiphaseSystem::nearInterface() const
forAllConstIter(PtrDictionary<phaseModel>, phases_, iter)
{
tnearInt.ref() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
tnearInt.ref() =
max(tnearInt(), pos0(iter() - 0.01)*pos0(0.99 - iter()));
}
return tnearInt;

View File

@ -254,8 +254,8 @@
// dgdt =
// (
// pos(alpha2)*(pEqnComp2 & p)/rho2
// - pos(alpha1)*(pEqnComp1 & p)/rho1
// pos0(alpha2)*(pEqnComp2 & p)/rho2
// - pos0(alpha1)*(pEqnComp1 & p)/rho1
// );
p_rgh.relax();

View File

@ -548,7 +548,8 @@ Foam::multiphaseMixture::nearInterface() const
forAllConstIter(PtrDictionary<phase>, phases_, iter)
{
tnearInt.ref() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
tnearInt.ref() =
max(tnearInt(), pos0(iter() - 0.01)*pos0(0.99 - iter()));
}
return tnearInt;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,9 +71,9 @@ Foam::aspectRatioModels::VakhrushevEfremov::E() const
return
neg(Ta - scalar(1))*scalar(1)
+ pos(Ta - scalar(1))*neg(Ta - scalar(39.8))
+ pos0(Ta - scalar(1))*neg(Ta - scalar(39.8))
*pow3(0.81 + 0.206*tanh(1.6 - 2*log10(max(Ta, scalar(1)))))
+ pos(Ta - scalar(39.8))*0.24;
+ pos0(Ta - scalar(39.8))*0.24;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -84,7 +84,7 @@ Foam::tmp<Foam::volScalarField>
Foam::dragModels::GidaspowErgunWenYu::CdRe() const
{
return
pos(pair_.continuous() - 0.8)*WenYu_->CdRe()
pos0(pair_.continuous() - 0.8)*WenYu_->CdRe()
+ neg(pair_.continuous() - 0.8)*Ergun_->CdRe();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,7 +74,7 @@ Foam::dragModels::GidaspowSchillerNaumann::CdRe() const
volScalarField CdsRe
(
neg(Re - 1000)*24.0*(1.0 + 0.15*pow(Re, 0.687))/alpha2
+ pos(Re - 1000)*0.44*max(Re, residualRe_)
+ pos0(Re - 1000)*0.44*max(Re, residualRe_)
);
return

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -80,7 +80,7 @@ Foam::dragModels::IshiiZuber::CdRe() const
volScalarField ReM(Re*muc/muMix);
volScalarField CdRe
(
pos(1000 - ReM)*24.0*(scalar(1) + 0.15*pow(ReM, 0.687))
pos0(1000 - ReM)*24.0*(scalar(1) + 0.15*pow(ReM, 0.687))
+ neg(1000 - ReM)*0.44*ReM
);
@ -92,7 +92,7 @@ Foam::dragModels::IshiiZuber::CdRe() const
volScalarField CdReEllipse(Ealpha*0.6666*sqrt(Eo)*Re);
return
pos(CdReEllipse - CdRe)
pos0(CdReEllipse - CdRe)
*min(CdReEllipse, Re*sqr(1 - pair_.dispersed())*2.66667)
+ neg(CdReEllipse - CdRe)*CdRe;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,9 +66,9 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Lain::CdRe() const
return
neg(Re - 1.5)*16.0
+ pos(Re - 1.5)*neg(Re - 80.0)*14.9*pow(Re, 0.22)
+ pos(Re - 80.0)*neg(Re - 1500.0)*48*(1.0 - 2.21/sqrt(max(Re, SMALL)))
+ pos(Re - 1500.0)*2.61*Re;
+ pos0(Re - 1.5)*neg(Re - 80.0)*14.9*pow(Re, 0.22)
+ pos0(Re - 80.0)*neg(Re - 1500.0)*48*(1.0 - 2.21/sqrt(max(Re, SMALL)))
+ pos0(Re - 1500.0)*2.61*Re;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -67,7 +67,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::SchillerNaumann::CdRe() const
return
neg(Re - 1000)*24.0*(1.0 + 0.15*pow(Re, 0.687))
+ pos(Re - 1000)*0.44*max(Re, residualRe_);
+ pos0(Re - 1000)*0.44*max(Re, residualRe_);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,7 +71,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::CdRe() const
volScalarField B
(
neg(alpha2 - 0.85)*(0.8*pow(alpha2, 1.28))
+ pos(alpha2 - 0.85)*(pow(alpha2, 2.65))
+ pos0(alpha2 - 0.85)*(pow(alpha2, 2.65))
);
volScalarField Re(pair_.Re());
volScalarField Vr

View File

@ -79,7 +79,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Tenneti::CdRe() const
volScalarField CdReIsolated
(
neg(Res - 1000)*24.0*(1.0 + 0.15*pow(Res, 0.687))
+ pos(Res - 1000)*0.44*max(Res, residualRe_)
+ pos0(Res - 1000)*0.44*max(Res, residualRe_)
);
volScalarField F0

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -72,7 +72,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::WenYu::CdRe() const
volScalarField CdsRes
(
neg(Res - 1000)*24.0*(1.0 + 0.15*pow(Res, 0.687))
+ pos(Res - 1000)*0.44*max(Res, residualRe_)
+ pos0(Res - 1000)*0.44*max(Res, residualRe_)
);
return

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,8 +70,8 @@ Foam::tmp<Foam::volScalarField> Foam::liftModels::TomiyamaLift::Cl() const
return
neg(EoH - scalar(4))*min(0.288*tanh(0.121*pair_.Re()), f)
+ pos(EoH - scalar(4))*neg(EoH - scalar(10.7))*f
+ pos(EoH - scalar(10.7))*(-0.288);
+ pos0(EoH - scalar(4))*neg(EoH - scalar(10.7))*f
+ pos0(EoH - scalar(10.7))*(-0.288);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -80,9 +80,9 @@ Foam::tmp<Foam::volVectorField> Foam::wallLubricationModels::Frank::Fi() const
return zeroGradWalls
(
(
pos(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179)
+ pos(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187)
+ pos(Eo - 33.0)*0.179
pos0(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179)
+ pos0(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187)
+ pos0(Eo - 33.0)*0.179
)
*max
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,9 +78,9 @@ Foam::wallLubricationModels::TomiyamaWallLubrication::Fi() const
return zeroGradWalls
(
(
pos(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179)
+ pos(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187)
+ pos(Eo - 33.0)*0.179
pos0(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179)
+ pos0(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187)
+ pos0(Eo - 33.0)*0.179
)
*0.5
*pair_.dispersed().d()

View File

@ -379,8 +379,8 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
(
min
(
(pos(iDmdt)*he2 + neg(iDmdt)*hef2)
- (neg(iDmdt)*he1 + pos(iDmdt)*hef1),
(pos0(iDmdt)*he2 + neg(iDmdt)*hef2)
- (neg(iDmdt)*he1 + pos0(iDmdt)*hef1),
0.3*mag(hef2 - hef1)
)
);

View File

@ -598,7 +598,7 @@ Foam::multiphaseSystem::nearInterface() const
tnearInt.ref() = max
(
tnearInt(),
pos(phases()[phasei] - 0.01)*pos(0.99 - phases()[phasei])
pos0(phases()[phasei] - 0.01)*pos0(0.99 - phases()[phasei])
);
}

View File

@ -179,7 +179,7 @@ while (pimple.correct())
(
fvc::interpolate(fvc::average(alphafs[phasei]))
);
surfaceScalarField phiCorrCoeff(pos(alphafBar - 0.99));
surfaceScalarField phiCorrCoeff(pos0(alphafBar - 0.99));
surfaceScalarField::Boundary& phiCorrCoeffBf =
phiCorrCoeff.boundaryFieldRef();

View File

@ -143,8 +143,8 @@ while (pimple.correct())
// ddtPhiCorr filter -- only apply in pure(ish) phases
surfaceScalarField alphaf1Bar(fvc::interpolate(fvc::average(alphaf1)));
surfaceScalarField phiCorrCoeff1(pos(alphaf1Bar - 0.99));
surfaceScalarField phiCorrCoeff2(pos(0.01 - alphaf1Bar));
surfaceScalarField phiCorrCoeff1(pos0(alphaf1Bar - 0.99));
surfaceScalarField phiCorrCoeff2(pos0(0.01 - alphaf1Bar));
{
surfaceScalarField::Boundary& phiCorrCoeff1Bf =

View File

@ -73,7 +73,7 @@ Lavieville::fLiquid
) const
{
return
pos(alphaLiquid - alphaCrit_)
pos0(alphaLiquid - alphaCrit_)
*(
1 - 0.5*exp(-20*(alphaLiquid - alphaCrit_))
)

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,7 +74,7 @@ cosine::fLiquid
) const
{
return
pos(alphaLiquid1_ - alphaLiquid)
pos0(alphaLiquid1_ - alphaLiquid)
*(
neg(alphaLiquid0_ - alphaLiquid)
*(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -267,7 +267,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs()
this->refValue() = 0.0;
this->refGrad() =
pos(alpha - SMALL)
pos0(alpha - SMALL)
*constant::mathematical::pi
*specularityCoefficient_.value()
*alpha

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,7 +41,7 @@ if (mesh.nInternalFaces())
{
scalarField sumPhi
(
pos(alpha1 - 0.01)*pos(0.99 - alpha1)
pos0(alpha1 - 0.01)*pos0(0.99 - alpha1)
*fvc::surfaceSum(mag(phi))().primitiveField()
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,9 +71,9 @@ Foam::aspectRatioModels::VakhrushevEfremov::E() const
return
neg(Ta - scalar(1))*scalar(1)
+ pos(Ta - scalar(1))*neg(Ta - scalar(39.8))
+ pos0(Ta - scalar(1))*neg(Ta - scalar(39.8))
*pow3(0.81 + 0.206*tanh(1.6 - 2*log10(max(Ta, scalar(1)))))
+ pos(Ta - scalar(39.8))*0.24;
+ pos0(Ta - scalar(39.8))*0.24;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -84,7 +84,7 @@ Foam::tmp<Foam::volScalarField>
Foam::dragModels::GidaspowErgunWenYu::CdRe() const
{
return
pos(pair_.continuous() - 0.8)*WenYu_->CdRe()
pos0(pair_.continuous() - 0.8)*WenYu_->CdRe()
+ neg(pair_.continuous() - 0.8)*Ergun_->CdRe();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,7 +74,7 @@ Foam::dragModels::GidaspowSchillerNaumann::CdRe() const
volScalarField CdsRe
(
neg(Re - 1000)*24.0*(1.0 + 0.15*pow(Re, 0.687))/alpha2
+ pos(Re - 1000)*0.44*max(Re, residualRe_)
+ pos0(Re - 1000)*0.44*max(Re, residualRe_)
);
return

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -80,7 +80,7 @@ Foam::dragModels::IshiiZuber::CdRe() const
volScalarField ReM(Re*muc/muMix);
volScalarField CdRe
(
pos(1000 - ReM)*24.0*(scalar(1) + 0.15*pow(ReM, 0.687))
pos0(1000 - ReM)*24.0*(scalar(1) + 0.15*pow(ReM, 0.687))
+ neg(1000 - ReM)*0.44*ReM
);
@ -92,7 +92,7 @@ Foam::dragModels::IshiiZuber::CdRe() const
volScalarField CdReEllipse(Ealpha*0.6666*sqrt(Eo)*Re);
return
pos(CdReEllipse - CdRe)
pos0(CdReEllipse - CdRe)
*min(CdReEllipse, Re*sqr(1 - pair_.dispersed())*2.66667)
+ neg(CdReEllipse - CdRe)*CdRe;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,9 +66,9 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Lain::CdRe() const
return
neg(Re - 1.5)*16.0
+ pos(Re - 1.5)*neg(Re - 80.0)*14.9*pow(Re, 0.22)
+ pos(Re - 80.0)*neg(Re - 1500.0)*48*(1.0 - 2.21/sqrt(max(Re, SMALL)))
+ pos(Re - 1500.0)*2.61*Re;
+ pos0(Re - 1.5)*neg(Re - 80.0)*14.9*pow(Re, 0.22)
+ pos0(Re - 80.0)*neg(Re - 1500.0)*48*(1.0 - 2.21/sqrt(max(Re, SMALL)))
+ pos0(Re - 1500.0)*2.61*Re;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -67,7 +67,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::SchillerNaumann::CdRe() const
return
neg(Re - 1000)*24.0*(1.0 + 0.15*pow(Re, 0.687))
+ pos(Re - 1000)*0.44*max(Re, residualRe_);
+ pos0(Re - 1000)*0.44*max(Re, residualRe_);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,7 +71,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::CdRe() const
volScalarField B
(
neg(alpha2 - 0.85)*(0.8*pow(alpha2, 1.28))
+ pos(alpha2 - 0.85)*(pow(alpha2, 2.65))
+ pos0(alpha2 - 0.85)*(pow(alpha2, 2.65))
);
volScalarField Re(pair_.Re());
volScalarField Vr

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -72,7 +72,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::WenYu::CdRe() const
volScalarField CdsRes
(
neg(Res - 1000)*24.0*(1.0 + 0.15*pow(Res, 0.687))
+ pos(Res - 1000)*0.44*max(Res, residualRe_)
+ pos0(Res - 1000)*0.44*max(Res, residualRe_)
);
return

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,8 +70,8 @@ Foam::tmp<Foam::volScalarField> Foam::liftModels::TomiyamaLift::Cl() const
return
neg(EoH - scalar(4))*min(0.288*tanh(0.121*pair_.Re()), f)
+ pos(EoH - scalar(4))*neg(EoH - scalar(10.7))*f
+ pos(EoH - scalar(10.7))*(-0.288);
+ pos0(EoH - scalar(4))*neg(EoH - scalar(10.7))*f
+ pos0(EoH - scalar(10.7))*(-0.288);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -79,9 +79,9 @@ Foam::tmp<Foam::volVectorField> Foam::wallLubricationModels::Frank::Fi() const
return
(
pos(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179)
+ pos(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187)
+ pos(Eo - 33.0)*0.179
pos0(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179)
+ pos0(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187)
+ pos0(Eo - 33.0)*0.179
)
*max
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,9 +77,9 @@ Foam::wallLubricationModels::TomiyamaWallLubrication::Fi() const
return
(
pos(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179)
+ pos(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187)
+ pos(Eo - 33.0)*0.179
pos0(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179)
+ pos0(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187)
+ pos0(Eo - 33.0)*0.179
)
*0.5
*pair_.dispersed().d()

View File

@ -145,8 +145,8 @@ while (pimple.correct())
// ddtPhiCorr filter -- only apply in pure(ish) phases
surfaceScalarField alphaf1Bar(fvc::interpolate(fvc::average(alphaf1)));
surfaceScalarField phiCorrCoeff1(pos(alphaf1Bar - 0.99));
surfaceScalarField phiCorrCoeff2(pos(0.01 - alphaf1Bar));
surfaceScalarField phiCorrCoeff1(pos0(alphaf1Bar - 0.99));
surfaceScalarField phiCorrCoeff2(pos0(0.01 - alphaf1Bar));
{
surfaceScalarField::Boundary& phiCorrCoeff1Bf =

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -267,7 +267,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs()
this->refValue() = 0.0;
this->refGrad() =
pos(alpha - SMALL)
pos0(alpha - SMALL)
*constant::mathematical::pi
*specularityCoefficient_.value()
*alpha

View File

@ -207,7 +207,7 @@ void Foam::CLASS::updateCoeffs()
(
"phi"
);
this->valueFraction() = 1.0 - pos(phip);
this->valueFraction() = 1.0 - pos0(phip);
PARENT::updateCoeffs();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -411,12 +411,24 @@ Foam::dimensionSet Foam::pos(const dimensionSet&)
}
Foam::dimensionSet Foam::pos0(const dimensionSet&)
{
return dimless;
}
Foam::dimensionSet Foam::neg(const dimensionSet&)
{
return dimless;
}
Foam::dimensionSet Foam::neg0(const dimensionSet&)
{
return dimless;
}
Foam::dimensionSet Foam::posPart(const dimensionSet& ds)
{
return ds;

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -81,7 +81,9 @@ dimensionSet magSqr(const dimensionSet&);
dimensionSet mag(const dimensionSet&);
dimensionSet sign(const dimensionSet&);
dimensionSet pos(const dimensionSet&);
dimensionSet pos0(const dimensionSet&);
dimensionSet neg(const dimensionSet&);
dimensionSet neg0(const dimensionSet&);
dimensionSet posPart(const dimensionSet&);
dimensionSet negPart(const dimensionSet&);
dimensionSet inv(const dimensionSet&);
@ -360,7 +362,7 @@ public:
friend dimensionSet magSqr(const dimensionSet&);
friend dimensionSet mag(const dimensionSet&);
friend dimensionSet sign(const dimensionSet&);
friend dimensionSet pos(const dimensionSet&);
friend dimensionSet pos0(const dimensionSet&);
friend dimensionSet neg(const dimensionSet&);
friend dimensionSet inv(const dimensionSet&);

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -198,6 +198,17 @@ dimensionedScalar pos(const dimensionedScalar& ds)
}
dimensionedScalar pos0(const dimensionedScalar& ds)
{
return dimensionedScalar
(
"pos0(" + ds.name() + ')',
pos0(ds.dimensions()),
::Foam::pos0(ds.value())
);
}
dimensionedScalar neg(const dimensionedScalar& ds)
{
return dimensionedScalar
@ -209,13 +220,24 @@ dimensionedScalar neg(const dimensionedScalar& ds)
}
dimensionedScalar neg0(const dimensionedScalar& ds)
{
return dimensionedScalar
(
"neg0(" + ds.name() + ')',
neg0(ds.dimensions()),
::Foam::neg0(ds.value())
);
}
dimensionedScalar posPart(const dimensionedScalar& ds)
{
return dimensionedScalar
(
"posPart(" + ds.name() + ')',
posPart(ds.dimensions()),
::Foam::pos(ds.value())
::Foam::pos0(ds.value())
);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -68,7 +68,9 @@ dimensionedScalar hypot(const dimensionedScalar&, const dimensionedScalar&);
dimensionedScalar sign(const dimensionedScalar&);
dimensionedScalar pos(const dimensionedScalar&);
dimensionedScalar pos0(const dimensionedScalar&);
dimensionedScalar neg(const dimensionedScalar&);
dimensionedScalar neg0(const dimensionedScalar&);
dimensionedScalar posPart(const dimensionedScalar&);
dimensionedScalar negPart(const dimensionedScalar&);

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -708,7 +708,9 @@ UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)
UNARY_FUNCTION(scalar, scalar, pos0, pos0)
UNARY_FUNCTION(scalar, scalar, neg, neg)
UNARY_FUNCTION(scalar, scalar, neg0, neg0)
UNARY_FUNCTION(scalar, scalar, posPart, posPart)
UNARY_FUNCTION(scalar, scalar, negPart, negPart)

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,7 +91,9 @@ UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)
UNARY_FUNCTION(scalar, scalar, pos0, pos0)
UNARY_FUNCTION(scalar, scalar, neg, neg)
UNARY_FUNCTION(scalar, scalar, neg0, neg0)
UNARY_FUNCTION(scalar, scalar, posPart, posPart)
UNARY_FUNCTION(scalar, scalar, negPart, negPart)

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -108,7 +108,9 @@ UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)
UNARY_FUNCTION(scalar, scalar, pos0)
UNARY_FUNCTION(scalar, scalar, neg)
UNARY_FUNCTION(scalar, scalar, neg0)
UNARY_FUNCTION(scalar, scalar, posPart)
UNARY_FUNCTION(scalar, scalar, negPart)
UNARY_FUNCTION(scalar, scalar, exp)

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -101,7 +101,9 @@ UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)
UNARY_FUNCTION(scalar, scalar, pos0)
UNARY_FUNCTION(scalar, scalar, neg)
UNARY_FUNCTION(scalar, scalar, neg0)
UNARY_FUNCTION(scalar, scalar, posPart)
UNARY_FUNCTION(scalar, scalar, negPart)
UNARY_FUNCTION(scalar, scalar, exp)

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -132,7 +132,9 @@ UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)
UNARY_FUNCTION(scalar, scalar, pos0)
UNARY_FUNCTION(scalar, scalar, neg)
UNARY_FUNCTION(scalar, scalar, neg0)
UNARY_FUNCTION(scalar, scalar, posPart)
UNARY_FUNCTION(scalar, scalar, negPart)
UNARY_FUNCTION(scalar, scalar, exp)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -106,7 +106,9 @@ UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)
UNARY_FUNCTION(scalar, scalar, pos0)
UNARY_FUNCTION(scalar, scalar, neg)
UNARY_FUNCTION(scalar, scalar, neg0)
UNARY_FUNCTION(scalar, scalar, posPart)
UNARY_FUNCTION(scalar, scalar, negPart)
UNARY_FUNCTION(scalar, scalar, exp)

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -851,7 +851,9 @@ UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)
UNARY_FUNCTION(scalar, scalar, pos0, pos0)
UNARY_FUNCTION(scalar, scalar, neg, neg)
UNARY_FUNCTION(scalar, scalar, neg0, neg0)
UNARY_FUNCTION(scalar, scalar, posPart, posPart)
UNARY_FUNCTION(scalar, scalar, negPart, negPart)

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -99,7 +99,9 @@ UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)
UNARY_FUNCTION(scalar, scalar, pos0, pos0)
UNARY_FUNCTION(scalar, scalar, neg, neg)
UNARY_FUNCTION(scalar, scalar, neg0, neg0)
UNARY_FUNCTION(scalar, scalar, posPart, posPart)
UNARY_FUNCTION(scalar, scalar, negPart, negPart)

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-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -165,24 +165,41 @@ inline Scalar component(const Scalar s, const direction)
}
//- Return 1 if s is positive or 0 otherwise -1
inline Scalar sign(const Scalar s)
{
return (s >= 0)? 1: -1;
}
//- Return 1 if s is positive but not 0
inline Scalar pos(const Scalar s)
{
return (s > 0)? 1: 0;
}
//- Return 1 if s is positive or 0
inline Scalar pos0(const Scalar s)
{
return (s >= 0)? 1: 0;
}
//- Return 1 if s is negative but not 0
inline Scalar neg(const Scalar s)
{
return (s < 0)? 1: 0;
}
//- Return 1 if s is negative or 0
inline Scalar neg0(const Scalar s)
{
return (s <= 0)? 1: 0;
}
//- Return the positive part of s
inline Scalar posPart(const Scalar s)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,7 +41,7 @@ inline label sign(const label s)
return (s >= 0)? 1: -1;
}
inline label pos(const label s)
inline label pos0(const label s)
{
return (s >= 0)? 1: 0;
}

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -147,7 +147,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs()
patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
this->refValue() = Cmu75*kp*sqrt(kp)/mixingLength_;
this->valueFraction() = 1.0 - pos(phip);
this->valueFraction() = 1.0 - pos0(phip);
inletOutletFvPatchScalarField::updateCoeffs();
}

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -143,7 +143,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs()
patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
this->refValue() = sqrt(kp)/(Cmu25*mixingLength_);
this->valueFraction() = 1.0 - pos(phip);
this->valueFraction() = 1.0 - pos0(phip);
inletOutletFvPatchScalarField::updateCoeffs();
}

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -86,7 +86,7 @@ void diffusion<CombThermoType, ThermoType>::correct()
this->wFuel_ ==
C_*this->turbulence().muEff()
*mag(fvc::grad(YFuel) & fvc::grad(YO2))
*pos(YFuel)*pos(YO2);
*pos0(YFuel)*pos0(YO2);
}
}
}

View File

@ -107,7 +107,7 @@ bool Foam::dynamicInkJetFvMesh::update()
stationaryPoints_.component(vector::X)*
(
1.0
+ pos
+ pos0
(
- (stationaryPoints_.component(vector::X))
- refPlaneX_

View File

@ -81,7 +81,7 @@ void Foam::fvMotionSolverEngineMesh::move()
);
motionSolver_.pointMotionU().boundaryFieldRef()[linerIndex_] ==
pistonSpeed*pos(deckHeight_.value() - linerPoints)
pistonSpeed*pos0(deckHeight_.value() - linerPoints)
*(deckHeight_.value() - linerPoints)
/(deckHeight_.value() - pistonPlusLayers);
}

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -149,7 +149,7 @@ void Foam::SRFFreestreamVelocityFvPatchVectorField::updateCoeffs()
}
// Set the inlet-outlet choice based on the direction of the freestream
valueFraction() = 1.0 - pos(refValue() & patch().Sf());
valueFraction() = 1.0 - pos0(refValue() & patch().Sf());
mixedFvPatchField<vector>::updateCoeffs();
}

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,7 +48,7 @@ Foam::bound(volScalarField& vsf, const dimensionedScalar& lowerBound)
(
vsf.primitiveField(),
fvc::average(max(vsf, lowerBound))().primitiveField()
* pos(-vsf.primitiveField())
* pos0(-vsf.primitiveField())
),
lowerBound.value()
);

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-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -128,7 +128,7 @@ void Foam::inletOutletFvPatchField<Type>::updateCoeffs()
phiName_
);
this->valueFraction() = 1.0 - pos(phip);
this->valueFraction() = 1.0 - pos0(phip);
mixedFvPatchField<Type>::updateCoeffs();
}

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-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -178,8 +178,8 @@ void Foam::inletOutletTotalTemperatureFvPatchScalarField::updateCoeffs()
scalar gM1ByG = (gamma_ - 1.0)/gamma_;
this->refValue() =
T0_/(1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up));
this->valueFraction() = 1.0 - pos(phip);
T0_/(1.0 + 0.5*psip*gM1ByG*(1.0 - pos0(phip))*magSqr(Up));
this->valueFraction() = 1.0 - pos0(phip);
inletOutletFvPatchScalarField::updateCoeffs();
}

View File

@ -97,7 +97,7 @@ void Foam::interfaceCompressionFvPatchScalarField::updateCoeffs()
return;
}
operator==(pos(this->patchInternalField() - 0.5));
operator==(pos0(this->patchInternalField() - 0.5));
fixedValueFvPatchScalarField::updateCoeffs();
}

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-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -128,7 +128,7 @@ void Foam::outletInletFvPatchField<Type>::updateCoeffs()
phiName_
);
this->valueFraction() = pos(phip);
this->valueFraction() = pos0(phip);
mixedFvPatchField<Type>::updateCoeffs();
}

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -284,7 +284,7 @@ void Foam::plenumPressureFvPatchScalarField::updateCoeffs()
// Limit to prevent outflow
const scalarField p_new
(
(1.0 - pos(phi))*t*plenumPressure + pos(phi)*max(p, plenumPressure)
(1.0 - pos0(phi))*t*plenumPressure + pos0(phi)*max(p, plenumPressure)
);
// Relaxation fraction

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-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -178,7 +178,7 @@ void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs()
<< exit(FatalError);
}
valueFraction() = 1.0 - pos(phip);
valueFraction() = 1.0 - pos0(phip);
mixedFvPatchVectorField::updateCoeffs();
}

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-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -152,7 +152,7 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::updateCoeffs()
<< exit(FatalError);
}
valueFraction() = 1.0 - pos(phip);
valueFraction() = 1.0 - pos0(phip);
mixedFvPatchVectorField::updateCoeffs();
}

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-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -148,7 +148,7 @@ void Foam::pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs()
<< exit(FatalError);
}
valueFraction() = 1.0 - pos(phip);
valueFraction() = 1.0 - pos0(phip);
mixedFvPatchVectorField::updateCoeffs();
}

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -133,7 +133,7 @@ void Foam::prghTotalHydrostaticPressureFvPatchScalarField::updateCoeffs()
operator==
(
ph_rghp
- 0.5*rhop*(1.0 - pos(phip))*magSqr(Up)
- 0.5*rhop*(1.0 - pos0(phip))*magSqr(Up)
);
fixedValueFvPatchScalarField::updateCoeffs();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -180,7 +180,7 @@ void Foam::prghTotalPressureFvPatchScalarField::updateCoeffs()
operator==
(
p0_
- 0.5*rhop*(1.0 - pos(phip))*magSqr(Up)
- 0.5*rhop*(1.0 - pos0(phip))*magSqr(Up)
- rhop*((g.value() & patch().Cf()) - ghRef.value())
);

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -176,7 +176,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(p0p - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
operator==(p0p - 0.5*rho*(1.0 - pos0(phip))*magSqr(Up));
}
else
{
@ -194,14 +194,14 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs
p0p
/pow
(
(1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)),
(1.0 + 0.5*psip*gM1ByG*(1.0 - pos0(phip))*magSqr(Up)),
1.0/gM1ByG
)
);
}
else
{
operator==(p0p/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up)));
operator==(p0p/(1.0 + 0.5*psip*(1.0 - pos0(phip))*magSqr(Up)));
}
}
@ -209,7 +209,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs
else if (internalField().dimensions() == dimPressure/dimDensity)
{
// Incompressible flow
operator==(p0p - 0.5*(1.0 - pos(phip))*magSqr(Up));
operator==(p0p - 0.5*(1.0 - pos0(phip))*magSqr(Up));
}
else
{

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -167,7 +167,7 @@ void Foam::totalTemperatureFvPatchScalarField::updateCoeffs()
operator==
(
T0_/(1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up))
T0_/(1.0 + 0.5*psip*gM1ByG*(1.0 - pos0(phip))*magSqr(Up))
);
fixedValueFvPatchScalarField::updateCoeffs();

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-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -137,7 +137,7 @@ updateCoeffs()
patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
this->refValue() = 1.5*sqr(intensity_)*magSqr(Up);
this->valueFraction() = 1.0 - pos(phip);
this->valueFraction() = 1.0 - pos0(phip);
inletOutletFvPatchScalarField::updateCoeffs();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -150,7 +150,7 @@ void Foam::uniformInletOutletFvPatchField<Type>::updateCoeffs()
phiName_
);
this->valueFraction() = 1.0 - pos(phip);
this->valueFraction() = 1.0 - pos0(phip);
mixedFvPatchField<Type>::updateCoeffs();
}

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -164,7 +164,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(p0 - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
operator==(p0 - 0.5*rho*(1.0 - pos0(phip))*magSqr(Up));
}
else
{
@ -182,14 +182,14 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
p0
/pow
(
(1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)),
(1.0 + 0.5*psip*gM1ByG*(1.0 - pos0(phip))*magSqr(Up)),
1.0/gM1ByG
)
);
}
else
{
operator==(p0/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up)));
operator==(p0/(1.0 + 0.5*psip*(1.0 - pos0(phip))*magSqr(Up)));
}
}
@ -197,7 +197,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
else if (internalField().dimensions() == dimPressure/dimDensity)
{
// Incompressible flow
operator==(p0 - 0.5*(1.0 - pos(phip))*magSqr(Up));
operator==(p0 - 0.5*(1.0 - pos0(phip))*magSqr(Up));
}
else
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -191,7 +191,7 @@ public:
{
return
blendingFactor_*this->mesh().surfaceInterpolation::weights()
+ (1 - blendingFactor_)*pos(this->faceFlux_);
+ (1 - blendingFactor_)*pos0(this->faceFlux_);
}
};

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -153,7 +153,7 @@ Foam::limitedSurfaceInterpolationScheme<Type>::weights
{
pWeights[face] =
pWeights[face]*CDweights[face]
+ (1.0 - pWeights[face])*pos(faceFlux_[face]);
+ (1.0 - pWeights[face])*pos0(faceFlux_[face]);
}
surfaceScalarField::Boundary& bWeights =
@ -170,7 +170,7 @@ Foam::limitedSurfaceInterpolationScheme<Type>::weights
{
pWeights[face] =
pWeights[face]*pCDweights[face]
+ (1.0 - pWeights[face])*pos(pFaceFlux[face]);
+ (1.0 - pWeights[face])*pos0(pFaceFlux[face]);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -134,7 +134,7 @@ public:
//- Return the interpolation weighting factors
tmp<surfaceScalarField> weights() const
{
return pos(this->faceFlux_);
return pos0(this->faceFlux_);
}
//- Return the interpolation weighting factors

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -131,7 +131,7 @@ public:
const GeometricField<Type, fvPatchField, volMesh>&
) const
{
return pos(faceFlux_);
return pos0(faceFlux_);
}
};

View File

@ -166,7 +166,7 @@ public:
if (mesh_.isInternalFace(facei))
{
// Apply upwind differencing
w[facei] = pos(faceFlux_[facei]);
w[facei] = pos0(faceFlux_[facei]);
}
}
}

View File

@ -687,14 +687,14 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
case opSumDirection:
{
const vector n(dict_.lookup("direction"));
return gSum(pos(values*(Sf & n))*mag(values));
return gSum(pos0(values*(Sf & n))*mag(values));
}
case opSumDirectionBalance:
{
const vector n(dict_.lookup("direction"));
const scalarField nv(values*(Sf & n));
return gSum(pos(nv)*mag(values) - neg(nv)*mag(values));
return gSum(pos0(nv)*mag(values) - neg(nv)*mag(values));
}
default:
{
@ -722,7 +722,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
n /= mag(n) + ROOTVSMALL;
const scalarField nv(n & values);
return gSum(pos(nv)*n*(nv));
return gSum(pos0(nv)*n*(nv));
}
case opSumDirectionBalance:
{
@ -730,7 +730,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
n /= mag(n) + ROOTVSMALL;
const scalarField nv(n & values);
return gSum(pos(nv)*n*(nv));
return gSum(pos0(nv)*n*(nv));
}
case opAreaNormalAverage:
{

View File

@ -248,7 +248,7 @@ void Foam::DSMCCloud<ParcelType>::collisions()
vector relPos = p.position() - cC;
label subCell =
pos(relPos.x()) + 2*pos(relPos.y()) + 4*pos(relPos.z());
pos0(relPos.x()) + 2*pos0(relPos.y()) + 4*pos0(relPos.z());
subCells[subCell].append(i);
whichSubCell[i] = subCell;

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-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -136,7 +136,7 @@ inline Foam::tmp<Foam::fvScalarMatrix> Foam::ReactingCloud<CloudType>::SYi
return
fvm::Sp(neg(sourceField)*sourceField/(Yi + YiSMALL), Yi)
+ pos(sourceField)*sourceField;
+ pos0(sourceField)*sourceField;
}
else
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -72,7 +72,7 @@ inline Type& Foam::PairCollisionRecord<Type>::collisionData()
template<class Type>
inline bool Foam::PairCollisionRecord<Type>::accessed() const
{
return pos(origProcOfOther_);
return pos0(origProcOfOther_);
}

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-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -109,10 +109,10 @@ bool Foam::triSurfaceSearch::checkUniqueHit
surface().faceNormals()[edgeFacei];
const label signCurrHit =
pos(currHitNormal & lineVec);
pos0(currHitNormal & lineVec);
const label signExistingHit =
pos(existingHitNormal & lineVec);
pos0(existingHitNormal & lineVec);
if (signCurrHit == signExistingHit)
{

View File

@ -350,7 +350,7 @@ bool Foam::movingConeTopoFvMesh::update()
newPoints =
topoChangeMap().preMotionPoints()
+ (
pos(0.5 - mag(motionMask_)) // cells above the body
pos0(0.5 - mag(motionMask_)) // cells above the body
)*curMotionVel_*time().deltaT().value();
}
else
@ -369,7 +369,7 @@ bool Foam::movingConeTopoFvMesh::update()
newPoints =
points()
+ (
pos(0.5 - mag(motionMask_)) // cells above the body
pos0(0.5 - mag(motionMask_)) // cells above the body
)*curMotionVel_*time().deltaT().value();
}
}
@ -380,7 +380,7 @@ bool Foam::movingConeTopoFvMesh::update()
newPoints =
points()
+ (
pos(0.5 - mag(motionMask_)) // cells above the body
pos0(0.5 - mag(motionMask_)) // cells above the body
)*curMotionVel_*time().deltaT().value();
}

View File

@ -221,7 +221,7 @@ Foam::interfaceProperties::surfaceTensionForce() const
Foam::tmp<Foam::volScalarField>
Foam::interfaceProperties::nearInterface() const
{
return pos(alpha1_ - 0.01)*pos(0.99 - alpha1_);
return pos0(alpha1_ - 0.01)*pos0(0.99 - alpha1_);
}