kill(all)$

maxima:fvm:heat conduction (unsteady),explicit,cank-nicolson,implicit (limit : Δt)
peter.vlasschaert@gmail.com,29/11/2022

load package
-----------------

load(lrats)$

see website:
ref 1:
new:28/11/2022:maxima : double integration one dim.heat conduction (unsteady) with source =S,version 1.0a
ref 2:
new:16/11/2022:maxima : :simple formulation of 4 basic rules , 1D  fvm (W,w,p,e,E) ,CV =[w,p,e],version1.0

θ   values :
--------------

θ  = 0   , Explicit Scheme
θ  = 1/2, Crank-Nicolson Scheme
θ  = 1   , Implicit Scheme

see : ref 1 . "final equation f(θ)"

p1a:T[p]·a[p]=-a[W]·(T[W]^°·θ-T[W]·θ-T[W]^°)-a[E]·(T[E]^°·θ-T[E]·θ-T[E]^°)+T[p]^°·(a[W]·θ+a[E]·θ+a[p]^°-a[W]-a[E])+b;

p1b:[a[W]=k(w)/Δx(w),a[E]=k(e)/Δx(e),a[p]^°=c·Δx·ρ/Δt];

p1c:a[p]=(a[W]+a[E])·θ+a[p]^°;

p1d:a[p]^°=ratcoeff(rhs(p1a),T[p]^°);

find Δt ,θ  = 0   , Explicit Scheme.
--------------------------------------------

p2a:subst([θ=0],p1a);

ref 2: {a[p],a[W],a[E]} >0  , p2b =coef T[p]^°>0

p2b:subst([θ=0],rhs(p1d))>0;

p2bx1:a[p]^°> a[W]+a[E];

p2bx2:subst(p1b,p2bx1);

p2bx3:[k(w)=k,k(e)=k,Δx(w)=Δx,Δx(e)=Δx];

assume(k≥0,Δx≥0,c≥0,ρ≥0,Δt≥0);

p2bx4:subst(p2bx3,p2bx2);

p2bx5:(lhs(p2bx4) =rhs(p2bx4))*(Δt*Δx);

p2bx6:reverse(p2bx5/(2*k));

→ limit condition : Δt

p2bx7:lhs(p2bx6) < rhs(p2bx6);

find Δt ,θ  = 1/2   , Crank-Nicolson Scheme.
---------------------------------------------------------

ref 2: {a[p],a[W],a[E]} >0  , p2b =coef T[p]^°>0

p3a:subst([θ=1/2],p1a);

p3b:subst([θ=1/2],rhs(p1d))>0;

p3c:subst(p1b,p3b);

p3d:subst(p2bx3,p3c);

p3d1:lhs(p3d) =0;

p3d2:solve(p3d1,Δt)[1];

→ limit condition : Δt

p3d2a:lhs(p3d2) < rhs(p3d2);

find Δt ,θ  = 1   , Implicit Scheme
---------------------------------------------------------
ref 2: {a[p],a[W],a[E]} >0  , p2b =coef T[p]^°>0

p4a:subst([θ=1],p1a);

p4b:subst([θ=1],rhs(p1d))>0;

→ no limit condition : Δt,all Δx & Δt

p4c:subst(p1b,p4b);

p4d:sign(lhs(p4c));

always stable , physical . 

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