Henri - My apologies for the delay in answering.
We have an existing mesh generator [`CylindricalGrid2D`](https://www.ctcms.nist.gov/fipy/fipy/generated/fipy.meshes.html#fipy.meshes.factoryMeshes.CylindricalGrid2D) that automatically takes care of calculating cylindrical symmetry. You only need to specify the r and z dimensions of the mesh and FiPy takes care of the wedge-shaped geometry; you do not need to transform your PDE into cylindrical form. Mathematically, what boundary conditions are you trying to achieve? I definitely wouldn’t use `NthOrderBoundaryCondition`. Those are only for higher-order PDEs like Cahn-Hilliard/Ginsburg-Landau. Even then, that’s an older way of doing things that we don’t recommend anymore. `Pol.faceGrad.constrain()` is the syntax we recommend, but you should be aware that as a finite volume code, FiPy has no-flux as the natural boundary condition. While no-flux is not always equivalent to zero normal gradient, for your diffusion equation, they are equivalent. There is no need to apply a constraint if no-flux is what you desire. - Jon On Nov 3, 2020, at 12:49 PM, Henri Colaux <colauxhe...@gmail.com<mailto:colauxhe...@gmail.com>> wrote: Dear devs, I am writing a code that simulates the diffusion of magnetisation from proton to proton inside a solid. This process behaves like a standard diffusion program (but with an equilibrium term) so your code have been very helpful and I got some great results so far, but I stambled into some problem whose solution is above my knowledge. I am trying to simulate a « drill-core » sort of structure with two different components - denoted « domains », one being a small slice inside a much more abundant one, as pictured in the following schematics : [X] I figured that this system is equivalent to producing a 2D array using Grid2D as picture of the right of this figure, and ensuring that there is no magnetisation transfer (i.e. no flux) taking place at the border of the system. To account for the rotation centre and the cylindrical symmetry, I have taken the effect of the radius directly in the differential equation.Yet, for some reasons, it seems like the boundery conditions is not set correctly in my code, which gave unwanted behaviours. I have included a minimum working example of the code I am trying to simulate. First and formost, could you let me know if I do everything right for what I am trying to simulate ? Cheers ! Henri Colaux -- To unsubscribe from this group, send email to fipy+unsubscr...@list.nist.gov<mailto:fipy+unsubscr...@list.nist.gov> View this message at https://list.nist.gov/fipy --- To unsubscribe from this group and stop receiving emails from it, send an email to fipy+unsubscr...@list.nist.gov<mailto:fipy+unsubscr...@list.nist.gov>. <spindiff_v3_6_1_mwe.py> -- To unsubscribe from this group, send email to fipy+unsubscr...@list.nist.gov View this message at https://list.nist.gov/fipy --- To unsubscribe from this group and stop receiving emails from it, send an email to fipy+unsubscr...@list.nist.gov.