CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

WENO SCHEME BASICS Help Required!!!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 15, 2007, 15:38
Default WENO SCHEME BASICS Help Required!!!
  #1
John
Guest
 
Posts: n/a
Hi Guys,

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

fweno.m

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)

for i=1ng-6)

k = i;

f1 = D(i);

f2 = D(i+1);

f3 = D(i+2);

f4 = D(i+3);

f5 = D(i+4);

SP1=(13/12)*(f1-2*f2+f3).^2+0.25.*(f1-4*f2+3*f3).^2;

SP2=(13/12)*(f2-2*f3+f4).^2+0.25.*(f2-f4).^2;

SP3=(13/12)*(f3-2*f4+f5).^2+0.25.*(3*f3-4*f4+f5).^2;

alphap1= 0.1/((eps+SP1).^2);

alphap2=0.6/((eps+SP2).^2);

alphap3=0.3/((eps+SP3).^2);

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;

DTP(i+3)=WP1.*DP1+WP2.*DP2+WP3.*DP3; DT(i+3)=DTP(i+3);

end

  Reply With Quote

Old   January 18, 2007, 03:16
Default Re: WENO SCHEME BASICS Help Required!!!
  #2
saygin
Guest
 
Posts: n/a
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.

Saygin

  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ENO / WENO scheme phy4me Main CFD Forum 4 November 5, 2010 03:58
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
Finite Volume WENO Scheme DSS Main CFD Forum 3 January 15, 2007 03:47
Flux splitting for WENO scheme DSS Main CFD Forum 6 January 10, 2007 10:59
Conservative TVD or WENO scheme? Wen Long Main CFD Forum 3 July 9, 2004 16:40


All times are GMT -4. The time now is 18:29.