From f675358ffdc2701d7c9c38ddaae5e6449be10a57 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 30 Sep 2010 23:01:55 +0100 Subject: [PATCH] Least square vectors next to fixed gradient boundaries work better with short distance --- .../leastSquaresGrad/leastSquaresVectors.C | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C index 655014d7c..3138098d8 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C @@ -135,8 +135,24 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const const unallocLabelList& faceCells = p.patch().faceCells(); // Build the d-vectors + + // Original version: closest distance to boundary + vectorField pd = + mesh_.Sf().boundaryField()[patchi] + /( + mesh_.magSf().boundaryField()[patchi] + *mesh_.deltaCoeffs().boundaryField()[patchi] + ); + + if (!mesh_.orthogonal()) + { + pd -= mesh_.correctionVectors().boundaryField()[patchi] + /mesh_.deltaCoeffs().boundaryField()[patchi]; + } + // Better version of d-vectors: Zeljko Tukovic, 25/Apr/2010 - vectorField pd = p.delta(); + // Experimental: review fixed gradient condition. HJ, 30/Sep/2010 +// vectorField pd = p.delta(); if (p.coupled()) {