A FEniCS Tutorial - FEniCS Project
A FEniCS Tutorial - FEniCS Project
A FEniCS Tutorial - FEniCS Project
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
implies a boundary integral over the complete boundary, or in <strong>FEniCS</strong> terms,<br />
an integral over all exterior facets. However, the contributions from the parts<br />
of the boundary where we have Dirichlet conditions are erased when the linear<br />
system is modified by the Dirichlet conditions. We would like, from an efficiency<br />
point of view, to integrate v*g*ds only over the parts of the boundary where we<br />
actually have Neumann conditions. And more importantly, in other problems<br />
one may have different Neumann conditions or other conditions like the Robin<br />
type condition. With the mesh function concept we can mark different parts<br />
of the boundary and integrate over specific parts. The same concept can also<br />
be used to treat multiple Dirichlet conditions. The forthcoming text illustrates<br />
how this is done.<br />
Essentially, we still stick to the model problem from Section 1.14, but replace<br />
the Neumann condition at y = 0 by a Robin condition:<br />
− ∂u<br />
∂n = p(u−q),<br />
where p and q are specified functions. The Robin condition is most often used<br />
to model heat transfer to the surroundings and arise naturally from Newton’s<br />
cooling law.<br />
Since we have prescribed a simple solution in our model problem, u = 1+<br />
x 2 +2y 2 , we adjust p and q such that the condition holds at y = 0. This implies<br />
that q = 1+x 2 +2y 2 and p can be arbitrary (the normal derivative at y = 0:<br />
∂u/∂n = −∂u/∂y = −4y = 0).<br />
Now we have four parts of the boundary: Γ N which corresponds to the upper<br />
side y = 1, Γ R which corresponds to the lower part y = 0, Γ 0 which corresponds<br />
to the left part x = 0, and Γ 1 which corresponds to the right part x = 1. The<br />
complete boundary-value problem reads<br />
−∇ 2 u = −6 in Ω, (90)<br />
u = u L on Γ 0 , (91)<br />
u = u R on Γ 1 , (92)<br />
− ∂u<br />
∂n = p(u−q) on Γ R, (93)<br />
− ∂u<br />
∂n = g on Γ N . (94)<br />
Theinvolvedprescribedfunctionsareu L = 1+2y 2 ,u R = 2+2y 2 ,q = 1+x 2 +2y 2 ,<br />
p is arbitrary, and g = −4y.<br />
Integration by parts of − ∫ Ω v∇2 udx becomes as usual<br />
∫<br />
−<br />
Ω<br />
∫<br />
v∇ 2 udx =<br />
Ω<br />
∫<br />
∇u·∇vdx−<br />
∂Ω<br />
∂u<br />
∂n vds.<br />
The boundary integral vanishes on Γ 0 ∪Γ 1 , and we split the parts over Γ N and<br />
Γ R since we have different conditions at those parts:<br />
∫<br />
− v ∂u ∫<br />
∂n ds = − v ∂u ∫<br />
Γ N<br />
∂n ds− v ∂u ∫ ∫<br />
Γ R<br />
∂n ds = vgds+ vp(u−q)ds.<br />
Γ N Γ R<br />
∂Ω<br />
78