CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Understanding variableHeightFlowRateInletVelocity boundary condition (https://www.cfd-online.com/Forums/openfoam-solving/152043-understanding-variableheightflowrateinletvelocity-boundary-condition.html)

escodonic April 22, 2015 12:54

Understanding variableHeightFlowRateInletVelocity boundary condition
 
I am doing a two phase flow simulation with VOF.
As an inlet BC I'm using the "variableHeightFlowRateInletVelocity".

As inputs OpenFoam requires the volumetric flow rate and the phase-fraction field.

When running some cases I can see that the water free surface elevation can change in time. I assume that if the height increases, the velocity should decrease, and always the volumetric flow rate is constant.

Somebody knows how that BC works? How OpenFoam makes the change of velocity and height in time?

Thanks

CUnsworth June 4, 2015 07:30

Hello,
I would also like clarity on this question, and in addition how the lower and upper bounds work.
are they set heights(mm or m)? fractions of the inlet boundary scale? percentage? variation from initial conditions?
Chris.

sharonyue June 4, 2015 10:44

Quote:

Originally Posted by escodonic (Post 543245)
I am doing a two phase flow simulation with VOF.
As an inlet BC I'm using the "variableHeightFlowRateInletVelocity".

As inputs OpenFoam requires the volumetric flow rate and the phase-fraction field.

When running some cases I can see that the water free surface elevation can change in time. I assume that if the height increases, the velocity should decrease, and always the volumetric flow rate is constant.

Somebody knows how that BC works? How OpenFoam makes the change of velocity and height in time?

Thanks

Hi,

here is the code:
Code:

scalarField alphap =
        patch().lookupPatchField<volScalarField, scalar>("alpha1");

    alphap = max(alphap, scalar(0));
    alphap = min(alphap, scalar(1));

    // a simpler way of doing this would be nice
    scalar avgU = -flowRate_/gSum(patch().magSf()*alphap);

    vectorField n(patch().nf());

    operator==(n*avgU*alphap);

where n is to make it a vector. And avgU is:
avgU = \frac{F}{{\sum {\left( {{\alpha _1} \cdot S} \right)} }}

Then U in every patch cell will be:
U = \frac{F}{{\sum {\left( {{\alpha _1} \cdot S} \right)} }}{\alpha _1} \cdot \vec n

:D

buesinaw December 30, 2019 11:07

If I understand correctly, together the variableHeightFlowRate boundary condition can be used in the "alpha.water" file and the variableHeightFlowRateInletVelocity boundary condition can be used in the "U" file to apply a volumetric flow rate to a boundary of a two-phase (air/water) open-channel flow problem. It appears that there's no control over how much of the specified volumetric flow is assigned to water and how much is assigned to air. In an open-channel flow problem the user typically wants to specify the volumetric flow rate of just the water, not the air. Can one use these boundary conditions to specify that the volumetric inflow is the volumetric inflow of water only?

indy07cz January 7, 2020 15:28

Quote:

Originally Posted by buesinaw (Post 753499)
If I understand correctly, together the variableHeightFlowRate boundary condition can be used in the "alpha.water" file and the variableHeightFlowRateInletVelocity boundary condition can be used in the "U" file to apply a volumetric flow rate to a boundary of a two-phase (air/water) open-channel flow problem. It appears that there's no control over how much of the specified volumetric flow is assigned to water and how much is assigned to air. In an open-channel flow problem the user typically wants to specify the volumetric flow rate of just the water, not the air. Can one use these boundary conditions to specify that the volumetric inflow is the volumetric inflow of water only?


I used theese BC's for spillway study and it worked as you expect - volumetric inflow=volumetric inflow of water. Just check spillway in FOAM_tutorials. Or you can separate inlet into 2 parts: one for water and one for air and then use other BC's.

hwangpo February 1, 2020 01:13

The variableHeightFlowRate boundary condition provides a phase fraction condition based on the local flow conditions, whereby the values are constrained to lay between user-specified upper and lower bounds. The behaviour is described by:
if alpha > upperBound:
- apply a fixed value condition, with a uniform level of the upper bound
if lower bound <= alpha <= upper bound: - apply a zero-gradient condition
if alpha < lowerBound:
- apply a fixed value condition, with a uniform level of the lower bound.
Thus, the lowerBound and upperBound should be given.

The variableHeightFlowRateInletVelocity boundary condition provides a velocity boundary condition for multiphase flow based on a user-specified volumetric flow rate.
The flow rate is made proportional to the phase fraction alpha at each face of the patch and alpha is ensured to be bound between 0 and 1. The flowRate and alpha terms should be provided.

Hope this helps.

alfa.fauzi April 30, 2021 06:53

Inlet angle for variableHeightFlowRateInletVelocity boundary
 
Hi everyone,


I have a question regarding an inlet angle when using variableHeightFlowRateInletVelocity BC for interFoam. Is there a way to setup an angle? I know that it is easy to setup an angle using velocity vector component within standard inlet BC e.g. using fixedValue uniform (Usin45 Ucos45 0) for an angle of 45 degree between x&y direction.



However I'm not sure how it works with variableHeightFlowRateInletVelocity although there is the vector component uniform (0 0 0). Is it only by changing the value inside the bracket?



As an example if I want a 45 degree between x & y direction, is it simply by writing the followings?



type variableHeightFlowRateInletVelocity;
flowRate 109.15; //(m3/s)
alpha alpha.water;
value uniform (109.15*sin45 109.15*cos45 0);



Hope someone answers my question. Thanks!


Regards,
Alfa

indy07cz April 30, 2021 07:16

Hi, I'm not sure but I think that value here is just placeholder. Just try and you will see.

Mahmoud Abbaszadeh June 4, 2022 07:57

Hi All,

I would like to use variableHeightFlowRateInletVelocity BC. In this scenario, we can define a constant flow discharge across the inlet boundary. I'm wondering if we can use a non-uniform flow discharge at the inlet boundary?

I tried to use the topoSetDict and set non-uniform values at the inlet. However, after a few time steps, the depth at the inlet increases to satisfy the fixed flow discharge. As a result, the non-uniform velocity will only affect a fraction of the initialized cellZone that was determined in the toposetDict.

Anyone has an idea how to deal with it?

Thanks in advance.


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