-
Notifications
You must be signed in to change notification settings - Fork 13
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
Draft
doraemonho
wants to merge
15
commits into
lanl:develop
Choose a base branch
from
doraemonho:STS
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
06ddc80
Layout the Infrastructure for STS algorthim
doraemonho 9dc6ac6
STS RKL1 Integrator implmentation
doraemonho 99a7de7
minor bug fix & added TODO
doraemonho 7696934
RKL1 implmentation improved and bug fix
doraemonho b55663b
Merge branch 'develop' into STS
doraemonho b81ece7
Move the "min_diff_dt" to inner if loop
doraemonho 3f489d1
Workable STS rkl1 Solver Update
doraemonho d0f4841
Format Fix
doraemonho 2209813
Format Fix
doraemonho 5dd332a
Format Fix
doraemonho c4315ce
Merge pull request #1 from doraemonho/STS_dev
doraemonho 979e35d
STS test problem update
doraemonho 5e74f2b
Merge pull request #2 from doraemonho/STS_dev
doraemonho f01b765
typo fixed in thermal_duffusion.py
doraemonho 402efbe
Merge pull request #3 from doraemonho/STS_dev
doraemonho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |||||
| #include "artemis.hpp" | ||||||
| #include "gas.hpp" | ||||||
| #include "geometry/geometry.hpp" | ||||||
| #include "sts/sts.hpp" | ||||||
| #include "utils/artemis_utils.hpp" | ||||||
| #include "utils/diffusion/diffusion.hpp" | ||||||
| #include "utils/diffusion/diffusion_coeff.hpp" | ||||||
|
|
@@ -183,6 +184,15 @@ std::shared_ptr<StateDescriptor> Initialize(ParameterInput *pin, | |||||
| const bool do_conduction = pin->GetOrAddBoolean("physics", "conduction", false); | ||||||
| params.Add("do_conduction", do_conduction); | ||||||
|
|
||||||
| const bool do_sts = pin->GetOrAddBoolean("physics", "sts", false); | ||||||
| params.Add("do_sts", do_sts); | ||||||
|
|
||||||
| if (do_sts) { | ||||||
| params.Add("diff_dt", std::numeric_limits<Real>::max(), Params::Mutability::Mutable); | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| Real sts_max_dt_ratio = pin->GetOrAddReal("sts", "sts_max_dt_ratio", -1.0); | ||||||
| params.Add("sts_max_dt_ratio", sts_max_dt_ratio); | ||||||
| } | ||||||
|
|
||||||
| const bool do_diffusion = do_viscosity || do_conduction; | ||||||
| params.Add("do_diffusion", do_diffusion); | ||||||
|
|
||||||
|
|
@@ -388,6 +398,7 @@ std::shared_ptr<StateDescriptor> Initialize(ParameterInput *pin, | |||||
| //---------------------------------------------------------------------------------------- | ||||||
| //! \fn Real Gas::EstimateTimestepMesh | ||||||
| //! \brief Compute gas hydrodynamics timestep | ||||||
| //! STS_Flag | ||||||
| template <Coordinates GEOM> | ||||||
| Real EstimateTimestepMesh(MeshData<Real> *md) { | ||||||
| using parthenon::MakePackDescriptor; | ||||||
|
|
@@ -464,7 +475,23 @@ Real EstimateTimestepMesh(MeshData<Real> *md) { | |||||
| Real diff_dt = std::min(visc_dt, cond_dt); | ||||||
|
|
||||||
| const auto cfl_number = params.template Get<Real>("cfl"); | ||||||
| return cfl_number * std::min(min_dt, diff_dt); | ||||||
|
|
||||||
| // STS Time Stepping Control | ||||||
| const auto do_sts = params.template Get<bool>("do_sts"); | ||||||
| if (do_sts) { | ||||||
| const auto sts_max_dt_ratio = params.template Get<Real>("sts_max_dt_ratio"); | ||||||
| auto dt_ratio = min_dt / diff_dt; | ||||||
| // limit the timestep within the STS ratio, otherwise use the hyperbolic timestep | ||||||
| if (sts_max_dt_ratio > 0.0 && dt_ratio > sts_max_dt_ratio) { | ||||||
| min_dt = sts_max_dt_ratio * diff_dt; | ||||||
| } | ||||||
| // update the parabolic timestep | ||||||
| gas_pkg->UpdateParam("diff_dt", cfl_number * diff_dt); | ||||||
| } else { | ||||||
| min_dt = std::min(min_dt, diff_dt); | ||||||
| } | ||||||
|
|
||||||
| return cfl_number * min_dt; | ||||||
| } | ||||||
|
|
||||||
| //---------------------------------------------------------------------------------------- | ||||||
|
|
||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_outparameter inparthenon/time. So you should make sure thistm.ncycle % tm.ncycle_out == 0as well.