CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] problem with groovyBC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 28, 2013, 14:42
Default problem with groovyBC
  #1
Senior Member
 
Join Date: Mar 2010
Posts: 173
Rep Power: 17
Jonathan is on a distinguished road
hi guys,

i was hoping someone could give me a hand with the following issue i am having with groovyBC???

below is my groovy "code":

Code:
    INLET
    {
    //type        fixedValue;
    //value        uniform (0 0 21.38);
        type            groovyBC;

    lookuptables (
    {
        name z_velocity;
        outOfBounds clamp;
        fileName "$FOAM_CASE/rel_z_velocity";
    }
    {
        name y_velocity;
        outOfBounds clamp;
        fileName "$FOAM_CASE/rel_y_velocity";
    }
    {
        name x_velocity;
        outOfBounds clamp;
        fileName "$FOAM_CASE/rel_x_velocity";
    }
    );

    variables    "radius=sqrt(pow(pos().x,2) + pow(pos().y,2));theta=asin(mag(pos().x/pos().y));";
    valueExpression    "vector(x_velocity(radius)*sin(theta),y_velocity(radius),z_velocity(radius))";
        value        uniform (0 0 0);
    }
and this is the error message i am getting!

Code:
#0  Foam::error::printStack(Foam::Ostream&) in "/home/jonathan/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/home/jonathan/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  asin in "/lib/x86_64-linux-gnu/libm.so.6"
#4  Foam::asin(Foam::Field<double>&, Foam::UList<double> const&) in "/home/jonathan/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5  Foam::asin(Foam::UList<double> const&) in "/home/jonathan/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#6  parserPatch::PatchValueExpressionParser::parse() in "/home/jonathan/OpenFOAM/jonathan-2.1.1/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#7  Foam::PatchValueExpressionDriver::parse(std::string const&) in "/home/jonathan/OpenFOAM/jonathan-2.1.1/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#8  Foam::CommonValueExpressionDriver::evaluateVariable(Foam::word const&, Foam::string const&) in "/home/jonathan/OpenFOAM/jonathan-2.1.1/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#9  Foam::CommonValueExpressionDriver::addVariables(Foam::string const&, bool) in "/home/jonathan/OpenFOAM/jonathan-2.1.1/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#10  Foam::CommonValueExpressionDriver::addVariables(Foam::List<Foam::string> const&, bool) in "/home/jonathan/OpenFOAM/jonathan-2.1.1/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#11  Foam::CommonValueExpressionDriver::clearVariables() in "/home/jonathan/OpenFOAM/jonathan-2.1.1/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#12  Foam::groovyBCFvPatchField<Foam::Vector<double> >::updateCoeffs() in "/home/jonathan/OpenFOAM/jonathan-2.1.1/platforms/linux64GccDPOpt/lib/libgroovyBC.so"
#13  Foam::fvMatrix<Foam::Vector<double> >::fvMatrix(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) in "/home/jonathan/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/SRFSimpleFoam"
#14  
 at SRFSimpleFoam.C:0
#15  
 in "/home/jonathan/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/SRFSimpleFoam"
#16  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#17  
 in "/home/jonathan/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/SRFSimpleFoam"
Floating point exception (core dumped)
Any ideas???

many thanks in advance,
best regards
jon
Jonathan is offline   Reply With Quote

Old   August 28, 2013, 14:56
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Jonathan View Post
hi guys,

i was hoping someone could give me a hand with the following issue i am having with groovyBC???

below is my groovy "code":

Code:
<snip>

    variables    "radius=sqrt(pow(pos().x,2) + pow(pos().y,2));theta=asin(mag(pos().x/pos().y));";
    valueExpression    "vector(x_velocity(radius)*sin(theta),y_velocity(radius),z_velocity(radius))";
        value        uniform (0 0 0);
    }
and this is the error message i am getting!

Code:
#0  Foam::error::printStack(Foam::Ostream&) in "/home/jonathan/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/home/jonathan/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  asin in "/lib/x86_64-linux-gnu/libm.so.6"
#4  Foam::asin(Foam::Field<double>&, Foam::UList<double> const&) in "/home/jonathan/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5  Foam::asin(Foam::UList<double> const&) in "/home/jonathan/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#6  parserPatch::PatchValueExpressionParser::parse() in "/home/jonathan/OpenFOAM/jonathan-2.1.1/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"

<snip>

Floating point exception (core dumped)
Any ideas???

many thanks in advance,
best regards
jon
Let me quote from the man-page of asin:
Code:
asin(x) returns a NAN and raises the "invalid" floating-point exception for |x| > 1.
groovyBC does not check whether you use the functions correctly. Probably your |x/y|>1
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   September 3, 2013, 14:50
Default thanks
  #3
Senior Member
 
Join Date: Mar 2010
Posts: 173
Rep Power: 17
Jonathan is on a distinguished road
hi Bernhard,

yes thanks - that was it. i had a asin instead of an atan which was a pretty dumb mistake, and was throwing me off

thanks for your help + a great tool,

best regards
jonathan
Jonathan is offline   Reply With Quote

Reply

Tags
groovybc, swak4foam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] reactingMultiPhaseEulerFoam problems with groovyBC zanilu70 OpenFOAM Community Contributions 4 December 13, 2016 06:46
Fluent Parallelization Problem After AC Power Dropped pawl Hardware 5 November 13, 2016 06:08
[swak4Foam] epsilon groovyBC problem Thom OpenFOAM Community Contributions 5 October 26, 2012 05:16
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13


All times are GMT -4. The time now is 05:07.