kill(all)$

load package

load(lrats)$

fluid :Material Derivative,'cylindrical' coordinates,version 1.0,corrected
peter.vlasschaert@gmail.com,11/06/2019

info : website ' unit vector'. (How to get)

youtube : https://www.youtube.com/watch?v=ruh7xXIODgI.

fluid : unit vector ,'spherical','cylindrical' coordinates,version 1.0
unit vector : 'cartesian' , {i,j,k}
unit vector : 'cylindrical',{er,eθ,ez}

Material Derivative
================

relation between : Q(x,y,z,t) and  Q(r,θ,z,t)
--------------------------------------------------------------
cartesian coordinates
===================

Q1(x,y,z,t)  =>  DQ1/Dt , 'unit vectors don't change direction when particle moves'
unit vectors : {ex,ey,ez} other books use : {i,j,k}  or {e1,e2,e3}

Q1(x,y,z,t) = u(x,y,z,t)*ex + v(x,y,z,t)*ey + w(x,y,z,t)*ez
or
Q1(x,y,z,t) = ux*ex+uv*ey+uz*ez
--------------------------------------------------------------------------------------------------------------------------
ux : velocity into x-direction.
uy : velocity into y-direction.
uz : velocity into z-direction.
t:time

derivatives unit vectors with respect to  are 'all' zero.

cylindrical coordinates
====================

Q2(r,θ,z,t)  =>  DQ2/Dt , 'unit vectors change in  direction when particle moves'
unit vectors : {er,eθ,ez}

Q2(x,y,z,t) = ur(r,θ,z,t)*er + uv(r,θ,z,t)*eθ+ w(r,y,z,t)*ez
or
Q2(x,y,z,t) = ur*er+uθ*eθ+uz*ez
--------------------------------------------------------------------------------------------------------------------------
ur : velocity into r-direction.
uθ : velocity into θ-direction.
uz : velocity into z-direction
t :time

derivatives unit vectors with respect to  are 'not all' zero.
---------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
Maxima( 'command', depend)

start :  Cartesian coordintes
========================

DQ1/Dt = diff(Q1,t) + diff(x,t)*diff(Q1,x) + diff(y,t)*diff(Q1,y) + diff(z,t)*diff(Q1,z)

depends([ux],[x,y,z]);
depends([uy],[x,y,z]);
depends([uz],[x,y,z]);

p1:['diff(x,t) = ux,'diff(y,t)=uy,'diff(z,t) = uz];

definition : grad(u)
================

p2:grad(u) = 'diff(u,x)*ex+'diff(u,y)*ey+'diff(u,z)*ez;

u => ux ,u => uy,u => uz

p2a:[ux,uy,uz];

p1a:subst([u=p2a[1]],p2);
p1b:subst([u=p2a[2]],p2);
p1c:subst([u=p2a[3]],p2);

p3:DQ1/Dt ='diff(Q1,t)+'diff(x,t)*'diff(Q1,x) +'diff(y,t)*'diff(Q1,y)+'diff(z,t)*'diff(Q1,z);

p3a:subst(p1,p3);

x => y => z

p3b1:('diff(Q1,x,1)) = diff(ux,x)+diff(uy,x) +diff(uz,x);
p3b2:subst([x=y],p3b1);
p3b3:subst([x=z],p3b1);

p3b:subst([p3b1,p3b2,p3b3],p3a);

p3c:expand(p3b);

div(V)

p4:V = p2a;

definition : div(VV)
================

p4a:div(Vv)  = diff(ux,x) +diff(uy,y) + diff(uz,z);

p4b:rhs(p4a) = lhs(p4a);

simplify :  DQ1/Dt

p5:VV = rhs(p4)[1]*ex+rhs(p4)[2]*ey+rhs(p4)[3]*ez;

use : grad(u),'p2'

p5a:subst([u=ux],p2);

use : scalar product two vectors

p5b: p5*p5a;

p5b1:expand(p5b);

rem : rule scalar product

p5b2:[ex^2 = 1,ey^2=1,ez^2=1,ex*ey=0,ey*ex=0,ex*ez = 0,ez*ex = 0,ey*ez=0,ez*ey = 0];

ux : component velocity
====================

p5b3a:lratsubst(p5b2,p5b1);

p5b3a1:ev(p5b3a,nouns);

uy : component velocity
====================

p5b3b1:subst([u=uy],p2);
p5b3b2:p5*p5b3b1;
p5b3b3:lratsubst(p5b2,expand(p5b3b2));

uz : component velocity
====================

p5b3c1:subst([u=uz],p2);
p5b3c2:p5*p5b3c1;
p5b3c3:lratsubst(p5b2,expand(p5b3c2));

use above : ux,uy,uz ,p5b3a,p5b3b3,p5b3c3
--------------------------------

p6:VV*grad(VV) = lhs(p5b3a1)+lhs(p5b3b3)+lhs(p5b3c3);

Material derivative : VV ,total acceleration.
===================

p7a:DVV/Dt = lhs(p6) + timepart;

p7b:timepart = 'diff(VV,t);

p7c:subst(p7b,p7a);

cylindrical coordinates : Material Derivatives
===================

Q2=Q2(r,θ,z,t) ?

V =V(r,θ,z,t)  ?

space part : (ur,uθ,uz)
=========

p10: V= ur*er+ uθ*eθ + uz*ez;

depends([ ur,er, uθ,eθ , uz,ez],[t]);

p10a:DV/dt =diff(rhs(p10),t);

unit vector : ez   = > 'no' change position in time : diff(ez,t) = 0
unit vector : er   = >  change position in time : diff(er,t) = ?
unit vector : eθ   = >  change position in time : diff(eθ,t) = ?

rem : er = cos(θ)*i+sin(θ)*j =cos(θ)*ex+sin(θ)*ey
           eθ =  cos(θ+π/2)*i+sin(θ+π/2)*j =cos(θ+π/2)*ex+sin(θ/2)*ey

depends ([er,eθ],[θ]);
depends([θ,r],[t]);

p11a:er= cos(θ)*ex+sin(θ)*ey;
p11b:eθ=cos(θ+π/2)*ex+sin(θ+π/2)*ey;

p11a1:rhs(p11a)  = lhs(p11a);
p11b1:rhs(p11b)  = lhs(p11b);

p11c:'diff(er,t) = diff(rhs(p11a),θ)*diff(θ,t);

find : 'diff(er,t,1)=eθ*('diff(θ,t,1))
----------------------------------------------

p11d:[p11a1,p11b1];
p12:lhs(p11c) =lratsubst(p11d,rhs(p11c));

rem : uθ = ω*r

p12a : ω =diff(θ,t);

p12a1:rhs(p12a) = lhs(p12a);

p12b: uθ = ω*r;

p12c: subst([p12a],p12b);

p12d:subst([p12a1],p12);

find : 'diff(eθ,t,1)= ?
use :

p13:'diff(eθ,t) = diff(rhs(p11b),θ)*diff(θ,t);

p13a:lhs(p13) = lratsubst(p11d,rhs(p13));

p13b:subst([p12a1],p13a);

DV/Dt  ?
=======

p14:[p12d,p13b,diff(ez,t) =0];

p14a:lratsubst(p14,p10a);

rem:  uθ = ω*r

p14b:solve(p12b,ω);

p14c:subst(p14b,p14a),expand;

p14d:lhs(p14c) =factorsum(rhs(p14c));

coef:  er,eθ,ez ?
=============

er : ?

p14e1:ratcoef(rhs(p14c),er);

eθ : ?

p14e2:ratcoef(rhs(p14c),eθ);

ez : ?

p14e3:ratcoef(rhs(p14c),ez);

p15:lhs(p14d) = p14e1*er + p14e2*eθ +p14e3*ez;

ar,aθ,az : acceleration

p15a1: ar = p14e1,expand;
p15a2: aθ =p14e2,expand;
p15a3: az =p14e3,expand;

ur  => Vr=Vr(r,θ,z)
===============

linear  approximation with differential.
--------------------------------------------------------

princepal : Vr => Vθ => Vz

Vr = Vr(r,θ,z,t)
Vr +ΔVr = Vr + d(Vr)/dr*Δr +d(Vr)/dθ*Δθ + d(Vr)/dz*Δz + d(Vr)/dt*Δt
=> 
ΔVr = d(Vr)/dr*Δr +d(Vr)/dθ*Δθ + d(Vr)/dz*Δz + d(Vr)/dt*Δt

p16:ΔVr =' diff(Vr,r)*Δr + 'diff(Vr,θ)*Δθ + 'diff(Vr,z)*Δz + 'diff(Vr,t)*Δt;

p16a:p16/Δt;

see : 'above',ω

p16b:[Δθ/Δt = ω,Δz/Δt =uz,Δr/Δt = ur ];

p16c:expand(p16a);
p16d:lratsubst(p16b,p16a);

limit  :Δ t -> dt also Vr = ur.

p17: Dur/Dt =subst([Vr=ur],rhs(p16d));

p17a:p17+ subst([diff(ur,t) = 0],rhs(p15a1));

p17b:subst(p14b,p17a);

ar ?  relation with Material Derivative.

p7b1: ar  = lhs(p17b);
p17b2:ar =  rhs(p17b);

aθ ? relation with Material Derivative 
==============================

p18:ΔVθ =' diff(Vθ,r)*Δr + 'diff(Vθ,θ)*Δθ + 'diff(Vθ,z)*Δz + 'diff(Vθ,t)*Δt;

p18a:p18/Δt;

p18b:[Δθ/Δt = ω,Δz/Δt =uz,Δr/Δt = ur ];

p18c:expand(p18a);
p18d:lratsubst(p18b,p18a);

limit  :Δ t -> dt also Vθ = uθ.

p19:Duθ/Dt =subst([Vθ=uθ],rhs(p18d));

p19a:p19+subst([diff(uθ,t) =0],rhs(p15a2));

p19b:subst(p14b,p19a);

aθ ?  relation with Material Derivative.

p19b1: aθ  = lhs(p19b);
p19b2:aθ =  rhs(p19b);

az ? relation with Material Derivative 
==============================

p20:ΔVz =' diff(Vz,r)*Δr + 'diff(Vz,θ)*Δθ + 'diff(Vz,z)*Δz + 'diff(Vz,t)*Δt;

p20a:p20/Δt;

p20b:[Δθ/Δt = ω,Δz/Δt =uz,Δr/Δt = ur ];

p20c:expand(p20a);
p20d:lratsubst(p20b,p20a);

limit  :Δ t -> dt also Vz = uz.

p20e:Duz/Dt =subst([Vz=uz],rhs(p20d));

p20d:subst(p14b,p20e);

result :az  

p20d1: az = lhs(p20d);
p20d2: az = rhs(p20d);