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

Correct interFoam outlet BCs

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 25, 2024, 00:47
Default Correct interFoam outlet BCs
  #1
New Member
 
Jahir Bahena
Join Date: Feb 2024
Location: Mexico
Posts: 6
Rep Power: 2
Jahir is on a distinguished road
Hello.


As you all know, the implementation of cases that go beyond what the tutorials offer is a bit complicated sometimes. I started using interFoam last year and it's mostly worked out well, but I'm not sure I'm using the boundary condition my model requires.


In short, I'd like to know if this is the best way to approach outlets that are open to both fluids (n \cdot T = nP_{atm}). This are the files contained in the 0 directory:


alpha.water

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 1;
    }

    walls
    {
        type            zeroGradient;
    }

    outlet
    {
        type            zeroGradient;
        value           uniform 0;
    }

    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
}

// ************************************************************************* //

U
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     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            flowRateInletVelocity;
        volumetricFlowRate constant 10.7;
    }

    walls
    {
        type            noSlip;
    }

    atmosphere
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }

    outlet
    {
        type            inletOutlet;
        inletValue      uniform (0 0 0);
        value           $internalField;
    }
}


// ************************************************************************* //

p_rgh
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     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
{
    atmosphere
    {
        type            totalPressure;
        p0              uniform 0;
    }

    ".*"
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }
}

// ************************************************************************* //

I tried with totalPressure for the p_rgh condition at the outlets but it crashed. Since my goemetry is too big I can't say for certain that these are wrong, but I'm not sure these are the best BCs I could use for my simulation. I also checked the veolcities (and volumetric flows) at these boundaries and I think the values are too small.


Thank you very much in advance!
Jahir is offline   Reply With Quote

Old   April 26, 2024, 03:49
Default
  #2
Senior Member
 
Join Date: Dec 2021
Posts: 216
Rep Power: 5
Alczem is on a distinguished road
Hey,


What are you trying to simulate? An open channel? Can you share a picture of your geometry?
Alczem is offline   Reply With Quote

Old   April 26, 2024, 10:11
Default
  #3
New Member
 
Jahir Bahena
Join Date: Feb 2024
Location: Mexico
Posts: 6
Rep Power: 2
Jahir is on a distinguished road
Quote:
Originally Posted by Alczem View Post
Hey,


What are you trying to simulate? An open channel? Can you share a picture of your geometry?

It's a tank meant for separating water and sediment. To the left is the inlet and there are 4 outlets that are on the right side.
Attached Images
File Type: jpg desare.jpg (32.1 KB, 7 views)
Jahir is offline   Reply With Quote

Old   April 29, 2024, 05:40
Default
  #4
Senior Member
 
Join Date: Dec 2021
Posts: 216
Rep Power: 5
Alczem is on a distinguished road
Hey,


My usual setup for this kind of simulation is the following:


  • Initialise the water field with setFields at the proper height
  • Add a hRef file in constant/ with the height corresponding to the water level
  • For alpha.water and U at the inlet, use variableHeightFlowRate and variableHeightFlowRateInletVelocity
  • For the outlets, inletOutlet and pressureInletOutletVelocity are ok
  • totalPressure should work at the outlets
This usually works for my cases. hRef is necessary if your water level is different from z=0m. It represents the waterlevel outside the domain (= beyond the outlet, there is still water and not void) if that makes sense, and prevents the water from "falling" at the outlet.
Alczem 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
Incorrect pressure results and problems with outlet BC's jdw135 OpenFOAM 0 December 9, 2020 09:16
[isoAdvector] Correct isoAdvector/interIsoFoam/InterFoam BCs schf OpenFOAM Community Contributions 6 February 6, 2019 10:09
interFoam BC partially submerged outlet potac OpenFOAM Running, Solving & CFD 0 November 30, 2017 12:54
interFoam BC's jakitsch OpenFOAM Running, Solving & CFD 1 November 17, 2015 20:09
define BCs at inlet and outlet for natural ventilation simulation jjz2013 Main CFD Forum 0 January 29, 2013 15:50


All times are GMT -4. The time now is 17:08.