Engineering aspects of Realflow - Basic Questions

Discussions about the use of Realflow 2012
bmecohen
Posts: 28
Joined: Thu Sep 27, 2012 12:55 pm

Engineering aspects of Realflow - Basic Questions

Post by bmecohen » Thu Sep 27, 2012 1:49 pm

Hello for All!

I'm Gabor, a water engineering Bsc student. I use Realflow 1 and a half year and I currently use this software in my thesis project as an SPH tool.

I made a laboratory experiment, and I'm trying to modell it in RF. Everything is go well, but I have a few questions and I hope somebody has some good point about it.

1. Units /Basic question but I didn't find the right answer anywhere/
- viscosity
- rigid body mass
- int and ext pressure
Maybe this is some virtual custom values but I hope it's not. I should use realistic values to simulate things. It would be good to know that, maybe rigid bodies mass is based on SI values or something else.

2. Fill object - relaxation

I fill the tank with fluid but I have to wait until the fluid is relaxed. And then making an Initial State. It would be great if it could be more simple. I use a method where I use two deamons: 1. k Speed - for max value 0.1 to force the particles to flow slowly when the gravity force acting on it, and falls down. 2. Drag force - to eliminate the splash effect, to force the fluid stay in one piece.

After everything looks relaxed, deleting / inactivating these two deamon and make the initial state. Maybe there is a better way to do this, when this bouncing effect is not so slow. /it can be done in half or in one hour, but it would be good if I don't have to wait for that/

3. Sub-step

I use high sub-step values - from 100 to 333 and it's not slow, but I would like to ignore the effect of losing any particle or stayed in a rigid body after a collision. What do you think about it, about your experiments it is far more than enough or it's good.

4. Exporting data as txt with custom text /export.jpeg show the exact problem/

I know the Export Central make everything for me, but I have to open the particle data in Tecplot, and it uses some custom thing. I'm still learning Python scripting yet, I think it can be made with that, but I don't know how to start with the exporting particle data with custom text and specified format.
Attachments
export.JPG
Exporting data in asc format and in the needed one.
export.JPG (62.84 KiB) Viewed 3843 times
027.jpg
Sphere test
027.jpg (197.68 KiB) Viewed 3843 times
pic.jpg
Frame to frame - simulation and lab experiment
pic.jpg (212.59 KiB) Viewed 3843 times

fkfx
Posts: 309
Joined: Wed Apr 11, 2012 11:11 am
Location: Cologne, Germany
Contact:

Re: Engineering aspects of Realflow - Basic Questions

Post by fkfx » Sat Sep 29, 2012 12:04 pm

Hi,

first, you should be aware Realflow is a software targeted mainly at Visual Effects and is by no means scientifically correct. Visual Effects is all about smoke and mirrors, faking things and making them look real and believable. It is a system that calculates something looking like real water flow based on simplified physics, so simulation times stay on an acceptable level in the eyes of the VFX industry.

I am not sure about the real implementation in the code, but as far as i understand it, the values like viscosity and int/ ext pressure are Realflow internal and are no representation of an exact real world unit. Caronte however, the Rigid Body Dynamics engine, takes real world values much more into account. Mass is a critical concept and if you don't get that right, the RBD engine will not work correctly.

If your trying to do physical simulations, you'd better look into real CFD tools like XFlow:

http://www.xflow-cfd.com/

Substeps:

Usually, one starts with a simulation at a fairly low resolution just to find out if the trick works. Then, one increases Resolution step- wise and watches how the simulation behaves and needs to pull some strings here and there, because you cannot "just increase resolution" and the whole effect will stay the same, but with more particles. It is like testing something in an aquarium to get a proof of concept, but that doesn't mean the same will work in an ocean without doing some major modifications.

When increasing Resolution, the sim might become unstable (exploding ptcls), because the supsteps aren't sufficient for that particle count/ situation, anymore. So you increase substeps a bit and then try if the sim runns somoothly again.

The whole process of raising Resolution, making things work as supposed to with more Resolution and altering substeps is done in several iterations until your effect reaches the desired quality.

Rigid Bodies however, just take into account the low/medium/high setting, substeps are for SPH particles, only. The Hybrido/ Grid Fluid is based on Lattice Boltzmann methods and is also working idependently from your substeps setting. Make sure to change substeps using the small arrow next to the simulate button, as Preferences-> Simulation-> Substeps will only affect your default settings when creating a new scene.

TylerAfx
Posts: 372
Joined: Wed Apr 04, 2007 9:24 am

Re: Engineering aspects of Realflow - Basic Questions

Post by TylerAfx » Sat Sep 29, 2012 4:35 pm

Basically, you can simulate pretty accurately within RealFlow, just pay attention to your scene scale, eg 1 square in the grid resembles 1 meter edge size.

This is crucial for the right fps values as well as massrelated simulations. You could share your scene so I can have a look if the scaling is correct and the corresponding values fit the desired realism.

RealFlows default values for internal/external pressure (1.0) are way too high for working in a realistic scale at your experiments setup size. For the relaxation you also need to focus on the containers friction values and keep them natural..

As for the simulation of Air, which also puts a small friction on the fluid, generally using a soft/small drag force is recommended..

cheers

Tyler

User avatar
bitSeq
Posts: 1044
Joined: Thu Jul 10, 2008 9:48 am
Location: UK - Stuart Armiger
Contact:

Re: Engineering aspects of Realflow - Basic Questions

Post by bitSeq » Sat Sep 29, 2012 10:33 pm

If you need more accurate measurements you can use the tool that will tell you the volume of an object , I forget where it is.

Otuama
Posts: 1155
Joined: Fri Apr 02, 2010 12:56 am
Location: Swansea
Contact:

Re: Engineering aspects of Realflow - Basic Questions

Post by Otuama » Sat Sep 29, 2012 10:41 pm

You mean the measure utility?

I think it's in the Tools drop down.
iCreate Ltd
'Strength does not come from physical capacity. It comes from an indomitable will.' - Gandhi
'What Does Success Look Like?' - iCreate Ltd

lukeiamyourfather
Posts: 2880
Joined: Mon Oct 15, 2007 4:09 pm
Contact:

Re: Engineering aspects of Realflow - Basic Questions

Post by lukeiamyourfather » Wed Oct 03, 2012 5:37 pm

bmecohen wrote: 1. Units /Basic question but I didn't find the right answer anywhere/
- viscosity
- rigid body mass
- int and ext pressure
Maybe this is some virtual custom values but I hope it's not. I should use realistic values to simulate things. It would be good to know that, maybe rigid bodies mass is based on SI values or something else.
You can ask the developers but I think the viscosity is in centistokes, the weight is kilograms (or kilograms per cubic meter of fluid), and not sure about the internal and external pressure which might be specific to SPH and not actually correlate to any properties of real fluids.
bmecohen wrote: 2. Fill object - relaxation

I fill the tank with fluid but I have to wait until the fluid is relaxed. And then making an Initial State. It would be great if it could be more simple. I use a method where I use two deamons: 1. k Speed - for max value 0.1 to force the particles to flow slowly when the gravity force acting on it, and falls down. 2. Drag force - to eliminate the splash effect, to force the fluid stay in one piece.

After everything looks relaxed, deleting / inactivating these two deamon and make the initial state. Maybe there is a better way to do this, when this bouncing effect is not so slow. /it can be done in half or in one hour, but it would be good if I don't have to wait for that/
I posted a scene file here a while back that had a script to fill an object and stop when the fluid reached a certain level. That automates the process but regardless of how you do it things will take time to simulate and settle.
bmecohen wrote: 3. Sub-step

I use high sub-step values - from 100 to 333 and it's not slow, but I would like to ignore the effect of losing any particle or stayed in a rigid body after a collision. What do you think about it, about your experiments it is far more than enough or it's good.
Particles going through objects is one sign of not enough substeps. Fluid motion is also affected by substeps, not enough and the fluid will move differently. This is more apparent if you simulate two things side by side with different substep values, like 25 and 300 for example. How much this actually matters depends on what you're doing. Attached are some images that show what I'm talking about, I think there were 25, 50, and 150 or somewhere along those lines (left to right).
bmecohen wrote: 4. Exporting data as txt with custom text /export.jpeg show the exact problem/

I know the Export Central make everything for me, but I have to open the particle data in Tecplot, and it uses some custom thing. I'm still learning Python scripting yet, I think it can be made with that, but I don't know how to start with the exporting particle data with custom text and specified format.
Yes, Python can do this. I'd rely on RealFlow's cache until you're ready to import it to another application. At that point you can convert the cache to text files, but I wouldn't do this while it simulates. A batch script that goes through each frame would be the best way to do this. Here's some information about using text files with Python.

http://docs.python.org/tutorial/inputou ... ting-files
http://docs.python.org/library/stdtypes ... le-objects

Also, RealFlow is not an engineering tool and the results are not always accurate like others have said. If you want an engineering tool with accurate results there are products specifically for that which use different methods to simulate the fluids. Next Limit has another product called XFlow and there are others as well.
Attachments
preview00020.png
preview00020.png (280.93 KiB) Viewed 3783 times
preview00050.png
preview00050.png (558.53 KiB) Viewed 3783 times
preview00065.png
preview00065.png (652.3 KiB) Viewed 3783 times
preview00075.png
preview00075.png (605.81 KiB) Viewed 3783 times
preview00090.png
preview00090.png (531.96 KiB) Viewed 3783 times
preview00105.png
preview00105.png (499.72 KiB) Viewed 3783 times
preview00140.png
preview00140.png (380.78 KiB) Viewed 3783 times
preview00170.png
preview00170.png (341.33 KiB) Viewed 3783 times
WhenPicsFly | Debian GNU/Linux

bmecohen
Posts: 28
Joined: Thu Sep 27, 2012 12:55 pm

Re: Engineering aspects of Realflow - Basic Questions

Post by bmecohen » Sun Oct 07, 2012 10:41 am

Firstly, I would like to thank You all, who made a reply. It's very important for me, thank you again. If you interested in my progress, I can update my posts to organise my Realflow files for my thesis project.

fkfx
I heard about xflow, I were at a hungarian conference, where it was introduced, but my problem is, it has not a student version for simulation. It would be the best tool for my purpose, but not available. If anybody hear a change on this, please make it public! :)

TylerAfx
Thanks for the important infos, I will rescale my project to the idea what you told, and I will make a simulation, to compare the differences. Firstly I used Cinema 4D for basic modelling, but after I realised, because of the incomplexity of my test chamber, I rebuilt it in Realflow from cubes. So it will be easy to scale.

lukeiamyourfather
Big thanks for the great reply, and help. In the Department where I'm currently writing my thesis, they don't have enough resource to buy a specific software like Xflow, Ansys Fluent or CFX, or Flow3d. This is one of the challanges, but in my bachelor level of engineering study, the basic sph and hybrid solutions are good enough for a thesis work. However I would like to make it as good as it's possible with the resources I have.

bmecohen
Posts: 28
Joined: Thu Sep 27, 2012 12:55 pm

Re: Engineering aspects of Realflow - Basic Questions

Post by bmecohen » Sun Oct 07, 2012 2:19 pm

I go through many online tutorial and resource about scripting, but for the export I can't find anything for start, I already know how to build GUI forms and input data, but this is new for me.
I think it would be good, making an Event script, after every simulation step to write out my data. If it's possible it would be better if it could be done in AfterSimulationEnd. I don't want to waste time, on every simulation step, when I'm just testing /I know, in that case I can freeze this out/. Because, if I made good simulation, I don't want to resimulate for the whole scene, to get the exported data. If possible, the better would be, if i made the simulation cached, and from that data, it makes something out.

The basic concept is:
1. only one particle emitter - id, position and velocity on x y z, radius, pressure, density as wanted quantites
2. writing out as a txt format to a custom directory, with the beginning of a specified text

I. the directory maker I think it would be this:

scene.getRootPath() + "/export_data")

II. get emitter data

emitter_data = open("/particles/", "r") /i don't know how to specify to do it with all the datas inside from 001 to 400 frames and also, how to specify what parameters I want to collect/

III. write out as .txt with a specified text line

VARIABLES = "id" "x" "y" "z" "vx" "vy" "vz" "radius" "density" "pressure"
ZONE F=POINT, STRANDID=1, SOLUTIONTIME=0.03 / the solution time is should be increased every step by 0.3 everything else stays the same/

xxxxxxxx..particle data..xxxxxxxxx

bmecohen
Posts: 28
Joined: Thu Sep 27, 2012 12:55 pm

Re: Engineering aspects of Realflow - Basic Questions

Post by bmecohen » Sun Oct 07, 2012 4:42 pm

maybe with this will be the answer, but I don't know how to use it correctly:

emitter = scene.getEmitter(Circle01)
emitter.setExportResourcePath(EXPORT_PARTICLES_BIN, "$(SCENEDIR)/particles_version02" ) # getExportResourcePath(EXPORT_PARTICLES_xx) I don't know that, I have to use the bin file or pd or asc. but I want the data as ascii format. /

I saw an older post lukeiamyourfather write this code, but it won't work for me and I don't know why. Only I have a circle emitter with the name of Circle01 so I don't know what is missing.

# Creates a file object that Python can write to
file = open("/C:/Users/Gabor/scenes/test/particles_version02/001.txt", "w")

# Gets the emitter and the first particle of the emitter
emitter = scene.getEmitter("Circle01")
particle = emitter.getFirstParticle()

# Loop through all particles and write out their ID and position
while particle:
position = particle.getPosition()
id = particle.getId()
file.write("%s %s %s %s" % (id,position.getX(),position.getY(),position.getZ()))
particle = particle.getNextParticle()

# Close the file object when done, this is a good practice
file.close()

fkfx
Posts: 309
Joined: Wed Apr 11, 2012 11:11 am
Location: Cologne, Germany
Contact:

Re: Engineering aspects of Realflow - Basic Questions

Post by fkfx » Mon Oct 08, 2012 9:53 am

What's the error message or what else is not working?

At first sight, I found this a bit strange:
file = open("/C:/Users/Gabor/scenes/test/particles_version02/001.txt", "w")

Locked

Return to “Realflow 2012”