Skip to content
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

Fix adjoint MUSCL species bug #1550

Merged
merged 16 commits into from
Mar 15, 2022
Merged

Fix adjoint MUSCL species bug #1550

merged 16 commits into from
Mar 15, 2022

Conversation

bigfooted
Copy link
Contributor

@bigfooted bigfooted commented Feb 18, 2022

Proposed Changes

change limiter to enum class.

Note: For some reason this fixes a problem for the species transport, where the discrete adjoint solver would stop in computelimiters.hpp with the message "unknown limiter type". This only happens when a computation is run over more than one node (more than one core is OK though). This is because in CSolver::SetSolution_Limiter, GetKind_SlopeLimit() does not return a valid value for an existing slope limiter. Kind_SlopeLimit is set in CConfig::SetKind_ConvNumScheme, called in CConfig::SetGlobalParam, but this looks OK to me.

I did just notice that in CConfig:: line 3454 we check for MUSCL_Flow, MUSCL_Turb and MUSCL_AdjFlow and MUSCL_AdjTurb, but not for MUSCL_Species or MUSCL_Adj_Species(does not even exist). It looks like there is still something missing here.

I do not know why the error "unknown limiter type" occured and why it is now fixed by only changing to enum class.

Related Work

continuing effort to change all enums to enum class

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags, or simply --warnlevel=2 when using meson).
  • My contribution is commented and consistent with SU2 style.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

…lence boundary conditions: limiting the implementation of uniform inlet bc to the actual inlets
Copy link
Contributor

@TobiKattmann TobiKattmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bigfooted for enum class-ing the limiters 💐

I also dont know how and why this fixes the problem you saw but I would also suspect that this doesnt solve the root-cause. So valgrinding a DA case with species limiters would be nice. But in CConfig.cpp::3454 I would certainly add KindSLopeLimit_Species=NONE if !MUSCL_Species. On that note: Did your case had MUSCL_SPECIES with limiters on or off?

SU2_CFD/include/solvers/CFVMFlowSolverBase.inl Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CTurbSASolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CTurbSSTSolver.cpp Outdated Show resolved Hide resolved
bigfooted and others added 7 commits February 22, 2022 09:09
Co-authored-by: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com>
Co-authored-by: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com>
Co-authored-by: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com>
@bigfooted
Copy link
Contributor Author

the valgrind message has been solved by the most recent commit

Common/src/CConfig.cpp Outdated Show resolved Hide resolved
Common/src/CConfig.cpp Outdated Show resolved Hide resolved
SU2_CFD/include/solvers/CFVMFlowSolverBase.inl Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
bigfooted and others added 2 commits March 10, 2022 20:50
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
@bigfooted
Copy link
Contributor Author

@pcarruscag When running SU2_CFD_AD, the solver is DISC_ADJ_INC_RANS, and a number of initializations are skipped when we do not include this check. Most notably setting kind_limiter, which then leads to the 'conditional depends on uninitialized value' message from valgrind.

@bigfooted bigfooted merged commit a288828 into develop Mar 15, 2022
@bigfooted bigfooted deleted the feature_enum_limiter branch March 15, 2022 07:05
@pcarruscag pcarruscag changed the title changed limiter to enum class to fix adjoint species bug Fix adjoint MUSCL species bug Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants