If we have a problem which its boundaries or the the condition of solution is some panels or elements not grids, which must be confirmed. Is there a way to solve it numerically with FDM?
What do you mean by "elements not grids which must be confirmed."
I cannot think of any problem that is not solvable by the finite-difference method, at least in principle. It is not as efficient as finite element, boundary elements, etc., but otherwise it can do anything.
I added a note of my problem. I have to find Ud in any grid shown with "x". but two BCs are have to me mentioned 1)Ud=0 in the first and the last grid. 2) in every 2 neighboring panels(panels here are not panels in FDM) the condition I wrote must be confirmed
If I understood correctly, your problem is similar to a case where the governing equation is Laplace's equation and boundary conditions are 0 at both ends. If so, the answer is zero. Am I right about governing equation?
No the governing equation is saint venant equation. and about the boundary (which is the derivative of Ud) is not at the boundaries of the cross-section actually, they're within the shape...
the figure is a cross section of a channel ,the target is to find lateral velocity of the channel.
I think, you can split your domain into three domains (considering your schematic figure), which are panel and two domains on its sides. Apply saint venant equation everywhere, except panel, Apply a Laplacian equation for panel domain. The challenge would be finding proper boundary conditions at the border of the channel. You have to see which one of Dirichlet or Neumann boundary conditions are appropriate.
The FDM is usually much easier to implement than the FEM, as far as how many lines of code it takes to accomplish it, that is, if you intend to write the code, rather than using an existing code. The FDM may require less computational time too. The main advantage of the FEM is domain fitting. You can fit anything with triangles in 2D or tetrahedra in 3D, but you'll need some sort of grid generation tool as well. Laplace's equation is almost trivial to implement in the FDM and not overly complicated to implement in the FEM. Most textbooks that cover the FEM work through the presentation of the method using Laplace's equation for the examples. If you're solving Laplace's equation you could also use the Boundary Element Method, which makes all sorts of irregular boundaries a snap and you can calculate the results anywhere you want inside the domain. I'm not sure what the underlying problem is, but you could probably solve it using the FDM inside an Excel spreadsheet by adding a button to iterate.
From the figure of your problem I would say you could call it a finite difference problem. It is simply establishing the equations for each pair of the panels and solving the set of equations for a system of (n-2) equations, which "n" corresponds to number of "x" points. each equation comes from the assumption of the equality of average stresses between two panels.