View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000777OpenFOAM[All Projects] Bugpublic2013-03-13 12:182015-02-02 21:05
Reporterdhora 
Assigned To 
PrioritynoneSeverityfeatureReproducibilityN/A
StatusnewResolutionopen 
PlatformOSOS Version
Product Version2.2.x 
Target VersionFixed in Version 
Summary0000777: csv output format for functionObjects
DescriptionThe functionObjects use different output formats. CSV files would be much more convenient for the generation of plots and the monitoring of the simulations. Only small changes would be necessary. Example for the forces functionObject:

//file() << obr_.time().value() << tab
// << "(" << sum(force_[0]) << "," << sum(force_[1]) << ") "
// << "(" << sum(moment_[0]) << "," << sum(moment_[1]) << ")"
// << endl;

file() << obr_.time().value() << ", "
       << sum(force_[0])[0] << ", " << sum(force_[0])[1] << ", " << sum(force_[0])[2] << ", "
       << sum(force_[1])[0] << ", " << sum(force_[1])[1] << ", " << sum(force_[1])[2] << ", "
       << sum(moment_[0])[0] << ", " << sum(moment_[0])[1] << ", " << sum(moment_[0])[2] << ", "
       << sum(moment_[1])[0] << ", " << sum(moment_[1])[1] << ", " << sum(moment_[1])[2]
       << endl;


It's not a major issue, just a proposal.

Best regards
David

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0003642)
wyldckat (updater)
2015-02-01 17:02

I took a look into this, because I actually thought this was already implemented in 2.3.x. But it's not.

What is implemented is a similar feature that is already implemented in the class "sampledSets", used by the "sampling" library... for sampling sets, namely these (quoted from "sampleDict"):
// uniform evenly distributed points on line
// face one point per face intersection
// midPoint one point per cell, inbetween two face intersections
// midPointAndFace combination of face and midPoint
//
// polyLine specified points, not nessecary on line, uses
// tracking
// cloud specified points, uses findCell
// triSurfaceMeshPointSet points of triSurface


In theory, this class "sampledSets" can be used as a basis for creating a new somewhat more generic class for writing out tabular data that was populated by other classes, such as the "forces" and "probes" classes.
This isn't hard to do, but it's essentially "bureaucratic coding", since it's mostly one to three management classes for storing data prior to writing...

The objective here seems to be that one or a few classes are needed for storing tabular data, or at least row data, before it's stored to the final file, in any specific format, already provided by the "Foam::writer" class.

- Issue History
Date Modified Username Field Change
2013-03-13 12:18 dhora New Issue
2015-02-01 17:02 wyldckat Note Added: 0003642