Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Importing complex geometry from matlab to comsol

Rafael Mayorga Gonzalez

Please login with a confirmed email address before reporting spam

Hi everyone, I would like to ask a question about importing the geometry from Matlab to Comsol (or Avizo to comsol). Actually, I have a 3D pore network (I got it after the skeletonization of the pore structure of a porous particle) consists of some cylinders with the different radii and length. It means that all these cylinders have volume and specific coordinates and position in 3D space. So the question is that: **Is it possible to import these cylinders from matlab to comsol? This network is irregular and the coordination number of nodes (junction point of cylinders) is different. **


2 Replies Last Post May 14, 2018, 5:22 a.m. EDT
Yara Soares COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago May 11, 2018, 8:09 a.m. EDT

Dear Roozbeh,

If you haven't gotten a reply back, please consider submitting your question to support@comsol.com for a swift reply.

Met vriendelijke groet, Best regards,

Yara Soares


COMSOL BV | Röntgenlaan 37 | 2719 DX Zoetermeer Phone: +31 (0)79 363 4230 | Fax: +31 (0)79 361 4212

www.comsol.nl | yara.soares@comsol.com

Dear Roozbeh, If you haven't gotten a reply back, please consider submitting your question to support@comsol.com for a swift reply. Met vriendelijke groet, Best regards, Yara Soares -------------------------------------------------------------------------- COMSOL BV | Röntgenlaan 37 | 2719 DX Zoetermeer Phone: +31 (0)79 363 4230 | Fax: +31 (0)79 361 4212 www.comsol.nl | yara.soares@comsol.com --------------------------------------------------------------------------

Please login with a confirmed email address before reporting spam

Posted: 7 years ago May 14, 2018, 5:22 a.m. EDT

Hi,

Easiest would have been if there was a livelink product that links Avizo to comsol. That you may check.

However, there are 3D import formats such as stl or 3D-CAD and probably more depending on the livelink products that you have. If you can export your geometry to any of these, then you can directly import them from GUI.

On the other hand, if you just want to load different regular geometries such as spheres or cylinders, you can easily load them from MATLAB. For example, to create the code, use GUI and generate a cylinder by giving its properties. Then save as 'm' file. When you inspect the m file it is easy to understand the script. You now add a do loop around the script by varying the coordinates and dimensions of the cylinder, for which you already have data from your other software. But be careful of how many such cylinders you have. If you say thousands of them, it is not at all efficient because you may be successful in loading the geometry (time consuming) but how are you going to ensure that when cylinders meet each other, their geometry is smoothly interfaced for each and every such interface. You might face an uphill task as well when it comes to meshing - in all probability your mesh may break down. I say this from experience of loading 10,000 spheres, where I ended up with degenerate geometry because of 100s of overlapping or nearly touching spheres, which also gave problems with meshing. Manually fixing them in GUI is an impossibel task. So as long as your geometry is neat, you are fine. My best advise is as Yara says, speak to COMSOL support.

Of course, it will be nice to know if you succeed and how you did it.

Suresh

Hi, Easiest would have been if there was a livelink product that links Avizo to comsol. That you may check. However, there are 3D import formats such as stl or 3D-CAD and probably more depending on the livelink products that you have. If you can export your geometry to any of these, then you can directly import them from GUI. On the other hand, if you just want to load different regular geometries such as spheres or cylinders, you can easily load them from MATLAB. For example, to create the code, use GUI and generate a cylinder by giving its properties. Then save as 'm' file. When you inspect the m file it is easy to understand the script. You now add a do loop around the script by varying the coordinates and dimensions of the cylinder, for which you already have data from your other software. But be careful of how many such cylinders you have. If you say thousands of them, it is not at all efficient because you may be successful in loading the geometry (time consuming) but how are you going to ensure that when cylinders meet each other, their geometry is smoothly interfaced for each and every such interface. You might face an uphill task as well when it comes to meshing - in all probability your mesh may break down. I say this from experience of loading 10,000 spheres, where I ended up with degenerate geometry because of 100s of overlapping or nearly touching spheres, which also gave problems with meshing. Manually fixing them in GUI is an impossibel task. So as long as your geometry is neat, you are fine. My best advise is as Yara says, speak to COMSOL support. Of course, it will be nice to know if you succeed and how you did it. Suresh

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.