MFC icon indicating copy to clipboard operation
MFC copied to clipboard

`m_riemann_solvers` refactor made simple

Open sbryngelson opened this issue 3 years ago • 2 comments

Part of the reason m_riemann_solvers is so long is because, for HLLC, there are two separate calls for model_eqns == 2 and model_eqns == 2 .and. bubbles. These can be nicely condensed, with appropriate if statements if (bubbles) then, though it requires some care.

sbryngelson avatar Jan 15 '23 19:01 sbryngelson

Branch of code for model_eqns == 2 .and. bubbles: https://github.com/MFlowCode/MFC/blob/38ef7b9ee0b067a7b3d2e90f818965414e2359b7/src/simulation/m_riemann_solvers.fpp#L1421-L1856

Branch of code for model_eqns == 2: https://github.com/MFlowCode/MFC/blob/38ef7b9ee0b067a7b3d2e90f818965414e2359b7/src/simulation/m_riemann_solvers.fpp#L1858-L2164

These can be consolidated by adding an if (bubbles) then statement to the second branch, adding the bubbles-specific code, and then deleting the first branch.

sbryngelson avatar Sep 22 '23 20:09 sbryngelson

Looking at refactoring some of these nasty bits of code would be a good introduction to the "meat" of the code @AiredaleDev @okBrian. Admittedly I'm a bit biased and would love for the code to not be so nasty in some of these places. Glad to talk more about it.

sbryngelson avatar May 28 '24 13:05 sbryngelson