View Issue Details

IDProjectCategoryView StatusLast Update
0003762OpenFOAMBugpublic2021-12-07 21:35
ReportercgoessniAssigned Tohenry 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Platformamd64OSDebianOS Versionstable
Product Version9 
Fixed in Version9 
Summary0003762: XiEngineFoam crashes with adjustTimeStep yes
DescriptionXiEngineFoam crashes with adjustTimeStep set to yes.

Using dynamicCode for coded setDeltaT at line 57 in "/home/clemens/OpenFOAM/clemens-9/run/kivaTest/system/controlDict/functions/setDeltaT"
Courant Number mean: 0 max: 0
deltaT = 0
Crank angle = -180 CA-deg
deltaZ = 0
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::fvMesh::movePoints(Foam::Field<Foam::Vector<double> > const&) at ??:?
#4 Foam::layeredEngineMesh::move() at ??:?
#5 ? in "/home/clemens/local/OpenFOAM-9/platforms/linux64GccDPInt32Opt/bin/XiEngineFoam"
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7 ? in "/home/clemens/local/OpenFOAM-9/platforms/linux64GccDPInt32Opt/bin/XiEngineFoam"


If I add the following Info output to setDeltaT.H

if (adjustTimeStep)
{
    scalar maxDeltaTFact = maxCo/(CoNum + small);
    scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);

Info<< "maxDeltaTFact " << maxDeltaTFact << endl;
Info<< "deltaTFact " << deltaTFact << endl;
Info<< "deltaTValue() " << runTime.deltaTValue() << endl;
Info<< "maxDeltaT " << maxDeltaT << endl;
    runTime.setDeltaT
    (
        min
        (
            deltaTFact*runTime.deltaTValue(),
            maxDeltaT
        )
    );

    Info<< "deltaT = " << runTime.deltaTValue() << endl;
}

I get the following output:

Using dynamicCode for coded setDeltaT at line 57 in "/home/clemens/OpenFOAM/clemens-9/run/kivaTest/system/controlDict/functions/setDeltaT"
Courant Number mean: 0 max: 0
maxDeltaTFact 9.0072e+14
deltaTFact 1.2
deltaTValue() 2.77778e-05
maxDeltaT 0.000111111
deltaT = 0
Crank angle = -180 CA-deg
deltaZ = 0
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::fvMesh::movePoints(Foam::Field<Foam::Vector<double> > const&) at ??:?
#4 Foam::layeredEngineMesh::move() at ??:?
#5 ? in "/home/clemens/local/OpenFOAM-9/platforms/linux64GccDPInt32Opt/bin/XiEngineFoam"
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7 ? in "/home/clemens/local/OpenFOAM-9/platforms/linux64GccDPInt32Opt/bin/XiEngineFoam"
Floating point exception

So for some reason, setDeltaT sets it to zero unconditionally.
Steps To ReproduceTake the tutorial $FOAM_TUTORIALS/XiEngineFoam/kivaTest and set adjustTimeStep yes
Additional InformationFixed in -dev, is a backport possible?
TagsNo tags attached.

Activities

cgoessni

2021-12-07 20:59

reporter   ~0012294

Correction: adjustableRunTime has to be set too for this issue to trigger.

The function adjustDeltaT() in OpenFOAM/db/Time.C seems to fail if user time is in CA

henry

2021-12-07 21:09

manager   ~0012296

Try OpenFOAM-dev

cgoessni

2021-12-07 21:09

reporter   ~0012297

Problem can be resolved with the attached patch.

patch (311 bytes)
--- engineTime/crankConRod/crankConRod.C.orig	2021-12-07 22:08:25.371104683 +0100
+++ engineTime/crankConRod/crankConRod.C	2021-12-07 22:08:03.055483706 +0100
@@ -42,6 +42,7 @@
 {
     deltaT_  = degToTime(deltaT_);
     endTime_ = degToTime(endTime_);
+    beginTime_ = degToTime(beginTime_);
 
     if
     (
patch (311 bytes)

henry

2021-12-07 21:13

manager   ~0012299

I am unable to reproduce the problem in OpenFOAM-dev, so I believe it is already fixed.

cgoessni

2021-12-07 21:17

reporter   ~0012300

Yes, the re-write of the userTime framework has resolved this issue. I will apply the patch that I posted for -9 locally.

Thanks for the quick reply. Then both 0003761 and this report can be closed.

henry

2021-12-07 21:35

manager   ~0012303

Resolved by commit 15b2a2f42cdfce7c79b974e9be24a3320a6ef790
There is no issue is OpenFOAM-dev

Issue History

Date Modified Username Field Change
2021-12-07 20:39 cgoessni New Issue
2021-12-07 20:59 cgoessni Note Added: 0012294
2021-12-07 21:09 henry Note Added: 0012296
2021-12-07 21:09 cgoessni File Added: patch
2021-12-07 21:09 cgoessni Note Added: 0012297
2021-12-07 21:13 henry Note Added: 0012299
2021-12-07 21:17 cgoessni Note Added: 0012300
2021-12-07 21:35 henry Assigned To => henry
2021-12-07 21:35 henry Status new => resolved
2021-12-07 21:35 henry Resolution open => fixed
2021-12-07 21:35 henry Fixed in Version => 9
2021-12-07 21:35 henry Note Added: 0012303