Lid Driven Cavity Programme

July 16, 2017 | Author: shootgun01 | Category: N/A
Share Embed Donate


Short Description

Download Lid Driven Cavity Programme...

Description

ME 602 Computational Fluid Dynamics Assignment 02

Submitted By:

#include #include #include #include using namespace std;

enum {imax=129,jmax=129,Re=100,itr_si_max=10,itr_w_max =2,U=1}; //imax = max grid pt. starting frm 1 in x dir //jmax=max grid pt. starting frm 1 in y dir //U =non dimentional vel of lid (at the top wall) //Re=reynolds no fr the expt. //itr_si_ma=no of itr for si //itr_w_max=no of itr fr omega long double si[150][150], u[150][150], v[150][150], omeg[150][150], Er,dx, dy, omeg_prev, si_prev; int i, j,itr_si, itr_w, counter=0;

//calc the grid spacing void calc_grid_spacing() { dx = 1.0/(imax-1); dy = 1.0/(jmax-1); }

//setting the initial boundry conditions void initialize_BC() { for(i=1;i1;i--) { omeg_prev = omeg[i][j]; omeg[i][j] = (omeg[i+1][j]*(1-(u[i][j]*dx*Re)/2) + omeg[i-1][j]*(1+(u[i][j]*dx*Re)/2) +\ omeg[i][j+1]*(1-(v[i][j]*dx*Re)/2) + omeg[i][j-1]*(1+(v[i][j]*dx*Re/2)))/4; } } }

//updating the boundry cond. over the walls for (i=2;i
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF