CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[cfMesh] and user-defined template mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 24, 2014, 09:32
Default and user-defined template mesh
  #1
Senior Member
 
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 123
Rep Power: 18
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 offline   Reply With Quote

Old   December 18, 2014, 03:02
Default cfMesh and user-defined template mesh
  #2
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 124
Rep Power: 16
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, 10:20
Default
  #3
Senior Member
 
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 123
Rep Power: 18
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 offline   Reply With Quote

Old   March 22, 2015, 16:24
Default
  #4
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 124
Rep Power: 16
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

Old   December 15, 2016, 04:42
Default
  #5
Senior Member
 
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 153
Rep Power: 17
be_inspired is on a distinguished road
I am also interested in this functionality.
Is possible to use workflowControls to use a own template case over which I want to introduce a stl and then, delete the cells inside the stl, project and so on?
be_inspired 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
fetal overflow in user defined cavitation model unclewallcn CFX 15 January 20, 2016 22:17
Transient User Defined Function in CFX Niru CFX 0 November 12, 2013 17:07
[snappyHexMesh] Layers:problem with curvature giulio.topazio OpenFOAM Meshing & Mesh Conversion 10 August 22, 2012 09:03
user defined function&dynamic mesh dynamicmesh Fluent UDF and Scheme Programming 0 April 8, 2012 13:07
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 18:10


All times are GMT -4. The time now is 19:05.