CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Render Velocity values along a slice

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 5, 2015, 17:49
Default Render Velocity values along a slice
  #1
New Member
 
Ashwin
Join Date: Apr 2015
Posts: 6
Rep Power: 11
lpashwin is on a distinguished road
I am a novice OpenFoam and Paraview user. I have run a tutorial case and I have converted the results into VTK using FoamToVtk. I would now like to plot/render a sliced view of the velocity values at a specific time step.

Below is the code I have so far. I am unable to figure out how to activate the velocity and display(/render/plot) it at different time steps.

Code:
## list of the time steps  
time_step=[0,520,1021,1522,2023]

## File path
file_path="/home/lpashwin/to_home_server/tutorial_case/DTCHull/VTK/"

## Case Name 
case_name="DTCHull_"

## File names 
file_names=[file_path+case_name+str(ii)+'.vtk' for ii in time_step]

# Reading in the VTK Files (reader is the source as per the manual definition)
reader=OpenDataFile(file_names)

# Creating a Slice View
sliced_view=CreateView("MultiSlice")
sliced_view.YSliceValue=[1]


Show(view=sliced_view)
Render(view=sliced_view)
lpashwin is offline   Reply With Quote

Old   May 5, 2015, 18:01
Default
  #2
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
You can use sample utility.

Code:
cp    $FOAM_UTILITIES/postProcessing/sampling/sample/sampleDict    system/.
Then edit this file to set up the plane you want to extract and the output format (vtk for instance, for visualization with paraview). Then run,

Code:
sample
Cheers,
Cyp is offline   Reply With Quote

Old   May 5, 2015, 19:45
Default
  #3
New Member
 
Ashwin
Join Date: Apr 2015
Posts: 6
Rep Power: 11
lpashwin is on a distinguished road
Thank you Cyp for the quick response. I output a VTK file using Sample. Is there any quick and dirty way to create a jpeg file from the VTK files. I am running my simulations on a linux server and creating jpg files makes it easier to view the results on my windows based client.
lpashwin is offline   Reply With Quote

Reply

Tags
pvpython vtk openfoam


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
Multiple floating objects CKH OpenFOAM Running, Solving & CFD 14 February 20, 2019 10:08
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 23:38
how to extract velocity values from cells fromain STAR-CCM+ 2 May 27, 2015 15:12
Results of CFX Simulations Sof_70_Usthb CFX 3 July 9, 2011 07:15
Nodes positions + velocity and pressure values at the nodes Lily Kabanj FLUENT 1 March 13, 2000 20:21


All times are GMT -4. The time now is 11:26.