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

[swak4Foam] GroovyBC doesn't read variables and Expression

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Nicole
  • 1 Post By Nicole

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   November 17, 2015, 03:52
Default GroovyBC doesn't read variables and Expression
  #1
New Member
 
seyyed
Join Date: Jun 2014
Posts: 7
Rep Power: 11
S.M.H is on a distinguished road
hi
i changed buoyantBoussinesqSimpleFoam and add a heat source to it
Code:
fvScalarMatrix TEqn
    (
        fvm::div(phi, T)
      - fvm::Sp(fvc::div(phi), T)
      - fvm::laplacian(kappaEff, T)
      == Qt
     
    );
then i changed createFields.H to read Qt from 0 file
Code:
 Info<< "Reading field Qt\n" << endl;
    volScalarField Qt
    (
        IOobject
        (
            "Qt",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );
now i want that Qt in 0 file change with groovyBC in each iteration

Code:
type            groovyBC;
     variables   "Tzone{cellZone'poool}=average(T);Uzone{cellZone'poool}=average(mag(U));q=(((0.0888+(0.0783*Uzone))*((3363)-((0.6)*((exp((20.386)-((5132)/(Tzone))))*(133.3224)))))/(31.2));";
        
        valueExpression  "297.15";
        gradientExpression "-q"; 
        fractionExpression "1";
        value       uniform 297.15 ;
i used this expression in boundry file T, too
but in the results groovyBC calculated expression in T but in Qt all values set to 0
result for T :
Code:
 {
        type            groovyBC;
        refValue        uniform 297.15;
        refGradient     uniform -3.57777;
        valueFraction   uniform 1;
        value           uniform 297.15;
        valueExpression "297.15";
        gradientExpression "-q";
        fractionExpression "1";
        evaluateDuringConstruction 0;
        variables       "Tzone{cellZone'poool}=average(T);Uzone{cellZone'poool}=average(mag(U));q=(((0.0888+(0.0783*Uzone))*((3363)-((0.6)*((exp((20.386)-((5132)/(Tzone))))*(133.3224)))))/(31.2));";
        timelines       (
);
        lookuptables    (
);
    }
result for Qt:
Code:
{
        type            groovyBC;
        refValue        uniform 0;
        refGradient     uniform 0;
        valueFraction   uniform 1;
        value           uniform 297.15;
        valueExpression "297.15";
        gradientExpression "-q";
        fractionExpression "1";
        evaluateDuringConstruction 0;
        variables       "Tzone{cellZone'poool}=average(T);Uzone{cellZone'poool}=average(mag(U));q=(((0.0888+(0.0783*Uzone))*((3363)-((0.6)*((exp((20.386)-((5132)/(Tzone))))*(133.3224)))))/(31.2));";
        timelines       (
);
        lookuptables    (
);
    }
then i noticed that if i add a semicolon or a braket in variables and make a syntax error code compile without any errors that means code doesn't read groovyBC variables and Expression

any suggestion?

thanks
S.M.H is offline   Reply With Quote

 


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] How to define boundary condition variables by using previosly defined variables? pawlo OpenFOAM Community Contributions 8 September 13, 2020 11:37
[swak4Foam] access field variables in groovyBC mehtab OpenFOAM Community Contributions 11 February 4, 2019 12:08
[swak4Foam] Error using groovyBC - 'parser error for expression driver' odellar OpenFOAM Community Contributions 4 September 21, 2015 11:51
Something doens't work with wallHeatFlux utility or externalWallHeatFluxTemperat BC!! zfaraday OpenFOAM Post-Processing 0 February 5, 2015 16:47
cfx expression variables Manoj Kumar CFX 2 February 16, 2006 10:03


All times are GMT -4. The time now is 10:20.