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

Reading a volScalarField from File

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 28, 2005, 11:49
Default Is it possible to read in a vo
  #1
New Member
 
Klaus Schnitzlein
Join Date: Mar 2009
Posts: 7
Rep Power: 8
schnitzlein is on a distinguished road
Is it possible to read in a volScalarfield from a
data file (in the constant directory) during the run and if yes, how can this be achieved?

Thanks in advance.
schnitzlein is offline   Reply With Quote

Old   June 28, 2005, 11:55
Default Yes, instead of say vol
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 13
henry is on a distinguished road
Yes, instead of say

volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

use

volScalarField p
(
IOobject
(
"p",
"constant",
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
henry is offline   Reply With Quote

Old   June 29, 2005, 04:56
Default Thank you very much for your h
  #3
New Member
 
Klaus Schnitzlein
Join Date: Mar 2009
Posts: 7
Rep Power: 8
schnitzlein is on a distinguished road
Thank you very much for your help. Originally I replaced runTime.timeName() by runTime.constant(). The results are identical.

I set up the file defining the field beginning with:

dimensions [...];

internalField
nonuniform (
.. here the values are inserted
)

What I know is that I have to insert the values for the interior cells. But, in what order? And how do they relate to the cells and their indices, respectively.

I would like to specify the values in the same ordering as for the cells (polyMesh/cells). Is it possible? Is there a chance to define the values for the entire mesh, not only for the internal and boundary fields, e.g. by using a different keyword, e.g. Field ...?
schnitzlein is offline   Reply With Quote

Old   June 29, 2005, 05:01
Default Come on, this is trivial: the
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
Come on, this is trivial: the list of values is in the same order as the list of cells: first value into first cell, second value into a second cell etc. Anything else would be madness.

Hrv

P.S. For future reference, think about your problems: if it is logical, it is probably right!
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   June 29, 2005, 05:03
Default BTW, before you ask, the same
  #5
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
BTW, before you ask, the same applies for points, edges, faces, faces in patch etc.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create initiate a volScalarField p without reading from disk NO_READ does not seem to work dbxmcf OpenFOAM Running, Solving & CFD 12 August 22, 2013 07:32
Error reading trn file OliH CFX 3 March 4, 2010 09:24
Error reading msh file ANIL FLUENT 1 January 22, 2009 01:45
error reading file limingtiger CD-adapco 3 September 21, 2005 20:31
prob reading in .neu file jemteo FLUENT 0 June 15, 2004 13:00


All times are GMT -4. The time now is 19:16.