Environmental Engineering Reference
In-Depth Information
L=100;
h1 = 12;
hc = h0 + ((h1-h0)/L)*x;
hu = sqrt(h0*h0 + ((h1*h1-h0*h0)/L)*x);
plot (x,hc,'--g',x,hu,'-b');
legend ('confined','unconfined',2)
13.3
2D Implementation
Of course most flow fields in environmental systems are higher-dimensional. In this
chapter we are concerned with 2D flow fields, which are more complex than 1D
fields, but in general still simpler than 3D flows. The first task is to represent a 1D
flow field in 2D.
In order to start with a 2D description, one needs to know how to represent
meshes. In MATLAB
, the easiest way to obtain a mesh is the meshgrid com-
mand. It is best explained by an example:
®
[x,y] = meshgrid ([0:10:100],[10:2:20])
x =
0 10 20 30 40 50 60 70 80 90 100
0 10 20 30 40 50 60 70 80 90 100
0 10 20 30 40 50 60 70 80 90 100
0 10 20 30 40 50 60 70 80 90 100
0 10 20 30 40 50 60 70 80 90 100
0 10 20 30 40 50 60 70 80 90 100
y =
10 10 10 10 10 10 10 10 10 10 10
12 12 12 12 12 12 12 12 12 12 12
14 14 14 14 14 14 14 14 14 14 14
16 16 16 16 16 16 16 16 16 16 16
18 18 18 18 18 18 18 18 18 18 18
20 20 20 20 20 20 20 20 20 20 20
A rectangular mesh, a grid, is produced for which the x -coordinates are given by
the first vector in the brackets and the y -coordinates by the second vector in the
brackets. If the command is called with a single vector as parameter, that one is used
for both x - and y -direction. The meshgrid command produces two matrices, one
containing the x -coordinates, and one containing the y -coordinates. In the example
the matrices are denoted by x and y also. Using the commands
hc = h0 + (Qx0/(K*h0))*x;
hu = sqrt (h0*h0 + (2*Qx0/K)*x);
the piezometric heads for the confined and for the unconfined aquifers are calcu-
lated for all grid points. Both hc and hu are also matrices here which have the same
dimension as x and y . The fields are plotted as surfaces by using the command:
Search WWH ::




Custom Search