View Issue Details

IDProjectCategoryView StatusLast Update
0001184OpenFOAMBugpublic2014-02-25 13:08
Reporteruser864Assigned Touser4 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionno change required 
PlatformLinuxOSUbuntu OS Version12.04
Summary0001184: Failure to start from latest time when BC stores scalarlist
DescriptionI have observed that OpenFOAM fails to start from latest time when a custom boundary condition stores (and not even needs to read) a scalarlist. The error is provided under Additional Information.

This only happens when you are writing the files in binary format. Simulations stored in ascii format or with scalars stored instead of scalarLists run flawlessly. The same error is present at least from version 2.1.1 to 2.3
Steps To ReproduceI have created an easy-to-check case, so it can be reproduced in a direct manner (v. 2.2.2 or 2.3). Please, find it attached. The case is based on the cavity tutorial, only that a new BC has been applied. The new BC is called 'failFixedValue' and is a modified version of 'oscillatingFixedValue', tailored to behave as fixedValue and to store a dummy scalarList associated to the BC.

Run
./launchAll

This yields no error for the ascii case, and fails for the binary case.
Additional InformationCreate time

Create mesh for time = 0.1

Reading transportProperties

Reading field p

Reading field U



--> FOAM FATAL IO ERROR:
"ill defined primitiveEntry starting at keyword 'dumlist' on line 32 and ending at line 33"

file: /media/work/OpenFOAM/OpenFOAM-2.3.0/run/testBug/cavity_bin/0.1/U at line 33.

    From function primitiveEntry::readEntry(const dictionary&, Istream&)
    in file lnInclude/IOerror.C at line 132.

FOAM exiting
TagsNo tags attached.

Activities

user864

2014-02-25 11:50

 

testBug.tar.gz (5,197 bytes)

user4

2014-02-25 13:07

 

failFixedValueFvPatchField.C (4,056 bytes)   
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Copyright (C) 2011-2013 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 "failFixedValueFvPatchField.H"
#include "mathematicalConstants.H"
#include "fieldTypes.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //

template<class Type>
scalar failFixedValueFvPatchField<Type>::currentScale() const
{
    return 1.0;
}


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

template<class Type>
failFixedValueFvPatchField<Type>::failFixedValueFvPatchField
(
    const fvPatch& p,
    const DimensionedField<Type, volMesh>& iF
)
:
    fixedValueFvPatchField<Type>(p, iF),
    refValue_(p.size())
{}


template<class Type>
failFixedValueFvPatchField<Type>::failFixedValueFvPatchField
(
    const failFixedValueFvPatchField<Type>& ptf,
    const fvPatch& p,
    const DimensionedField<Type, volMesh>& iF,
    const fvPatchFieldMapper& mapper
)
:
    fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
    refValue_(ptf.refValue_, mapper)
{}


template<class Type>
failFixedValueFvPatchField<Type>::failFixedValueFvPatchField
(
    const fvPatch& p,
    const DimensionedField<Type, volMesh>& iF,
    const dictionary& dict
)
:
    fixedValueFvPatchField<Type>(p, iF),
    refValue_("refValue", dict, p.size())
{
    if (dict.found("value"))
    {
        fixedValueFvPatchField<Type>::operator==
        (
            Field<Type>("value", dict, p.size())
        );
    }
    else
    {
        fixedValueFvPatchField<Type>::operator==
        (
            refValue_*currentScale()
        );
    }
}


template<class Type>
failFixedValueFvPatchField<Type>::failFixedValueFvPatchField
(
    const failFixedValueFvPatchField<Type>& ptf
)
:
    fixedValueFvPatchField<Type>(ptf),
    refValue_(ptf.refValue_)
{}


template<class Type>
failFixedValueFvPatchField<Type>::failFixedValueFvPatchField
(
    const failFixedValueFvPatchField<Type>& ptf,
    const DimensionedField<Type, volMesh>& iF
)
:
    fixedValueFvPatchField<Type>(ptf, iF),
    refValue_(ptf.refValue_)
{}


// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //

template<class Type>
void failFixedValueFvPatchField<Type>::updateCoeffs()
{
    if (this->updated())
    {
        return;
    }

    fixedValueFvPatchField<Type>::operator==
    (
        refValue_*currentScale()
    );

    fixedValueFvPatchField<Type>::updateCoeffs();
}


template<class Type>
void failFixedValueFvPatchField<Type>::write(Ostream& os) const
{
    fixedValueFvPatchField<Type>::write(os);
    refValue_.writeEntry("refValue", os);

    // Dummy list
    scalarField dumlist(10, -1.0);
    dumlist[3] = 6.0;
    dumlist.writeEntry("dumlist", os);
}


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// ************************************************************************* //
failFixedValueFvPatchField.C (4,056 bytes)   

user4

2014-02-25 13:08

  ~0002895

write as a scalarField and #include fieldTypes.H

Issue History

Date Modified Username Field Change
2014-02-25 11:50 user864 New Issue
2014-02-25 11:50 user864 File Added: testBug.tar.gz
2014-02-25 13:07 user4 File Added: failFixedValueFvPatchField.C
2014-02-25 13:08 user4 Note Added: 0002895
2014-02-25 13:08 user4 Status new => resolved
2014-02-25 13:08 user4 Resolution open => no change required
2014-02-25 13:08 user4 Assigned To => user4