My guess is that you got the sign of the outward-facing normal wrong somewhere. 
I posted my derivation to 
https://gist.github.com/guyer/3b77bbf32d90ef314754f0d76a7e04cc.


On Mar 6, 2020, at 4:09 AM, Alexander Tismer 
<alexander.tis...@ihs.uni-stuttgart.de<mailto:alexander.tis...@ihs.uni-stuttgart.de>>
 wrote:

Dear Users,

my question concerns the implementation of the boundary conditions in FiPy.
I would like to solve a 1D Conv-Diff-Equation with 3 control volumes using 
CentralDifferenceConvectionTerm and DiffusionTerm of FiPy.

For me, it is not clear why the first row of the matrix of the linear equation 
system is
> 9.000000  -2.500000      ---
and the right hand side is
> 6.5

The case is the following. Each control volume (W, C and E) has the length 1/3. 
All coefficients (gamma, u, rho) in the equation is set to 1:

   o---> x
   |-D=1/3-|-D=1/3-|-D=1/3-|
  x=0                     x=1
phi=1                   phi=0
   v                       v
   +-------+-------+-------+
   |   W   |   C   |   E  |
   o---x---o---x---o---x---o
   |       |       |       |
   +-------+-------+-------+

If I discretize the equation in the first control volume (W), I get for the 
matrix row
> 10.000000  -2.500000      ---
and for the right hand side
> 7.0

So this is a little bit different from FiPy. Is there any mistake from my side?

Please find attached my notes on how calculating my matrix coefficients 
(fipy_0.png) and my python script for fipy (fipy.py).

Warm regards,
Alex
<fipy_0.png><fipy.py>_______________________________________________
fipy mailing list
fipy@nist.gov<mailto:fipy@nist.gov>
http://www.ctcms.nist.gov/fipy
 [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

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

Reply via email to