CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

problem computing maximum

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 31, 2009, 12:00
Default problem computing maximum
  #1
Member
 
Julien Schaguene
Join Date: Apr 2009
Location: France
Posts: 55
Rep Power: 17
Schag is on a distinguished road
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!
Schag is offline   Reply With Quote

Old   August 31, 2009, 16:44
Default
  #2
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
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.
niklas is offline   Reply With Quote

Old   September 1, 2009, 02:41
Default
  #3
Member
 
Julien Schaguene
Join Date: Apr 2009
Location: France
Posts: 55
Rep Power: 17
Schag is on a distinguished road
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?
Schag is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need any WHATEVER Help,please. Heat-Flow problem Amr FLUENT 1 March 15, 2013 11:47
Problem in Tutorial problem of fluent Phanindra FLUENT 5 April 17, 2007 09:57
CFD algorithm design with reconfigurable computing Beatríz Navarro FLUENT 0 June 24, 2006 18:22
the problem of CL in computing airplane zuozicheng CFX 1 July 12, 2005 18:39
GAMBIT meshing problem Gauthier Lambert Main CFD Forum 1 August 3, 2000 09:22


All times are GMT -4. The time now is 14:39.