CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Special Topics > Mesh Generation & Pre-Processing

How to use MEGACADS (DLR)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By NablaDyn

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2019, 08:01
Default How to use MEGACADS (DLR)
  #1
Senior Member
 
NablaDyn's Avatar
 
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 11
NablaDyn is on a distinguished road
I invite the users of the free and GUI-supported structured mesh generator MEGACADS (German Aerospace Centre, DLR) to ask questions regarding use, pre- and post-processing here. Additional information and documentation can be found on the web: http://www.megacads.dlr.de/


Note: MEGACADS is a bit buggy. However, once familiar with its special needs and syntax, it provides a useful technology to generate high-quality hexahedral grids, e.g. for OpenFOAM. It can be run interactively or in batch mode on PC and HPC architectures.


Other MEGACADS-related threads can be found here:
Installation: MegaCads Installation on Ubuntu
CAD-Import/Start-Up: Problem with import in MegaCads
MegaCads mesh manipulation and conversion to OpenFOAM format (software on ResearchGate, look for BLoOMYBOXX VX.Y): https://www.researchgate.net/publica...YBOXX_Download
Chris2337 likes this.

Last edited by NablaDyn; October 6, 2019 at 09:49. Reason: Appended Links to other threads.
NablaDyn is offline   Reply With Quote

Old   December 30, 2019, 14:05
Default
  #2
Member
 
yoooodarulez's Avatar
 
Nick
Join Date: Nov 2009
Posts: 45
Rep Power: 17
yoooodarulez is on a distinguished road
Dear NablaDyn,

I have come to the point where i have familiarized myself with the syntax and the commonly used commands and after going through some of the 2d/3d tutorials, offered within the MegaCads folder itself, id like to proceed with some more complicated geometry files such as .igs/.stl. You have already mentioned that MegaCads is able to import such files (stl in particular) through the import_geometry 7 "name.stl" 0 0 command, which is, indeed, functioning, however, no manipulation can be made on top of it, as you, once again, have noted. As such, is it possible to import such a file and work on it?

Thanks!
Nick
yoooodarulez is offline   Reply With Quote

Old   January 3, 2020, 03:49
Default
  #3
Senior Member
 
NablaDyn's Avatar
 
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 11
NablaDyn is on a distinguished road
Quote:
Originally Posted by yoooodarulez View Post
Dear NablaDyn,

I have come to the point where i have familiarized myself with the syntax and the commonly used commands and after going through some of the 2d/3d tutorials, offered within the MegaCads folder itself, id like to proceed with some more complicated geometry files such as .igs/.stl. You have already mentioned that MegaCads is able to import such files (stl in particular) through the import_geometry 7 "name.stl" 0 0 command, which is, indeed, functioning, however, no manipulation can be made on top of it, as you, once again, have noted. As such, is it possible to import such a file and work on it?

Thanks!
Nick

Hi Nick,
As of yet, I don't know of any mechanism in MegaCads to import "active" geometry other than reading in polyline data (the ".dat" files mentioned somewhere in the documentation) or by conversion/derivation of 3D geometry into splines/B-splines (this is what I regularly do). For instance, in FreeCAD (www.freecadweb.org) I start by decomposing my original solid body geometry into shells/surfaces. Then I cut through these faces using another "helper-surface/plane" (boolean operations or else) and the resulting cutting line is exported as polyline, i.e. simply an ordered list of points, say 100 points, (remember, you can convert polylines into splines in MegaCads). I mostly use 3 to 5 polylines per direction (u,v) of each surface. The result is a some sort of grid approximating your geometry.
I know this is not very straight-forward but it always served my needs. I always eyeballed a simple software that fits spline surfaces (those can be imported directly into MegaCads, given the right formatting as POPINDA data or else) into unstructured data (STL or points) but never found the time to search for one or write my own. It should be feasible though with modest effort.
If you know that your surface is a Coons surface, it is enough to import the bounding curves and recreate the surface in MegaCads.

Hope this helps a bit. A surface-fitting tool (maybe implemented in bloomyboxx) is not yet off the table but I don't know when I will find the time.


happy new year btw!

Martin

Last edited by NablaDyn; January 3, 2020 at 03:51. Reason: Typo
NablaDyn is offline   Reply With Quote

Old   January 6, 2020, 13:57
Default
  #4
Member
 
yoooodarulez's Avatar
 
Nick
Join Date: Nov 2009
Posts: 45
Rep Power: 17
yoooodarulez is on a distinguished road
Dear Martin,

Happy new year and thank you once more for your prompt reply!

Quote:
or by conversion/derivation of 3D geometry into splines/B-splines (this is what I regularly do)
Suppose that a similar pattern has been followed
Quote:
I start by decomposing my original solid body geometry into shells/surfaces. Then I cut through these faces using another "helper-surface/plane" (boolean operations or else) and the resulting cutting line is exported as polyline, i.e. simply an ordered list of points, say 100 points
to derive these polylines. A couple of questions arise, into my head, regarding the said procedure:

1) The format of the exported polylines is similar to the .dat files which have already been imported into MegaCads, so far? This may be a silly question but, until now, i have always worked with already prepared .igs files, without paying attention to the actual structure of the data sets, included within the file. It goes without saying that I will familiarize myself with it, from now on
2) Consequently, if that is the case and if I am not mistaken, the following step would be to use spline_polygon command, for all these entities, or is it that they have been already been imported into MegaCads as splines?

Quote:
I mostly use 3 to 5 polylines per direction (u,v) of each surface. The result is a some sort of grid approximating your geometry
I suppose that using more will increase the resemblance of the actual geometry?

Quote:
If you know that your surface is a Coons surface, it is enough to import the bounding curves and recreate the surface in MegaCads.
This is actually another question of mine. So far, we have imported the aforementioned polylines into MegaCads, but no surfaces whatsoever. These surfaces can be produced through the use of the already created polylines (surrounding the required surfaces) under the def_coons_splines command?

Then again, for this scenario to be effective, one has to provide several key-splines, forming the coons surfaces, which may not be easily derived in some cases?
If that is so, is there any other way around it?

Thanks again!

Nick
yoooodarulez is offline   Reply With Quote

Old   January 8, 2020, 06:55
Default
  #5
Senior Member
 
NablaDyn's Avatar
 
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 11
NablaDyn is on a distinguished road
Hi Nick,
Quote:

to derive these polylines. A couple of questions arise, into my head, regarding the said procedure:

1) The format of the exported polylines is similar to the .dat files which have already been imported into MegaCads, so far? This may be a silly question but, until now, i have always worked with already prepared .igs files, without paying attention to the actual structure of the data sets, included within the file. It goes without saying that I will familiarize myself with it, from now on
What exactly the output format will look like depends on the CAD software or the export format you use. I prefer simple ASCII point data, so I can check manually for consistency etc. (e.g., whether start and end point are exactly at the wanted positions). For example, if you export a 4-node line in FreeCAD as ASCII point file, it should look something like this:
Code:
-1 0 0
-0.5 0 0
0 0 0.02
0.5 0 0.04
To import such a line into MEGACADS, use copy/paste or else and simply stick to the format descriptions for .dat or ASCII POPINDA files mentioned in the MEGACADS documentation which means you have to add some very basic header info. A block can be a 1D, 2D or 3D "mesh", i.e. nothing more than an ordered 3D point list. The above line would thus take the following form in POPINDA format:
($$ Comments in POPINDA format, #: My additional explanations for your better understanding)
Code:
$$  nblock  nlevel  icoord
#  nblock: No of "blocks" in file; nlevel and icoord: Always "1"
    1      1       1 
$$ PROJECT= "Lorem Ipsum..."
$$ SCRIPT= "/whatever/.../SAVE_PROC_FILE"
# Start of block 1
$$  physical block dimensions:
$$   i    j    k    iwidth
# ijk: No of nodes/points in ijk direction, iwidth: Always "0"
    4      1       1       0 
$$  coordinates:
$$      x                y                z
-1        0        0
-0.5     0        0
0         0        0.02
0.5      0        0.04
# Next entity/block if you like
$$  physical block dimensions:
$$   i    j    k    iwidth
.
.
.
Be sure not to use tabs but only blanks as column separators in POPINDA files!!!
If you want to derive splines, I recommend .dat files. If you want to import a ready-to-process point distribution/mesh, I would most probably use POPINDA. These file types do not differ severly though. It is mostly a matter of how suited the resulting MEGACADS entity is for further processing. You can however convert both types into each other.

Quote:
2) Consequently, if that is the case and if I am not mistaken, the following step would be to use spline_polygon command, for all these entities, or is it that they have been already been imported into MegaCads as splines?
Exactly, at least if you read in a .dat file since it is of polygonal nature.

Quote:
I suppose that using more will increase the resemblance of the actual geometry?
For sure.

Quote:
This is actually another question of mine. So far, we have imported the aforementioned polylines into MegaCads, but no surfaces whatsoever. These surfaces can be produced through the use of the already created polylines (surrounding the required surfaces) under the def_coons_splines command?
I'm afraid my above statement concerning Coons is flawed. Sorry for that. It's been some weeks since I used Coons the last time. MEGACADS needs already a surface for Coons creation. You can however create a real Coons surface from bounding lines in FreeCAD's surface workbench (or other CAD software), derive uv lines and create the (topologically) 2D surface mesh manually (as described above). In that case, for instance in the POPINDA file i>1 and j>1

Quote:
Then again, for this scenario to be effective, one has to provide several key-splines, forming the coons surfaces, which may not be easily derived in some cases?
If that is so, is there any other way around it?
I assume that is a matter of the complexity of your geometry. Manually, I can export a single rather curvy surface in, say, 1 to 3 minutes. You might nevertheless significantly boost that process if your CAD software already comes with a function to derive splines/B-splines and output its ordered point list. Or, even automate it, if you fit splines into corresponding STL (or else) data using Matlab/Scilab or whatever software you are familiar with. I guess some trial and error experience will clear this up for you.

If you need more specific help, maybe you can share here/send me the geometry that you are dealing with.

Regards,

Martin

Last edited by NablaDyn; January 8, 2020 at 12:10.
NablaDyn is offline   Reply With Quote

Old   January 14, 2020, 23:59
Default
  #6
Member
 
yoooodarulez's Avatar
 
Nick
Join Date: Nov 2009
Posts: 45
Rep Power: 17
yoooodarulez is on a distinguished road
Dear Martin,

Thank you once more for the provided tips!

I guess it all comes down to trial and error, as you mentioned, regarding the CAD software of choice and the user's experience with it, in order to suit their needs.

I will take my time to familiarize myself with FreeCAD ( it is my understanding that it it a rather capable opensource software, which I, too, have come across quite some time now) and work my way, while taking your comments into consideration, from basic 3D geometries to my ultimate goal, which is ship hull modelling.

My guess: I will be back, very shortly, however, lets cross our fingers!

Thanks again!
Nick
yoooodarulez is offline   Reply With Quote

Old   August 18, 2021, 09:21
Default Deriving coons surfaces in MegaCads
  #7
Member
 
yoooodarulez's Avatar
 
Nick
Join Date: Nov 2009
Posts: 45
Rep Power: 17
yoooodarulez is on a distinguished road
Dear Martin,
Dear all fellow Megacads enthousiasts,

I hope you are doing well.

Lately, I am trying to use Megacads to derive the needed surfaces, out of the points/lines of a given drawing, by creating a POPINDA file format and utilizing the def_coons_splines command.

To my understanding, there are several cases where the initial drawing file (such as the lines plan of a vessel in this particular case) does not allow the user to create a single block with sets of equal numbers of points (if I am not mistaken this is how the software functions).

If my above assumption holds true, then, in those cases, one has to split the geometry into more blocks, in order to proceed forth.

Consequently, these blocks will be implemented either as a single file, incorporating them all (multiblock file), or, as multiple files, containing a single block each (is there, really, any difference between these 2 options ?)

If the input has been well considered (upper part connection between purple and green block- 1st attachment), I presume that there is no problem with the coons surfaces too. Once the command has been utilized then the surfaces will be created and no gap/overlapping will exist.

On the other hand, if not (gap between purple and light blue block) then, is there any command or strategy to tackle this issue?

In this 1st attachment, the problem could be solved because upper and lower blocks contain same number of points and thus they could be joined, similarly to the two upper blocks.
I just wanted to highlight the gap and to figure whether or not is there any solution in case where there is such gap when the 2 boundary blocks differ in their number of points.

As far as the latter scenario is concerned, the 2nd attachment depicts 3 blocks (purple, light blue, orange), which contain different number of points, surrounding a diamond-like shaped area in the middle. This aforementioned little area is not part of any of the 3 blocks and thus while trying to def_algebraic_grid_2 in the respective working plane, it seems that there is no such working plane (since this is not part of any block).

I was wondering if there are any commands (like concatenate or intersect or merge or something else), that skip my mind (it also seems that the DLR site is offline for quite some time now) and which tackle such issues.

Thanks in advance

https://ibb.co/6YT99sk 1st attachment
https://ibb.co/54NSTbJ 2nd attachment
yoooodarulez 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
[CAD formats] MegaCads Installation on Ubuntu NablaDyn OpenFOAM Meshing & Mesh Conversion 13 May 29, 2020 14:17
[ICEM] Volume mesh smoothing problem -DLR F6 Far ANSYS Meshing & Geometry 5 April 23, 2012 07:31
Looking for DLR F-5 model aweizazuji ANSYS 0 June 16, 2011 04:43
DLR TAU Code Tobias Hoell Main CFD Forum 2 June 11, 2011 14:32
Free structured grid generator: MegaCads Olaf Brodersen Main CFD Forum 0 February 11, 1999 04:16


All times are GMT -4. The time now is 12:44.