View Issue Details

IDProjectCategoryView StatusLast Update
0003397OpenFOAMBugpublic2019-11-26 16:36
Reporterhandrake0724Assigned Towill 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Versiondev 
Fixed in Versiondev 
Summary0003397: Airy wave makes an error when wave length is less than 2
Descriptionin wave tutorial of tutorial/multiphase/interFoam/liminar/wave,
if Airy wave has the following setup (wave length being less than 2 or wave number being larger than pi), it make an overflow error in exp or sinh functions.
But the Airy wave setup has nothing wrong in linear wave theory point of view.

waves
(
    Airy
    {
        length 2;
        amplitude 0.01;
        phase 0;
        angle 0;
        // depth 10; // for shallow
    }
)

call stack shows the error was originated from waveSuperposition::UGas as shown below

#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/usr/lib/libc.so.6"
#3 __sinh_finite in "/usr/lib/libm.so.6"
#4 sinhf32x in "/usr/lib/libm.so.6"
#5 Foam::sinh(Foam::Field<double>&, Foam::UList<double> const&) at ??:?
#6 Foam::sinh(Foam::tmp<Foam::Field<double> > const&) at ??:?
#7 Foam::waveModels::Airy::vi(int, double, Foam::Field<Foam::Vector2D<double> > const&) const at ??:?
#8 Foam::waveModels::Airy::velocity(double, Foam::Field<Foam::Vector2D<double> > const&) const at ??:?
#9 Foam::waveSuperposition::velocity(double, Foam::Field<Foam::Vector<double> > const&) const at ??:?
#10 Foam::waveSuperposition::UGas(double, Foam::Field<Foam::Vector<double> > const&) const at ??:?

or

#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/usr/lib/libc.so.6"
#3 ? in "/usr/lib/libm.so.6"
#4 expf64 in "/usr/lib/libm.so.6"
#5 Foam::exp(Foam::Field<double>&, Foam::UList<double> const&) at ??:?
#6 Foam::exp(Foam::UList<double> const&) at ??:?
#7 Foam::waveModels::Airy::vi(int, double, Foam::Field<Foam::Vector2D<double> > const&) const at ??:?
#8 Foam::waveModels::Airy::velocity(double, Foam::Field<Foam::Vector2D<double> > const&) const at ??:?
#9 Foam::waveSuperposition::velocity(double, Foam::Field<Foam::Vector<double> > const&) const at ??:?
#10 Foam::waveSuperposition::UGas(double, Foam::Field<Foam::Vector<double> > const&) const at ??:?


 
TagsNo tags attached.

Activities

will

2019-11-26 16:36

manager   ~0010941

It's z/(2*pi*l), or z*k that when much greater than 2 triggers the error, not the length/wavenumber itself. That's good, because otherwise we'd have an issue with clipping a dimensioned number.

My suspicion is that if the decay functions (exp/sinh/etc...) are overflowing, then the parameters are unlikely to be realistic. In this example, setting an amplitude of 1cm in a domain 600m tall... However, it is preventable by similar means to some clipping that we already do for depth, so there's not really any disadvantage in your proposal.

Resolved by https://github.com/OpenFOAM/OpenFOAM-dev/commit/d0768e6039ba526d4fde446fd22fd6ff76577417

Issue History

Date Modified Username Field Change
2019-11-26 14:21 handrake0724 New Issue
2019-11-26 16:36 will Assigned To => will
2019-11-26 16:36 will Status new => resolved
2019-11-26 16:36 will Resolution open => fixed
2019-11-26 16:36 will Fixed in Version => dev
2019-11-26 16:36 will Note Added: 0010941