Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 426
    • Issues 426
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #414
Closed
Open
Issue created Mar 01, 2017 by Mattijs Janssens@MattijsMaintainer

Number of time steps for adjustableRunTime calculated not robust

The current logic to calculate the remaining number of time steps goes

    scalar nSteps = timeToNextWrite/deltaT_ - SMALL;
    label nStepsToNextWrite = label(nSteps) + 1;

which for e.g. deltaT=0.005, writeInterval 0.1 should go

   nSteps = 19.99999999;
  nStepsToNextWrite = 19+1

however the SMALL can fall in the truncation error and instead

   nSteps = 20.000000001;
  nStepsToNextWrite = 20+1

so replace logic with

    scalar nSteps = timeToNextWrite/deltaT_;
    // nSteps can be < 1 so make sure at least 1
    label nStepsToNextWrite = max(1, round(nSteps));
Assignee
Assign to
Time tracking