From 17129062cd4cea7aff3de2885c74a03dd4c05d53 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Wed, 7 Sep 2016 13:49:02 +0100 Subject: [PATCH] Added dat file for forces and moments Conflicts: bin/plotForces.py --- bin/plotForces.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/plotForces.py b/bin/plotForces.py index fd8ff938d..a7d779848 100755 --- a/bin/plotForces.py +++ b/bin/plotForces.py @@ -35,6 +35,7 @@ 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,10 +54,17 @@ for i in range(1,len(t)): mz[i] += mvz[i] # write clean data file -outfile=open('forces.dat','w') +outForces=open('forces.dat','w') for data in zip(t,fx,fy,fz): - outfile.write(' '.join([str(d) for d in data])+'\n') + outForces.write(' '.join([str(d) for d in data])+'\n') +outForces.close() + +outMoments=open('moments.dat','w') + +for data in zip(t,mx,my,mz): + outMoments.write(' '.join([str(d) for d in data])+'\n') +outMoments.close() # plot forces import pylab