velocity data

Hi everyone, (well ok, Bobo is the only person posting here so Hi Bobo)



I’m just playing around with the free Krakatoa, and having a great time I might add!



I’ve been using the PRT Loader to bring in some third part CFD data. I’ve reformatted the data to meet the requirements of CSV files for Krakatoa and hey presto everything is great!

Ok, so my data contains position and velocity data, it looks like this :


<br> float32 Position[0] float32 Position[1] float32 Position[2] float32 Velocity[0] float32 Velocity[1] float32 Velocity[2]<br> 1.71E+01 0.00E+00 1.06E+01 -4.04E+00 2.43E-02 1.55E-01<br>



My question is straight forward, what can i do with this velocity data in Krakatoa. As I understand it, the loader will display velocity as lines in the viewport, but this is velocity calculated from one frame to the next and not the velocity data it reads from the file.



Any input welcome!



Also, a side point. The data I have is actually the velocity that a particle will have at a given cell, or a point in space and not sequential particle data like the type used in software like Krakatoa.

How can i take this velocity field, and feed in some particles to created an animated sequence. I imagine I could write a script but trying to calculate how a few millions particles will move through a velocity field with a couple of hundred thousand points sounds like a job for a super computer!



Cheers,



Josh.

Hi Josh,



Thanks for the kind words!



The CSV and PRT files save the velocity in generic units per second. If you were using PFlow, entering 100.0 in the Speed field of a Speed operator would output a vector value with magnitude of 100.0.



The PRT Loader simply divides that value by the FPS to give you a velocity display showing where the particle will be on the next frame, so at 30 fps it divides by 30, then draws the line.



If you open the shutter to 360 degrees and render with enough motion blur passes, you should get a line with the length of one frame. Note that the line would be CENTERED at the particle position, half showing the half of the previous frame and half showing the half of the next frame.



If you want to draw a line with the length of a whole second at 30 FPS, you would have to open the shutter for 360*30=10800 but it looks like I have limited the spinner in the UI to 3600.0, so I might fix that (anyone can, it is a script after all).



What exactly do you want to do with your velocities?





We have an operator that converts velocity data from our fluid simulation into particle motion, as does FumeFX. In your case, you might have to write your own PFlow operator in the SDK, or try your luck with Data Operators in Box #3. For example, you could create a proxy particle system where each particle represents one voxel of your data field and contains the velocity value in some channel (but not in the velocity channel, you don’t want it moving anywhere - best bet is the Scripted Vector channel). Then you could sample that proxy system with your main system using a Data Operator.

Creating the proxy system could be done with a Birth Script reading data from a text file and creating one particle per cell. The rest is straight-forward Box #3 stuff…

Hi Bobo,



thanks for your input!



I’ve now changed from using a particle loader object to using PFlow and a Krakatoa file birth to load the csv. I noticed it doesn’t list csv as one if it’s native types but it does load the file. I added a speed event (inherit previous ; 100) as you suggested and I’m now getting some results! I don’t know if they’re right though lol.



I added some data fields for colour as per the csv specification. The colour works for the loader object, but the particles render as the display colour through PFlow. I had a brainwave and added a standard material with a vertex colour map, and i then found that adding materials to the particles didn’t make a difference, maybe I’m missing something?





“The PRT Loader simply divides that value by the FPS to give you a velocity display showing where the particle will be on the next frame, so at 30 fps it divides by 30, then draws the line.”



I also tried this by changing the framerate to 1fps, the velocities still don’t show in the viewport. This isn’t important anyway, and also my data may be a bit whacked out.





“What exactly do you want to do with your velocities?”



I’m not exactly sure yet! i think my question is - what CAN I do with the velocities.



Eventually I want to be able to create animations that show visually how wind will move around our designs (I work for an architecture firm). I want something with more visual impact than the technical stuff we use now.





“We have an operator that converts velocity data from our fluid simulation into particle motion, as does FumeFX. In your case, you might have to write your own PFlow operator in the SDK…”



The data I have comes from Fluent, and since I am not much of a SDK coder I will try to get the data arranged in such a way that I can use it easily.



Thanks again for your help!



Josh.

Since it’s CSV, you could change the data so that you write velocity but read color or density. Maybe set the velocity vector to the color channel and the velocity magnitude to the density?



The PRT Pflow Birth brings in velocity, so you could do even cooler stuff with Box#3, like birth trails of particles based on velocity magnitude or feed MASSIVE amounts of particles through a velocity vector field generated by your proxy particles.


  • Chad

Since it’s CSV, you could

change the data so that you

write velocity but read color

or density. Maybe set the

velocity vector to the color

channel and the velocity

magnitude to the density?



I’ve set the colour to the velocity (now normalized) and this is working really well with the loader object.

Great idea to set the density via the velocity magnitude, I presume Krakatoa will use this data as the final pass density.



The PRT Pflow Birth brings in

velocity, so you could do even

cooler stuff with Box#3, like

birth trails of particles

based on velocity magnitude or

feed MASSIVE amounts of

particles through a velocity

vector field generated by your

proxy particles.


  • Chad



    this sounds great, but excuse my ignorance i don’t have a PRT Pflow birth operator, is this one of Orbaz’ expansions?



    How would I set up a vector field like this?



    maybe my problem isn’t understanding Krakatoa but particles systems and PFlow < :



    Thanks Chad.



    j.


this sounds great, but excuse

my ignorance i don’t have a

PRT Pflow birth operator, is

this one of Orbaz’ expansions?



By ‘PRT Pflow birth operator’ I’m 99.7% sure he meant the Krakatoa File Birth operator.

ah yes, I think you’re right.



I’ve multiplied my velocity vectors by a stupidly amount and still no joy, but I’m still getting some great effects.

Time to go back to the source and sort out some new data

Thanks again everyone.



J.


I added some data fields for

colour as per the csv

specification. The colour

works for the loader object,

but the particles render as

the display colour through

PFlow. I had a brainwave and

added a standard material with

a vertex colour map, and i

then found that adding

materials to the particles

didn’t make a difference,

maybe I’m missing something?





Note that Krakatoa File Birth does NOT load a sequence of frames but just a single frame, so no velocities will be updated per frame by it - it requires the Krakatoa FIle Position to get the particles moving.



The PFlow operators in 1.0.1 are really rather basic. We are currently reworking them completely, so in a future update the File Birth will actually be able to load SEQUENCES (both give birth and mark particles for death), as well as load colors, orientations and possibly any other channels that make sense.



Right now, you cannot get the color loaded into PFlow, it will only display in the PRT Loader.



As for the velocities, if your velocity is too short, it will not show up. Make sure the value you save in the CSV file is large enough. For example, if a particle is moving one unit per frame, the value in the file should be 30 units. Try scaling your velocity vectors a lot and see if they will display.



Also, if you disable the position loading in the Krakatoa File Position and load only velocities, you should see how fast they are moving and figure out whether the velocities are ok or too small.


>The PFlow operators in 1.0.1
>are really rather basic. We
>are currently reworking them
>completely, so in a future
>update the File Birth will
>actually be able to load
>SEQUENCES (both give birth and
>mark particles for death), as
>well as load colors,
>orientations and possibly any
>other channels that make
>sense.

They ALL make sense, otherwise we wouldn't put them in our PRT's in the first place. There just needs to be a channel mapping system that lets you load the "Mood" channel into the particle orientation or mapping 73 channel.

- Chad

They ALL make sense, otherwise

we wouldn’t put them in our

PRT’s in the first place.

There just needs to be a

channel mapping system that

lets you load the “Mood”

channel into the particle

orientation or mapping 73

channel.





Well, the Age channel for example does not necessarily make sense to load - the age is assigned to a particle at birth, so we can ignore that channel even if it was saved. The loader will compare two consecutive frames based on their Born ID and figure out which particles are new in the second file (have to be born) and which are not there anymore (have to die). The dead particles will not be deleted but just marked in a dedicated Frantic channel, and a Test will let you decide whether you want to actually delete them or just color them pink or something ;o)



In general we hope to support anything that is saved in the file, sooner or later.

Note that Krakatoa File Birth

does NOT load a sequence of

frames but just a single

frame, so no velocities will

be updated per frame by it -

it requires the Krakatoa FIle

Position to get the particles

moving.





that’s ok, I’m still working with a snapshot, a single frame! < :



The PFlow operators in 1.0.1

are really rather basic. We

are currently reworking them

completely, so in a future

update the File Birth will

actually be able to load

SEQUENCES (both give birth and

mark particles for death), as

well as load colors,

orientations and possibly any

other channels that make

sense.



Right now, you cannot get the

color loaded into PFlow, it

will only display in the PRT

Loader.



As for the velocities, if your

velocity is too short, it will

not show up. Make sure the

value you save in the CSV file

is large enough. For example,

if a particle is moving one

unit per frame, the value in

the file should be 30 units.

Try scaling your velocity

vectors a lot and see if they

will display.



ok, I’ll try this









Also, if you disable the

position loading in the

Krakatoa File Position and

load only velocities, you

should see how fast they are

moving and figure out whether

the velocities are ok or too

small.



Bobo, i don’t see how to do this! is there an option in the PRT Loader?





Thanks again!



Josh.