speed field / champ de vitesse

hey everybody! i want to create a speed field in 3D ( champ de vitesse) for the particules in the code down here.
%%%%Evolution de la concentration%%%% close all; clc; clear all; tmax = 10; pmax = 10;
dy = 1; dx = 1; dz = 1; dt = 86400;
%%%%% INITIALISATION DES CONSTANTES %%%%%
g = 9.81; dp = 1.0884*10^3; %densite des particules df = 1.025*10^3; %densite du fluide r = 5.6900*10^-6; %rayon des particules visc = df*10^-6; %viscosite de l'eau
vstokes = -(2/9)*(dp-df).*r.^2*g*visc^-1 ;
% coefficenti di turbolenza%
sigmaV = sqrt(10^-5*dt); sigmaH = sqrt(10^-5*dt);
%dstokesfinal=vstokes*dt;
%%%%%%% CREARE UN CAMPO DI VELOCITA %%%%%
u =0.2; v= -0.2;
X=ones(10,10); Y=ones(10,10);
[X,Y]=meshgrid(X,Y);
%posizioni iniziali xo = 1; yo = 1; zo = 1;
positionx(1,1:pmax) = xo; %positiony(1,1:pmax) = yo; positionz(1,1:pmax) = zo;
%figure (1) %hold on
for t = 2:tmax
% C=zeros(xmax,ymax);
%C=zeros(xmax, zmax);
for p = 1:pmax
%funzione posizione%
positionz(t,p)= positionz(t-1,p)+(vstokes*dt+randn*sigmaV)/dz;
positiony(t,p)= positiony(t-1,p)+(V*dt+randn*sigmaH)/dy;
positionx(t,p)= positionx(t-1,p)+ (U*dt +randn*sigmaH)/dx;
if positionz(t,p)>0
positionz(t,p)=0;
end
end
plot3(positionx,positiony,positionz) grid ON xlabel('x(m)') ylabel('y(m)') zlabel('z(m)') title(['Champ de vitess p = ' num2str(pmax) ' particules Méditerranée']);

Réponses (1)

sararossi
sararossi le 26 Avr 2018

0 votes

could any of you help me? please :)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!