Sign in to follow this  
Numsgil

Drag in a liquid

Recommended Posts

I'm working on a simulation where the user can set different rates for friction and drag for spheres moving through an undetermined medium. The friction works as though the spheres were sliding across the medium, and I have equations and controls for that all worked out. Where I'm having difficulty is in working out a model for drag. I'm assuming drag through a liquid. I'd like the user to be able to set the basic constants for an equation. So far I've managed to find Stokes Drag Equation (?) which is Force = 6pi *(viscosity)* Radius * velocity. But I understand this doesn't work under all circumstances (something about Oseen's equation?) And I get incredibly large values for the force when I plug it in, so I need to know a good range for viscosity. Most resources I can find for this are practice tests, so you can imagine I'm feeling a little confused and overwhelmed. Does anyone have any experience in this area?

Share this post


Link to post
Share on other sites
Stoke's Equation for laminar motion, where the force that is resisting motion is given as you stated, yes. When a resistive force felt is porportional to speed the equation of motion is ma(t) = -bv(t). However you could make things a bit easier for yourself. For example we have a(t) = -b/m*v(t) when we divide through by mass. Working this into a body in motion through a viscous liquid we have a(t) = g - b/m * v(t) or a(t) + b/m *v(t) = g. This sets it up for a method that is very similar to what is in Lengyel's book but not as simple. So I will simply borrow from him.

In Lengyel's book an approximation for the forces felt and the resulting motion through a resistive medium is given by:

mg - mkv(t) = ma(t). Simple, the solving of the differential equation results in:

x(t) = g/k * t + (kv0 - g / k2 )(1 - e-kt) + x0 where you can modify k to adjust the resistance felt and v(t) = g/k + (v0 - g/k)e-kt. Ive not implemented this so I suggest you experiment. Notice that his k is my b/m and is the damping constant.

Note also that the reason this is an ideal case is because there will always be other influencing forces invloved and such a simple scenario is practically unencouterable.

Share this post


Link to post
Share on other sites
Thanks for your help. Is the g gravity? Perhaps you could define some of the variables you used (just so I'm sure I understand what your equations are talking about).

Since the simulation is run in discrete steps, how should I simulate the order of action and reaction.

For instance, say one of the circles tries to move with a force of X in one cycle. Should drag be considered for the end velocity of the impulse before the velocity is actually finalized?

Share this post


Link to post
Share on other sites
I apologize for being so terse.

When a moving object feels a force that is in oppisition to its motion and porportional to its velocity then equation of motion can be given as ma = -bv or ma + bv = 0. b here is a property of the object that tells about the surface of that object and how fluids move around it. This property can be measured in wind tunnels. For an object in a gravitational field this can be further rewritten as ma + bv = mg or ma = mg - bv. Where mg is the gravitational force. Dividing through by the mass we get a = g - (b/m) * v thus we can rewrite this as the differential equation: a + (b/m) * v = g.

Lengyel gives the solution as:

x(t) = (g/k) * t + ((kv0 - g) / k2 )(1 - e-kt) + x0 where k, the damping constant, can be adjusted to affect the resistance felt and x(t) is position based on an input time. As I said it looks like k = b/m and b is based on the nature of the surface of the object and can be found by placing the object in a wind tunnel. Fortunatley though, using stoke's equation for laminar motion through a viscous liquid for the sphere, I believe b = 6πηr.

No need to calculate impulses as we are doing the simple case. You can use that equation for position as is.

Share this post


Link to post
Share on other sites
Actually, in liquids, aside of drag, there's also effect of so-called added mass (unsure if it's correct English term). It is especially essential for convincing object-fall-into-water simulation, but could be important there as well. For example if you simulate things with very small own mass (bubble), and don't take added mass into account, you get insane values for acceleration at first step.

Also, don't forget about buoyancy, too.

So, equation becomes:
m*a + volume*density*addedmass_constant*a + velocity*drag_constant = external_forces + m*g - volume*density*g
so we have
a = (external_forces + m*g - volume*density*g - velocity*drag_constant) / (m + volume*density*addedmass_constant)

where m*g - volume*density*g is just weight force plus buoyant force, g is vector pointing down equal to free fall acceleration, and a is acceleration of our object.

Addedmass_constant is around 1.something , I believe .

When using some solution, you could need to use (m + volume*density*addedmass_constant) as mass of object.

(no analitic equation about liquid are really precise in real world, of course, and this added mass thing is approximation as well.)

There was thread on similar topic some time ago.

Additional note: Drag proportional to velocity could lead to simulation instabilities, but fortunately it is simple enough to compute that semi-analitically.
If dv/dt=-o*v , then v=v0*exp(-o*t)
there, o is drag_constant/mass
So, for timestep dt instead of doing
v-=dt*v*drag_constant/mass
you can
v*=exp(-dt*drag_constant/mass)
(It's assuming you have some other forces and will have to inegrate it)

Share this post


Link to post
Share on other sites
Looking at my fluid dynamics notes, the added mass is m* = 1/2*(density of fluid)*(volume of sphere)

In my notes it's derived by calculating the velocity potential, then the pressure and then integrating across the sphere. Although before I looked at my notes I would have just done it by considering the energy of the system.

Either way, the effect of 'added mass' is more important than drag in most cases. But then I would say that because in the course I've done it's all inviscid flows.

Share this post


Link to post
Share on other sites
Yes, my 1 or 1.5 was probably exaggregated... I remember some homework problem with cocentric spheres and liquid between 'em.
Speaking of effect of added mass, it is very important for accelerating body but not for body that is moving with constant velocity.

Share this post


Link to post
Share on other sites
So for the algorithm, this would be a good order: (?) (keep in mind for friction I'm pretending the bots are in a flat world with gravity pointing in towards the screen, and for drag I'm pretending they're in a fishbowl like environment with gravity pointing along the y axis of the screen. It's a magic medium.)

1. Calculate Drag and Friction and other resistive forces based on current relative velocity. Store these in an acceleration vector.
2. Add external forces to the acceleration vector.
3. Calculate added mass and static friction (only if velocity = <0,0>) to see if the sphere has sufficient force to change velocity. If it does, then change the sphere's velocity with acceleration vector - static and added mass forces.
4. Zero out the acceleration vector.
5. Check for and correct collisions between spheres.
6. Move the spheres.

Is that right? Or am I missing a step or placing something out of order?

Share this post


Link to post
Share on other sites
since the added mass is due to the mass of boundary layers that get dragged along, i think the most important factor to take into account is surface area.

Quote:

Looking at my fluid dynamics notes, the added mass is m* = 1/2*(density of fluid)*(volume of sphere)

that surprises me. what does the inner goemerty have to do with the outside flow?

also, using surface area is plausible cuase it has the desired effect of being significant on small objects whilst being insignificant on large objects.

area*mu*rho*someconstant would most probably do fine.

Share this post


Link to post
Share on other sites
Quote:
Original post by Eelco
since the added mass is due to the mass of boundary layers that get dragged along, i think the most important factor to take into account is surface area.

Not only. Imagine you have large sphere with water and with small sphere inside, at center of large one. If you move small sphere, most of water will move in opposite direction. In case large sphere is very big or infinite, you get that added mass should be proportional to volume of small sphere...
Simple idea: as sphere moves in one direction, center of mass of water moves in opposite direction.
Water dragged along only increases amount of water that have to move in opposite direction...
Quote:

Quote:

Looking at my fluid dynamics notes, the added mass is m* = 1/2*(density of fluid)*(volume of sphere)

that surprises me. what does the inner goemerty have to do with the outside flow?

also, using surface area is plausible cuase it has the desired effect of being significant on small objects whilst being insignificant on large objects.

area*mu*rho*someconstant would most probably do fine.

Share this post


Link to post
Share on other sites
i believe what you are talking about is called the boundary layer Dmytry and feel is a bit over the top for the original poster's needs. Simple approximations are sufficient. I suppose one cannot neglect buoyancy however.

I will also note that non zero viscosity is in use here and we have laminar flow as well as implied by using Stoke's method. By the first stipulation alone it is obvious that there is no inviscid flow.

Share this post


Link to post
Share on other sites
Quote:
Original post by Daerax
i believe what you are talking about is called the boundary layer Dmytry and feel is a bit over the top for the original poster's needs. Simple approximations are sufficient. I suppose one cannot neglect buoyancy however.

I will also note that non zero viscosity is in use here and we have laminar flow as well as implied by using Stoke's method. By the first stipulation alone it is obvious that there is no inviscid flow.

I believe boundary layer is something very different, if I translated this term correctly.

Indeed, there is some liquid moving along with object, but it's usually not as important as flow in liquid all around object, where most of liquid are moving in opposite direction to direction of body. (i.e. easy to see that center of mass of liquid are moving in direction opposite to direction of body movement [grin])

When object are moving in incompressible liquid with constant velocity, and flow is laminar, looking from object's system of reference, there is some constant flow field all around object. If you change velocity by dV you'll change kinetic energy of flow. F*V=dE/dt so you can use energy conservation to find force that was required to cause certain acceleration. (this is actually quite general thing, it works with other mechanical stuff like gearboxes (if you want to compute rotation inertia of gearbox))

With stuff like bubbles(when this "added mass" accounts for literally entire inertia), it is VERY significant and important, and with other stuff it's significant aswell. "added mass" it's just sort of inertia of water that have to move if object moves*, and it is around ~volume*liquid_density.

For example, if you have submerged submarine with mass about M (and buoyancy M*g), and apply force F, it will have acceleration probably about ~F/(2*M) (at least F/(1.5*M), but I remember that for real water and real sub, it's around 2), that is, about 2 times smaller than one would get ignoring added mass. I'm is not sure in figures for floating ships, but also something similar.

[Edited by - Dmytry on June 5, 2005 12:32:10 PM]

Share this post


Link to post
Share on other sites
Well the boundary layer is the fluid that seems to "stick" to the surface of our object in viscous flow. The proper simulations of this is no simple thing and involves the use of tensors and the use of concepts from the Navier Stokes equations.

The approximation I gave is valid for resisted motion in the direction of motion and takes into account the "resistive forces" of the surrounding fluids with respect to the nature of our body.

But yes you are right about the importance of the concept of boundary layers, I just dont think it would appropriate to simulate such directly unless you were making some sort of professional ship simulator.

Share this post


Link to post
Share on other sites
I actually weren't proposing to take just boundary layer into account. "Added mass" is not just mass of boundary layer. It consist of inertial effect of fluid motion around object (which could sort of include boundary layer too, tho in not so simple way).
Most of this inertial effect is due to fluid moving in direction opposite to direction of motion of object.

(Actually, Eelco were talking about boundary layer portion of added mass, that would quite depend to surface of object.)

This added mass concept is just a simple method to approximate inertial effect of liquid, absolutely non computationally expensive, and is conceptually very simple. (you just pretend that object have bigger mass)

not to derail this thread: it's sort of like "inertia" of gearbox. If you want to simulate motor attached to gearbox, you pretend that gearbox have some rotation inertia (if you aren't interesting in simulating each gear (for example if motor with torque I is connected to ideal 10x up gearbox connected to flywheel with inertia I, "inertia of gearbox" is 100*I and rotation acceleration of motor is T/(100*I))). Both things is mechanical systems where velocities of massive parts linearly (in case of liquid, approximately linearly) depends to velocity of some shaft.

[Edited by - Dmytry on June 5, 2005 1:29:07 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Dmytry
Quote:
Original post by Eelco
since the added mass is due to the mass of boundary layers that get dragged along, i think the most important factor to take into account is surface area.

Not only. Imagine you have large sphere with water and with small sphere inside, at center of large one. If you move small sphere, most of water will move in opposite direction. In case large sphere is very big or infinite, you get that added mass should be proportional to volume of small sphere...
Simple idea: as sphere moves in one direction, center of mass of water moves in opposite direction.
Water dragged along only increases amount of water that have to move in opposite direction...


ah yes thats indeed a good point, didnt think of that. that imfluence is probably more significant for a lot of situations.

although adding the mass of this water to that of the body, whilst it does increase its inertia, is far from physically correct, since this added intertia doesnt move with the same speed or in the same direction at all...

this is all quite complex... probably best to use some empirical motivated formula, with numerical stability as an excuse. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Eelco
Quote:
Original post by Dmytry
Quote:
Original post by Eelco
since the added mass is due to the mass of boundary layers that get dragged along, i think the most important factor to take into account is surface area.

Not only. Imagine you have large sphere with water and with small sphere inside, at center of large one. If you move small sphere, most of water will move in opposite direction. In case large sphere is very big or infinite, you get that added mass should be proportional to volume of small sphere...
Simple idea: as sphere moves in one direction, center of mass of water moves in opposite direction.
Water dragged along only increases amount of water that have to move in opposite direction...


ah yes thats indeed a good point, didnt think of that. that imfluence is probably more significant for a lot of situations.

although adding the mass of this water to that of the body, whilst it does increase its inertia, is far from physically correct, since this added intertia doesnt move with the same speed or in the same direction at all...

Actually, it's sorta like gearbox or other similar mechanical system. If speeds of massive parts linearly depend to speed of "shaft"(I mean thing we apply force to) (currently I'm talking about one dimension of motion of thing we apply force to, like rotation around one axis, or motion of ball along straight line(note:water doesn't have to move along straight line)), it will work like there's some inertia added, doesn't really matter how this mechanical system works. It comes from energy conservation, and that F*V=dE/dt. For some dV/dt you find corresponding dE/dt that is nicely proportional to V so you get F.

Of course, everything is more complicated in 3D with general shapes (I think in general case you have something like dV/dt=T*F where T is some tensor). But with spheres everything is simpler, and you really have added mass that (for idealized liquid) is mostly straightforward to compute, you just need to integrate energy of flow and apply energy conservation. (thing higherspeed said about)
Quote:

this is all quite complex... probably best to use some empirical motivated formula, with numerical stability as an excuse. :)

Yes, and added mass is such thing(used in simulating ships), but it's not only empirically motivated but theoretically aswell.

Share this post


Link to post
Share on other sites
I've been doing more research, and I think I'm almost done.

My first question is with added mass. Do all forces act on mass+added mass? That is, bouyancy, drag, gravity, etc? Obviously the actual force of gravity is determined by mg, but the effect of gravity is a = Force of gravity / (mass + added mass) right?

Second, if I understand this right, I need to let the user set viscosity and density of the liquid to allow realistic control of the simulation. Is it possible to have a highly viscous, low density liquid? Or a high density low viscosity liquid? I guess if I'm asking if viscosity and density are really independant enough to let the user control both.

Last, assuming the user can set viscosity and density such that the spheres can make the transition from laminar to terbulent flow, how should I handle that? What equations do I need to go look up? Or is it too complicated and I should just stick with laminar?

I'd like to get everything in terms of forces, so I don't need solutions in terms of anything but F =

[Edited by - Numsgil on June 6, 2005 2:27:52 AM]

Share this post


Link to post
Share on other sites
first: Yes, that's important question, actually.
To get acceleration you need to divide sum of all these forces by mass + added mass.
But added mass should not affect rotational inertia of ball.

It is important to note that generally speaking fluid forces do not have to apply to this "added mass". Them might have their own inertias. But things like buoyancy, drag, "friction", and similar stuff that absolutely doesn't somehow account for inertia of liquid should apply to this added mass.

Added mass might looks to you like sort of dark voodoo spell. Actually, it's better to think about "added mass" as draglike force that depends to acceleration of object, like F[am]=-A*added_mass , similarly to how drag depends to velocity. So, you have
A=(all_other_forces-A*added_mass)/mass
and to solve for A,
A*mass=all_other_forces-added_mass*A
and
A*mass+A*added_mass=all_other_forces
brackets
A*(mass+added_mass)=all_other_forces
and finally
A=all_other_forces/(mass+added_mass)

Of course it's all approximation, in real hydrodynamics you don't have such separate forces, you have integral of pressure on surface of object, that gives you all this stuff.

second: there's probably no real rules of that (except that there's no liquids with really very small density. ) I don't think that low density liquid can't be very viscosous; it's just not very typical. There's many liquids much more viscosous than water yet having same or lower density.

third:Speaking of turbulence and stuff... it's rather complicated thing, and requirs fluid simulation that simulates grid of cells, or simulates particles, or something similar (i did some for gas with thermal expansion).
There may be some approximations, but I don't sure how correct them may be. Whole thing leaves impression that such things is going to give you atleast twofold errors. (or even tenfold if taken from game physics books.[grin])

[Edited by - Dmytry on June 6, 2005 10:07:09 AM]

Share this post


Link to post
Share on other sites
So drag from laminar and/or turbulent forces doesn't use added mass, but all other forces do? (Just making sure I get this right).

I'm not incredibly worried about errors in the transition from laminar to turbulent flow since it's not the main focus of the program. But I would like to make it at least look realistic and offer it as a possibility.

I've read that the critical Reynolds number for a sphere is roughly 4 * 10^5. Is that right? If I just use laminar below this and turbulent above this, will it look goofy or will the effect be more or less realistic (I guess I'm asking how far from either model real objects get when they approach the critical Reynolds.)

Share this post


Link to post
Share on other sites
Quote:
Original post by Numsgil
So drag from laminar and/or turbulent forces doesn't use added mass, but all other forces do? (Just making sure I get this right).

Not, them actually should use added mass, in sense that to get acceleration you need to do that:
add all forces together and divide by mass + added mass.

(these drags are blatantly incorrect for accelerating motion and "added mass" fixes it somewhat.)

"Added mass" itself is way of taking into account part of fluid force that depends to acceleration _of_object_, I edited post above to show why you add this "added mass" to mass.
Quote:

I'm not incredibly worried about errors in the transition from laminar to turbulent flow since it's not the main focus of the program. But I would like to make it at least look realistic and offer it as a possibility.

I've read that the critical Reynolds number for a sphere is roughly 4 * 10^5. Is that right? If I just use laminar below this and turbulent above this, will it look goofy or will the effect be more or less realistic (I guess I'm asking how far from either model real objects get when they approach the critical Reynolds.)

I don't know much about this stuff, I actually don't do fluid dynamics, even less these approximations. I only know that all this stuff is horribly inprecise even for spheres.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this