|
[Sponsors] |
August 31, 2009, 13:00 |
problem computing maximum
|
#1 |
Member
Julien Schaguene
Join Date: Apr 2009
Location: France
Posts: 55
Rep Power: 17 |
Hi all,
I'm facing a problem computing a maximum value for a time interval on each cell. I put there my code: volVectorField Umax (initiated full of (0 0 0)) forAll(times, timeI) { forAll(U,cellI) { if (mag(U[cellI]) > mag (Umax[cellI]) { Umax[cellI]=U[cellI]; } } } I get strange results, such as velocity in a cell that is not reach on my interval. Does anybody has an idea? Any advice would be welcome. Thank you! |
|
August 31, 2009, 17:44 |
|
#2 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
so....
in cell2 it can be the value from time=1s and in cell3 it can be the value from time=2s...for instance Im just curious why that would be interesting, to mix together the different times. Or have you left out pieces of code, like where you read in the U at different times? Where in that loop is that read? And why not initiate Umax with the values from the first time, that way you dont have to check for that time and can skip 1 iteration...not much, but still. anyways...your code (as it is written) does neither change the time or U in that loop. |
|
September 1, 2009, 03:41 |
|
#3 |
Member
Julien Schaguene
Join Date: Apr 2009
Location: France
Posts: 55
Rep Power: 17 |
Yes, that's the point, I can have U from time 1 in cell 3, and U from time 254 in cell 68957. It is interesting for me because I want to study sediment, so I have to know the maximum velocity in a non steady flow.
I could have initiate Umax with U(t=0), but that's not the point. And of course, I have many pieces of code left, I don't have just these lines, it would be dummy to think it would work! My base was the vorticity application. So for each time, I read U and it works. I obtain a correct average, it's just the maximum that doesn't work. I think my problem is the if (mag(U[cellI]) > mag (Umax[cellI]) { Umax[cellI]=U[cellI]; } because when I suppress the if, I get Umax=U at each time step (ouf!) Any idea? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need any WHATEVER Help,please. Heat-Flow problem | Amr | FLUENT | 1 | March 15, 2013 12:47 |
Problem in Tutorial problem of fluent | Phanindra | FLUENT | 5 | April 17, 2007 10:57 |
CFD algorithm design with reconfigurable computing | BeatrÃz Navarro | FLUENT | 0 | June 24, 2006 19:22 |
the problem of CL in computing airplane | zuozicheng | CFX | 1 | July 12, 2005 19:39 |
GAMBIT meshing problem | Gauthier Lambert | Main CFD Forum | 1 | August 3, 2000 10:22 |