BoundaryUnitNormal
BoundaryUnitNormal[x,y,…]
represents an outward-pointing unit normal vector on a region.
Details and Options
- BoundaryUnitNormal can be used to construct partial differential equation boundary conditions that depend on the unit normal vector
of the boundary.
- BoundaryUnitNormal can be used with NeumannValue, DirichletCondition and NIntegrate.
- BoundaryUnitNormal can be generated by boundary conditions like AcousticAbsorbingValue, HeatFluxValue or MassOutflowValue.
- BoundaryUnitNormal can be used to specify a tangential on the boundary.
- BoundaryUnitNormal will evaluate to a vector of length of the embedding dimension of the region
when the boundary condition is discretized.
- Components of the boundary unit normal
can be accessed with Indexed.
- For finite element approximations, the PDE is multiplied with a test function
and integrated over
. Integration by parts gives
. The integrand
in the boundary integral is replaced with the NeumannValue
.
- When a PDE specifies the Neumann value as
, BoundaryUnitNormal can be used to model
instead by specifying the NeumannValue as
.
- Conversely, when a PDE specifies the Neumann value as
, BoundaryUnitNormal can be used to model
instead by specifying the NeumannValue as
.
- At internal boundaries of a region, the boundary unit normal is not uniquely defined.
- The value of the boundary unit normal
will be computed by solving
with a Dirichlet condition of
on all boundaries including internal boundaries over the entire region
. The boundary unit normal is then the gradient of
normalized with
.

Examples
open allclose allBasic Examples (1)Summary of the most common use cases

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-peipk
Solve a Poisson equation on a unit Disk:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-yks3yb


https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-fdx0b0

Compute the total flux through the boundary of the region through a second-order approximation of the boundary region:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-q3lkvi

Compute the total flux through the boundary of a subregion:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-ohbdqg

Scope (6)Survey of the scope of standard use cases
Solve a Poisson equation on a unit Disk:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-kpdvm1

Compute the total flux through the outer boundary:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-hoxrd1

Compute the total flux through the boundary of the region through a second-order approximation of the boundary region:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-glwiy2

Specify a differential equation and a region:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-72b1ry
On the left, set up a NeumannValue with a boundary unit normal and solve the equation:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-s6o7xq


https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-btsp

For this domain, the equivalent of the BoundaryUnitNormal at the left is :

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-xki8do

Show that the solutions are equal:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-3s9mbg

Create a tangential for a NeumannValue:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-vugv3d

Make use of a Indexed component of a BoundaryUnitNormal to compute a NeumannValue:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-e5szlb

Solve a Poisson equation on a geometry:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-111hh8


https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-mt42hv

Compute the total flux through the boundary:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-hysxir

Set up a NeumannValue with a boundary normal:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-4aamdq

Use a Neumann 0 boundary condition and solve the equation again:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-gsronc

Inspect how the solutions start to differ over time:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-8wla0j

For this domain, the equivalent of the BoundaryUnitNormal at the left is :

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-n2hg3t

Check that the solutions are the same:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-q5bysd

Applications (1)Sample problems that can be solved with this function
The following example considers a Stokes flow with prescribed traction boundary conditions in an annulus region. On the outer edge, at , there are no-slip boundary conditions. These set the fluid velocity in the
and
directions to 0,
. On the inner boundary, at
, a traction is prescribed. The traction with the stress vector
is given as:
Here, is the radial unit vector given as
and
is the tangent unit vector given as
.
and
are the Cartesian unit vectors in the
and
directions, respectively. For this example, the traction is set in normal direction to
and the tangential traction is set to
. In other words, at the inner boundary the velocity is not specified, only the traction
is specified.
The fluid stress tensor is given by:
Set up parameters, geometry and refined mesh:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-xpjitv
Set up a Stokes flow operator:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-6lkqmm
Set up a no-slip condition on the outer boundary:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-nhoy9y

On the inner surface, you can compute the tangent unit normal from the outward-pointing unit normal with a cross product. Use a cross product to compute the unit tangent from the unit normal vector
:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-ud1ygr

To extract the first and second components of the cross product for the and
directions, respectively, Indexed is used.
Set up the traction boundary conditions:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-15astn
Equivalently, note that the tangent unit normal can also be given as because the unit normal vector on the inner surface is
and the unit tangent then is
:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-y2xspd
Without specifying a boundary condition for the pressure, the pressure value will be floating and NDSolve will give a warning that not enough boundary conditions are specified:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-y5wzc3


Visualize the pressure solution and the velocity field:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-er5xux


To verify that the traction boundary condition works, you can compute radial and tangential components of the velocities and plot them at for all
. For the radial velocity, a solution proportional to
is expected, and for the tangential velocity, a solution proportional to
is expected.
Define a function to compute the radial and tangential components of the velocities:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-pc070f
Plot the radial component of the velocities and a function proportional to :

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-iuvcjp

Plot the tangential component of the velocities and a function proportional to :

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-c2tym6

Next, compute the normal stress and the shear at the inner boundary and check that they match the prescribed traction boundary conditions. The stress tensor is given by:
The normal and tangential components of the traction vector can be computed by
Create a function to compute the stress tensor :

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-bb6m4r
Compute the unit normal vector:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-p165nw

Define a function for the tangent vector:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-hex03l
Define a function to compute the normal stress:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-018gdp
Define a function to compute the shear stress:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-79dpns
Visualize the computed normal and shear stress at :

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-x0g8b1

Visualize the difference of the normal and shear stress at from the boundary conditions:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-hyqwm4

Properties & Relations (2)Properties of the function, and connections to other functions
Compute the boundary unit normal field:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-vttyuv

Visualize the boundary unit normal:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-tte75g

Visualize the boundary unit normal on the boundary only:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-26hsps

The boundary unit normal is computed by solving a Poisson equation over the region and specifying 0 Dirichlet conditions. Compute a Poisson equation over a unit Disk:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-tzjb00
Compute the normalized gradient of the potential:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-zz9sy1

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-9k549a

This is the same as computing the boundary unit normal of an ElementMesh:

https://wolfram.com/xid/04ifdyc4zl66lgy67183ju8n4m-mr2srl

Wolfram Research (2023), BoundaryUnitNormal, Wolfram Language function, https://reference.wolfram.com/language/FEMDocumentation/ref/BoundaryUnitNormal.html.
Text
Wolfram Research (2023), BoundaryUnitNormal, Wolfram Language function, https://reference.wolfram.com/language/FEMDocumentation/ref/BoundaryUnitNormal.html.
Wolfram Research (2023), BoundaryUnitNormal, Wolfram Language function, https://reference.wolfram.com/language/FEMDocumentation/ref/BoundaryUnitNormal.html.
CMS
Wolfram Language. 2023. "BoundaryUnitNormal." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/FEMDocumentation/ref/BoundaryUnitNormal.html.
Wolfram Language. 2023. "BoundaryUnitNormal." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/FEMDocumentation/ref/BoundaryUnitNormal.html.
APA
Wolfram Language. (2023). BoundaryUnitNormal. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/FEMDocumentation/ref/BoundaryUnitNormal.html
Wolfram Language. (2023). BoundaryUnitNormal. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/FEMDocumentation/ref/BoundaryUnitNormal.html
BibTeX
@misc{reference.wolfram_2025_boundaryunitnormal, author="Wolfram Research", title="{BoundaryUnitNormal}", year="2023", howpublished="\url{https://reference.wolfram.com/language/FEMDocumentation/ref/BoundaryUnitNormal.html}", note=[Accessed: 14-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_boundaryunitnormal, organization={Wolfram Research}, title={BoundaryUnitNormal}, year={2023}, url={https://reference.wolfram.com/language/FEMDocumentation/ref/BoundaryUnitNormal.html}, note=[Accessed: 14-March-2025
]}