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

define CSVfile dict in the BC code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 27, 2018, 12:12
Default define CSVfile dict in the BC code
  #1
New Member
 
Ignacio Sarmiento
Join Date: Jul 2018
Posts: 8
Rep Power: 8
IgnacioSarmientoINH is on a distinguished road
Newbie question:
There is a very useful option for reading non uniform values from CSV files with dataentry/function1, but I would like to define this way 5 variables for my BC, so someone could just define every variable in the U dict as:
<entryName> csvFile;
<entryName>Coeffs
{
nHeaderLine 4;
refColumn 0; // reference column index
componentColumns (1); // component column indices
separator ","; // optional (defaults to ",")
mergeSeparators no; // merge multiple separators
fileName "fileXYZ"; // name of csv data file
outOfBounds clamp; // optional out-of-bounds handling
interpolationScheme linear; // optional interpolation scheme
}
but it's kind of redundant define all this for the 5 variables changing only componentColumns, it would be more confortable calling it only once, but that is not possible for arbitrary number of variables, actually I only can call scalars, vectors and tensors, so I was thinking in call it directly from the BC code, is that possible?
insted writing

h_(function1<scalar>::New("h", dict))
put directly in the code
h_(function1<scalar>::New("h",


{
h csvFile;
hCoeffs
{
nHeaderLine 4;
refColumn 0;
componentColumns dict.lookup("valuesColumns")[0];
separator ",";
mergeSeparators no;
fileName dict.lookup("dataFileName"),;
outOfBounds clamp;
interpolationScheme linear;
}
}

)


I know that drafting doesn't actually works, but how can I define this dict in the code so this could work? or is it possible to redefine 1 member of the dict when I call it?
Any other suggestions for not calling 5 times the same file changing only the componentColumns?
IgnacioSarmientoINH is offline   Reply With Quote

Reply

Tags
boundary condition, csv, csvfile


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
UDF error for Heat Generation mame Fluent UDF and Scheme Programming 4 March 3, 2016 05:22
REAL GAS UDF brian FLUENT 6 September 11, 2006 09:23
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 16:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 09:10
UDF Scalar Code: HT 1 Greg Perkins FLUENT 8 October 20, 2000 13:40


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