View Issue Details

IDProjectCategoryView StatusLast Update
0000738OpenFOAMBugpublic2013-03-12 17:36
Reporterwyldckat Assigned Touser2 
PrioritynormalSeveritytrivialReproducibilityalways
Status resolvedResolutionfixed 
Summary0000738: Tutorials "sloshingTank2D" and "sloshingTank2D3DoF" in "multiphase/interDyMFoam/ras/" won't run
DescriptionOpenFOAM 2.1.x, commit 739a317d096eed466e58cdb25fa72b2c86bf0c23
Tested in Ubuntu 10.04 i686 and openSUSE 11.2 x86_64

--> FOAM FATAL IO ERROR:
keyword interpolationScheme is undefined in dictionary "/home/user/OpenFOAM/user-2.1.x/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/controlDict::functions::wallPressure"

It looks like the commit {{b95f403f9241c4d782309927e7813ebcc5b9692a}} is the one to (partially) blame: https://github.com/OpenFOAM/OpenFOAM-2.1.x/commit/b95f403f9241c4d782309927e7813ebcc5b9692a
Steps To Reproducerun
rm -r tutorials
cp -r $FOAM_TUTORIALS .
cd tutorials/multiphase/interDyMFoam/ras/sloshingTank2D
./Allrun
cat log.interDyMFoam
Additional InformationDon't forget that it's both "sloshingTank2D" and "sloshingTank2D3DoF".
TagsNo tags attached.

Activities

wyldckat

2013-02-07 18:53

updater   ~0001881

Adding to "wallPressure":
   interpolationScheme isThisNeeded;

does let the tutorial run, although I haven't checked if it actually interpolates or not...

wyldckat

2013-02-16 10:15

updater  

sampledSurfaces.patch (1,121 bytes)   
diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C
index c480ec3..051e440 100644
--- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C
+++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C
@@ -217,7 +217,20 @@ void Foam::sampledSurfaces::read(const dictionary& dict)
     {
         dict.lookup("fields") >> fieldSelection_;
 
-        dict.lookup("interpolationScheme") >> interpolationScheme_;
+        if(dict.found("interpolationScheme"))
+        {
+            dict.lookup("interpolationScheme") >> interpolationScheme_;
+        }
+        else
+        {
+            WarningIn("sampledSurfaces::read(const dictionary& dict)")
+                << "'interpolationScheme' is not defined in: " << nl
+                << "      " << dict.name() << nl
+                << "    "
+                << "It is only required for when interpolating volume fields."
+                << endl;
+        }
+
         const word writeType(dict.lookup("surfaceFormat"));
 
         // define the surface formatter
sampledSurfaces.patch (1,121 bytes)   

wyldckat

2013-02-16 10:16

updater  

controlDict (2,379 bytes)   
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     interDyMFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         40;

deltaT          0.01;

writeControl    adjustableRunTime;

writeInterval   0.05;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression compressed;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  yes;

maxCo           0.5;
maxAlphaCo      0.5;

maxDeltaT       1;

functions
{
    probes
    {
        type            probes;
        functionObjectLibs ("libsampling.so");
        outputControl   outputTime;
        probeLocations
        (
            ( 0 9.95 19.77 )
            ( 0 -9.95 19.77 )
        );
        fields
        (
            p
        );
    }

    wallPressure
    {
        type            surfaces;
        functionObjectLibs ("libsampling.so");
        outputControl   outputTime;
        surfaceFormat   raw;
        //interpolationScheme isThisNeeded;
        fields
        (
            p
        );

        surfaces
        (
            walls
            {
                type        patch;
                patches     (walls);
                triangulate false;
            }

//             nearWalls_interpolated
//             {
//                 type            patchInternalField;
//                 patches         ( "walls" );
//                 interpolate     true;
//                 offsetMode  normal;
//                 distance    0.1;
//             }
        );
    }
}


// ************************************************************************* //
controlDict (2,379 bytes)   

wyldckat

2013-02-16 10:28

updater   ~0001919

After some diagnosing and testing, the conclusion was that "interpolationScheme" is only used for when volume fields are interpolated, namely in "Foam::sampledSurfaces::sampleAndWrite(... vField)" (file "src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C").


Attached is a "controlDict" for "tutorials/multiphase/interDyMFoam/ras/sloshingTank2D" which has ready-to-test options for testing the influence of the entry "interpolationScheme".

  * If the block "nearWalls_interpolated" is uncommented, it will complain about the value provided in "interpolationScheme".

  * Otherwise, since the block "walls" requests a direct value extraction from the patch surfaces, then the interpolation scheme is not used.


Given this situation and if keeping the entry "interpolationScheme isThisNeeded;" is not very well acceptable in those two tutorials, then attached is a proposition patch "sampledSurfaces.patch" for giving only a warning when "interpolationScheme" is not provided.
If and when the entry is necessary, the error triggered later on will still indicate what interpolation types are available, although the user will have to go to the top of the log file to figure out what was missing...

wyldckat

2013-03-11 21:53

updater   ~0001976

Bump: this is already fixed in 2.2.x, because it has got "interpolationScheme cellPoint;" in "controlDict".

Issue History

Date Modified Username Field Change
2013-02-07 18:49 wyldckat New Issue
2013-02-07 18:53 wyldckat Note Added: 0001881
2013-02-16 10:15 wyldckat File Added: sampledSurfaces.patch
2013-02-16 10:16 wyldckat File Added: controlDict
2013-02-16 10:28 wyldckat Note Added: 0001919
2013-03-11 21:53 wyldckat Note Added: 0001976
2013-03-12 17:36 user2 Status new => resolved
2013-03-12 17:36 user2 Fixed in Version => 2.2.x
2013-03-12 17:36 user2 Resolution open => fixed
2013-03-12 17:36 user2 Assigned To => user2