|January 15, 2007, 16:38||
WENO SCHEME BASICS Help Required!!!
I am trying to implement a basic 1-D hyperbolic equation using WENO scheme in Matlab. I am facing lot of trouble due to my boundary and also . Could you guys have a look at my Matlab code and send a quick comment..!! Itwill be of great help
function [DT]=fweno(u,ng,delx,eps) DTP=zeros(ng,1); DTN=zeros(ng,1); DT=zeros(ng,1);
% %extrapolate the beginning and end points of data %% u is the data with 3 extra points at the beginining and %at the end % ng is the number of spatial divisions
u(3) = 2*u(4)-u(5); u(2) = 2*u(3)-u(4); u(1) = 2*u(2)-u(3); u(ng-2) = 2*u(ng-3)-u(ng-4); u(ng-1) = 2*u(ng-2)-u(ng-3); u(ng) = 2*u(ng-1)-u(ng-2);
D = (u(2:ng)-u(1:ng-1))/delx;
% WENO scheme based on left-based stencil ( k=i-3, ........i+2)
k = i;
f1 = D(i);
f2 = D(i+1);
f3 = D(i+2);
f4 = D(i+3);
f5 = D(i+4);
WPT=alphap1+alphap2+alphap3; WP1=alphap1./WPT; WP2=alphap2./WPT; WP3=alphap3./WPT;
DP1= f1/3- 7*f2/6 + 11*f3/6; DP2= -f2/6 + 5*f3/6 + f4/3; DP3= f3/3 + 5*f4/6 - f5/6;
|January 18, 2007, 04:16||
Re: WENO SCHEME BASICS Help Required!!!
I don't know Matlab coding syntax but I will try to help you.
First of all, what is the meaning of left-based or biased stencil? Do these (k=i-3, ........i+2) indicating nodes or cell centers? Cell centers should be from i-2 to i+2 for the reconstruction to i+1/2(-) and i-1/2(+). (-) (+) indicating the left- and right-side of the cell boundary respectively.
Can you expalin, what do this expression calculates? D = (u(2:ng)-u(1:ng-1))/delx;
i starts to count from 1, so f1=D(1), if it is your 3rd ghost cell it is ok. But the end-side uses ng-2 at most, I think it is not you 3rd ghost cell.
For finding i+1/2(-) and i-1/2(+) you should use different linear weights, and the characteristic decomposition should be done at each boundary of the cell wrt the reconstruction point.
|Thread||Thread Starter||Forum||Replies||Last Post|
|ENO / WENO scheme||phy4me||Main CFD Forum||4||November 5, 2010 04:58|
|Version 15 on Mac OS X||gschaider||OpenFOAM Installation||120||December 2, 2009 11:23|
|Finite Volume WENO Scheme||DSS||Main CFD Forum||3||January 15, 2007 04:47|
|Flux splitting for WENO scheme||DSS||Main CFD Forum||6||January 10, 2007 11:59|
|Conservative TVD or WENO scheme?||Wen Long||Main CFD Forum||3||July 9, 2004 16:40|