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

Gradients

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 16, 2006, 01:17
Default Hello All, I am wondering i
  #1
Member
 
Shaun Cooper
Join Date: Mar 2009
Posts: 54
Rep Power: 17
coops is on a distinguished road
Hello All,

I am wondering if it is possible to get access to the spatial gradient constituents of the divergence operator.

What I really want is to be able to look at the three seperate constituents of the divergence of the velocity (i.e du/dx, dv/dy, dw/dz). How can I access these so that I can print these fields out at each time step?

Thanks in advance,

Shaun
coops is offline   Reply With Quote

Old   October 16, 2006, 01:26
Default Calculate fvc::grad(U) and tak
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Calculate fvc::grad(U) and take the xx, yy and zz component.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   October 16, 2006, 01:52
Default Thanks for the advice thus far
  #3
Member
 
Shaun Cooper
Join Date: Mar 2009
Posts: 54
Rep Power: 17
coops is on a distinguished road
Thanks for the advice thus far however I have the following problem.

I have created a field called gradU that is a volTensorField. It is written out at each time step. From this field I was then going to take the individual constituents I require. For example I created a volScalar field called streamwise and at the end of the application (just before runTime.write(); at the end of the time step) I have written the following:

streamwise = gradU.xx();

When I go to compile this I receive the following error:

newThermSolver.C:132: error: 'struct Foam::volTensorField' has no member named 'xx'

I am not sure what I have done wrong. Can someone help me with this error? This looks like an example that can be found on pg P-23 of the programmers guide.

The tensorfield gradU does write out at each time-step and does appear to work correctly.

Thanks,

Shaun
coops is offline   Reply With Quote

Old   October 16, 2006, 03:05
Default I am not sure what I have done
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Quote:
I am not sure what I have done wrong
You didn't check the header files, you didn't look for example codes that may be using the same thing, you didn't check the documentation, you didn't even search this forum.

OK, enough of that - I think you've got the message :-)

gradU.component(tensor::XX);

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   October 16, 2006, 05:20
Default Sorry, Sorry, Sorry, Sorry.
  #5
Member
 
Shaun Cooper
Join Date: Mar 2009
Posts: 54
Rep Power: 17
coops is on a distinguished road
Sorry, Sorry, Sorry, Sorry.

Thanks for you help!
coops 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
gradients cirilo Siemens 1 March 11, 2006 17:59
Gradients... Question.. Main CFD Forum 0 June 29, 2005 14:03
Gradients. J. Ca Main CFD Forum 4 February 25, 2005 15:11
GRADIENTS Luca FLUENT 2 January 28, 2005 11:43
Specifying gradients S Roy Phoenics 0 April 18, 2002 02:41


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