CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   simpleFoam diverges (https://www.cfd-online.com/Forums/openfoam-solving/128622-simplefoam-diverges.html)

dreamilam January 17, 2014 01:19

simpleFoam diverges
 
3 Attachment(s)
Dear foamers,

I am trying to simulate an external aero case using simplefoam but without success.
It runs fine till 150 iterations or so. After that it starts diverging.

1. Tried switching turbulence off - didn't help
2. used very low relaxation factors for p and U - didn't help either
3. changed the solver for p from GAMG to PCG and for U from smoothsolver to PBiCG - No difference.
4. Deleted a few problematic cells just by visual inspection - No difference
5. Played around with the boundary conditions also.

can anybody help?

I am attaching my checkMesh results and other files
Quote:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.0.1
Exec : checkMesh
Date : Jan 14 2014
Time : 15:36:03
Host : ###
PID : 13033
Case : ###
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
points: 3187653
faces: 8793754
internal faces: 8421668
cells: 2823527
boundary patches: 7
point zones: 0
face zones: 0
cell zones: 0

Overall number of cells of each type:
hexahedra: 2547951
prisms: 46259
wedges: 6148
pyramids: 0
tet wedges: 10862
tetrahedra: 79
polyhedra: 212228

Checking topology...
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces ...
Patch Faces Points Surface topology
frontAndBack 13780 14148 ok (non-closed singly connected)
inlet 4134 4266 ok (non-closed singly connected)
outlet 4134 4266 ok (non-closed singly connected)
lowerWall 28554 29231 ok (non-closed singly connected)
upperWall 10140 10349 ok (non-closed singly connected)
body 311263 358013 multiply connected (shared edge)
oldInternalFaces 81 137 ok (non-closed singly connected)
<<Writing 154 conflicting points to set nonManifoldPoints

Checking geometry...
Overall domain bounding box (-10 -15 -0.367733) (40 15 20)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (1.40214e-16 -1.55299e-16 4.47086e-15) OK.
Max cell openness = 8.96162e-16 OK.
Max aspect ratio = 52.1007 OK.
Minumum face area = 4.33694e-07. Maximum face area = 0.156207. Face area magnitudes OK.
Min volume = 1.10242e-09. Max volume = 0.0585742. Total volume = 30551.4. Cell volumes OK.
Mesh non-orthogonality Max: 64.9868 average: 7.86377
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 3.93546 OK.

Mesh OK.

End
k boundary conditions
Quote:

internalField uniform 0.153067;

boundaryField
{
frontAndBack
{
type symmetryPlane;
}
inlet
{
type fixedValue;
value uniform 0.153067;
}
outlet
{
type inletOutlet;
inletValue uniform 0.153067;
value uniform 0.153067;
}
lowerWall
{
type kqRWallFunction;
value uniform 0.153067;
}
upperWall
{
type symmetryPlane;
}
body
{
type kqRWallFunction;
value uniform 0.153067;
}
oldInternalFaces
{
type symmetryPlane;
}
}

omega
Quote:

internalField uniform 1020.16;

boundaryField
{
frontAndBack
{
type symmetryPlane;
}
inlet
{
type fixedValue;
value uniform 1020.16;
}
outlet
{
type inletOutlet;
inletValue uniform 1020.16;
value uniform 1020.16;
}
lowerWall
{
type omegaWallFunction;
value uniform 0;
}
upperWall
{
type symmetryPlane;
}
body
{
type omegaWallFunction;
value uniform 0;
}
oldInternalFaces
{
type symmetryPlane;
}
}

U
Quote:

internalField uniform (31.94 0 0);

boundaryField
{
frontAndBack
{
type symmetryPlane;
}
inlet
{
type fixedValue;
value uniform (31.94 0 0);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (31.94 0 0);
}
lowerWall
{
type fixedValue;
value uniform (31.94 0 0);
}
upperWall
{
type symmetryPlane;
}
body
{
type fixedValue;
value uniform (0 0 0);
}
oldInternalFaces
{
type symmetryPlane;
}
}
p
Quote:

nternalField uniform 0;

boundaryField
{
frontAndBack
{
type symmetryPlane;
}
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
lowerWall
{
type zeroGradient;
}
upperWall
{
type symmetryPlane;
}
body
{
type zeroGradient;
}
oldInternalFaces
{
type symmetryPlane;
}
}
nut
Quote:

internalField uniform 0;

boundaryField
{
frontAndBack
{
type symmetryPlane;
}
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
lowerWall
{
type nutkWallFunction;
value uniform 0;
}
upperWall
{
type symmetryPlane;
}
body
{
type nutkWallFunction;
value uniform 0;
}
oldInternalFaces
{
type symmetryPlane;
}
}

tomf January 17, 2014 03:08

Hi,

I am not so sure about your mesh. Especially the old_Internal_Faces patch seems odd to me. You also seem to have a lot of different cell types, I am guessing this may have to do with the divergence. Could you post pictures of the mesh or maybe results from your latest iteration? Boundary conditions seem appropriate except once again the old internal faces, seems weird to have a symmetry plane in the middle of the mesh (guessing this). Please show this patch as well when showing the mesh.

Regards,
Tom

dreamilam January 17, 2014 04:24

Hi Tom,
Thanks for your reply.
I generated my mesh using SHM. Initially, there were a lot of skewed faces and my mesh check failed. so, I deleted those cells and the internal faces are a result of that.

I am really sorry. I am not at a liberty to post images of the mesh because of the rules in my company.

How can I make sure that I dont have too many different cell types?

tomf January 17, 2014 04:33

Well in that case I think it is because of deleting the cells and the neighbouring cells of the ones you deleted. I think you need to work on the settings of snappy to make sure it gets a good mesh without deleting cells. I do not use snappy, so I am not sure what are the best settings, but there are a lot of discussions on the forum.

So fix the mesh (without deleting bad cells), than try again.

Other than that it can be in fvSchemes. Could you post that one as well?

Regards

dreamilam January 17, 2014 05:19

Hi Tom,

I ll work on improving the mesh. But, we used to remove the bad cells in starccm+ and convert the internal faces to symmetryPlane. can't we do something like that in openfoam?

Here is my fvSchemes
Quote:

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
}

divSchemes
{
default none;
div(phi,U) Gauss linearUpwindV grad(U);
div(phi,k) Gauss upwind;
div(phi,omega) Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p;
}

// ************************************************** *********************** //

tomf January 17, 2014 06:04

I never did something like that, I do not think it will give you a good result in the end, I do not know how starccm+ handles it, but the general procedure would make me doubtful about the final result.

Probably in starccm+ there are additional limiters on gradients active. You can try to add them to you fvSchemes to get a converged result:

Code:

gradSchemes
{
    default        cellLimited Gauss linear 1;
}

laplacianSchemes
{
    default        Gauss linear limited 0.333;
}

snGradSchemes
{
    default        limited 0.333;
}

You can look on the forum for other examples.

Basically your setup (fvSchemes/fvSolution, boundary conditions) should be fine on a good enough mesh. My suggestions above may work on a slightly worse mesh. Last thing to check is the transportProperties files for correct value of viscosity, but I do not see anything very weird with your settings.

Good luck,
Tom

vatavuk January 17, 2014 14:40

Hi Ilam,
The solver simpleFoam is for steady-state flows. If your flow is expected to have vortex shedding this can hinder convergence. In this case it would be better to use a transient flow solver like pisoFoam.
Best Regards,
Paulo

Alfalfa January 18, 2014 14:47

I found out that you can still get decent results even with some skeewed faces (providing the skeewness is not too high). At least you can get convergence and if you only have something like 10 skeewed faces, I don't think it will be a big problem.

dreamilam January 27, 2014 23:32

Hi Tom and others,
Thanks for the reply first of all.

@Tom: I did the changes you said. No change in the residual pattern.

@Vatavuk: Hi, we are trying to simulate the flow around a bike, which would be used for thermal analysis later. vortex shedding is not of any interest to us as such .

@Boucher: Hi, Initially I ran the case without removing any cells. It was diverging and that's when I started removing those bad cells.

P.S: Really sorry for the late reply.


All times are GMT -4. The time now is 01:51.