View Issue Details

IDProjectCategoryView StatusLast Update
0003521OpenFOAMFeaturepublic2020-11-21 19:46
Reporterpeksa Assigned Tohenry  
PriorityhighSeverityminorReproducibilityalways
Status closedResolutionsuspended 
Platformx86OSCentosOS Version7
Summary0003521: EngineTime (CAD) not recognized correctly by functionObjects
DescriptionIn internal combustion engine related solvers (coldEngineFoam and XiEngineFoam) the solver setup (startTime, endTime etc.) respect the engine relevant cranck-angle-degree (CAD) format.

However, run-time functionObjects respect the physical time value (runTime.value()) instead of runTime.timeToUserTime(runTime.value()) based value. In order to make e.g. timeActivatedFileUpdate function to work, user needs to input the update timings in real time which is cumbersome because the values depend on engine setup.

In contrast to above, postProcessing utility "postProcess -func CourantNo" utilizes the engine time based time-step saved under the uniform directory. Hence, mistakenly, utilizes that in the computation of the Courant number even though in that utility the physical time step should be used.

Because this engineTime related bug concerns variety of functionObjects I don't have a satisfactory solution to provide at the moment but I'd like to inquire whether you have ideas how to fix the issue? I could participate to the bug-fixing process if required/preferred.
Steps To Reproduce1) Copy */tutorials/combustion/XiEngineFoam/kivaTest tutorial
2) add engine time based timeActivatedFileUpdate (fileUpdate1) from below to the controlDict
3) log the output and see that files are updated at the startup only.
4) add physical time based timeActivatedFileUpdate (fileUpdate2) from below to the controlDict
5) log the output and see that files are updated correctly according to the physical time given.

---------------------------------------------------------
    fileUpdate1
    {
        type timeActivatedFileUpdate;
        functionObjectLibs ("libutilityFunctionObjects.so");
        outputControl timeStep;
        outputInterval 1;
        fileToUpdate "$FOAM_CASE/system/controlDict";
        timeVsFile
        (
            (-190 "$FOAM_CASE/system/controlDict")
            (-179 "$FOAM_CASE/system/controlDict")
        );
    }

---------------------------------------------------------

    fileUpdate2
    {
        type timeActivatedFileUpdate;
        functionObjectLibs ("libutilityFunctionObjects.so");
        outputControl timeStep;
        outputInterval 1;
        fileToUpdate "$FOAM_CASE/system/controlDict";
        timeVsFile
        (
            (-1 "$FOAM_CASE/system/controlDict")
            (-0.0197778 "$FOAM_CASE/system/controlDict") // Corresponds -177.75 CA-deg
        );
    }
---------------------------------------------------------
TagsNo tags attached.

Activities

henry

2020-07-10 15:46

manager   ~0011415

Updating all the functionObjects to work with engine time would be a substantial undertaking and currently none of the OpenFOAM sponsors:

https://openfoam.org/supporters/

have expressed any interest in the maintenance of the engine solvers so we would need to secure specific funding for this work.

peksa

2020-07-12 14:42

reporter   ~0011417

I totally understand the related work-load and requirement of funding.

May I inquire, what kind of solution you would prefer to have for such a problem? Perhaps a separate parameter "-useEngineTime" or replace runTime.value() by timeToUserTime in functionObject control?

henry

2020-07-12 14:55

manager   ~0011418

My preference would be for the handling to be automatic and use the UserTime where appropriate.

ZhangYan

2020-07-21 22:25

reporter   ~0011428

Hi, I've changed timeActivatedFileUpdate to engineTimeActivatedFileUpdate.
Enjoy: https://github.com/ZhangYanTJU/functionObjects

henry

2020-11-21 19:46

manager   ~0011701

Pending funding or a general patch.

Issue History

Date Modified Username Field Change
2020-07-10 15:19 peksa New Issue
2020-07-10 15:42 henry Category Bug => Feature
2020-07-10 15:46 henry Note Added: 0011415
2020-07-12 14:42 peksa Note Added: 0011417
2020-07-12 14:55 henry Note Added: 0011418
2020-07-21 22:25 ZhangYan Note Added: 0011428
2020-11-21 19:46 henry Assigned To => henry
2020-11-21 19:46 henry Status new => closed
2020-11-21 19:46 henry Resolution open => suspended
2020-11-21 19:46 henry Note Added: 0011701