abarret / multiphase-stokes

Solver a mixture of fluids based on IBAMR
1 stars 0 forks source link

Support varying drag coefficients #72

Closed abarret closed 5 months ago

abarret commented 6 months ago

This does some major things, so I'm opening this now before it's ready to be merged so that @bindi-nagda can provide feedback. I'm open to separating this into multiple PRs.

First, this replaces object names. This drops VC (variable coefficient) and INS (incompressible navier-stokes) as they are not accurate. This also replaces TwoFluid with Multiphase.

Second, this introduces the MultiphaseParameters class which is a collection of constants. Instead of each class holding it's own constants, we pass around a MultiphaseParameters object. I think a better approach to this class would be some kind of key-value pair, but for now it's just a public container.

Third, this consolidates all the numerical routines into a separate header file. The intent is to clean the implementation files of numerical code. This should make the operator and multigrid implementation clearer. This also helps simplify the variable coefficient code.

abarret commented 6 months ago

Note that most of the line additions here are the actual numerical code, a lot of which is copied and pasted.

abarret commented 5 months ago

I've added more tests for a varying drag coefficient. I haven't checked order of convergence, but the error norms are almost exactly the same as for the original drag coefficient. There are some details in discretization differences, specifically that are being investigated in #46.

abarret commented 5 months ago

Ok I'm done adding things to this PR. I've removed the examples that are now tests and updated the remaining examples.

bindi-nagda commented 5 months ago

@abarret I started a review above and added some comments. Nothing too pressing though. I will look at the commits related to testing later.

abarret commented 5 months ago

@abarret I started a review above and added some comments. Nothing too pressing though. I will look at the commits related to testing later.

You need to submit the review for me to see the comments.

abarret commented 5 months ago

I'll go back through and add some additional comments to the numerical routines. I am hesitant to do any big code refactoring and duplicate reduction to computationally sensitive parts of the code without doing any kind of profiling. My thought process was therefore "put the stencils far away where nobody will look at them."

bindi-nagda commented 5 months ago

@abarret I agree that we should leave the numerical routines "unrolled" so the compiler can see everything. I can create an issue to port the momentum force calculations to Fortran.

I am not yet merging this since I want to test the main branch for the flags mentioned in https://github.com/abarret/multiphase-stokes/issues/46. I see all those synchronizations included in this PR already, but we want to identify which ones are needed right? I anticipate having that completed in a few days.