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

Two-Phase Inlet Velocities

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2015, 04:57
Default Two-Phase Inlet Velocities [solved]
  #1
New Member
 
Join Date: Sep 2015
Posts: 4
Rep Power: 10
ninnghazad is on a distinguished road
Hello,
i am trying to simulate two-phase flow coming from a set of large pipes, flowing through a number of interconnected chambers and pipes, and exiting through another pipe. there are some open boundaries through which air can enter and exit. i am using interFoam based on the multiphase/interFoam/ras examples. while it is super slow (~7s per 24h walltime on 12 cores), it works, as long as i use alpha=1 on the inlets.

now i want to adjust inlet conditions. i know how much water goes in and how fast it is. the first thing i tried was to adjust alpha and just set fixedValue velocities for my inlets and check the flow using functionObjects.

while that results in the right amount of water, it pushes way to much air into the system, resulting in very high velocities (air) and an even slower simulation. also the spraying of a mixture is just not what i need.

what i want is a nice stream of water on the bottom of my inlets and just a bit of air above that.
now i know i could split the inlet patches while meshing and set them up as two individual boundaries - but as i have a set of different inflows i would like to try, that would mean making a whole bunch of models in blender and having to snappyhexmesh them all. redoing the process every time i think of another inflow to test.

is there a better way? can i specify per phase velocities on the same inlet patch? any scriptable way?

Last edited by ninnghazad; September 25, 2015 at 11:16.
ninnghazad is offline   Reply With Quote

Old   September 25, 2015, 05:49
Default Progress, but no success
  #2
New Member
 
Join Date: Sep 2015
Posts: 4
Rep Power: 10
ninnghazad is on a distinguished road
so i found funkySetBoundaryFields, and it seems to be just what i need. but i still have some problems with it. while i am able to set alpha nicely, the velocities i try to set the same way get ignored. this is my funkySetBoundaryDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object funkySetBoundaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

velocities {
    field U;
    expressions
    (
        {
            target value;
            patchName "inlet_0";
            expression "(pos().z<=2.639655604) ? -11.99 : 0";
        }

        {
            target value;
            patchName "inlet_1";
            expression "(pos().z<=2.71130699) ? -9.84 : 0";
        }

    );
}

alpha {
    field alpha.water;
    expressions
    (
        {
            target value;
            patchName "inlet_0";
            expression "(pos().z<=2.639655604) ? 1 : 0";
        }

        {
            target value;
            patchName "inlet_1";
            expression "(pos().z<=2.71130699) ? 1 : 0";
        }

    );
}
i'm not sure, but i think this may be because alpha is a scalar field while U is a vector field. i want to set a velocity normal to the patch pointing inwards.
so i looked at the examples that came with swak4Foam and saw this in funkySetBoundaryDict.dambreak:
Code:
expression "(pos().y<thres) ? vector(1,0,0)*(maxY-pos().y) : vector(0,0,0)";
k, it sets a vector based on position, which is what i want to do. but now my patches are rotated, and i would like to have the normal calculated for me. so i don't run into troubles when changing the mesh and forgetting to adapt the dict by hand mainly. can someone give a push in the right direction?

edit: i found out about normal() funkySetBoundaryDict syntax, but still only alpha gets set, U won't change...

Last edited by ninnghazad; September 25, 2015 at 08:45.
ninnghazad is offline   Reply With Quote

Old   September 25, 2015, 11:16
Default
  #3
New Member
 
Join Date: Sep 2015
Posts: 4
Rep Power: 10
ninnghazad is on a distinguished road
wohoo! it works!
the problem was my 0/U, i still had remnants of old tries in there, but as i fixed my inlets to look like this:
Code:
    inlet_0
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
and set up my funky expression like this:
Code:
expression "(pos().z<=2.639655604) ? normal()*-11.99 : vector(0,0,0)";
i got a nice stream of water on the bottom of my pipes.

out of interest i also tried it with
Code:
expression "(pos().z<=2.639655604) ? -11.99 : 0";
and using surfaceNormalFixedValue in 0/U which works just as well. in that case use
Code:
target refValue;
in funkySetBoundaryDict.
ninnghazad 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
VOF Inlet condition Rizwan FLUENT 15 July 5, 2018 16:33
Wrong velocities at first cell of velocity inlet boundaries Bahram OpenFOAM Bugs 9 September 24, 2015 10:52
iteration questions in discrete phase iknowjesus FLUENT 4 March 13, 2015 06:07
Three Phase flow into a reservoir... akjha Main CFD Forum 0 December 15, 2014 07:01
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 05:13


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