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

Get output of time derivative

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alberto

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 18, 2011, 16: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: 18
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, 20:47
Default
  #2
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

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

Old   March 14, 2012, 12:53
Default
  #4
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
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, 13:04
Default
  #5
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto 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
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
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 11:03
How to output variables every time step? Dazhi Guo FLUENT 4 January 16, 2001 11:17


All times are GMT -4. The time now is 18:00.