feature request: Viewing and editing OpenFOAM blockMeshDict in FreeCAD?

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: feature request: Viewing and editing OpenFOAM blockMeshDict in FreeCAD?

Post by bernd »

I would like to give it a try too. Would you post an example blockmeshfile?
foadsf
Posts: 102
Joined: Fri Mar 06, 2015 10:02 pm
Contact:

Re: feature request: Viewing and editing OpenFOAM blockMeshDict in FreeCAD?

Post by foadsf »

There are lot of blockMeshFiles available here in OpenFOAM tutorials. A very good example has been mentioned here in this StackOverflow post.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: feature request: Viewing and editing OpenFOAM blockMeshDict in FreeCAD?

Post by bernd »

foadsf wrote: Wed Aug 22, 2018 5:38 pm There are lot of blockMeshFiles available here in OpenFOAM tutorials. A very good example has been mentioned here in this StackOverflow post.
ok than the attached file will be my test case ...


remove txt ...
Attachments
blockMeshDict.txt
(3.01 KiB) Downloaded 52 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: feature request: Viewing and editing OpenFOAM blockMeshDict in FreeCAD?

Post by bernd »

played a bit ... https://github.com/berndhahnebach/FreeC ... f8426bd887

we really should include it as FEM mesh. I'm not good at re module at all. Do you plan to read the hexaeder too? If yes I would adapt the reader I started to read a real FEM mesh in FreeCAD. I would just need a dictionary, with the node numbers for each hexaeder.

bernd
foadsf
Posts: 102
Joined: Fri Mar 06, 2015 10:02 pm
Contact:

Re: feature request: Viewing and editing OpenFOAM blockMeshDict in FreeCAD?

Post by foadsf »

cool. I see you have already started integrating into the FreeCAD and sent a pull request? next logical steps would be:
  • connect the points which are in the same face and put the face title/number in center
  • put the hex name/number in the middle of the block
  • file a better way of showing text, the

    Code: Select all

    Draft.makeText([str(vertexNum)],point=FreeCAD.Vector(vertex[0],vertex[1],vertex[2]))
    is utterly awful! i would prefer a solution like the one I have suggested in this question where the text is proportional to the window size and always parallel to the view plane
Last edited by foadsf on Wed Aug 22, 2018 8:59 pm, edited 1 time in total.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: feature request: Viewing and editing OpenFOAM blockMeshDict in FreeCAD?

Post by bernd »

as I said, I'm not good at re module at all. For the hex elements I would need a dictionary, with the node numbers for each hexaeder. Would you add this to your code?
foadsf
Posts: 102
Joined: Fri Mar 06, 2015 10:02 pm
Contact:

Re: feature request: Viewing and editing OpenFOAM blockMeshDict in FreeCAD?

Post by foadsf »

i will try implementing it. would you be so kind to help me with the annotation?
foadsf
Posts: 102
Joined: Fri Mar 06, 2015 10:02 pm
Contact:

Re: feature request: Viewing and editing OpenFOAM blockMeshDict in FreeCAD?

Post by foadsf »

The blockMesh has this nice feature of

Code: Select all

blockMesh  -blockTopology
which
write block edges and centres as .obj files
. and then two .obg files can be imported into MeshLab. What we are developing can replace that.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: feature request: Viewing and editing OpenFOAM blockMeshDict in FreeCAD?

Post by bernd »

foadsf wrote: Wed Aug 22, 2018 9:00 pm i will try implementing it. would you be so kind to help me with the annotation?
once we have the hexaeder I will show you something better than Draft to visualize the mesh :)

In the regard of the annotation. This should be dissussed once the mesh can be imported as FemMesh.

bernd
foadsf
Posts: 102
Joined: Fri Mar 06, 2015 10:02 pm
Contact:

Re: feature request: Viewing and editing OpenFOAM blockMeshDict in FreeCAD?

Post by foadsf »

I'm talking to one of the SO guys over here for the rest of the re stuff over here. feel free to join.
Post Reply