CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

How can I change the mesh structure generated by cfMesh

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

Like Tree3Likes
  • 1 Post By franjo_j
  • 1 Post By pici
  • 1 Post By franjo_j

Reply
 
LinkBack Thread Tools Display Modes
Old   May 19, 2015, 23:43
Default How can I change the mesh structure generated by cfMesh
  #1
New Member
 
Choi Hak Kyu
Join Date: Apr 2015
Posts: 12
Rep Power: 4
prodo is on a distinguished road
Sponsored Links
Hello,
Now I'm generating the mesh by cfMesh
I can generating mesh around boundary layer like picture 1 by cfMesh
The meshs are merged immediately on upper boundary layer

but, I want generate mesh seems like picture 2, there is little difference.
(you can compare red circle)

so, How can I generate the mesh like picture 2?
there is a option for this ?

thank you
Attached Images
File Type: jpg cfMesh1.jpg (17.6 KB, 104 views)
File Type: jpg cfMesh2.jpg (18.6 KB, 101 views)
prodo is offline   Reply With Quote
Sponsored Links

Old   May 22, 2015, 04:27
Default
  #2
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 118
Rep Power: 9
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Hello,

I guess you want to move the transition region away from the boundary layer. Please try refinementThickness option. The is boundaryCellSizeRefinementThickness options valid globally.
I hope this helps you proceed further.

Regards,

Franjo
prodo likes this.
__________________
Principal Developer of cfMesh
www.cfmesh.com
Social media: LinkedIn, Twitter, YouTube, Google+, Facebook, Pinterest
franjo_j is offline   Reply With Quote

Old   June 2, 2015, 06:59
Default
  #3
New Member
 
Choi Hak Kyu
Join Date: Apr 2015
Posts: 12
Rep Power: 4
prodo is on a distinguished road
Thank you very much, Franjo

It is working very well

Regards,
prodo is offline   Reply With Quote

Old   July 20, 2015, 06:29
Question about cfMesh cartesianMesh objectRefinement
  #4
Member
 
pici's Avatar
 
Pierluigi Cirrottola
Join Date: Jun 2013
Posts: 49
Rep Power: 6
pici is on a distinguished road
Hi prodo, hi Franjo
I' trying to use cfMesh too, and I can say that it is very interesting and fast.
I have this problem: this objectRefinement part of my meshDict doesn't work at all. I don't see any error in cartesianMesh logfile, but refinement doesn't appear.
Can you help me?
Many thanks
Piero
Code:
objectRefinement
{
    centro
    {     type         sphere;
        cellSize    0.1;
        centre        (0 0 0);
        radius        3;    }
    linea1
    {    type        line;
        cellSize    0.2;
        p0            (-7.5 0 8);
        p1            (0 0 0);
        refinementThickness    2.5;    }
    linea2
    {    type        line;
        cellSize    0.2;
        p0            (7.5 0 8);
        p1            (0 0 0);
        refinementThickness    2.5;    }
    verticale
    {    type        line;
        cellSize    1;
        p0            (0 -50 0);
        p1            (0 50 0);
        refinementThickness    10;    }    
}
pici is offline   Reply With Quote

Old   July 20, 2015, 06:43
Default
  #5
New Member
 
Choi Hak Kyu
Join Date: Apr 2015
Posts: 12
Rep Power: 4
prodo is on a distinguished road
I think, objectRefinement spell was wrong
may objectRefinements is correct

Code:
objectRefinement <--
{
    centro
    {     type         sphere;
        cellSize    0.1;
        centre        (0 0 0);
        radius        3;    }
    linea1
    {    type        line;
prodo is offline   Reply With Quote

Old   July 20, 2015, 08:27
Thumbs up ok
  #6
Member
 
pici's Avatar
 
Pierluigi Cirrottola
Join Date: Jun 2013
Posts: 49
Rep Power: 6
pici is on a distinguished road
Quote:
Originally Posted by prodo View Post
I think, objectRefinement spell was wrong
may objectRefinements is correct

Code:
objectRefinement <--
{
    centro
    {     type         sphere;
        cellSize    0.1;
        centre        (0 0 0);
        radius        3;    }
    linea1
    {    type        line;
It is surprising how long I checked my meshDict for some misspell without any result . . . Now it works.
Many many thanks to you, prodo
Piero
pici is offline   Reply With Quote

Old   July 21, 2015, 09:13
Unhappy cfMesh python tools
  #7
Member
 
pici's Avatar
 
Pierluigi Cirrottola
Join Date: Jun 2013
Posts: 49
Rep Power: 6
pici is on a distinguished road
Hi Franjo,
I read that you are actively involved in cfMesh SourceForge project.
I have a stupid problem: I'm not able to run salomeTriSurf.py.
In effect, I can start the tool, but I don't know how to create the output file.
I read the source code, but, because I'm not so good to program, I didn't understand how to input the fileName.
Can you give me some information?
Thank you in advance
Piero
p.s. I'm running Salomé 7.5.1 on Ubuntu 14.04.2LTS
pici is offline   Reply With Quote

Old   July 22, 2015, 04:19
Default cfMesh python tools for Salome
  #8
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 118
Rep Power: 9
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Ciao Piero,

Yes, I am the principal developer of cfMesh. However, the scripts for Salome are the contribution from Ivor Clifford.
In order to export the surface from Salome I usually do the following:
1. Generate a triangulation in Salome, within the Mesh module.
2. Import the salomeToSurf.py script. The Load Script option exists inside the File menu.
3. Select the surface you want to export, by highlighting it in the project tree, and write:
triSurf().writeFms("surfaceName.fms")
in the python console.
This executes the script with the selected mesh as its argument, and writes the fms file with the given name into the directory where Salome is installed. You can also provide an absolute path to get the fms file written to the desired location.

I hope this helps you move forward.

Regards,

Franjo
__________________
Principal Developer of cfMesh
www.cfmesh.com
Social media: LinkedIn, Twitter, YouTube, Google+, Facebook, Pinterest
franjo_j is offline   Reply With Quote

Old   July 22, 2015, 06:15
Cool Nice !
  #9
Member
 
pici's Avatar
 
Pierluigi Cirrottola
Join Date: Jun 2013
Posts: 49
Rep Power: 6
pici is on a distinguished road
Quote:
Originally Posted by franjo_j View Post
Ciao Piero,

Yes, I am the principal developer of cfMesh. However, the scripts for Salome are the contribution from Ivor Clifford.
In order to export the surface from Salome I usually do the following:
1. Generate a triangulation in Salome, within the Mesh module.
2. Import the salomeToSurf.py script. The Load Script option exists inside the File menu.
3. Select the surface you want to export, by highlighting it in the project tree, and write:
triSurf().writeFms("surfaceName.fms")
in the python console.
This executes the script with the selected mesh as its argument, and writes the fms file with the given name into the directory where Salome is installed. You can also provide an absolute path to get the fms file written to the desired location.

I hope this helps you move forward.

Regards,

Franjo
Ciao, Franjo
I just tested it (on 7.5.1): it works very well!
Many thanks
Piero
p.s. it could be a good idea to make a sub-forum about cfMesh use . . .
franjo_j likes this.
pici is offline   Reply With Quote

Old   January 13, 2016, 08:40
Default
  #10
New Member
 
Javier Añez Perdomo
Join Date: May 2013
Location: Rouen, France
Posts: 6
Rep Power: 6
javierjap is on a distinguished road
Hi everyone.

I just began using cfMesh on last Monday. And I am also new in OF and Salome.
I followed the steps described below, but I got this message from the python console:

>>>triSurf().writeFms("meshPractice.fms")
Converting SMESH Mesh 'Mesh_1'
Done
Traceback (most recent call last)
File ''<input>'', line 1, in <module>
File /path_to_salomeTriSurf.py, line 344, in writeFms
f = open(fileName, 'wb') #NOTE: file opened as binary to ensure unix-style line breaks
IOError: [Errno 13] Permission denied: 'meshPractice.fms'


I am using Salome 7.6
Please anyone
Thanks in advance

JAP



Quote:
Originally Posted by franjo_j View Post
Ciao Piero,

Yes, I am the principal developer of cfMesh. However, the scripts for Salome are the contribution from Ivor Clifford.
In order to export the surface from Salome I usually do the following:
1. Generate a triangulation in Salome, within the Mesh module.
2. Import the salomeToSurf.py script. The Load Script option exists inside the File menu.
3. Select the surface you want to export, by highlighting it in the project tree, and write:
triSurf().writeFms("surfaceName.fms")
in the python console.
This executes the script with the selected mesh as its argument, and writes the fms file with the given name into the directory where Salome is installed. You can also provide an absolute path to get the fms file written to the desired location.

I hope this helps you move forward.

Regards,

Franjo
javierjap is offline   Reply With Quote

Old   January 18, 2016, 10:00
Default
  #11
Member
 
pici's Avatar
 
Pierluigi Cirrottola
Join Date: Jun 2013
Posts: 49
Rep Power: 6
pici is on a distinguished road
Quote:
Originally Posted by javierjap View Post
Hi everyone.

I just began using cfMesh on last Monday. And I am also new in OF and Salome.
I followed the steps described below, but I got this message from the python console:

>>>triSurf().writeFms("meshPractice.fms")
Converting SMESH Mesh 'Mesh_1'
Done
Traceback (most recent call last)
File ''<input>'', line 1, in <module>
File /path_to_salomeTriSurf.py, line 344, in writeFms
f = open(fileName, 'wb') #NOTE: file opened as binary to ensure unix-style line breaks
IOError: [Errno 13] Permission denied: 'meshPractice.fms'


I am using Salome 7.6
Please anyone
Thanks in advance

JAP
Hi Javier,
perhaps you are trying to send your .cms file to a protected directory.
In python console, write:
import os
print os.getcwd()

you will see the actual dir where your are attempting to write.
Write now:
dir="yourdirname"
os.chdir(dir)
where "yourdirname" is complete path of a directory where you have a complete hownership and try to use again TriSurf().writeFms("meshPractice.fms")
I hope it is enough
bye
Piero
pici is offline   Reply With Quote

Old   January 20, 2016, 13:17
Default
  #12
New Member
 
Javier Añez Perdomo
Join Date: May 2013
Location: Rouen, France
Posts: 6
Rep Power: 6
javierjap is on a distinguished road
Quote:
Originally Posted by pici View Post
Hi Javier,
perhaps you are trying to send your .cms file to a protected directory.
In python console, write:
import os
print os.getcwd()

you will see the actual dir where your are attempting to write.
Write now:
dir="yourdirname"
os.chdir(dir)
where "yourdirname" is complete path of a directory where you have a complete hownership and try to use again TriSurf().writeFms("meshPractice.fms")
I hope it is enough
bye
Piero
Thanks so much Piero for your reply. Although I had found a solution before

Since that was my first time using python console in Salome, I did not know that the scripts need to be located where Salome is being run.

However, I have another question. Have you managed to create smooth boundary layers using cartesianMesh? I mean, I am trying to get similar cell size between the last boundary layer and its neighbor cell.

Attached I sent you two pictures:
The first picture is just a simple case to demonstrate the big difference between the last boundary layer and its neighbor cell, and the second picture both cells are approximately the same size.

Best regards
JAP
Attached Images
File Type: jpg Screenshot from 2016-01-20 17:54:11.jpg (105.0 KB, 40 views)
File Type: jpg Screenshot from 2016-01-20 17:57:46.jpg (123.0 KB, 35 views)
javierjap is offline   Reply With Quote

Old   January 20, 2016, 21:08
Default
  #13
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 118
Rep Power: 9
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Hello,

Quote:
Originally Posted by javierjap View Post
Thanks so much Piero for your reply. Although I had found a solution before

Since that was my first time using python console in Salome, I did not know that the scripts need to be located where Salome is being run.

However, I have another question. Have you managed to create smooth boundary layers using cartesianMesh? I mean, I am trying to get similar cell size between the last boundary layer and its neighbor cell.

Attached I sent you two pictures:
The first picture is just a simple case to demonstrate the big difference between the last boundary layer and its neighbor cell, and the second picture both cells are approximately the same size.

Best regards
JAP
The explicit control does not exist, yet. Though, you can try to play with the thicknessRatio and the number of layers. This may get you what you want.

Regards,

Franjo
javierjap likes this.
__________________
Principal Developer of cfMesh
www.cfmesh.com
Social media: LinkedIn, Twitter, YouTube, Google+, Facebook, Pinterest
franjo_j is offline   Reply With Quote

Old   February 23, 2017, 06:10
Default
  #14
New Member
 
Sam
Join Date: Feb 2017
Posts: 1
Rep Power: 0
SamHardyUK is on a distinguished road
Hi guys, this is my first post so please be kind!

I created an fms file using the salomeTriSurf.py script and the triSurf().writeFms("draftTube8.fms") function as outlined by franjo_j - this was successful and I have the .fms file in the correct directory and tried to mesh using cartesianMesh and got the following terminal window failure:

Create time

Setting root cube size and refinement parameters
Root box (-2.446 -3.36 -4.096) (5.746 4.832 4.096)
Requested cell size corresponds to octree level 13
Refining boundary
Refining boundary boxes to the given size
Finished refining boundary boxes
Performing automatic refinement
Performing automatic refinement
Marking inside/outside.
Number of internal boxes is 100736558
Number of outside boxes is 70662364
Number of data boxes is 52416923
Number of unknown boxes is 0
Killed


This case has been run using a simple .fms file that was created from a merged .stl using surfaceToFMS.
So my question is, why would the .fms file created in salome cause the cartesianMesh to fail? The only change I have made to the fms file created in salome is to change the inlet and outlet from wall to patch and left the main body as wall.
p, li { white-space: pre-wrap; salomeTriSurf.py p, li { white-space: pre-wrap; }
SamHardyUK 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
sliding mesh problem in CFX Saima CFX 45 September 22, 2015 10:53
No layers in a small gap bobburnquist OpenFOAM Native Meshers: snappyHexMesh and Others 6 August 26, 2015 09:38
Mesh sensitivity when using phase change models BKaus STAR-CCM+ 0 February 28, 2012 21:51
2D Mesh Generation Tutorial for GMSH aeroslacker Open Source Meshers: Gmsh, Netgen, CGNS, ... 12 January 19, 2012 04:52
Help with UDF to change mesh by external mesh generator zou_mo Fluent UDF and Scheme Programming 1 July 1, 2009 04:57

Sponsored Links


All times are GMT -4. The time now is 15:17.