# difficulty specifying a system of coupled pde (wrong sub_system!)

I am trying to solve a system of two pde in 3 dimensions with 3 unknown variables.

'u' (3d vector field)

'c', 'p' (scalars)

It is very similar to Flow past a dolphin example http://

The only difference is, f in the 1st pde is a function of c. Clearly now, I can't integrate just the first equation from t=0 to t=0.5 like in the example. This is my attempt at trying to write a code to solve it. I have mentioned only the relevant lines to keep it short.

...

solver_

...

RbcLP = PDESystem([['u', 'p', 'c']], problem, solver_parameters) # c is the temperature

...

class RbcLP_u(

def form(self, u, v_u, u_, u_1, p, v_p, c, v_c, R, P, dt, **kwargs):

U = .5*(u + u_1)

# variational form of RbcLP u equation

# take care of divergencelessness of u!!

# return the weak form of eqn 1

...

class RbcLP_c(

def form(self, c, v_c, c_, c_1, U_, dt, **kwargs):

C = 0.5*(c + c_1)

# variational form of RbcLP_c

# return weak form of eqn 2

...

# define boundary conditions bc , bcc

...

RbcLP.add_

RbcLP.add_

problem.prm['T'] = 1.5

problem.solve()

what is the correct way to handle these two pde?

I am a complete newbie to fenics and cbc.pdesys. So, pardon if its a silly question. Any help is highly appreciated.

## Question information

- Language:
- English Edit question

- Status:
- Answered

- For:
- CBC.PDESys Edit question

- Assignee:
- No assignee Edit question

- Last query:

- Last reply:

Hi,

If you solve all components coupled [['u', 'p', 'c']], then there is just one PDESubSystem, or form, required for all three! So, no need for the second class RbcLP_c, just put everything in the first.

Thanks! I'm not so familiar with weak forms. Since I have two integrals which are zero, (from each pde) can I just add both of them and put in the first class RbcLP_u?

## Can you help with this problem?

Provide an answer of your own, or ask Bhavani Shankar for more information if necessary.