# 3D visualization of the results of a 2D simulation in COMSOL

Considering that COMSOL forum is dead and CFD-online is not responsive, I'm gonna try asking my question here:

I have done a 2D simulation in COMSOL multiphysics. I have two independent variables x and t and two dependent variable u1 and u2. Comsol gives me 2D projections of the 3D graphs u1(x,t) and u2(x,t) as below:

What I need is a 3D plot like this:

I have tried exporting the data. There are two options in COMSOL. Text which generates a file with several columns like this

The other options is Unstructured VTKFile (*.vtk). I tried importing both into ParaView but I could not manage to get any plots. Here and here I uploaded the exported data and here is my COMSOL file.

I would appreciate if you could help me know how to do this in COMSOL, ParaView or any other possible software.

• That VTK file has a lot of data, but it doesn't look like it's in the proper structure. Your text file that you screenshot has everything you need. It should be easy to load and plot that data with Matlab or Python. – LedHead Aug 12 '17 at 18:05
• @led23head python is fine for me. can you help me know how to do that? I have attached all files – Foad Aug 12 '17 at 18:22
• You can use numpy.loadtxt to load in the data file, and you probably want to try matplotlib 3D plotting or pcolor for plotting, or maybe quiver plots if this is actually vector data. – LedHead Aug 12 '17 at 18:41
• The issue is I do not understand this data structure and what those columns and rows represent. it seems to be mix of both time and values. Could you be so kind to give me more info about that? – Foad Aug 12 '17 at 18:47
• What does the Comsol manual says about the format of the exported file? The VTU file just contains lines. – nicoguaro Aug 14 '17 at 21:11