CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Is there a corrected Gauss gradient scheme?

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 5 Post By bigphil

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 24, 2011, 09:18
Default Is there a corrected Gauss gradient scheme?
  #1
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Hi,

I have been looking at the accuracy of the Gauss linear gradient scheme for a simple case compared with the analytical solution, and it is exactly correct for a perfectly orthogonal mesh. But it is inaccurate if the grid is non-orthogonal.

Is there any corrected version of the Gauss linear gradient scheme where the non-orthogonality is corrected for explicitly?

I have also tried leastSquares but it seems to give strange gradients in the boundary cells. extendedLeastSquares seems to work the best but I am not entirely sure how it works.

Philip
bigphil is offline   Reply With Quote

Old   November 27, 2011, 09:54
Default
  #2
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
OK,

I found that you can specify explicit correction like this (as described here):
Code:
gradSchemes
{
   grad(U)   Gauss skewCorrected linear;
}
This certainly reduces the error on non-orthogonal grids, for my test cases anyway.

However, leastSquares gives me much better results on non-orthogonal grids. I was getting strange incorrect gradients in the boundary cells using leastSquares but this was solved by commenting and uncommenting a few lines in OpenFOAM-1.6-ext/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C.
I commented the following lines (lines 140 to 151):
Code:
        // 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];                                                                                                 
        //  }
and uncommented this line (line 155):
Code:
	// Better version of d-vectors: Zeljko Tukovic, 25/Apr/2010                                                                                           
	// Experimental: review fixed gradient condition.  HJ, 30/Sep/2010                                                                                    
        vectorField pd = p.delta();
Philip
fumiya, nero235, serles and 2 others like this.
bigphil is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in fvschemes divSchemes cannot use Gauss linearUpwind nico765 OpenFOAM Bugs 30 August 9, 2018 08:39
please help me which solver is better for my application Ger_US OpenFOAM 8 January 8, 2013 13:29
Fv scheme fuji OpenFOAM 7 December 14, 2010 00:44
solution diverges when linear upwind interpolation scheme is used subash OpenFOAM 0 May 29, 2010 02:23
Water pump OpenFOAM 15 ANSYS CFX 110 comparation waynezw0618 OpenFOAM Running, Solving & CFD 39 March 5, 2009 13:57


All times are GMT -4. The time now is 11:41.