On Thu, Mar 24, 2016 at 6:36 PM, Djoeke Schoonenberg <[email protected]> wrote: > > I have a couple of questions/issues: > > 1) The analytical solution for S_vap (for a constant mass flux) is a 1/r > profile —> its gradient is equal to - S_vap / r. However, setting this as a > boundary condition at r1 (which updates itself each time step, because the > variable is involved) like > >>> S_vap.faceGrad.constrain((-1*S_vap.faceValue) * mesh.faceNormals, >>> where=mesh.facesLeft)
I'm confused about what the boundary conditions are, can you write them out a little more clearly? > 2) If I take the diffusion constant to be larger than 0.011, once the system > has reached a steady-state, the mass flux going out remains a tiny bit > smaller than the mass flux coming in, no matter how small I make the time > steps & required residuals. Why is this? Could that be to with taking values at the cell centers when measuring the incoming and outgoing fluxes. Does accounting for the gradient to the boundary help in this calculation? FiPy stores values at the cell centers so there will be some error when you get the faceValue. It doesn't use the gradient on the boundaries. > 3) The surface density seems to be moving too fast. The velocity ranges > between 0.062 at r1 and 0.0524 at r2, and the distance between r2 and r1 is > 5 - 1 = 4, so the time it takes for the incoming mass flux through r2 at t=0 > to reach the left-hand-side boundary r1 would be larger than 4/0.062 = 64.5. > However, the system reaches its steady-state already around t=1.73. That seems strange. I don't know. > 4) If I set the diffusion constant to 0, such that there is only convection, > S_vap[-1] equals 8.0645, which should be the value corresponding to x=4.96, > (because (5/4.96) * 8 = 8.0645), which is the second to last value of the > faceCenters grid. S_vap.faceValue[-1] is equal to 8, as imposed. > But why does S_vap[-1] not correspond to the last value of the cellCenters > grid, which is 4.98? It's because the ConvectionTerm is only first order. Decreasing the grid size should get it closer. > On the same note: if I take Dif < 0.011 (for which the inwards mass-flux > equals the outward mass-flux when the system has reached steady-state), the > solution exactly overlaps with the analytical solution only if I do >>> S_vap_analytical.setValue(Mf / (xalt*vgas(xalt))) #with xalt >>> defined below in my code > > instead of > >>> S_vap_analytical.setValue(Mf / (x*vgas(x))) Probably the same deal. -- Daniel Wheeler _______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
