Diusion/Heat Equation Derive a Cellular Algorithm Running on InterCellInterCell/Escapade TutorialN. FressengeasLaboratoire Materiaux Optiques, Photonique et SystemesUnite de Recherche commune a l’Universite Paul Verlaine Metz et a SupelecDowload this document fromhttp://intercell.metz.supelec.frN. Fressengeas LMOPSInterCell/EscapadeDiusion/Heat Equation Derive a Cellular Algorithm Running on InterCellTable of contentsFick Di usion or Heat Transfer laws as an exampleFick/Heat lawsBoundary ConditionsDerive a Cellular AlgorithmInstall the necessary softwareDiscretize your problemLocate your equations on the MeshRunning on InterCellA look at the lesRun the programSee the resultsN. Fressengeas LMOPSInterCell/EscapadeDiusion/Heat Equation Derive a Cellular Algorithm Running on InterCellFick/Heat lawsSteady state Fick/Heat di usion lawsA fairly simple partial di erential problem for didactic purposeFick laws Di usion lawsI IJ = Cgrad () q = kgrad (T )@ @TI I+div (J) = 0 C +div (q) = 0@t @t@ @TI I= C4 C = k4T@t @tSteady state lawSteady state law4 = 0 4T = 0N. Fressengeas LMOPSInterCell/EscapadeDiusion/Heat Equation Derive a Cellular Algorithm Running on InterCellBoundary ConditionsSome boundary conditionsComplexity often lies in the boundary conditionsTJPure diusionqJqBoundary conditionsI Constant ow pipes : J = J = Cgrad ()0@ @I grad (J)kBoxborders : = 0 or = 0@x @yI Dirichlet : constantN. ...
escabooz.sage IA piece of software written inSAGE IInstall usingmake install ISAGEsyntax to formally describe your differential problem IWrites aset of files(*.booz&*.cell) to describe the cellular algorithm
Install the necessary software
InterCellsoftware to derive the Cellular Algorithm Downloadescabooz.sgaefromInterCellweb site
llE/reeCdaecspageasssenInt
Running the script IStartSAGE ILoad the script IWrite the files
Differential problem specification A shortSAGE/Pythonscript
LMOPS
Install the necessary software
acaped
TheSAGEscript file IDefine a discrete differential problem IDefine discrete boundary conditions Iset up constants and observers IFeed all this to oneEscapadeobject IThis object can write the files for you
Declare the unknownsyou are seeking # Declare the unknown as an unknown function rho=function("rho")
Declare the constants you will be using # Declare the constants you will use formally # It is usually a good idea to have dx and dy declared # We take here dx=dy=dr var("J0 C dr")
de
Discretize your problem
capa
.NserFgnessaeteInelrCEsl/ed
Finite Differences will be used Let us define some expressions that will be needed several times Center second order derivatives SecondDerivativeX =(rho(-1,0)+rho(+1,0)-2*rho(0,0))/dr^2 SecondDerivativeY =(rho(0,-1)+rho(0,+1)-2*rho(0,0))/dr^2
acap
LMOPS
Discretize your problem
Off-centered first order derivatives UpDerivative=(rho(0,0)-rho(0,-1))/dr DownDerivative=(rho(0,+1)-rho(0,0))/dr LeftDerivative=(rho(+1,0)-rho(0,0))/dr RightDerivative=(rho(0,0)-rho(-1,0))/dr
Discretization is at your convenience IYou can use 5 (or more) points to improve derivative accuracy IYou can attempt stabilization using Lax method I !Call in all your discretization skills
Discretize your problem
Discretize your problem
LMOPS
And with several coupled equations ?
apedsEacle/l
General discretized equation4ρ= 0 equlaplacian=[SecondDerivativeX+SecondDerivativeY]
equlaplacianis alist IAdd equations as list elements ILeast Squares will treat them equally
Good normalization practice ISame order of magnitude required for each IIf not : only the highest will be solved. . . mess foreseen