kill(all)$

maxima :taylor :heat conduction equation (cylindrical coord),version 1.0
peter.vlasschaert@gmail.com,07/09/2021

ref:cartesian coordinates
maxima : principle balance ,conservation, momentum 'version 1.0'   
peter.vlasschaert@gmail.com,19/08/2021
ref : cylindrical coordinates
new: 01/09/2021:maxima:differential volume element cylindrical coordinates for pde construct ,version 1.0   (1)
download  (Maxima,code)       :maximavolumedifferentialdatacylindcoordversion12021
download  (Maxima,png)        :mamaximavolumedifferentialdatacylindcoordversion12021outp
new: 01/09/2021:maxima: how to use table :calculation grad,div,curl  ,'cylindrical coordinates',version 1.0     (2)
download  (Maxima,code)       :howtousetablecylindricalcoordversion12021
download  (Maxima,png)         :howtousetablecylindricalcoordversion12021outp

load packages ,option.
=================

load(lrats)$ratprint:false$

tabble :cylindrical coordinates,(see:ref ,'above' =(2))
========================================

→  matrix : form

cym:matrix(
		["surface",	"direction",	"incremental","scale factor","unit vector"],
		[dz·dθ·r,	r,	dr,dr/dr,er],
		[dr·dz,	θ,	dθ·r,dθ·r/dθ,eθ],
		[dr·dθ·r,	z,	dz,dz/dz,ez]
	);

→ table:   form

cyt:table_form (cym)$

vv:dv=product(cym[i,3],i,2,4);

ww:reverse(vv);

ref :taylor approach

Heat Conduction Equation (caresian coordinates)
========================================

1e) step: taylor (x-direction :distance :Δx)
--------------------------------------------------------

ref :taylor approach
--------------------------
maxima: taylor expantion (first order)=balances(mass,energy,momentum,....),version 1.0
peter.vlasschaert@gmail.com,06/09/2021
------------------------------------------------------------------------------------------------------------------------
use:p6d
------------------------------------------------------------------------------------------------------------------------
figure 1: m(x)  → f(x)    m(x+dx) → f(x+Δx)

pa1a:netflow(x)=-(at('diff(f(x),x,1),x=x))·Δx;

pa1b:lhs(pa1a)=f(x)-f(x+Δx);

→  use (s)cale (f)actors =sf  (r,θ,z) → sf =(1,r,1)

ordergreat(Δx,sf);

pa1c:netflow(sf*x)=-'diff(f(x),sf*x,1)·'(sf*Δx);

rem : cartesian coordinates : (x,y,z)→ sf =(1,1,1)

2e)  step :table cylindrical coord
--------------------------------------------

→ r-direction :sf=1→ dr

pa2:subst([sf=cym[2,4],x=cym[2,2],f=Q,Δx=Δr],pa1c);

pa2a:subst([Δr=dr],pa2);

→ 0-direction :sf=r →  (r*dθ)

pb2:subst([sf=cym[3,4],x=cym[3,2],f=Q,Δx=Δθ],pa1c);

pb2a:subst([Δθ=dθ],pb2);

→ z-direction :sf=1 →  (dz)

pc2:subst([sf=cym[4,4],x=cym[4,2],f=Q,Δx=Δz],pa1c);

pc2a:subst([Δz=dz],pc2);

3e) step :fourier laws (r,θ,z)
-------------------------------------
k =' independent direction'

→Q(r)

pa3a:Q(r)=-k*dv/cym[2,3]*'diff(T,Δr);

pa3b:subst([vv],pa3a);

→Q(θ)

pb3a:Q(θ)=-k*dv/cym[3,3]*'diff(T,r*Δθ);

pb3b:subst([vv],pb3a);

→Q(z)

pc3a:Q(z)=-k*dv/cym[4,3]*'diff(T,Δz);

pc3b:subst([vv],pc3a);

4e)step netflow (r,θ,z)
-------------------------------

depends(T,[r,θ,z,t]);

→ netflow(r) 'r-direction'

pa4a:subst([pa3b],pa2a);

pa4b:subst([Δr=r],pa4a);

pa4c:ev(pa4b,nouns),expand;

pa4d:lratsubst([ww],pa4c);

pa4e1:ratcoeff(rhs(pa4d),k*diff(T,r));

pa4e2:pa4e1=dv/cym[2,2];

pa4f:lratsubst([pa4e2],pa4d);

→ netflow(θ) 'θ-direction' =r*dθ

pb4a:subst([pb3b],pb2a);

pb4b:lhs(pb4a)=lratsubst([Δθ=θ],rhs(pb4a));

method : final result (mathematics), ?  ' send email for solution ' pb4b →p4bc

pb4c:lhs(pb4b)=1/r^2*k*diff(diff(T,θ),θ)*dv;

→ netflow(z) 'z-direction' =dz

pc4a:subst([pc3b,Δz=z],pc2a);

pc4b:ev(pc4a,nouns);

pc4c:lratsubst([ww],pc4b);

5e) step : overall net flow 
------------------------------------

pa5a:netflow=netflow(r)+netflow(r*θ)+netflow(z);

pa5b:(subst([pa4f,pb4c,pc4c],pa5a)),expand;

6e) step : g =heat generation /dv
--------------------------------------------

pa6a:g*dv;

7e) step : lhs :heat conduction equation (cylindrical coordinates)
----------------------------------------------------------------------------------------

pa7a:netflow +pa6a;

pa7b:subst([pa5b],pa7a);

8e) step : rhs :heat conduction equation (cylindrical coordinates)
------------------------------------------------------------------------------------------
E =internal energy =mass *Cp*ΔT=mass*heat capacity*temperature difference.
ρ = density
t=    time
Cp= Heat capacity (@ :constant pressure),general : Cp=C
T = Temperature.
m=mass

pa8a:m =ρ*dv;
pa8b:'diff(E,t)=m*Cp*diff(T,t);
pa8c:subst([pa8a],pa8b);

9e)step : combination lhs=rhs
-------------------------------------------

pa9a:pa7b=lhs(pa8c);

pa9b:subst([pa8c],pa9a);

pa9c:pa9b/(dv*k),expand;

10e) step : α factor :diffusiivity
-------------------------------------------

aa:α = k/(ρ*Cp); /*thermal diffusivity */

bb:[reverse(aa)];

pa10a:lhs(pa9c)=lratsubst(bb,rhs(pa9c));

11e) step: final :heat conduction equation  3D ( cylindrical coordinates)
-------------------------------------------------------------------------------------------------

pa11a:pa10a;

steady :heat conduction equation :
===========================
independent of time

pa11b:lhs(pa10a)=0;

rem :Δr=dr ,Δθ=dθ,Δz=dz

rem : r-direction

q1:1/r*'diff((r*'diff(T,r)),r)=ev(1/r*'diff((r*'diff(T,r)),r),diff);

q2:lhs(q1)=expand(rhs(q1));

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