View Issue Details

IDProjectCategoryView StatusLast Update
0000448OpenFOAMBugpublic2012-03-05 11:11
Reporteralbertop Assigned Touser4 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSopenSUSE OS Version12.1
Summary0000448: Using vanDriest damping functions leads to a crash
Description[I report this issue again, since I think the previous one was deleted due to a confusion caused by me deleting one note (#0001111) where I was saying this issue was due to a build problem, which does not seem to be the case, as I tried to explain in the (deleted) note #0001112. I am sorry for the confusion.]

Enabling the vanDriest damping function in LES tutorials (for example, pisoFoam/pitzDaily) causes a crash in the solver at the first iteration. The error message follows, and shows that the problem is in the evaluation of the exp function.

#0 Foam::error::printStack(Foam::Ostream&) in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 in "/lib/x86_64-linux-gnu/libm.so.6"
#4 exp in "/lib/x86_64-linux-gnu/libm.so.6"
#5 Foam::exp(Foam::Field<double>&, Foam::UList<double> const&) in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#6 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::exp<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#7 Foam::incompressible::LESModels::vanDriestDelta::calcDelta() in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#8 Foam::incompressible::LESModels::Smagorinsky::correct(Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#9 Foam::incompressible::LESModel::correct() in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#10
 in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/pisoFoam"
#11 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#12
 in "/home/ojan/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/pisoFoam"
Floating point exception

This issue was reported on http://www.cfd-online.com/Forums/openfoam-solving/97860-incomp-les-pisofoam-how-set-up-smagorinsky-model-van-driest-dampin.html#post347294 by another user, and I can reproduce it.

I examined the variables involved in the argument of the exp function using the pitzDaily tutorial for pisoFoam, and it seems that y assumes negative values with large magnitude (-1.0e+15).
Steps To ReproduceSet "delta" equal to "vanDriest" in any tutorial using LES models.
TagsNo tags attached.

Activities

albertop

2012-03-04 22:21

reporter   ~0001118

I used git bisect to locate the source of the problem, and it appears that

c06792759a720eb9d1494b4b4b0c3a86d21c20b0 is the first bad commit
commit c06792759a720eb9d1494b4b4b0c3a86d21c20b0
Author: andy <andy>
Date: Wed Feb 1 16:26:01 2012 +0000

    BUG: Corrected valid() behaviour for wallPoint - mantis #405

http://www.openfoam.org/mantisbt/view.php?id=405

The change was introduced to correct a problem with AMI/kOmegaSST, however the change made to the null constructor seems the root of the problem:

inline Foam::wallPoint::wallPoint()
:
    origin_(point::max),
    distSqr_(-GREAT) // Originally it was distSqr_(GREAT)
{}

albertop

2012-03-05 04:05

reporter   ~0001119

Last edited: 2012-03-05 04:07

I am not sure about the need of using -GREAT as value in wallPoint(). Is any other invalid value for a distance OK?

If such a value is required in other parts of the code, I would suggest the following change:

y.max(SMALL);

delta_ = min
(
    static_cast<const volScalarField&>(geometricDelta_()),
    (kappa_/Cdelta_)*((scalar(1) + SMALL) - exp(-y/ystar/Aplus_))*y
);

since y should not be negative in the damping function anyway. Note that y.max(0.0) would not work, since it would set delta to zero.

user4

2012-03-05 11:11

  ~0001120

Fixed in commit acca713bb47eeac410ef8613c4542e4fbbee5051.

Thanks Alberto.

(the -great is to be able to recognise unset values through AMI interpolation. We now use the mag of the distance on unset values)

Issue History

Date Modified Username Field Change
2012-03-04 10:11 albertop New Issue
2012-03-04 22:21 albertop Note Added: 0001118
2012-03-05 04:05 albertop Note Added: 0001119
2012-03-05 04:07 albertop Note Edited: 0001119
2012-03-05 04:07 albertop Note Edited: 0001119
2012-03-05 11:11 user4 Note Added: 0001120
2012-03-05 11:11 user4 Status new => resolved
2012-03-05 11:11 user4 Fixed in Version => 2.1.x
2012-03-05 11:11 user4 Resolution open => fixed
2012-03-05 11:11 user4 Assigned To => user4