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

Tensor data generated by foamToVTK

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 15, 2008, 19:38
Default Hi, What is the number of
  #1
New Member
 
J. T.
Join Date: Mar 2009
Posts: 12
Rep Power: 17
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, 22:01
Default Found the reason for the probl
  #2
New Member
 
J. T.
Join Date: Mar 2009
Posts: 12
Rep Power: 17
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, 05:00
Default See the Documentation->Formatt
  #3
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
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, 13:41
Default The writeFuns::write function
  #4
New Member
 
J. T.
Join Date: Mar 2009
Posts: 12
Rep Power: 17
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, 14:57
Default Thanks. Just so people don'
  #5
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
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


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange foamToVTK problem hsieh OpenFOAM Running, Solving & CFD 5 April 24, 2023 21:12
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
[OpenFOAM] FoamToVTK problem oevermann ParaView 6 July 11, 2006 15:10
[OpenFOAM] FoamToVTK error with OF 13 melanie ParaView 1 May 22, 2006 04:40


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