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

Issue for the case test_2d_square_droplet in the current master version #288

Closed Shuaihao-Zhang closed 1 month ago

Shuaihao-Zhang commented 12 months ago

In the current master version, the calculation result for the test_2d_square_droplet case is incorrect. image

I checked the pull request history to find the potential reason. image

It was found that the result is still ok after #269 is merged. The source code of #271 can not be founded, but it just changed a few lines of code. After #274 is merged. The result become unreasonable.

I haven't found the exact cause of this issue yet. I will try to figure it out. And add a regression test for this case immediately after it is fixed.

Xiangyu-Hu commented 12 months ago

Probably due to the change of free surface density re initialization, return SMAX(rho_sum, rho_0);

Xiangyu-Hu commented 12 months ago

However, may be it is not directly due to this change.

Shuaihao-Zhang commented 12 months ago

Thanks. I will check that first.

Shuaihao-Zhang commented 12 months ago

Probably due to the change of free surface density re initialization, return SMAX(rho_sum, rho_0);

Yes, this is the reason for the issue. Should I change this function ReinitializedDensity back to the previous version? I can submit a pull request together with a regression test for this case.

Xiangyu-Hu commented 12 months ago

No. That will lead to another issue of lifting of free surface in free surface flows. #274 We may only change it for two phase flow problems.

Xiangyu-Hu commented 12 months ago

I have created a branch for Issue "288-issue-for-the-case-test_2d_square_droplet in the current master version", so that we can work on it to solve the problem.

Xiangyu-Hu commented 12 months ago

2021-water-13-02684.pdf we may use the idea of this paper to obtained multiphase density.

Shuaihao-Zhang commented 12 months ago

Sure, I will check this paper. So that means we give up the previous solution?

Xiangyu-Hu commented 12 months ago

The previous formulation is OK, but seems not generalized enough (probably only works for water-air case).

Shuaihao-Zhang commented 12 months ago

I see. Thanks!

Xiangyu-Hu commented 1 month ago

the new version has no such issue.