code-mphi / ECOGEN

A CFD open source code dedicated to multiphase compressible flows
https://code-mphi.github.io/ECOGEN/
Other
103 stars 36 forks source link

Non physical results of cavitation problems in two-dimensional unstructured grids #37

Closed HanWang1893 closed 1 year ago

HanWang1893 commented 1 year ago

hello kevin:

When I used a two-dimensional unstructured fan grid to solve the cavitation problem, I found that the radius change of the cavitation seems to be different from the theoretical solution, and this situation does not occur in orthogonal grids.

In short, under the same operating conditions, the time required for bubble collapse will significantly increase with the increase of the computational domain, as shown in the figure. I tried to increase the mesh density, but this situation did not improve. This has greatly troubled me in doing grid independence verification. bubble R with time

If you want to test it, here is my example file. o-mesh-novis90-600 50mm.zip

You sincerely han

kevinschmidmayer commented 1 year ago

Hi Han,

I can't tell exactly what is wrong but I will share this:

Let me know if this helps.

Best, Kevin

HanWang1893 commented 1 year ago

Hi Kevin: Thank you very much for your reply.

I have noticed that you mentioned the role of the second-order method in your article, but using rectangular grids to simulate bubble problems always leads to the accumulation of errors caused by the grid shape in the final stage of bubble contraction, resulting in the non spherical shape of the bubble, resulting in inaccurate collection of velocity and pressure values at the bubble boundary, which is fatal to the theoretical model problem I want to study. This is why I need to use a fan grid to calculate this problem. Fortunately, I recently achieved the desired effect through one-dimensional computing.

Regarding the problem of axial symmetry, I am sorry that I did not express it clearly. In the radius curve graph I provided, the calculation result for the calculation domain of 30mm uses axial symmetry, while the other results do not. You can see the difference from the change in the curve. In fact, in the previous calculation, I added an axisymmetric instruction to the model file. However, after the problem I mentioned earlier occurred, I thought that unstructured meshes do not support axisymmetric computation, so I tried several examples to remove the axisymmetric option.

Regarding mesh quality, I calculated the size of the mesh so that it is small enough where bubbles appear, and the transition is uniform across different encryption regions. Therefore, I believe that there should be no problem with mesh quality. And as the computational domain increases, the computational results tend to deviate more from the theoretical solution, so I gave up using a larger computational domain for testing. If there is a problem with the grid, I think it may be that the grid density is insufficient, but a grid with a higher density (more than twice the grid density in the previous case) exceeds the computing resources I can use.

I observed and compared the computational results for the same problem on rectangular and unstructured grids with the same size of computational domain and grid density. It is found that in the pressure nephogram, it seems that the low pressure inside the bubble is more likely to cause the pressure drop in the entire flow field in unstructured grids. From a physical perspective, I think this is the reason why using unstructured grids can cause the bubble to contract significantly longer than the theoretical solution, and in longer time calculations, the bubble rebound size is only half of the theoretical solution.

image image

Overall, although I achieved the desired effect by using a one-dimensional mesh. However, I still hope to solve the problem of unstructured grids to avoid errors in subsequent calculations.

You sincerely han

kevinschmidmayer commented 1 year ago

Han,

Just to be clear, I don't say to not use unstructured mesh for this problem. It is definitely a good idea and I already used it in the past and I continue to work on it by the way. I simply want to draw attention toward the absence of second order yet and its impact.

Concerning axy-symmetry, you should always use it if you want to model a spherical bubble. If your bubble collapse faster than expected, such as for your 30mm simulation, it probably means your domain is too small. Although I don't understand what you explained in your last paragraph. And it's surprising that results are not similar for the Cartesian and unstructured grids (first order for both). Diffusion will be different and will influence the results but they should both converge with refinement to the semi-analytical solution (at least until the complete collapse).

Let me know if you happen to clarify things out and I might give it a try if I suspect a code error. As I said, this also is a subject similar to what I'm investigating on right now.

Kevin

HanWang1893 commented 1 year ago

hi kevin During this period, I have been calculating cavitation problems in various computational domains and grid types. Firstly, I compared the second-order rectangular grid with the theoretical solution GNASG, verifying the correctness of the transport equation and the second-order rectangular grid calculation.

气泡半径随时间变化对比

Then I used rectangular and unstructured grids with computational domain sizes of 35mm, 40mm, and 50mm for calculations, and uniformly used the first-order format used for unstructured grids. The density of grids with the same computational domain size is basically the same (considering the different shapes of the two grids, it is accurate to say that the side lengths are the same). Comparing the results with the theoretical solution, as shown in the figure below, I found that the calculation results using the first-order format exhibit a phenomenon where the time required for bubble collapse increases with the increase of the computational domain, and this phenomenon is more severe in the calculation results of unstructured grids. 气泡半径随时间变化对比c 气泡半径随时间变化对比o

I do not have a deep understanding of discrete format methods, so I am unable to provide good suggestions. According to my understanding, if pressure diffusion anomalies are a characteristic of first-order discrete formats, then unstructured grids may amplify this characteristic.

han

kevinschmidmayer commented 1 year ago

Hi Han,

As I said, the domain must be large enough for any wave to not travel from the bubble to the boundary and back to the bubble within the time frame of your observation. So ideally, you should not even play with the domain size in the first place. If the speed of sound is 1500 m/s and your simulation runs until 2.5e-4 s, your domain size must be 1500 * 2.5e-4 / 2 = 0.1875 m.

You may start far away from the semi-analytical solution. However, when you refine you will converge to the solution. Although slowly with a first-order method.

I don't think your problem is a misunderstanding of the interplays between the grids and methods but rather a misunderstanding of the test case your are running. If your outer boundaries are too close to the bubble, the pressure field the bubble sees will be different compared to far away boundaries. Pressures will be higher and then generate a faster collapse. This is what you observe. So all you are presenting makes perfect sense.

Hope it helps, Kevin

HanWang1893 commented 1 year ago

Hi,kevin Thank you for patiently answering my question. I understand what you are trying to say and it will be very helpful for my future calculations. It has to be said that when I learned to use CFD, I never saw in the data what the size of the computational domain is specifically related to. They only said that it is good to be large enough and the results converge, which led to my misunderstanding of the quantifier 'large enough'.

Thank you very much for answering my confusion from a physical perspective. I will try to retest using the parameters you mentioned and inform you of the results.

Han

kevinschmidmayer commented 1 year ago

Hi @HanWang1893,

If you do not have any update to share on this issue, I will close it. Please let me know.

Best, Kevin

HanWang1893 commented 1 year ago

Hi kevin,

I know it's been too long since last time,During this period, I conducted a calculation according to what you said last time. I have set up three examples, and currently two of them have results. The third one may have a too large number of grids and require a very long computational time. If you need to get the results now, I can share the first two first, or wait until I finish the third one, which may take another half month. 7948c719cdadc9d9c3da9f30e93a391

Han

kevinschmidmayer commented 1 year ago

Hi Han,

No worries. You don't have to share anything. It is up to you. Regarding your third simulation, make sure you obtain the results you expect so far in order to save unnecessary computational time if this is not the case.

Best, Kevin

HanWang1893 commented 1 year ago

hi kevin

Referring to your suggestions on the computational domain, I recalculated the bubble collapse process with enough computational domain size. Other settings are the same as my previous ones, which are still in the form of Unstructured grid. Unfortunately, too much time was spent on the calculation with the highest mesh number, which lasted for about one and a half months. Due to some accidents in the laboratory, I had to end the calculation early. In the existing calculation results, there is still a significant error between the trend of bubble radius changing with time and the theoretical solution.

Figure_1

Your Sincerely han

code-mphi commented 1 year ago

Hi Han,

Sorry for the late reply. I don't know what is going on with your simulations but I am almost certain something was not done right since we have very good results on our side without having a very refined mesh. Furthermore, the mismatch between the simulations and the semi-analytical solution, specifically for t/tc < 0.5, indicates for me that something is wrong. I have never experienced this but when I was not comparing the same initial setup. I advise you to carefully review your setup and to do 1D or 2D axi-symmetric simulations for way faster results before doing 3D. Don't forget to also use mesh stretching (even for unstructured meshes) to avoid refining places where it is not useful. These will save you a lot of computational time.

Best, Kevin

HanWang1893 commented 1 year ago

Hi Kevin,

Yes, I'm getting a very good fit with the semi-analytic solution when using either 1D or 2D structural meshes for my simulations. The situation in the previous reply also occurs only in the unstructured sector meshes, and that is exactly what makes me wonder when I only make changes to the mesh file. Maybe it's because I added axisymmetry and symmetry to the unstructured mesh? I will check and test my calculations again, thanks for the suggestion.

Your Sincerely, Han

code-mphi commented 1 year ago

OK thank you for the information. I don't really know then. Maybe there were some issues that are now solved within our private version. Are you using first-order simulations ? Second-order simulations do not work for unstructured meshes with ECOGEN V3.1. The next version will allow that but is currently delayed.