|
[Sponsors] |
September 22, 2010, 06:47 |
Diagonal elements of a volTensorField
|
#1 |
New Member
Join Date: Sep 2010
Posts: 3
Rep Power: 16 |
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. |
|
September 23, 2010, 12:06 |
|
#2 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21 |
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. |
|
|
|
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 |