필터 지우기
필터 지우기

problem in calculating flux in pde toolbox

조회 수: 1 (최근 30일)
Mohammad Monfared
Mohammad Monfared 2014년 1월 30일
댓글: Mohammad Monfared 2014년 1월 31일
Hi everybody,
I'm trying to calculate and plot the flux terms in the following equation in the pde toolbox:
fluxes are the inside square bracket terms. According to pde toolbox syntax, pde coefficients become:
c = K
a = 0
f = d(K)/dz = d(K)/dh * dh/dz
when I try to plot the fluxes by these lines the result is incorrect (violence of mass conservation law):
uintrp = pdeintrp(p,t,u) ;
[ux,uz] = pdegrad(p,t,u) ;
qx = -K(uintrp) .* ux ;
qz = -K(uintrp) .* (uz + 1) ;
pdeplot(p,e,t,'flowdata',[qx; qz])
But surprisingly when I change the 'qz' as follows everything seems OK!:
qz = -K(uintrp) .* (uz - 1) ;
so I'm a bit confused since the flux in the main equation has '+' in it not '-'. What am I missing here?
thanks,
  댓글 수: 1
Mohammad Monfared
Mohammad Monfared 2014년 1월 31일
The problem was simply because of a '-' in a function evaluating dK/dh !

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Boundary Conditions에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by