View Issue Details

IDProjectCategoryView StatusLast Update
0001539OpenFOAM[All Projects] Bugpublic2015-02-17 23:35
ReporterwyldckatAssigned Tohenry 
PrioritylowSeveritytextReproducibilityN/A
Status resolvedResolutionfixed 
Product Version 
Fixed in Version 
Summary0001539: Unable to derive a class from outletInletFvPatchField.C as "outletInletFvPatchScalarField"
DescriptionIf we copy-change the class "turbulentMixingLengthDissipationRateInlet" to create "turbulentMixingLengthDissipationRateOutlet", which derives from "outletInletFvPatchScalarField", it's will result in a compile error:

   outletInletFvPatchField.C:129:37: error: no matching function for call to ‘pos(const Foam::fvsPatchField<double>&)’


The reason for this can be seen if we compare the source codes from each original parent classes:

 - inletOutletFvPatchField:

    const Field<scalar>& phip =
        this->patch().template lookupPatchField<surfaceScalarField, scalar>
        (
            phiName_
        );

 - outletInletFvPatchField:

    const fvsPatchField<scalar>& phip =
        this->patch().template lookupPatchField<surfaceScalarField, scalar>
        (
            phiName_
        );


If we change "fvsPatchField" to "Field" in "outletInletFvPatchField.C", it works fine:

--- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C
@@ -120,7 +120,7 @@ void Foam::outletInletFvPatchField<Type>::updateCoeffs()
         return;
     }
 
- const fvsPatchField<scalar>& phip =
+ const Field<scalar>& phip =
         this->patch().template lookupPatchField<surfaceScalarField, scalar>
         (
             phiName_
Steps To ReproduceAttached is the source code ready for testing. Unpack and run "wmake libso" on it to trigger the error.
Additional InformationThis first happened to us around 19 months ago and only today was I able to double-check if this still occurs, how and why.

The provided example class might not make much sense, since there are other ways to get similar results, but still, it's a bug we (accidentally) managed to trigger.
TagsNo tags attached.

Activities

wyldckat

2015-02-17 19:27

updater  

turbulentMixingLengthDissipationRateOutlet.tar.gz (2,886 bytes)

henry

2015-02-17 23:35

manager   ~0003818

There are two possible solutions: either a reference to Field rather than fvsPatchField is used or fvsPatchField.H in included so that the pos function is known. For consistency with inletOutlet I have changed outletInlet to use Field as you propose.

Resolved by commit ba8c218ad5d49e28719d7489e4119eb59c6f5733

Issue History

Date Modified Username Field Change
2015-02-17 19:27 wyldckat New Issue
2015-02-17 19:27 wyldckat File Added: turbulentMixingLengthDissipationRateOutlet.tar.gz
2015-02-17 23:35 henry Note Added: 0003818
2015-02-17 23:35 henry Status new => resolved
2015-02-17 23:35 henry Resolution open => fixed
2015-02-17 23:35 henry Assigned To => henry