214 Computational Modelling in Hydraulic and Coastal Engineering
method (Figure  8.5) and those from the solution of the advection–
diffusion equation (Figure 8.2) are evident. The ‘entrapment’ of particles, shown in the far right side of Figure 8.5, is caused by the boundary
conditions. Those particles are related to the long ‘tail’ of contaminant
shown along the horizontal part of the breakwater in Figure 8.2.
Computer code 8.3
% Example 8.3 Advective Diffusion by Random Particle Motion
- Marina Breakwater
% dif = Diffusion coefficient;
% dec = Decay coefficient;
% ipp = Number of simulated particles;
% xo, yo = Initial position of particles [m];
% Dd = Spatial computational step [m];
% Dt = Time computational step [s];
% nx = Number of computational steps in the x-direction;
% ny = Number of computational steps in the y-direction;
% nt = Number of computational steps in time;
clc; clear all; close all;
% Input data
dif=0.2;
dec=0.00001;
ipp=5000;
xo=90;
yo=125;
Dd=5;
Dt=5;
nx=70;
ny=40;
nt=720;
% Importing data for depths, velocities and diffusion
coefficients;
load Depths.txt
load CoastU.txt
load CoastV.txt
fDep=Depths;
fCoU=CoastU;
fCoV=CoastV;
% Subroutine for depths h=fm(i,j,fDep);
% Subroutine for velocity u=fm(i,j,fCoU);
% Subroutine for velocity v=fm(i,j,fCoV);
for i=1:nx
for
j=1:ny
cmax(i,j)=0;
end
end
imm=(nx-1)*Dd;
Précédent

- 227/302

Suivant