CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Rendering your CFD results - general discussion (https://www.cfd-online.com/Forums/main/89402-rendering-your-cfd-results-general-discussion.html)

cfdnewbie June 11, 2011 13:37

Rendering your CFD results - general discussion
 
Hello fellow numericists!

I'm trying to get a discussion going about how to render your cfd results in an easy and efficient way...I'm wondering if there are people out there who have experience in rendering their solutions with a professional (although free) rendering tool like blender or povanimate..... I've been trying to read up on how to actually render my stuff, but I cant make heads or tails of it :)=

So, if there are guys and galls out there who would be interested in discussing rendering for numericists, maybe setting up tutorials and creating a webpage for the community, please reply!

so long, take care y'all!

cfd noob

Ralph M June 21, 2012 16:11

Hi,

Do you (after one year) already have a clue how to tackle this problem? I'd be interested in any information or tips that you might have!

Regards,

Ralph

cfdnewbie June 21, 2012 17:17

Hello,
Yes, I have in the meantime set up a rendering toolchain for our cfd solver that uses blender to create some nice animations. It does still require some more time then lets say create a simple still picture in tecplot, but of course it looks way better!
I havemt tried povray or any other remdering tool, i find blender does all I need.
All the best,
Newbie

Ralph M June 22, 2012 01:52

Thanks for your reply. Yesterday evening I also found some links pointing in the direction of Blender. It seems that a VRML export of the data from paraFoam can be imported and rendered in Blender directly?
Do you know a tutorial which you find very useful?
Thanks!
Ralph

cfdnewbie June 22, 2012 03:06

Quote:

Originally Posted by Ralph M (Post 367785)
Thanks for your reply. Yesterday evening I also found some links pointing in the direction of Blender. It seems that a VRML export of the data from paraFoam can be imported and rendered in Blender directly?
Do you know a tutorial which you find very useful?
Thanks!
Ralph


Hello Ralph,
the way I did it was to search google for "paraview blender", since I'm using paraview for postprocessing. paraview can export x3d files, which blender can read. It is pretty easy to just import a single geomtry and render it, however, if you want to do time dependent stuff, you will have to do quite some scripting! But the vids look indeed very nice, I think, here's one from youtube I like:
http://www.youtube.com/watch?v=0aACFaRazuA

Cheers,
newbie

Ralph M June 22, 2012 03:11

Yep, you are right: http://www.openfoamworkshop.org/6th_...gun_slides.pdf

Hopefully the next OF user who is looking for this stuff doesn't has to spend an evening browsing the web ;)

Thanks for your help!

cfdnewbie June 22, 2012 03:21

Quote:

Originally Posted by Ralph M (Post 367796)
Yep, you are right: http://www.openfoamworkshop.org/6th_...gun_slides.pdf

Hopefully the next OF user who is looking for this stuff doesn't has to spend an evening browsing the web ;)

Thanks for your help!


Wow, great slides, thanks Ralph. If I had had these 6 months ago, I wouldn't have had to invest so much time in scripting python... but that's how you learn :)

Be very careful though when using "older" scripts for blender 2.63 and above. I wrote my scripts for 2.62, and found that some stuff didn't work in 2.63a and I had to rework quite some things. But it worked in the end....

If you need any more help, let me know!

Newbie

as a side note: hmmm...maybe I should write up my stuff, make some nice screenshots and post them all online as a tutorial...

cfdnewbie June 22, 2012 03:29

http://www.youtube.com/watch?v=5-GtdRLfeFI

found it: here's the vid that helped me do the first rendering!

Ralph M June 22, 2012 03:46

Thanks! I will have a look into this later today.

cfdnewbie July 17, 2012 16:50

Hey Ralph,
just wondering: did you get your rendering done?
Cheers
cfd newbie

Ralph M July 18, 2012 02:25

1 Attachment(s)
Good morning CFD Newbie,

Yes I managed to create some fancy renders. It's extremely difficult to render water (for multiphase flows with a ship) but once you got the settings right it works like a charm!

Attached you find one of the first renders that I made (altough I can make better ones now :)) .

Regards,

Ralph

cfdnewbie July 18, 2012 07:27

Hello Ralph,
looks great! glad it worked out for you. I'm working on setting up a website with some hints on how to render CFD results in blender. I'm sure there are more people out there who would like to give it a try. plus it looks so much better than tecplot :)

keep blending :)
cfd newbie

SH_P August 28, 2012 02:39

Hi guys.
Your results look awesome. Can you please give us a clue how you created them. Specially, the transient ones! A tutorial would be a great idea!
Thanks, Soroush

mpeti August 28, 2012 05:17

Why not use Paraview?
 
Hi

Using Blender might be an option, but what is the problem with just creating the animations with Paraview itself? Paraview can open multiple files at once and animate the visualization at your convenience. You can very easily export frames of the animation with the dedicated functionality and create videos easily. If you are using OpenFOAM the tool paraFoam opens up the solution right the way you want but I am sure an easy solution exists for all major CFD tools.

cfdnewbie August 28, 2012 05:54

Yeah, of course, animation in paraview is a lot easier, but the rendering with a professional render engine just looks a lot nicer! Plus you can do easy camera movement, POVs, textures, lighting etc!

SH_P August 28, 2012 09:35

Quote:

Originally Posted by cfdnewbie (Post 379071)
Yeah, of course, animation in paraview is a lot easier, but the rendering with a professional render engine just looks a lot nicer! Plus you can do easy camera movement, POVs, textures, lighting etc!

Exactly, As a matter of fact, We are currently using Ensight for post processing and creating animations and it does its job great, even different types of camera movements are available. but that is not wat I want exactly!

I am not very familiar with Paraview and Blender. But I worked with Autodesk Maya for some years and I know the potential of a professional software like Blender for post-processing.

Honestly, I was going to import my data into Maya first through MEL, but it is very complicated, since I couldn't even import X3d files into it. But it seems that Blender can do the job more easily.

Anyway, Can you guys help me where to start?
I am learning Blender right now, But I think I should learn a bit of Pyton scripting as well. Can you suggest me a reference for that?

Thanks,
Soroush

cfdnewbie August 28, 2012 10:47

Soroush,
here you will find the complete python script used in the blender python console to do the animations, i.e. read in the x3d files and do the videos in the thread:

http://www.blender.org/forum/viewtopic.php?t=23052

I havent been able to clean it up or write a concise tutorial due to time constraints, but if you have any additional questions, just let me know!


the toolchain should be like this:
1) export the geometry/solution as x3d from paraview
2) import it into blender
3) setup your camera, lights, animations
4) render the movie


The script does 2) and 4), in between, you have to setup the camera, lights etc in blender, save it as a blend file, and then execute blender with the python script!

SH_P August 28, 2012 11:26

Thanks for the information,

Just one thing: what was the version of your Blender and Paraview when posting in that froum? I'm not sure, but I think scripts are a little version dependence, right?

cfdnewbie August 28, 2012 11:34

Blender was either 2.63a or 2.63, dont remember....
Paraview was 3.14.1

SH_P August 28, 2012 11:36

OK, Great,
Thanks

cfdnewbie August 28, 2012 11:41

Just one thing: if you get something done, please post back and share!

SH_P September 4, 2012 01:59

OK! I cleaned up your code (can be found on Blender.org forum).
Now, for Cycle implementation. I've found out how to correct the texture (vertex color paint) in cycle engine. However, after hours of struggling with python, I couldn't find a way to translate the process to code... :(
If you are interested I can describe the problem for you, maybe you can find a way!

BTW, I have tow question:
1. How did you automate the export process in Paraview? Do you have a code or something?
2. How did you make your animation using the resulting still images?

Thanks

cfdnewbie September 4, 2012 02:59

Quote:

Originally Posted by SH_P (Post 380088)
OK! I cleaned up your code (can be found on Blender.org forum).
Now, for Cycle implementation. I've found out how to correct the texture (vertex color paint) in cycle engine. However, after hours of struggling with python, I couldn't find a way to translate the process to code... :(
If you are interested I can describe the problem for you, maybe you can find a way!

BTW, I have tow question:
1. How did you automate the export process in Paraview? Do you have a code or something?
2. How did you make your animation using the resulting still images?

Thanks

Thanks and great that you are posting back! I looked at the cycles stuff as well and got as far as you did (I could import the x3d and set the vertex color in blender) but I couldnt find a way to do it in python....
If you have any ideas or want to share what you discovered, please do!

about your questions:
1) yes, I do have some lines of python code and I run paraview in batch mode (pvbatch), it just goes through all my files, imports them, applies a layout (forgot what they are called in paraview...statefile??) and then exports it as x3d

2) I used mencoder under linux...


all the best and thanks again for contributing!

SH_P September 4, 2012 03:07

If you can find a way to add a node in blender (equivalent to: "add>inpute>attribute" in node editor) it is almost done, but I couldn't find a way to add this specific node (Attribute).

I have only one paraview session so I wouldn't need to load different files. All I want to do is to export the .x3d file in every frame change. Can you help me with its python code? I've never used python in paraview and have no idea how to do it.

Thanks

tptbd September 5, 2012 03:04

I am a new member on this forum. I think, i will get help from all member.

SH_P September 9, 2012 08:53

Quote:

Originally Posted by cfdnewbie (Post 379140)
Just one thing: if you get something done, please post back and share!

Finally found the way to use Cycle! I explained it Blender forum.
Now we can do almost everything with Blender !!:D

BTW, Is Reynolds your real name?

>Soroush

cfdnewbie September 9, 2012 11:25

Awesome Soroush!
I will check it out in the coming days, unfortunately I'm so bogged down by work at the moment that I can't focus on the nicer things :) But I will most certainly look it up!

Sorry for not replying to your paraview scripting problem, if you still need help with that, let me know and i can post the python I use!

all the best!


ps: no, reynolds is (sadly) not my real name!

SH_P September 9, 2012 12:41

No problem!
I Wrote a script that works fine, Actually, I rendered an animation of falling droplet simulated in Fluent as well!

The only problem is that my script uses time step counts (ViewTime command) which are all integer numbers. That is fine for the case of integer file names only.

Do you know how to get the the precise values of time steps and store them in an array? I tried some commands on the internet but none of them works.

Thanks,
>Soroush

cfdnewbie September 9, 2012 14:15

Quote:

Originally Posted by SH_P (Post 380949)
No problem!
I Wrote a script that works fine, Actually, I rendered an animation of falling droplet simulated in Fluent as well!

cool! is the video available somewhere?

Quote:

The only problem is that my script uses time step counts (ViewTime command) which are all integer numbers. That is fine for the case of integer file names only.

Do you know how to get the the precise values of time steps and store them in an array? I tried some commands on the internet but none of them works.

Thanks,
>Soroush
hm, I'm not sure what you are asking here... do you mean in paraview? or blender?? Sorry, I am confused?!?!

SH_P September 9, 2012 14:48

I mean in Paraview. Consider a loaded case has time steps : 0.001, 0.002,... . I want a command to extract these time step values for the case and put them in a list.

Ps. I will upload the video on YouTube soon!

cfdnewbie September 9, 2012 15:01

where would you get the timesteps from? your filename? (So your filename might my something like "Solution_10.25000.vtu" with 10.25 being the time)?

That would work by doing sth like
end = filename.find('vtu')
time = filename[end-8:end-1]

maybe you would have to convert that to a number, but that should give you the time from your filename...

SH_P September 9, 2012 15:10

Thanks for your reply,

That could be one case. The other is the case in which I load my files into Paraview (All at the same time, such as a transient Ensight case) so the time step values should be extracted from the current session not from individual file names.
Here is the code I've found but it doesn't work. (Maybe it is a version issue):
I want to make an array like: "tsteps"
http://paraview.org/Wiki/ParaView/Py...ling_with_time

SH_P September 10, 2012 03:07

Found it mayself! :)

reeader = FindSource('case name')
tstrps = reader.TimestepValues

cfdnewbie September 10, 2012 05:43

awesome! I just looked at your nice tutorial on blender.org! thanks a lot, I will incorporate it into my code!

cfdnewbie September 11, 2012 03:20

and really looking forward to your video :)

SH_P September 12, 2012 05:34

Here it is! :

http://www.youtube.com/watch?v=DE5zCX9x_Ms
Not a very big deal... Just wanted to test some of the lighting and texturing capabilities!

cfdnewbie September 12, 2012 06:03

you sir, are my hero! That is very impressive! is it done with the blender render or cycles?

SH_P September 12, 2012 06:19

Thanks,
Its done by Blender engine.

hitechengineering September 12, 2012 06:20

Hi!
 
Hi friends...I am new to this forum and want your support to understand and resolve CFD flow related problems in aerospace industry.

Regards
James.

markusrehm August 12, 2013 09:29

Hi cfdnewbie,

I am trying to import the my paraview x3d to blender but it is missing the color.
I suspect it is an issue importing the colors since I get the following warning:

"Warning: adding faces did not work! file is invalid, not adding UVs or vcolors

I saw a similar error posted here:

http://www.blender.org/forum/viewtop...5725593b68583a

Do you know a solution?

Thanks, Markus.


All times are GMT -4. The time now is 21:22.