Hi Toni, I looked over your script and there are some things I would
change, but I don't know if it will help with the convergence issues
you are having.

On Mon, Mar 29, 2010 at 10:18 AM, Ivas  Toni <toni.i...@mat.ethz.ch> wrote:

> mu = 1e3
> # we take a equal 1 so it doesn't influence solution
> a=1
> gamma = 1000
> x0=40
> #phaseOld = CellVariable(name='phase field', mesh=mesh, hasOld=1)
> phase = CellVariable(name='phase field',mesh=mesh,value=1.,hasOld=1)
> phaseOld = CellVariable(name='phase field old',mesh=mesh, value=1, hasOld=1)

I don't think you need a phaseOld, just use phase.getOld().

> phaseEq = TransientTerm(phase.getOld().getGrad()[0]) == 
> ImplicitDiffusionTerm()+VanLeerConvectionTerm(convectionCoeff) \
>  +ImplicitSourceTerm((phaseOld.getGrad()[0]-phase.getOld().getGrad()[0])/timeStepDuration)

I would do this it in this way,

    phaseEq = TransientTerm(phase.getGrad()[0]) ==
ImplicitDiffusionTerm() + PowerLawConvectionTerm(convectionCoeff) +
ImplicitSourceTerm((phase.getGrad()[0] -
phase.getOld().getGrad()[0])/timeStepDuration)

> for i in range(steps):
      phase.updateOld()
>    while residual > desiredResidual:
>           
> residual=phaseEq.sweep(phase,dt=timeStepDuration,solver=LinearLUSolver()
>           ,boundaryConditions=bcs)

Try this with and without an explicit source term as well.



-- 
Daniel Wheeler


Reply via email to