kill(all)$

maxima : convection -diffusion problem (exact : solution),version 1.0
peter.vlasschaert@gmail.com,18/10/2022

convection - diffusion problem.

p1a:'diff(u*ρ*Φ,x) = 'diff(Γ*'diff(Φ,x),x);

bc : Φ(0) = 1  ... (1)
       Φ(L) = 0 ....(2)
bc = (b)oundary (c)onditions 

ρ = density
u = velocity x-direction 
Φ = function ( see below ,Φ(x))
Γ = diffusion coef.

→ advection : part

p1:ρ*u*'diff(Φ,x);

u,ρ = constant

→ diffusion : part

p2:Γ*'diff(Φ,x,2);

Γ = constant

time independent : differential equation
----------------------------------------------------

p3a:p1-p2=0;

bc : Φ(0) = 1  ... (1)
       Φ(L) = 0 ....(2)

assume(ρ>0,u>0);

ode2 : solves ordinary second order differential equation ( = Maxima)

p3b:ode2(p3a,Φ,x);

set : Φ = Φ(x)

p3b1:subst([Φ=Φ(x)],p3b);

BC = (B)oundary (C)ondition

→  Φ(0) = 1  ... (1)

p3b2:psubst([x=0,Φ(x)=1],p3b1);

→  Φ(L) = 0  ... (1)

p3b3:psubst([x=L,Φ(x)=0],p3b1);;

rem : psubst ,p = parallel

p4:[p3b2,p3b3];

solve find :{%k1,%k2}
---------------------------

p4a:flatten(solve(p4,[%k1,%k2]));

→ Φ(x)

p4b1:factor(subst(p4a,p3b1));

→ Φ(x) @ x =0

p4b2:subst(p4a,p3b2);

subtract :Φ(x) -Φ(0)

p4b3:factor(p4b1-p4b2);

rhs : p4b3;

→ num

p4b3a:num(rhs(p4b3));

p4b3a1:part(p4b3a,1);

→ denom

p4b3b:denom(rhs(p4b3));

final : result p3a
---------------------

p5:p4b3/p4b3a1;

-------------------------------------------------------------------------