diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C index 9ce17a2025..0eb6a52034 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C @@ -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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,8 +41,7 @@ pressureInletOutletParSlipVelocityFvPatchVectorField : mixedFvPatchVectorField(p, iF), phiName_("phi"), - rhoName_("rho"), - UName_("U") + rhoName_("rho") { refValue() = *this; refGrad() = vector::zero; @@ -61,8 +60,7 @@ pressureInletOutletParSlipVelocityFvPatchVectorField : mixedFvPatchVectorField(ptf, p, iF, mapper), phiName_(ptf.phiName_), - rhoName_(ptf.rhoName_), - UName_(ptf.UName_) + rhoName_(ptf.rhoName_) {} @@ -76,8 +74,7 @@ pressureInletOutletParSlipVelocityFvPatchVectorField : mixedFvPatchVectorField(p, iF), phiName_(dict.lookupOrDefault("phi", "phi")), - rhoName_(dict.lookupOrDefault("rho", "rho")), - UName_(dict.lookupOrDefault("U", "U")) + rhoName_(dict.lookupOrDefault("rho", "rho")) { fvPatchVectorField::operator=(vectorField("value", dict, p.size())); refValue() = *this; @@ -94,8 +91,7 @@ pressureInletOutletParSlipVelocityFvPatchVectorField : mixedFvPatchVectorField(pivpvf), phiName_(pivpvf.phiName_), - rhoName_(pivpvf.rhoName_), - UName_(pivpvf.UName_) + rhoName_(pivpvf.rhoName_) {} @@ -108,8 +104,7 @@ pressureInletOutletParSlipVelocityFvPatchVectorField : mixedFvPatchVectorField(pivpvf, iF), phiName_(pivpvf.phiName_), - rhoName_(pivpvf.rhoName_), - UName_(pivpvf.UName_) + rhoName_(pivpvf.rhoName_) {} @@ -122,8 +117,6 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::updateCoeffs() return; } - const label patchI = patch().index(); - const surfaceScalarField& phi = db().lookupObject(phiName_); @@ -131,23 +124,22 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::updateCoeffs() patch().patchField(phi); tmp n = patch().nf(); - const Field& magS = patch().magSf(); + const Field& magSf = patch().magSf(); - const volVectorField& U = db().lookupObject(UName_); - - vectorField Uc(U.boundaryField()[patchI].patchInternalField()); - Uc -= n()*(Uc & n()); + // Get the tangential component from the internalField (zero-gradient) + vectorField Ut(patchInternalField()); + Ut -= n()*(Ut & n()); if (phi.dimensions() == dimVelocity*dimArea) { - refValue() = Uc + n*phip/magS; + refValue() = Ut + n*phip/magSf; } else if (phi.dimensions() == dimDensity*dimVelocity*dimArea) { const fvPatchField& rhop = patch().lookupPatchField(rhoName_); - refValue() = Uc + n*phip/(rhop*magS); + refValue() = Ut + n*phip/(rhop*magSf); } else { @@ -176,7 +168,6 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::write fvPatchVectorField::write(os); writeEntryIfDifferent(os, "phi", "phi", phiName_); writeEntryIfDifferent(os, "rho", "rho", rhoName_); - writeEntryIfDifferent(os, "U", "U", UName_); writeEntry("value", os); } @@ -188,11 +179,7 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::operator= const fvPatchField& pvf ) { - fvPatchField::operator= - ( - valueFraction()*(patch().nf()*(patch().nf() & pvf)) - + (1 - valueFraction())*pvf - ); + fvPatchField::operator=(pvf); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H index 5a485362d5..f73730907d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H @@ -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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,6 @@ Description Property | Description | Required | Default value phi | flux field name | no | phi rho | density field name | no | rho - U | velocity field name | no | U \endtable Example of the boundary condition specification: @@ -95,9 +94,6 @@ class pressureInletOutletParSlipVelocityFvPatchVectorField //- Density field name word rhoName_; - //- Velocity field name - word UName_; - public: