|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Join Date: Sep 2010
Posts: 3
Rep Power: 4 ![]() |
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. |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 723
Rep Power: 10 ![]() |
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. |
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 13:38 |
| Error while running rhoPisoFoam.. | nileshjrane | OpenFOAM Running, Solving & CFD | 8 | August 26, 2010 12:50 |
| How to get the Diagonal elements of volTensorField | su_junwei | OpenFOAM Running, Solving & CFD | 0 | December 1, 2008 10:29 |
| Penetrating elements in extruded mesh | Michael P | CFX | 2 | May 20, 2005 08:06 |
| CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 12, 2001 23:19 |