|
[Sponsors] |
November 29, 2010, 00:37 |
How to create large Mesh?
|
#1 |
Member
Join Date: Nov 2010
Posts: 33
Rep Power: 15 |
I am working on nonnewtonianIcofoam. I refined the mesh using refineMesh utility. The current mesh structure is as follows:
Mesh stats points: 14884 internal points: 0 faces: 29042 internal faces: 14182 cells: 7200 boundary patches: 6 point zones: 0 face zones: 0 cell zones: 0 Overall number of cells of each type: hexahedra: 7180 prisms: 0 wedges: 0 pyramids: 0 tet wedges: 0 tetrahedra: 0 polyhedra: 20 I would like to increase the number of cells and faces in this mesh to a large value (say 200K). Please suggest the way to do it. Can it be done using blockMesh? It will be great if I can get some kind of help. Thanks!! |
|
November 29, 2010, 05:29 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
Yes, it can be done. Edit the file constant/polymesh/blockMeshDict. See the user guide on how to do it.
|
|
December 3, 2010, 23:43 |
|
#3 |
Member
Join Date: Nov 2010
Posts: 33
Rep Power: 15 |
Hey Anton,
Thanks for your response. Good to see reply from TUD, I was associated with TUD for last 2 years. 1. As I understand, I can edit the blockMeshDict. But it will require adding the vertices, edges etc. by hands. I am looking for an automated way to create a very refined mesh which increases the size of ldu matrix, and hence leads to a computational intensive case. Please suggest. 2. I can refine the mesh repeatedly using refineMesh. But after some iterations of refineMesh, the checkMesh utility starts reporting problem with the generated mesh. Please suggest a way to create a large mesh without using refineMesh utility. Thanks in Advance !! |
|
December 4, 2010, 09:09 |
|
#4 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22 |
Hi pkr,
here are two python scripts and an OpenFOAM case that might be useful: it's just a simple tube, but you can easily increase the number of elements. First, you can increase the mesh_density parameter, second you can increase the length of the tube. Have a look at line 172 of "pyCylinder.py": you can increase length and mesh density here. You must define an appropriate path to your file system here, too. Start the script with: Code:
python pyCylinder.py By the way I recommend to use simpleFoam instead of nonNewtonianIcoFoam. Getting a steady state solution is simple, fast and reliable. You should get all information you need for your computation time analysis. Despite of that it would be easy to switch to nonNewtonianIcoFoam, too. The usage of the script can be automized further, p.e. by making a loop changing the case path name and mesh size. The other files for completion of the case can be copied to the new directories (i.e. system, constant and 0 folders). OpenFOAM can be started automatically in each loop, and the times for PCG solver can be found in the simulation log file.... Do you have different processors to run your cases on? It would be nice to have some benchmarks, if you are analyzing computation times anyway... Hope the scripts are useful, Martin |
|
December 8, 2010, 18:04 |
|
#5 |
Member
Join Date: Nov 2010
Posts: 33
Rep Power: 15 |
Hi Martin,
The scripts provided by you are really very useful. I am analyzing OpenFoam for different multi-core architectures. I don't have any benchmarks at this moment, but I will let you know once I get some. Following queries: 1. I would like to know if the similar script can be used for other applications in the tutorial? As I see the folder 0 differs from application to application. Please suggest the way to incorporate it to other applications like multiphase, heat transfer etc. 2. In the script, changing of both density as well as length leads to increase in number of cells. How is changing density different from the changing length? Thanks !! |
|
December 9, 2010, 03:17 |
|
#6 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22 |
Hi,
ad 1.) Since the script only provides a blockMeshDict file it is independent from the application. The mesh can be used by any OpenFOAM solver. A very typical way to set up an OpenFOAM case is: - Select the solver you want to use. - Copy the case structure for the selected solver from the tutorials directory. The case structure mostly consists of "0", "system" and "constant". - Insert the blockMeshDict from the script into "constant/polyMesh" and generate the mesh with the blockMesh command. - Next you must adjust the files in the "0" directory, so that each file has correct boundary conditions defined for the patches from your blockMeshDict. In my case these are "inlet", "outlet" and "wall". - Check the settings for material laws, turbulences etc. in the "constant" directory. - Adjust the controlDict file in the "system" folder to your needs. Tune the "fvSchemes" and "fvSolution" in "system" folder if necessary. In your particular case you are going to spend much time in "fvSolution", since this is the place to deal with the linear solver settings. After you have defined the case for your selected solver once you can copy your case to your next project. Only minor adjustments will be necessary to do, once you got your standard cases. You can easily write a script to copy the complete case structure for each new test run you want to perform. If you only want to change the mesh size, only one file will differ for each run. ad 2.) The mesh density parameter applies to one quarter of the tube as you can see in the attached image. A value of 10 will provide 10 cells in x and y direction of the block. To have a different number of cells in one of the direction change line 87. For the number of cells in z direction let's have a look at lines 86 to 91: Code:
d = self._mesh_density d2 = d z_level_1 = int(self._l / (((2*math.pi*self._r)/(d*4.0))))+1 sum_cells = 5 * d * d2 * z_level_1 print "Number of cells: %i" %(sum_cells) Instead of this automatism you can add another parameter to the script that takes the number of elements in z direction. Same is true for the d2 parameter mentioned above. Here are some thoughts of mine, feel free to ignore them ;-) : Since your objective is to examine the behavior on multi core architecture I would concentrate on only one or two solvers. Most solvers behave very similar concerning the underlying hardware, so solving the same pressure equation in dozens of different solvers don't provide useful information. Further more I would drop all turbulence related stuff. It can take too many time only to get the simulation converging. I would not use time discretized solvers either. The time steps have great influence on stability, the mesh density limits the time steps, the time for solving the equation systems depends on the chosen time steps.... too complicated... So my favorite would be simpleFoam with laminar and steady state flow, using a high viscosity Newtonian fluid. May be you can add a scalar transport to the solver to get a rather simple additional equation system. To benchmark the pure effect of hardware architecture I would only change length of the tube. The simulation itself will stay in a physically meaningful range. You should consider of using the OpenFOAM-1.6-ext version. It has some very interesting AMG solver variants. There are papers dealing with the performance mentioned here: http://www.cfd-online.com/Forums/ope...41dev-svn.html Looking forward to your benchmarks Martin |
|
January 21, 2011, 00:19 |
|
#7 |
Member
Join Date: Nov 2010
Posts: 33
Rep Power: 15 |
Hi Martin,
Have you worked with parallel decomposed cases? I am trying an experiment on interFoam/laminar/damBreak case. The number of cells in the generated mesh is 955000. To run in parallel, the mesh decomposition is done using metis decomposition. When decomposed and running for 4 cores (quad-core Xeon E5620 ), it works perfectly fine. On changing the decomposed case to 2-cores, After some time of running, the systems hangs and displays the following error: "mpirun noticed that process rank 0 with PID 3758 on node exited on signal 11 (Segmentation fault)." Both of the cases (2-cores and 4-cores) work fine for lower number of cells (< 600000 cells). Please suggest. Thanks!! |
|
January 31, 2011, 07:16 |
|
#8 |
Senior Member
Join Date: Nov 2010
Posts: 113
Rep Power: 16 |
Hi pkr,
just for your interest, I'm using the decomposition method metis for parallelization as well and quite often on 2 cores with more than 1 000 000 cells without any problem. Maybe you want to upload the case, so I could give it a try? Greetings |
|
February 1, 2011, 12:54 |
|
#9 | |
Member
Join Date: Nov 2010
Posts: 33
Rep Power: 15 |
Quote:
Thanks for your response. I have attached the case, can you please try and see. Thanks |
||
February 1, 2011, 13:01 |
|
#10 |
Member
Join Date: Nov 2010
Posts: 33
Rep Power: 15 |
Hi lindstroem, Can you also upload your case for me to try?
Thanks |
|
February 2, 2011, 07:26 |
|
#11 |
Senior Member
Join Date: Nov 2010
Posts: 113
Rep Power: 16 |
Hi pkr,
Code:
Create time Time = 0 Create mesh Calculating distribution of cells Selecting decompositionMethod metis Finished decomposition in 1.89 s Calculating original mesh data Distributing cells to processors Distributing faces to processors Calculating processor boundary addressing Distributing points to processors Constructing processor meshes Processor 0 Number of cells = 477656 Number of faces shared with processor 1 = 606 Number of processor patches = 1 Number of processor faces = 606 Number of boundary faces = 38720 Processor 1 Number of cells = 477344 Number of faces shared with processor 0 = 606 Number of processor patches = 1 Number of processor faces = 606 Number of boundary faces = 38680 Number of processor faces = 606 Max number of processor patches = 1 Max number of faces between processors = 606 Processor 0: field transfer Processor 1: field transfer End. Greetings |
|
February 2, 2011, 11:16 |
|
#12 |
Member
Join Date: Nov 2010
Posts: 33
Rep Power: 15 |
Hi lindstroem,
Thanks for your reply. I don't have any problem in decomposition, the problem comes when I run the case after decomposition. Thanks. |
|
February 3, 2011, 05:43 |
|
#13 |
Senior Member
Join Date: Nov 2010
Posts: 113
Rep Power: 16 |
Sorry, got that wrong. I started a computation (with unphysical boundary conditions, but I had no time to set up a "realistic" case) and it ran for 10 minutes. I can try your boundary conditions if you send them (maybe the whole case-directory).
Greetings BTW: Changing the decomposition method sometimes helps as well.. e.g. try scotch instead of metis. But I dont know if this helps in your case.. Last edited by lindstroem; February 10, 2011 at 09:33. |
|
April 21, 2013, 15:58 |
|
#14 |
Member
ehk
Join Date: Sep 2012
Posts: 30
Rep Power: 14 |
Hi
I need the computational domain with layers of quads that have about equal lengths (a=b=c). From the bottom to the top, each layer has quads of increasing size.I there any way to create it in OF. |
|
April 22, 2013, 14:18 |
|
#15 | ||
Member
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 17 |
Hello,
To refine the mesh starting from a blockMeshDict file, you can change the number of cell per block directly at the creation of the block: Quote:
Quote:
I'm not an expert, but it is how I do to refine my meshes (I include some parameters in my M4 file). The good thing is that if you do it well, you have full control of your mesh. Hope it can help. Last edited by Yosmcer; May 4, 2013 at 09:50. |
|||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
Gambit problems | Althea | FLUENT | 22 | January 4, 2017 04:19 |
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation | tommymoose | ANSYS Meshing & Geometry | 48 | April 15, 2013 05:24 |
[Gmsh] 2D Mesh Generation Tutorial for GMSH | aeroslacker | OpenFOAM Meshing & Mesh Conversion | 12 | January 19, 2012 04:52 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |