SimVascular / svFSIplus

This repository contains a line-by-line conversion of the Fortran svFSI solver to C++.
Other
7 stars 20 forks source link

Couple svFSI with svZeroD #70

Open menon-karthik opened 1 year ago

menon-karthik commented 1 year ago

I implemented a coupling framework between svSolver and svZeroDPlus that allows users to use svZeroDPlus for 0D boundary conditions with 3D svSolver simulations (in place of GenBC). This needs to be implemented for svFSIplus too.

PS: At the time of creating this issue, the svSolver-svZeroDPlus has not been merged yet, but it will hopefully be merged soon.

kharold23 commented 10 months ago

Currently working on coupling svFSIplus with genBC and will work on coupling svFSIplus with svZeroD after I get it working with genBC. At the moment though, I'm having trouble with writing to GenBC.int corrrectly, as genBC is unable to read past the first line and throws an error.

ktbolt commented 10 months ago

@kharold23 Why do you want to add genBC to svFSIplus? genBC is very slow and difficult to use.

menon-karthik commented 10 months ago

@ktbolt The end goal is still to use svZeroDPlus to couple boundary conditions. But svFSIPlus doesn't currently have a way to couple external boundary conditions that we can test any new implementation against. So to do that in a consistent way, the idea is to first implement GenBC and replicate the functionality and results of comparisons with fortran svFSI. Then implement the svZeroDPlus coupling after that so we already have a working version of coupled boundary conditions to test against.

ktbolt commented 10 months ago

@menon-karthik Sounds good. So the new genBC is implemented in C++, yes?

menon-karthik commented 10 months ago

For now we are using the old Fortran GenBC implementation so we can test against something we already know works. @kharold23 and @aabrown100-git have some coupled boundary condition problems that they've been simulating in the Fortran svFSI that will be used to compare against. So first step is to just replicate that in svFSIPlus.

Once we get it working properly in svFSIPlus, we can re-implement GenBC in C++ if required. But since we want to move to svZeroDPlus anyway, that might not be useful.

ktbolt commented 5 months ago

@menon-karthik what is the status of this?

kharold23 commented 2 months ago

I've gotten two test cases working with sv0DSolver coupled to svFSIplus that match the results from svFSIplus coupled to genBC (which were also validated against svFSI coupled to genBC). I'm working on getting this ready for merging, I just had a few questions/comments:

  1. The sv0D interface files are currently in a subfolder of the svFSI code folder-- is this ok? Or would you prefer them to be organized in a different way?

  2. We're planning on cloning and compiling sv0DSolver each time we compile svFSIplus in order to run these continuous integration tests. We're still figuring out where this will be located.

menon-karthik commented 2 months ago

I've gotten two test cases working with sv0DSolver coupled to svFSIplus that match the results from svFSIplus coupled to genBC (which were also validated against svFSI coupled to genBC). I'm working on getting this ready for merging, I just had a few questions/comments:

  1. The sv0D interface files are currently in a subfolder of the svFSI code folder-- is this ok? Or would you prefer them to be organized in a different way?
  2. We're planning on cloning and compiling sv0DSolver each time we compile svFSIplus in order to run these continuous integration tests. We're still figuring out where this will be located.

Just to add to this - one test is a fluid mechanics case and the other is a structural mechanics case. For the fluid mechanics case (pipe flow with RCR outlet BC), we validated the coupling between svFSIplus and the svZeroDSolver BC using the analytical solution for the RCR outlet. This will be added to the tests. For the structural mechanics case, the validation is against a reference solution from @aabrown100-git.

kharold23 commented 2 months ago

Also, should we include the genBC test cases? I know Aaron added some for his struct/ustruct cases, but wasn't sure if I should include my fluid test case.

Would we want to combine them into one case like in svFSI? (just a generic 0D coupling test case with options to do it with either genBC or sv0D, except in svFSI it was with genBC or cplBC)