On Thu, Sep 27, 2012 at 11:24 PM, Oliver Maclaren
<[email protected]> wrote:
> Hi,
> thanks for the response Daniel! Playing around with this example, I
> also noticed that solving the equation (over domain [0,1]):
>
> (A) eq = PowerLawConvectionTerm([1]) - 1
>
> subject to:
>
> (B) vel.constrain(0, mesh.facesLeft)
> (C) vel.faceGrad.constrain([-0], mesh.facesRight)
>
> gives the correct answer (y=x, from 0 to 1), but requires the second
> boundary condition to be specified otherwise gives the error message:
>
> ".../FiPy-3.0/fipy/solvers/pysparse/linearLUSolver.py", line 89, in _solve_
>     LU = superlu.factorize(L.matrix.to_csr())
> RuntimeError: Factor is exactly singular"

I don't get that error, but I do get a different answer. The surplus
boundary condition is required to specify an outflow boundary
condition due to the default boundary condition being "no flux" even
for convection terms.

> On the other hand, solving what should be an equivalent equation (?):
>
> (D) eq= -PowerLawConvectionTerm([1]) +1
>
> subject to the same boundary conditions gives the solution y=x-1, i.e.
> y going from -1 to 0, which seems incorrect (the solution should be
> the same as before?). I.e. the equation is satisfied (slope =1) but
> the LHS boundary condition is not enforced properly.

If you introduce a very small transient term then you can change the
sign of the equation and  it will work as expected. The transient term
is required as a reference point for the sign of the equation. I'll
file a ticket and try and fix this and get back to you. It might not
be possible to fix this though.

> Any idea what is happening here? I am hoping to solve a system of two
> (or more) coupled equations with one being a
> convection-diffusion-reaction equation for solute transport in a tube
> and the other a convection equation with a source term coupled to the
> solute concentration (representing an osmotic source). So before I do
> this I would like to verify the solvers for each part as much as
> possible.

To be safe, include small transient terms or diffusion terms. The
problem is with upwinding correctly. When the only terms in the
equation are a convection and a source term, it is quite hard to know
which direction to choose for upwinding. I think this is the issue.

> Thanks so much for your time!

No problem.

-- 
Daniel Wheeler
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to