CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

OpenFOAM: adjustTimeStep for shallowWaterFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By LuckyTran

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 9, 2023, 15:15
Default OpenFOAM: adjustTimeStep for shallowWaterFoam
  #1
New Member
 
Join Date: Jun 2017
Posts: 15
Rep Power: 9
Simone81 is on a distinguished road
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;

// ************************************************************************* //
Simone81 is offline   Reply With Quote

Old   June 9, 2023, 18:45
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
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
Simone81 likes this.
LuckyTran is offline   Reply With Quote

Old   June 12, 2023, 15:44
Default
  #3
New Member
 
Join Date: Jun 2017
Posts: 15
Rep Power: 9
Simone81 is on a distinguished road
This seems very helpful, thank you!
Simone81 is offline   Reply With Quote

Reply

Tags
adjusttimestep, openfoam 10


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 09:45.