MFlowCode / MFC

Exascale simulation of multiphase/physics fluid dynamics
https://mflowcode.github.io
MIT License
132 stars 58 forks source link

`m_riemann_solvers` refactor made simple #63

Open sbryngelson opened 1 year ago

sbryngelson commented 1 year ago

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 commented 9 months ago

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 commented 1 month ago

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.