Write forces dat file

This commit is contained in:
Hrvoje Jasak 2016-08-09 13:25:49 +01:00
parent 3143f456cc
commit 520b77015d

View file

@ -35,7 +35,6 @@ for line in lines:
mvy.append(float(match.group(12)))
mvz.append(float(match.group(13)))
# combine pressure and viscous forces and moments
fx = fpx
fy = fpy
@ -53,6 +52,12 @@ for i in range(1,len(t)):
my[i] += mvy[i]
mz[i] += mvz[i]
# write clean data file
outfile=open('forces.dat','w')
for data in zip(t,fx,fy,fz):
outfile.write(' '.join([str(d) for d in data])+'\n')
# plot forces
import pylab
pylab.xlabel('iteration')