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

Strange results and how to debug them

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2017, 11:56
Default Strange results and how to debug them
  #1
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
Hello,

I'm pretty sure I'm not the only one with this problem. I have set up a simulation (simpleFoam, pimpleFoam, pimpleDyMFoam) and it often looks like everything seems ok at first but very soon courant number jumps up and deltaT looks like 1e-9 or even lower. The residuals are all OK...

When I interrupt the solver and check progress in paraFoam, there are usually just a few spots in the whole domain that claim to bear pressure and velocity about 1000+ times greater than expected.

Sometimes I manage to get rid of that problem with some fiddling around but I never really know what I did and what's wrong.

So, what's your suggestion where to start? (a similar topic from this forum would do for a start, but I couldn't find anything useful)...

Thanks!
kandelabr is offline   Reply With Quote

Old   April 27, 2017, 13:24
Default
  #2
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
I see two general problems:
- The mesh is not well adapted. Meshing is more a kind of art. Especial problematic are meshes form automatic mesh programs. Manual made meshes are often much better
- In correct boundary conditions

Your current problem: Are the pressure bearing spots always at the same place in the mesh? Then look what happens here. Are they moving? Look where they come from.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   April 28, 2017, 19:17
Default
  #3
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
I guess you're right, it looks like it's the mesh's fault... The spots are mostly on AMI faces and on sharp edges that didn't mesh well. I thought that wouldn't make too much trouble since this page says:

https://openfoam.org/release/2-3-0/non-conforming-ami/
Quote:
Where the patch geometries are not well matched, conservation errors are introduced and the sum of weights deviates from 1. Since errors are localised to particular faces, which are often few in number, this deviation should not cause the method to fail.
What's better for snappyHexMesh, fine background mesh and little refinement or vice versa?

Are there any special tricks other than refinement for getting nice AMI faces and their edges? I'm meshing inlet pipe, impeller and volute of a pump, each model with a separate mesh. I could probably use the single region-approach and mesh everything in a single step, would that help with anything?

I've been wrestling with snappyHexMesh for quite a while and I only got fair results with explicit feature refinement and refinement levels as low as 0, 1 and 2. Anything else produced junk meshes.

Thanks for your help.
kandelabr is offline   Reply With Quote

Old   April 29, 2017, 02:13
Default
  #4
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 16
student666 is on a distinguished road
Quote:
Originally Posted by kandelabr View Post
I


Are there any special tricks other than refinement for getting nice AMI faces and their edges? I'm meshing inlet pipe, impeller and volute of a pump, each model with a separate mesh. I could probably use the single region-approach and mesh everything in a single step, would that help with anything?
in my experience, when you deal with rotating mesh, it's not the better way to mesh domains (stator +rotor)separately.
I suggest to use refinement surfaces into SHM dict and specify them as cellZones and faceZones.

This will give you a better starting mesh and you could reduce the problem.
You can find how to do it on the openfoam userguide.

Regards

Sent from my ASUS_X008D using CFD Online Forum mobile app
student666 is offline   Reply With Quote

Old   May 3, 2017, 18:54
Default
  #5
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
Actually, I was going to ask about an explanation of cellZones, faceZones, etc. I can't seem to find very basic information like, for example, what's the difference between a patch and a faceZone...

Also, I'm confused about MRF and dynamic mesh. At the moment I have both MRF in fvOptions and dynamicMeshDict for mesh rotation. What's the point of having both? How can I run a simplified steady MRF case when there's a SRFSimpleFoam but not a MRF* solver?

Thanks again!
kandelabr is offline   Reply With Quote

Old   May 4, 2017, 01:14
Default
  #6
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
> difference between a patch and a faceZone

A face zone is some primitive version of a patch. A real patch can be defined while meshing, in particular you may choose it's form. A face zone is constructed from faces of the ready mesh. In some cases this is sufficient, when there is no need to describe the exact form and position.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   May 4, 2017, 07:49
Default
  #7
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 16
student666 is on a distinguished road
MRF used with fvOptions, as in your case, are used to perform a "Freeze rotor analysys".
Dynamic mesh is used to make the mesh rotate or others...
So the first, it is a steady state analysys with a fixed position of the rotor and a extra momentum source given.
Roughly speaking that's it .

If you use simplefoam eg, std solver can't perform a transient analysys, so dynamicDict has no influence.
If you use pimpleFoam eg, maybe fvOption could give problems, because that dictionary generates an extra momentum in your cellZone....i think that's the probable consequence

Sent from my ASUS_X008D using CFD Online Forum mobile app
student666 is offline   Reply With Quote

Old   May 4, 2017, 16:43
Default
  #8
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
Thanks for your replies.
It seems after some investigation the problem is not connected with dynamic mesh or boundary conditions but within the mesh itself. I'm attaching a screenshot of a few cells that cause trouble. The thing is that I can't simplify the geometry any more and I have no idea how to make a better mesh. I can't just keep increasing the number of elements.
Attached Images
File Type: png impeller-faulty.png (191.9 KB, 19 views)
kandelabr is offline   Reply With Quote

Old   May 5, 2017, 00:17
Default
  #9
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 16
student666 is on a distinguished road
How did you get to this conclusion? Have you checked the mesh?...by the way...I can't see trough your eyes, but sorry, with this picture i cant understand much...i can't read p values and I can't properly understand your domain set up..
Before moving to the numerics, have you triple checked your BC settings?

Sent from my ASUS_X008D using CFD Online Forum mobile app
student666 is offline   Reply With Quote

Old   May 5, 2017, 00:47
Default
  #10
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 16
student666 is on a distinguished road
I suppose the red cell is upon a wall patch, but no layer added...is it correct?
And
Quote:
Originally Posted by piu58 View Post
I see two general problems:
- The mesh is not well adapted. Meshing is more a kind of art. Especial problematic are meshes form automatic mesh programs. Manual made meshes are often much better
- In correct boundary conditions


Sent from my ASUS_X008D using CFD Online Forum mobile app
student666 is offline   Reply With Quote

Old   May 5, 2017, 07:34
Default
  #11
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
Yeah, sorry I obviously took on the spirit in which OF documentation is "written" where everything is assumed to be known or obvious

I'm attaching more screenshots of the model and meshes. Impeller is rotating and there are two AMI interfaces, suction pipe -- impeller inlet and impeller outlet -- volute.

I (mostly) followed this tutorial, i guess you know it already: http://www.cfdsupport.com/Turbomachi...l/node159.html

I can't run the simulation anymore so I can't give you more screenshots of the results. The picture posted above is a zoom-in on the bottom side of the impeller. Both pressure and velocity seem OK everywhere in the whole domain but in those spots values jump by a factor of +/- 1 000 for velocity and +/- 1 000 000 for pressure, all in those few neighbour cells.

I'm not adding layers (yet) since they're not exactly required and I have enough problems already without them. I also turned turbulence modeling off for the time being.

Here are my boundary conditions:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.1                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    suction_inlet
    {
        type    zeroGradient;
    }

    "(.+_walls|rotating_volute)"
    {
        // impeller_walls
        // volute_walls
        // suction_walls
        type    zeroGradient;
    }

    ".+ami."
    {
        // impeller_inlet_ami
        // impeller_outlet_ami
        // volute_ami
        type    cyclicAMI;
        value    $internalField;
        //lowWeightCorrection 0.2;
    }

    volute_outlet
    {
        type    fixedValue;
        value   uniform 0;
    }
}

// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.1                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    suction_inlet
    {
        type    fixedValue;
        value   uniform (0 -5.5 0);
    }

    "(.+_walls|rotating_volute)"
    {
        // impeller_walls
        // volute_walls
        // suction_walls
        type    noSlip;
    }

    ".+ami."
    {
        // impeller_inlet_ami
        // impeller_outlet_ami
        // volute_ami
        type    cyclicAMI;
        value    $internalField;
        lowWeightCorrection 0.2;
    }

    volute_outlet
    {
        type    zeroGradient;
    }
}

// ************************************************************************* //
Attached Images
File Type: jpg mesh-impeller.jpg (164.0 KB, 72 views)
File Type: jpg mesh-impeller-2.jpg (203.0 KB, 12 views)
File Type: jpg mesh-suction.jpg (80.8 KB, 12 views)
File Type: jpg mesh-volute.jpg (76.8 KB, 11 views)
File Type: jpg model-screenshot.jpg (57.0 KB, 13 views)
kandelabr is offline   Reply With Quote

Old   May 5, 2017, 14:03
Default
  #12
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 16
student666 is on a distinguished road
If I were you, I should work mainly on the mesh to have good response from checkmesh utility.
Then, in case work on the bc.
One dummy error is not to set as not rotating AMI patches.
Then triple check bc, try to change them.
Then, go to numerical schemes.
Good luck.



Sent from my ASUS_X008D using CFD Online Forum mobile app
student666 is offline   Reply With Quote

Old   May 11, 2017, 15:09
Default
  #13
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
so yes, i took some time to do a gazillion of meshing experiments and it indeed is a mesh problem. i even managed to make it work once or twice but i still can't create a proper mesh (a.k.a. know what i'm doing).

i guess i got the answer for this thread, but my problems stay...

thanks for your help.
kandelabr 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 05:22.