Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
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.
3D Surface Plots
Posted 01.02.2010, 11:28 GMT-5 Results & Visualization Version 4.3b 7 Replies
Please login with a confirmed email address before reporting spam
When post-processing in a 2D model one can use Plot Parameters/Surface to create a 3D surface plot. (Height Data tab)
Working in 3D one can create a slice through a structure and present the stresses or strains. I'd like to be able to turn this 2D colored slice into a 3D surface....specifically, a contoured surface plot of the normal stress.
It would seem that the capability is present in the wealth of post processing menus but I've not found the handle.
Suggestions?
Thanks, Marty
Key Words: 3D surface plot, contour plot
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
I mostly create interiour boundaries to use them as "metrology" support, but to get your "height data" approach in 3D, I can only think of one way within COMSOL (<=V3.5a):
that is to export/extrude/map your 3D results to a 2D geometry and then postprocess it there
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Rune Westin at COMSOL Support provided some needed detail which I’ll include along with my embellishments. Rune has also provided the very useful model file which is attached. (extrusion_demo.mph)
Again the objective is to create a 3D surface plot of a parameter such as pressure or stress acting on a particular boundary plane within the model. This is readily done in 2D simulations with the Post Processing/Plot Parameters/Surface GUI. Here the Height Data tab controls the 3D presentation.
To accomplish the task in a 3D simulation the parameter data from the plane of interest in the 3D model is ‘Extruded’ onto a 2D polygon using a work plane. It is this extruded data that is then plotted into the 3D Surface using the same GUI mentioned above. Now some detail applicable to 3.5a.
As Ivar suggests one may create the model and add a ‘metrology’ source plane (boundary) at the location of interest. (This will be in the 3D, Geom1 environment.) It may be useful to complete the model and test it at this juncture.
To prepare for the extrusion data a ‘destination’ 2D region will be required. First create a work plane, Draw/Work-Plane Settings/Face Parallel, which will reside in Geom2. In Geom2 create a polygon of the same shape and dimension as the source metrology plane in Geom1.
Mapping the data from the 3D source (Geom1) to the 2D destination (Geom2) is accomplished with an Extrusion Coupling Variable. While in tab Geom1, use Options/Extrusion Coupling Variable/Boundary Variables to open the Boundary Extrusion Variables GUI.
On the Source tab select the metrology boundary which has been added. Assign a meaningful name and include an expression. The expression may be an existing Application Mode variable such as ‘p’ or ‘sz_smsld’.
On the Destination tab select the Geometry to be *Geom2 and enter the Variable name you just applied in the Source tab. You will notice that the Geom2 tab is now active to enable the select the destination polygon (2D Subdomain selection) created earlier for this purpose.
Then with the Source Vertices tab and the Destination Vertices tabs establish a one-to-one correlation for the mapping. The sequence is important.
There may be a trick, but it seemed necessary to run the simulation again with the Geom2 tab active.
Once complete the desired plot can be obtained just as with the 2D model. Still in the Geom2 tab select PostProcessing/Plot Parameters/Surface.
On the Surface Data tab the Expression will be the extrusion variable name assigned earlier. Plotting at this point will provide 2D plot but if the Height Data tab is selected and the same variable name entered as the Expression there one will obtain a 3D surface plot as desired.
Rune offered these documentation reference points which I’ll pass along.
Comsol MultiPhysics User’s Guide: Chapter 2: Geometry Modeling and CAD Tools
Page 59 in Creating a 3D Geometry Model find Creating and Using 2D Work Planes
Comsol MultiPhysics User’s Guide: Chapter 4: Modeling Physics and Equations
Page 275 in Using Coupling Variables find Extrusion Coupling Variables.
Again many thanks to the community.
Marty
Key Words: 3D surface plot, contour plot, extrusion
Attachments:
Please login with a confirmed email address before reporting spam
Thanks for the precise description, such info is very usefull, as complements to the documentations
Havn't been on the forum for some time, stuck on a difficult simulation and design case, therefore my late reply ;)
Have a nice day
Ivar
Please login with a confirmed email address before reporting spam
I am interested in the post you have about how you went about rendering a 3D surface plot from the 2D slice you exported from COMSOL. I need to do the same thing. I have flow through a tube, with obstacles in the flow. I would like to create a 3D velocity profile plot after the obstacles. I have 2D slices of the velocity profiles, and I have been trying to import them into MATLAB, and create a surface plot based on the color, but I am not completely succesful. I was wondering if you had any tips.
Thanks,
-Alex
Please login with a confirmed email address before reporting spam
I am stuck with this 2D versus 3D thing.
I extruded a 3D geometry onto a 2D geometry by 'work plane' method. I then drew a circle on this 2D geometry.
When I clicked on any physics and tried to assign a boundary condition to the circle, I did not see the circle as a surface on the 3D geometry. Did I miss some steps in between?
I am using 4.0 by the way.
Hope you may help. Thanks!
liwah
Good day and many thanks to Robert, Ivar, and Rune for their contributions to this question.
Rune Westin at COMSOL Support provided some needed detail which I’ll include along with my embellishments. Rune has also provided the very useful model file which is attached. (extrusion_demo.mph)
Again the objective is to create a 3D surface plot of a parameter such as pressure or stress acting on a particular boundary plane within the model. This is readily done in 2D simulations with the Post Processing/Plot Parameters/Surface GUI. Here the Height Data tab controls the 3D presentation.
To accomplish the task in a 3D simulation the parameter data from the plane of interest in the 3D model is ‘Extruded’ onto a 2D polygon using a work plane. It is this extruded data that is then plotted into the 3D Surface using the same GUI mentioned above. Now some detail applicable to 3.5a.
As Ivar suggests one may create the model and add a ‘metrology’ source plane (boundary) at the location of interest. (This will be in the 3D, Geom1 environment.) It may be useful to complete the model and test it at this juncture.
To prepare for the extrusion data a ‘destination’ 2D region will be required. First create a work plane, Draw/Work-Plane Settings/Face Parallel, which will reside in Geom2. In Geom2 create a polygon of the same shape and dimension as the source metrology plane in Geom1.
Mapping the data from the 3D source (Geom1) to the 2D destination (Geom2) is accomplished with an Extrusion Coupling Variable. While in tab Geom1, use Options/Extrusion Coupling Variable/Boundary Variables to open the Boundary Extrusion Variables GUI.
On the Source tab select the metrology boundary which has been added. Assign a meaningful name and include an expression. The expression may be an existing Application Mode variable such as ‘p’ or ‘sz_smsld’.
On the Destination tab select the Geometry to be *Geom2 and enter the Variable name you just applied in the Source tab. You will notice that the Geom2 tab is now active to enable the select the destination polygon (2D Subdomain selection) created earlier for this purpose.
Then with the Source Vertices tab and the Destination Vertices tabs establish a one-to-one correlation for the mapping. The sequence is important.
There may be a trick, but it seemed necessary to run the simulation again with the Geom2 tab active.
Once complete the desired plot can be obtained just as with the 2D model. Still in the Geom2 tab select PostProcessing/Plot Parameters/Surface.
On the Surface Data tab the Expression will be the extrusion variable name assigned earlier. Plotting at this point will provide 2D plot but if the Height Data tab is selected and the same variable name entered as the Expression there one will obtain a 3D surface plot as desired.
Rune offered these documentation reference points which I’ll pass along.
Comsol MultiPhysics User’s Guide: Chapter 2: Geometry Modeling and CAD Tools
Page 59 in Creating a 3D Geometry Model find Creating and Using 2D Work Planes
Comsol MultiPhysics User’s Guide: Chapter 4: Modeling Physics and Equations
Page 275 in Using Coupling Variables find Extrusion Coupling Variables.
Again many thanks to the community.
Marty
Key Words: 3D surface plot, contour plot, extrusion
Please login with a confirmed email address before reporting spam
I would like to export data from 2D surface plot. I did right click the surface plot and saved it as data and exported it. Let say for the geometry one edge is from 1 to m and other edge is from 1 to n and the color data has to have m x n elements. However the exported color data dimension is same as m and n. There is smth wrong. Could someone help me please? I used 4.3b. I need to export all data points as I would like to use MATLAB for further data processing.
Thank you
regards
Sel
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.
Suggested Content
- KNOWLEDGE BASE Troubleshooting Graphics Issues
- FORUM Axis limits in 3D plots
- BLOG Surface, Volume, and Line Plots: Visualizing Results on a Heat Sink
- KNOWLEDGE BASE Error: Failed to compute elastoplastic strain variables
- FORUM Format Plots in Reports