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

How to plot a gradient.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 7, 2009, 06:17
Default How to plot a gradient.
  #1
New Member
 
Quentin
Join Date: May 2009
Posts: 22
Rep Power: 17
Bedotto is on a distinguished road
Hi all,

in my study about a turbulent couette flow (including the energy equation for an incompressible flow) I would like to plot the heat flux in paraFoam (like U for instance). That's equivalent to plot the gradient of the temperature T. That's why I've tried to create a new field I call "gradT" which is a Volume vector Field and I've tried to solve the equation "gradT"=fvc::grad(T). But it doesn't work(It nevers works the first time ) and I receive the following error mesage:

Beta.C: In function ‘int main(int, char**)’:
Beta.C:140: error: no matching function for call to ‘Foam::fvMatrix<Foam::Vector<double> >::fvMatrix(Foam::tmp<Foam::GeometricField<Foam::V ector<double>, Foam::fvPatchField, Foam::volMesh> >)’

And I want to solve the following equation:
fvVectorMatrix gradTEqn
(
gradT
- fvc::grad(T)
);

gradTEqn.solve();

Maybe is there a better way to plot the gradient? I hope you will have some hints concerning my operator error message.

My regards
Quentin

P.S: I'm not sure if that's the good section of the forum.
Bedotto is offline   Reply With Quote

Old   July 7, 2009, 10:48
Default
  #2
Senior Member
 
santos's Avatar
 
Jose Luis Santos
Join Date: Mar 2009
Location: Portugal
Posts: 215
Rep Power: 18
santos is on a distinguished road
Send a message via Skype™ to santos
Hi,

Try this:

Code:
volVectorField gradT
(
  IOobject
  (
    "gradT",
    runTime.timeName(),
    mesh,
    IOobject::NO_READ,
    IOobject::AUTO_WRITE
  ),
  fvc::grad(T)
);
Regards,
Jose Santos
santos is offline   Reply With Quote

Old   July 8, 2009, 04:57
Default
  #3
New Member
 
Quentin
Join Date: May 2009
Posts: 22
Rep Power: 17
Bedotto is on a distinguished road
Thanks Santos that was the command I required.
Bedotto 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
plot temperature gradient isabel CFX 1 October 6, 2008 23:51
How to plot pressure gradient in Fluent? jrg FLUENT 3 November 12, 2007 05:48
Adapt gradient and time plot. Sham FLUENT 2 April 14, 2005 13:43
plot the gradient for scalar tseo FLUENT 1 February 20, 2004 14:15
How to compute gradient for non-orthogonal grids? Paul Hsieh Main CFD Forum 3 November 11, 2003 05:52


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