View Issue Details

IDProjectCategoryView StatusLast Update
0002728OpenFOAMBugpublic2017-10-20 15:21
ReporterKerghan Assigned Towill  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformUnixOSGNU/Linux Ubuntu 16.04OS Version(please specify)
Summary0002728: nearWallFields fails to produce field on some meshes
DescriptionIt looks like there is a bug in point generation for probing locations near walls to estimate near-wall fields in nearWallFields function object. More precisely, it's probably somewhere in point tracking.
Steps To Reproduce1. Prepare $FOAM_TUTORIALS/incompressible/simpleFoam/airFoil2D
2. In $YOUR_CASE/system/controlDict add
functions
{
    nearField
    {
        type nearWallFields;
        libs ("libfieldFunctionObjects.so");
        writeControl timeStep;
        writeInterval 1;
        fields ((U UNear1em6));
        patches (walls);
        distance 1e-6;
    }
}
3. Run simpleFoam
Additional InformationIn case of OpenFOAM-5.x one should get warning messages:
..........snip..........
Starting time loop

nearWallFields nearField: Sampling 1 fields
--> FOAM Warning :
    From function void Foam::particle::locate(const vector&, const vector*, Foam::label, bool, Foam::string)
    in file particle/particle.C at line 507
    "Particle initialised with a location outside of the mesh."
--> FOAM Warning :
    From function void Foam::particle::locate(const vector&, const vector*, Foam::label, bool, Foam::string)
    in file particle/particle.C at line 507
    "Particle initialised with a location outside of the mesh."
..........snip..........
--> FOAM Warning :
    From function void Foam::particle::locate(const vector&, const vector*, Foam::label, bool, Foam::string)
    in file particle/particle.C at line 507
    "Particle initialised with a location outside of the mesh."
--> FOAM Warning :
    From function bool Foam::functionObjectList::read()
    in file db/functionObjects/functionObjectList/functionObjectList.C at line 675
    Caught FatalError
--> FOAM FATAL ERROR:
Cell not found for particle position (-17.2841 -0.406463 0.025).

    From function void Foam::particle::locate(const vector&, const vector*, Foam::label, bool, Foam::string)
    in file particle/particle.C at line 455.

Time = 1

smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 0.0611362, No Iterations 2
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 0.0585177, No Iterations 2
GAMG: Solving for p, Initial residual = 1, Final residual = 0.0940365, No Iterations 7
time step continuity errors : sum local = 0.000301165, global = 6.11097e-18, cumulative = 6.11097e-18
smoothSolver: Solving for nuTilda, Initial residual = 1, Final residual = 0.0452916, No Iterations 2
ExecutionTime = 0.18 s ClockTime = 0 s
..........snip..........


Not sure if solver should keep running after fatal error, but it does. Eventually case doesn't have requested near-wall field, everything else is ok.

In case of OpenFOAM-4.x solver crashes right away:
..........snip..........
Starting time loop

nearWallFields nearField: Sampling 1 fields
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigSegv::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 double Foam::particle::trackToFace<Foam::findCellParticle::trackingData>(Foam::Vector<double> const&, Foam::findCellParticle::trackingData&) at ??:?
#4 Foam::findCellParticle::move(Foam::findCellParticle::trackingData&, double) at ??:?
#5 void Foam::Cloud<Foam::findCellParticle>::move<Foam::findCellParticle::trackingData>(Foam::findCellParticle::trackingData&, double) at ??:?
#6 Foam::functionObjects::nearWallFields::calcAddressing() at ??:?
#7 Foam::functionObjects::nearWallFields::read(Foam::dictionary const&) at ??:?
#8 Foam::functionObjects::nearWallFields::nearWallFields(Foam::word const&, Foam::Time const&, Foam::dictionary const&) at ??:?
#9 Foam::functionObject::adddictionaryConstructorToTable<Foam::functionObjects::nearWallFields>::New(Foam::word const&, Foam::Time const&, Foam::dictionary const&) at ??:?
#10 Foam::functionObject::New(Foam::word const&, Foam::Time const&, Foam::dictionary const&) at ??:?
#11 Foam::functionObjects::timeControl::timeControl(Foam::word const&, Foam::Time const&, Foam::dictionary const&) at ??:?
#12 Foam::functionObjectList::read() at ??:?
#13 Foam::Time::loop() at ??:?
#14 Foam::simpleControl::loop() at ??:?
#15 ? at ??:?
#16 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#17 ? at ??:?
Segmentation fault (core dumped)
TagsNo tags attached.

Activities

will

2017-10-20 11:52

manager   ~0008905

The function object does all sorts of wacky fixes to account for particles that are slightly outside or just along face-diagonals. These are what is failing. None of that is needed any more. The version 5+ tracking just handles it.

There are still some NaN-s in the output, which is a little worrying. I haven't investigated why. This crash is fixed, though.

Resolved in dev by commit aa24a97c, and in 5.x by 26b8a502.

will

2017-10-20 15:21

manager   ~0008911

FYI, the NaN issue has now been dealt with, too, in dev, by commit 6d06f737. There were some other issues in the way that the tracking was being done which prevented some tracks from registering. That has been dealt with now.

Issue History

Date Modified Username Field Change
2017-10-18 16:57 Kerghan New Issue
2017-10-20 11:52 will Assigned To => will
2017-10-20 11:52 will Status new => resolved
2017-10-20 11:52 will Resolution open => fixed
2017-10-20 11:52 will Fixed in Version => 5.x
2017-10-20 11:52 will Note Added: 0008905
2017-10-20 15:21 will Note Added: 0008911