|
[Sponsors] |
August 3, 2016, 13:51 |
how to calculate dv/dx ??
|
#1 |
Member
Bijan Darbari
Join Date: Nov 2015
Posts: 48
Rep Power: 10 |
Dear All
How can I calculate dv/dx in openfoam?? As noted in OpenFOAM programming guide, the gradient of a vector is a tensor as follow: I think for calculating dv/dx, I must access the (2,1) component of tensor grad(U). How can I access that component?? Best regards |
|
August 4, 2016, 10:34 |
|
#2 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 |
Hi,
You can access a tensor T value (XY component) at each cell index "i" of the mesh as the following: Code:
forAll(mesh.C(), i) { cout << "T[" << i << "].component(tensor::XY) = " << T[i].component(tensor::XY) << std::endl; } regards, T.D. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
calculate velocity difference | helly | OpenFOAM Post-Processing | 0 | June 21, 2016 08:49 |
How to calculate the flux of this term grad(alpha1)*alphaf*U? | keepfit | OpenFOAM Running, Solving & CFD | 2 | June 9, 2016 15:08 |
How to calculate the flux of this term grad(alpha1)*alphaf*U? | keepfit | OpenFOAM | 0 | June 6, 2016 10:42 |
calculate values for eps and k from Re or u????? | sbar | OpenFOAM Pre-Processing | 5 | August 16, 2010 04:10 |
How to calculate Torque for francis turbine | manish | CFX | 4 | March 15, 2007 02:57 |