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

get velocity gradient with a boundary function

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 20, 2011, 10:08
Default get velocity gradient with a boundary function
  #1
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18
Chris Lucas is on a distinguished road
Hi
I want to write a new inlet boundary condition for epsilon. For this new boundary condition, I need calculate for instance the velocity gradient ( and magSqr(symm(fvc::grad(U))) )

I know I can get the velocity field at the patch using:
const fvPatchField<vector>& U = patch().lookupPatchField<volVectorField, vector>("U");

The problem is (as I understand it) that by using the code above, U is a “vector patch field”. But if I want to get the velocity gradient (using fvc::grad(U)), U must be a volVectorField.


Is there a way to get the velocity of the entire grid within the boundary condition, so that I can calculate the velocity gradient and then use this result to get the velocity gradient at the patch?


Thanks for the help.
Christian
Chris Lucas is offline   Reply With Quote

Old   August 10, 2011, 06:57
Default
  #2
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 16
lindstroem is on a distinguished road
Hi Chris,

did you succeed?

I also want to get the velocity gradient at a patch..

Thanks in advance.
lindstroem is offline   Reply With Quote

Old   August 10, 2011, 09:36
Post
  #3
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18
Chris Lucas is on a distinguished road
Hi,

I didn't looked into this subject much more and therefore didn't solve the problem. Please let me know if you do

Best Regards
Christian
Chris Lucas is offline   Reply With Quote

Old   August 24, 2012, 14:17
Default
  #4
New Member
 
Wei Liu
Join Date: Apr 2011
Location: West Lafayette, IN
Posts: 29
Rep Power: 15
mathslw is on a distinguished road
Quote:
Originally Posted by lindstroem View Post
Hi Chris,

did you succeed?

I also want to get the velocity gradient at a patch..

Thanks in advance.
Hi,

I also want to get the velocity gradient at a patch.

did you succeed?

Thanks!

Wei
mathslw is offline   Reply With Quote

Old   August 27, 2012, 04:11
Default
  #5
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18
Chris Lucas is on a distinguished road
Hi,

no, I have not continued this work.


The following is a guess only (not sure if this works or even if this is correct):

I guess you need the normal BC gradient and not the fvc::grad.

Look at src/thermophysicalmodelbasic/derivatedFvPatchFields/gradientEnthalpy.C

as shown there, you get the surfaceNormalGradient of a fvPatchScalarfield (hope the same is true for fvPatchVectorField) with the function snGrad.


Another method is to calculate the gradient by hand. You have the value at the BC and the cell value next to the BC + the distance. However, this way you do not get the surfaceNormalGradient.


Kind Regards,
Christian
Chris Lucas 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
Problem with assigned inlet velocity profile as a boundary condition Ozgur_ FLUENT 5 August 25, 2015 05:58
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 16:45
Calculated gradient boundary condition similar to gammaContactAngle adona058 OpenFOAM Running, Solving & CFD 0 September 26, 2007 16:23
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15
New topic on same subject - Flow around race car Tudor Miron CFX 15 April 2, 2004 07:18


All times are GMT -4. The time now is 21:32.