CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

find min/max deltaT

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 20, 2009, 20:36
Default find min/max deltaT
  #1
Senior Member
 
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 371
Rep Power: 12
cnsidero is on a distinguished road
I'm trying to implement the CoEuler (local timestepping) scheme in my solver but I don't think its working. As a simple check to confirm, I want to print the min/max timestep to stdout. I've included the following in main source file of my solver:

Code:
dimensionedScalar maxDt = 0.0;
dimensionedScalar minDt = 0.0;

maxDt = max(runTime.deltaT()).value();

minDt = min(runTime.deltaT()).value();

Info<< "Max and min time steps = "
<< maxDt << " " << minDt << endl;
When I recompile it with wmake, I get an error beginning with the following:

Code:
mySolverFoam.C: In function ‘int main(int, char**)’:
mySolverFoam.C:229: error: no matching function for call to ‘max(Foam::dimensionedScalar)’
So I understand the Foam min and max functions don't accept dimensionScalar types. The rest of the compilation error messages says the min and max functions take basic data types as input, i.e. chars, ints, floats.

I guess, the general questions is how do I find min/max timestep? Also, am I right in assuming the timestep is stored as a scalar field array, i.e. a deltaT for each cell?

I'm a noob at C++ so I think this a simple question for someone in the know.
cnsidero is offline   Reply With Quote

Old   September 21, 2009, 02:19
Default
  #2
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 20
niklas will become famous soon enoughniklas will become famous soon enough
Quote:
Originally Posted by cnsidero View Post
Also, am I right in assuming the timestep is stored as a scalar field array, i.e. a deltaT for each cell?
nope, its just a singe scalar..that's what the compiler is telling you. It is a dimensionedScalar.

So what you are trying to do is calculate something like max(1).
niklas is offline   Reply With Quote

Old   September 21, 2009, 08:34
Default
  #3
Senior Member
 
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 371
Rep Power: 12
cnsidero is on a distinguished road
Quote:
Originally Posted by niklas View Post
nope, its just a singe scalar..that's what the compiler is telling you. It is a dimensionedScalar.

So what you are trying to do is calculate something like max(1).
Ouch! Now I really feel dumb.
cnsidero is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for SUBOFF model but i can't find it. Heewon Lee Main CFD Forum 6 September 9, 2014 08:55
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
How to find the number of particles trapped prashant FLUENT 4 October 31, 2007 10:25
where can I find information on Star v4? tootoon CD-adapco 5 March 11, 2007 17:36
YPlus nowhere to be find Daniel CFX 3 May 1, 2006 16:22


All times are GMT -4. The time now is 00:09.