[firedrake] Enforcing slip boundary condition strongly
Lawrence Mitchell
lawrence.mitchell at imperial.ac.uk
Fri Jul 10 17:01:53 BST 2015
Hi Justin,
> On 9 Jul 2015, at 21:28, Justin Chang <jychang48 at gmail.com> wrote:
>
> Hi everyone,
>
> I am solving a mixed poisson (aka: Darcy) problem using the VMS formalism (Masud and Hughes, CMAME, 2002) which enables one to use equal order lagrangian interpolation. In this formulation, the flux/velocity is prescribed strongly and the pressure is prescribed weakly, like how it's done with RT0 elements.
>
> The main difference is that velocity is now a VectorFunctionSpace as opposed to a FunctionSpace. My question is, how would I implement the flux boundary condition in a Dirichlet sense? Say I am working with a unit square for now. I want to enforce v_x = some value(s) for x=0/x=1, and v_y - some values(s) for y = 0/y = 1. How would this be done in Firedrake?
I /believe/ the combination of the two branches in PyOP2 and Firedrake described below will do what you want.
PyOP2, branch bc-components (pull request https://github.com/OP2/PyOP2/pull/450)
Firedrake, branch bc-components (pull request https://github.com/firedrakeproject/firedrake/pull/551)
With these, you can do:
V = VectorFunctionSpace(mesh, "CG", 1)
P = VectorFunctionSpace(mesh, "CG", 1)
W = V*P
# boundary condition for x-component of velocity space.
bcvx = DirichletBC(W.sub(0).sub(0), scalar_value, boundary_ids)
# and for y-component
bcvy = DirichletBC(W.sub(0).sub(1), scalar_value, boundary_ids)
solve(..., bcs=[bcvx, bcvy])
You can either try using those branches directly or else wait until they're merged and update to a newer master. But if you try them and find problems, please do update the pull requests with comments.
Cheers,
Lawrence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.ic.ac.uk/pipermail/firedrake/attachments/20150710/82a6b42b/attachment.sig>
More information about the firedrake
mailing list