Modifying forces.C to output CSV
Hi all.
I'm attempting to make sense of the forces/moments output I get from OpenFOAM, and it's getting rather tiresome to have to edit my forces output into CSV and perform further calculations for every simulation. I've (kind of) found where the forces is output to file, in src/postProcessing/functionObjects/forces/forces/forces.C: Code:
00676 file() << obr_.time().value() << tab |
Hi Bolar,
The easiest would probably be to make a small shell script, which does all the modifications for you. Something along these lines (but please test on a copy first, since it is untested): Code:
#!/bin/bash 1. First, create the directory (if not already existing): Code:
mkdir $HOME/bin Code:
$HOME/bin/processForces.sh Code:
chmod +x $HOME/bin/processForces.sh Code:
export PATH=$HOME/bin/:$PATH A: Code:
cp -r forces forcesPlay Code:
processForces.sh forcesPlay/0/forces.dat Code:
processForces.sh forces/0/forces.dat I hope that this has helped. Kind regards Niels |
Quote:
|
All times are GMT -4. The time now is 10:32. |