matlab codes - ķITH ARAMBULA%CVEN 673%Transport in Porous...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
%EDITH ARAMBULA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %CVEN 673 %Transport in Porous Media %Extra credit -- Profiles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %DEFINITION OF VARIABLES AND VALUES %Specific discharge in cm/d q=1.5; %Porosity n=0.3; %Velocity in cm/d v=q/n; %Length of the column in cm L=50; %Initialize the non-dimensional distance matrix dx=0.5/50; x=[0:dx:1]; N=size(x,2); %Peclet number Pe=30; %Initialize the non-dimensional time step and limits dt=0.05*v/L; tinitial=0*v/L; tfinal=6*v/L; %Initialize concentration vectors Cold(1:N,1)=0; Cold(1)=1; Cnew(1:N,1)=0; %Initialize constants matrix const(1:N,1:N)=0; const(1,1)=1; const(N,N)=1; %Initialize the P vector P(1:N,1)=0; P(1)=1; %COMPUTE CONSTANTS a=-(dt/(2*dx^2*Pe))-(dt/(4*dx)); B=1+dt/(dx^2*Pe); Bmod=1-dt/(dx^2*Pe); e=-(dt/(2*dx^2*Pe))+(dt/(4*dx)); %CONSTRUCT CONSTANTS MATRIX for i=2:N-1 const(i,i-1)=a; const(i,i)=B; const(i,i+1)=e; end %COMPUTE THE CONCENTRATION AT EACH TIME STEP tstart=tinitial+dt; %Time loop for timestep=tstart:dt:tfinal for j=2:N-1 jprevious=j-1;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/12/2011 for the course CGN 6933 taught by Professor Staff during the Spring '08 term at University of South Florida.

Page1 / 4

matlab codes - ķITH ARAMBULA%CVEN 673%Transport in Porous...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online