|
[Sponsors] |
OpenFOAM: adjustTimeStep for shallowWaterFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 9, 2023, 15:15 |
OpenFOAM: adjustTimeStep for shallowWaterFoam
|
#1 |
New Member
Join Date: Jun 2017
Posts: 15
Rep Power: 9 |
Hello,
I am running the shallowWaterFoam. I would like to have and adjustable time step based on the Courant number, see my controlDict below. My problem is that adjustTimeStep doesn't work. it seems the solver is indifferent to my controlDict setup. Any idea? Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 10 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { format ascii; class dictionary; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application shallowWaterFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 40000; deltaT 0.5; writeControl runTime; writeInterval 1; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; adjustTimeStep on; maxCo 1; // ************************************************************************* // |
|
June 9, 2023, 18:45 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66 |
Indeed many of the basic solvers do not come with variable time stepping enabled. However, many of then can be made compatible by building your own solver. Please see this particular post for an example. In your case, create your own modified version of shallowWaterFoam by editing shallowWaterFoam.c (a good practice is to name it something else like myShallowWaterFoam). After updating the source code, build it by typing into a terminal
Code:
wmake myShallowWaterFoam and then you can run your case by running Code:
myShallowWaterFoam |
|
June 12, 2023, 15:44 |
|
#3 |
New Member
Join Date: Jun 2017
Posts: 15
Rep Power: 9 |
This seems very helpful, thank you!
|
|
Tags |
adjusttimestep, openfoam 10 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Frequently Asked Questions about Installing OpenFOAM | wyldckat | OpenFOAM Installation | 3 | November 14, 2023 12:58 |
How to develop OpenFOAM with CMake and popular IDEs | cosscholar | OpenFOAM Programming & Development | 0 | March 16, 2022 16:17 |
Solvers in OpenFOAM for LES + heat transfer | arun1994 | Main CFD Forum | 1 | November 26, 2021 08:57 |
OpenFOAM Foundation releases OpenFOAMŪ 3.0.0 | CFDFoundation | OpenFOAM Announcements from OpenFOAM Foundation | 1 | November 7, 2015 16:16 |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 14:36 |