CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

Read a vector list with IFstream and create IOobject from it

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   June 14, 2013, 09:30
Default Read a vector list with IFstream and create IOobject from it
New Member
Marcel Vonlanthen
Join Date: Nov 2012
Location: Zurich, Switzerland
Posts: 28
Rep Power: 6
Sylv is on a distinguished road
Dear foamer,

I want to use some cutting planes from a source case (generate by the runtime sampling tool) to feed the inlet of a target case. To do so, I use the BC timeVaryingMappedFixedValue at the inlet of my traget case.

Unfortunately, the foamFiles generated by the sampling tool have no header, thus I cannot read them directly with timeVaryingMappedFixedValue (TVMFV). So I decided to modify this BC.

for example, TVMFV reads U values from the file U with an IOobject (IOobject needs header):
IOField<point> samplePoints
I can read the U from the sampling tool with IFstream (does not need header):
vectorField readU;
fileName caseDir = "path/to/my/Ufile"
IFstream dataStream(caseDir/"U");
dataStream >> readU;
How can I reconstruct the IOobject in TVMFV with my vectorField "readU"? My question is similar to this post, but I still don't understand how to do it...
Sylv is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

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