Nonlinear multi-physics example with fully-coupled Newton solve
Dear Firedrake Developers, Is there a firedrake example for nonlinear multi-physics (multiple, two or more, coupled PDEs), which are solved with Newton's method in a fully-coupled way? Henrik -- Dipl.-Math. Henrik Büsing Institute for Applied Geophysics and Geothermal Energy E.ON Energy Research Center RWTH Aachen University ------------------------------------------------------ Mathieustr. 10 | Tel +49 (0)241 80 49907 52074 Aachen, Germany | Fax +49 (0)241 80 49889 ------------------------------------------------------ http://www.eonerc.rwth-aachen.de/GGE hbuesing@eonerc.rwth-aachen.de ------------------------------------------------------
Dear Henrik,
On 21 Sep 2015, at 16:28, Buesing, Henrik <HBuesing@eonerc.rwth-aachen.de> wrote:
Dear Firedrake Developers,
Is there a firedrake example for nonlinear multi-physics (multiple, two or more, coupled PDEs), which are solved with Newton’s method in a fully-coupled way?
I don't think we have an example of this per se. Which aspects are you interested in following: how to formulate the problem in Firedrake, or how to driver the solvers? Cheers, Lawrence
Is there a firedrake example for nonlinear multi-physics (multiple,
two or more, coupled PDEs), which are solved with Newton's method in a
fully-coupled way?
I don't think we have an example of this per se. Which aspects are you
interested in following: how to formulate the problem in Firedrake, or
how to driver the solvers?
Cheers,
Lawrence
Dear Lawrence, I guess, the answer is both. I tried to setup an example for two-phase flow in porous media (see twophase.py). I have attached the system I want to setup (see System.pdf). The primary variables are pw and Sn. pw ... water pressure Sn ... gas saturation phi ... porosity rho_\alpha ... density of phase alpha kr\alpha ... relative mobility of phase alpha, e.g. Brooks-Corey or just linear as in twophase.py mu\alpha ... viscosity of phase alpha pc = 0 ... no capillary pressure \vec{g}=(0,0,-g)=(0,0,0) ... no gravity K ... permeability My boundary conditions are Dirichlet for the right boundary and gas inflow at the bottom middle. 1) Regarding formulation of the problem: a) I would like to upwind krw, and krn, i.e. always take the upstream value. In the case of no capillarity and no gravity, I only look at pressure gradients, e.g. take krw_ij = krw_j if pw_j -pw_i >=0 = krw_i if pw_j -pw_i < 0 I had a look at the steady-state advection example, but I didn't manage to transfer it to my problem. b) I would like to include gravity. I tried g = interpolate(Expression("(0.0,0.0,-grav)"),DG2), but got a "Can't add expressions with different shapes, when doing dot(grad(pw)-rhow*g,grad(v)). 2) Regarding solvers: a) The linear solver always converges within 1 iteration to a residual of 0.0 (bcgs+hypre/boomeramg). That's quite weird. If I use a direct method (preonly+lu) I get NaNs. So, I guess, there is still something wrong. b) When the linear solver takes no step, than the nonlinear solver is happy with that and just converges. This leads to the point, where nothing happens at all. 3) Regarding output a) Can I deactivate the pyop2 INFO output? Thank you for your help! Henrik
Dear Henrik, I will try and address the bigger comments later (I am in a course today), but a brief note on question (3) is below.
On 22 Sep 2015, at 09:02, Buesing, Henrik <HBuesing@eonerc.rwth-aachen.de> wrote:
Dear Lawrence,
I guess, the answer is both. I tried to setup an example for two-phase flow in porous media (see twophase.py). I have attached the system I want to setup (see System.pdf). The primary variables are pw and Sn.
pw ... water pressure Sn ... gas saturation phi ... porosity rho_\alpha ... density of phase alpha kr\alpha ... relative mobility of phase alpha, e.g. Brooks-Corey or just linear as in twophase.py mu\alpha ... viscosity of phase alpha pc = 0 ... no capillary pressure \vec{g}=(0,0,-g)=(0,0,0) ... no gravity K ... permeability
My boundary conditions are Dirichlet for the right boundary and gas inflow at the bottom middle.
1) Regarding formulation of the problem:
a) I would like to upwind krw, and krn, i.e. always take the upstream value. In the case of no capillarity and no gravity, I only look at pressure gradients, e.g. take krw_ij = krw_j if pw_j -pw_i >=0 = krw_i if pw_j -pw_i < 0 I had a look at the steady-state advection example, but I didn't manage to transfer it to my problem.
b) I would like to include gravity. I tried g = interpolate(Expression("(0.0,0.0,-grav)"),DG2), but got a "Can't add expressions with different shapes, when doingdot(grad(pw)-rhow*g,grad(v)).
2) Regarding solvers:
a) The linear solver always converges within 1 iteration to a residual of 0.0 (bcgs+hypre/boomeramg). That's quite weird. If I use a direct method (preonly+lu) I get NaNs. So, I guess, there is still something wrong. b) When the linear solver takes no step, than the nonlinear solver is happy with that and just converges. This leads to the point, where nothing happens at all.
3) Regarding output a) Can I deactivate the pyop2 INFO output?
Set: parameters["pyop2_options"]["log_level"] = "WARNING" Cheers, Lawrence
Dear Lawrence, Just as an explanation: I'm trying to mimic a simple finite volume scheme (two-point flux approximation) So in my nonlinear form I want to integrate the fluxes v_\alpha = -kr\alpha/\mu\alpha*K*(\nabla p\alpha - \rho\alpha*g) over the faces of my elements (which is not yet in my code) Henrik
-----Ursprüngliche Nachricht-----
Von: firedrake-bounces@imperial.ac.uk [mailto:firedrake-
bounces@imperial.ac.uk] Im Auftrag von Lawrence Mitchell
Gesendet: 22 September 2015 11:58
An: firedrake@imperial.ac.uk
Betreff: Re: [firedrake] Nonlinear multi-physics example with fully-
coupled Newton solve
Dear Henrik,
I will try and address the bigger comments later (I am in a course
today), but a brief note on question (3) is below.
On 22 Sep 2015, at 09:02, Buesing, Henrik <HBuesing@eonerc.rwth-<mailto:HBuesing@eonerc.rwth-aachen.de>
aachen.de<mailto:HBuesing@eonerc.rwth-aachen.de>> wrote:
Dear Lawrence,
I guess, the answer is both. I tried to setup an example for two-phase
flow in porous media (see twophase.py). I have attached the system I
want to setup (see System.pdf). The primary variables are pw and Sn.
pw ... water pressure
Sn ... gas saturation
phi ... porosity
rho_\alpha ... density of phase alpha
kr\alpha ... relative mobility of phase alpha, e.g. Brooks-Corey or
just linear as in twophase.py mu\alpha ... viscosity of phase alpha pc
= 0 ... no capillary pressure
\vec{g}=(0,0,-g)=(0,0,0) ... no gravity K ... permeability
My boundary conditions are Dirichlet for the right boundary and gas
inflow at the bottom middle.
1) Regarding formulation of the problem:
a) I would like to upwind krw, and krn, i.e. always take the upstream
value. In the case of no capillarity and no gravity, I only look at
pressure gradients, e.g.
take krw_ij = krw_j if pw_j -pw_i >=0
= krw_i if pw_j -pw_i < 0
I had a look at the steady-state advection example, but I didn't
manage to transfer it to my problem.
b) I would like to include gravity. I tried g =
interpolate(Expression("(0.0,0.0,-grav)"),DG2), but got a "Can't add
expressions with different shapes, when doingdot(grad(pw)-
rhow*g,grad(v)).
2) Regarding solvers:
a) The linear solver always converges within 1 iteration to a
residual of 0.0 (bcgs+hypre/boomeramg). That's quite weird. If I use a
direct method (preonly+lu) I get NaNs. So, I guess, there is still
something wrong.
b) When the linear solver takes no step, than the nonlinear solver is
happy with that and just converges. This leads to the point, where
nothing happens at all.
3) Regarding output
a) Can I deactivate the pyop2 INFO output?
Set:
parameters["pyop2_options"]["log_level"] = "WARNING"
Cheers,
Lawrence
participants (2)
- 
                
                Buesing, Henrik
- 
                
                Lawrence Mitchell