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

[swak4Foam] Trouble setting groovyBC interFoam Inlet BC

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gschaider

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   June 30, 2012, 14:37
Default Trouble setting groovyBC interFoam Inlet BC
  #1
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16
mgdenno is on a distinguished road
Hello,

As indicated in the post title, I am trying to use groovyBC to set the inlet boundary condition for a interFoam simulation. I am using OpenFOAM 2.1.0 running on kubuntu 11.10. The attached picture (colored as p_rgh) shows a 2D view of the problem which is flow in a channel over a spillway. The inlet is on the right, the outlet is on the left, top is atmosphere, bottom is wall, and front and back are symmetry plane. Historically I have split my inlet patch into 2 separate patches, one for air and one for water. I was hoping that I would be able to use groovyBC to accomplish the same thing with one patch so that I can change the inlet water level without changing my mesh. Anyway, the simulation seems to run ok, and the water surface looks ok (although I haven't compared to physical model data yet), but the pressure at the inlet seems to be funky. You can see in the picture that the p_rgh is 0 at the inlet, and p (not shown) has a significant negative pressure at the inlet.

This seems incorrect to me. Can anyone provide any insight regarding what is happening? Are my boundary conditions (below) specified incorrectly?

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

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

internalField   uniform 0;

boundaryField
{
    top
    {
        type            totalPressure;
        p0              uniform 0;
        U               U;
        phi             phi;
        rho             rho;
        psi             none;
        gamma           1;
        value           uniform 0;
    }
    bottom
    {
        type            buoyantPressure;
        value           uniform 0;
    }
    inlet
    {
        type            buoyantPressure;
        value           uniform 0;
    }
    outlet
    {
       type            totalPressure;
       p0              uniform 0;
       U               U;
       phi             phi;
       rho             rho;
       psi             none;
       gamma           1;
       value           uniform 0;
    }
    walls
    {
        type            symmetryPlane;
    }
    wes
    {
        type            buoyantPressure;
        value           uniform 0;
    }
}

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

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    top
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
    bottom
    {
        type            zeroGradient;
    }
    inlet
    {
       type             groovyBC;
       valueExpression "1";
       fractionExpression "(pos().z<28) ? 1 : 0";
       value            uniform 1;
    }
    outlet
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
    walls
    {
        type            symmetryPlane;
    }
    wes
    {
        type            zeroGradient;
    }
}

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

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

internalField   uniform (0 0 0);

boundaryField
{
    top
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
    bottom
    {
        type            slip;
    }
    inlet
    {
       type            groovyBC;
       valueExpression "(pos().z<28) ? vector(1.981,0,0) : vector(0,0,0)";
       value           uniform (0 0 0);
    }
    outlet
    {
        type            inletOutlet;
        inletValue      uniform (0 0 0);
        value           uniform (0 0 0);
    }
    walls
    {
        type            symmetryPlane;
    }
    wes
    {
        type            slip;
    }
}


// ************************************************************************* //
Thanks in advance. I look forward to your input.
Attached Images
File Type: jpg overview.jpg (37.1 KB, 125 views)
mgdenno 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
interFoam vs. simpleFoam channel flow comparison DanM OpenFOAM Running, Solving & CFD 12 January 31, 2020 15:26
interFoam (HELYX-OS) pressure boundary conditions SFr OpenFOAM Running, Solving & CFD 8 June 23, 2016 16:36
problem with inlet BC setting Tanjina Fluent Multiphase 4 July 1, 2013 13:06
[swak4Foam] Scale discrete inlet velocity profile with groovyBC cboss OpenFOAM Community Contributions 1 June 20, 2010 13:02
Warning 097- AB Siemens 6 November 15, 2004 04:41


All times are GMT -4. The time now is 00:59.