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

Adding a term that includes time

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 27, 2010, 10:05
Default Adding a term that includes time
  #1
New Member
 
Ozgur Kirlangic
Join Date: May 2009
Location: Istanbul
Posts: 16
Rep Power: 8
ozgur is on a distinguished road
Hi,

A very simple question: In OpenFOAM, how can I add a term that includes time into my equations?

My first attempt which doesn't work is as follows:

solve
(
fvm::ddt(T)==-exp(-time())
);

Thanks for any comments,

Ozgur
ozgur is offline   Reply With Quote

Old   August 27, 2010, 10:23
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,594
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Hi Ozgur

time() is not a known object, so use runTime.time().value() instead. The "value()" request is given as it strips off the dimensionality of the given time and merely returns a scalar. This is needed as exp() does not know how to handle dimensionedScalar.

Further you need to do "A * Foam::exp(- runTime.time().value())", where A is a dimensionedScalar A("null", dims , 1), where dims is the dimensions of ddt(T). If this is not added you will get an error while running the program due to the dimensional checking functionality, however the program will compile.

Instead of dims you could e.g. do "dimensionSet( 0, 1, -1, 0, 0, 0, 0)" which sets the dimensions to those of velocity.

Have a nice weekend,

Niels
ngj is offline   Reply With Quote

Old   August 27, 2010, 13:59
Default
  #3
New Member
 
Ozgur Kirlangic
Join Date: May 2009
Location: Istanbul
Posts: 16
Rep Power: 8
ozgur is on a distinguished road
Hi Niels,

Thank you very much. It worked fine

cheers,

Ozgur
ozgur 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
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Floating point exception error Alan OpenFOAM Running, Solving & CFD 10 April 6, 2012 14:02
Convective term evaluated at time n+1/2 Lionel S. Main CFD Forum 0 February 12, 2007 15:22
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07
unsteady calcs in FLUENT Sanjay Padhiar Main CFD Forum 1 March 31, 1999 12:32


All times are GMT -4. The time now is 16:45.