fvPatchFields: Replaced 1 - pos0(phi) with the simpler neg(phi)

This commit is contained in:
Henry Weller
2022-02-04 14:14:34 +00:00
parent edce47e02c
commit c8cecdfff4
16 changed files with 34 additions and 38 deletions

View File

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

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -136,7 +136,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs()
patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_); patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
this->refValue() = Cmu75*kp*sqrt(kp)/mixingLength_; this->refValue() = Cmu75*kp*sqrt(kp)/mixingLength_;
this->valueFraction() = 1.0 - pos0(phip); this->valueFraction() = neg(phip);
inletOutletFvPatchScalarField::updateCoeffs(); inletOutletFvPatchScalarField::updateCoeffs();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -136,7 +136,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs()
patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_); patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
this->refValue() = sqrt(kp)/(Cmu25*mixingLength_); this->refValue() = sqrt(kp)/(Cmu25*mixingLength_);
this->valueFraction() = 1.0 - pos0(phip); this->valueFraction() = neg(phip);
inletOutletFvPatchScalarField::updateCoeffs(); inletOutletFvPatchScalarField::updateCoeffs();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -137,7 +137,7 @@ void Foam::SRFFreestreamVelocityFvPatchVectorField::updateCoeffs()
} }
// Set the inlet-outlet choice based on the direction of the freestream // Set the inlet-outlet choice based on the direction of the freestream
valueFraction() = 1.0 - pos0(refValue() & patch().Sf()); valueFraction() = neg(refValue() & patch().Sf());
mixedFvPatchField<vector>::updateCoeffs(); mixedFvPatchField<vector>::updateCoeffs();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -115,7 +115,7 @@ void Foam::inletOutletFvPatchField<Type>::updateCoeffs()
phiName_ phiName_
); );
this->valueFraction() = 1.0 - pos0(phip); this->valueFraction() = neg(phip);
mixedFvPatchField<Type>::updateCoeffs(); mixedFvPatchField<Type>::updateCoeffs();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -162,8 +162,8 @@ void Foam::inletOutletTotalTemperatureFvPatchScalarField::updateCoeffs()
scalar gM1ByG = (gamma_ - 1.0)/gamma_; scalar gM1ByG = (gamma_ - 1.0)/gamma_;
this->refValue() = this->refValue() =
T0_/(1.0 + 0.5*psip*gM1ByG*(1.0 - pos0(phip))*magSqr(Up)); T0_/(1.0 + 0.5*psip*gM1ByG*neg(phip)*magSqr(Up));
this->valueFraction() = 1.0 - pos0(phip); this->valueFraction() = neg(phip);
inletOutletFvPatchScalarField::updateCoeffs(); inletOutletFvPatchScalarField::updateCoeffs();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -261,7 +261,7 @@ void Foam::plenumPressureFvPatchScalarField::updateCoeffs()
// Limit to prevent outflow // Limit to prevent outflow
const scalarField p_new const scalarField p_new
( (
(1.0 - pos0(phi))*t*plenumPressure + pos0(phi)*max(p, plenumPressure) neg(phi)*t*plenumPressure + pos0(phi)*max(p, plenumPressure)
); );
// Relaxation fraction // Relaxation fraction

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -164,7 +164,7 @@ void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs()
<< exit(FatalError); << exit(FatalError);
} }
valueFraction() = 1.0 - pos0(phip); valueFraction() = neg(phip);
mixedFvPatchVectorField::updateCoeffs(); mixedFvPatchVectorField::updateCoeffs();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -139,7 +139,7 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::updateCoeffs()
<< exit(FatalError); << exit(FatalError);
} }
valueFraction() = 1.0 - pos0(phip); valueFraction() = neg(phip);
mixedFvPatchVectorField::updateCoeffs(); mixedFvPatchVectorField::updateCoeffs();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -135,7 +135,7 @@ void Foam::pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs()
<< exit(FatalError); << exit(FatalError);
} }
valueFraction() = 1.0 - pos0(phip); valueFraction() = neg(phip);
mixedFvPatchVectorField::updateCoeffs(); mixedFvPatchVectorField::updateCoeffs();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -116,11 +116,7 @@ void Foam::prghTotalHydrostaticPressureFvPatchScalarField::updateCoeffs()
const vectorField& Up = const vectorField& Up =
patch().lookupPatchField<volVectorField, vector>(UName_); patch().lookupPatchField<volVectorField, vector>(UName_);
operator== operator==(ph_rghp - 0.5*rhop*neg(phip)*magSqr(Up));
(
ph_rghp
- 0.5*rhop*(1.0 - pos0(phip))*magSqr(Up)
);
fixedValueFvPatchScalarField::updateCoeffs(); fixedValueFvPatchScalarField::updateCoeffs();
} }

View File

@ -96,7 +96,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs
dynamicPressureFvPatchScalarField::updateCoeffs dynamicPressureFvPatchScalarField::updateCoeffs
( (
p0_, p0_,
0.5*(1 - pos0(phip))*magSqr(Up) 0.5*neg(phip)*magSqr(Up)
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -153,7 +153,7 @@ void Foam::totalTemperatureFvPatchScalarField::updateCoeffs()
operator== operator==
( (
T0_/(1.0 + 0.5*psip*gM1ByG*(1.0 - pos0(phip))*magSqr(Up)) T0_/(1.0 + 0.5*psip*gM1ByG*neg(phip)*magSqr(Up))
); );
fixedValueFvPatchScalarField::updateCoeffs(); fixedValueFvPatchScalarField::updateCoeffs();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -127,7 +127,7 @@ updateCoeffs()
patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_); patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
this->refValue() = 1.5*sqr(intensity_)*magSqr(Up); this->refValue() = 1.5*sqr(intensity_)*magSqr(Up);
this->valueFraction() = 1.0 - pos0(phip); this->valueFraction() = neg(phip);
inletOutletFvPatchScalarField::updateCoeffs(); inletOutletFvPatchScalarField::updateCoeffs();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -134,7 +134,7 @@ void Foam::uniformInletOutletFvPatchField<Type>::updateCoeffs()
phiName_ phiName_
); );
this->valueFraction() = 1.0 - pos0(phip); this->valueFraction() = neg(phip);
mixedFvPatchField<Type>::updateCoeffs(); mixedFvPatchField<Type>::updateCoeffs();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -146,7 +146,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
const fvPatchField<scalar>& rho = const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>(rhoName_); patch().lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(p0 - 0.5*rho*(1.0 - pos0(phip))*magSqr(Up)); operator==(p0 - 0.5*rho*neg(phip)*magSqr(Up));
} }
else else
{ {
@ -164,14 +164,14 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
p0 p0
/pow /pow
( (
(1.0 + 0.5*psip*gM1ByG*(1.0 - pos0(phip))*magSqr(Up)), (1.0 + 0.5*psip*gM1ByG*neg(phip)*magSqr(Up)),
1.0/gM1ByG 1.0/gM1ByG
) )
); );
} }
else else
{ {
operator==(p0/(1.0 + 0.5*psip*(1.0 - pos0(phip))*magSqr(Up))); operator==(p0/(1.0 + 0.5*psip*neg(phip)*magSqr(Up)));
} }
} }
@ -179,7 +179,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
else if (internalField().dimensions() == dimPressure/dimDensity) else if (internalField().dimensions() == dimPressure/dimDensity)
{ {
// Incompressible flow // Incompressible flow
operator==(p0 - 0.5*(1.0 - pos0(phip))*magSqr(Up)); operator==(p0 - 0.5*neg(phip)*magSqr(Up));
} }
else else
{ {