AMATLAB EXAMPLE 2 FLOW IN TWODIMENSIONAL POROUS MEDIUM

AMATLAB EXAMPLE 2 FLOW IN TWODIMENSIONAL POROUS MEDIUM






Matlab example

A.Matlab example #2


Flow in two-dimensional porous medium is governed by Laplace equation in terms of pressure as:


AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM = 0


Once the pressure is known, the velocity vector can be evaluated from


v = AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM p or vx = AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM , vy = AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM where is the permeability


AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM = 0

AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM

AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM = 0


Solve the problem1 of flow in a porous medium shown in the above figure. The flow region is a rectangle ABCD with a central circular region E of zero permeability that allows no flow through it. The boundaries AB and CD are also impervious to flow so that AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM = 0. The pressure along the two ends are p = 10 psig and p = 0 psig. Let AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM = 1.0 lbft/s throughout the region.


In the Matlab command window, enter: pdetool


The PDE Toolbox graphical user interface will then open. Choose the Options menu and then its submenus as follows:

Grid – places grid lines in the drawing space.

Snap – makes any objects drawn snap to the nearest grid line.

Grid Spacing – lets you change grid-line spacing in x and y by unchecking “auto” boxes and assigning new values.


Choose the rectangle tool and draw a square with the left bottom corner at (0.8, 1.25) and top right corner at (.8, 1.25). Choose the ellipse (or circle) tool and draw a circle with radius of 0.5. Since we want the domain to be a rectangle with a circular hole in it, edit the Set formula: field to contain:


R1 – C1


in which the negative sign “” is the set difference operator.


AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM


Next, choose PDE Specification . . . under the PDE menu. Pick Elliptic equation and enter the appropriate coefficient values. The parameters, though typically constant, may be entered as function of x and y (and even of u and its first derivatives). The current problem definition can be saved from the File menu.

AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM



Choose Boundary Mode under the Boundary menu. The solution domain will be outlined with a segmented border with arrows. Double click on any segment to set the boundary type and condition for that segment.


AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM


The boundary condition on the right end of the rectangle is p = 0 and is set as follows:



AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM


The boundary condition on the left end of the rectangle is p = 10 and is set as follows:


AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM


The boundary conditions on the top, the bottom, and all the four circle segments are the same. The color for the Dirichlet boundary segments is red, and the color for the Neumann segments is blue.


AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM



Choose Initialize Mesh from the Mesh menu. Next choose Refine Mesh to improve the first rough mesh. This option can be repeated to reduce the mesh size further.


AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM



Choose Parameters under the Plot menu to specify the output type. For this example we choose color, contour, and arrows.


AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM


Everything is now ready for generating a solution. Choose Solve PDE from the Solve menu. The results will be generated automatically and the values of the dependent variable will be color-coded in the solution domain. A color bar at the right assigns numerical solution values to each color. The isobar and velocity vector are also plotted.


AMATLAB EXAMPLE 2  FLOW IN TWODIMENSIONAL POROUS MEDIUM


To summarize, the Matlab PDE Toolbox allows you to use drawing tools to create solution domains. You can then choose the PDE to be solved, assign PDE parameters appropriate for the domain, assign boundary conditions to boundary segments, and specify initial conditions for the PDE. You can then generate triangular meshes of different refinements, compute discrete solutions at the nodes of the mesh, and display high-quality plots of the continuous approximation to the PDE solution over the domain and even over times.





1 Wilkes, James, Fluid Mechanics for Chemical Engineers, Prentice-Hall, 1999, p.566

9






Tags: medium, twodimensional, example, porous, amatlab