Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have solved 2D incompressible Navier Stokes and written out a .dat file that includes x,y,u,v,p values. I am trying to get a 2D color heat graph like this one for my data

enter image description here

Here is what I have done so far trying to use Contourplot:

Data = Import[
"C:\\Users...
UVP-steady-state.dat", "Table"];
x = Data[[3 ;; 16002, 1]];
y = Data[[3 ;; 16002, 2]];
u = Data[[3 ;; 16002, 3]];
v =  Data[[3 ;; 16002, 4]];
p =  Data[[3 ;; 16002, 5]];
grid = Transpose[{x, y}];
ListPlot[grid, PlotLabel -> "MeshPoints", AxesLabel -> {"x", "y"}, 
PlotRange -> Automatic, AspectRatio -> Automatic]
velocity = Transpose[{x, y, Sqrt[u*u + v*v]}];
pressure = Transpose[{x, y, p}];
ListContourPlot[velocity]
ListContourPlot[pressure]

My steady state solution is in this .dat file

http://www.wikiupload.com/VSPA5GS9BAXQ830

I am able to make my solution look like this with TecPlot. enter image description here

For some reason Mathematica with ListContourPlot plots two fairly large gaps in the middle of the graph.

share|improve this question
    
Try ColorFunction and ColorData. –  Pragabhava Apr 30 '13 at 22:41
2  
@l3win, out of curiosity, how did you solve the Navier-Stokes equations? –  user21 May 1 '13 at 6:58
    
@ruebenko any chance in future for NDSolve to solve Navier-Stokes out of the box..? –  PlatoManiac May 1 '13 at 17:23
    
I used what is called the Projection Method for incompressible Navier-Stokes. I did not solve it with Mathematica but with Fortran :) –  l3win May 1 '13 at 17:23
1  
@PlatoManiac, as much as I would like too, my contract with WRI does not allow me to discuss future development. I do, however, have a Navier-Stokes solver written in Mathematica. It would need (a lot of :-) polishing, however. –  user21 May 1 '13 at 17:52
show 1 more comment

1 Answer 1

up vote 2 down vote accepted

This is similar to your picture:

ListContourPlot[velocity, ColorFunction -> "Rainbow", 
                PlotLegends -> Automatic, PlotRange -> All, Contours -> 99, 
                ContourStyle -> {None}]

enter image description here

But this is on a finer grain

ListContourPlot[velocity, ColorFunction -> "Rainbow", PlotLegends -> Automatic]

enter image description here

ListContourPlot[velocity, ColorFunction -> "Rainbow", 
                PlotLegends -> Automatic, Contours -> 99, ContourStyle -> {None}]

enter image description here

share|improve this answer
    
Aaah Mathematica 9!!! Your PlotLegends is now fixed.... it was so messed up in Mathematica 8.0 –  drN Apr 30 '13 at 23:25
    
what do you mean fixed? I am unable to use the command belisarius posted. It gives me an error for PlotLegends –  l3win May 1 '13 at 3:36
    
Does ListContourPlot only take in PlotLegends for Mathematica 9? –  l3win May 1 '13 at 3:52
    
Maybe I just have to edit how the contours are plotted and the range which they are plotted. Trying to get rid of the two big white gaps in the middle of the graph still –  l3win May 1 '13 at 18:13
    
@l3win There is a scaling problem. Let me try to fix it –  belisarius May 1 '13 at 18:25
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.