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

Tensor data generated by foamToVTK

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 15, 2008, 20:38
Default Hi, What is the number of
  #1
New Member
 
J. T.
Join Date: Mar 2009
Posts: 12
Rep Power: 8
cpplabs is on a distinguished road
Hi,
What is the number of components of the Bmean tensor in the results of tutorial/channelOodles/channel395 ? foamToVTK marks the tensor has 6 components but saves 9 for each of them.
Thanks,

JT
Bmean 6 60000 float
followed by 540000 values (60000 * 9)
cpplabs is offline   Reply With Quote

Old   January 30, 2008, 23:01
Default Found the reason for the probl
  #2
New Member
 
J. T.
Join Date: Mar 2009
Posts: 12
Rep Power: 8
cpplabs is on a distinguished road
Found the reason for the problem: the 6 components symmTensor is saved as a regular 9 components tensor. I have a fix but don't know how to attach the files, can someone let me know how to submit the fix.
Thanks.
cpplabs is offline   Reply With Quote

Old   January 31, 2008, 06:00
Default See the Documentation->Formatt
  #3
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
See the Documentation->Formatting on the left: \attach

Alternatively tell us what you've changed.
mattijs is offline   Reply With Quote

Old   January 31, 2008, 14:41
Default The writeFuns::write function
  #4
New Member
 
J. T.
Join Date: Mar 2009
Posts: 12
Rep Power: 8
cpplabs is on a distinguished road
The writeFuns::write function uses the insert function to convert the symmTensor into a scalar list:
void Foam::writeFuns::write(*)
{
......
insert(vvf.internalField(), fField);
......
write(os, binary, fField);
}

The insert function is defined for scalar, vector and tensor only, not defined for symmTensor, so the one for tensor is used symmTensor.
Add the following two insert function in Foam::writeFuns can solve the problem:

void Foam::writeFuns::insert(const symmTensor& pt, DynamicList<floatscalar>& dest)
{
for (direction cmpt = 0; cmpt < symmTensor::nComponents; cmpt++)
{
dest.append(float(pt[cmpt]));
}
}
void Foam::writeFuns::insert(const sphericalTensor& pt, DynamicList<floatscalar>& dest)
{
for (direction cmpt = 0; cmpt < sphericalTensor::nComponents; cmpt++)
{
dest.append(float(pt[cmpt]));
}
}
cpplabs is offline   Reply With Quote

Old   January 31, 2008, 15:57
Default Thanks. Just so people don'
  #5
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
Thanks.

Just so people don't make the same mistake I made (board converted floatScalar to all lower case) here are the corrected files for 1.4.1.

writeFuns.C
writeFuns.H
mattijs 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
Strange foamToVTK problem hsieh OpenFOAM Running, Solving & CFD 4 January 4, 2009 01:03
FoamToVTK and MayaVi alexandrepereira OpenFOAM Post-Processing 57 August 11, 2008 04:15
FoamToVTK output names hartinger OpenFOAM Post-Processing 2 March 29, 2007 06:49
FoamToVTK problem oevermann OpenFOAM Paraview & paraFoam 6 July 11, 2006 15:10
FoamToVTK error with OF 13 melanie OpenFOAM Paraview & paraFoam 1 May 22, 2006 04:40


All times are GMT -4. The time now is 02:10.