CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: blockMesh (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/)
-   -   Removing interior cells (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/83427-removing-interior-cells.html)

shd01 December 28, 2010 08:46

Removing interior cells
 
Hi all,

Please would a seasoned openFOAMer give me a few words of advice on my mesh?

Using interFoam and groovyBC in OF 1.6.x, I would like to create a ship in a wave tank via blockMesh. A the moment it is a rectangular log, but in future I want to use a form that I can generate from a script.

My (newbie) approach has been to generate the ship as an interior block in blockMeshDict. This is all well and good, and the geometry looks ok:

http://i30.photobucket.com/albums/c327/shd01/th_log.jpg

I had supposed that I could add boundary conditions to the "hull" patches that effectively turn them into walls of the domain. Of course, the flow goes straight through the patches as if the ship wasn't there. I've tried a number of different boundary conditions and patch configurations but I suspect my approach is fundamentally wrong, and I need to completely remove the interior cells of the ship from the domain.

I see that snappyHexMesh is able to remove interior cells, and I am wondering whether there might be a simpler utility or trick that I can run on my mesh to remove the interior cells. Or maybe there is a mode in which I can use sHM to do what I want (without having to generate a STL file), but to be honest, I have no idea where to start with that.

Any pointers you could give me would be very gratefully received.

Best regards,

Steve Duncan


Code:

/*---------------------------------------------------------------------------*
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.3                                  |
|  \\  /    A nd          | Web:      http://www.openfoam.org              |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version        2.0;
    format          ascii;

    root            "";
    case            "";
    instance        "";
    local          "";

    class          dictionary;
    object          blockMeshDict;
}

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

convertToMeters 1;

vertices
(
    (0.000000 0.000000 -2.500000)
    (0.000000 4.000000 -2.500000)
    (20.000000 0.000000 -2.500000)
    (20.000000 4.000000 -2.500000)
    (0.000000 0.000000 1.500000)
    (0.000000 4.000000 1.500000)
    (20.000000 0.000000 1.500000)
    (20.000000 4.000000 1.500000)
    (5.000000 1.000000 -1.500000)
    (5.000000 3.000000 -1.500000)
    (15.000000 1.000000 -1.500000)
    (15.000000 3.000000 -1.500000)
    (5.000000 1.000000 0.500000)
    (5.000000 3.000000 0.500000)
    (15.000000 1.000000 0.500000)
    (15.000000 3.000000 0.500000)
);

blocks
(
    hex (0 2 3 1 4 6 7 5)        (200 40 40) simpleGrading (1 1 1)  // bounding box
    hex (8 10 11 9 12 14 15 13)    (100 20 20) simpleGrading (1 1 1)  // ship
);

edges
(
);

patches                     
(                           
    patch inlet             
    (                       
        (0 1 5 4)           
                           
    )                       
    wall fixedwalls         
    (                       
        (0 2 3 1)           
    )                       
                           
    patch atmosphere       
    (                       
        (4 5 7 6)           
    )                       
    wall front             
    (                       
        (1 3 7 5)           
                           
    )                       
    wall back               
    (                       
        (2 0 4 6)           
                           
    )                       
                           
    patch outlet           
    (                       
        (7 6 2 3)           
    )                       
                           
    patch hull           
    (                       
                           
        (8 10 11 9)       
        (8 9 13 12)       
        (10 14 15 11)       
        (9 11 15 13)       
        (12 13 15 14)       
        (10 8 12 14)               
    )                       
                           
);                                 
mergePatchPairs
(
);

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


shd01 January 14, 2011 13:39

I'd still be grateful for some help with this.

Thanks.

wyldckat January 14, 2011 17:33

Greetings Steve and welcome to the forum!

Disclaimer: I only have some limited experience with OpenFOAM. But since people are either very busy this time of the year, or are still on vacations, or stuck in some blizzard or flood... so I'll try to give you some suggestions.

I've never removed cells from inside meshes, but I know some tutorials that might get you in the right direction:
  • "multiphase/interDyMFoam/ras/floatingObject" - this tutorial shows you how to select the zones of the mesh that are assigned to the floating object. Study the "Allrun" script and "*Dict" files present inside the folder "system".
  • for programmable "blockMeshDict"s generated with m4, run these commands to get a list of the tutorial folders:
    Code:

    tut
    find . -name "makeMesh" | xargs grep "m4" -sl
    find . -name "Allrun" | xargs grep "m4" -sl

  • you can find all of the tutorials that use cellSet by running:
    Code:

    find . -name "cellSetDict"
Other than this, you'll have to continue looking for suspicious looking OpenFOAM applications in the folder "$FOAM_APPBIN" and search for other dictionary files "*Dict" in the "$FOAM_APP" folder. To see what folders I'm talking about, echo them like this:
Code:

echo $FOAM_APP
echo $FOAM_APPBIN
find $FOAM_APP -name "*Dict"

Other places you can search for more information:
Best regards and good luck!
Bruno

shd01 January 16, 2011 11:11

Many thanks for your time, wyldckat. I hadn't noticed this tutorial until you pointed it out.

I see the floatingObject described in blockMeshDict as a patch with no faces, and then it looks like it's modified by a subsequent call to subsetMesh in the Allrun file. I think I should be able to do something similar.

I shall play with this tutorial and post the results of my endeavours.

Thanks again.


All times are GMT -4. The time now is 07:21.