Open gaboperezayala opened 2 years ago
I am confused. In the figure, why "there is no gradient of pressure in y"?
Dr. Lulu thanks for your answer the problem was in the definition of the boundary conditions, now it is working as it's supposed, please refer to issue #584
Hello Dr. Lu, I'm trying to implement a 2D pressure equation to solve single-phase flow in homogeneous porous media in DeepXDE, but I have some doubts about the Neumann boundary conditions definition.
The equation to solve is
p_xx + p_yy = 0 in Ω = [0,1] x [0,1]
with the Dirichlet boundary conditions:
p = 10 on Ω = (x,Ly), x ε [0,1] p = 5 on Ω = (x,0), x ε [0,1]
and, with the Neumann boundary conditions:
u = 0 on ∂Ω = (0,y), y ε [0,1] u = 0 on ∂Ω = (Lx,y), y ε [0,1]
As Neumann boundary conditions are defined as: dy/dn(x) = func(x). In my study the first-order derivative dp/dx (p_x) is set as 0, as well as, dp/dy (p_y) is set as 0. However, dp/dy (p_y) cannot be 0, it has to be different than 0 (otherwise results has nonsense because it means that there is no pressure gradient in y) AND I HAVEN'T FOUND HOW TO IMPLEMENT THIS ON DeepXDE I'd really appreciate the help you can provide.
Implementation
This description goes through the implementation of a solver for the above described Pressure equation step-by-step.
First, import modules required.
Define a computational geometry using a rectangle geometry.
Next, express the PDE residual of the equation.
Next, boundary conditions are considered
Next, define the PDE problem as:
Next, choose the network, here it is used a fully connected neural network of 1 hidden layer with 30 nodes and 30.000 iterations, using "tanh" as activation function and Xavier Initialization.
Now, build a Model and choose the optimizer ("adam") and learning rate (0.001), then train the model using 30.000 iterations:
Plot results
As you can see in the previous figure; if there is no gradient of pressure in y, then the results have nonsense. If Neuman bc are not implemented, then the result has sense as in the next figure. Nevertheless, the problem is that Neumann BC has to be implemented.