2

I'm trying to implement a phase field solidification model of a ternary alloy using FiPy. I have looked at most of the phase field examples provided on FiPy's website and my model is similar to examples.phase.quaternary.

The evolution equation for the concentrations looks like this:

https://i.sstatic.net/KvM1r.png

Which should be solved for C_1 and C_2 (C_3 is solvent). The concentration equations are coupled with the phase evolution equation and we have D_i = D_i(phi), h = h(phi).

There are nonlinear dependencies of the variable solved for (C_i) in all three terms which makes me unsure on how to define them in FiPy. The first term (red) is a diffusion term with a nonlinear coefficient and that should be fine, but how should I define the counterdiffusion and the phasetransformation terms?

I tried defining them as diffusion and convection terms with nonlinear coefficients but without success. Therefore I am hoping for some advice on how I can define so that FiPy likes it.

Any help is highly appreciated, thanks! /Anders

1 Answer 1

1

This set of equations can be solved in a coupled manner. The counter diffusion term can be defined as a coupled diffusion term and the phase transformation term can be defined as a convection term. The equations will be,

eqn1 = fipy.TransientTerm(var=C_1) == \
       fipy.DiffusionTerm(D_1 - coeff_1 * (D_1 - D_3), var=C_1) \ # coupled
       - fipy.DiffusionTerm(coeff_1 * (D_2 - D_3), var=C_2) \ # coupled
       + fipy.ConvectionTerm(conv_coeff_1, var=C_1)

where

coeff_1 = D_1 * C_1 / ((D_1 - D_3) * C_1 + (D_2 - D_3) * C_2 + D_3)
conv_coeff_1 = Vm / R * D_1 * h.faceGrad * inner_sum_1.faceValue

and inner_sum_1 is the complicated inner sum in the phase transformation term. The $\nabla h$ part has been taken out of the inner sum. You can either use (h.grad * inner_sum_1).faceValue or h.faceGrad * inner_sum_1.faceValue or use face values for the variables that constitute inner_sum_1. I don't know how much difference it makes. After both the C_1 and C_2 equations are defined in a similar manner, then combine them into one equation with

eqn = eqn1 & eqn2
5
  • Hi and thanks for the input, much appreciated! However, the variable C_3 is declared as a solvent i.e. : components = [ CellVariable(mesh=mesh, name='C1', hasOld=1), CellVariable(mesh=mesh, name='C2', hasOld=1), ] solvent = Variable(value = 1) for Cj in components: solvent -= Cj solvent.name = 'C3' Such as in examples.phase.quaterny, this means there is no evolution equation for C3, i.e. the constraint between the concentrations is being utilized instead: C1 + C2 + C3 = 1. Can I still write the term for C3 as a DiffusionTerm as specified in your comment? Commented Oct 7, 2016 at 11:03
  • In the case that solving for C3 is redundant, substitute C3 from the equations so there is no need to define it.
    – wd15
    Commented Oct 8, 2016 at 14:18
  • The answer is amended with the C_3 = 1 - C_1 - C_2 substitution.
    – wd15
    Commented Oct 8, 2016 at 15:19
  • Thanks for the comments! A followup question thought, does it make any difference if I define C3 and insert it in the equations or if I just insert it directly? When you use C3.harmonicFaceValue for example? Commented Oct 13, 2016 at 8:28
  • C_3 need not be defined at all anywhere in the script. If you need use it for something (like plotting for example) then define it as C_3 = 1 - C_1 - C_2.
    – wd15
    Commented Oct 14, 2016 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.