mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
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:
committed by
Andrew Heather
parent
639305e960
commit
56bfc75949
@ -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())
|
||||
);
|
||||
|
||||
@ -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())
|
||||
);
|
||||
}
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user