% Re du/dt +dp/dx-(1-alpha) d2u/dx2 - dtau/dx=F, (2) % dp/dt+beta du/dx = beta R, (1) % dtau/dt+tau1De-2(tau+alpha/De)du/dx = 0 (3) % u is fluid velocity field, % p is fluid pressure, and % tau is the stress tensor. % F is the body force. % The boundary conditions are no-flux at all boundaries, % no-slip for the velocity % clear fem1 fem2 L=6.0; % Domain length beta=0.3; % inverse compressibility Re=0.1; % Reynolds number De=0.1;; % Deborah number alpha=0.9; % Non-Newtonian fraction of viscosity dt=0.05; % time step t=0; % global time variable xleft=-L/2; % current position of the left end point xright=L/2; % current position of the right end point k=0; % Initialize counter kend=5; % number of steps % working structure fem1.sdim={'x'}; fem1.form = 'coefficient'; fem1.dim = {'u','p','tau'}; fem1.shape=2; % The main loop starts while k