Beruflich Dokumente
Kultur Dokumente
MATLAB Answers
Vote
0
Pressure Swing Adsorption: Solve coupled partial differential equation system with ODE-Solver and Method of Lines
Asked by Robert Anhalt on 21 Feb 2017
Latest activity Commented on by Torsten on 1 Mar 2017
Accepted Answer by Torsten
32 views (last 30 days)
fluid flow equation 1.png Equation system with BC 2.png Equation System with BC 3.png
Dear all,
I want to solve the following PDE, which describes Fluid Flow in space and time:
I want to apply the "Method of Lines" and ODE-Solver in Matlab to solve the PDE, in order to extend the PDE to coupled PDE-Systems shown in the appendix ("Equation system
with BC 2" & "Equation System with BC 3"). My corresponding MATLAB-code to solve the simplest fluid flow is:
https://www.mathworks.com/matlabcentral/answers/326228-pressure-swing-adsorption-solve-coupled-partial-differential-equation-system-with-ode-sol 1/5
7/8/2017 Pressure Swing Adsorption: Solve coupled partial differential equation system with ODE-Solver and Method of Lines - MATLAB Answers - MATL
I expect to get a "sharp" plug-flow of fluid, since there is no diffusion-term in the pde. But my visualization shows a "dispersed" flow as you can see in the red marked area in the
following graphic:
https://www.mathworks.com/matlabcentral/answers/326228-pressure-swing-adsorption-solve-coupled-partial-differential-equation-system-with-ode-sol 2/5
7/8/2017 Pressure Swing Adsorption: Solve coupled partial differential equation system with ODE-Solver and Method of Lines - MATLAB Answers - MATL
I don't know how to simulate the fluid-flow correctly. Maybe the boundary conditions doesn't fit or there is another profound failure. I would appreciate to get some suggestions and
information, e.g. how to set the BC correctly.
I want to solve the coupled PDE in principle by extending the vector u(i) within the ODE-Solver like in the following function (random function without meaning):
% function ut=Fluid_Flow(u,n,v,C_BC,dx)
for i=1:n
if(i==1)
ut(i) = -1*v*(u(i)-C_BC)/dx;
ut(n+i) = -v*(u(n+i)+C_BC)/dx;
elseif (i==n)
ut(i) =0;
ut(n+i) =0;
else
ut(i) = -1*v*(u(i)-u(i-1))/dx;
ut(n+i) = -v*(u(i)-u(i-1))/(dx^2);
end
end
ut=ut';
end
%Initial Condition:
for i=1:n
u0(i) = 0;
u0(n+i) = 0;
end
I'm not sure, if the coupled PDE-system works, if the coupling is executed this way. I would appreciate, if someone could confirm it.
Thank You.
0 Comments
Log in to comment.
Tags
pressure swing adsorption partial differential equation coupled partial differential equation coupled partial differential equation system ode solver method of lines fluid flow
equation system coupling
Products
No products are associated with this question.
Related Content
1 Answer
Vote
0
Link
Answer by Torsten on 22 Feb 2017
Accepted Answer
https://www.mathworks.com/matlabcentral/answers/326228-pressure-swing-adsorption-solve-coupled-partial-differential-equation-system-with-ode-sol 3/5
7/8/2017 Pressure Swing Adsorption: Solve coupled partial differential equation system with ODE-Solver and Method of Lines - MATLAB Answers - MATL
You need a second-order discretization in space to avoid these artificial diffusion effects.
Take a look at
http://www.nag.co.uk/numeric/mb/nagdoc_mb/manual_25_1/pdf/d03/d03intro.pdf
Best wishes
Torsten.
2 Comments
Robert Anhalt on 1 Mar 2017
I've reviewed Your provided link! I could find further helpful literature, which deals with artificial diffusion respectively numerical diffusion.
Artificial diffusion is limited, when only the number of space intervalls is increased as you can see in the graphic (I set n=15000 in my code):
But the computation for this method is time-consuming. Hence I will implement a more efficient upwind scheme for space discretization. I hope this will work.
Kind regards
Robert
Torsten on 1 Mar 2017
By the way:
You don't need to distinguish between 1<i<n and i=n in your discretization:
function ut=Fluid_Flow(u,n,v,C_BC,dx)
for i=1:n
if(i==1)
ut(i)= -1*v*(u(i)-C_BC)/dx;
else
ut(i)= -1*v*(u(i)-u(i-1))/dx;
end
end
ut=ut';
end
Best wishes
Torsten.
Log in to comment.
https://www.mathworks.com/matlabcentral/answers/326228-pressure-swing-adsorption-solve-coupled-partial-differential-equation-system-with-ode-sol 4/5
7/8/2017 Pressure Swing Adsorption: Solve coupled partial differential equation system with ODE-Solver and Method of Lines - MATLAB Answers - MATL
Learn more
Apply Today
MATLAB Academy
New to MATLAB?
https://www.mathworks.com/matlabcentral/answers/326228-pressure-swing-adsorption-solve-coupled-partial-differential-equation-system-with-ode-sol 5/5