View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003397 | OpenFOAM | Bug | public | 2019-11-26 14:21 | 2019-11-26 16:36 |
Reporter | handrake0724 | Assigned To | will | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | dev | ||||
Fixed in Version | dev | ||||
Summary | 0003397: Airy wave makes an error when wave length is less than 2 | ||||
Description | in 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 ??:? | ||||
Tags | No tags attached. | ||||
|
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 |