CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] Plotting solution vector from Matlab in Paraview

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 20, 2016, 13:19
Default Plotting solution vector from Matlab in Paraview
  #1
New Member
 
Chaitanya Raj Goyal
Join Date: Nov 2016
Posts: 4
Rep Power: 10
crg123 is on a distinguished road
Hello,

I am solving a 2D hyperbolic PDE, which gives me a solution in 'x' and 'y' direction for each node on the mesh, for each time step. Therefore, if I freeze the time step, I have a solution vector in 'x', and 'y', for the whole mesh, i.e., a single value in both 'x' and 'y' direction, for each node on mesh.

It looks like this when the solution is initially viewed in Paraview.



You can notice the 'x' and 'y' solution for all points (nodes). The no. of rows is the total no. of nodes on mesh.

Then, I convert this vtk file to .csv, and import it to MATLAB, where I run some post processing on the 'x' and 'y' solution vectors. Now, I have replaced the originally imported solution vectors 'x' and 'y', with some new values. I wanted to take back these new solutions to Paraview again for plotting. So I used a tool called vtktrisurf in MATLAB. The problem was that this tool only takes 1 solution vector, i.e., I can either give the 'x' solution vector or 'y'. So, I used pythagoras theorem on respective elements of 'x' and 'y' solutions, to generate a single vector. The vtk was created, and the simulation in PARAVIEW was exactly what I was hoping to see. However, when I use pythagoras theorem, I convert all negative components of the solution to positive. It will show me what I want to see when there is no scalar warping. However, when I warp it with scalar in Paraview, it shows the entire profile in positive values. That is not actually true, because there were negative values in the solution. Long story short, how can I view the correct simulation. Maybe the answer goes back to the point where I convert my matrix in MATLAB to vtk. I also have the option of creating a separate vtk for 'x' solution and separate for 'y'. In that case, is there a way to superpose them in Paraview to view the correct profile?

Thanks a lot for your time!
crg123 is offline   Reply With Quote

Reply

Tags
matlab code, mesh 2d, superposition, vector manipulation, vtk files


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFL Condition Matt Umbel Main CFD Forum 19 June 30, 2020 09:20
Filtering DNS solutions Vs projecting filtered DNS solution juliom Main CFD Forum 5 May 19, 2016 17:06
[OpenFOAM] Calculating and Plotting Nusselt Number with ParaView RTom ParaView 8 May 3, 2016 18:58
[OpenFOAM] from paraview to matlab izna ParaView 3 September 8, 2013 10:42
Wall functions Abhijit Tilak Main CFD Forum 6 February 5, 1999 02:16


All times are GMT -4. The time now is 16:05.