Hello everyone,

I am trying to solve the following equation:

\[
\frac{\partial }
{{\partial t}}\left( {\xi ^2 cx} \right) - \frac{\partial }
{{\partial \xi }}\left( {\frac{{\xi ^3 }}
{R}\frac{{dR}}
{{dt}}cx} \right) + 3cx\frac{{\xi ^2 }}
{R}\frac{{dR}}
{{dt}} = \frac{\partial }
{{\partial \xi }}\left( {\frac{{\xi ^2 cD_{im} }}
{{R^2 }}\frac{\partial }
{{\partial \xi }}x} \right)
\]

Sorry for the messy code, but this is latex output from MathType. I would
suggest pasting it in your favorite latex compiler.

I coded the equation this way:

diffTerm = ImplicitDiffusionTerm(coeff=xi**2.0*c*D_p/R**2.0)

eq1 = TransientTerm(coeff=xi**2.0*c) \

        - ExponentialConvectionTerm(coeff = unitVector*xi_f**3.0/R*dR_dt*c_f,
diffusionTerm=diffTerm) \

        + 3.0*c*x_p*xi**2.0*dR_dt/R \

        == diffTerm

and I sweep this way:

        res = eq1.sweep(

                var = x_p,

                boundaryConditions=bc_xp,

                solver=LinearLUSolver(tolerance=1e-11),

                dt=dt)


and use the following boundary conditions

bc_xp = (

    FixedFlux(faces=mesh.getFacesRight(), value=-15.0),

    FixedFlux(faces=mesh.getFacesLeft(), value=0.0)

    )

I want to use a fixed flux boundary condition of 0.0 at xi=0 (on the left)
because I'm working in a spherically symmetrical one-dimensional domain.

Now the coefficients are nonlinear and they depend on the value of x. But
if they are assumed constant and I try to solve this problem, the
residuals and the last values close to xi=1 explode (strong divergence).

I was wondering if any of you can see something that is obviously wrong in
the way I pose my problem. I'm know it has a solution, because it's been
found before by other authors.

I tried changing one boundary condition to fixedValue and it converges!
The solution is of course wrong but it's much more stable. Perhaps there's
something wrong with the boundary conditions? I've read quite some posts
on BCs in the archives of this mailing list.

Would it be better if I worked with the trunk version of FiPy?

I really need to solve that problem...

Many thanks !

Etienne

Reply via email to