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

how to calculate dv/dx ??

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 3, 2016, 13:51
Default how to calculate dv/dx ??
  #1
Member
 
Bijan Darbari
Join Date: Nov 2015
Posts: 48
Rep Power: 10
bijan darbari is on a distinguished road
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
Attached Images
File Type: png Capture.PNG (5.5 KB, 10 views)
bijan darbari is offline   Reply With Quote

Old   August 4, 2016, 10:34
Default
  #2
Senior Member
 
Join Date: Sep 2010
Posts: 226
Rep Power: 16
T.D. is on a distinguished road
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;
}
the other components can be accessed by T[i].component(tensor::XX), T[i].component(tensor::YY), etc..

regards,

T.D.
T.D. 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
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


All times are GMT -4. The time now is 02:43.