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

IOobject and IOfield in OpenFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 2, 2008, 21:56
Default Hi all, The IO in openfoam
  #1
Member
 
Heng Xiao
Join Date: Mar 2009
Location: Zurich, Switzerland
Posts: 58
Rep Power: 8
xiao is on a distinguished road
Hi all,

The IO in openfoam seems to be complicated for me. I have been struggling for a while. Any hint on the following questions would be greatly appreciated.

1. The follow statement is from the file "CreateFile.H". Where did the code was "told" to find the suitable file and read the values for pressure from the right file? Is this the so called "demandDrivenData"?

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

2. Related to the question above, the following function is from "solidParticleIO.C". Does the statement

IOField<scalar> d(fieldIOobject("d"), np);

also create a field from a file? What data does the object "d" contain?

Thanks very much!

----------------------------
void Cloud<solidparticle>::writeFields() const
{
label np = size();

IOField<scalar> d(fieldIOobject("d"), np);
IOField<vector> U(fieldIOobject("U"), np);

label i = 0;
for
(
Cloud<solidparticle>::const_iterator iter = begin();
iter != end();
++iter, ++i
)
{
const solidParticle& p = iter();

d[i] = p.d_;
U[i] = p.U_;
}

d.write();
U.write();
}

};
----------------------------
The function "fieldIOobject" is a member function of "Cloud", defined in CloudIO.C:

template<class>
IOobject Cloud<particletype>::fieldIOobject(const word& fieldName) const
{
return IOobject
(
fieldName,
polyMesh_.time().timeName(),
"lagrangian",
polyMesh_,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
}
xiao 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
IOobject r2d2 OpenFOAM Running, Solving & CFD 19 July 31, 2009 12:48
A question on IOObject ivan_cozza OpenFOAM 0 September 16, 2008 03:24
Create GeometricField without IOobject nadine OpenFOAM Running, Solving & CFD 3 August 15, 2008 09:24
Use of IOobject to Output irishdave OpenFOAM Pre-Processing 1 January 8, 2008 12:12
IOobject constructor problem iyer_arvind OpenFOAM Running, Solving & CFD 3 November 19, 2006 07:39


All times are GMT -4. The time now is 09:22.