-
Notifications
You must be signed in to change notification settings - Fork 12
Draft: Implementation of STS algorithm #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.cpp
andartemis_driver.hpp
: Added STS control parameters and initialization logicartemis.cpp
andartemis.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