thwaitesproject / thwaites

6 stars 0 forks source link

extruded crevasse mesh with open bcs doesn't converge with laplace pc #9

Open w3168 opened 1 month ago

w3168 commented 1 month ago

Running python 10km_flume_crevasse_3d_balp_extruded.py 23.05.24 60 600 30 along > 23.05.24_extruded_pb_original_noverticallumpchange gives this error message

/home/wscott/firedrake/src/firedrake/firedrake/_deprecation.py:65: UserWarning: The use of `File` for output is deprecated, please update your code to use `VTKFile` from `firedrake.output`.
  warn(
/home/wscott/firedrake/src/firedrake/firedrake/_deprecation.py:65: UserWarning: The use of `File` for output is deprecated, please update your code to use `VTKFile` from `firedrake.output`.
  warn(
/home/wscott/firedrake/src/firedrake/firedrake/function.py:325: FutureWarning: The .split() method is deprecated, please use the .subfunctions property instead
  warnings.warn("The .split() method is deprecated, please use the .subfunctions property instead", category=FutureWarning)
/home/wscott/firedrake/src/firedrake/firedrake/_deprecation.py:65: UserWarning: The use of `File` for output is deprecated, please update your code to use `VTKFile` from `firedrake.output`.
  warn(
/home/wscott/firedrake/src/firedrake/firedrake/functionspaceimpl.py:172: FutureWarning: The .split() method is deprecated, please use the .subfunctions property instead
  warnings.warn("The .split() method is deprecated, please use the .subfunctions property instead", category=FutureWarning)
/home/wscott/firedrake/src/firedrake/firedrake/function.py:325: FutureWarning: The .split() method is deprecated, please use the .subfunctions property instead
  warnings.warn("The .split() method is deprecated, please use the .subfunctions property instead", category=FutureWarning)
firedrake:WARNING No comm specified for VectorSpaceBasis, COMM_WORLD assumed
/home/wscott/firedrake/src/firedrake/firedrake/function.py:325: FutureWarning: The .split() method is deprecated, please use the .subfunctions property instead
  warnings.warn("The .split() method is deprecated, please use the .subfunctions property instead", category=FutureWarning)
Traceback (most recent call last):
  File "/home/wscott/thwaites/run_scripts_testing/ice_shelf_cavity/10km_flume_crevasse_3d_balp_extruded.py", line 768, in <module>
    vp_timestepper.initialize_pressure()
  File "/home/wscott/thwaites/thwaites/coupled_integrators.py", line 199, in initialize_pressure
    self.solver.solve()
  File "petsc4py/PETSc/Log.pyx", line 188, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
  File "petsc4py/PETSc/Log.pyx", line 189, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
  File "/home/wscott/firedrake/src/firedrake/firedrake/adjoint_utils/variational_solver.py", line 89, in wrapper
    out = solve(self, **kwargs)
  File "/home/wscott/firedrake/src/firedrake/firedrake/variational_solver.py", line 323, in solve
    solving_utils.check_snes_convergence(self.snes)
  File "/home/wscott/firedrake/src/firedrake/firedrake/solving_utils.py", line 124, in check_snes_convergence
    raise ConvergenceError(r"""Nonlinear solve failed to converge after %d nonlinear iterations.
firedrake.exceptions.ConvergenceError: Nonlinear solve failed to converge after 0 nonlinear iterations.
Reason:
   DIVERGED_LINEAR_SOLVE

and the log file is 23.05.24_extruded_pb_original_noverticallumpchange.txt

Here is what the mesh look like from different angles:

mesh_plan_zoomin mesh_plan_zoomout mesh_zoomin mesh_zoomout

w3168 commented 1 month ago

Talking with @stephankramer yesterday we think it might be because the laplacian weak form in vertical_lumping.py is not SPD... (i.e. see this line and following :https://github.com/thwaitesproject/thwaites/blob/4598a196a0dd5d289002679c1dc07d0f649c6f6a/thwaites/vertical_lumping.py#L100)

Maybe adding a strong dirichlet pressure bc through the laplace pc might help (currently we default to None) or doing it weakly like a penalty term (nitsche method)...