Automate Mesh Export
Transcript
And with that, we’ll come back to the meshing section and continue from here. We’ll still be using the Mesh from Implicit Body block as well as the preservation regions that we created earlier. The preservation regions again come from our oil and fuel Inlet and Outlet faces, and they’re just implicit bodies that we use to control areas where we want to preserve that sharpness.
We’ll leave the sharpen iterations at one for now. We might increase this to two or three depending on how well those edges are preserved, and we’ll likely end up decreasing the tolerance value to preserve more geometric fidelity than, let’s say, this tolerance of 1 mm is giving us. The other aspect I mentioned previously regarding manual run mode and applying that to our Export Mesh so that our files don’t get overwritten, that’s still definitely the case. However, if you know you’re going to want to run multiple design iterations and look at various different variables and how they impact the design, we can automate the file path as well as the name of the file that’s been outputted based on the variables that you’re changing.
So I’ll quickly show you how we can go about doing this. I’ll first copy the file path location that I have here, and then I’m going to search for Concatenate Text. The first text value here, I’m going to make this a variable, and I’ll call this file path, and I’ll paste what I just copied minus the file name and extension. I’ll leave the dash and I’ll search for another Concatenate Text. The text two in this operand is going to be our file extension, which is going to be STL, and the delimiter we’ll use is going to be a period. Now anything we sandwich in between this fop path and this extension will be a variable that we change, and the file that gets written out will be generated based on that change. So for instance, I’ll add one more Concatenate Text, and we would just continue to nest these within each other as we expand upon the variables that we want to explore. But for now, we’ll just say I want to look at cell size, and maybe in specific, we’ll do the cell size in the Z direction.
The next block that I’ll call is going to be Text from Scalar. All this does is take a scalar value and turn it to a text, as it says. I’ll search for cell size in this value capture, let’s say the ZV value again, because we want to maybe play with the aspect ratio and how that impacts the pressure drop in the direct primary direction of flow. The reference is primarily always going to be a value of one with the units that we want to output, and we don’t need that many significant digits so we’ll decrease that. Now all we’ll do is update the mesh, and then I’ll also click play on the Export Mesh here once this finishes, and we’ll see in a moment when this file path, when this file gets created, we’ll look at the file path location and see what gets generated.
I still have the file path, so we have cell size z-10. So maybe we want to update this a little bit. We’ll put a delimiter to do dash millimeters. We’ll update this, check what that file looks like. So cell size Z millimeters 10. Again, you would just continue to nest these Concatenate Text blocks within each other to add on different variables. So we might make this a variable and call this cell size Z. We would remove this cell size from this Concatenate Text. We would add another one, so we would put cell size in here and add a new one, which could be our unit cell type, etc. And each time a file or a variable gets changed, the mesh is performed, the file will ultimately get updated. Control Z, and I’ll leave it like this for now.
This lesson explores ways to automate your workflow for meshing. This file builds on the previously completed file found in the HEX Design Part 2: Heat Exchanger Flow Distribution and Control. Although the notebook setup looks different than the two previous courses the direction on how to Automate Mesh Exports has not changed.
We recommend that you complete that course and HEX Design Part 1: Intro to Two-Channel Heat Exchangers in nTop before starting this lesson. We also recommend reviewing 102: Guide to Meshing course for more information on meshing.
For a faster or slower speed for the video, click on the settings in the bottom right of the video.
