RuntimeError for coupled PDEs : how to formulate the variational problem for coupled PDEs?

I’m currently trying to solve the system of coupled PDEs in the following picture :

I’ve tried to follow the approach presented in the following document page 73 : https://fenicsproject.org/pub/tutorial/pdf/fenics-tutorial-vol1.pdf

You can see in the picture how I’ve implemented my variational problem.

Nevertheless, when I run the script I get a RuntimeError message :


RuntimeError Traceback (most recent call last)
in
6
7 u=Function(V)
----> 8 solve(a == b,u,bc)
9
10 def vitesse(x,y,z):

/opt/conda/lib/python3.7/site-packages/dolfin/fem/solving.py in solve(*args, **kwargs)
218 # tolerance)
219 elif isinstance(args[0], ufl.classes.Equation):
–> 220 _solve_varproblem(*args, **kwargs)
221
222 # Default case, just call the wrapped C++ solve function

/opt/conda/lib/python3.7/site-packages/dolfin/fem/solving.py in _solve_varproblem(*args, **kwargs)
245 solver = LinearVariationalSolver(problem)
246 solver.parameters.update(solver_parameters)
–> 247 solver.solve()
248
249 # Solve nonlinear variational problem

RuntimeError:

Could someone please help me?

In order to help you, here is the part when I define the variational problem :

g_x,g_y=Constant(0.0),Constant(-Cd*(rho_air/mu)w**2)
u_x,u_y = TrialFunction(V)
v_x,v_y = TestFunction(V)
a = inner(grad(u_x), grad(v_x))dx + inner(grad(u_y), grad(v_y))dx + sin(lat)(L/D)*2(u_xv_y-u_y
v_x)dx
b = (v_x
g_x+v_y*g_y)*ds

u=Function(V)
solve(a == b,u,bc)

Please follow the guidelines Read before posting: How do I get my question answered?.
In your case, you should probably do:

u=TrialFunction(V)
u_x, u_y = split(u)

But i can only guess as you have not supplied a Minimal working example or the full error message.

Sorry, this is my first post and I realize that it was not clear enough.

Here is the MWE :

`from dolfin import *`

    mesh = BoxMesh(Point(50, 50, 0), Point(-50, -50, -1), 100, 100, 10)

    P1 = FiniteElement("Lagrange", mesh.ufl_cell(), 1)
    V = FunctionSpace(mesh, P1*P1)

    tol = 1E-14
    def boundary(x, on_boundary):
        return on_boundary and not near(x[2],l,tol)

    c = Constant((0.0,0.0))
    bc = DirichletBC(V,c,boundary)

    g_x,g_y=Constant(0.0),Constant(-112)
    u = TrialFunction(V)
    v = TestFunction(V)
    u_x,u_y = split(u)
    v_x,v_y = split(v)
    a = inner(grad(u_x), grad(v_x))*dx + inner(grad(u_y), grad(v_y))*dx + (u_x*v_y-u_y*v_x)*dx
    b = (v_x*g_x+v_y*g_y)*ds

    u=Function(V)
    solve(a == b,u,bc)

Here is the full error message :

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-4-5fedceb1d312> in <module>
      8 
      9 u=Function(V)
---> 10 solve(a == b,u,bc)
     11 
     12 def vitesse(x,y,z):

/opt/conda/lib/python3.7/site-packages/dolfin/fem/solving.py in solve(*args, **kwargs)
    218     # tolerance)
    219     elif isinstance(args[0], ufl.classes.Equation):
--> 220         _solve_varproblem(*args, **kwargs)
    221 
    222     # Default case, just call the wrapped C++ solve function

/opt/conda/lib/python3.7/site-packages/dolfin/fem/solving.py in _solve_varproblem(*args, **kwargs)
    245         solver = LinearVariationalSolver(problem)
    246         solver.parameters.update(solver_parameters)
--> 247         solver.solve()
    248 
    249     # Solve nonlinear variational problem

RuntimeError: 

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
***     fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to successfully call PETSc function 'KSPSolve'.
*** Reason:  PETSc error code is: 76 (Error in external library).
*** Where:   This error was encountered inside /home/conda/feedstock_root/build_artifacts/fenics-pkgs_1575559212425/work/dolfin/dolfin/la/PETScKrylovSolver.cpp.
*** Process: 0
*** 
*** DOLFIN version: 2019.1.0
*** Git changeset:  77c758717da1cb8017bf95109363bb1a91a4f8e5
*** -------------------------------------------------------------------------

Your suggestion with split(u) didn’t solve the problem unfortunately.

I’m using fenics 2019.1.0 on a jupyter notebook.

Thank you for your help!

It looks like you are running out if memory. Does it work on a smaller mesh?

Yeah indeed it works with a smaller mash. Thanks a lot !