Partial Differential Equations

Solve a Poisson Equation in a Cuboid with Periodic Boundary Conditions

Solve a Poisson equation in a cuboid with periodic boundary conditions where the solution from the right-hand side of the region is projected to the left-hand side.

In[1]:=
Click for copyable input
\[CapitalOmega] = Cuboid[{0, 0, 0}, {5, 1, 1}]; ufun = NDSolveValue[{-Laplacian[u[x, y, z], {x, y, z}] == 1, DirichletCondition[u[x, y, z] == 0, 0 < x < 5], PeriodicBoundaryCondition[u[x, y, z], x == 0, TranslationTransform[{5, 0, 0}]]}, u, {x, y, z} \[Element] \[CapitalOmega]]
Out[1]=

Visualize the solution.

In[2]:=
Click for copyable input
SliceContourPlot3D[ ufun[x, y, z], {{"XStackedPlanes", {0, 1.5, 3.5, 5}}, {"YStackedPlanes", 1}, {"ZStackedPlanes", 1}}, {x, y, z} \[Element] \[CapitalOmega], ColorFunction -> "TemperatureMap", Boxed -> False, Axes -> False]
Out[2]=

Related Examples

de es fr ja ko pt-br ru zh