This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How to implement normal dependent dirichlet boundary condition

+2 votes

I'm trying to solve the linear Boussinesq-equations, where I find $\mathbf{u}$ from

$$ \mathbf{u}_t + \nabla \eta_0 - \frac{\epsilon}{3}h^2\nabla\nabla\cdot \mathbf{u}_t = 0$$
with Dirichlet BC $$\mathbf{u} \cdot \mathbf{n} = 0$$

How do I implement this BC when the boundaries are not parallel to the x- or y-axis?

I've seen in other threads people are suggesting Nitsche's method, but with restricted knowledge of the method and a different boundary term from the integration by parts ($\int_{\partial \Omega} \mathbf{v} \cdot \mathbf{n}\nabla \cdot \mathbf{u}_t ~\mathrm{ds}$), I'm not really sure how to relate it.

asked Dec 6, 2016 by andergsv FEniCS Novice (230 points)
edited Dec 13, 2016 by andergsv

1 Answer

+1 vote
 
Best answer

Nitsche worked out.

$$ \langle\mathbf{u}_t \cdot \mathbf{v} \rangle + \langle\nabla \eta_0 \cdot \mathbf{v} \rangle + \frac{\epsilon}{3}h^2(\langle \nabla\cdot \mathbf{u}_t \nabla\cdot \mathbf{v}\rangle - \int_{\partial \Omega} \mathbf{v} \cdot \mathbf{n}\nabla \cdot \mathbf{u}_t ~\mathrm{ds})= 0$$

with Dirichlet BC expressed as $\nabla \cdot \mathbf{u}_t +\kappa \mathbf{u}_t \cdot \mathbf{n} = 0$ and substitute into the expression above, so that the last term looks like

$$\int_{\partial \Omega} \mathbf{v} \cdot \mathbf{n} \kappa \mathbf{u}_t \cdot \mathbf{n}~\mathrm{ds}$$
where $\kappa$ is a large enough constant.

F1 = Constant(1/dt)*dot((u-u0),v)*dx \
    + eps/(Constant(3)*dt)*h*h*inner(div(u-u0),div(v))*dx \
    + dot(grad(eta0),v)*dx 
F1 += -Constant(kappa)*eps/Constant(3*dt)*dot(v,n)*(dot(u0,n)-dot(u,n))*ds

F2 = Constant(1/dt)*(eta-eta0)*q*dx - h*dot(u0,grad(q))*dx
answered Dec 13, 2016 by andergsv FEniCS Novice (230 points)
selected Dec 13, 2016 by andergsv
...