|
[Sponsors] |
February 7, 2012, 04:40 |
Run-time Code Compilation in controlDict
|
#1 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 137
Rep Power: 19 |
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, 22: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, 10:46 |
|
#3 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 137
Rep Power: 19 |
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, 21: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 17, 2022, 23:51 |
|
#5 | |
Member
Tatsuya Shimizu
Join Date: Jul 2012
Posts: 42
Rep Power: 13 |
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, 04: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, 05: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 11:08 |
Run time Selection Mechanism - Some help required to understand | jaswi | OpenFOAM Programming & Development | 3 | October 29, 2015 13:42 |
Orifice Plate with a fully developed flow - Problems with convergence | jonmec | OpenFOAM Running, Solving & CFD | 3 | July 28, 2011 05:24 |
Full pipe 3D using icoFoam | cyberbrain | OpenFOAM | 4 | March 16, 2011 09:20 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 18:07 |