CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Modifying forces.C to output CSV

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ngj

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   August 24, 2013, 04:57
Default Modifying forces.C to output CSV
  #1
Member
 
Anand Lobo
Join Date: Jun 2013
Posts: 56
Rep Power: 12
Boloar is on a distinguished road
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
00677             << "("
00678             << sum(force_[0]) << ","
00679             << sum(force_[1]) << ","
00680             << sum(force_[2])
00681             << ") "
00682             << "("
00683             << sum(moment_[0]) << ","
00684             << sum(moment_[1]) << ","
00685             << sum(moment_[2])
00686             << ")"
00687             << endl;
Is there a function that outputs the magnitude of a vector input? And how can I get rid of those parentheses that show up in the output? I ask because I'm not the most competent programmer.
Boloar is offline   Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] outputTime in Swak function immortality OpenFOAM Community Contributions 20 October 6, 2022 12:08
RNG diverged during the analysis the flow over a multi element airfoil, why? s.m OpenFOAM Running, Solving & CFD 0 August 5, 2013 08:39
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 09:34
[OpenFOAM] Probe Multiple Points in ParaView and Output as CSV eric.m.tridas ParaView 4 November 29, 2011 13:30
Output transient file to csv Ben CFX 3 September 23, 2008 08:17


All times are GMT -4. The time now is 14:42.