Dear Jonathan,

many thanks for your quick reply.

I figured out that the convective flux crossing the left side of the 
element W is in your equation

- rho * v * (phi_W + phi(X=0))/2

and in my equation

- rho * v * phi(X=0)

That is the difference. Why is it necessary to interpolate the value of 
phi at the left side between phi_W and phi(X=0)? The value of phi is 
known at this position, because it is the boundary condition.

Warm regards,
Alex
Am 06.03.20 um 21:30 schrieb Guyer, Jonathan E. Dr. (Fed) via fipy:
> 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 ]
> 

-- 
Alexander Tismer

Institut für Strömungsmechanik
und Hydraulische Strömungsmaschinen
Universität Stuttgart
Pfaffenwaldring 10
70550 Stuttgart

Tel.:   +49 (0) 711 / 685 63007
Fax:    +49 (0) 711 / 685 63255
eMail: alexander.tis...@ihs.uni-stuttgart.de
http://www.ihs.uni-stuttgart.de
_______________________________________________
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