View Issue Details

IDProjectCategoryView StatusLast Update
0002022OpenFOAMpublic2016-03-08 14:15
Reporteralexeym Assigned Tohenry  
PrioritynormalSeveritytextReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Versiondev 
Summary0002022: Strange initialization of specularityCoefficient_ and restitutionCoefficient_ in JohnsonJacksonParticle*FvPatchScalarField.C
DescriptionBoth fields are of dimensionedScalar type, yet they are initialized like scalarField:

Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
JohnsonJacksonParticleThetaFvPatchScalarField
(
    const fvPatch& p,
    const DimensionedField<scalar, volMesh>& iF
)
:
    mixedFvPatchScalarField(p, iF),
    restitutionCoefficient_(p.size()),
    specularityCoefficient_(p.size())
{}

Surely it is perfectly OK to initialized scalar with label, but constructors usage are a little bit misleading.
Steps To Reproduce1. Checkout sources
2. Go to
- applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta
- applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip
- applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip
- applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta
3. Check *.C files
Additional InformationSince further in the files these fields are initialized like:

    restitutionCoefficient_
    (
        "restitutionCoefficient",
        dimless,
        dict.lookup("restitutionCoefficient")
    ),

instead of restitutionCoefficient_(p.size()) field could be initialized like:

    restitutionCoefficient_("restitutionCoefficient", dimless, 0.0)
TagsNo tags attached.

Activities

henry

2016-03-08 14:15

manager   ~0006015

Resolved in OpenFOAM-dev by commit 0ef2082dad95596a944a15202a61de3d62cd95e9

Issue History

Date Modified Username Field Change
2016-03-08 13:51 alexeym New Issue
2016-03-08 14:15 henry Note Added: 0006015
2016-03-08 14:15 henry Status new => resolved
2016-03-08 14:15 henry Fixed in Version => dev
2016-03-08 14:15 henry Resolution open => fixed
2016-03-08 14:15 henry Assigned To => henry
2016-03-11 11:44 administrator Category 3.0.1 => (No Category)