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

[HOW TO] Get access to the velocity gradient at a point???

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 2 Post By ycui
  • 4 Post By ycui

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2016, 11:40
Smile [HOW TO] Get access to the velocity gradient at a point???
  #1
New Member
 
Join Date: Nov 2016
Posts: 16
Rep Power: 9
ycui is on a distinguished road
Dear Foamer,

I want to calculate the velocity gradient tensor on a parcel for Lagrangian tracking. The code is in KinematicParcel.C:

Quote:
// First calculate the velocity gradient for all fluid nodes
volTensorField gradU = fvc::grad(td.cloud().U());
// Access to the value at the cell where parcel locates
tensor gradUatPoint = gradU[this->cell()];
// Transform to the particle phase
tensor gradUatParticle = rotMatrix & gradUatPoint & rotMatrix.T();
The above 3 lines works, but has two disadvantages:
1. The first line cannot parallel computed, I don't the reason.
2. For every parcel, the first line will be executed. If tracking many parcels, its time consuming.

Is there any solution for:
1. Parallel compute fvc::grad()??
2. Or directly obtain the velocity gradient tensor at the cell point (remove line 1 and only keeps line 2 & 3)??

It bothers me for a long time. Thank you very much in advance!

Best,

ycui
Luttappy and galleon like this.
ycui is offline   Reply With Quote

Old   December 6, 2016, 11:19
Default
  #2
New Member
 
Join Date: Nov 2016
Posts: 16
Rep Power: 9
ycui is on a distinguished road
I solve this problem, by:
1. put fvc::grad(U) in side CreateFields.H, read by the constructor of KinematicCloud.H, and set as vgt (velocity gradient tensor) a parameter.
2. set the interpolation function of vgt in KinematicParcle.H, otherwise cannot parallel computing.
3. use the interpolation function in KinematicParcle.C.

Then it runs very fast since for every time step fvc::grad(U) only calculate once, and allows for parallel computing.
Luttappy, ustam, galleon and 1 others like this.
ycui 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
[OpenFOAM] Annotate velocity of specific cell or point jwstolk ParaView 4 August 5, 2016 05:50
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 14:07
[snappyHexMesh] determining displacement for added points CFDnewbie147 OpenFOAM Meshing & Mesh Conversion 1 October 22, 2013 09:53
Variables Definition in CFX Solver 5.6 R P CFX 2 October 26, 2004 02:13
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


All times are GMT -4. The time now is 17:13.