weymouth / lily-pad

Real-time two-dimensional fluid dynamics simulations in Processing. Initiated by Dr G D Weymouth:
https://github.com/weymouth/
MIT License
161 stars 78 forks source link

Multiple Foil Tests #8

Closed dankoenig closed 8 years ago

dankoenig commented 8 years ago

Is it possible to have a BodyUnion of two FoilTests? i.e. have two of the FoilTest classes within one flow in order to determine the pressure and force for each, and their interaction with each other?

body = BodyUnion(new FoilTest(x,y,...), FoilTest(x2,y2....));

does not work

weymouth commented 8 years ago

That doesn't make sense. BodyUnion takes the union of two bodies, not two test cases. If you want to look at two foils you need to use:

pair = BodyUnion(new NACA(arguments), new NACA(other arguments));

dankoenig commented 8 years ago

I see. I think the problem im facing is trying to get the outputs from FoilTest (pressure, force), as well as having the ability to supply a pitchAmp to each foil. Any suggestions?

Thank you!

On Wed, Apr 6, 2016 at 5:20 AM, Dr Weymouth notifications@github.com wrote:

That doesn't make sense. BodyUnion takes the union of two bodies, not two test cases. If you want to look at two foils you need to use:

pair = BodyUnion(new NACA(arguments), new NACA(other arguments));

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/weymouth/lily-pad/issues/8#issuecomment-206252261

weymouth commented 8 years ago

I'm thinking about updating body Union and the update routines to make this easier since it seems user unfriendly. Can you help me test it out?

dankoenig commented 8 years ago

Absolutely, I will be able to today between 530 and 730 EST.

thank you.

On Wed, Apr 6, 2016 at 12:19 PM, Dr Weymouth notifications@github.com wrote:

I'm thinking about updating body Union and the update routines to make this easier since it seems user unfriendly. Can you help me test it out?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/weymouth/lily-pad/issues/8#issuecomment-206447795

weymouth commented 8 years ago

The new version of BodyUnion lets you add as many bodies on as you want. To change their dynamics you could use

for (Body body : group.bodyList){body.follow(kinematics);}

where kinematics is a function that returns a PVector with (x,y,phi) as in the new foil example in the LilyPad.pde file.

As for forces, look at the SaveArray class in the same (BodyUnion.pde) file. You can use saved.printPressForce(pressure, group, L) to write the pressure force on all the bodies to the same file.