|
[Sponsors] |
Varying time step increment in OpenFoam controlDict file |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 2, 2024, 16:39 |
Varying time step increment in OpenFoam controlDict file
|
#1 |
New Member
Hongbin Wang
Join Date: Feb 2020
Posts: 20
Rep Power: 6 |
I am modelling wind in built-in urban areas. The domain is (-1500 -1200 -4.65946) (2000 1200 500) in meters. The distance between the inlet and the outlet is 3500m. I would like the first 1000 time steps the time increment is 2 and later the increment is 1. How do I achieve this in controlDict file?
Many thanks. |
|
April 3, 2024, 04:08 |
|
#2 | |
Member
Pedro Gouveia
Join Date: Oct 2022
Location: Portugal
Posts: 64
Rep Power: 4 |
Quote:
I am not sure if there is an automated way to do this. Nevertheless, you can set the runTimeModifiable option to true in the controlDict, and when you see the analysis reaching 1000 time steps change it to 2 seconds. It will proceed just like nothing has happened. Hope this helps, Pedro Gouveia |
||
April 4, 2024, 18:32 |
|
#3 |
New Member
Hongbin Wang
Join Date: Feb 2020
Posts: 20
Rep Power: 6 |
worked out. the controlDict below works. This is a revision from the tutorial file (esi 2212)
combustion/XiEngineFoam/kivaTest/system/controlDict // Make sure all utilities know specialised models libs (atmosphericModels); application simpleFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 5000; deltaT 1; writeControl timeStep; writeInterval 1000; purgeWrite 2; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable yes; functions { timeStep { name setDeltaT; type coded; libs (utilityFunctionObjects); code #{ #}; codeExecute #{ const Time& runTime = mesh().time(); if (runTime.timeToUserTime(runTime.value()) <100) { const_cast<Time&>(runTime).setDeltaT ( runTime.userTimeToTime(2) ); } else { const_cast<Time&>(runTime).setDeltaT ( runTime.userTimeToTime(1) ); } #}; } // #include "momentum" } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Postprocess: sampleDict works but creates no output folder | shock77 | OpenFOAM Post-Processing | 14 | November 15, 2021 08:27 |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 18:13 |
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 | tlcoons | OpenFOAM Installation | 13 | April 20, 2016 17:34 |
Trouble compiling utilities using source-built OpenFOAM | Artur | OpenFOAM Programming & Development | 14 | October 29, 2013 10:59 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 02:58 |