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.

Basic Geometry Problem

Please login with a confirmed email address before reporting spam

I'm fairly new to COMSOL and am having trouble building proper structures with the built-in geometry tools. Whenever I attempt a few geometry transformations, such as a revolution followed by a sweep and then an extrusion, I find it impossible to connect the structure back onto itself again.

I have attached an example of this general problem with images of the meshed problem region. In the attached file, I attempt to create a single coil of wire with an extrusion for a port attachment (to be used in the Magnetic Fields interface). This is much like the geometry that is imported in the example model: inductor_3d.mph. Using the geometry tool, I sweep a rectangle up in a spiral, revolve off each end face, extrude/sweep the ends out into the same plane, and then extrude to bring the two ends together and complete the loop. Mathematically, I think everything should connect exactly and mesh nicely. In COMSOL, however, there seems to be injected a small amount of error (probably during the spiral sweep?) such that the ends can no longer come back together perfectly. This typically produces an error in the Union step: "Internal error in geometry decomposition." The attached model may not throw that error as currently constructed, but run the mesh tool and you find that the joint connecting the two ends does not come together properly, producing extremely fine mesh in that region and throwing the error: "Failed to respect edge element on geometry edge."

How do I get around this geometry issue in COMSOL? I'm running into this same problem quite frequently. I assume there must be some simple step I'm overlooking. I discovered that I can create a mesh-able geometry by just placing a big solid block to form the connections between my ends, but that is not ideal and seems to create convergence issues in the solver for some of the problems I'd like to analyze.

Thanks for any tips you can provide.


5 Replies Last Post 26 ago 2014, 16:03 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 4 ago 2014, 07:32 GMT-4
Hi,

Try changing geometry "form union" => "relative repair tolerance" to bigger value, like 1e-4.

Best regards

Tero Hietanen
Hi, Try changing geometry "form union" => "relative repair tolerance" to bigger value, like 1e-4. Best regards Tero Hietanen

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 4 ago 2014, 12:52 GMT-4
This to me seems to be a problem with either the program itself or a math error. I looked at the geometry tree and it looks good. It is when you do the interpolation curve 1 and sweep 2 that this gets to be problematic. The reason the mesh doesn't work is that you really don't have faces lining up mathematically. This is why it is so dense in that one corner. I attached a pdf file of the error. This is not a solution more of a documentation that something is not right.

One possible solution is to use another program to draw your object. COMSOL can make it very hard to do what you want with "wavy" items. This does not help you if you do not have a separate program . Another option would be to take your object and modify it a bit and see if it is good enough. I have an attached file.
This to me seems to be a problem with either the program itself or a math error. I looked at the geometry tree and it looks good. It is when you do the interpolation curve 1 and sweep 2 that this gets to be problematic. The reason the mesh doesn't work is that you really don't have faces lining up mathematically. This is why it is so dense in that one corner. I attached a pdf file of the error. This is not a solution more of a documentation that something is not right. One possible solution is to use another program to draw your object. COMSOL can make it very hard to do what you want with "wavy" items. This does not help you if you do not have a separate program . Another option would be to take your object and modify it a bit and see if it is good enough. I have an attached file.


Please login with a confirmed email address before reporting spam

Posted: 10 years ago 5 ago 2014, 12:07 GMT-4
Thank you both!

Dennis better documented the origin of the problem, and Tero's suggestion works for this case.

To add to Tero's solution: If you don't want to increase the repair tolerance for the entire domain, you can add an earlier union step where you combine only the problem sections. Increase the relative repair tolerance for that step until the union forms as you want it to without breaking anything else in the process.
Thank you both! Dennis better documented the origin of the problem, and Tero's suggestion works for this case. To add to Tero's solution: If you don't want to increase the repair tolerance for the entire domain, you can add an earlier union step where you combine only the problem sections. Increase the relative repair tolerance for that step until the union forms as you want it to without breaking anything else in the process.

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 5 ago 2014, 12:16 GMT-4
I just looked in more detail at Dennis's attached comsol file. His adjustment to the geometry employs a clever use of workplanes and differences to force the two section ends back onto the same plane. From that point, fusing the two ends together can be done without any of the inherent error from previous sweep steps. I had not thought of that trick yet.
I just looked in more detail at Dennis's attached comsol file. His adjustment to the geometry employs a clever use of workplanes and differences to force the two section ends back onto the same plane. From that point, fusing the two ends together can be done without any of the inherent error from previous sweep steps. I had not thought of that trick yet.

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 26 ago 2014, 16:03 GMT-4
I thought I'd post a follow-up to this because I eventually figured out the root of several of my geometry problems.

If you sweep a face along a parametric curve, the angle of that face seems to be determined by the tangent of the curve at each point. The parametric curves I was sweeping along were often spirals or helices. These curves do not terminate perfectly tangential to the x, y, z axes. (A circle would, but I wanted a spiral.) It was this slight angle to the parametric curve at each point that introduced the slight angle to the termination faces of my sweeps, which in turn made it very difficult to complete the rest of my geometry.

One way to draw a spiral without this sweep issue is to instead draw the spiral on a 2D work plane with a pair of parametric curves, close it into a solid, and then extrude it into 3D. Or you could draw a slightly compromised version by connecting increasingly larger arcs. The helix remains tricky to do without sweeps, which then force you to deal with the imperfect aftermath as discussed in the posts above.
I thought I'd post a follow-up to this because I eventually figured out the root of several of my geometry problems. If you sweep a face along a parametric curve, the angle of that face seems to be determined by the tangent of the curve at each point. The parametric curves I was sweeping along were often spirals or helices. These curves do not terminate perfectly tangential to the x, y, z axes. (A circle would, but I wanted a spiral.) It was this slight angle to the parametric curve at each point that introduced the slight angle to the termination faces of my sweeps, which in turn made it very difficult to complete the rest of my geometry. One way to draw a spiral without this sweep issue is to instead draw the spiral on a 2D work plane with a pair of parametric curves, close it into a solid, and then extrude it into 3D. Or you could draw a slightly compromised version by connecting increasingly larger arcs. The helix remains tricky to do without sweeps, which then force you to deal with the imperfect aftermath as discussed in the posts above.

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.