AMReX-Fluids / IAMR

A parallel, adaptive mesh refinement (AMR) code that solves the variable-density incompressible Navier-Stokes equations.
https://amrex-fluids.github.io/IAMR/
80 stars 57 forks source link

Error happens when setting ns. init_iter = 0 in the 2D lid_driven case. #21

Closed ruohai0925 closed 6 years ago

ruohai0925 commented 6 years ago

Hello all,

Like the title, if the initialization process for setting pressure is ignored in lid_driven case, error happens: "0::Assertion `old_data != 0' failed, file "../../../amrex/Src/Amr/AMReX_StateData.H", line 234 !!! 0::SIGABRT !!!" It seems that a state data is not filled. Maybe better to specify init_iter should be larger than 0.

Some further questions: is the multilevel initialization process really necessary and important? What if one just set old and new pressure as 0 and let the codes run. Maybe the initialization process will reduce the convergence time for level and composite solvers, but I am not sure.

Jordan

drummerdoc commented 6 years ago

Seems like an easy-to-fix bug. If you think think initial iterations don't do anything important (and the bug is fixed), you can easily confirm :) Generally, you could generate an impulsive start to the flow if the pressure gradient suddenly shows up during the first step. It is not often the case that this is what you would want, as the initial flow would not satisfy any reasonable initial condition that satisfies the equations for incompressible flow. Certainly, it would have bad convergence properties. That said, you may want this anyway...thus, the switch, which we ought to fix.

drummerdoc commented 6 years ago

I can reproduce, BTW. Looking into it...

drummerdoc commented 6 years ago

I pushed a simple fix to the development branch for this. Please re-open if the fix breaks anything else. Thanks for reporting!

ruohai0925 commented 6 years ago

Got it! I prefer to use the initialization while writing the codes.

Thanks for your explanation.