Hello all,
The following is my domain - it consists of three submeshes - top (1), middle (2) and bottom (3).
I have solved a PDE in the top submesh that gives a solution u1 on the Function Space, VSub1. I have attached the final segment of the code here to indicate the variables used. Here the top boundary of the top submesh is marked ‘1’ and the bottom boundary of the top submesh is marked ‘2’.
u1 = TrialFunction(Vsub1)
v1 = TestFunction(Vsub1)
u1 = Function(Vsub1)
dx1 = Measure("dx")[submesh_regions1]
bcs1 = []
F1 = kappa*inner(nabla_grad(u1), nabla_grad(v1))*dx + g1*v1*ds1(1) + r*sinh(C*u1)*v1*ds1(2) - f*v1*dx1
J1 = derivative(F1, u1)
problem = NonlinearVariationalProblem(F1, u1, bcs1, J1)
solver = NonlinearVariationalSolver(problem)
solver.solve()
I have obtained the solution u1 in the top submesh.
Now, I want to the use the solution obtained at the bottom boundary of this submesh as a boundary condition (in the top boundary of the middle submesh) for a PDE that I want to solve in the middle submesh. The top and middle submesh share a common boundary. I want to access the computed solution in the top submesh for another PDE solve in the middle submesh.
The following is the code segment for the middle submesh to solve for another variable, u.
Vsub = FunctionSpace(submesh, 'CG', 1)
u = TrialFunction(Vsub)
v = TestFunction(Vsub)
u = Function(Vsub)
dx = Measure("dx")[submesh_regions]
bcs = []
u_0 = Constant(0.0) #Initial Condition
u_n = project(u_0, Vsub)
F = u*v*dx - u_n*v*dx + D*dt*dot(grad(u), grad(v))*dx + dt*g*v*ds(2)
Here, the marked boundary ‘2’ of the middle submesh coincides with bottom boundary of the top submesh.
I’m struggling to do this for the middle submesh
F = u*v*dx - u_n*v*dx + D*dt*dot(grad(u), grad(v))*dx + dt*(u2 - computed at bottom boundary of the top submesh)*v*ds(2)
The solution u2 in the top submesh needs to be used a boundary condition for the top boundary of the middle submesh.
Please help me resolve this situation.
Thanks in advance for the help offered !