
[Sponsors] 
January 12, 2008, 05:59 
How can generate Uniform Cartesian grid?

#1 
Guest
Posts: n/a

Hi, Guys
I need generate uniform Cartesian grid for any arbitrary geometry. This is supposed to be used for some specific multiphaseflow coding. At the first step, I mesh the domain which should cover the whole geometry of interest, and be possibly larger than the space occupied by the geometry. The second step is to determine which cubic cells are located inside the geometry. The third step is to cut the cells near the boundaries of the geometry. I would appreciate your hints about the last two steps. Is there any package available to handle this problem? Regards, Harry 

January 12, 2008, 07:55 
Re: How can generate Uniform Cartesian grid?

#2 
Guest
Posts: n/a

Harry,
this seem so be a non trivial problem. There are several packages out there that try to do this. Especially for highly complex geometry cutting step is extremly difficult and generating good cell quality is a challange. I need some more information: What does you geometry look like? Is it very complex? Do you need to access the mesh generated in Step 2 (Inside cells, not boundary fitted)? Is your initial surface closed and manifold? How good is th emesh quality of your inital surface mesh? (criterions like triquality or equiangle skewness may be helpful) BastiL 

January 12, 2008, 09:34 
Re: How can generate Uniform Cartesian grid?

#3 
Guest
Posts: n/a

i do some job in this regard, related paper is:
http://www3.interscience.wiley.com/c...TRY=1&SRETRY=0 this paper describe fairly simplems possible method to generate cartesian grid, its implementation is available here: http://mehr.sharif.ir/~tav/cartgen.htm 

January 12, 2008, 09:40 
Re: How can generate Uniform Cartesian grid?

#4 
Guest
Posts: n/a

correct link to paper is: http://dx.doi.org/10.1002/fld.1685


January 12, 2008, 14:28 
Re: How can generate Uniform Cartesian grid?

#5 
Guest
Posts: n/a

Interesting project. I tried to compile it but I struggle with gfortran. Which compiler is best?
These structured octree methods face lots of challenges. All codes have their certain pros and cons so it might be helpful to know how Harrys requirements are. I know most of the tools and can give him some feedback afterwards. 

January 12, 2008, 15:39 
Re: How can generate Uniform Cartesian grid?

#6 
Guest
Posts: n/a

> Interesting project. I tried to compile it but I struggle with gfortran. Which compiler is best?
i think that it will be possible to compile it under any f90 compiler (i have tried DF), maybe you sholud separate module part from other parts and then compile its. > These structured octree methods face lots of challenges. i do not understand what you mean, but i could say that, generation of "Cartesian Octree" is fairly robust and simple procedure and there is not any challenge in this regard. but note that: you sholud have a healthy CAD geometry, without gap, ..., fortunately there are several methods to repaire CAD files ! 

January 12, 2008, 17:40 
Re: How can generate Uniform Cartesian grid?

#7 
Guest
Posts: n/a

Thanks, how do I seperate modules? I will lool for the error messages  it has something to do with boolean operators as far as I remember.
The challenges: Generating a healty CAD is one of these. I do not really know good ways to repair really compelex CAD data so far.... So this sould be possible to handle as very few meshers can. What CAD repair do you propose? Another one is boundary adaption. I have seen very few (commercial) tools that are able to produce sufficiant quality for really complex geometries. Some companies do not even try to programm such a tool... Cartesian octree itself is robust no doubt. 

January 12, 2008, 19:02 
Re: How can generate Uniform Cartesian grid?

#8 
Guest
Posts: n/a

Harry,
What kind of geometry do you have? I would like to take a try at it with HyperionMesh3D. Mesh3D generates a structured Hexahedral mesh from generic input geometries. I would be happy to issue a free license for your evaluation. Also, if anyone else is interested, please contact me. www.titanalgorithms.com/hyperion_mesh3d Best Regards DSS Last edited by wyldckat; March 9, 2014 at 17:09. Reason: removed image that was showing publicity, as the site is now dead 

January 12, 2008, 19:36 
Re: How can generate Uniform Cartesian grid?

#9 
Guest
Posts: n/a

impressive work! This is the part that I wanted. I calculate dense gassolid flows. Hopefully, uniform Cartesian grid is just used to calculate solid concentration which requires to be mapped to CFD grid later. CFD grid generated by some commercial grid generators such as Gambit and ICEM/CFD is composed of arbitraryshape cells. I can extract surface grid and triangulate it for the generation of uniform Cartesian grid. So my case may not be as hard as what BastiL is considering although I do be looking for a generalizedpurpose method. However, in my work I need calculate solid concentration/porosity by dividing the volume of particles with the volume of cell where the particles are residing. This means that cell size needs to be big enough to obtain solid concentration having physical meanings, and it is necessary to obtain the exact volumes of the boundary cells which are partially located inside the domain of interest. I have quickly looked through rt's paper, it seems these volumes are not available in his method. Therefore I would appreciate your further suggestion.
Cheers, Harry 

January 13, 2008, 12:15 
Re: How can generate Uniform Cartesian grid?

#10 
Guest
Posts: n/a

rt, this is what I get with gfortran (mere than once):
... IF(FLG_OCTREE) CALL MAKE_REMAINED_LEVELS 1 Error: ELSE IF clause at (1) requires a scalar LOGICAL expression ... However your project looks interestign. Can you tell me more: What input and output file formats, is boundary fitting of octree mesh to geometry done and if yes, how? Thanks. BastiL 

January 15, 2008, 09:33 
Re: How can generate Uniform Cartesian grid?

#11 
Guest
Posts: n/a

> However, in my work I need calculate solid concentration/porosity by dividing the volume of particles
this is separated task from grid generator, you only need to determine number/type (include their volume) of particles in each cartesion cell which is easy for a uniform cartesian mesh. > and it is necessary to obtain the exact volumes of the boundary cells which are partially located inside the domain of interest my method compute approximate partial volume with more than 2nd order accuracy (you could increase its), i disscuss in paper about its. When we use approximate method (FDM, FVM, ...) why you try to use exact geometry! note that accuracy of suggested approximate method could be easily controlled and i think for a corse grid an geometry with approximately smooth boundary, it could be matched with computer floating point resolution. but if you look for exact one (which is not essential in my opinion) you should implement method like M. Aftosmis method (AIAA98) which is fairly difficult to implement and needs stateoftheart background in computational gometry 

January 15, 2008, 09:43 
Re: How can generate Uniform Cartesian grid?

#12 
Guest
Posts: n/a

regarding to error under gfortran let me time to check its, now i am busy but i post my comment in this regard as soon as possible (but i think it will be very easy to resolve, basically compile of Fortran code is not challenge).
redarding to CAD repaire: I list a few one in CartGen paper (get your email, i will send paper if u do not have access) some of them are opensource , e.g. http://graphics.stanford.edu/software/volfill/ is one of the old methods, for some of them binary package are available. Usually a surface triangulation, e.g. STL is required, but cargen is work of 0506 and now there are more methods and more tools for this (if you realy look for a cad fixing tool send me an offline email) some new methods get only point cloud and generate healthy triangulation over it, basically noone claim for robust method to repair dirty geometries (read related papers to figure out what is challenge in this field), but results are usually satisfactory. a good resource in this field is ACM: http://portal.acm.org/ (ACM SIGRAGH and ACM TOG is one of the best) search in this bank by suitable keyword, if you do not have direct acces to paper do not worry in the computer science field peoples usually put their work on web and with google you usually could get them. Also, you could use some from refs. of cartgen paper in this field, and then follow their citation by google scholar to know what is new works and statoftheart CADFIX is a commercial package for this too, also i heard from my friends that SolidWork could repair "dirty" STL files > I have seen very few (commercial) tools that are able to produce sufficient quality for really complex geometries probably you mean bodyfitted grid not cartesianoctree, i should say that i only know one semicommercial cartesain octree solver (available only for US), Cart3D due to M. Aftosmis. Writing an immersed boundary octree flow solver is an order of magnitude difficult in contrast to bodyfitted solver (if we try to preserve efficiency). to my knowledge adaptation available in commercial grid generators are not fully automatic and generation of a suitable method needs large human efforts and is really art. (automation is one of main benefits of Cartesian solver) 

January 15, 2008, 09:45 
Re: How can generate Uniform Cartesian grid?

#13 
Guest
Posts: n/a

regarding to compile error, i feedback in near future, i am quit busy right now.
> However your project looks interestign. Can you tell me more: What input and output file formats, is boundary fitting of octree mesh to geometry done and if yes, how? please look at the paper, method is quit clear and easy, you got all of your question are answered un its (get your email, i could forward its) input geometry is surface triangulation, e.g. STL you could write output based on your need, only for show i put Tecplot and binary VTK (paraveiw read its) 

January 15, 2008, 09:45 
Re: How can generate Uniform Cartesian grid?

#14 
Guest
Posts: n/a

regarding to compile error, i feedback in near future, i am quit busy right now.
> However your project looks interestign. Can you tell me more: What input and output file formats, is boundary fitting of octree mesh to geometry done and if yes, how? please look at the paper, method is quit clear and easy, you got all of your question are answered un its (get your email, i could forward it to u) input geometry is surface triangulation, e.g. STL you could write output based on your need, only for show i put Tecplot and binary VTK (paraveiw read its) 

January 15, 2008, 10:31 
Re: How can generate Uniform Cartesian grid?

#15 
Guest
Posts: n/a

Thanks so far rt. I have no access to the paper and CAD repair is of interest for me, I have stlFiles. My EMail:
BastiL2001@yahoo.de You're right I mean body fitted meshing. 

January 15, 2008, 18:33 
Re: How can generate Uniform Cartesian grid?

#16 
Guest
Posts: n/a

Could you send me too a copy of your paper ? I try to use CartGen compiling it with gfortran: I solve some problems in order to compile it, and at the end I've been able to compile it and process your example files. But I've a working file only for tecplot format; for VTK format, changing some part of the OPEN instruction in the subroutine in order to compile with gfortran, I was not be able to read the binary file with Paraview 3.2: do you have some suggestions ? Thanks Marco


January 15, 2008, 18:53 
Re: How can generate Uniform Cartesian grid?

#17 
Guest
Posts: n/a

"my method compute approximate partial volume with more than 2nd order accuracy (you could increase its), i disscuss in paper about its."
Great! this is exactly what I want. "When we use approximate method (FDM, FVM, ...) why you try to use exact geometry!" In my case, Cartesian grid is only used to evaluate solid concentration. Now it seems all my problems have got being solved. Thanks for your kindly help. Cheers, Harry 

January 16, 2008, 01:43 
Re: How can generate Uniform Cartesian grid?

#18 
Guest
Posts: n/a

Harry,
so what u need is a (high resolution) uniform cartesian grid (not octree), then u could extract partial volume, etc. information easily from its based on method disscussed in the paper. My code has a simple version for generation of uniform grid too, which is more easy to use and understand, give your mail ID i forward its to you. 

January 16, 2008, 01:49 
Re: How can generate Uniform Cartesian grid?

#19 
Guest
Posts: n/a

> Could you send me too a copy of your paper ?
give ur mail ID please let me know what u do to compile its under gfortran. note that the output is only for showing the results, to use grid you should write your own output. basically, i try to introduce an easy to implement cart grid generator (for uniform one it takes belw 2 days for me from scratch and i think for a people that read paper it take more little time), so code is not designed for end user and is not well documented with suitable output port, and is just to show programming and ease of implementation, i.e., converting 3d grid generation over complex geometry to sequense of 2d grid generation and in the same manner converting 2d to sequence of 1d grid generation 

January 16, 2008, 03:51 
Re: How can generate Uniform Cartesian grid?

#20 
Guest
Posts: n/a

"so what u need is a (high resolution) uniform cartesian grid (not octree), then u could extract partial volume, etc. information easily from its based on method disscussed in the paper. My code has a simple version for generation of uniform grid too, which is more easy to use and understand, give your mail ID i forward its to you."
This would greatly help. My email is s.b.kuang@gmail.com 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Pressure instability with rhoSimpleFoam  daniel_mills  OpenFOAM Running, Solving & CFD  44  February 17, 2011 18:08 
Problems with Turbulence Modeling  ezsoal  OpenFOAM Running, Solving & CFD  4  November 26, 2009 16:12 
FOAM FATAL IO ERRORsimpleFoam  hariya03  OpenFOAM Running, Solving & CFD  6  July 16, 2008 08:03 
RasInterFoam STRANGE RESULTS AT BOUNDARY  kumar2  OpenFOAM Running, Solving & CFD  8  March 24, 2008 19:38 
On grid independent solution for pulsatile flow  David  FLUENT  4  June 8, 2005 16:20 