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.

How to parametrized a radius circle

Please login with a confirmed email address before reporting spam

Hi everybody! I'm a new user of Comsol.

My question is:
How can I parametrize a radius circle?
I want to draw a circle, but I'd like to have the possibility to change my radius in a second moment for sensitivities analysis!

I tried defining a constant, but it gives me a "syntax error" when I define it with its associated measure unit.
If I define it with no measure unit I can draw the circle but when I change the constant, the circle does not change!

I'm sorry, I know it's a simple thing but I'm not able to do it!

Thanks! :)

1 Reply Last Post 16.07.2009, 17:11 GMT-4
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: 2 decades ago 16.07.2009, 17:11 GMT-4
Hello

I had the same difficulties when starting with Comsol, I wanted to extensively parametrise my geometries. Comsol accepts quite well "constants" for 2D figures, BUT you cannot use the [units], this is not understood by the software (I have learned that COMSOL developpers are working on correcting that).

Unfortnately for most 3D geometry entities, "constants" are not accepted.

I have also heard that COMSOL developpers are evolving their geometric core software, so changes and improvements might well be just around the corner.

For complex geometry parametrised with only one, or a few, variable(s), I mostly use the link to SolidWorks for my 3D geometry.

Nevertheless, the first answer in your case is: run your simulation from Matlab (or Script if you have an older version than 3.5)

To start I can suggest to generate your model once with COMSOL GUI's and use the "history" file (or saved ".m" file for V<3.5) as baseline for writing the Matlab call to COMSOL. This is OK for simple geometries, but become difficult for more complex geometries, in which case probably there is only the "CAD" interface approach that will work.

Now, I'm a "user" so I might have this wrong, but the COMSOL people will certanly correct me in that case: "Constants" are processed only once when you start the software, when you use them to create a geometry they are translated into their numerical values at the moment of geometry generation.
Whith the GUI interface you manually create your geometry, ONCE, but this geometry is NOT "rebuild" each time you run the software, only the FEM calculation is restarted, based on the constructed geometry and the physics and boundary settings defined. I believe this is the main misunderstanding here.

When you do a "reset model", the FEM calculations and meshing is reset, but not the geometry, nor your physics settings.

Just as well as the newly arrived "parametric sweep" solving, it's typically intended for PDE parameters, or CAD (i.e. SolidWorks) interface parameters, but not COMSOL geometry.

Hope this helps you on your way, good luck

PS: I read the manuals at least 3 times, over several months, before I really believed I had got most of the knowledge, I'm not saying the the books are badly written, nor that I'm particularly dumb, it's just that they are dense, there is a lot to absorb, and I was quite biaised from the use of more traditional FEM programmes. There is really a switch of mindset you have to accept when you start to use COMSOL for true multiphysics, but you will not regret your old software.
Hello I had the same difficulties when starting with Comsol, I wanted to extensively parametrise my geometries. Comsol accepts quite well "constants" for 2D figures, BUT you cannot use the [units], this is not understood by the software (I have learned that COMSOL developpers are working on correcting that). Unfortnately for most 3D geometry entities, "constants" are not accepted. I have also heard that COMSOL developpers are evolving their geometric core software, so changes and improvements might well be just around the corner. For complex geometry parametrised with only one, or a few, variable(s), I mostly use the link to SolidWorks for my 3D geometry. Nevertheless, the first answer in your case is: run your simulation from Matlab (or Script if you have an older version than 3.5) To start I can suggest to generate your model once with COMSOL GUI's and use the "history" file (or saved ".m" file for V

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.