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

groovyBC coupling two boundaries

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By philippose

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 21, 2018, 06:36
Default groovyBC coupling two boundaries
  #1
Member
 
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10
Mehdi3031 is on a distinguished road
Hello Forum!
I am trying to couple two boundaries in OF using grooviBC meaning that I want the flux that gets out of bundary "gasOut" to come back in from boundary "Center", I tried to dublicate what is written here:
http://openfoamwiki.net/index.php/Contrib/groovyBC
as following:


Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    walls
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    liqout
    {
        type            inletOutlet;
        inletValue      uniform (0 0 0);
        value           uniform (0 0 0);
    }
    liqin
    {
        type            flowRateInletVelocity;
        massFlowRate    constant 0.00020964;
        value           uniform (0 0 0);
    }
    gasout
    {
        type            inletOutlet;
        inletValue      uniform (0 0 0);
        value           uniform (0 0 0);
    }
    gasin
    {
    type            flowRateInletVelocity;
        massFlowRate    constant 3.74429e-05;
        value           uniform (0 0 0);
    }

    center
    {
       type            groovyBC;
       variables       "Q_gas@gasout=-1*sum(phi);Q_center=sum(phi);U_relax=0.3;";
       valueExpression "(Q_center + U_relax*(Q_gas - Q_center))/sum(mag(Sf()))*normal()";
       fractionExpression "1";
       value           $internalField;
    }
    side1
    {
        type            cyclicAMI;
    }
    side2
    {
        type            cyclicAMI;
    }
}


// ************************************************************************* //
But I get the following error:


--> FOAM FATAL ERROR:
Parser Error for driver PatchValueExpressionDriver at "1.22-26" :"field Q_gas not existing or of wrong type"
"(Q_center + U_relax*(Q_gas - Q_center))/sum(mag(Sf()))*normal()"
^^^^^
-----------------------|

Context of the error:


- From dictionary: /home/mehdi/OpenFOAM/mehdi-3.0.1/run/CFD2018/cavityTestQ/0/U.boundaryField.center
Evaluating expression "(Q_center + U_relax*(Q_gas - Q_center))/sum(mag(Sf()))*normal()"


From function parsingValue
in file lnInclude/CommonValueExpressionDriverI.H at line 1210.

FOAM exiting

seems that OF doesn't understand the Q_gas@gasout in my groovy boundary condition...

Any help is appreciated in advance. Thanks

Mehdi3031 is offline   Reply With Quote

Old   September 25, 2018, 05:18
Default Still hanging there
  #2
Member
 
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10
Mehdi3031 is on a distinguished road
Anyone out there ?!
Mehdi3031 is offline   Reply With Quote

Old   September 25, 2018, 07:59
Default
  #3
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hi there,
A Good day to you.

You have a syntax error in your sepcification of the "variables"... try this out..:

Code:
    center
    {
       type            groovyBC;
       variables 
       (
          "Q_gas{patch'gasout}=-1*sum(phi);"
          "Q_center=sum(phi);"
          "U_relax=0.3;"
       );
       valueExpression "(Q_center + U_relax*(Q_gas - Q_center))/sum(mag(Sf()))*normal()";
       fractionExpression "1";
       value           $internalField;
    }
Regards,
Philippose
Mehdi3031 likes this.
philippose is offline   Reply With Quote

Old   September 27, 2018, 04:51
Default Many Thanks
  #4
Member
 
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10
Mehdi3031 is on a distinguished road
Quote:
Originally Posted by philippose View Post
Hi there,
A Good day to you.

You have a syntax error in your sepcification of the "variables"... try this out..:

Code:
    center
    {
       type            groovyBC;
       variables 
       (
          "Q_gas{patch'gasout}=-1*sum(phi);"
          "Q_center=sum(phi);"
          "U_relax=0.3;"
       );
       valueExpression "(Q_center + U_relax*(Q_gas - Q_center))/sum(mag(Sf()))*normal()";
       fractionExpression "1";
       value           $internalField;
    }
Regards,
Philippose

Dear Philippose,
I tried it and it worked!! Thank you so much for your time and care. But it is very strange to me since I exactly used the syntax that was on the official website of groovy !!

Thank you so much again...
Have a lovely day
Mehdi3031 is offline   Reply With Quote

Reply


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] Change in alpha and U with groovyBC in twoPhaseEulerFoam dani2702 OpenFOAM Community Contributions 0 November 17, 2016 04:30
Difference between stagger/coupling iteration and coupling step Jiricbeng CFX 1 September 13, 2016 03:37
Coupling time duration, Coupling time steps Jiricbeng CFX 0 April 29, 2015 09:37
[swak4Foam] groovyBC for coupling of patches deniggo OpenFOAM Community Contributions 20 October 2, 2014 19:04
[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 03:27.