CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] swak4Foam division by 0 error (https://www.cfd-online.com/Forums/openfoam-community-contributions/191174-swak4foam-division-0-error.html)

xuegy August 2, 2017 18:19

swak4Foam division by 0 error
 
Hello all,
I've compiled OpenFOAM v1706 and swak4Foam (https://github.com/Unofficial-Extend...pile_v17706%2B)

During the swak4Foam installation it gave me tons of could no open file * for source file * due to No such file or directory warnings but according to https://openfoamwiki.net/index.php/I...Error_Messages they can be ignored. And the compilation finished without errors, only warnings. However this is quite unusual since in my previous installation there's no warning.

OpenFOAM works, but swak4Foam doesn't. I applied a Robin BC:
Code:

        type groovyBC;
        variables "GT=snGrad(T);DT=8.1e-13;DC=4.4e-12;";
        valueExpression "0";
        gradientExpression "0";
        fractionExpression "1/(1+DC/(DT*GT*mag(delta())))";

but OpenFOAM gave me this error:
Code:

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#4  Foam::operator/(Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#5  parserPatch::PatchValueExpressionParser::parse() at ??:?
#6  Foam::PatchValueExpressionDriver::parseInternal(int) at ??:?
#7  Foam::CommonValueExpressionDriver::parse(Foam::exprString const&, Foam::word const&) at ??:?
#8  Foam::tmp<Foam::Field<double> > Foam::CommonValueExpressionDriver::evaluate<double>(Foam::exprString const&, bool) at ??:?
#9  Foam::groovyBCFvPatchField<double>::updateCoeffs() at ??:?
#10  Foam::fvMatrix<double>::fvMatrix(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) at ??:?
#11  Foam::tmp<Foam::fvMatrix<double> > Foam::fv::optionList::operator()<double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::word const&) at ??:?
#12  ? at ??:?
#13  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#14  ? at ??:?
Floating point exception (core dumped)

Which looks like a division by zero error.

I'm 100% sure my own solver and groovyBC is correct. It worked on OpenFOAM 4.1 with an earlier swak4Foam-dev (before 0.4.1 was released). I also tried OpenFOAM 4.1 with swak4Foam 0.4.1 and latest dev but they all gave the same error. So this should be an installation error.

wyldckat August 26, 2017 16:05

Quick answer: I don't if you've solved this problem or not.

If you haven't, please provide a simple test case where this boundary condition can be used, because this is very likely some specific internal initialization that works differently from the expected one from past OpenFOAM versions.


All times are GMT -4. The time now is 19:17.