CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

GroovyBC gradientExpression issues

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2021, 05:14
Red face GroovyBC gradientExpression issues
  #1
New Member
 
Aurelien
Join Date: Mar 2021
Posts: 1
Rep Power: 0
Aurel65460 is on a distinguished road
Dear all,

I am a beginner in OpenFoam simulation and i want to model heat transfer problem with laplacianFoam solver.

The geometry is pretty easy : a 3D rectangle of an uniform material with radiation and convection on every faces.
On the top face, the convection coefficient is considered as a gaussian function of space varying along the simulation. To do that i want to use the GroovyBC function.

My T file is :

Code:
dimensions      [0 0 0 1 0 0 0];

internalField   uniform 300;

boundaryField
{
    inlet
    {
        type           	groovyBC; 
        variables 		"k=16;sigma=5.67e-8;E=0.7;Tinf=300;Tfluid=700;A=6600;sig=0.07;hamb=3300;x0=0.165;y0=0.2;x=pos().x;y=pos().y;h=hamb+A*exp(-(pow((x-x0),2)/(2*pow(sig,2))+pow((y-y0),2)/(2*pow(sig,2))));";
        gradientExpression 	"(h/k)*(Tfluid-T)+(sigma/k)*E*(pow(Tinf,4)-pow(T,4))";
        fractionExpression 	"0";	
    }
    outlet
    {
        type           	groovyBC;
        variables 		"h=20;k=16;sigma=5.67e-8;E=0.7;Tinf=300;";
        gradientExpression 	"h/k*(Tinf-T)+(sigma/k)*E*(pow(Tinf,4)-pow(T,4))";
        fractionExpression 	"0";
    }
    upperWallAndLowerWall
    {
    	type           	groovyBC;
        variables 		"h=20;k=16;sigma=5.67e-8;E=0.7;Tinf=300;";
        gradientExpression 	"h/k*(Tinf-T)+(sigma/k)*E*(pow(Tinf,4)-pow(T,4))";
        fractionExpression 	"0";
    }
    frontAndBack
    {
        type           	groovyBC;
        variables 		"h=20;k=16;sigma=5.67e-8;E=0.7;Tinf=300;";
        gradientExpression 	"h/k*(Tinf-T)+(sigma/k)*E*(pow(Tinf,4)-pow(T,4))";
        fractionExpression 	"0";
    }
}
When i run the simulation, at a time step (depending of the values), i have the following error :

Code:
Time = 1

DICPCG:  Solving for T, Initial residual = 1, Final residual = 8.46407e-07, No Iterations 29
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3  ? in "/lib/x86_64-linux-gnu/libm.so.6"
#4  powf64 in "/lib/x86_64-linux-gnu/libm.so.6"
#5  Foam::pow(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#6  Foam::pow(Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#7  parserPatch::PatchValueExpressionParser::parse() at ??:?
#8  Foam::PatchValueExpressionDriver::parseInternal(int) at ??:?
#9  Foam::CommonValueExpressionDriver::parse(Foam::exprString const&, Foam::word const&) at ??:?
#10  Foam::tmp<Foam::Field<double> > Foam::CommonValueExpressionDriver::evaluate<double>(Foam::exprString const&, bool) at ??:?
#11  Foam::groovyBCFvPatchField<double>::updateCoeffs() at ??:?
#12  Foam::fvMatrix<double>::fvMatrix(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/laplacianFoam"
#13  ? in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/laplacianFoam"
#14  ? in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/laplacianFoam"
#15  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#16  ? in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/laplacianFoam"
Exception en point flottant (core dumped)
I know this error can occur when there is a division by 0 or wrong utilisation of mathematical function but i don t which one can be.

In a previous version, the inlet condition was given by an external table using " gradient nonuniform $fluxProfile; " and it worked well. I conclued the error is coming from inlet condition. In addition, if i remplace h by a constant in the variables definition (for exemple ...;h=2000;", simulation is running and results look fine.

Overall i suppose the error come from how i wrote the gaussian function but i don t understand why.

If anyone have an idea or can help me, I would be very grateful.

Aurélien
Aurel65460 is offline   Reply With Quote

Reply

Tags
exception, floating, gradientexpression, groovybc


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] CyclicAMI, groovyBC issues sherifkadry OpenFOAM Community Contributions 21 January 14, 2021 12:43
[swak4Foam] groovyBC for oscillatory flow liybzd OpenFOAM Community Contributions 5 November 12, 2018 08:53
[swak4Foam] Boundary condition with a non-uniform gradient - groovyBC? STiss OpenFOAM Community Contributions 3 October 11, 2013 03:04
[swak4Foam] groovyBC: using gradientExpression instead of valueExpression gregdB OpenFOAM Community Contributions 15 September 20, 2013 09:03
[swak4Foam] settings a gradient on boundary using groovyBC gfilip OpenFOAM Community Contributions 6 May 4, 2012 10:41


All times are GMT -4. The time now is 12:50.