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

OpenFOAM 1.5.x.git

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 19, 2009, 09:23
Default setDeltaT
  #1
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
Im running 1.5.x.git version.

dont know if this counts as a bug, but it produces a sigFpe error.

I'm running engineCompRatio and when I reach TDC it crashes.
I traced the crash to the setDeltaT-line, when t1=0

Code:
     
while(mag(ca-ca1) > eps)
{
    ca = runTime.theta();
    scalar t1 = runTime.userTimeToTime(ca1-ca);
    runTime.setDeltaT(t1);
    runTime++;
    Info << "CA = " << runTime.theta() << endl;
    mesh.move();
}
Its easily fixed by the modification below.
But should there be some sort of warning/fix in setDeltaT when one tries to set the timestep to 0.

Code:
     
while(mag(ca-ca1) > eps)
{
    ca = runTime.theta();
    if (mag(ca-ca1) > eps)
    {
        scalar t1 = runTime.userTimeToTime(ca1-ca);
        runTime.setDeltaT(t1);
        runTime++;
        Info << "CA = " << runTime.theta() << endl;
        mesh.move();
    }
}
N

Last edited by niklas; March 19, 2009 at 10:34.
niklas is offline   Reply With Quote

Old   March 22, 2009, 18:46
Default
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 13
henry is on a distinguished road
Is it possible for the first loop:

if (mag(ca - ca0) > eps)
{
while(mag(ca - ca0) > eps)
{
ca = runTime.theta();
scalar t0 = runTime.userTimeToTime(ca0 - ca);
runTime.setDeltaT(t0);
runTime++;
Info << "CA = " << ca << endl;
mesh.move();
}
}

to suffer from the same problem? Also wouldn't it be better to reorganize the loops so that the test is only required once?

H
henry is offline   Reply With Quote

Old   March 23, 2009, 05:46
Default
  #3
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
Sorry for the bad naming of the topic, I tried to edit it afterwards, but that wasnt possible...

Quote:
Originally Posted by henry View Post
Is it possible for the first loop:

if (mag(ca - ca0) > eps)
{
while(mag(ca - ca0) > eps)
{
ca = runTime.theta();
scalar t0 = runTime.userTimeToTime(ca0 - ca);
runTime.setDeltaT(t0);
runTime++;
Info << "CA = " << ca << endl;
mesh.move();
}
}

to suffer from the same problem?
Yes, it is. I just havent seen this yet since I always start at BDC so the
criteria at the entry of the while statement is always false.

Quote:
Originally Posted by henry View Post
Also wouldn't it be better to reorganize the loops so that the test is only required once?
I just realized you dont have to do anything really,
just replace the ca-caX from the while (..) check and
use runTime.theta()-caX, then the if's can be removed.

N
niklas is offline   Reply With Quote

Old   March 23, 2009, 11:35
Default
  #4
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 13
henry is on a distinguished road
Thanks for the fix, I have pushed it into 1.5.x.

H
henry 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
OpenFoam vs CFX5 mass balance in OpenFoam tangd OpenFOAM Running, Solving & CFD 33 May 23, 2010 16:36
CheckMesh error using a tutorial from OpenFOAM 114 with openFOAM 13 martapajon OpenFOAM Native Meshers: blockMesh 7 January 21, 2008 13:52
OpenFOAM users in Munich OpenFOAM benutzer in M%c3%bcnchen jaswi OpenFOAM 0 August 3, 2007 13:11
OpenFOAM SteliosNTUA ParaView 4 March 8, 2007 04:15
A new Howto on the OpenFOAM Wiki Compiling OpenFOAM under Unix mbeaudoin OpenFOAM Installation 2 April 28, 2006 08:54


All times are GMT -4. The time now is 10:13.