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

Cylindrical mesh with symmetrical BC - fv Sols and Schems

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

Like Tree1Likes
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 16, 2025, 02:04
Default Cylindrical mesh with symmetrical BC - fv Sols and Schems
  #1
Senior Member
 
Desh
Join Date: Mar 2021
Location: Sydney
Posts: 124
Rep Power: 6
dasith0001 is on a distinguished road
Hi Formers,

I am attempting to run a 3D, CHT transient solver for cylindrical domain with symmetry BC, using OF12. ( btw I love the new OF12!!!). please see the attached for the domain.

I initially tried Ansys Mechanical Mesher but OF12 did not like it at all then I have to turn back to good old blockMesh. I've created a decent mesh, please also see the checkMesh results.

Now the model runs ok with the following fvScheme

PHP Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  10
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    
version     2.0;
    
format      ascii;
    class       
dictionary;
    
object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default 
Euler;
}

gradSchemes
{
    default     
cellMDLimited Gauss linear 1;
    
grad(U)     cellMDLimited Gauss linear 1;

}

divSchemes
{
    default         
none;

    
div(phi,U)       Gauss upwind;
    
div(phi,K)      Gauss upwind;
    
div(phi,h)       Gauss upwind;
    
div(phi,k)       Gauss upwind;
    
div(phi,K)       Gauss upwind;
    
div(phi,epsilon)  Gauss upwind;
    
div(phi,R)       Gauss upwind;
    
div(R)          Gauss upwind;
    
div(Ji,Ii_h)    Gauss upwind;
    
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear//div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linearUpwindV cellMDLimited Gauss linear 1;
}

laplacianSchemes
{
    default        
Gauss linear limited 1;
}

interpolationSchemes
{
    default         
linear;
}

snGradSchemes
{
    default         
corrected//limited 0.5;
}

// ************************************************************************* // 
and the fvSolution would be

PHP Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  10
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    
version     2.0;
    
format      ascii;
    class       
dictionary;
    
object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    
"rho.*"
    
{
        
//solver          diagonal;
        
solver          PCG;
        
preconditioner  DIC;
        
tolerance       1e-6;
        
relTol          0.1;
    }

    
p_rgh
    
{
        
solver           GAMG;
        
smoother         GaussSeidel;
        
tolerance        1e-6;
        
relTol           0.1;
        
maxIter         1000;
    }

    
p_rghFinal
    
{
        
$p_rgh;
        
tolerance        1e-6;
        
relTol           0.1;
    }

    
"(U|h|k|epsilon|Yi)"
    
{
        
solver          smoothSolver;
        
smoother        GaussSeidel;
        
tolerance       1e-6;
        
relTol          0.1;
        
maxIter         1000;
    }

    
"(U|h|k|epsilon|Yi)Final"
    
{
        
$U;
        
tolerance        1e-6;
        
relTol           0.1;
    }

    
G
    
{
        
solver          GAMG;
        
smoother        GaussSeidel;
        
tolerance       1e-5;
        
relTol          0.1;
    }

    
GFinal
    
{
        
$G;
        
relTol          0.1;
    }
}

potentialFlow
{
    
// Used for potentialFoam initialisation
    
nNonOrthogonalCorrectors 1;
}

PIMPLE
{
    
momentumPredictor   yes;
    
nOuterCorrectors    2;
    
nCorrectors         2;
    
nNonOrthogonalCorrectors 1;

    
maxCo               0.1;
    
rDeltaTSmoothingCoeff 0.1;
    
rDeltaTDampingCoeff 0.1;
    
alphaTemp       0.1;
    
maxDeltaT       0.1;
}

relaxationFactors
{
    
equations
    
{
        
".*"            0.7;
    }

    
fields
    
{
        
rho             1.0;
        
p_rgh           1.0;
    }
}

// ************************************************************************* // 
Now my question is,

Are there any general things to change in 'fvSolution' and 'fvScheme' in particular for cylindrical domain with 'sys' BCs to

1) to increase its robustness ?
2) to increase the accuracy ?

( So i can start the model with robust config. and then finish with accuracy)

Thank you
D
Attached Images
File Type: jpg cylindrical mesh.jpg (55.8 KB, 4 views)
File Type: jpg checkMesh.jpg (91.2 KB, 3 views)
dasith0001 is offline   Reply With Quote

Old   May 16, 2025, 06:03
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 840
Rep Power: 16
Tobermory will become famous soon enough
Yes - although aim #2 will come at the expense of aim #1 (Sod's law!).

The next thing I would try would be to change the divSchemes from upwind (1st order, highly stable, but also highly diffusive) to something nearer to 2nd order. Beware - removing the numerical diffusion removes a stabilising factor fromt he simulation, so you may have to work hard to keep the run from crashing and play with the different 2nd order divSchemes to find the best one for your simulation setup. This will probably have a BIG impact on parts of the solution with strong flow gradients.

Ditto for the time integration - change from Euler (1st order) to one of the 2nd order schemes. This may only have a small effect if your time step is already small.

Also worth checking that your nOuterCorrectors and nNonOrthogonalCorrectors settings are optimal - try increasing a little, and look at the residual values to see if there's any benefit from doing more PIMPLEs or more pressure correctors.

Once you have the best solution possible on that mesh, then I would consider improving the mesh - eg smoothing out the sudden checnges in mesh size; getting rid of the 7 extreme orthogonality faces from the checkMesh etc. This will give a minor tweak to the accuracy, but will probably also help the stability.

Hope the above helps.
dasith0001 likes this.
Tobermory is offline   Reply With Quote

Old   May 18, 2025, 19:45
Default
  #3
Senior Member
 
Desh
Join Date: Mar 2021
Location: Sydney
Posts: 124
Rep Power: 6
dasith0001 is on a distinguished road
Hi Tobermory,

This certainly helps a lot, thanks for the directions!

Cheers,
D
dasith0001 is offline   Reply With Quote

Old   May 18, 2025, 22:29
Default
  #4
Senior Member
 
Desh
Join Date: Mar 2021
Location: Sydney
Posts: 124
Rep Power: 6
dasith0001 is on a distinguished road
Additionally, I am really keen to see if there are any other ways to increase the stability.

In this cylindrical mesh with 'sym' BCs, I have only one patch ( to act as both inlet and outlet) to maintain its pressure.

Sometimes I start with the high viscosity, jus to get the model take off, but I would really really like to know if I can do any other changes to increase the stability.

Thanks,
D

Last edited by dasith0001; May 18, 2025 at 22:29. Reason: typo
dasith0001 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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



All times are GMT -4. The time now is 04:46.