View Issue Details

IDProjectCategoryView StatusLast Update
0003690OpenFOAMBugpublic2021-06-29 17:43
Reporterfede Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSDebianOS Version9
Product Versiondev 
Fixed in Versiondev 
Summary0003690: engineTime-based solvers cannot run with the option -case
DescriptionThe definition of the path of the engineGeometry file in engineTimeNew.C is not correct, if the solver has not launched in the $FOAM_CASE folder.

Please find attached a patched version of the file (see line 41 of the file) that fixes this issue.

Wish this helps.
Kind regards,

Federico
Steps To Reproducecd $FOAM_TUTORIALS/combustion/coldEngineFoam

blockMesh -case freePiston
coldEngineFoam -case freePiston


OpenFOAM release used: OpenFOAM-dev, commit 10a6e7a46
TagsNo tags attached.

Activities

fede

2021-06-29 16:03

reporter  

engineTimeNew.C (2,567 bytes)   
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Copyright (C) 2011-2018 OpenFOAM Foundation
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

\*---------------------------------------------------------------------------*/

#include "engineTime.H"
#include "IFstream.H"

// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

Foam::autoPtr<Foam::engineTime> Foam::engineTime::New
(
    const word& name,
    const fileName& rootPath,
    const fileName& caseName,
    const fileName& systemName,
    const fileName& constantName,
    const fileName& dictName
)
{
    IFstream engineDictFile(rootPath/caseName/constantName/dictName);

    dictionary engineDict(engineDictFile);

    const word engineType
    (
        engineDict.lookupOrDefault<word>("engineType", "crankConRod")
    );

    Info<< "Selecting engine type " << engineType << endl;

    dictionaryConstructorTable::iterator cstrIter =
        dictionaryConstructorTablePtr_->find(engineType);

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorInFunction
            << "Unknown engine type "
            << engineType << nl << nl
            << "Valid engine types are :" << nl
            << dictionaryConstructorTablePtr_->sortedToc()
            << exit(FatalError);
    }

    return autoPtr<engineTime>
    (
        cstrIter()
        (
            name,
            rootPath,
            caseName,
            systemName,
            constantName,
            dictName
        )
    );
}


// ************************************************************************* //
engineTimeNew.C (2,567 bytes)   

henry

2021-06-29 16:38

manager   ~0012071

Have you tested your proposed change in parallel?

fede

2021-06-29 17:10

reporter   ~0012072

you are right, I simply forgot. I fix the lines to make it work in serial and parallel and I send it back. Apologies

henry

2021-06-29 17:43

manager   ~0012073

Resolved by commit fbfbe79bcd3212f80ebbdd0d8b337fef7d367616

Issue History

Date Modified Username Field Change
2021-06-29 16:03 fede New Issue
2021-06-29 16:03 fede File Added: engineTimeNew.C
2021-06-29 16:38 henry Note Added: 0012071
2021-06-29 17:10 fede Note Added: 0012072
2021-06-29 17:43 henry Assigned To => henry
2021-06-29 17:43 henry Status new => resolved
2021-06-29 17:43 henry Resolution open => fixed
2021-06-29 17:43 henry Fixed in Version => dev
2021-06-29 17:43 henry Note Added: 0012073