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

pimpleFoam DynamicMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2021, 14:58
Default pimpleFoam DynamicMesh
  #1
Member
 
Join Date: Feb 2020
Posts: 79
Rep Power: 6
Fouch is on a distinguished road
Hi !


I am trying to run a case with pimpleFoam and dynamicMesh.
This is a rotor of a centrifugal fan.


The problem is a crash occured at 0.00022s because of a very high distortion of the mesh (please see the screenshot before and after).


I don't understand why the static mesh seems to stick to the moving mesh.


below my createPatchDict :


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

// Do a synchronisation of coupled points after creation of any patches.
// Note: this does not work with points that are on multiple coupled patches
//       with transformations (i.e. cyclics).
pointSync false;

// Patches to create.
patches
(
    {
        //- Master side patch
        name            AMI1;
        patchInfo
        {
            type            cyclicAMI;
            matchTolerance  0.0001;
            neighbourPatch  AMI2;
            transform       noOrdering;
            lowWeightCorrection 0.2;
        }
        constructFrom patches;
        patches (rotatingZone);
    }

    {
        //- Slave side patch
        name            AMI2;
        patchInfo
        {
            type            cyclicAMI;
            matchTolerance  0.0001;
            neighbourPatch  AMI1;
            transform       noOrdering;
            lowWeightCorrection 0.2;
        }
        constructFrom patches;
        patches (rotatingZone_slave);
    }

);

// ************************************************************************* //
SnappyHexMesh :


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

// Which of the steps to run
castellatedMesh true;
snap            true;
addLayers       false;

// Geometry.
geometry
{

    aubes.stl
    {
        type        triSurfaceMesh;
    name         aubes;
        patchInfo
        {
            type wall;
        }
    }
    NF.stl
    {
        type        triSurfaceMesh;
        name            NF;
        patchInfo
        {
            type wall;
        }
    }
    disque.stl
    {
        type        triSurfaceMesh;
    name         disque;
        patchInfo
        {
            type wall;
        }
    }
    cone.stl
    {
        type        triSurfaceMesh;
    name         cone;
        patchInfo
        {
            type wall;
        }
    }
    pavi.stl
    {
        type        triSurfaceMesh;
        name        pavi;
        patchInfo
        {
            type wall;
        }
    }
        bec.stl
    {
        type        triSurfaceMesh;
        name        bec;
        patchInfo
        {
            type wall;
        }
    }

    wallinlet.stl
    {
        type        triSurfaceMesh;
        name        wallinlet;
        patchInfo
        {
            type wall;
        }
    }

    AMI.stl
    {
        type        triSurfaceMesh;
        name        rotatingZone;
    }
    inlet.stl
    {
        type        triSurfaceMesh;
        name        inlet;
        patchInfo
        {
            type        patch;
        }
    }
    gap.stl
    {
        type        triSurfaceMesh;
        name        gap;
    }
    outlet.stl
    {
        type        triSurfaceMesh;
        name        outlet;
        patchInfo
        {
            type        patch;
        }
    }
    walls.stl
    {
        type        triSurfaceMesh;
        name body;
        patchInfo
        {
            type        wall;
        }
    }

    cylinder
    {
        type            searchableCylinder;
        point1          (0.92 -0.69  -0.05);
        point2          (0.92 -0.69 0.4);
        radius          0.06;
    }

}


// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    // Refinement parameters
    // ~~~~~~~~~~~~~~~~~~~~~

    maxLocalCells 3000000;
    maxGlobalCells 10000000;
    minRefinementCells 0;
    maxLoadUnbalance 0.10;
    nCellsBetweenLevels 2;


    // Explicit feature edge refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    features
    (
    {
    file "walls.eMesh";
    level 1;
    }
    {
    file "AMI.eMesh";
    level 3;
    }
    {
    file "NF.eMesh";
    level 3;//4
    }
    {
    file "aubes.eMesh";
    level 3;//3
    }
    {
    file "cone.eMesh";
    level 2;
    }
    {
    file "disque.eMesh";
    level 2;
    }
    {
    file "pavi.eMesh";
    level 1;
    }
    {
    file "wallinlet.eMesh";
    level 2;
    }
    {
    file "bec.eMesh";
    level 4;
    }
    );


    // Surface based refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~

     refinementSurfaces
    {
        rotatingZone
        {
            level           (3 3);
            faceType        baffle;
            cellZone        rotating;
            faceZone        rotating;
            cellZoneInside  inside;
        }

                cone    { level (1 3); type wall; }// 3 4
                aubes    { level (3 3); type wall; }// 4 4
                disque    { level (1 3); type wall; }
             body    { level (1 2); type wall; }
                outlet  { level (1 1); type patch; }
                inlet   { level (1 1); type patch; }
                wallinlet   { level (1 2); type wall; }
                pavi    { level (1 3); type wall; }
        bec    { level (6 6); type wall; }//5 6
                NF    { level (1 3); type wall; } //5 5
    }

    // Resolve sharp angles
    resolveFeatureAngle 15;


    // Region-wise refinement
    // ~~~~~~~~~~~~~~~~~~~~~~
    refinementRegions
    {

/*    bec
    {

        mode        distance;

        // Distance and minimum uniform refinement level
        levels      ((4 0));

        // If cells
        // - have level 0..9
        // - and are in a gap < 3 cell sizes across
        // - with the gap on the inside ('inside'), outside ('outside')
        //   or both ('mixed') of the surface
        // refine them
        gapLevel    (4 0 5); 
        gapMode     mixed;
    gapSelf     false;
    }*/

       rotatingZone
        {
            mode        inside;
            levels      ((0 1));
        }
      /*  wallinlet
        {
            mode        distance;
            levels      ((0.2 1));
        }
        */
        bec
        {
            mode        distance;
            levels      ((0.002 6));
        }
/*        wallinlet
        {
            mode        distance;
            levels      ((0.001 3));
        }
        gap
        {
            mode        distance;
            levels      ((0.001 6));
        }*/
    /*    disque
        {
            mode        distance;
            levels      ((0.01 2));
        }*/
     /*   NF
        {
            mode        distance;
            levels      ((0.001 5));
        }*/
    /*    cylinder
        {
            mode    inside;
            levels   ((1e15 3));
        }*/
    }

    // Mesh selection
    // ~~~~~~~~~~~~~~
    locationInMesh (0 0 1);
    allowFreeStandingZoneFaces false;
}



// Settings for the snapping.
snapControls
/*{
    nSmoothPatch 8;
    tolerance 2; // 1.0;
    nSolveIter 300;
    nRelaxIter 10;
    //nFeatureSnapIter 10;

    implicitFeatureSnap true;
    explicitFeatureSnap false;
    multiRegionFeatureSnap false;
}*/
{
    //- Number of patch smoothing iterations before finding correspondence
    //  to surface
    nSmoothPatch 3;

    //- Relative distance for points to be attracted by surface feature point
    //  or edge. True distance is this factor times local
    //  maximum edge length.
    tolerance 1.1; // 1.0;

    //- Number of mesh displacement relaxation iterations.
    nSolveIter 100;

    //- Maximum number of snapping relaxation iterations. Should stop
    //  before upon reaching a correct mesh.
    nRelaxIter 5;

    // Feature snapping

        // Number of feature edge snapping iterations.
        // Leave out altogether to disable.
        nFeatureSnapIter 5;

        // Detect (geometric only) features by sampling the surface
        // (default=false).
        implicitFeatureSnap true;

        // Use castellatedMeshControls::features (default = true)
        explicitFeatureSnap false;

        // Detect features between multiple surfaces
        // (only for explicitFeatureSnap, default = false)
        multiRegionFeatureSnap false;
}



// Settings for the layer addition.
addLayersControls
{
    relativeSizes false;
    expansionRatio 1.2;
    finalLayerThickness 0.3;

    layers
    {
/*    body
    {
            nSurfaceLayers  3;
            expansionRatio  1.2;
        finalLayerThickness 0.005;//5
         }*/
  /*       outlet
    {
            nSurfaceLayers  3;
            expansionRatio  1.2;
        finalLayerThickness 0.006;
         }
        wallinlet
        {
            nSurfaceLayers  3;
            expansionRatio  1.2;
            finalLayerThickness 0.005;
        }*/
        pavi
        {
            nSurfaceLayers  3;
            expansionRatio  1.2;
            finalLayerThickness 0.002;
        }
    aubes
    {
            nSurfaceLayers  3;//3
            expansionRatio  1.2;
        finalLayerThickness 0.002;//0.002
        }
/*        NF
        {
            nSurfaceLayers  3;//3
            expansionRatio  1.2;
            finalLayerThickness 0.001;//0.0015
        }*/

        cone
        {
            nSurfaceLayers  3;
            expansionRatio  1.2;
        finalLayerThickness 0.0018;//0.002
        }
        disque
        {
            nSurfaceLayers  3;
            expansionRatio  1.2;
        finalLayerThickness 0.0021;
        }
    }

//    expansionRatio 1.2;
 //   finalLayerThickness 0.3;
    minThickness 0.00001;
    nGrow 0;

    // Advanced settings

    featureAngle 175;
    slipFeatureAngle 30;
    nRelaxIter 5;
    nSmoothSurfaceNormals 3;
    nSmoothNormals 3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedialAxisAngle 90;
    nBufferCellsNoExtrude 0;

    nLayerIter 100;
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{

    //- Maximum non-orthogonality allowed. Set to 180 to disable.
    maxNonOrtho 55;

    //- Max skewness allowed. Set to <0 to disable.
    maxBoundarySkewness 4;
    maxInternalSkewness 4;

    //- Max concaveness allowed. Is angle (in degrees) below which concavity
    //  is allowed. 0 is straight face, <0 would be convex face.
    //  Set to 180 to disable.
    maxConcave 70;

    //- Minimum pyramid volume. Is absolute volume of cell pyramid.
    //  Set to a sensible fraction of the smallest cell volume expected.
    //  Set to very negative number (e.g. -1E30) to disable.
    minVol 1e-13;

    //- Minimum quality of the tet formed by the face-centre
    //  and variable base point minimum decomposition triangles and
    //  the cell centre. This has to be a positive number for tracking
    //  to work. Set to very negative number (e.g. -1E30) to
    //  disable.
    //     <0 = inside out tet,
    //      0 = flat tet
    //      1 = regular tet
    minTetQuality 1e-30; // 1e-30;

    //- Minimum face area. Set to <0 to disable.
    minArea 1e-13;

    //- Minimum face twist. Set to <-1 to disable. dot product of face normal
    //  and face centre triangles normal
    minTwist 0.001;

    //- Minimum normalised cell determinant
    //  1 = hex, <= 0 = folded or flattened illegal cell
    minDeterminant 0.001;

    //- minFaceWeight (0 -> 0.5)
    minFaceWeight 0.05;

    //- minVolRatio (0 -> 1)
    minVolRatio 0.01;

    //must be >0 for Fluent compatibility
    minTriangleTwist -1;


    // Advanced

    //- Number of error distribution iterations
    nSmoothScale 4;
    //- Amount to scale back displacement at error points
    errorReduction 0.75;

    // Optional : some meshing phases allow usage of relaxed rules.
    // See e.g. addLayersControls::nRelaxedIter.
    relaxed
    {
        //- Maximum non-orthogonality allowed. Set to 180 to disable.
        maxNonOrtho 65;
    }
/*    maxNonOrtho 50;

    maxBoundarySkewness 2;
    maxInternalSkewness 2;

    maxConcave 65;
    minVol 1e-13;
    minTetQuality 1e-30;
    minArea 1e-13;
    minTwist 0.001;
    minDeterminant 0.002;
    minFaceWeight 0.05;
    minVolRatio 0.01;
    minTriangleTwist -1;
    minTwist 0.001;
    nSmoothScale 4;
    errorReduction 0.75;

    relaxed
    {
        maxNonOrtho 65;
    }*/
    
}



// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1e-6;


// ************************************************************************* //
fvSolution :


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

solvers
{
 
    p
    {
        solver          GAMG;//GAMG
    smoother        DICGaussSeidel;//DICGaussSeidel
        tolerance       1e-5;
        relTol          0.01;
        minIter    2;
    maxIter     50;   
    }
    
    pFinal
    {
        $p;
        tolerance       1e-8;
        relTol          0;
        minIter    4;
    maxIter     200;   
    }
    "pcorr.*"
    {
        $p;
        tolerance       1e-2;
        relTol          0;
    }
    
    "(k|omega|U|e|h|nuTilda|rho)"
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-6;
        relTol          0.1;
        maxIter          50;
        minIter         1;
    }
        "(k|omega|U|e|h|nuTilda|rho)Final"
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-6;
        relTol          0;
        maxIter          50;
        minIter          4;
    }
    
}

PIMPLE
{
    momentumPredictor   yes;
    transonic           no;
    consistent          true;
    nOuterCorrectors    10;
    nCorrectors         2;
    nNonOrthogonalCorrectors 1;

/*residualControl
    {
    //    p     1e-5;
        U     1e-6;
    }*/

    //- Control over each time step. The outer loops are recalculated
    //  till the residuals are reached. For outer loops, we can use
    //  under-relaxation as it is kind of a SIMPLE loop. Stiff problems
    //  can be handled and the time step can be increased. Further information
    //  are given in the book Mathematics, Numerics, Derivations and OpenFOAM
    outerCorrectorResidualControl
    {
        p    
        {
            relTol      0;
            tolerance   1e-4;
        }
        U    
        {
            relTol      0;
            tolerance   1e-5;
        }
    }

}

relaxationFactors
{
    fields
    {}

    equations
    {
        p       1;      // Make matrix at least diagonal dominant
        U       0.95;
        pFinal       1;      // Make matrix at least diagonal dominant
        UFinal       1;
    }
}

// ************************************************************************* //
Thanks in advance !
Attached Images
File Type: jpeg 0.00001.jpeg (186.7 KB, 20 views)
File Type: jpeg 0.00022.jpeg (192.4 KB, 17 views)
Fouch is offline   Reply With Quote

Old   October 10, 2021, 09:53
Default
  #2
Member
 
Join Date: Feb 2020
Posts: 79
Rep Power: 6
Fouch is on a distinguished road
Problem solved.
That come from the toposet because use particle tracking with AMI.
Fouch is offline   Reply With Quote

Old   October 11, 2021, 02:50
Default
  #3
Member
 
Join Date: Feb 2020
Posts: 79
Rep Power: 6
Fouch is on a distinguished road
I re-open the post because I cannot find a way to avoid the "sticking" when I use singleProcessorFaceSet.


Does anyone of you already faced to this issue ?
Fouch is offline   Reply With Quote

Old   October 12, 2021, 02:59
Default
  #4
Member
 
Join Date: Feb 2020
Posts: 79
Rep Power: 6
Fouch is on a distinguished road
Ok guys, may be it can help somebody in the futur.
I just had boundary in snappy instead of baffle…
Now it run perfectly
Fouch is offline   Reply With Quote

Old   October 27, 2022, 13:53
Default
  #5
Senior Member
 
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 6
Tibo99 is on a distinguished road
Congrats for resolving your issues by yourself. Your project seems to be interesting. It looks like it could be similar from the one that I'm trying to accomplish.

I want to simulate a rotating puck in OF at several angle of inclination, which involve a 3D simulation. So, I just started to gather the information about which solver and turbulence model to use.

From what I read in the documentation, if I use AMI, I need to use pimpleFoam solver. But, if I use MRF, any solver can be use. I don't know if I should use AMI or MRF yet. Do you have some tips and/or suggestions? From your experience, which one should be more suitable for my case? Are there any other methods then these two that I haven't heard about and could be better?

For the turbulence model, I'm debating between DES or LES. But this one is probably driven by the resources that I have access to.

Finally, since the puck has an inclination, I don't know yet how I should address the making of the mesh. Any suggestions, documentations or tutorials that I could look at?

Thank you very much for answering.
Tibo99 is offline   Reply With Quote

Old   October 27, 2022, 14:05
Default
  #6
Member
 
Join Date: Feb 2020
Posts: 79
Rep Power: 6
Fouch is on a distinguished road
Hi,

Could you explain what is a rotating puck ?

BR
Fouch is offline   Reply With Quote

Old   October 27, 2022, 14:16
Default
  #7
Senior Member
 
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 6
Tibo99 is on a distinguished road
Sorry! Its a hockey puck. I forgot to mention the word 'hockey'. Probably because I'm Canadian! lol
Attached Images
File Type: jpg HP.jpg (62.3 KB, 5 views)
Tibo99 is offline   Reply With Quote

Reply


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
pimpleFoam runs slower than rhoPimpleFoam Kosuke Seto OpenFOAM Running, Solving & CFD 3 May 27, 2023 14:12
Running pimpleFoam in steady state trailer OpenFOAM Running, Solving & CFD 6 January 24, 2023 03:07
pisoFoam and pimpleFoam are unstable in foam-extend 4.0/4.1 (misunderstanding ?) Kombinator OpenFOAM Running, Solving & CFD 4 January 14, 2021 04:10
External management of solid motion (using dynamicmesh) maxou1993 Main CFD Forum 0 July 28, 2015 11:37
pimpleFoam: turbulence->correct(); is not executed when using residualControl hfs OpenFOAM Running, Solving & CFD 3 October 29, 2013 08:35


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