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

Get output of time derivative

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By alberto

Reply
 
LinkBack Thread Tools Display Modes
Old   November 18, 2011, 17:49
Default Get output of time derivative
  #1
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 9
nandiganavishal is on a distinguished road
Dear Foamers,

I would like to know, if we can get the time derivative of a variable as the output. For instance, if I am solving the transient Navier Stokes, is it possible to get the acceleration (du/dt) too at every time step as an output.

Kindly let me know.

Regards

Vishal Nandigana
nandiganavishal is offline   Reply With Quote

Old   November 20, 2011, 21:47
Default
  #2
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Use fvc::ddt(yourField) to store it in a volField of the same type of your field. Setting the IOobject to AUTO_WRITE will have the time derivative stored.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   November 21, 2011, 12:45
Default
  #3
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 9
nandiganavishal is on a distinguished road
Thanks Alberto. It worked well.
nandiganavishal is offline   Reply With Quote

Old   March 14, 2012, 13:53
Default
  #4
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 275
Rep Power: 7
Andrea_85 is on a distinguished road
Hi,
how can i get the same in a postprocessing? If i use this code:

read U
read rho

volVectorField ddt
(
IOobject
(
"ddt",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),

fvc::ddt(rho,U)
);

ddt.write()

it returns always zero.

best
andrea
Andrea_85 is offline   Reply With Quote

Old   March 14, 2012, 14:04
Default
  #5
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by Andrea_85 View Post
Hi,
how can i get the same in a postprocessing? If i use this code:

read U
read rho

volVectorField ddt
(
IOobject
(
"ddt",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),

fvc::ddt(rho,U)
);

ddt.write()

it returns always zero.

best
andrea
If you only declared the field in createFields.H, it is normal. You have to

a) declare the field as you did in createFields.H

b) add the line

Code:
ddt == fvc::ddt(rho,U);
at the end of pEqn.H, so you have the corrected velocity. You do not need the .write() call if you define the field with AUTO_WRITE in the global scope.

Best,
sharonyue likes this.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM 6 April 12, 2011 11:24
lift and drag on ship superstructures vaina74 OpenFOAM Running, Solving & CFD 3 June 8, 2010 12:30
ForcesCoeffs ronaldo OpenFOAM 4 September 14, 2009 07:11
Time derivative in transiente run Antonio Lopes CFX 2 January 12, 2008 12:03
How to output variables every time step? Dazhi Guo FLUENT 4 January 16, 2001 12:17


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