# Seeking explanation why solve zeroes out solution in certain circumstances

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

 November 19, 2013, 18:59 Seeking explanation why solve zeroes out solution in certain circumstances #1 New Member   Tom Chyczewski Join Date: Mar 2009 Location: Bethpage, New York, USA Posts: 15 Rep Power: 10 Sponsored Links I am hoping someone can help me understand the behavior I'm observing with the code at bottom, which I adapted from scalarTransportFoam.C. Since my equation is stating that T isn't changing, I expect the T before the solve to be the same as T after the solve. However, as it is written, the T after the solve is equal to 0 for all m. If I change the construction of DD to Code: ```for (m=0; m<64, ++m) { DD[m] = scalar(l); }``` then the code behaves as I'd expect. Namely, T before is equal to T after (=5). Can anyone explain why solve is setting T to 0 if I use m in the construction of DD? Thanks. Code: ```#include "fvCFD.H" #include "fvIOoptionList.H" #include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" #include "createFields.H" #include "createFvOptions.H" simpleControl simple(mesh); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nCalculating scalar transport\n" << endl; #include "CourantNo.H" int m; int l = 5; scalar DD[64]; for (m=0; m<64; ++m) { DD[m] = scalar(m); } for (m=0; m<64; ++m) { forAll(U,i) { T[i] = DD[m]; } Info<<"T Before "<

 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 makaveli_lcf OpenFOAM Running, Solving & CFD 3 September 11, 2013 12:44 analyse In India Main CFD Forum 10 March 9, 2007 04:01 Christophe FLUENT 0 August 11, 2006 11:13 tangd OpenFOAM Running, Solving & CFD 0 May 29, 2006 09:07 Amilcar R Arvelo Main CFD Forum 1 December 1, 1998 16:55