MATLAB: How to apply Dirichlet boundary condition to a part of a face

boundaryconditiondirichletfacepartialPartial Differential Equation Toolboxpde

How to apply Dirichlet boundary condition to a part of a face?
What should be the vector input to apply the boundary conditions on a part of the face?

Best Answer

Please find the example script, "partialDirichletBCExample.m" attached with this email that demonstrates how to apply Dirichlet boundary condition only on a portion of a face.. In the attached example, we are solving two problems with two PDE models as follows:
1. Simulate the requirement of applying Dirichlet boundary condition to a part of a face. In the PDE model, "model1", we apply y-displacement on half of the face numbered 6, using functional form of the boundary condition specification.
2. Verify the simulated model. In the PDE model, "model2", we create the geometry such that there are two faces in place of face 6 in "model1". Here, we apply mixed boundary conditions on face 11, which is equivalent to applying Dirichlet boundary condition on half of the face numbered 6 on "model1".
As you can observe from the results plots, both these models give the same results except near the half way partition. Here "model1" has an imperfect face, unlike "model2", where the geometry has been created such that there are two faces in place of face 6 of "model1". Similarly, you can use this approach to apply Dirichlet boundary condition only on a portion of a face to your PDE model.