Recursive model for body in fluid

In summary, MrsTMouse's problem is that she is struggling to model the angular motion when a force is applied a distance from the center of the object. She also is struggling to make the approximation more precisely, but with the same time step of 0.001.
  • #1
MrsTMouse
8
0
Good evening,

I've been trying to wrap my head around this problem for some time and I just can't seem to get it straight.

What I am trying to achieve:
I want to program a recursive model that calculates the position of a moving body in a fluid after a certain time.

What i have done already
I got as far as to simulate the movement due to a force applied at the center of the object.
In pseudo-code
for the speed at t = n
//calculate the drag force due to vn-1 Wikipedia reference
Fd = 0.5*ρ*vn-12*Cd*A //
// add any external force that may have been applied when n-1<=t<n and the gravitational force
Ftot= Fd+Fext+Fg
// calculate the acceleration of the object at n
an=Ftot/m
// assume the acceleration constant for dt so the velocity becomes
v = vn-1 + an*dt
// calculate the new coordinates of the object based on vn

This works fine as long as the time step dt is small enough (0<dt<0.00001)
The amount of calculations is too high. So i decided to approximate some more by limiting the rate of change of the drag force Fd.est = MAX(const,Fd)
This leads to a decent approximation with about a factor 100 less calculations per second (0<dt<0.001), which i think is sufficient. I observed a 10% disparity between the original and the approximation after 10^7 iterations.

What I'm struggling with
1) I'm stumped on how to model the angular motion when a force is applied a distance d from the center of the object
2) Is there a way to make the approximate the whole model more precisely but with the same dt = 0.001

If anyone has tips on how I can improve I would greatly appreciate it.

MrsTMouse
 
Physics news on Phys.org
  • #2
For off-center forces, you will have to compute the produced torques and solve another equation for angular motion.

To compute things more efficiently, you will need to learn some numerical methods for ordinary differential equations. Your method, by the way, is known as Euler's method.
 
  • #3
My dynamics are not what they ought to be. Could you provide an example calculation for the torque and the angular motion equations?
Is there a numerical method for ODE s that I can readily apply or if not, is there free literature I can read up in?

Thanks for the help, much appreciated.
 
  • #4
First, you need to determine the center of mass and the moment(s) of inertia of your body. Then you need to determine the net torque of the forces (relative the center of mass). Then you will have an equation very similar to Newton's second law. Look up the details on Wikipedia, if unclear, ask for help here.

To solve an ODE, I would try by default one of the Runge-Kutta integrators. Wikipedia is your friend again.
 
  • #5
So for the off-center forces:
// calculate all moments due to forces that apply on the body (drag, external, gravity = 0 due to symmetry)
Fd= 0.5*A*Cd*ρ*ωn-12
Mdrag = Fd*r where r = radius of the object(assuming the object is symmetrical)
Mext = Fext*x where x is the distance to to centre of mass
// calculate angular acceleration
α = Mtot/I
// calculate angular speed
ωnn-1+α*dt
// calculate new angle of the body
θnn-1n*dt

For the runge kutta methods. If I understood correctly I would want to calculate the (angular) velocity with it by doing above calculations 4 times with
k1 : euler
k2 : dt = dt/2 and vn-1 = vn-1 + k1*dt/2
k3 : dt = dt/2 and vn-1 = vn-1 + k2*dt/2
k4 : dt = dt and vn-1 = vn-1 + k3*dt

and then vn = vn-1 + dt/6(k1+2k2+2k3+k4)

and the new coordinates are then pn = pn-1 + vn*dt
 
  • #6
MrsTMouse said:
For the runge kutta methods ...
and then vn = vn-1 + dt/6(k1+2k2+2k3+k4)

and the new coordinates are then pn = pn-1 + vn*dt

The first part of that looks OK, but the last part
pn = pn-1 + vn*dt

is throwing all improved accuracy away, because it is just the same as Euler's forward difference method!

You need to rewrite your second-order differential equation as two coupled first order equations and then solve both of them together using R-K. Any examples of solving equations of motion usiing R-K (on the web or in a textbook) should show you how to do it right. (Or search PF for other threads about RK, this sort of question comes up fairly often).

Also, it's not obvious from your equations that you will always have the correct sign for the drag force. Remember the force changes direction if the velocity is reversed, but ##v^2## does mot change sign when ##v## goes from positive to negative. Maybe you want to calcule ##v | v | ## instead (i.e. ##v## times the absolute value of ##v##.)
 
  • #7
If your object is a sphere, then drag should not have any torque.

Secondly, a rotating body, even a sphere, produces greater drag, but I do not remember any details on that.
 
  • #8
I made my calculations for a ring. So surface fri tion is much smaller than the drag.

I will try to rewrite my ode s as coupled first order equations as soon as I get some free time.
 

Related to Recursive model for body in fluid

1. What is a recursive model for body in fluid?

A recursive model for body in fluid is a mathematical model used to describe the motion of a body in a fluid, such as a person swimming in water or a bird flying through the air. It takes into account the forces acting on the body, such as gravity, buoyancy, and fluid resistance, and uses equations to predict the body's trajectory and velocity.

2. How does a recursive model for body in fluid differ from other models?

A recursive model for body in fluid differs from other models in that it takes into account the changing conditions of the fluid and the body's motion over time. This allows for a more accurate prediction of the body's trajectory and velocity, as opposed to simpler models that only consider steady-state conditions.

3. What are the applications of a recursive model for body in fluid?

A recursive model for body in fluid has many applications in various fields, such as aerospace engineering, biomechanics, and sports science. It can be used to design more efficient aircraft and watercraft, improve athletic performance, and understand the movement of marine animals.

4. How is a recursive model for body in fluid developed?

A recursive model for body in fluid is developed by using principles of fluid mechanics and applying them to the specific body and fluid system being studied. This involves creating equations that describe the forces acting on the body and using numerical methods to solve for the body's motion over time.

5. What are the limitations of a recursive model for body in fluid?

While a recursive model for body in fluid can provide accurate predictions in many cases, it also has some limitations. It may not account for all factors that affect the body's motion, such as turbulence or complex fluid behavior. Additionally, it may be computationally intensive and require advanced mathematical skills to develop and use.

Similar threads

  • Classical Physics
2
Replies
35
Views
2K
  • Classical Physics
2
Replies
48
Views
2K
  • Classical Physics
Replies
2
Views
1K
Replies
14
Views
433
  • Classical Physics
Replies
12
Views
1K
  • Classical Physics
Replies
5
Views
885
Replies
3
Views
679
  • Classical Physics
2
Replies
49
Views
2K
  • Classical Physics
Replies
17
Views
2K
Replies
13
Views
785
Back
Top