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

[swak4Foam] and OF-2.2.1

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 8, 2013, 15:02
Default and OF-2.2.1
  #1
Member
 
India
Join Date: Oct 2012
Posts: 84
Rep Power: 13
mayank.dce2k7 is on a distinguished road
Hi Foamers,

I recently switched from OF-2.1.1 to OF-2.2.1. I installed swak4Foam it compiled fine which was checked by re-running ./Allwmake command which returned the list of libraries. Now I ran a simple steady state simulation using swak Data entry and encountered errors which were not there in OF-2.1.1.

Below is 0/U file: where I implemented swakDataEntry.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.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
{
    INLET
    {

       type            groovyBC;
       variables "r2=(pow(pos().x,2)+pow(pos().y,2));R2=sum(area())/pi;para=-((R2-r2)/R2)*normal();";
       valueExpression "2*0.0852*para"; //where 0.351 is the average velocity
       value        uniform (0 0 0);      
     
    }

    PART_1
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

    OUTLET1
    {

        type            flowRateInletVelocity;
        volumetricFlowRateExpression "0";
        volumetricFlowRate swak { 
            variables "phi1{INLET}=-0.502*sum(area())*0.0852;"; 
            expression "phi1"; // volume flow going out of domain from outlet 1 which 0.52 times that at inlet
            valueType patch;
            patchName OUTLET1;};

     value           uniform ( 0 0 0 );
    }

    OUTLET2
    {

       type            zeroGradient;
        
    }


}
Error message:

Create mesh for time = 0

Reading field p

Reading field U



--> FOAM FATAL IO ERROR:
keyword independentVariableName is undefined in dictionary ""

file: from line 47 to line 50.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 402.

FOAM exiting
mayank.dce2k7 is offline   Reply With Quote

Old   September 8, 2013, 18:03
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 mayank.dce2k7 View Post
Hi Foamers,

I recently switched from OF-2.1.1 to OF-2.2.1. I installed swak4Foam it compiled fine which was checked by re-running ./Allwmake command which returned the list of libraries. Now I ran a simple steady state simulation using swak Data entry and encountered errors which were not there in OF-2.1.1.

Below is 0/U file: where I implemented swakDataEntry.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.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
{
    INLET
    {

       type            groovyBC;
       variables "r2=(pow(pos().x,2)+pow(pos().y,2));R2=sum(area())/pi;para=-((R2-r2)/R2)*normal();";
       valueExpression "2*0.0852*para"; //where 0.351 is the average velocity
       value        uniform (0 0 0);      
     
    }

    PART_1
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

    OUTLET1
    {

        type            flowRateInletVelocity;
        volumetricFlowRateExpression "0";
        volumetricFlowRate swak { 
            variables "phi1{INLET}=-0.502*sum(area())*0.0852;"; 
            expression "phi1"; // volume flow going out of domain from outlet 1 which 0.52 times that at inlet
            valueType patch;
            patchName OUTLET1;};

     value           uniform ( 0 0 0 );
    }

    OUTLET2
    {

       type            zeroGradient;
        
    }


}
Error message:

Create mesh for time = 0

Reading field p

Reading field U



--> FOAM FATAL IO ERROR:
keyword independentVariableName is undefined in dictionary ""

file: from line 47 to line 50.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 402.

FOAM exiting
You probably also upgraded from an old swak to 0.2.4. To quote from the README there
Code:
**** =swakDataEntry= improved
     Two enhancements
     - the name of the independent variable  no can be
       specified. This variable holds the value that is passed to the
       data entry as a uniform value
     - data entry can now be integrated. This allows using it for
       instance for the injection rate in lagrangian models
the reference guide in the Documentation folder explains it
Code:
** Data entry
   The main library introduces a subtype of =DataEntry= that is
   selected under the name =swak= wherever data entries lie
   =constant=, =polynomial= etc are used. After that a dictionary with
   additional parameters is required. An example entry would look
   like this:
: flowRateProfile swak {
:     expression "exp(-t)";
:     independentVariableName t;
:     valueType patch;
:     patchName top;
:     integrationIntervalls 100;
: };
   Required entries in the dictionary are
   - expression :: the expression to be evaluated
   - independentVariableName :: the name of the independent variable
        that was passed during evaluation (usually this is the time)
   - valueType :: this determines the type of parser that is
                  used. Additional parameters for the initialization
                  may be needed and the usual entries like
                  =variables= are of course possible
   Only for integrations an additional parameter is needed
   - integrationIntervalls :: number of intervals the integration
        range is divided into.
The day when people start reading these file ...
__________________
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



All times are GMT -4. The time now is 11:52.