CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Validation Study: How do I plot wind tunnel data (*.dat) in Paraview (http://www.cfd-online.com/Forums/openfoam/91051-validation-study-how-do-i-plot-wind-tunnel-data-dat-paraview.html)

bigbang July 28, 2011 14:33

Validation Study: How do I plot wind tunnel data (*.dat) in Paraview
 
I'm new to CFD openFOAM so I'm running through a validation case to sharpen my skills.

The windtunnel data for the Ahmed Body is taken from here

The *.dat files contain data points for given planes. How to I plot them and interpolate it over the plane to compare my results to the windtunnel?

bigbang August 3, 2011 10:27

1 Attachment(s)
Update:

Ok I managed to import the data after cleaning it up a little in excel and saving it as a CSV file (comma delimited)

Paraview can open CSV files as a table. Then I applied the Filter > TableToPoints to get points. However I wasn't able to see them until I clicked on the split "horizontal button" on the right and chose a 3D view.

Now I have the points where I want them, but I can't manage to get a surface from the points. Any ideas?

bigbang August 4, 2011 14:15

matlab to the rescue
 
1 Attachment(s)
OK so I finally managed to get a surface from my points.

Unfortunately it was not by means of free software. I used matlab to interpolate the points over a structured grid and then plotted the result. First you must load your data into matlab under 3 arrays. I used 'x', 'y' and 'z'. Where x and y were the coordinates and z was the magnitude of the velocity.

Code:

ti = -250:1:250;
tj = 28:1:538;
[qx,qy] = meshgrid (ti,tj);
F = TriScatteredInterp(x,y,z);
qz = F(qx,qy);
R = maprasterref();
mapshow(qz, R, 'DisplayType', 'surface');

And after adjusting the plot using plotting tools you can see the attached result.

akidess August 5, 2011 03:30

Alex, have you tried the TableToStructuredGrid filter instead of TableToPoints?

bigbang August 5, 2011 08:00

2 Attachment(s)
Yes. Unfortunately I get a long error message about the number of rows.

I imported my data from CSV and it all comes in clean with the headers. There are 911 datapoints.

Then I select the TableToStructuredGrid filter and enter the range of my data and select the columns for x, y and z coordinates:
x {0,0}
y {-250,250}
z {28, 538}

I apply and get the following error:

Code:

ERROR: In /home/opencfd/OpenFOAM/ThirdParty-2.0.0/ParaView-3.10.1/VTK/Graphics/vtkTableToStructuredGrid.cxx, line 97
vtkPTableToStructuredGrid (0x2621f90): The input table must have exactly 256011 rows. Currently it has 911 rows.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-2.0.0/ParaView-3.10.1/VTK/Filtering/vtkExecutive.cxx, line 756
vtkPVCompositeDataPipeline (0x2623220): Algorithm vtkPTableToStructuredGrid(0x2621f90) returned failure for request: vtkInformation (0x26ccb40)
  Debug: Off
  Modified Time: 82398
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_DATA
  ALGORITHM_AFTER_FORWARD: 1
  FROM_OUTPUT_PORT: 0
  FORWARD_DIRECTION: 0




ERROR: In /home/opencfd/OpenFOAM/ThirdParty-2.0.0/ParaView-3.10.1/VTK/Graphics/vtkTableToStructuredGrid.cxx, line 97
vtkPTableToStructuredGrid (0x2621f90): The input table must have exactly 256011 rows. Currently it has 911 rows.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-2.0.0/ParaView-3.10.1/VTK/Filtering/vtkExecutive.cxx, line 756
vtkPVCompositeDataPipeline (0x2623220): Algorithm vtkPTableToStructuredGrid(0x2621f90) returned failure for request: vtkInformation (0x26cc300)
  Debug: Off
  Modified Time: 85434
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_DATA
  ALGORITHM_AFTER_FORWARD: 1
  FROM_OUTPUT_PORT: 0
  FORWARD_DIRECTION: 0




ERROR: In /home/opencfd/OpenFOAM/ThirdParty-2.0.0/ParaView-3.10.1/VTK/Graphics/vtkTableToStructuredGrid.cxx, line 97
vtkPTableToStructuredGrid (0x2621f90): The input table must have exactly 256011 rows. Currently it has 911 rows.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-2.0.0/ParaView-3.10.1/VTK/Filtering/vtkExecutive.cxx, line 756
vtkPVCompositeDataPipeline (0x2623220): Algorithm vtkPTableToStructuredGrid(0x2621f90) returned failure for request: vtkInformation (0x26cc300)
  Debug: Off
  Modified Time: 85468
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_DATA
  ALGORITHM_AFTER_FORWARD: 1
  FROM_OUTPUT_PORT: 0
  FORWARD_DIRECTION: 0




ERROR: In /home/opencfd/OpenFOAM/ThirdParty-2.0.0/ParaView-3.10.1/VTK/Graphics/vtkTableToStructuredGrid.cxx, line 97
vtkPTableToStructuredGrid (0x2621f90): The input table must have exactly 256011 rows. Currently it has 911 rows.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-2.0.0/ParaView-3.10.1/VTK/Filtering/vtkExecutive.cxx, line 756
vtkPVCompositeDataPipeline (0x2623220): Algorithm vtkPTableToStructuredGrid(0x2621f90) returned failure for request: vtkInformation (0x26cc300)
  Debug: Off
  Modified Time: 85506
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_DATA
  ALGORITHM_AFTER_FORWARD: 1
  FROM_OUTPUT_PORT: 0
  FORWARD_DIRECTION: 0




Warning: In /home/opencfd/OpenFOAM/ThirdParty-2.0.0/ParaView-3.10.1/VTK/Filtering/vtkDataObject.cxx, line 910
vtkTable (0x2549d40): Attempted to ShallowCopy from null.



All times are GMT -4. The time now is 17:48.