problem with a coupled system
I am very sorry to have to ask this but can you please have a look at my code? The BC's are completely off for this coupled system, nothing like what I would expect it to be.
from cbc.pdesys import *
mesh = UnitSquare(20, 20)
# Change desired items in the problem_parameters dict from cbc.pdesys
problem_
problem = Problem(mesh, problem_parameters)
#solver_
solver_
solver_
coupled = PDESystem([['Pw', 'Sw']], problem, solver_parameters) # Creates FunctionSpace, Functions etc.
class SS2Ph(PDESubSys
def form(self, Pw, v_Pw, Pw_, Sw, Sw_, Sw_1, v_Sw, dt, **kwargs):
FPw = inner(grad(
FSw = inner(grad(
return FPw + FSw
# setup the BCs
def left(x):
return x[0] < DOLFIN_EPS
def right(x):
return x[0] > 1.0-DOLFIN_EPS
def top(x):
return x[1] > 1.0-DOLFIN_EPS
def bottom(x):
return x[1] < DOLFIN_EPS
bcs = [DirichletBC(
# add the pde subsystem
coupled.
class InitialConditio
def __init__(self):
print "initialized initial conditions"
def eval(self, values, x):
values[0] = 10.0
values[1] = 0.5
def value_shape(self):
return (2,)
def update(self):
plot(
plot(
Problem.update = update
problem.q0 = {'PwSw': InitialConditio
problem.prm['T'] = 3.0
problem.
problem.solve()
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- CBC.PDESys Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Yaakoub El Khamra
- Solved:
- Last query:
- Last reply: