View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000097OpenFOAM[All Projects] Bugpublic2010-12-01 20:302011-05-04 11:34
Reporterbgschaid 
Assigned Tomattijs 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.7.x 
Target VersionFixed in Version1.7.x 
Summary0000097: Add support vor CSV (Comma separated value) files to OpenFOAM
DescriptionCSV is a very simple format that can be read and written by spreadsheet-programs (but also other data-processing programs). This set of patches adds support to those OF-classes where that kind of input/output is beneficial
- a new probe-class that writes CSV
- a writer for sampledSets that writes CSV
- an alternate Reader to the interpolationTable that reads from a CSV-file (thus enabling for instance timeVaryingUniformFixedValue to read from CSV)

These three patches are independent of each other.
Additional InformationDescription of the Patches:

CSVProbes.patch: adds a new functionObject csvProbes that inherits from probes but writes CSV files. To make the inheritance possible the interface to probes was slightly modified

CSVWrites.patch: adds a new writer based on raw for sampledSets. Modifies the writer class to generalize it (a separator-character can be chosen depending on the writer-type instead of the hardcoded space)

CSVTimeLine.patch: factors out the part of the interpolationTable-class that reads from a file into another run-time-selectable class. There are two implementations: "openfoam" which is the default file-format (this is used if no specific file format is chosen) and "csv" which reads from a csv-File. Typical usage is

        type timeVaryingUniformFixedValue;
        readerType csv;
        outOfBounds clamp;
        fileName "$FOAM_CASE/conditions.csv";
        hasHeaderLine true;
        timeColumn 0;
        valueColumns (3 4 5);

where readerType selects the reader (if not present it is assumed to be "openfoam"), fileName and outOfBounds are as usual, hasHeaderLine indicates whether there is a header line with descriptions of the columns (not uncommon fro spreadsheets), timeColumn is the column in which the time is found, valueColumns are the components of the value (this example is from a U-file. For a scalar this would be a single-value list)

This way of specifying makes it possible to use the same CSV-file for different boundary conditions (T in column 2 for instance) which makes it easier to keep the timeVarying boundary conditions consistent
TagsInput/output
Attached Filespatch file icon CSVProbes.patch [^] (29,758 bytes) 2010-12-01 20:30 [Show Content]
patch file icon CSVTimeline.patch [^] (36,584 bytes) 2010-12-01 20:31 [Show Content]
patch file icon CSVWriter.patch [^] (9,350 bytes) 2010-12-01 20:31 [Show Content]
patch file icon CSVTimeline.v2.patch [^] (36,869 bytes) 2010-12-05 11:01 [Show Content]
patch file icon CSVProbes.v2.patch [^] (30,263 bytes) 2010-12-14 16:23 [Show Content]

- Relationships

-  Notes
(0000153)
bgschaid (reporter)
2010-12-01 20:32

Sorry for the (non)formatting. It looked nice (paragraphs and all) in the textbox when I wrote it
(0000155)
bgschaid (reporter)
2010-12-05 11:02

Uploaded a second version of the Timeline-patch that fixes a problem if the data file does not exist
(0000178)
bgschaid (reporter)
2010-12-14 16:23

Recent changes in the GIT made the probes-patch fail so I uploaded a new version
(0000341)
mattijs (manager)
2011-04-26 18:11

Commit 6a818ef288cbfae26620182a0f5b3a7dbe94524b:
- csv interpolationTable readers (CSVTimeLine.patch)
- sampledSet csv writer (CSVWriter.patch)

I've left out the csvProbes.

Thanks!

- Issue History
Date Modified Username Field Change
2010-12-01 20:30 bgschaid New Issue
2010-12-01 20:30 bgschaid File Added: CSVProbes.patch
2010-12-01 20:31 bgschaid File Added: CSVTimeline.patch
2010-12-01 20:31 bgschaid File Added: CSVWriter.patch
2010-12-01 20:32 bgschaid Note Added: 0000153
2010-12-01 20:33 bgschaid Tag Attached: Input/output
2010-12-05 11:01 bgschaid File Added: CSVTimeline.v2.patch
2010-12-05 11:02 bgschaid Note Added: 0000155
2010-12-14 16:23 bgschaid File Added: CSVProbes.v2.patch
2010-12-14 16:23 bgschaid Note Added: 0000178
2011-04-26 18:11 mattijs Note Added: 0000341
2011-05-04 11:34 andy Status new => closed
2011-05-04 11:34 andy Assigned To => mattijs
2011-05-04 11:34 andy Resolution open => fixed
2011-05-04 11:34 andy Fixed in Version => 1.7.x