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.

Customized geometry

Please login with a confirmed email address before reporting spam

Hi!

Does anyone know how to import geometry created in Matlab (or the corresponding .mat file) into COMSOL? I wish to create a 2D parabolic dish but could not find any windows in the COMSOL GUI to key in equations for customized geometries.

Thanks!!!

6 Replies Last Post Jan 11, 2010, 9:36 a.m. EST

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 13, 2009, 11:06 a.m. EDT
Hello,

What comes to my mind at the first place is to create the geometry using Comsol script commands like line1, arc1 and alike. The final geometry can be first processed by `geomcoerce` (do you need a closed curve, area or solid?) and exported by `geomexport` with a DXF extension. The CAD Import can be used to import the geometry to Comsol afterwards.

Hope it helps,
Onur
Hello, What comes to my mind at the first place is to create the geometry using Comsol script commands like line1, arc1 and alike. The final geometry can be first processed by `geomcoerce` (do you need a closed curve, area or solid?) and exported by `geomexport` with a DXF extension. The CAD Import can be used to import the geometry to Comsol afterwards. Hope it helps, Onur

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 23, 2009, 3:19 p.m. EDT
I have the same question.

For example, I am interested in flow in a channel whose upper boundary is a sine function. How can I draw the upper boundary?

Thanks a lot.
I have the same question. For example, I am interested in flow in a channel whose upper boundary is a sine function. How can I draw the upper boundary? Thanks a lot.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 23, 2009, 3:47 p.m. EDT
Use the command geomfile from matlab,

Using geomfile you can specify the size of any domain, as long as you can specify the boundaries of the domain as functions of some parameter. However the documentation is not very clear, and you will have to do a bit of trial and error.

However its a very powerful option.
Use the command geomfile from matlab, Using geomfile you can specify the size of any domain, as long as you can specify the boundaries of the domain as functions of some parameter. However the documentation is not very clear, and you will have to do a bit of trial and error. However its a very powerful option.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 2, 2009, 6:03 a.m. EST
Hi everyone!

Thanks for all the advice. In the end, I resorted to using Autocad to generate the parabola, then import it into COMSOL, because it was easier. I noticed if we want to do that in COMSOL, we have to write the MATLAB script that gives the output in the form of an "object" array, and I can't simply use the x and y coordinates which were in the form of a double array. Or is there an easier way I'm not aware of?
Hi everyone! Thanks for all the advice. In the end, I resorted to using Autocad to generate the parabola, then import it into COMSOL, because it was easier. I noticed if we want to do that in COMSOL, we have to write the MATLAB script that gives the output in the form of an "object" array, and I can't simply use the x and y coordinates which were in the form of a double array. Or is there an easier way I'm not aware of?

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 3, 2009, 2:44 a.m. EST
Hi

You can geerate several types of higher order cures in COMSOL, at least rather easily in 2D by creating a Bezier curve and then editing it (double click on the curve). If you have a surface, decompose it first ("coerce to curve") and "slpit" it to elementary items, and delete unwanted items. Then play with the weight value. sqrt(2) gives a circle.

You have als the "higher" order curves.

Take a look in the documentation for the full formulas or select a good mathematics book on Bezier curves

Good luck
Ivar
Hi You can geerate several types of higher order cures in COMSOL, at least rather easily in 2D by creating a Bezier curve and then editing it (double click on the curve). If you have a surface, decompose it first ("coerce to curve") and "slpit" it to elementary items, and delete unwanted items. Then play with the weight value. sqrt(2) gives a circle. You have als the "higher" order curves. Take a look in the documentation for the full formulas or select a good mathematics book on Bezier curves Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 11, 2010, 9:36 a.m. EST
Hello,

i want to create a parable, following this formula: y(x)=x^2/(c). How can i create such a curve in Comsol? I am using the Bezier 2nd degree tool at the moment, but I am not sure, how to select the weight and the points.

Thanks for helping!

Moritz
Hello, i want to create a parable, following this formula: y(x)=x^2/(c). How can i create such a curve in Comsol? I am using the Bezier 2nd degree tool at the moment, but I am not sure, how to select the weight and the points. Thanks for helping! Moritz

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.