2D PJ Pressure analizer

Moderator: Mike Everman

Suns
Posts: 23
Joined: Sun Sep 19, 2010 2:55 pm
Antipspambot question: 125

2D PJ Pressure analizer

Post by Suns » Mon Sep 20, 2010 6:56 pm

Hello all, this is my first post,

I´m Robinson from Brazil and graduated in Engineering of control and automation.
I have the wish to build a PJ for some time now, the first one will be probably Short Lady from Larry.

Well, when i buy the necessary tools, I post something about that. (i dont have access to the university tools anymore)

I has working a little with uflow1d and missed to be able to put a pj like chinese in it. I has unable to find free 2d or 3d flow/pressure simulation software, and easy to use. (i find out about lisa now when posting, i will try it)

I´m making a very simple software, easy to use to try simulate PJ in 2d.
The simulation appears to works. I´m putting some effort to make it usable for everyone.

something like the uflow1d, with 2d and simple equations.
eath pixel will be one node of simulation

the interface will be command line,
you make a simple image with the PJ borders in black.
Red is the initial pressure, and green the initial velocity, blue probably will be fixed pressure points.

You have a config file, to put some constants.
the program will generate a image per frame.

TGA RGB files without RLE compression

it is about to be release, it will have bugs and generate a lots of non real data first. I will need help to test and get more ideas.

After that i planned to put gas composition and temperature to the nodes, with that i want to make a crude simulation of the sustainable PJ operation.

Robinson

Suns
Posts: 23
Joined: Sun Sep 19, 2010 2:55 pm
Antipspambot question: 125

Re: 2D PJ Pressure analizer

Post by Suns » Mon Sep 20, 2010 8:12 pm

Some demos, without PJ walls

the simulation resolution is 10x10 nodes.

i put a point initial pressure on this video:
http://www.badongo.com/vid/1724754


And 3 pixel points initial pressure on this:
http://www.badongo.com/vid/1724755

Robinson

Suns
Posts: 23
Joined: Sun Sep 19, 2010 2:55 pm
Antipspambot question: 125

Re: 2D PJ Pressure analizer

Post by Suns » Tue Sep 21, 2010 5:52 pm

Just draw a simple open tube on paintbrush, and put to simulate.

This is the results:
http://www.youtube.com/watch?v=BFaOPep5CS8

http://www.youtube.com/watch?v=3QDRU4N8avY

Robinson

Suns
Posts: 23
Joined: Sun Sep 19, 2010 2:55 pm
Antipspambot question: 125

Re: 2D PJ Pressure analizer

Post by Suns » Wed Sep 22, 2010 2:49 pm

Software RELEASED!!!!

Just save a image with max 1024x1024 in TGA greyscale (draw on paint and convert using xnview to 256 grey scale and to tga)
The black 0x00, is borders, any other grey is local pressure, 128 grey is 0.

the image is pj.tga (next version i will you the filename inside config.cfg)
and run 2dflow.exe
you can change some setting in config.cfg
the simulation will be saved inside /anim directory

the ffmpeg-avi.bat will make a video from the simulation, using ffmpeg (included).


If someone is interested you can download it here:
http://www.badongo.com/file/24174871
http://www.4shared.com/file/aL5C4Xty/2D-FlowSim.html

And a new video Short Lady like
http://www.youtube.com/watch?v=Ajc2RyOqo-M

zono
Posts: 78
Joined: Wed May 28, 2008 1:03 pm

Re: 2D PJ Pressure analizer

Post by zono » Fri Sep 24, 2010 2:24 pm

I am thrilled ! Thank you for this work, I will test it soon.

zono
___________________________
zono - the thruster buster
--------------------------------------

zono
Posts: 78
Joined: Wed May 28, 2008 1:03 pm

Re: 2D PJ Pressure analizer

Post by zono » Fri Sep 24, 2010 11:03 pm

i couldn't sleep until i tested your sim-tool. wow ! works fine !

simulation of a cone reflector pipe has been done, looks very good. and i have many questions:

- what are the meanings and gas dynamics parameters in your cfg file?

iframe=100; //quantos frames processar para tirar um shot
???
framelim=100000; //total de frames a processar
ok, clear
cof=0.01; //coeficiente de compressibilidade
what ist this translated to ideal gas equation ""p = rho R T"
dT=0.1; //delta Tempo por frame
milli seconds ???
dump=1.0; //Coeficiente de amortecimento
???
//dump=0.9985;

//dump=0.9999;

and last question: did you use wave equation only, or also mass transport, mass and impulse conservation equations?

thanks for all, zono
Attachments
00233.jpg
cone-reflection.jpg
(8.4 KiB) Downloaded 57 times
___________________________
zono - the thruster buster
--------------------------------------

Rossco
Posts: 589
Joined: Fri Nov 28, 2003 12:16 pm
Antipspambot question: 0
Location: Australia, Brisbane
Contact:

Re: 2D PJ Pressure analizer

Post by Rossco » Sat Sep 25, 2010 11:35 pm

Robinson,

This is very cool!

What is it written in?
Can the extremes of the image not be walls?
Sofar... very fun toy. Will be watching.

Rossco
Big, fast, broke, fix it, bigger, better, faster...
[url=callto://aussierossco]Image[/url]

Suns
Posts: 23
Joined: Sun Sep 19, 2010 2:55 pm
Antipspambot question: 125

Re: 2D PJ Pressure analizer

Post by Suns » Mon Sep 27, 2010 12:40 pm

Rossco,
Thanks very much for your reply.
(the better part of making a software for the community is to see others trying and using it!!)
What is it written in?
Can the extremes of the image not be walls?
Sofar... very fun toy. Will be watching.
It is written in pure C.

I have tried to make the limits of the image not be walls, but I got problems with the simulation like having a inverse pressure have coming back. (fixed pressure on the limit dont work heheh.)
But it is something that will be implemented.
- what are the meanings and gas dynamics parameters in your cfg file?

iframe=100; //quantos frames processar para tirar um shot
???
framelim=100000; //total de frames a processar
ok, clear
cof=0.01; //coeficiente de compressibilidade
what ist this translated to ideal gas equation ""p = rho R T"
dT=0.1; //delta Tempo por frame
milli seconds ???
dump=1.0; //Coeficiente de amortecimento
???
//dump=0.9985;
//dump=0.9999;
Sorry i forgot and leave the config file in Portuguese, and with no explanations.
iframe is the number of frames on simulation to jump and not make an output image.
framelim is total number of frames to be processed
cof is the coefficient of compressibility rho (and other coefficients together).
dT is the delta time from one frame to another in seconds. if too big can make integration errors.
dump is an wave absorber magic component. It dumps the speed field.

-After the simplifications i made i skipped a lot of things, my focus has to make a sim core that works, I´m now working on making the simulation correct.
-Like i have no reference of how much size is one pixel in real size environment.
-How much 0x01 on the gray-scale is on pressure scale.
-Gas compressibility and everything else is a empirical value for now to make the output of simulation looks good.

My focus will be:
-Make the limits of the image work like a infinite space, no walls on the limit. (already tried, need a better idea)
-Make a better output, using RGB output.
-Work again on equations to make the simulation output be usable in real world. (new parameters like: distance per pixel, pressure per greyscale)
-Put monitor points. It will output the pressure and speeds of the gas in that point in a CSV file. (Or i can output everything to a CVS file. can be rendered in another software in anyways wished)
-Work on dump, making viscosity instead and wave impact on surfaces lose energy.
and last question: did you use wave equation only, or also mass transport, mass and impulse conservation equations?
I use a simplification of generic scalar transport equations.
http://en.wikipedia.org/wiki/Wave_equat ... t_equation
http://en.wikipedia.org/wiki/Generic_sc ... t_equation
I have a conservation of the mass and impulse (if i let the image limits not be wall the total mass of the gas will change).
And it do mass transport to. The wave come as a consequence in the simulation.
I can have discarded some thing important in the simplification, this is on the next steps.

Well thats it for now, the next thing i will make is output RGB images, think on putting R=pressure, G=X velocity and B=Y velocity, after that i think the walls issue.

Thanks again for your reply

Robinson Bruginski

Suns
Posts: 23
Joined: Sun Sep 19, 2010 2:55 pm
Antipspambot question: 125

Re: 2D PJ Pressure analizer

Post by Suns » Tue Sep 28, 2010 3:00 pm

No I´m not conserving the impulse.

i tested to see bernoulli effect, and an air foil and it dont work. I think i know what need to be done.

Going to correct this.

Suns

zono
Posts: 78
Joined: Wed May 28, 2008 1:03 pm

Re: 2D PJ Pressure analizer

Post by zono » Tue Sep 28, 2010 5:33 pm

Hi Robinson,

thank you again for your great sim-tool and your answers to me (zono) and Rossco. Seems you have already two new fans (or followers) !

I am so happy, that you started developing this tool, so I would be glad, trying to support you in some questions to improve your tool. Programming in C is not my strength, but as process engineer I have some knowledge in fluid dynamics, that would help you a little bit. Here some first hints for you:

- I think, you couldn't test bernoulli effect and an air foil , because your tool doesn't support velocity as initial condition yet? If you used generic transport equation, you HAVE conserving of impulse anyway.

- look for "farfield conditions" in your literature. There you may be able to set your boundary conditions to set constant pressure or constant density at your walls.

- maybe reflections on the outer boundary walls do not affect your simulation, if frame is 1024x1024 pix and your PJ model only , say 100x40 pix (in first approach, its not a real good recommendation of me.)

- if you want, you can post parts of your algorithms, where i can try to translate your params (i.e. cof -> rho, R ,T and pix ->dx and greyscale -> p) so you can get reality conditions.

go on ! it's a great work of art !

zono
___________________________
zono - the thruster buster
--------------------------------------

hinote
Posts: 1241
Joined: Sat Oct 04, 2003 1:54 am
Antipspambot question: 0
Location: Central California

Re: 2D PJ Pressure analizer

Post by hinote » Tue Sep 28, 2010 7:48 pm

Hello:

I hope this post doesn't destroy the enthusiasm shown thus far in this thread. The ability to see pressure variations created by software is undeniably interesting and worthwhile.

In order to be more realistic though you're going to have to introduce velocity variations due to temperature. Most photos of operating pulsejets show that temperature variations within the duct are extreme, varying from near ambient up to combustion temp. This represents a temp variation in excess of 1000 degrees C.

As an example, the speed of sound at 100C has a velocity of about 388 meters/sec., but at 650C the velocity is almost doubled at 728 meters/sec.

Since Bernoulli (pv=k) rules here the pressure is going to deviate substantially too.

FWIW

Bill

Suns
Posts: 23
Joined: Sun Sep 19, 2010 2:55 pm
Antipspambot question: 125

Re: 2D PJ Pressure analizer

Post by Suns » Tue Sep 28, 2010 8:24 pm

Zono, Thanks again for your reply.
Will be good to use your expertise, i´m running some simulations and organizing the code to be understandable next week. I will probably put this thing as open-source as soon it become modular.

Hinote, my final objective is a tool easy to use, just draw, drop and run.
But i plan to increase the quality of simulation, with the pulse-jets in mind. I plan to put air temp, air composition and combustion into the nodes.
If i can get self sustained operation with know design i will be satisfied.

I put viscosity to the air, with this i can see the effect of argumentator working. It sucks the outside air to the flow.
DEMO-viscosity.png
DEMO-viscosity.png (12.42 KiB) Viewed 17519 times
vacum.png
Original design
vacum.png (427 Bytes) Viewed 17516 times
In the sample image the green and red is on zero = zero, so if the speed is -1 the value of color will be 255. (gives a good contrast without looking the rgb of the pixels)
strong red areas, air going up
strong green areas air going left

Blue is the pressure, but the orders of magnitude is too big in the image it keep folding.

I hardcoded the constant speed on the left and right, the flow is to the right
the throat you see a mid green, it is high speed air to the right.

zono
Posts: 78
Joined: Wed May 28, 2008 1:03 pm

Re: 2D PJ Pressure analizer

Post by zono » Wed Sep 29, 2010 8:22 am

Hi Suns,

it's a good idea publishing your code as open source. The best and bigges open-souce-hosting website i know is :

http://sourceforge.net/

There are more CFD tools , but not as easy to use than yours!

Here my question to your color-images: did you add color output already, or colored it with a image manipulation tool? It is ´good, having viscosity added, but augmentors or ejectors are already working without viscosity (I made a tool for it) . They are also working based on pure impulse conservation. To show your code working with augmentors, you should use another figure, where circulation can occur:

zono
Attachments
ejector.jpg
___________________________
zono - the thruster buster
--------------------------------------

Washout661
Posts: 11
Joined: Fri Nov 17, 2006 12:42 pm
Antipspambot question: 0
Location: Edinburgh

Re: 2D PJ Pressure analizer

Post by Washout661 » Wed Sep 29, 2010 11:54 am

How realistic would it be to use 3 separate images as inputs to set the initial conditions?
eg 1 each for initial pressure, temp & velocity. Separate outputs for each of these could be much easier to interpret for analysis.
Also, if you are looking at importing in RGB for pressure & temp, would it be useful to use the 3 fields to crudely import in scientific notation, eg R.G x 10^B. This would give you much more range in values to play with rather than being limited to 255 values.

Cheers

Steve

Suns
Posts: 23
Joined: Sun Sep 19, 2010 2:55 pm
Antipspambot question: 125

Re: 2D PJ Pressure analizer

Post by Suns » Wed Sep 29, 2010 3:22 pm

Zono,

I used sourceforge before, i have a little things made for opensource community (sis5597 linux driver, some mplayer filters).
Never archived a popular software but anyways some of my software achievements. hehe I made a sound codec VHZ (not fft based), a crypto system, a image recognition engine (used by Brazilian team on robocup), a data compression engine, an 3d engine (Vesa videocards era), and some things smaller.

appears to be doing coanda effect too

The color output is direct from the simulation.

i will test the type of augmentor you showed here.

I will put new parameters to cfg file, horizontal speed (it will create fixed speed on the left and right borders, creating flows)
Or/and constant pressure on the left and the right. (maybe pressure points)
-cfg for color output or basic pressure output.
-disable viscosity from sim, it slowdown the simulation.

This way i stop hard-coding every time this things, and release the version 0.02

Thinking on using a lib like pnglib or implement bmp read. Tga is a good binary file format but not in use anymore.
BMP you have image upside down some times, and every crazy thing to read from header and correct.

Steve, i has thinking of doing something like this. Thanks.
For output maybe it is a good idea to output RGB in the notation that you describe, i will see if it looks good.
For input need to play a little, something diferent maybe better.
(there is some image format that is 32bits floatpoint i think, that is used in professional cameras and tools for HDR)
http://en.wikipedia.org/wiki/High_dynamic_range_imaging

Robinson

Post Reply