Skip to content

Instantly share code, notes, and snippets.

@ottbot
Created March 31, 2011 09:07
Show Gist options
  • Save ottbot/896073 to your computer and use it in GitHub Desktop.
Save ottbot/896073 to your computer and use it in GitHub Desktop.
dvm force calc
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