kill(all)$

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

ref:
maxima : principle balance ,conservation, momentum 'version 1.0'
peter.vlasschaert@gmail.com,19/08/2021

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

load(lrats)$ratprint:false$

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);

2e) step :heat conduction equation (x-direction)
-----------------------------------------------------------------
Δx=dx

pa2:subst([f=Q,Δx=dx],pa1a);

→ see :figure 

pa3:opp(xdir)=dy*dz;

pa4:dv =dx*dy*dz;

pa4b:reverse(pa4);

3e)step: fourier law  x-direction:netflow (x)
--------------------------------------------------------
k = thermal conductivity
T=t emperature

depends(T,[x,y,z,t]); /*3 dimension*/

pa5:Q(x)=-k*lhs(pa3)*diff(T,x);

pa5a:subst([pa3],pa5);

4e)step :combination3e) step & 2e) step
------------------------------------------------------
suppose : k 'independent  of the direction '
k = thermal conductivity

pa6:subst([pa5a],pa2);

pa6a:lhs(pa6)=ev(rhs(pa6),nouns);

pa6b:lhs(pa6)=args(rhs(pa6a));

pa6c:lratsubst([pa4b],pa6a);

5e) step other direction :y-direction,z-direction
--------------------------------------------------------------

p7a:pa6c;
p7b:subst([x=y],p7a);
p7c:subst([x=z],p7a);

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

p8: g*dv;

7e) step : lhs:heat conduction equation 
------------------------------------------------------

p9:netflow(x)+netflow(y)+netflow(z)+p8;

p9a:subst([p7a,p7b,p7c],p9);

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

p10a:m =ρ*dv;
p10b:'diff(E,t)=m*Cp*diff(T,t);
p10c:subst([p10a],p10b);

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

p11a:p9a=lhs(p10c);

p11b:subst([p10c],p11a);

p11c:expand(p11b/(dv*k));

10e) step : use coef :thermal diffusivity α
--------------------------------------------------------

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

bb:[reverse(aa)];

r1:g/k+at(diff(T,z,2),z=z)+at(diff(T,y,2),y=y)+at(diff(T,x,2),x=x)=rhs(p11c);

→ lhs'r1'

r2:args(lhs(r1));

r3:makelist(at(diff(T,ii,2),ii=ii)=diff(T,ii,2),ii,[x,y,z]);

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

p12:subst(r3,lhs(r1))=lratsubst(bb,rhs(r1));

steady :heat conduction equation :
===========================
independent oftime

p12a:lhs(p12)=0;

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