|
[Sponsors] |
January 19, 2014, 18:00 |
Varying time step
|
#1 |
New Member
erik gustafsson
Join Date: Oct 2013
Posts: 19
Rep Power: 13 |
Is it possible to set a fixed varying time step in openfoam? Let say i want
deltaT = 0.0001 if t>=0 && t<=1 deltaT = 0.001 if t>1 && t<=2 deltaT = 0.01 if t>2 && t<=3 If there is i would be really happy if someone have an example of this. At the moment I'm not satisfied with adjustableTimeStep. Thanks |
|
January 19, 2014, 22:22 |
|
#2 |
Member
Eric Robertson
Join Date: Jul 2012
Posts: 95
Rep Power: 15 |
This is certainly possible if you modify the source code of the particular solver you want to use. Would require a set of if statements.
|
|
January 20, 2014, 02:54 |
|
#3 |
New Member
Josh
Join Date: Jun 2013
Posts: 19
Rep Power: 13 |
A less-than-elegant solution might be just to run a bash script which replaces the controlDict file and runs the solver again.
|
|
January 20, 2014, 04:55 |
|
#4 |
Senior Member
|
Hi,
You can create 3 different controlDicts with required deltaT parameter and then use function objects to update control dictionary during the time. Put something like: Code:
functions { fileUpdate1 { type timeActivatedFileUpdate; functionObjectLibs ("libutilityFunctionObjects.so"); outputControl timeStep; outputInterval 1; fileToUpdate "$FOAM_CASE/system/controlDict"; timeVsFile ( (-1 "$FOAM_CASE/system/controlDict_1") (1 "$FOAM_CASE/system/controlDict_2") (2 "$FOAM_CASE/system/controlDict_3") ); } } So from the beginning of the simulation it will use controlDict_1 where you put deltaT=0.0001, from 1 to 2 s it will use controlDict_2 where you put deltatT=0.001 etc. |
|
January 20, 2014, 04:58 |
|
#5 | |
New Member
erik gustafsson
Join Date: Oct 2013
Posts: 19
Rep Power: 13 |
Quote:
(-1 "$FOAM_CASE/system/controlDict_1") (1 "$FOAM_CASE/system/controlDict_2") (2 "$FOAM_CASE/system/controlDict_3") -1 / 1 / 2 is those number related to time? |
||
January 20, 2014, 07:37 |
|
#6 |
Senior Member
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Time step size and max iterations per time step | pUl| | FLUENT | 31 | October 23, 2020 23:50 |
High Courant Number @ icoFoam | Artex85 | OpenFOAM Running, Solving & CFD | 11 | February 16, 2017 14:40 |
Extrusion with OpenFoam problem No. Iterations 0 | Lord Kelvin | OpenFOAM Running, Solving & CFD | 8 | March 28, 2016 12:08 |
calculation stops after few time steps | sivakumar | OpenFOAM Running, Solving & CFD | 7 | March 17, 2013 07:37 |
Full pipe 3D using icoFoam | cyberbrain | OpenFOAM | 4 | March 16, 2011 10:20 |