CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

cfMesh and user-defined template mesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   November 24, 2014, 10:32
Default cfMesh and user-defined template mesh
  #1
Member
 
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 95
Rep Power: 9
hannes is on a distinguished road
Dear all,

I would like to use a self-defined template mesh (e.g. a o-grid topology) with cfMesh. As I understand, cfMesh generates the template itself. Is there a way to change this behaviour and use the mesh in constant/polyMesh instead (like snappyHexMesh does)?

Regards, Hannes
hannes is online now   Reply With Quote

Old   December 18, 2014, 04:02
Default cfMesh and user-defined template mesh
  #2
Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 63
Rep Power: 7
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Dear Hannes,

Sorry for the late reply, I was busy working on the new release of cfMesh, so your post somehow slipped my radar.
Your requirement can be implemented in cfMesh by doing the following:
1. Read the mesh from disk, instead of generating initial meshes. The mesh class has a read function, which you can use to read the mesh from disk after constructing it.
2. Implementing the functionality to remove cells that you do not want in the final mesh.
3. The remaining parts of the workflow can be the same as for cartesianMesh or tetMesh. You may need modifications there if you want to use high aspect-ratio cells.

Would you be interested in contributing to cfMesh with this meshing workflow?

Regards,

Franjo
franjo_j is offline   Reply With Quote

Old   December 20, 2014, 11:20
Default
  #3
Member
 
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 95
Rep Power: 9
hannes is on a distinguished road
Dear Franjo,

yes, I am interested in contributing. I already found the read function some time ago and tried to make use of it. Therefore I modified the "createCartesianMesh" function as follows:

Code:
void cartesianMeshGenerator::createCartesianMesh()
{
    bool read=false;

    if( meshDict_.found("readTemplate") )
    {
        if( readBool(meshDict_.lookup("readTemplate")) )
            read=true;
    }

    if (read)
    {
     mesh_.read();
    }
    else
    {

     //- create polyMesh from octree boxes
     cartesianMeshExtractor cme(*octreePtr_, meshDict_, mesh_);


     if( meshDict_.found("decomposePolyhedraIntoTetsAndPyrs") )
     {
        if( readBool(meshDict_.lookup("decomposePolyhedraIntoTetsAndPyrs")) )
            cme.decomposeSplitHexes();
     }

     cme.createMesh();

     # ifdef DEBUG
     mesh_.write();
     //::exit(EXIT_SUCCESS);
     # endif
    }
}
Unfortunately, this did not work as expected. No refinement was done, no cells were removed and only the boundary was moved... I suspect, the information which is contained in "meshMetaDict" is missing?

Do you have a hint, what is the best way to proceed?

Regards, Hannes
hannes is online now   Reply With Quote

Old   March 22, 2015, 17:24
Default
  #4
Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 63
Rep Power: 7
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Dear Hannes,

What other the requirements you would like to have? So far we have the following:
1. Refinement of template cells. - what kind cells shall be handled by the procedure (hex, tets, polyhedral, etc..) The code for mesh refinement is not available in cfMesh, and it needs to be implemented or reused from some other library.
2. Removal of cells. - there are a couple of possible ways in dealing with this problem. You can use findCellsIntersectingSurface to find the template cells intersected by the surface mesh, and remove the cells that are not required in the final mesh. By default, I would suggest to remove both the intersected and the outside cells to keep the same default behavior as cartesianMesh.
3. Boundary layers. - My impression that they are readily available for this task.

meshMetaDict is not important in this case. It is a dictionary storing some basic information about the mesh, and which surface mesh was used to generate the mesh.

I am personally reluctant to implement these modifications in cartesianMesh, and would suggest to do this in a new workflow optimized for this purpose. I suggest the name templateMesh.

Regards,

Franjo
franjo_j is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On



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