Doing simple convection diffusion in a narrow channel: simulating the accumulation of damaged solute in a dilute solution as a result of x-ray exposure. I’m having trouble getting a Source term to work the way I think it should. I want a strip of volume elements in the middle of the channel (the x-ray illuminated volume) to act as a source of “damaged” solute. So any solution that convects into those pixels should have the concentration of damaged material increased at a constant rate. Note vel is simple Poiseuille flow, but set to zero for testing purposes.
Can anyone spot any obvious errors? Here’s what I tried: <I’m only showing some of the code here for brevity> print "volume element size: ",dx,"x",dy Lx = dx*nx Ly = dy*ny mesh = Grid2D(dx=dx, dy=dy, nx=nx, ny=ny) print "dimensions of capillary: ",Lx,Ly ... xc,yx = mesh.cellCenters ... scalarSource = CellVariable(mesh, value=0.0, rank=0) strip = ((xc>Lx/3) & (xc<2*Lx/3)) scalarSource.setValue([100.0], where=strip) eq = TransientTerm() == (DiffusionTerm(coeff=D)+VanLeerConvectionTerm(coeff=vel))+ImplicitSourceTerm(scalarSource) _______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
