CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] snappyHexMesh doesnt snap (https://www.cfd-online.com/Forums/openfoam-meshing/104855-snappyhexmesh-doesnt-snap.html)

mark_CFD_wind June 9, 2015 06:56

Is it possible in the blockMeshDict to create two areas in effect, one close to the turbine where I can impose much more vertices and a larger one to deal with the macro flow effects? Or is this what the refinement is supposed to do?

Thanks,

Mark

Saideep June 9, 2015 09:17

Hi Mark;

It basically gets complex if you have an irregular shape. Incase if you have a chance to split into hexahedral polygons then it is easy as explained in the cavity tutorial.

Also I just saw several videos in Youtube which shows the usage of "Adaptive meshes". {I didn't start working with that as of now may be someone can shed some light on that}. I just have an impression it is just a library so it shall be easy to use an adaptive grid also.

Saideep

Regis_ July 21, 2015 15:24

Quote:

Originally Posted by wyldckat (Post 371983)
The only thing that I can find to be potentially wrong is the "locationInMesh", which is a value too round and likely to get placed on top of a face or vertex of a cell.

Bruno, could you elaborate a bit more on this? From what I understood, as far as this point is inside the part of the geometry we wish to mesh, we're good. For instance, I use something like (5 5 5), that is, really round numbers.

Regis

wyldckat July 25, 2015 15:04

Greetings to all!

@Regis_:
Quote:

Originally Posted by Regis_ (Post 556377)
Bruno, could you elaborate a bit more on this? From what I understood, as far as this point is inside the part of the geometry we wish to mesh, we're good. For instance, I use something like (5 5 5), that is, really round numbers.

The answer is essentially in the comment section of the "snappyHexMeshDict" files that are in the OpenFOAM tutorial cases, e.g.: https://github.com/OpenFOAM/OpenFOAM...xMeshDict#L140
Code:

    // NOTE: This point should never be on a face, always inside a cell, even
    // after refinement.
    // This is an outside point locationInMesh (-0.033 -0.033 0.0033);
    locationInMesh (-9.23149e-05 -0.0025 -0.0025); // Inside point

In other words, you should avoid situations where it's not able to calculate an accurate line between the location of this point "locationInMesh" and the centre/vertexes of a face (face of a cell).

Best regards,
Bruno

gouravjee March 17, 2018 14:08

Quote:

Originally Posted by wyldckat (Post 371983)
Greetings Thomas and welcome to the forum!

The only thing that I can find to be potentially wrong is the "locationInMesh", which is a value too round and likely to get placed on top of a face or vertex of a cell.

I suggest the following:
  1. Create a smaller case, based on this geometry, with a single connecting cylinder.
  2. Prepare the case for mesh generation. In a similar way to the tutorial "mesh/snappyHexMesh/flange".
  3. Test if it works.
    If it does, run Allclean and pack your case inside a zip or tar.gz file and attach to your next post. If too big, share online in some site like Dropbox.
This way it is easier to diagnose what's wrong, since we'll be able to test this ourselves.

Best regards,
Bruno

can anyone tell me what is wrong with my mesh. whenever i run it, i only get bounding box which i created with blockMesh
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      dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

geometry
{
    mysurf.stl
    {
        type triSurfaceMesh;
        regions
        {
                input {name input;}
                walls {name walls;}
                output {name output;}

               
        }
    }
    cylinder.stl
    {
        type triSurfaceMesh;
        name cylinder;
    }
};



// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    maxLocalCells 100000;

    maxGlobalCells 2000000;

    minRefinementCells 10;

    maxLoadUnbalance 0.10;

    nCellsBetweenLevels 1;

    features
    (

    );


    refinementSurfaces
    {
        regional.stl
        {
            // Surface-wise min and max refinement level
            level (2 2);
            input { level (2 2);    patchInfo {type          patch;} }
            walls { level (2 2);    patchInfo {type          patch;} }
            output { level (2 2);  patchInfo {type  patch;} }
        }
    }

    // Resolve sharp angles
    resolveFeatureAngle 24;

    refinementRegions
    {
        cylinder.stl
        {
           
            levels (2 2);
        }
    }

    locationInMesh (0 0 10);

    allowFreeStandingZoneFaces true;
}

snapControls
{

    nSmoothPatch 3;

    tolerance 2.0;

    nSolveIter 30;

    nRelaxIter 5;

        nFeatureSnapIter 10;

        implicitFeatureSnap true;

        explicitFeatureSnap false;

        multiRegionFeatureSnap false;
}



// Settings for the layer addition.
addLayersControls
{
    relativeSizes true;

    layers
    {

    }

    expansionRatio 1.0;

    finalLayerThickness 0.3;

    minThickness 0.1;

    nGrow 0;

    featureAngle 60;

    slipFeatureAngle 30;

    nRelaxIter 3;

    nSmoothSurfaceNormals 1;

    nSmoothNormals 3;

    nSmoothThickness 10;

    maxFaceThicknessRatio 0.5;


    maxThicknessToMedialRatio 0.3;


    minMedianAxisAngle 90;

    nBufferCellsNoExtrude 0;


    nLayerIter 50;
}



meshQualityControls
{
    #include "meshQualityDict"


    // Advanced

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

writeFlags
(
    scalarLevels
    layerSets
    layerFields    // write volScalarField for layer coverage
);

mergeTolerance 1e-6;


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


wyldckat March 17, 2018 16:43

Quote:

Originally Posted by gouravjee (Post 685537)
can anyone tell me what is wrong with my mesh. whenever i run it, i only get bounding box which i created with blockMesh

Quick answer:
  1. Please follow the instructions given here: https://www.cfd-online.com/Forums/op...-get-help.html
  2. Because right now the best me or any one else can do is guess, and my best guess is that snappyHexMesh is as blind as we are regarding the geometry you are telling us that exists somewhere in 3D space.
Because:
  1. Yes, you do have a geometry somewhere, but where is it exactly?
  2. What is its size?
  3. Is the geometry truly inside the bounding box defined in blockMeshDict?
  4. Is the geometry ever crossed by one of the cell edges of the initial mesh?
  5. Did you know that there is a ton of information about how to use snappyHexMesh provided here: https://openfoamwiki.net/index.php/SnappyHexMesh ? ;)

gouravjee March 18, 2018 08:56

Quote:

Originally Posted by wyldckat (Post 685545)
Quick answer:
  1. Please follow the instructions given here: https://www.cfd-online.com/Forums/op...-get-help.html
  2. Because right now the best me or any one else can do is guess, and my best guess is that snappyHexMesh is as blind as we are regarding the geometry you are telling us that exists somewhere in 3D space.
Because:
  1. Yes, you do have a geometry somewhere, but where is it exactly?
  2. What is its size?
  3. Is the geometry truly inside the bounding box defined in blockMeshDict?
  4. Is the geometry ever crossed by one of the cell edges of the initial mesh?
  5. Did you know that there is a ton of information about how to use snappyHexMesh provided here: https://openfoamwiki.net/index.php/SnappyHexMesh ? ;)

I assume you might help me with this information:)
  • I have tried with unv format for creating bounding box.
  • To get familiar with snappyHexMeshI have used the following tutorial https://www.youtube.com/watch?v=n9xYN59v3po
  • My geometry lies within the bounding box as i have confirmed it in salome
  • it is a cylindrical geometry which has both height and radius of 300 cm
  • cylinder.stl indicates the internal solid region and rest are the faces.

wyldckat March 18, 2018 14:19

Quote:

Originally Posted by gouravjee (Post 685586)
I assume you might help me with this information:)
  • I have tried with unv format for creating bounding box.
  • To get familiar with snappyHexMeshI have used the following tutorial https://www.youtube.com/watch?v=n9xYN59v3po
  • My geometry lies within the bounding box as i have confirmed it in salome
  • it is a cylindrical geometry which has both height and radius of 300 cm
  • cylinder.stl indicates the internal solid region and rest are the faces.

I should have been more specific... Both me or anyone else, need the following information about the geometry and the initial mesh, in order to try and diagnose the problem:
  1. Which are the specific dimensions of the cylindrical geometry and where exactly is it located in 3D space? The specific X, Y, Z coordinates are very important. The units in which you defined the values are also very important.
  2. Which are the specific dimensions of the bounding box of the initial mesh? Again, the X, Y, Z values of the 2 extremes of this mesh are important.
  3. Which is the number of cell divisions that you have defined along X, Y and Z for the initial mesh?


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