Draft: Implementation of STS algorithm#36
Conversation
1. Added sts folder and files to handle the update. 2. artemis.cpp/hpp modified a) added sts flag b) added Initialize for sts 3. artemis_driver.hpp a) added sts flag b) added the entry for sts in PreStepTasks() fn c) added the entry for sts in PostStepTasks() fn d) Added a check to remove diffusion from main step if sts is enabled 4. gas.cpp a) Added the sts flag b) Added the diffusion timetep for paramters c) Modified the timestep compuation
- changed `sts.cpp/hpp` for implmenting the RKL1 - Bug Fixed in enterting sts_integrator section in `artemis_driver.cpp`
Workable STS rkl1 Solver Update && Format Fix
- Bug fixed for sts.hpp - changed duffusion problem py script to sts solver - changed the conduction input file
STS test problem update
typo fixed in thermal_duffusion.py
|
I think most of the work on RKL1 solver has been finished and passed the CI on Darwin. |
adamdempsey90
left a comment
There was a problem hiding this comment.
Mostly organizational comments. Looks good otherwise.
Some other things to do:
- Update parameters for the new
<sts>node - Update documentation in
doc/
| if (parthenon::Globals::my_rank == 0 && info_output) { | ||
| Real ratio = tm.dt / min_diff_dt; | ||
| std::cout << "STS ratio: " << ratio << ", Taking " << s_sts << " steps." << std::endl; | ||
| if (ratio > 200.0) { | ||
| std::cout << "WARNING: ratio is > 200. Proceed at own risk." << std::endl; | ||
| } | ||
| } |
There was a problem hiding this comment.
This output should respect the ncycle_out parameter in parthenon/time. So you should make sure this tm.ncycle % tm.ncycle_out == 0 as well.
| params.Add("do_sts", do_sts); | ||
|
|
||
| if (do_sts) { | ||
| params.Add("diff_dt", std::numeric_limits<Real>::max(), Params::Mutability::Mutable); |
There was a problem hiding this comment.
| params.Add("diff_dt", std::numeric_limits<Real>::max(), Params::Mutability::Mutable); | |
| params.Add("diff_dt", Big<Real>(), Params::Mutability::Mutable); |
|
|
||
| Real muj = (2. * stage - 1.) / stage; | ||
| Real nuj = (1. - stage) / stage; | ||
| Real muj_tilde = muj * 2. / (std::pow(nstages, 2.) + nstages); |
There was a problem hiding this comment.
| Real muj_tilde = muj * 2. / (std::pow(nstages, 2.) + nstages); | |
| Real muj_tilde = muj * 2. / ( SQR(nstages) + nstages); |
| //! \brief Assembles the tasks for the STS RKL1 integrator | ||
| // comment: Maybe it should be moved back to artemis_driver.cpp | ||
| template <Coordinates GEOM> | ||
| TaskCollection STSRKL1(Mesh *pmesh, const Real time, Real dt, int stage, int nstages) { |
There was a problem hiding this comment.
I would prefer any function that builds a TaskCollection or sets up Tasks to be in ArtemisDriver directly.
| // Getting the integrator & time ratio between hyperbolic and parabolic terms | ||
| std::string sts_intg_mothod = pin->GetOrAddString("sts", "integrator", "none"); | ||
| Real sts_max_dt_ratio = pin->GetOrAddReal("sts", "sts_max_dt_ratio", -1.0); | ||
| const bool info_output = pin->GetOrAddBoolean("sts", "info_output", false); |
There was a problem hiding this comment.
Is this extra parameter needed? Printing the number of stages every ncycle_out is fine
Background
This is an ongoing and not yet finish development to implement the Super-Time-Stepping (STS) algorithm in Artemis to optimize diffusion calculations with relaxed timestep constraints.
Description of Changes
Core Changes
artemis_driver.cppandartemis_driver.hpp: Added STS control parameters and initialization logicartemis.cppandartemis.hpp: Implemented STS integration points and modified timestep handlinggas.cpp: Modified the timestep calculation for STS timestep managementNew Components
sts/directory containing implementation files for the STS algorithmImplementation Status
This is a work in progress, with the following features currently under development:
Checklist