On Sun, Jun 12, 2016 at 8:14 AM, Gopalakrishnan, Krishnakumar <k.gopalakrishna...@imperial.ac.uk> wrote: > > 1. The backward Euler method is used in formulating the equation, > "n.grad(phi) = k * (phi_P + n.grad(phi) * dx / 2) " . But Backward Euler > is a first order method, isn't it ? I am a bit confused about the second > order accuracy statement.
I'm confused by your question. Backward Euler refers to the time stepping scheme, which is indeed first order. The spatial discretization scheme is second order and using the boundary condition trick that I demonstrated is second order and also implicit. > 2. In, the equation, "eq = (fp.TransientTerm() == > fp.DiffusionTerm(diffCoeff) - \ > > fp.ImplicitSourceTerm((mesh.faceNormals * implicitCoeff * > mesh.facesRight).divergence)) " , > > from what I understand the 'ImplicitCoeff' is zeroed out in all other > locations other than the right boundary by the boolean method > 'mesh.facesRight' , right ? Exactly, mesh.facesRight is just evaluates to a boolean array. There is also mesh.exteriorFaces which gets you all exterior faces and then you can also do logical operations based on physical location to get more specific masks to capture boundaries or internal regions. > If this is being implemented, do we have the restriction to use fixed dx ? I guess not if you're careful, but it could be a bit fiddly getting the correct distance. > Although dx appears in the Implicit term, it can just be set to the value > of 'dx' of the last node (i.e. length of the last segment in a > variable-mesh sized 1D geometry file). Am I missing something here ? No, but you need to know how to get the correct distance. There are arrays of cell to face distances, but I'd have to think about how to get that working right. > 3. Also, I am a bit confused about the negative signs used in the equation > above. The implicitCoeff is given a negative sign, and the equation's > ImplicitSourceTerm is also given a negative sign. From what I undertand, > this is what we intend to do ? I was just flipping signs to make it work so I'm not sure. Maybe it would be better to have them both positive and it would make more sense that way. > Assign the diffusion coefficient D throughout the domain, using the > faceVariable method. > Manually set it to zero at the right boundary > Then **add** the Diffusion achieved by the div.(D grad( phi)) by using the > ImplicitSourceTerm method, and ensure that this effect gets added only at > the right boundary. You got it. > If this is the workflow, then perhaps we just have to declare the > ImplicitSourceTerm to be positive, and use the addition sign instead of > subtraction sign for the implicitSourceTerm in the equation ? Yup, I think so. > 5. Taking one massive step to get to the answer. Here is a big question > (due to my poor knowledge in the subject) > > I understand that the implicitness enables us to take these large time-steps > due to the affine and A-stable properties of Implicit Methods. But are we > required to do this ? Oh no. You can still take as small a time step as necessary to capture the dynamics at the time scale of interest. It's just that you're not limited by the horrible dx**2 / D time step limit associated with explicit diffusion. Typically it's best to resolve to some dx based time scale (rather than dx**2) that captures an interface being tracked or some feature of interest moving around. > My problem is that, I am solving a coupled system > of PDEs and my other equations, require me to step very very slowly, due to > the inherent stiffness of my system. The PDEs describe processes of varying > time-constants. So, does taking the timestep to be small inhibit us > in any way ? The only down side to small time steps is that their small :-) > Once again, thanks a lot for your solution. Based on the discusssions with > Ray and from this particular method from your posting to the list, I > think I shall be able to solve the problem in 1D. The issues you pointed > out about using this approach in 2D went right over my head. I have to > think about this, when I implement them perhaps in a week or so. Good luck with it. -- Daniel Wheeler _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]