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:

enter image description here

What I need is a 3D plot like this:

enter image description here

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

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.

  • $\begingroup$ 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. $\endgroup$ – LedHead Aug 12 '17 at 18:05
  • $\begingroup$ @led23head python is fine for me. can you help me know how to do that? I have attached all files $\endgroup$ – Foad Aug 12 '17 at 18:22
  • $\begingroup$ 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. $\endgroup$ – LedHead Aug 12 '17 at 18:41
  • $\begingroup$ 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? $\endgroup$ – Foad Aug 12 '17 at 18:47
  • $\begingroup$ What does the Comsol manual says about the format of the exported file? The VTU file just contains lines. $\endgroup$ – nicoguaro Aug 14 '17 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.