openfoam visualisation rendering using blender

18
openFoam Visulation Rendering using Blender openFoam Brisbane Users' Group 19th June 2014

Upload: julien-de-charentenay

Post on 22-Nov-2014

1.400 views

Category:

Technology


3 download

DESCRIPTION

This presentation was made at the openFoam Brisbane Users' Get-Together of June 2014. It is a step-by-step tutorial on how to render CFD results from openFoam using Blender. The provided files are based on a design submitted for the Khamsin Virtual Racecar Challenge - http://www.khamsinvirturalracecarchallenge.com - by Team CAEdevice - http://www.caedevice.net/ CFD simulation is based on openFoam. Postprocessing is made using ParaView and rendering using Blender.

TRANSCRIPT

Page 1: openFoam Visualisation Rendering Using Blender

openFoam Visulation Rendering using BlenderopenFoam Brisbane Users' Group

19th June 2014

Page 2: openFoam Visualisation Rendering Using Blender

Objectives

• Learn how to generate high resolution render of openFoam CFD results using Blender

Page 3: openFoam Visualisation Rendering Using Blender

Thanks

• CAEdevice www.caedevice.net for enabling the use of his design geometry

• KVRC www.khamsinvirtualracecarchallenge.com and its partners: Competition Car Engineering and Hibou Scientific Software

• Matt Cragun, Total Sim USA for his presentation "Data Visualisation and Rendering with Blender and VTK"

Page 4: openFoam Visualisation Rendering Using Blender

Blender

• A few basics - please refer to Matt Cragun's presentation:

http://www.openfoamworkshop.org/6th_OpenFOAM_Workshop_2011/Program/Training/cragun_slides.pdf

Be prepared, the learning curve is steep...

Shortcut Action

RMB Select

Shift+MMB Pan

Shift+D Duplicate

G Grab (to move an object)

R Rotate

(G, R) >> (X, Y, Z) Specify the axis to be used to

move/rotate object

X Delete

F12 Render

F3 Save image

Page 5: openFoam Visualisation Rendering Using Blender

The Workflow

Rendered image

Blender

X3D 3DS

SketchUp GeometryParaView

VTK

openFoam

Page 6: openFoam Visualisation Rendering Using Blender

Files Provided SketchUp and 3DS files,

including textures

openFoam CFDresults converted

to VTK format.

Download from:https://s3.amazonaws.com/cfdresultspublic/oF+Rendering+using+Blender.zip

Page 7: openFoam Visualisation Rendering Using Blender

ParaView

• Start ParaView;• Open files:

– bc_body_480.vtk– bc_frontwing_480.vtk– bc_rearwing_480.vtk– bc_wheelback1_480.vtk– bc_wheelback2_480.vtk– bc_wheelfront1_480.vtk– bc_wheelfront2_480.vtk

Page 8: openFoam Visualisation Rendering Using Blender

ParaView

Let's create streamlines:• Open file: internalMesh.vtk• Select the internalMesh.vtk

object;• Activate the Steam Tracer

filter;• Change the Steam Tracer

parameters to:– High Resolution Line

Source– Point1: (-1.0; -1.2; 0.25)– Point2: (1.0; -1.2; 0.25)

Page 9: openFoam Visualisation Rendering Using Blender

ParaView

And color them:

• Select the StreamTracer object;

• Select the Tube filter;

– Radius: 0.005

• Change the color variable to "U"

Then do a little bit of house keeping and export:

• Hide the car geometry;

• Select Edit View Option:– Turn off Orientation Axes

• Export scene as X3D

Page 10: openFoam Visualisation Rendering Using Blender

Blender

• Start Blender• Delete the default cube in

the middle• Import

RenderingRoom.3ds• Import CAEdevice.3ds

• Rotate (R) and move (G) the car to align properly:– R >> Z >> -90– G >> X >> 1.5– G >> Y >> 5

Page 11: openFoam Visualisation Rendering Using Blender

Blender• Import results.x3d saved from

ParaView• Delete by right-click in the

object view and select Delete:– TODO to TODO.006– ViewPoint

• Select the ParaView object (ShapeIndexedFaceSet);

• Rotate and position:– R >> X >> 90– R >> Z >> 90– G >> X >> 1.5– G >> Y >> 5

Page 12: openFoam Visualisation Rendering Using Blender

Blender

• Position camera– G >> X >> -8.5– G >> Z >> -4– G >> Y >> 8.5– R >> Z >> -90– Rotate so that car is in

the camera view point using View>Camera

And Render (F12)

Page 13: openFoam Visualisation Rendering Using Blender

Blender

Let's remove the tube shadows:

• Select ShapeIndexesFaceSet

• Select Material panel• Untick Traceable

Page 14: openFoam Visualisation Rendering Using Blender

Blender

Add lighting:• Select existing

light;• Copy (Shift+D);• Move the copied

light (X, Y, Z);• Repeat above step

twice for key and fill lights

Fill Key

Page 15: openFoam Visualisation Rendering Using Blender

Blender

• Set the lights as follows:– Initial light (lamp):

• R >> Z >> -90• Sun• Energy: 1

– Key light:• Energy: 0.4

– Fill light:• Energy: 0.1

And Render (F12)

Page 16: openFoam Visualisation Rendering Using Blender

Blender

Modify as desired to improve camera position, lighting position and intensity.

Then:• Change resolution to

100% (Render panel)• Render (F12)• And Save (F3)

Page 17: openFoam Visualisation Rendering Using Blender

Blender

• Repeat with showing the pressure distribution on the car.

• Tricks:– In ParaView:

• Group the various car parts in one dataset

• Coarsen the mesh using Quadratic Clustering filter

Page 18: openFoam Visualisation Rendering Using Blender

Happy Rendering

Thank you for your time and attention...

Please, tweet your rendering pictures to @HibouSoftware

and

on Fridays use #simulationfriday