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

Problem with reading CSV files

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By manju819

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 24, 2014, 22:36
Default Problem with reading CSV files
  #1
New Member
 
Longfei
Join Date: Apr 2014
Posts: 2
Rep Power: 0
MrNinainaidi is on a distinguished road
Hi all,

I am trying to read a csv file into the velocity boundary conditions (FOAM_CASE/0/U), and below is what I did.

Code:
    mainJet
    {
      type            timeVaryingMappedFixedValue;
      offset          csvFile;  
      csvFileCoeffs
      {
            nHeaderLine         0;
            refColumn           0;  
            componentColumns    (1 2 3); 
            separator           ",";
            mergeSeparators     no; 
            fileName            "myDataFile"; 
            outOfBounds         clamp; 
            interpolationScheme linear; 
       };
       setAverage      off;
    }
I have attached the csv file that I intend to read.
Can some one tell me what is the problem with my csv file and csvFileCoeffs settings?

Everytime when I try to run the case I get the following error message from OpenFOAM:

Code:
--> FOAM FATAL IO ERROR: 
Cannot open CSV file for reading.

file: myDataFile at line 1.

    From function CSV<Type>::read()
    in file lnInclude/CSV.C at line 82.

FOAM exiting

Thanks in advance!
Longfei
Attached Files
File Type: gz myDataFile.csv.tar.gz (249 Bytes, 129 views)
MrNinainaidi is offline   Reply With Quote

Old   July 2, 2015, 06:34
Default
  #2
Member
 
Manjunath Reddy
Join Date: Jun 2013
Posts: 47
Rep Power: 13
manju819 is on a distinguished road
Hi,
You should give the path of the file where you didn't mention it.

it should be like this

fileName "$FOAM_CASE/mydataFile";


and you should place your file in the case folder.
lionx, mmohaqeqf and rowz like this.
manju819 is offline   Reply With Quote

Reply

Tags
csv


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
[Commercial meshers] Converting a mesh with splitted cells using fluentMeshToFoam jlpelerin OpenFOAM Meshing & Mesh Conversion 4 April 25, 2011 17:56
Reading .srp/.vrp files into Matlab Will Humber FLUENT 0 February 13, 2008 14:20
Grid reading problem on parallel machine wies FLUENT 0 September 15, 2005 11:18
Error Reading files Mark FLUENT 0 August 26, 2005 17:04
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 21:51


All times are GMT -4. The time now is 11:28.