CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Inlet and Outlet b.c. based on mass flux (http://www.cfd-online.com/Forums/openfoam-pre-processing/119536-inlet-outlet-b-c-based-mass-flux.html)

Hale June 19, 2013 09:01

Inlet and Outlet b.c. based on mass flux
 
1 Attachment(s)
Hi foamers,




I'm trying to model a dropshaft (using interFoam solver) that contains
  • constant water flow at the inlet.
  • also constant water flow at the outlet which is equal to the fraction of water that is dropped.
I tried with
  • Inlet
    • U: type fixedValue;
      value uniform (-0.05 0 0);
    • P: type zeroGradient;
  • Outlet
    • U: type zeroGradient;
    • P: type fixedValue;
      value uniform 0;
These boundary conditions give some wrong results.
  1. Inlet: I calculated the velocity based on the constant water discharge. As I can see from the results the water has the expected velocity but the water level at (1) does not remain constant. The water level decreases as it drops down.
  2. Outlet: I constructed the U-shaped form so the water at location (2) is in balance with outlet so when the water drops the corresponding flux will go out from the outlet and therefore the water level would be constant at location (2). But it seems like the outlet boundary condition sucks the water and therefore I won't have constant water level at location (2) shown in figure below.
Figure below shows the set-up and the inlet/outlet boundaries.

Is there any way to define the boundaries based on mass flux? if yes how can I apply it to my case. I really appreciate any help and idea.

mayank.dce2k7 August 9, 2013 00:13

Hi Hale,

Did you find any solution to your problem. I am stuck on the same problem i.e applying boundary conditions based on mass flux?

Regards,
Mayank

Hale August 9, 2013 02:26

Quote:

Originally Posted by mayank.dce2k7 (Post 444669)
Hi Hale,

Did you find any solution to your problem. I am stuck on the same problem i.e applying boundary conditions based on mass flux?

Regards,
Mayank


Hi Mayank,

yes I solved the problem. If you only want to define a boundary condition based on the mass flux then I recommend that you calculate the corresponding velocity (Q=U*A -> U = Q/A) and use the following for velocity and pressure

velocity

Code:

    inFlow
    {
        type            fixedValue;
        value          uniform (xx 0 0);  // define the velocity
    }

pressure

Code:

    inFlow         
    {
        type            buoyantPressure;
        value          uniform 0;
    }


This boundary condition gives a uniform velocity at the inlet. There is also another boundary condition where you directly can define the mass flux:

velocity

Code:

    inFlow
    {
        type            flowRateInletVelocity; 
        flowRate        xx;  // here you define the mass flux
        value          uniform (0 0 0);
    }

pressure

Code:

    inFlow         
    {
        type            buoyantPressure;
        value          uniform 0;
    }

This boundary condition gives the desired mass flux through the specified boundary but the velocity is not necessarily uniform. I'm not so sure about this boundary condition therefore I recommend you the first one.

If you want to know the mass flux through the boundaries then add this function to your controlDict

Code:

functions
{
    inletFlux
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        outputControl  outputTime;
        log            true;
        // Output field values as well
        valueOutput    false;
        source          patch;
        sourceName      waterFlow;  // write the name of the boundary
        operation      sum;

        fields
        (
            rho phi alpha1    //define the quantities you want to be printed
        );
    }

    outletFlux
    {
        $inletFlux;
        sourceName      outlet;
    }

}

Remember that you should define your geometry in such a way that y=0 at the outlet otherwise it produces negative pressure. I had this problem with the previous post.

Hope this helps you :)


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