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

[swak4Foam] groovyBC elevated inlet. pos() issue

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 22, 2011, 07:37
Default groovyBC elevated inlet. pos() issue
  #1
Member
 
Join Date: Nov 2010
Posts: 41
Rep Power: 15
grjmell is on a distinguished road
I've got an issue with groovyBC. It makes my run crash instantly. I'm using twoPhaseEulerFoam and I have an elevated inlet (see pic), the inlet is above a wall. I want to put a logarithmic velocity profile onto that inlet. I've implemented it in groovy heres the code.

Code:
    myinlet
    {
        type            groovyBC;
        variables      "u_f=0.0239;z0=0.0000333;K=0.41;vel=(u_f/K)*log((pos().z)/z0)*normal();";
        valueExpression "-vel";
    }

This works, if the inlet goes from the bottom to the top, however it seems that when it is elevated then there is an issue with pos().z, it makes my run crash instantly with this error. When i take pos().z out, it works again, so it is not a problem with groovyBC as such. I know i need to account for pos().z not starting at zero for my profile but it should nevertheless work?


Code:
Starting time loop

Courant Number mean: 0 max: 0
Max Ur Courant Number = 0
deltaT = 0.000598802
Reading/calculating field UaMean

Reading/calculating field UbMean

Reading/calculating field alphaMean

Reading/calculating field pMean

fieldAverage: starting averaging at time 0

Time = 0.000598802

DILUPBiCG:  Solving for alpha, Initial residual = 1.48592e-17, Final residual = 1.48592e-17, No Iterations 0
Dispersed phase volume fraction = 0.135285  Min(alpha) = 0  Max(alpha) = 0.6
DILUPBiCG:  Solving for alpha, Initial residual = 1.48592e-17, Final residual = 1.48592e-17, No Iterations 0
Dispersed phase volume fraction = 0.135285  Min(alpha) = 0  Max(alpha) = 0.6
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam171/lib/linux64GccDPOpt/libOpenFOAM.so"
#1  Foam::sigFpe::sigFpeHandler(int) in "/opt/openfoam171/lib/linux64GccDPOpt/libOpenFOAM.so"
#2   in "/lib/libc.so.6"
#3   in "/lib/libm.so.6"
#4  log in "/lib/libm.so.6"
#5  Foam::log(Foam::Field<double>&, Foam::UList<double> const&) in "/opt/openfoam171/lib/linux64GccDPOpt/libOpenFOAM.so"
#6  Foam::log(Foam::UList<double> const&) in "/opt/openfoam171/lib/linux64GccDPOpt/libOpenFOAM.so"
#7  parserPatch::PatchValueExpressionParser::parse() in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libswak4FoamParsers.so"
#8  Foam::PatchValueExpressionDriver::parse(std::string const&) in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libswak4FoamParsers.so"
#9  Foam::CommonValueExpressionDriver::evaluateVariable(Foam::word const&, Foam::string const&) in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libswak4FoamParsers.so"
#10  Foam::CommonValueExpressionDriver::addVariables(Foam::string const&, bool) in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libswak4FoamParsers.so"
#11  Foam::CommonValueExpressionDriver::addVariables(Foam::List<Foam::string> const&, bool) in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libswak4FoamParsers.so"
#12  Foam::groovyBCFvPatchField<Foam::Vector<double> >::updateCoeffs() in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libgroovyBC.so"
#13  Foam::fvMatrix<Foam::Vector<double> >::fvMatrix(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&, Foam::dimensionSet const&) in "/opt/openfoam171/applications/bin/linux64GccDPOpt/twoPhaseEulerFoam"
#14  
 in "/opt/openfoam171/applications/bin/linux64GccDPOpt/twoPhaseEulerFoam"
#15  __libc_start_main in "/lib/libc.so.6"
#16  
 in "/opt/openfoam171/applications/bin/linux64GccDPOpt/twoPhaseEulerFoam"
Floating point exception
Attached Images
File Type: jpg mesh.jpg (66.7 KB, 44 views)
grjmell is offline   Reply With Quote

Old   June 23, 2011, 00:11
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 grjmell View Post
I've got an issue with groovyBC. It makes my run crash instantly. I'm using twoPhaseEulerFoam and I have an elevated inlet (see pic), the inlet is above a wall. I want to put a logarithmic velocity profile onto that inlet. I've implemented it in groovy heres the code.

Code:
    myinlet
    {
        type            groovyBC;
        variables      "u_f=0.0239;z0=0.0000333;K=0.41;vel=(u_f/K)*log((pos().z)/z0)*normal();";
        valueExpression "-vel";
    }

This works, if the inlet goes from the bottom to the top, however it seems that when it is elevated then there is an issue with pos().z, it makes my run crash instantly with this error. When i take pos().z out, it works again, so it is not a problem with groovyBC as such. I know i need to account for pos().z not starting at zero for my profile but it should nevertheless work?
If pos().z<=0 anywhere, then it will fail (unless you unset FOAM_SIGFPE - then you will get NaN in these places - also not a good solution)
gschaider is offline   Reply With Quote

Old   June 23, 2011, 04:53
Default
  #3
Member
 
Join Date: Nov 2010
Posts: 41
Rep Power: 15
grjmell is on a distinguished road
Thanks Bernhard. I get it.
grjmell is offline   Reply With Quote

Old   January 23, 2013, 07:56
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
dear bernhard
How can i unset FOAM_SIGFPE to find where NANs are occuring?
Thanks.
immortality is offline   Reply With Quote

Old   January 23, 2013, 08:02
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
another question occured! At my case that is similar to what Greg said i have set pos().y=0 at starting.i don't figure out it.does it have any problem?why?
immortality is offline   Reply With Quote

Old   January 23, 2013, 09:11
Default
  #6
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 immortality View Post
dear bernhard
How can i unset FOAM_SIGFPE to find where NANs are occuring?
Thanks.
The answer is in your question:

unset FOAM_SIGFPE

But that only makes the solver run and calculate garbage. Doubt that this will help you much
__________________
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   January 23, 2013, 09:14
Default
  #7
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 immortality View Post
another question occured! At my case that is similar to what Greg said i have set pos().y=0 at starting.i don't figure out it.does it have any problem?why?
PLEASE be more specific. One can only GUESS what you mean. Of course pos().y==0 can be a problem. For instance if you calculate the logarithm of it
__________________
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

Reply

Tags
groovybc, twophaseeulerfoam


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
Pressure Inlet VS velocity Inlet difference Mohsin FLUENT 9 January 4, 2021 11:34
Problem with assigned inlet velocity profile as a boundary condition Ozgur_ FLUENT 5 August 25, 2015 05:58
[swak4Foam] groovyBC interFoam splitted inlet -- massflowrate FerdiFuchs OpenFOAM Community Contributions 1 October 1, 2014 08:51
Mass flow inlet and pressure outlet issue nikhil FLUENT 5 December 11, 2013 13:30
[swak4Foam] groovyBC, coupling inlet with velocity at specific point location olivierG OpenFOAM Community Contributions 6 June 23, 2012 09:44


All times are GMT -4. The time now is 23:28.