Test for Pollutant and Porous Flow

Test for Pollutant and Porous Flow

<p> Test for Pollutant and Porous Flow</p><p>% The is pollutant flow in a shallow porous medium. % The explicit finite difference method is used. % The unknown is the concentration. % The steady state velocity components are found from % Darcys Law, see the function [velx vely] = por2db_fun(nx,ny,L,W) clear; % % Input data and some useful variables. % L = 500; % length in x direction W = 100; % length in y direction T = 8.; % final time maxk = 1600; % number of time steps dt = T/maxk; nx = 100.; % number of steps in x direction dx = L/nx; ny = 50.; % number of steps in y direction dy = W/ny; decay = .1; % decay rate % variable wind vector from Darcys Law. [velx vely] = por2d_fun(nx,ny,L,W); % Set initial conditions. for i = 1:nx+1 x(i) =(i-1)*dx; for j = 1:ny+1 y(j) =(j-1)*dy; u(i,j,1) = 0.; end end % Set upwind boundary conditions. for k = 1:maxk+1 time(k) = (k-1)*dt; for j = 1:ny+1 u(1,j,k) = 10.0; u(nx+1,j,k) = 10.0; end for i = 1:nx+1 u(i,ny+1,k) = 10.0; end u(40:60,ny-2:ny,1) = 10.0; end % % Execute the explicit finite difference method. % Use upwind finite differences. % % ???????????????????????????????????????????????????? % % Output is given in time dependent meshc(),see above, % and final time using meshc() and contour(). % figure(4) subplot(2,1,1) mesh(x,y,u(:,:,maxk)'); xlabel('x') ylabel('y') zlabel('concentration') title(['Concentration at time = ' num2str(maxk*dt)]) subplot(2,1,2) contour(x,y,u(:,:,maxk)'); xlabel('x') ylabel('y') title(['Contours at time = ' num2str(maxk*dt)])</p><p> function [velx vely] = por2d_fun(nx,ny,L,W) % Steady state saturated 2D porous flow. % SOR is used to solve the algebraic system. % The unknown is the pressure. % % Input data % % Data for SOR maxm = 1000; eps = 0.005; ww = 1.97; % Porous medium data Hcond = 100.; % hydraulic conductivity iw = 30; % location of "wells jw = 30; iwp = 80; jwp = 20; R_well = -3200; % pump rate uleft = 100. ; % upstream concentratitons uright = 100.; for j = 1:ny+1 u(1,j) = uleft; u(nx+1,j) = uright; end for j = 1:ny+1 for i = 2:nx u(i,j) = 100.; end end dx = L/nx; rdx = 1./dx; rdx2 = Hcond/(dx*dx); dy = W/ny; rdy = 1./dy; rdy2 = Hcond/(dy*dy); % Calibrated well to be independent of mesh R_well = R_well/(dx*dy); xw = (iw)*dx; yw = (jw)*dy; for i = 1:nx+1 x(i) = dx*(i-1); end for j = 1:ny+1 y(j) = dy*(j-1); end % % Execute SOR Algorithm % % ????????????????????????????????????????????????????? % % Output to Terminal % m ww figure(1) meshc(x,y,u') xlabel('x') ylabel('y') zlabel('pressure') title('Steady State Pressure' ) figure(2) [X Y] = meshgrid(x(1:nx), y(1:ny)); velx = -Hcond*diff(u,1,1)/dx; vely = -Hcond*diff(u,1,2)/dy; subplot(2,1,1) quiver(X, Y, velx(1:nx,1:ny)', vely(1:nx,1:ny)') xlabel('x') ylabel('y') title('Velocity Vectors') axis([0 L 0 W]) subplot(2,1,2) quiver(X, Y, velx(1:nx,1:ny)', vely(1:nx,1:ny)') xlabel('x') ylabel('y') title('Velocity Vectors') axis([100 200 50 70])</p><p>S t e a d y S t a t e P r e s s u r e</p><p>1 0 0</p><p>9 0</p><p>8 0 e r u</p><p> s 7 0 s e r p 6 0</p><p>5 0</p><p>4 0 1 0 0 5 0 0 4 0 0 5 0 3 0 0 2 0 0 1 0 0 0 0 y x V e l o c i t y V e c t o r s 1 0 0</p><p> y 5 0</p><p>0 0 5 0 1 0 0 1 5 0 2 0 0 2 5 0 3 0 0 3 5 0 4 0 0 4 5 0 5 0 0 x V e l o c i t y V e c t o r s 7 0</p><p>6 5</p><p> y 6 0</p><p>5 5</p><p>5 0 1 0 0 1 1 0 1 2 0 1 3 0 1 4 0 1 5 0 1 6 0 1 7 0 1 8 0 1 9 0 2 0 0 x C o n c e n t r a t i o n a t t i m e = 2</p><p>1 0 n o i t a r t 5 n e c n o c 0 1 0 0 5 0 0 5 0 4 0 0 2 0 0 3 0 0 0 0 1 0 0 y x C o n c e n t r a t i o n a t t i m e = 4</p><p>1 0 n o i t a r t 5 n e c n o c 0 1 0 0 5 0 0 5 0 4 0 0 2 0 0 3 0 0 0 0 1 0 0 y x C o n c e n t r a t i o n a t t i m e = 8</p><p>1 0 n o i t a r t 5 n e c n o c 0 1 0 0 5 0 0 5 0 4 0 0 2 0 0 3 0 0 0 0 1 0 0 y x C o n t o u r s a t t i m e = 8 1 0 0</p><p> y 5 0</p><p>0 0 5 0 1 0 0 1 5 0 2 0 0 2 5 0 3 0 0 3 5 0 4 0 0 4 5 0 5 0 0 x</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us