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

Data Transfer

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 16, 2012, 16:58
Question Data Transfer
  #1
Member
 
Join Date: Jan 2010
Posts: 44
Rep Power: 7
Argen is on a distinguished road
I passed a multi-dimension matrix kk(N,M) from Fortran side to a volScalarField, ks, defined at OpenFoam side as,

PtrList<volScalarField> ks(Nq);
const int Nq=10;
for (int i=0;i<Nq;i++)
{
ks.set(i,new volScalarField
(
IOobject
(
"ks",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
km
)
);
};

volScalarField km
(
IOobject
(
"km",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("zero", dimless/dimLength, 0.0)
);

The outputs of data exhibit that the values for ks are the same as those for kk. But min(ks[i]) is always ZERO, even max(ks[i]) is fine.

What's wrong with this problem and how to fix it?
Argen is offline   Reply With Quote

Old   January 16, 2012, 18:04
Default
  #2
Member
 
Join Date: Jan 2010
Posts: 44
Rep Power: 7
Argen is on a distinguished road
Quote:
Originally Posted by Argen View Post
I passed a multi-dimension matrix kk(N,M) from Fortran side to a volScalarField, ks, defined at OpenFoam side as,

volScalarField km
(
IOobject
(
"km",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("zero", dimless/dimLength, 0.0)
);

The outputs of data exhibit that the values for ks are the same as those for kk. But min(ks[i]) is always ZERO, even max(ks[i]) is fine.
I found that min(ks[i])is always zero since "dimensionedScalar("zero", dimless/dimLength, 0.0)" is declared for km. I tested other values for it and correspondingly min(ks[i]) is changing no matter what values are actually specified.

How can solve this problem?
Argen 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
Writing/output of simple data into an ASCII-File matthi OpenFOAM Programming & Development 17 July 8, 2015 16:08
how to pickup the mesh data and vector data oga_shin OpenFOAM 2 October 27, 2011 23:42
Cell Data to Point Data Issues mcintoshjamie OpenFOAM Paraview & paraFoam 2 November 19, 2009 04:55
Saving particle (DPM) data to file? Philip FLUENT 2 June 12, 2006 01:41
Data transfer H. P. LIU Main CFD Forum 5 May 19, 2003 10:47


All times are GMT -4. The time now is 20:50.