CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   Meshing a Duct (http://www.cfd-online.com/Forums/openfoam-meshing/114476-meshing-duct.html)

dehein2 March 11, 2013 19:09

Meshing a Duct
 
Hello,

this is one of my first trys to mesh sth. Im trying to mesh a duct with snappyHexMesh. The duct was created in SolidWorks and exported as stl (bin). The Files center should be at [0 0 0] and the duct is approx. 40cm longs and 70cm in diameter. (at least that's what i created in SolidWorks)

http://www.dehein.de/files/duct.PNG

First ting i did was creating a basic mesh. I used this blockMeshDict file to create a basic mesh:

Code:

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

convertToMeters 1.0;

vertices
(
    (-0.5 -0.5 -0.5)
    (0.5 -0.5 -0.5)
    (0.5 0.5 -0.5)
    (-0.5 0.5 -0.5)
    (-0.5 -0.5 0.5)
    (0.5 -0.5 0.5)
    (0.5 0.5 0.5)
    (-0.5 0.5 0.5)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (10 10 10) simpleGrading (1 1 1)
);

edges
(
);


boundary
(
 
);

mergePatchPairs
(
);

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

I can view the the mseh with paraForam and i looks fine. I then created my first snappyHexMesh file, but im not really sure what it does ;)

Code:

castellatedMesh true;
snap            true;
addLayers      false;



geometry
{
    duct.stl
    {
        type triSurfaceMesh;
        name duct;
    }


};

castellatedMeshControls
{
    maxLocalCells 1000000;
    maxGlobalCells 2000000;
    minRefinementCells 0;
    nCellsBetweenLevels 2;

    features
    (
    );


}
 
snapControls
{
    nSmoothPatch 6;
    tolerance 10;
    nSolveIter 60;
    nRelaxIter 10;
}

And no matter what t do, i always get the following error message:

Code:

--> FOAM FATAL IO ERROR:
keyword meshQualityControls is undefined in dictionary "/home/dehein/tmp/hexmsehtrial/system/snappyHexMeshDict"

file: /home/dehein/tmp/hexmsehtrial/system/snappyHexMeshDict from line 19 to line 60.

    From function dictionary::subDict(const word& keyword)
    in file db/dictionary/dictionary.C at line 626.

FOAM exiting

I would appreciate any kind of help ;)

Thanks a lot

chegdan March 11, 2013 19:44

The error message

Code:

keyword meshQualityControls is undefined in dictionary "/home/dehein/tmp/hexmsehtrial/system/snappyHexMeshDict"
says that you are missing the "meshQualityControls" section in your snappyHexMeshDict file. Here is an example

Code:

    meshQualityControls
    {
        maxNonOrtho 65;
        maxBoundarySkewness 20;
        maxInternalSkewness 4;
        maxConcave 80;
        minFlatness 0.5;
        minVol 1.00E-13;
        minTetQuality -1e30;
        minArea -1;
        minTwist 0.05;
        minDeterminant 0.001;
        minFaceWeight 0.05;
        minVolRatio 0.01;
        minTriangleTwist -1;
        nSmoothScale 4;
        errorReduction 0.75;
    }

If you are just starting with OpenFOAM, i suggest using a pre-processor like HELYX-OS to write these *Dict files for you to avoid some of these errors. You can also use Dict files from other cases, use PyFoam to clone cases, or use other pre-processors. Good luck.

Disclaimer: I work for the company that makes HELYX-OS.

dehein2 March 12, 2013 04:30

edit: Sorry, ASCII works, but i get this error with binary stl's. Maybe thats interesting for you ?! ;)
Is your tool only to create the mesh? Because all the Case Setup Options are greyed out?!

Hi chegdan,

thanks for the reply. I did not see that section in some of the tutorials ;(
But i downloaded and installed your company's tool and looks promising.

I tried to start by importing the stl fist, i crashed. I tried to export the stl as ASCII and binary from SolidWorks. Then i clicked on Import STL and the programm crashes directly.

When creating the case i get this output form the terminal

Code:

dehein@dehein-linuxmint ~/Engys/HelyxOS/v1.0.1 $ ./helyxOS.sh
java -Xms128m -Xmx1024m -XX:OnError="/home/dehein/Engys/HelyxOS/v1.0.1/bin/collectInfo.run" -jar /home/dehein/Engys/HelyxOS/v1.0.1/lib/HelyxOS.jar HelyxOS 2>&1 | tee /home/dehein/Engys/HelyxOS/v1.0.1/helyxEE.log
WRITE: blockMeshDict -> /home/dehein/tmp/testcase/testcase/system/blockMeshDict
WRITE: snappyHexMeshDict -> /home/dehein/tmp/testcase/testcase/system/snappyHexMeshDict
WRITE: controlDict -> /home/dehein/tmp/testcase/testcase/system/controlDict
WRITE: fvSchemes -> /home/dehein/tmp/testcase/testcase/system/fvSchemes
WRITE: fvSolution -> /home/dehein/tmp/testcase/testcase/system/fvSolution
WRITE: decomposeParDict -> /home/dehein/tmp/testcase/testcase/system/decomposeParDict

Then i click import STL and get this:

Code:

dehein@dehein-linuxmint ~/Engys/HelyxOS/v1.0.1 $ ./helyxOS.sh
java -Xms128m -Xmx1024m -XX:OnError="/home/dehein/Engys/HelyxOS/v1.0.1/bin/collectInfo.run" -jar /home/dehein/Engys/HelyxOS/v1.0.1/lib/HelyxOS.jar HelyxOS 2>&1 | tee /home/dehein/Engys/HelyxOS/v1.0.1/helyxEE.log
WRITE: blockMeshDict -> /home/dehein/tmp/testcase/testcase/system/blockMeshDict
WRITE: snappyHexMeshDict -> /home/dehein/tmp/testcase/testcase/system/snappyHexMeshDict
WRITE: controlDict -> /home/dehein/tmp/testcase/testcase/system/controlDict
WRITE: fvSchemes -> /home/dehein/tmp/testcase/testcase/system/fvSchemes
WRITE: fvSolution -> /home/dehein/tmp/testcase/testcase/system/fvSolution
WRITE: decomposeParDict -> /home/dehein/tmp/testcase/testcase/system/decomposeParDict

Thank you

chegdan March 12, 2013 10:51

dehein2,

At present, HELYX-OS does not import binary format STL files, so you will have to do with ASCII at the moment. The messages that you are receiving are there to let you know what the GUI is doing, like writing dict files in this case. Its normal behavior at this point. For the case setup portion of the GUI, you will need to finish the meshing portion and save the case. After the case is saved, you will reload the case and the case setup portion will be ready to use.

There are some threads on HELYX-OS, but the most active is

http://www.cfd-online.com/Forums/ope...pyhexmesh.html

if you need some more information. However, most of the issues on that thread have been taken care of in the current release.

If you find a bug, they can be reported at SourceForge under the "tickets" section. It is also a good place to check if you run into anything. Good luck in setting up your case!


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