The time step was being modified for Paraview outputs at the end or during a simulation. This was dangerous since abrupt changes of the time step might lead to instabilities, wrong results when calculating derivatives of quantities outputted in the simulation (e.g., kinetic energy rate) and useless iterations when performing controlled restarts with adaptive time stepping (i.e., setting the end time of the simulation and then modifying it and restarting it from the last iteration).
This PR aims at avoiding all these issues by applying the following changes:
It does not change the time step in a simulation (to reach the time end in the last iteration) unless a new parameter in the simulation control section is set explicitly to false: set time step independent of end time = false. The default is true.
It refactors the Paraview control for transient simulations. There are still two options for output control: iteration output control and time output control. The first one outputs paraview files according to an iteration output frequency. The second one outputs Paraview files according to time depending on an output frequency or one or more times specified by the output times variable.
For specific Paraview time outputs, the time step was being modified. Since this is no longer the case, we always output the file before and after an specified time. For example, if we want to output Paraview files at 5 seconds, but we only have one iteration with 4.8 seconds and another one with 5.2, both Paraview files are written, to ensure that the user can recover the time at exactly 5 seconds via Paraview.
Testing
The output of four application tests corresponding to the lethe-fluidapplication was updated for the last time step, since it is no longer modified by default.
The tests in core and solvers that needed a simulation control object were modified to include new default parameters.
The simulation_control_03 test was extended to test all the output possibilities for both constant and adaptive time step.
The simulation_control_06 tested the output in certain time interval. This was moved to the simulation_control_03 test that considers all output possibilities.
Documentation
The simulation control section in the documentation was updated. It has the new parameters and explains in detail how to use the output control parameters.
Whenever the output time variable was being used in the examples, it was replaced by its new name output time frequency in both the prm file and the doc file.
Checklist (will be removed when merged)
See this page for more information about the pull request process.
Code related list:
[X] All in-code documentation related to this PR is up to date (Doxygen format)
[X] Copyright headers are present and up to date
[X] Lethe documentation is up to date
[X] The branch is rebased onto master
[X] Code is indented with indent-all and .prm files (examples and tests) with prm-indent
[X] If parameters are modified, the tests and the documentation of examples are up to date
[x] Changelog (CHANGELOG.md) is up to date if the refactor affects the user experience or the codebase
Pull request related list:
[x] No other PR is open related to this refactoring
[x] Labels are applied
[x] There are at least 2 reviewers (or 1 if small feature) excluding the responsible for the merge
[x] If this PR closes an issue or is related to a project, it is linked in the "Projects" or "Development" section
[x] If any future works is planed, an issue is opened
[x] The PR description is cleaned and ready for merge
Description
The time step was being modified for Paraview outputs at the end or during a simulation. This was dangerous since abrupt changes of the time step might lead to instabilities, wrong results when calculating derivatives of quantities outputted in the simulation (e.g., kinetic energy rate) and useless iterations when performing controlled restarts with adaptive time stepping (i.e., setting the end time of the simulation and then modifying it and restarting it from the last iteration).
This PR aims at avoiding all these issues by applying the following changes:
time end
in the last iteration) unless a new parameter in the simulation control section is set explicitly to false:set time step independent of end time = false
. The default is true.output times
variable.Testing
lethe-fluid
application was updated for the last time step, since it is no longer modified by default.simulation_control_03
test was extended to test all the output possibilities for both constant and adaptive time step.simulation_control_06
tested the output in certain time interval. This was moved to thesimulation_control_03
test that considers all output possibilities.Documentation
output time
variable was being used in the examples, it was replaced by its new nameoutput time frequency
in both the prm file and the doc file.Checklist (will be removed when merged)
See this page for more information about the pull request process.
Code related list:
Pull request related list: