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

Convergence study_Computational fluid dynamics

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 13, 2013, 05:18
Default Convergence study_Computational fluid dynamics
  #1
New Member
 
Miel
Join Date: Sep 2013
Posts: 1
Rep Power: 0
miel_35 is on a distinguished road
Hello guys!
I am a beginner in Matlab, I am currently a student in Computational fluid dynamics and i am struggling badly with the codes.

We started with a script that uses Taylor's series expansion to compute coefficients of one-dimensional Finite Difference schemes on an even stencil using 'a' points to the left and 'b' points to the right for a total of 'r = a + b + 1' points in the stencil. I was able to develop this script and afterwards, i made it a function as i should use it for another exercise. That's where i am stuck. I have to use a double 'for'-loop to run over all combinations of grid points in N and stencils in STENCIL to compute the max. trunc. errors in ERROR.
%% Input
L = 1; % length of domain
N = [5 10 20 40 80 160 320]; % vector with num. of grid points
STENCIL = [ 0 1 ; 1 1 ; 2 2 ]; % stencil size array
%% Initialize
k = 2*pi/L; % wave number
Dx = L./(N-1); % vector with grid spacings
ERROR = zeros(size(STENCIL,1),length(N)); % array to hold maximum errors
ROC = zeros(size(STENCIL,1),1); % vector to hold rates of conv.
TL = zeros(size(STENCIL,1),length(N)); % array to hold tendency line val.

Can anyone help? I would appreciate.
miel_35 is offline   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
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
FSI/MFX: resutls after using fluid mass flux to achieve convergence gogohusky CFX 4 May 23, 2012 06:08
Fluid dynamics in zero-g charles_west OpenFOAM 2 September 15, 2009 04:31
Fluid Dynamics Eng - PAX Mixer - San Rafael, CA Gary Jong FLUENT 0 February 25, 2008 20:46


All times are GMT -4. The time now is 08:22.