|
[Sponsors] |
Seeking explanation why solve zeroes out solution in certain circumstances |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
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: 17 |
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); } 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 "<<T[56]<<endl; solve ( fvm::ddt(T) ); Info<<"T After "<<T[56]<<endl; } return 0; } |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
smoothSolver diverges - solution in using PBiCG solver? | makaveli_lcf | OpenFOAM Running, Solving & CFD | 3 | September 11, 2013 13:44 |
Doubt on Implicit Methods | analyse In India | Main CFD Forum | 10 | March 9, 2007 04:01 |
Unsteady solution | Christophe | FLUENT | 0 | August 11, 2006 12:13 |
Problems with sonicTurbFoam | tangd | OpenFOAM Running, Solving & CFD | 0 | May 29, 2006 10:07 |
Which CFD software can solve this simulation accurately? | Amilcar R Arvelo | Main CFD Forum | 1 | December 1, 1998 16:55 |