Vapour Recompression (TVR) Simulation

Since I have been experimenting with the Flint particle system in Flash I decided to make a basic simulator using this action script library. The simulator did not need to be accurate it just needed to show the basic principles and relationships present.

TVR simulator image
Image of the TVR simulator | Flash file.

To create this project it was necessary to implement line zone collisions from the Lines and Collisions branch of the Flint SVN to allow the particles to bounce off bounding lines. This was very simple to implement, the first thing needed was to download and upgraded my Flint source code from the SVN, i then created a copy of the BoudingBox.as file in twoD\actions and called it BoundingShape.as. The file was then modified to reflect the new class name (BoundingShape) and changed to accept a LineZone instead of rectangular coordinates. The main update function was then changed to the following.

override public function update(emitter:Emitter,particle:Particle,time:Number ):void
{
    var p:Particle2D = Particle2D( particle );
    _zone.collideParticle(p, _bounce);
}

This code calls the collide particle function of the LineZone which check for a collision and if present it updates the particle to the new velocity and direction. The Bounding Shape action can then be implemented into your project with the following line of code.

emitter.addAction( new BoundingShape( new LineZone( point1, point2 ), 0.7 ) );

Click here to see the finished product of this project. Also if there is interest in seeing the source code for the TVR simulator or the bounding shape action leave a comment and I can upload the files.

Article Author

Pieter Vanderwerff

I am a visualisation expert based in Wellington, New Zealand. I enjoy creating new and interesting solutions that combine my experience in different design fields to create unique outcomes.

4 Comments

Hello I’ve been looking for something about particleEvent catching and I ve found your example. Do you mind if I ask you how you did it, well if you have a script or whatever could help me to test collisions, your boundingShape for example would be a great help.

10:17 AM
04 May 2009

ali

Hi Ali, i have made a test .fla file showing how to use the bounding shape class and have uploaded this along with the BoundingShape.as file, you can download them here. You will need to download the latest flint code from the Lines and Collisions branch in the SVN, then put the BoundingShape.as file in the twoD\\actions folder.This is how it should look. If you have any problems let me know.

Good Luck!

11:29 AM
04 May 2009

Pieter Vanderwerff

This might sound like a stupid question, but where exactly is the twoD\\actions folder? I’ve never messed with the internals of the swc files, I just link to it when I use it.

I would also like to thank you up front for developing this, I’ve been looking for something like this for a while.

10:52 AM
05 May 2009

Harrison

Harrison, if you check back in a few hours i will post a tutorial that should clear up some of the issues for you.

11:22 PM
05 May 2009

Pieter Vanderwerff

Write a Comment

Name and Email are required. Basic html is supported in comments.

Name

Email

Website

Comment