← Back to team overview

dolfin team mailing list archive

[Question #155482]: defining interior boundary

 

New question #155482 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/155482

I'd like to solve the advection-diffusion equation only on a part of the domain.
I've got problems to define the robin boundary conditions there, because the
boundary is an inner boundary.
I tried to define the condition with the parameter "interiour_facet_domains", but printing
the assembled values I get more values than defined on the boundary (in 
class Robin_boundary_Mem).
Please could you help me with defining the boundary conditions on the lower part
of the boundary of Subdomain Channel. I'm not sure if I'm defining the
interior domain the right way.
Thanks a lot in advance.
Melanie

 
The code is:

mesh = Rectangle(0,0,150,78,150, 78)
mesh.order()

V = FunctionSpace(mesh, "Lagrange", 1)
conc = TrialFunction(V) # solution
conc_prev = Function(V)
eta = TestFunction(V)

#Defining the subdomain

class Channel(SubDomain): 
   def inside(self,x,on_boundary):
        return True if x[1] >= 50.0 else False

subdomains = MeshFunction('uint', mesh, 2)
sub_channel = Channel()
sub_channel.mark(subdomains,0)

# Defining the equation
F_time = inner((conc-conc_prev),eta)*dx(0) 
F_Diff = (inner(grad(conc), grad(eta))*dx(0))  
F_Adv = inner(inner(velocity, grad(conc)),eta)*dx(0)      

# Defining the boundary conditions
boundary_parts = MeshFunction("uint", mesh, 1)

class RobinBoundary_Mem(SubDomain):
    def inside(self, x, on_boundary):
        return x[1] == 50.0 and x[0] > 20.0 and x[0] < 70.0  


Gamma_Mem = RobinBoundary_Mem()
Gamma_Mem.mark(boundary_parts,0)

normal = FacetNormal(mesh)
vel = Constant((0.0, -0.02))

bound_mem = (inner(conc*vel,normal)*eta)*ds(0)

###### TEST PRINT ######################
i = 0
vector_bound = assemble(bound_mem, interior_facet_domains = boundary_parts)
for i in range(len(vector_bound)):
    if vector_bound[i] != 0.0:
       print i
       print vector_bound[i]
#######################################

F = 0.1*(F_Adv + F_Diff + bound_mem) + F_time
a = lhs(F) 
L = rhs(F)

A = assemble(a, interior_facet_domains = boundary_parts)

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.