# Lid Driven Unsteady using ADI method.

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 September 16, 2013, 06:37 Lid Driven Unsteady using ADI method. #1 New Member   Rohan Sagar Join Date: Sep 2013 Posts: 1 Rep Power: 0 Hello all, We were trying to solve unsteady code for Lid Driven Cavity. Using Alternative Direction Implicit method with TDMA Algorithm. We are getting solution upto few time steps but after that omega is blowing up. Here the code we are trying. Any ideas whats going wrong in our code. Code: ```#include #include #include #include #include #include #include #define C_ERROR 0.000000001 #define grid 101 using namespace std; vector< vector > psi; vector< vector > omega; vector< vector > u; vector< vector > v; double dx=0, dy=0, beta=0, U=0; double dt=0, h=0; void Initialise(){ psi.resize(grid, vector(grid,0)); omega.resize(grid, vector(grid,0)); u.resize(grid, vector(grid,0)); v.resize(grid, vector(grid,0)); for(uint i=0;i > &v){ for(uint i=0;i &v){ for(uint i=0;i > a, vector< vector > b){ double diffSum=0, nSum=0; for(uint i=0;i& a, vector& b, vector& c, vector& d, vector& f) { size_t N = d.size(); for (int i=1; i 0; ) { f[i] = (d[i]-c[i]*f[i+1])/b[i]; } } void WriteFile(double a,uint Re){ ofstream File; File.open("unsteady.dat", ios::out | ios::app); for(uint i=0;i > tempomega; vector< vector > temppsi; do{ SetBoundaryConditions(); tempomega=omega; mainiter++; do{ //Computing PSI temppsi=psi; for(i=1;iC_ERROR); //Print(psi); //Solving u and v for(i=1;i a(grid-2,0); vector b(grid-2,0); vector c(grid-2,0); vector d(grid-2,0); vector x(grid-2,0); for(j=1;jC_ERROR); } int main(){ Initialise(); cout<<"Switching to Re=400\n"; Solve(100); /* //Test Case to cCheck Thomas Algorithm vector a(4,0); vector b(4,0); vector c(4,0); vector d(4,0); vector x(4,0); d[0]=8; d[1]=116; d[2]=47; d[3]=40; a[0]=0; a[1]=4; a[2]=2; a[3]=4; b[0]=2; b[1]=5; b[2]=5; b[3]=7; c[0]=3; c[1]=34; c[2]=7; c[3]=0; thomas(a,b,c,d,x); cout<<"A: "<

 Tags lid driven cavity, tmsa

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post new_at_this Main CFD Forum 0 December 22, 2011 17:04 gholamghar Main CFD Forum 0 August 1, 2010 01:55 josephlm Main CFD Forum 3 June 24, 2010 01:58 Perumal Main CFD Forum 1 January 22, 2007 14:27 justentered Main CFD Forum 0 December 30, 2003 00:52

All times are GMT -4. The time now is 01:51.

 Contact Us - CFD Online - Top