Workflow when exporting from SolidWorks

Hi,
I’m new to molflow and went over the (really great) youtube videos.
I have a model in SolidWorks and exported it to molflow via stl. The model is too detailed and I am trying to figure out a workflow that would make sense.
i didn’t see an exiting video showing this type of workflow. Is there an existing resource I might be able to use to figure this out?
Making a simplified version of the geometry, consisting only of a few vertices and internal surfaces is possible, but that doesn’t really work well for an iterative design with SolidWorks (or another CAD program) and I’m sure it’s not the right way to go, as I’ve seen complex models.

I did see for example this tutorial (https://appliedionsystems.com/portfolio/molflow-simulation-of-a-high-vacuum-diffusion-pump-assembly/) but I wonder if there’s something more detailed showing an end-to-end example.

thanks!

Hello Gal, and thanks for posting here.
If you can share the geometry of your model I can look at it and help you out.
If you don’t feel like posting it here on the site you can e-mail it to me at roberto.kersevan@cern.ch.
I assure confidentiality, Marton and I have done similar things many times in the past.
Up to you, although I’d prefer a “public” discussion here so that other users can profit from it.
Cheers.

thanks for the quick reply! i agree it would be nice to have it public
It’s a 30+ meg file (needlessly large)
so here’s a link
and it’s just a test design, so i have no issue with sharing

For very complicated geometries it is often worthwhile creating the geometry in Molflow+, via its editing features (extrude, copy, translate, create intersection, etc…) rather than using the STL file: the reason is that the STL often has un-needed facets which have no real vacuum importance but still take a lot of resources. Just imagine a “T” with two tubes intersecting, the STL file can easily be thousands of facets (especially in the area near the intersection) while using the editor one can have a “net” T with the minimum amount of facets,and hte side facets mostly rectangular.

Good. I look at it as soon as I can, and then post my analysis here, OK?

1 Like

I agree with your comment about how a simple geometry can just be modelled directly. but I was curious of that’s the best practice. i’m sure users with complex geometries (this is a CERN tool after all) don’t design twice - once in a CAD for manufacture and once in Molflow right? so I assumed there’s a good way for more direct interop.
happy with posting results here. thanks!

Dear Gal,
For any simulator, not just Molflow, making a good (simple yet valid) moel is the hardest part.
We have collected best practices and two tutorials (for Spaceclaim and Inventor) here:

I can’t give Solidworks-specific advice (we don’t have a license at CERN).
Also, as Roberto said, you might consider creating an equivalent geometry withing Molflow.
Good luck, Marton

1 Like

Looking at your geometry, it can be made very simple (1000 facets or less) by modeling the inside only, as it’s just a long tube with varying diameter and a 6-way intersection.

In SpaceClaim you have a “fill volume” and in Inventor a “sculpt” command for that, surely there is a Solidworks equivalent.

thanks very much for your help!
i’ll do as you suggest.

Here is my replying, detailing how to modify the original STL file with extra facets.

There are 44 screenshot in the attached zipped file (7zip), GalWinder.7z.
I’ll comment each one of them here below.

Test_signelfile_1.jpg: shows the STL file model before collapsing (number of vertices=3x number of facets), with volume ON: it has a lot more detail than necessary. Not only the vacuum surfaces, but also the external ones, flanges, holes for screws. I don’t know what units the CAD model was created with, I assume here mm… if not a proper scale factor will need to be used, easy to do within the graphical interface.

We must remove all the unnecessary facets.

One way would be to use a proper CAD tool, I believe that Marton has created a video or a file (on the Molflow website) where he explains how to use SpaceClaim.
I never use SpaceClaim because I never use CAD.
Here I show how to remove all unnecessary facets, modify the file, add some facets, etc… in order to get a workable 3D model, geometry only, to which the user would then add the physics, i.e. desorbing and pumping facets, temperatures, opacities, etc…

Test_signelfile_2.jpg: I zoom in and select a few facets with the mouse: (keep “shift” or “Ctrl” button pressed to add or subtract an highlighted facet to those already selected by mouse click). It is clear that the CAD model has all normal vectors pointing in the WRONG direction, outward for the inner vacuum surfaces and inward for the external ones. The CAD model describes the VOLUME of the object, the solid part, so it makes sense.
We need to revers ALL facets’ normals, easy to do, just select all facets (CTRL-a shortcut to select them all and then “Swap normal” command, “Facet” menu, or CTRL-n shortcut).

Once this is done it is better to save the file with a proper NON-STL extension, zip extension.

Test_signelfile_3.jpg: we now use the “Smart selection” command in the “Selection” menu, hit “Analyze” and then start clicking on the facets until a group of facets belonging to the EXTERNAL (useless) part of the model is highlighted. Here we see the first part of the first tube after the initial box. I select them and hit CTRL-delete (or “Delete” in the “Facet” menu).

Test_signelfile_4.jpg: I proceed in the same way for the next external layer, second part of the round tube… and delete the facets. You better save again the file, in case something goes wrong (there is no “restore” button for the delete action!). Change the name, in case you want to save all or most of the steps.

Test_signelfile_5.jpg and Test_signelfile_6.jpg: I select here two more external layers, and delete them, one at a time.

Test_signelfile_7.jpg: for the external facets of the rectangular box the smart selection does NOT select them with just one mouse click: that’s because the angular parameter in the “Smart selection” box is “30” (degrees), i.e. only adjacent facets having normal vectors differing by LESS than 30 degrees get selected simultaneously (a great and very useful routine written by Marton, kudos to him!).
Once I select the 5 facets (square end cap on the left in the figure and 4 rectangular side facets, I delete them.

Test_signelfile_8.jpg: I then do a number of facet selections (like repeating the previous steps for the remaining external facets of the 6-way cross, and the conical taper at the end), and I also select the FLANGES, which are not important (OK, they internal surface IS important, but we can re-created it later, easily, see below). When I do these (several) steps, I finally get to this model.
You can see that there are some missing parts (where the intermediate flanges where placed and at the top of 4 branches of the 6-way part. We need to fill in the missing parts, using the editing features of Molflow+.

Test_signelfile_9.jpg: to visualize what needs to be done, I set desorption ON from facet no. 3530, the square on the left, and NO sticking on any facet. Total outgassing rate of 1, any value would be equivalent at this stage, and if I hit “Run” button on the right I get this: one can clearly see the leaks… make sure you have the “Lines” and “Leaks” check boxes checked, upper right corner. We need to fill in the missing horizontal segments (two, one before and one after the 6-way cross), plus the termination (4 on the 6-way cross and the exit on the right (if that’s an exit… maybe there’s a pump there?).

Test_signelfile_10.jpg: to fill in the gap between the two horizontal circular pipe segments I select the vertices (press “Tab” while using the mouse to select all the necessary vertices, the mouse pointer will switch from a normal one to one with a little “v” on the right. If you want to deselect the vertices just click outside of the model while keeping “Tab” pressed.
If more vertices are selected in addition to those you need to create a facet, then you need to delete all the unused vertices, using the “Clear isolated” command (second one in the “Vertex) menu. Once you have all vertices you need selected, like in the figure, you can use the “Create Facet from Selected” command in the “Vertex” menu, with “Convex hull” option, and Molflow+ will generate the facet (if the resulting facet is NOT convex then it would not work, in that case you need to select SEQUENTIALLY all of the needed vertices and then use the other option, “Keep selection order”). Now I have created a new facet, which is appended at the end of the list of facets, no. 4244. I change its opacity to 0 (it is not a real, solid facet), otherwise it would later act as a plug, preventing molecules from moving left to right.

Test_signelfile_11.jpg: I repeat the operation with the other opening, selecting the vertices and hitting CTRL-v (shortcut for “Create facet from selected” in the “Vertex” menu). It is facet no.4245. Again, set its opacity to 0.

Test_signelfile_12.jpg: I select the two facets, and use now the “Facet”, “Transition between 2” command. It will create the transition between the two facets.

Test_signelfile_13.jpg: this shows the result…. 84 new triangular facets, with normal vectors pointing correctly INWARD, no need to reverse them.

Test_signelfile_14.jpg: here I have selected the vertices of the 4 terminations on the 6-way cross (one at a time!) and repeated the CTRL-v command, creating new facets. In case they come out wrongly oriented (outward) I use the CTRL-n normal reversal command, as before.

Test_signelfile_15.jpg: now I save the file, and run the program. The leaks have disappeared from the gap we had before, and only remain at the other gap and at the end. Occasionally few leaks appear at the interface between two segments of the same circular pipe, with apparently no axial gap… we’ll see later what is causing that, and how to fix it quickly.

Test_signelfile_16.jpg: here I repeat the same operation, twice, as before. I create the two end facets at the axial gap borders, vertex selection + CTRL-v, twice. Notice that the two new facets’ normal vectors are oriented antiparallel to each other, this means that when I’ll generate the transitional facets they will have the WRONG orientation, outward.

Test_signelfile_17.jpg: use of the “Transition…” command, as explained.

Test_signelfile_18.jpg: wrong normal, use CTRL-n.

Test_signelfile_19.jpg: run again, now leaks only at the exit on the right, and some intermediate ones (to be fixed later).

Test_signelfile_20.jpg: Select the end vertices and use CTRL-v to create the circular end facet.

Test_signelfile_21.jpg: now I switch to “Volume” view, and see that there are leaks on the interface connection, as mentioned earlier, and near the end of the tube… why is that?

Test_signelfile_22.jpg: I zoom in near the end. These leaks look strange…

Test_signelfile_23.jpg: Explanation (going back to wireframe view, “Volume” OFF): there is an overlapping of the last short cylindrical piece of pipe and the end of the tapered transition. (again visualized by letting “Smart selection” on (“Enable” checkbox checked).

Test_signelfile_24.jpg: I select some vertices and visualize their Z coordinate (the axis of this model is parallel to the Z axis).

Test_signelfile_25.jpg: I delete all the side facets of the short cylindrical stub, leaving the newly created end facet in place.

Test_signelfile_26.jpg: I create a transparent (opacity=0) facet at the end of the taper, as usual (vertex selection + CTRL-v command).

Test_signelfile_27.jpg: I use again the “Transition between 2” command to generate the side walls and fill in the gap.

Test_signelfile_28.jpg: wrong orientation of the normal vectors, outward, use CTRL-n again to reverse them.

Test_signelfile_29.jpg: run again. The leaks at the end have disappeared, only those at the interface of the two half pipes are left. Notice that some of the leaks have their origin point (point of emission of the molecule) away from the leaky holes, see few leak arrows on the right, near the conical taper.

Test_signelfile_30.jpg: same view in “Volume” mode. Leaks appear all around the interface perimeter… let’s see what is causing them…

Test_signelfile_31.jpg: I zoom in near the interface: it is clear that the definition of the two half pipes are not the same, they use different vertices. You can see sort of “triangular’ little openings, through which the molecules sooner or later find their way out, and leak.
This is an unfortunate and common feature of CAD models, which often creates this kind of problems. We’ll fix it now…

Test_signelfile_32.jpg: There are different way to fix this kind of leaks. One would be to move a bit along Z one of the two tubes (only one end) generate the circular ends (as done repeatedly before) and then create a short transition between the two. Here I choose another way to do it, to highlight more features of the editor. I select (Smart selection) the first part of the tube, and deleted all facets.

Test_signelfile_33.jpg: done. I will now move the circular end of the other pipe, on the right, BACK (in the –Z direction) up to the Z coordinate of the square facet with hole of the box.

Test_signelfile_34.jpg: again, select the vertices of and create the opening (with opacity=0), after having run the “”Clear isolated” command in the “Vertex” menu (to remove all unneeded vertices, some of them are at the same Z coordinate as those I need to create this facet).

Test_signelfile_35.jpg: I will move the new circular facet at the correct Z coordinate value, of the box, which is Z=10.46296005 (select the facet and use the “Cood.” Button on the menu on the right.

Test_signelfile_36.jpg: I select the facet, hit the “Z” button and copy-paste the new Z coordinate value in the “New coordinate” field. Then hit “OK”. When you hit “Apply” the circular end moves to the correct position. Remember to save often the file, since most commands have no restore option!

Test_signelfile_37.jpg: done.

Test_signelfile_38.jpg: set “Volume” view on, rotate the model, and run again. Now there are leaks through the tiny triangular opening between the walls of the pipe I just made longer and the existing, original square facet with hole.

Test_signelfile_39.jpg: now I need to remove the end facet with hole on the box, and create a new one using the circular opening of the lengthened pipe. I select the facet, no.3480, and delete it.

Test_signelfile_40.jpg: after I delete it, I use the vertex selection mode (keep “Tab” key pressed while selecting with the mouse). I see immediately that there are unwanted vertices, belonging to the old circular opening in the square facet, which need to be removed. I use the “Clear unused” command again.

Test_signelfile_41.jpg: I need to create the square with hole facet: I first need to create the square, which is done by selecting the 4 vertices and using CTRL-v (sorry, didn’t capture the screen here). When you do that you select then the circle and the square, and use the “Create two facets…” “Difference”… “Auto” command, which automatically generates a square facet with a hole in it, as needed.

Test_signelfile_42.jpg: done.

Test_signelfile_43.jpg: Remember to remove the square facet of the step before, since it is not needed anymore (or leave it there but change its opacity to 0, so it won’t bother molecules).

Test_signelfile_44.jpg: now save the file and run it again. NO LEAKS!

I stop here, even if the job is not finished: what needs to be done is to move appropriately some of the end facets (circular) created before. Why is that? Because I created the 4 circular facet on the 6-way cross at the end of the 4 cylindrical arms, but in reality the flanges which I have deleted at each of these 4 ends made the real cylindrical part a bit longer (roughly ½ the flange width). The same for the end of the tube, where also a flange was placed in the original STL model.
So, to get the final simplified (and highly realistic albeit not perfect) geometry you need to read the Z, X and Y coordinates of each of these 5 circular ends and MOVE them to the right coordinates, same as done above in screenshots 35-36.

End.

GalWiner.7z (9.0 MB)

Wow this is an amazingly detailed answer!
i can’t thank you enough! I’ll try this and post my findings here!

Hi,
I just wanted to thank you guys for your help with this problem. Gal has been assisting me with my graduate project, and we posted here because we encountered some issues. The step-by-step guidance and tips you provided were incredibly useful and helped me get my simulation up and running with ease. It made a huge difference and allowed me to work much more efficiently with the program, even enabling me to modify the design and recreate the simulation for other models I exported.
The response time and level of detail in your replies were amazing—what a great community!

Thanks again,
Erez

1 Like

I feel your pain. Unfortunately, I have not found a very efficient way to only design the model once in CAD to import into other software like Molflow. Same applies to other programs like ANYSIS for example. SolidWorks has a couple problems when exporting in STL. First it doesn’t have enough precision compared to Molflow so facets that share vertices wind up having different values. This can cause small leaks. Depending on what you are modeling this may be significant or not. It just depends on many times a particle has to bounce around near the leak before it is absorbed on a pumping facet. Second, if your CAD model has smooth curved surfaces, it can be random where the STL export decides to put vertices. So vertices from one body may not line up with vertices on other bodies, creating gaps and hence leaks in your model.

So, I just use the CAD model as a template for making the model within Molfow. It’s a major pain in the butt because you have to redo it every time they make a change in the CAD model. I usually wait until the changes have are significant enough to redo it.

The first thing I do is get rid of non-vacuum surfaces and all non-vacuum hardware (bolts, screws and etc for example). If you can hide non-vacuum parts in the CAD model before exporting, less to delete later. I also use smart select ALOT in Molflow to quickly select large sections of facets. Keeping below 90 degrees you can easily delete the non-vacuum surfaces since typically those facets will have a 90 degree bend difference between the internal and external surfaces. You can experiment with the setting because it’s not always the case. To use smart select you have to collapse the vertices first.

How I create the model varies, but as a general rule 1) I always collapse vertices before creating new parts. This is because many times I want to be able to move created parts that share a vertex separately. If you collapse later then those parts are now tied together. Sometimes there are just too many lines and it hard to tell things apart from each other. So I just move some of the parts temporarily out of the way. I can’t do this if it is tied to a part I don’t want to move without screwing up the non-moving part. 2) I always try to build new facets in either one of the X,Y or Z planes. 3) Create the new parts away from the original, so I can just do a simple move command to see that they overlap as they should if I created it correctly. Also, keep in mind there is not one single way to create a new part, there are usually a few different ways to accomplish the same task. So in more detail…

The imported CAD model facets are all triangles, so they will ALWAYS be planer. But even if a group of them forms a “flat” plane, it will not because of the lack of precision. So if you built a simplified facet out of a bunch in one of the planes it’s easy to set the vertices to the same plane value to make sure it is really flat. You can also do projections onto plane function too. I’ve developed a spreadsheet that calculates how parts need to be rotated based on copying selected vertices in the display box and pasting them into Excel. I have others that don’t calculate rotations, but from 3 vertices on a “circle” can calculate the center, diameter, and normal. I then use that to create a new circle in Molflow. I use this a lot to make round ports onto a vessel (Create circle, Extrude, and Build Intersection). For circles I also usually stick to number of sides that give vertices at every 45 degrees. You can have more in-between obviously. More sides for big diameters and less for smaller.

Sometimes I’ll take slices on the part, so the points are all in the same plane, before copying and moving vertices that then may get rotated or combined in some other way to create a new chamber.

1 Like