|
[Sponsors] |
August 27, 2010, 11:05 |
Adding a term that includes time
|
#1 |
New Member
Ozgur Kirlangic
Join Date: May 2009
Location: Istanbul
Posts: 16
Rep Power: 17 |
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 |
|
August 27, 2010, 11:23 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
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 |
|
August 27, 2010, 14:59 |
|
#3 |
New Member
Ozgur Kirlangic
Join Date: May 2009
Location: Istanbul
Posts: 16
Rep Power: 17 |
Hi Niels,
Thank you very much. It worked fine cheers, Ozgur |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Floating point exception error | Alan | OpenFOAM Running, Solving & CFD | 11 | July 1, 2021 22:51 |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 06:36 |
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 13:32 |