PDE Toolbox does not recognize subdomains in imported .stl geometry

6 views (last 30 days)
Hi,
I have been trying to run a heat transfer simulation on a 2D geometry made using a CAD program, stored as a .stl file. According to the PDE toolbox documentation, it should be possible to import a geometry from .stl for PDE modelling using the function 'importGeometry'. Indeed, importing the file works fine, it consists of a rectangle with several parts inside, each with different thermal properties. Plotting it with 'pdegplot' shows the geometry as it would be expected to look.
However, Matlab does not seem to recognize all the parts as belonging to the same geometry. For example, specifying a temperature on the boundary of the rectangle will result in a heat flow propagating through the rectangle, but ignoring all the parts inside, passing straight through them without feeling the different thermal properties. Specifing boundary conditions along the edges of these subdomains results in a heat flow propagating into these parts, but not to the surrounding area.
Upon closer inspection, I can see that a different mesh is generated for each subdomain. It seems like all the different shapes in the original .stl file are seen as different, independent geometries. Is there any way to import the .stl file, and make matlab see it as a whole, with subdomains of different properties?

Accepted Answer

Ravi Kumar
Ravi Kumar on 15 May 2019
STL with multiple bodies are imported as separate cells in PDE Toolbox. Essentially, the two cells are disconnected for analysis purposes, each with its own mesh and no common interface between them. Refer to the limitation mentioned in:
If your geometry is simple enough you can create multidomain 3-D geometry with functions: multicuboid, multicylinder, multisphere.
  7 Comments
Ravi Kumar
Ravi Kumar on 5 Dec 2019
Edited: Ravi Kumar on 5 Dec 2019
Sure. The funciton you need to use is geometryFromMesh. Refer to the examples which load mat file containing mesh data, which you can think of as coming from outside of the MATLAB. Let's say you have a mesh generation tools that honors the interface between two solid bodies by creating a common set of nodes on the interface. You will need node matrix, element connectivity matrix, and a vector that tells which element belongs to which solid. In the examples it is ElementIDToRegionID. If you have this data then geometryFromMesh should be able to reconstruct the multidomain geometry from the mesh data. Further, you can either retain the same mesh or you can recreate a new mesh.
Regards,
Ravi

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!