On Tue, Feb 14, 2023 at 9:25 AM Miguel Angel Salazar de Troya < miguel.sala...@corintis.com> wrote:
> Hello, > > I am solving the Navier-Stokes equation and an advection-diffusion > equation to model the temperature. They are fully coupled because the > viscosity is temperature dependent. I plan to solve the fully-coupled > problem with a segregated approach: I first solve the Navier-Stokes > equation for a fixed temperature and feed the velocity to the thermal > equation, then use that temperature back in the Navier-Stokes equation to > solve for the velocity again until I reach convergence. If I assemble the > residual and jacobian for the fully coupled system with the proper fields > section for the fieldsplit preconditioner (I am using Firedrake), is there > a way to tell PETSc to solve the problem with a segregated approach? > For a linear problem, this is easy using PCFIELDSPLIT. Thus you could use this to solve the Newton system for your problem. Doing this for a nonlinear problem is still harder because the top-level PETSc interface does not have a way to assemble subsets of the nonlinear problem. If you use a DMPlex to express the problem _and_ its callbacks to express the physics, then we can split the nonlinear problem into pieces. I am working with the Firedrake folks to develop a general interface for this. Hopefully we finish this year. Right now, I think the easiest way to do the nonlinear thing is to write separate UFL for the two problems and control the loop yourself, or to just use the linear variation. Thanks, Matt > Thanks, > Miguel > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>