# help!on simple method code

 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 9, 2011, 10:45 help!on simple method code #1 Member   HouKen Join Date: Jul 2011 Posts: 66 Rep Power: 8 Sponsored Links I post a thread yesterday on SIMPLE method and Now I'm reading sample code from: http://www.students.ncl.ac.uk/f.j.he...webs/codes.php Maybe you are very familiar with this code.However I can't understand a paragrah in the main function in[simple.cpp]: ... }/*}}}*/ void Boundary_velocities(Matrix& Vel_u, Matrix& Vel_v) { /*{{{*/ //The values of the final row are the same as the previous one unsigned FinalRow_u = Vel_u.numberOfRows() - 1; for (unsigned col = 0; col < Vel_u.numberOfCols(); col++) Vel_u(FinalRow_u, col) = Vel_u(FinalRow_u - 1, col); //The values of the final column are the same as the previous one unsigned FinalCol_v = Vel_v.numberOfCols() - 1; for (unsigned row = 0; row < Vel_v.numberOfRows(); row++) Vel_v(row, FinalCol_v) = Vel_v(row, FinalCol_v - 1); //------------Mass balance unsigned FinalCol_u = Vel_u.numberOfCols() - 1; for (unsigned row = 1; row < Vel_u.numberOfRows() - 2; row++) Vel_u(row, FinalCol_u) = 0; //Vel_u(row, FinalCol_u) = Vel_u(row, FinalCol_u - 1) + Vel_v(row-1, FinalCol_u) - Vel_v(row,FinalCol_u); //Vel_u(FinalRow_u-1, FinalCol_u) = Vel_u(FinalRow_u-1, FinalCol_u-1); Vel_u(FinalRow_u-1, FinalCol_u) = 0; unsigned FinalRow_v = Vel_v.numberOfRows() - 1; for (unsigned col = 1; col < Vel_v.numberOfCols() - 1; col++) Vel_v(FinalRow_v, col) = Vel_v(FinalRow_v - 1, col) + Vel_u(FinalRow_v,col-1) - Vel_u(FinalRow_v,col); } /*}}}*/ What does red part means?Is it trying to make sure the mass balance on the exit?or what? I have also read other books like from patankar,but I am not quite clear that if SIMPLE method will automatically fufill the mass balance over all calculation region?

 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 Halim Main CFD Forum 25 December 15, 2016 03:26 Ameya J Main CFD Forum 2 April 21, 2011 05:45 Shukla Main CFD Forum 3 January 20, 2011 13:51 syq129 Main CFD Forum 2 November 23, 2010 04:16 Jonny6001 Main CFD Forum 5 October 19, 2009 15:09