Dear All, I am testing my C++ code for Kobayashi-Warren-Carter model by Fipy. My question is concerning sourceCoeff in mesh20x20.py example from Fipy distribution: sourceCoeff = (diffusionCoeff * thetaGradDiff).divergence This term is explained I think in J.A. Warren et al. / Acta Materialia 51 (2003) 6035–6058 Eqs.(A28-A31). The subtraction operator is defined as Subt(\theta_0-\theta_1): \theta_1 - \theta_0 + 2\pi if \theta_1 - \theta_0< -\pi \theta_1 - \theta_0 if -\pi < \theta_1 - \theta_0< \pi
\theta_1 - \theta_0 - 2\pi if \pi <= \theta_1 - \theta_0 This subtraction operator is then used to define finite difference operator on the \theta phase field. The values 2\pi, 0 and -2\pi then define the source term corrections C_i,j eq(A.31). As I saw in the Fipy source the subtraction operator is defined on the modular variable which is defined on the circle: using: fmod(Theta + 3. * pi, 2. * pi) - pi This has the same effect as the Subt() operator above. Why it is then necessary to have sourceCoeff term in the mesh20x20.py example, if the gradients of the ModularVariable have already subtraction operator defined on the circle. I have set sourceCoeff to 0 in the mesh example and didn't notice significant difference in results (although I hadn't look at detailed numerical values). Thank you very much for your help! Best regards, Toni Ivas _______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
