CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

How to avoid checkerboard?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 2 Post By jameswilson620

Reply
 
LinkBack Thread Tools Display Modes
Old   July 12, 2012, 12:17
Default How to avoid checkerboard?
  #1
Member
 
Florian Ettner
Join Date: Mar 2009
Location: Munich, Germany
Posts: 40
Rep Power: 8
dohnie is on a distinguished road
Dear Foamers,
I created a density based (no PISO loop !) combustion solver which works fine as long as I use adiabatic walls. However, if I set the temperature on the walls to a fixed value, a checkerboard pattern in the pressure develops (not immediately, but after a few hundred timesteps).

In short, the code looks like this (similar to rhoCentralFoam):
Code:
#include "rhoEqn.H"

// solve all other transport equations

thermo.correct();
p.dimensionedInternalField() = rho.dimensionedInternalField() / thermo.psi().dimensionedInternalField();
p.correctBoundaryConditions();
rho.boundaryField() = psi.boundaryField()*p.boundaryField();
I know that this is not enough information to find a bug, but I've been stuck on this for a while and just wanted to ask for some general advice on the checkerboard problem in a density based code.

The p boundary condition on the walls is zeroGradient.
Changing the grad scheme in fvSchemes from Gauss linear to fourth did not yield any improvement.

Any suggestions are appreciated!

Last edited by dohnie; July 12, 2012 at 12:28. Reason: typo
dohnie is offline   Reply With Quote

Old   July 12, 2012, 12:25
Default
  #2
Member
 
Florian Ettner
Join Date: Mar 2009
Location: Munich, Germany
Posts: 40
Rep Power: 8
dohnie is on a distinguished road
Screenshot:

checkerboard.jpg
dohnie is offline   Reply With Quote

Old   July 13, 2012, 02:55
Default
  #3
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
Can you post your complete fvSchemes and fvSolution? Also, did you arefully check if your solution converges?
Bernhard is offline   Reply With Quote

Old   July 13, 2012, 06:14
Default
  #4
Member
 
Florian Ettner
Join Date: Mar 2009
Location: Munich, Germany
Posts: 40
Rep Power: 8
dohnie is on a distinguished road
Bernhard, I checked convergence, the residuals are nice.
Here are my schemes:

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default 		        Gauss linear;
    grad(scalarSlope)	cellMDLimited Gauss linear 1;
    grad(USlope)	        cellMDLimited Gauss linear 1;
}

divSchemes
{
    default         none;

    div(tauShear)       	Gauss linear;
    div(tauMC)        		Gauss linear;
    div((tauShear&U))   	Gauss linear;
    div((p*U))			Gauss linear;
    div((U+((sL*Xi)*-grad(c)))) Gauss linear;
    div((sL*grad(b))) 		Gauss linear;
    div(U) 	    		Gauss linear;
    div((sL*-grad(c))) 		Gauss linear;
  
    
    div(phiSt,c)    	Gauss vanLeer01;        
    div(phiXi,Xi)	Gauss vanLeer;
    
    div(phi,k) 	     	Gauss upwind;
    div(phi,omega) 	Gauss upwind; 
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default none;
  
    interpolate(tauMC) 	Gamma phi 1.0;
    interpolate(mu) 	Gamma phi 1.0;
    interpolate(muEff) 	Gamma phi 1.0;

    reconstruct(rho) limitedLinear 1.0;
    reconstruct(U)   limitedLinearV 1.0;
    reconstruct(T)   limitedLinear 1.0;

    interpolate(rho) linear; 		// for CFL
    reconstruct(cSound) linear; 	// for CFL
 
    // combustion stuff:
    interpolate(-grad(c)) linear;
    interpolate(grad((1-c))) linear;
    interpolate((((p*psiu)*sL)*Xi)) linear;
    interpolate((sL*((1|Xi)-Xi))) linear;
    interpolate(((rhoUnburned*sL)*Xi)) linear;
    interpolate((laplacian(interpolate(alphaEff),c)|mag(-grad(c)))) linear;
}

snGradSchemes
{
    default         corrected;
}
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    rho
    {
        solver          diagonal;
    }

    rhoE
    {
        solver          diagonal;
    }
    
    U
    {
	solver		 PCG;
        preconditioner   DIC;
        tolerance        1e-06;
        relTol           0;
    };

    fH
    {
	solver		 PCG;
        preconditioner   DIC;
        tolerance        1e-06;
        relTol           0;
    };
    tau
    {
	solver		 PCG;
        preconditioner   DIC;
        tolerance        1e-06;
        relTol           0;
    };
    c
    {
	solver		 PCG;
        preconditioner   DIC;
        tolerance        1e-06;
        relTol           0;
    };
    hu
    {
	solver		 PCG;
        preconditioner   DIC;
        tolerance        1e-06;
        relTol           0;
    };
    
    Xi
    {
	solver		 PBiCG;
        preconditioner   DILU;
        tolerance        1e-06;
        relTol           0;
    };

    k
    {
	solver		 PBiCG;
        preconditioner   DILU;
        tolerance        1e-06;
        relTol           0;
    };
    omega
    {
	solver		 PBiCG;
        preconditioner   DILU;
        tolerance        1e-06;
        relTol           0;
    };
    
}

Riemann
{
    secondOrder yes;            // Riemann: 1st or 2nd order
}

relaxationFactors
{
    // under-relaxation factors used in wave-transmissive schemes
    k               0.2;
    omega           0.2;
}
dohnie is offline   Reply With Quote

Old   January 19, 2015, 13:13
Default
  #5
New Member
 
james wilson
Join Date: Aug 2014
Location: Orlando, Fl
Posts: 29
Rep Power: 2
jameswilson620 is on a distinguished road
Any updates on this problem? I am experiencing the same issues but in a modified version of porousInterFoam where increasing permeability[m^2] results in this checkerboard pressure field.

James
jameswilson620 is offline   Reply With Quote

Old   January 19, 2015, 15:22
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,253
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

@James: Can you provide a test case and respective solver?

Either way, try following the same analysis strategy I used here: Strange Results at Tank Outlet with InterFoam post #17

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 23, 2015, 12:18
Default
  #7
New Member
 
james wilson
Join Date: Aug 2014
Location: Orlando, Fl
Posts: 29
Rep Power: 2
jameswilson620 is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings to all!

@James: Can you provide a test case and respective solver?

Either way, try following the same analysis strategy I used here: Strange Results at Tank Outlet with InterFoam post #17

Best regards,
Bruno
Bruno,

Ive seen your posts all throughout the forums. Thanks for your help and input! I need to get better at following up on my own solutions since I have fixed my problem!

My checkerboarding was caused by slip boundary conditions, i.e. checkerboarding would occur anywhere there were no gradients in the velocity field (resulting in unstable oscillations that still satisfied continuity). Im not sure what parameters/mat'l properties resulted in my cases diverging and not any of my others; however, I increased nOuterCorrectors in fvSolution for PIMPLE:

Code:
PIMPLE
{
    momentumPredictor   no;
    nOuterCorrectors    2; // increased from 1 -> 2
    nCorrectors         3;
    nNonOrthogonalCorrectors 0;
}
and it mitigated this issue!

I cant give you stats on the difference in iterations between the first and second loops; however, I know the second pass through the PIMPLE loop with nOuterCorrectors=2 resulted in nearly the order of iterations in the first pass.

I believe in my first case (mixed slip and no-slip boundaries), I had a high value of sigma (0.1N/m) and a small domain resulting in relatively large surface tension forces and consequently, un-realistic velocities on the slip walls across the interface since the BC is set to zeroGradient/slip/symetry and forced the liquid phase to adjust rapidly.

In another case, I had a uniform inflow and slip conditions on various boundaries resulting in the checkerboarding due to the onset of instability from the lack of gradients anywhere in the flow field.

I cannot reproduce the error since I have modified those cases. so I didnt provide a test case : /

I hope this helps, James
wyldckat and hua1015 like this.
jameswilson620 is offline   Reply With Quote

Old   January 26, 2015, 04:12
Default
  #8
Senior Member
 
Join Date: Oct 2013
Posts: 237
Rep Power: 4
chriss85 is on a distinguished road
If increasing the number of iterations fixes your problem, then this is a simple convergence issue. I suggest you monitor the convergence behaviour of the initial residuals.
chriss85 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANSYS Meshing] avoid to mesh the inside of the blade swiss_zhang ANSYS Meshing & Geometry 1 June 9, 2011 07:37
how to avoid self intersection:Proam bala CD-adapco 5 March 6, 2008 05:23
HOW turbulene Grid (avoid too fine or too coarse)? Toulouser FLUENT 1 February 1, 2007 04:47
How to avoid walls in moving referance frame (MRF) san FLUENT 5 March 31, 2006 01:17
Pressure checkerboard problem behzad Main CFD Forum 7 July 4, 2005 10:51


All times are GMT -4. The time now is 05:00.