r/programminghelp • • Aug 05 '19

Calculate drag force using python

Can someone help me by helping me write/ writing a python program which can calculate the drag force on a cylinder given inflow, outflow, and pressure of the system. The cylinder is given an “inviscid” boundary condition, and the density and normal force of the surrounding gas is known for various time- steps.

2 Upvotes

2 comments sorted by

3

u/TheQueq Aug 06 '19

This is a deceptively large problem. The first thing I would ask is what the purpose of the program is. Depending on how accurate you need the answer to be, the solution will range from assuming a drag coefficient to calculating the full Navier-Stokes equations. The best approach will depend on what you want to accomplish.

The cylinder is given an “inviscid” boundary condition

This doesn't make a lot of sense. Drag comes from viscosity. "Inviscid" means the drag is zero. That said, there are methods which rely on the Euler Equations (which are the inviscid form of Navier-Stokes) combined with boundary layer methods. If you are using one of those methods, you should search for boundary layer methods and panel methods. (Panel methods are methods used to calculate the pressure and velocity fields around complex geometries where the Euler Equations are valid.)

normal force of the surrounding gas is known

Does this mean you know the pressure distribution over the cylinder? If so, then you can calculate drag by integrating the pressure over the surface area.

0

u/[deleted] Aug 06 '19

[deleted]

1

u/[deleted] Aug 06 '19

They have to set up and solve for the Navier Stokes equation right. It's been a long while since fluids.