Xiangyu-Hu / SPHinXsys

SPHinXsys provides C++ APIs for engineering simulation and optimization. It aims at complex systems driven by fluid, structure, multi-body dynamics and beyond. The multi-physics library is based on a unique and unified computational framework by which strong coupling has been achieved for all involved physics.
https://www.sphinxsys.org/
Apache License 2.0
259 stars 199 forks source link

revise the continuum dynamics -- solve the conflicts #486

Closed Shuaihao-Zhang closed 3 months ago

Shuaihao-Zhang commented 5 months ago

Since some new PRs are merged, there are some conflicts.

I solved the conflicts based on the latest master version. I also simplified the code (delete many unnecessary code blocks and comments) and improved the code quality.

Most of the comments from #475 are considered in this version, except the following two points:

(1) I still use three step relaxations. I try your comments from #475. Combining any of the two processes will change the order of updating the variables and the affect the results.

As you can see here, we have three different particle dynamics (the interaction in each step), and some variables are updated between each two particle dynamics. I tried and found the current sequence gives the best result compared with experimental data and other people's numerical results. image

(2) I still keep the template class for Riemann solver. Although I just need acoustic Riemann solver for the uploaded two cases, I may need different Riemann solvers in the following studies.

Xiangyu-Hu commented 5 months ago

Since some new PRs are merged, there are some conflicts.

I solved the conflicts based on the latest master version. I also simplified the code (delete many unnecessary code blocks and comments) and improved the code quality.

Most of the comments from #475 are considered in this version, except the following two points:

(1) I still use three step relaxations. I try your comments from #475. Combining any of the two processes will change the order of updating the variables and the affect the results.

As you can see here, we have three different particle dynamics (the interaction in each step), and some variables are updated between each two particle dynamics. I tried and found the current sequence gives the best result compared with experimental data and other people's numerical results. image

(2) I still keep the template class for Riemann solver. Although I just need acoustic Riemann solver for the uploaded two cases, I may need different Riemann solvers in the following studies.

I am wondering why there is no way to put the computation of velocity gradient behind density change rate. It seems quite easy by combining computing velocity gradient and density change together and update strain by two steps as the density, and then update stress for momentum equation. It is the same as other solid dynamics updating and should be equivalent to the present version.

Shuaihao-Zhang commented 5 months ago

I am wondering why there is no way to put the computation of velocity gradient behind density change rate. It seems quite easy by combining computing velocity gradient and density change together and update strain by two steps as the density, and then update stress for momentum equation. It is the same as other solid dynamics updating and should be equivalent to the present version.

Yes, you are right. I have modified the code, and now we just have two steps of relaxation process. Thanks for your comments.

Xiangyu-Hu commented 5 months ago

@Shuaihao-Zhang Thanks for the revision. Before doing detailed review, I am wondering whether there are classes or methods are not used by the tests. If there is something like that, you can either build up a test for it or simply delete it. Not tested code pieces are no use but big troubles for maintaining.

Shuaihao-Zhang commented 5 months ago

@Shuaihao-Zhang Thanks for the revision. Before doing detailed review, I am wondering whether there are classes or methods are not used by the tests. If there is something like that, you can either build up a test for it or simply delete it. Not tested code pieces are no use but big troubles for maintaining.

@Xiangyu-Hu Thanks for your suggestion. I have deleted the codes that are not used by test cases.