|
[Sponsors] |
February 7, 2012, 05:40 |
Run-time Code Compilation in controlDict
|
#1 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 144
Rep Power: 20 |
Hi Foamers,
I try to implement a variable time Step in the controlDict with the #codeStream directive based on the actual time. Something like Code:
this->db().time().value() Thanks and best regards, Jan |
|
October 16, 2022, 23:53 |
|
#2 |
New Member
xinyu
Join Date: Apr 2022
Posts: 24
Rep Power: 4 |
May I ask if you have solved this problem? I have also encountered this problem.
|
|
October 17, 2022, 11:46 |
|
#3 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 144
Rep Power: 20 |
sorry, but It's has been to long, can't remember. But as far as I know, there is now a functionObject available to control the time step. May this is helpful for your requirements.
Best, Jan |
|
October 17, 2022, 22:08 |
|
#4 |
New Member
xinyu
Join Date: Apr 2022
Posts: 24
Rep Power: 4 |
Thank you very much for your help. I will try this method.
|
|
October 18, 2022, 00:51 |
|
#5 | |
Member
Tatsuya Shimizu
Join Date: Jul 2012
Posts: 42
Rep Power: 14 |
Quote:
Hi Can't you access time() of db() with the following code? const IOdictionary& d = static_cast<const IOdictionary&>(dict); scalar t = d.db().time().value();
__________________
Our Work: https://www.idaj.co.jp/product/ennovacfd/openfoam_gui/ Powered by Ennova : https://ennova-cfd.com/ Ennova's Channel Partners : http://www.wolfdynamics.com/ |
||
October 19, 2022, 05:15 |
|
#6 |
New Member
xinyu
Join Date: Apr 2022
Posts: 24
Rep Power: 4 |
Thank you very much for your help. I'm a novice. I've tried this method. It works. Why?
I can use scalar t=this ->db(). time(). value() in the u file; However, it is not allowed in the coalcloudproperties file. In addition, vectorField&field=* this; The same problem will arise. Thanks and best regards, liyuu |
|
October 24, 2022, 06:23 |
|
#7 | |
New Member
xinyu
Join Date: Apr 2022
Posts: 24
Rep Power: 4 |
Quote:
I can use scalar t=this ->db(). time(). value() in the u file; However, it is not allowed in the coalcloudproperties file. In addition, vectorField&field=* this; The same problem will arise. Thanks and best regards, liyuu |
||
|
|
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 12:08 |
Run time Selection Mechanism - Some help required to understand | jaswi | OpenFOAM Programming & Development | 3 | October 29, 2015 14:42 |
Orifice Plate with a fully developed flow - Problems with convergence | jonmec | OpenFOAM Running, Solving & CFD | 3 | July 28, 2011 06:24 |
Full pipe 3D using icoFoam | cyberbrain | OpenFOAM | 4 | March 16, 2011 10:20 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |