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

Periodic cyclic AMI + MRF crashing on pressure

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2017, 04:22
Default Periodic cyclic AMI + MRF crashing on pressure
  #1
Member
 
Thomas Sprich
Join Date: Mar 2015
Posts: 76
Rep Power: 11
Swift is on a distinguished road
Dear FOAMERS

I am simulating a 3D impeller case in a closed tank (no inlet and outlet) with simpleFOAM and MRF. I would like to take advantage of symmetry. To do this I model the geometry of the tank in quarters along the axis of the tank as shown in the image. I am using cyclicAMI boundary conditions on the ‘wedge’ edges because I can’t get an equal mesh on each face.

When I run simpleFOAM, I get a crash on the first iteration on the pressure step. See the error below:


Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.1                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 4.1
Exec   : simpleFoam
Date   : Oct 09 2017
Time   : 08:53:30
Host   : "thomas-MS-7885"
PID    : 3752
Case   : FourBladedMapFieldsRealizeableKEHiResCyclic
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Overriding DebugSwitches according to controlDict
    coupled         1;

Create mesh for time = 0


SIMPLE: convergence criteria
    field p     tolerance 0.0001
    field U     tolerance 1e-05
    field "(k|epsilon)"     tolerance 1e-05

Reading field p

AMI: Creating addressing and weights between 50097 source faces and 44472 target faces
AMI: Patch source sum(weights) min/max/average = 0, 2.4426, 1.0002
AMI: Patch target sum(weights) min/max/average = 0.26519, 2.476, 1.0029
Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model realizableKE
bounding k, min: 0 max: 0.051 average: 0.051
bounding epsilon, min: 0 max: 0.05 average: 0.05
Creating MRF zone list from MRFProperties
    creating MRF zone: MRF1
No finite volume options present


Starting time loop

Time = 1

GAMG:  Solving for Ux, Initial residual = 1, Final residual = 2.2586e-05, No Iterations 3
GAMG:  Solving for Uy, Initial residual = 1, Final residual = 0.00090351, No Iterations 2
GAMG:  Solving for Uz, Initial residual = 1, Final residual = 0.00082893, No Iterations 2
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::divide(Foam::Field<double>&, double const&, Foam::UList<double> const&) at ??:?
#4  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::dimensioned<double> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
#5  ? at ??:?
#6  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7  ? at ??:?
The error appears to have to do with sig figs or division by zero but I don’t know where I have gone wrong and how to fix it.
Does anyone have some advice on how to resolve this?


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

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

internalField   uniform 0;

boundaryField
{
    cyclic1-Right
    {
        type            cyclicAMI;
    }
    cyclic2-Left
    {
        type            cyclicAMI;
    }
    rotorBottom
    {
        type            zeroGradient;
    }
  
    baffles
    {
        type            zeroGradient;
    }
    tank
    {
        type            zeroGradient;
    }
    shaft
    {
        type            zeroGradient;
    }
    bottomOfTank
    {
        type            zeroGradient;
    }
    topOfTank
    {
        type            zeroGradient;
    }
}


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

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

internalField   uniform (0 0 0);

boundaryField
{
    cyclic1-Right
    {
        type            cyclicAMI;
    }
    cyclic2-Left
    {
        type            cyclicAMI;
    }
    rotorBottom
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
  
    baffles
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    tank
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    shaft
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    bottomOfTank
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    topOfTank
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
}


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

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

internalField   uniform 0.051;

boundaryField
{
    cyclic1-Right
    {
        type            cyclicAMI;
    }
    cyclic2-Left
    {
        type            cyclicAMI;
    }
    rotorBottom
    {
        type            kqRWallFunction;
        value           uniform 0.051;
    }
  
    baffles
    {
        type            kqRWallFunction;
        value           uniform 0.051;
    }
    tank
    {
        type            kqRWallFunction;
        value           uniform 0.051;
    }
    shaft
    {
        type            kqRWallFunction;
        value           uniform 0.051;
    }
    bottomOfTank
    {
        type            kqRWallFunction;
        value           uniform 0.051;
    }
    topOfTank
    {
        type            kqRWallFunction;
        value           uniform 0.051;
    }
}


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

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

internalField   uniform 0.05;

boundaryField
{
    
    cyclic1-Right
    {
        type            cyclicAMI;
    }
    cyclic2-Left
    {
        type            cyclicAMI;
    }
    rotorBottom
    {
        type            epsilonWallFunction;
        value           uniform 0.05;
    }
 
    baffles
    {
        type            epsilonWallFunction;
        value           uniform 0.05;
    }
    tank
    {
        type            epsilonWallFunction;
        value           uniform 0.05;
    }
    shaft
    {
        type            epsilonWallFunction;
        value           uniform 0.05;
    }
    bottomOfTank
    {
        type            epsilonWallFunction;
        value           uniform 0.05;
    }
    topOfTank
    {
        type            epsilonWallFunction;
        value           uniform 0.05;
    }
}


// ************************************************************************* //
boundary

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      binary;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

8
(
    rotorBottom
    {
        type            wall;
        inGroups        1(wall);
        nFaces          27410;
        startFace       2887555;
    }
    baffles
    {
        type            wall;
        inGroups        1(wall);
        nFaces          8790;
        startFace       2914965;
    }
    tank
    {
        type            wall;
        inGroups        1(wall);
        nFaces          23866;
        startFace       2923755;
    }
    shaft
    {
        type            wall;
        inGroups        1(wall);
        nFaces          2813;
        startFace       2947621;
    }
    bottomOfTank
    {
        type            wall;
        inGroups        1(wall);
        nFaces          7259;
        startFace       2950434;
    }
    topOfTank
    {
        type            wall;
        inGroups        1(wall);
        nFaces          7268;
        startFace       2957693;
    }
    cyclic1-Right
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          50097;
        startFace       2964961;
        matchTolerance  0.0001;
        transform       rotational;
        neighbourPatch  cyclic2-Left;
        rotationAxis    (0 0 1);
        rotationCentre  (0 0 0);
    }
    cyclic2-Left
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          44472;
        startFace       3015058;
        matchTolerance  0.0001;
        transform       rotational;
        neighbourPatch  cyclic1-Right;
        rotationAxis    (0 0 1);
        rotationCentre  (0 0 0);
    }
)

// ************************************************************************* //
fvSchemes

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

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    //default faceLimited leastSquares 0.5;
    default         Gauss linear;
    //grad(p)         cellLimited Gauss linear 1;
    //grad(U)         cellLimited Gauss linear 1;

}

divSchemes
{
    default         none;
    //div(phi,U)      bounded Gauss limitedLinearV 1;
    div(phi,U)      bounded Gauss linearUpwind grad(U);
    div(phi,k)      bounded Gauss linearUpwind grad(U);
    div(phi,epsilon) bounded Gauss linearUpwind grad(U);
    div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
//    default         Gauss linear corrected;
    default Gauss linear limited 0.33;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
//    default limited 0.33;
    default         corrected;
}


// ************************************************************************* //
fvSolution

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

solvers
{

    p
    {
        solver          GAMG;
        tolerance       1e-08;
        relTol          0.01;
        smoother        GaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 20;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }
    pFinal
    {

        $p;
        relTol          0.00;
    }
    U
    {
        solver          GAMG;
        tolerance       1e-08;
        relTol          0.001;
        smoother        GaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 20;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }

    k
    {
        solver          GAMG;
        smoother        GaussSeidel;
        nSweeps         5;
        tolerance       1e-08;
        relTol          0.001;
    }

    epsilon
    {
        solver          GAMG;
        smoother        GaussSeidel;
        nSweeps         5;
        tolerance       1e-08;
        relTol          0.001;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 2;
    momentumPredictor yes;
    pRefCell        0;
    pRefPoint        (00 0.0);
    pRefValue       0;
    residualControl
    {
        p               1e-4;
        U               1e-5;
        "(k|epsilon)" 1e-5;
    }
}

relaxationFactors
{
    fields
    {
        p               0.7;
    }
    equations
    {
        U               0.6;
        k               0.6;
        epsilon         0.6;
    }
}


// ************************************************************************* //
MRFProperties - Note I have put the cyclicAMI wall as part of the non-rotatingPatches

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

    MRF1
    {
        cellZone    rotatingDomainBottom;
        active      yes;

        // Fixed patcsshes (by default they 'move' with the MRF zone)
        nonRotatingPatches (cyclic1-Right cyclic2-Left);

        origin    (0 0 0);
        axis      (0 0 1);
        omega     -2.8571;
    }
// ************************************************************************* //
I have attached the relevant files

Kind Regards,
Thomas Sprich
Attached Images
File Type: png geometry.png (17.9 KB, 197 views)
Swift is offline   Reply With Quote

Old   October 9, 2017, 04:35
Default
  #2
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 16
Antimony is on a distinguished road
Hi,

If you look at the weights of your AMI, you see that the minimum weight is 0. While I have not performed simulations similar to yours, I have encountered AMI issues in my runs & they typically have to do with the minimum weight being 0.

This 0 weight, at least for me, has been the result of there being a mismatch in defining the cyclicAMI patches. You might want to check your mesh, particularly the AMI faces/patches, to ensure that the patches are defined correctly

Hope this helps.

Cheers,
Antimony
Antimony is offline   Reply With Quote

Old   October 9, 2017, 11:02
Default
  #3
Member
 
Thomas Sprich
Join Date: Mar 2015
Posts: 76
Rep Power: 11
Swift is on a distinguished road
Hi Antimony,

Thanks for your reply. It makes sense what you say. I think when I saw it crash on pressure, on not on velocity that AMI weights were not a problem.

I'm not sure what type of AMI simulations you have done. I've done some where I had rotating AMI planes and AMI was a problem too. In this case, the AMI planes are orthogonal and I'm not sure if that could be the problem...? There is a 'rotationAngle' option available for the cyclicAMI definition, but I'm not sure how to use this.

The second thing that could be a problem is at the corner of the wedge by the axis where the two AMI planes meet the mesh is very busy because this is where the impeller is located. I can't think why this should be a problem, but I think it is worth mentioning.

Thomas
Swift is offline   Reply With Quote

Old   October 10, 2017, 04:06
Default
  #4
Member
 
Thomas Sprich
Join Date: Mar 2015
Posts: 76
Rep Power: 11
Swift is on a distinguished road
Hi Antimony,

I have remeshed while trying to get better AMI weights.

I have managed to get the following when running simpleFoam:

Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Overriding DebugSwitches according to controlDict
    coupled         1;

Create mesh for time = 1


SIMPLE: convergence criteria
    field p     tolerance 0.0001
    field U     tolerance 1e-05
    field "(k|epsilon)"     tolerance 1e-05

Reading field p

AMI: Creating addressing and weights between 61954 source faces and 61950 target faces
AMI: Patch source sum(weights) min/max/average = 0.5618, 1.1697, 1
AMI: Patch target sum(weights) min/max/average = 0.562, 1.0172, 0.99997
Like this it runs and gets past the pressure calculation. I will test further and let you know how it goes.

The weights are not close to one. Is this a problem? At least they are very similar.

Thanks for your help once again.

Thomas
Swift is offline   Reply With Quote

Old   October 10, 2017, 04:22
Default
  #5
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 16
Antimony is on a distinguished road
Hi,

I think most of the problems come only when the weights are exactly 0. Apart from that the simulation should run, though there is no guarantee that it won't fail later.

If I remember correctly (from reading somewhere), if you use the rotation transformation, then it is quite possible that you will weights that are not close to 1 (but I could be wrong!).

Apologies that I don't have a more definitive answer for you.

Cheers,
Antimony
Antimony is offline   Reply With Quote

Old   October 11, 2017, 02:53
Default
  #6
Member
 
Thomas Sprich
Join Date: Mar 2015
Posts: 76
Rep Power: 11
Swift is on a distinguished road
Hi Antimony,

Just to let you know.

The simulation ran to a reasonable convergence without crashing.

Thanks again for your help and swift responses.

Thomas
Swift is offline   Reply With Quote

Old   May 16, 2019, 05:20
Default
  #7
Senior Member
 
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8
Krao is on a distinguished road
Hi Thomas Sprich,

I am facing a similar problem where the patch AMI weights are zero. I am trying to simulate half of the propeller using MRF+AMI. It would be very interesting if you can share the information regarding what exactly was the error that caused the failure. Thank you
Krao is offline   Reply With Quote

Old   May 16, 2019, 07:14
Default
  #8
Member
 
Thomas Sprich
Join Date: Mar 2015
Posts: 76
Rep Power: 11
Swift is on a distinguished road
Hi Krao,

Its been a long time since I have done this. To be honest, I think at that stage I just played with sHM settings until I got better AMI weights. Since then I have found some tips that can help get better results.

The problem I had was that the points on the master and slave surfaces for the AMI surfaces where not 100% conformal. You can see this when you look at them in paraFoam, the surfaces don't quite line up. I particularly had a problem at the edges.

To be able to help, you would really need to show your snappyHexMeshDict and show your meshing procedure. You also haven't shown what your error is, are all your AMI weights zero, or just the minimum?

I can only presume what problems you are having, but the below has helped me get AMI surfaces with better weights. Assuming that you have had similar problems to me.

There is a really good example for how to get good AMI surfaces in the tutorials:
tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/
I recommend starting with this.

Unlike in the propeller tutorial in pimple(DyM)Foam, here no facetype is defined and mergeOrSplitBaffles is used. I have honestly found this to be the only way to get AMI surfaces that are 100% conformal and that allow me to rotate the mesh. But you aren't rotating your mesh, so this maybe isn't an issue for you.

This may also help you:
https://openfoam.org/release/2-2-0/s...fles/#x4-12000

See "Baffle and Boundary Creation" section. This may also give you some ideas.

I hope that helps,
Thomas
Swift is offline   Reply With Quote

Old   May 17, 2019, 02:55
Default
  #9
Senior Member
 
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8
Krao is on a distinguished road
Thank you very much for your reply, can you please look into this thread, which I have posted yesterday (One half propeller simulation with MRFSimpleFoam crashing). It would be of a great help if you can provide some insights, where I would have made mistakes.


Previously I have used, AMI successfully for the dynamic simulation of Propellers and also I had success with MRFsimpleFoam for the full propeller. Now I am trying to figure out a procedure for determining the results of one half propeller, to save computational time.
Krao is offline   Reply With Quote

Reply

Tags
cyclicami; mrf


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
question regarding LES of pipe flow - pimpleFoam Dan1788 OpenFOAM Running, Solving & CFD 37 December 26, 2017 15:42
Pressure Outlet Guage pressure Mohsin FLUENT 36 April 29, 2016 18:16
Does star cd takes reference pressure? monica Siemens 1 April 19, 2007 12:26
Gas pressure question Dan Moskal Main CFD Forum 0 October 24, 2002 23:02
Hydrostatic pressure in 2-phase flow modeling (long) DS & HB Main CFD Forum 0 January 8, 2000 16:00


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