# Boundary conditions for solving Poisson's Equation with Experimental Data

I want to numerically (with Matlab) solve Poisson's equation : $\frac{\partial^2u}{\partial x^2} + \frac{\partial^2u}{\partial y^2} = f(x,y)$ On a rectangular domain using experimental data.

From experimental data let's say that I have a $[1:m \times 1:n]$ matrix that represents the right hand side of the equation. From experimental data I have access to $\nabla(u)$ which is also a $[1:m \times 1:n]$ matrix.

My question is : Is it mathematically/physically correct to reduce my mesh to a size of $[2:m-1 \times 2:n-1]$ and to take $\nabla(u)(1,:)$, $\nabla(u)(n,:)$, $\nabla(u)(:,1)$, $\nabla(u)(:,n)$ as my Neumann boundary conditions ? Or am I missing something ?

• Why don't you want to compare your purely numerical model with your experimental data? – Kyle Kanos Jul 22 '15 at 16:20
• I don't have a model to compare my values to. The idea here is to extract the pressure out of a velocity field obtain with a PIV method. With a well chosen right hand side f(x,y) (function of the pressure gradient), the pressure is the solution of Poisson's equation. cf : Kat and Oudheusden : "Instantaneous planar pressure determination from PIV in turbulent flow" link – Luc Rebillout Jul 22 '15 at 20:29
• You're trying to make a model to compare the values, no? So of course you don't have one now, you have to run the code first. That's really what I'm asking you, why is it that you don't do it the way I've described and instead want to do it the way you've described? – Kyle Kanos Jul 22 '15 at 20:33
• I'm sorry, maybe I didn't understood your question well enough. I haven't run the code because it's not fully implemented yet. I want to know first if the boundary conditions I want to use are correct. – Luc Rebillout Jul 22 '15 at 20:37
• Which leads us back to square one: why not run the code with typical boundary conditions for the system at hand and then compare it to the experimental data? It seems to me that you're trying to force the code to replicate the data, rather than letting it naturally evolve that way. – Kyle Kanos Jul 22 '15 at 20:39

Yes, that is something similar to what I did while implementing a finite difference (FD) code for an electrostatic problem. I'll just present what it did roughly, the computational efficiency can be increased of course.

My approach was a bit different, as to be able to simulate more complex geometries. The important matrices for the method were:

• A matrix representing the geometry, just to define the edge nodes
• A matrix that contained the actual points which needed to be calculated (everything within the edge nodes, excluding the edge nodes)
• A matrix which contained the boundary conditions, whereby you can create it as a matrix of data structures to represent all possible boundaries. The elements are just the edge nodes.

When the element that is calculated happens to be on to the boundary, it looks for the type of boundary condition on the neighboring edge. It can contain either a Dirichlet, Neumann, periodic or whatever you invent kind of boundary condition. The details of the condition can be saved in a data structure, to make it easy to impose all kinds of boundaries. Getting the data out of the structure and into your calculation should be easy at this point.

It worked, I got the right field solutions!

I eventually found out how to procede.

I found the work of Dr. De Kat, whose method was exactly the one I wanted to implement. It is explained in the pdf file here http://repository.tudelft.nl/view/ir/uuid:be00fb31-71cb-4859-ab79-67879caadc3c/ (starting page 49)

To him the best way is to have a region of the flow where Bernoulli's equation can be applied but he does use the Navier-Stokes equation which yields the pressure gradient as his neumann boundary conditions. At least one point must be exactly known in order to procede to a shift of the data after computation.