Created
March 31, 2011 09:07
-
-
Save ottbot/896073 to your computer and use it in GitHub Desktop.
dvm force calc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vi = w.vortices[step]; | |
fx = -vi.gamma * (vi.y - vi.yI)/w.dt; | |
fy = -vi.gamma * (vi.xI - vi.x)/w.dt; | |
/* average with previous shed vortex */ | |
if (step >= 1) { | |
vi = w.vortices[step - 1]; | |
fx = (fx + (-vi.gamma * (vi.y - vi.yI)/w.dt))/2.; | |
fy = (fy + (-vi.gamma * (vi.xI - vi.x)/w.dt))/2.; | |
} | |
for (i=0; i<=step;i++) { | |
vi = w.vortices[i]; | |
vj = w.displaced_vortices[i]; | |
u = (vj.xI - vi.xI)/w.dt; | |
v = (vj.yI - vi.yI)/w.dt; | |
fy += vi.gamma * u; | |
fx += vi.gamma * v; | |
} | |
w.vortices[step].fx = fx; | |
w.vortices[step].fy = fy; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment