finite difference method for continuity equation in polar form
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
the continuty equation for incompressible and 2 d irrotational flow in polar form is written as:
Using direct method, Lu decomposition
the domain is a circle with inner radius 1 and outer radius 2 and theta with a domain [0; 2*pi].
boundary conditions are u(1; theta) = 1 and u(2; theta) = 0
discretization with uniform (theta*r) (81 * 41), Implement Jacobi,
the discretization equation is : (j index for r and i index for theta)
use a direct solver (LU factorization) to solve. The domain can be imagined as rectangle.
%%%%%LU factorization
clc
clear all
%%%%%%%%%%%%%%% Inputs
r_in=1; % Inside Radius of polar coordinates, r_in, say 1 m
r_out = 2; % Outside Radins of polar coordinates, r_out, say 2 m
j_max = 40; % no. of sections divided between r_in and r_out, choose: 40, 80, 160
dr = (r_out - r_in)/j_max; % section length, m
% total angle = 2*pi
i_max= 80; % no. of angle steps, choose: 80, 160,320
dtheta= 2*pi/i_max; % angle step, rad
r = 1:dr:2;
theta=0:dtheta:2*pi;
[r,theta]=meshgrid(r,theta);
%%%%%initialize solution array
u=zeros(i_max+1,j_max+1);%%%%81*41 matrix
u_0=zeros(i_max+1,j_max+1);%%%% old
u(:,1)=u(:,1)+1; %%%%B.C
u(:,2)=u(:,2)+0;%%%%% B.C
beta=dr^2/dtheta^2;
7 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Boundary Conditions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!