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

Diagonal elements of a volTensorField

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

Like Tree1Likes
  • 1 Post By eugene

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2010, 06:47
Default Diagonal elements of a volTensorField
  #1
New Member
 
Join Date: Sep 2010
Posts: 3
Rep Power: 15
CpCaniggia is on a distinguished road
Dear All,

I need to compute the diagonal elements of a volTensorField. The tensor field has the form,

volTensorField tmp ("tmp", fvc::grad(U));

It seems OpenFoam 1.6 doesn't have a function like diag(tmp). Does OpenFoam 1.7 have such kinds of function? Do any people know how to compute the diagonal elements?

Many thanks,
Y. J.
CpCaniggia is offline   Reply With Quote

Old   September 23, 2010, 12:06
Default
  #2
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
If you want the sum of the diagonal elements then:

volScalarField trTmp = tr(tmp);

If you just want the diagonal components, then

tmp.xx()
tmp.yy()
tmp.zz()

will provide the individual fields.
makaveli_lcf likes this.
eugene is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Low Mach number Compressible jet flow using LES ankgupta8um OpenFOAM Running, Solving & CFD 7 January 15, 2011 14:38
Error while running rhoPisoFoam.. nileshjrane OpenFOAM Running, Solving & CFD 8 August 26, 2010 13:50
How to get the Diagonal elements of volTensorField su_junwei OpenFOAM Running, Solving & CFD 0 December 1, 2008 11:29
Penetrating elements in extruded mesh Michael P CFX 2 May 20, 2005 09:06
CFX4.3 -build analysis form Chie Min CFX 5 July 13, 2001 00:19


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