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/)
-   -   water injection (https://www.cfd-online.com/Forums/openfoam-solving/240677-water-injection.html)

wjchoi January 19, 2022 03:10

water injection
 
in weiroverflow example, i modified some parts from original codes.
the modified parts are below.

[code]

boundaryField
{
inlet
{

type flowRateInletVelocity;
volumetricFlowRate table
(
(0 0)
(100 0)
(100.01 0.008)
(200 0.008)
(200.01 0)
(300 0)
(300.01 0.008)
(400 0.008)
(400.01 0)
(500 0)
(500.01 0.008)
(600 0.008)
(600.01 0)
(700 0)
(700.01 0.008)
(800 0.008)
(800.01 0)
(900 0)
(900.01 0.008)
(1000 0.008)
);

}

originally, in the weirovercode example, water comes out constantly from inlet,
but i want to simulate the time varying water injection, so i modified this part as i mentioned above.

from the modified part, we can know the water injection exist only at 100~200s, 300~400s, 500~600s, 700~800s, 900 ~1000s as same flow rate (0.008m^3/s)


however, as time goes, the speed of water filling increased although i set the same flow rate (0.008)

in the simulation, the stop time and inject time work well. but in the inject time, the flow rate i set does not work well i think..

how can i solve this problem? ..

Yann January 19, 2022 03:56

Hi,

The weirOverflow tutorial initially uses a specific inlet condition in order to simulate a variable height of water on the inlet patch. 2 boundary conditions are working together to achieve this:
  • U: variableHeightFlowRateInletVelocity
  • alpha.water: variableHeightFlowRate
Have you modified the BC on alpha.water? I don't think you can expect correct behavior if your using variableHeightFlowRate on alpha but flowRateInletVelocity on U.

That being said, the flowRate entry in variableHeightFlowRateInletVelocity is a Function1 entry so you should be able to define it as a table too.

Try something like this:

Code:

    inlet
    {
        type            variableHeightFlowRateInletVelocity;
        alpha          alpha.water;
        value          uniform (0 0 0);
        flowRate        table
                        (
                            (0 0)
                            (100 0)
                            (100.01 0.008)
                            (200 0.008)
                            (200.01 0)
                            (300 0)
                            (300.01 0.008)
                            (400 0.008)
                            (400.01 0)
                            (500 0)
                            (500.01 0.008)
                            (600 0.008)
                            (600.01 0)
                            (700 0)
                            (700.01 0.008)
                            (800 0.008)
                            (800.01 0)
                            (900 0)
                            (900.01 0.008)
                            (1000 0.008)
                        );
    }

Please note I did not try to run it, you may have to adjust the syntax to make it work.

Cheers,
Yann

wjchoi January 19, 2022 06:25

water injection
 
Quote:

Originally Posted by Yann (Post 820510)
Hi,

The weirOverflow tutorial initially uses a specific inlet condition in order to simulate a variable height of water on the inlet patch. 2 boundary conditions are working together to achieve this:
  • U: variableHeightFlowRateInletVelocity
  • alpha.water: variableHeightFlowRate
Have you modified the BC on alpha.water? I don't think you can expect correct behavior if your using variableHeightFlowRate on alpha but flowRateInletVelocity on U.

That being said, the flowRate entry in variableHeightFlowRateInletVelocity is a Function1 entry so you should be able to define it as a table too.

Try something like this:

Code:

    inlet
    {
        type            variableHeightFlowRateInletVelocity;
        alpha          alpha.water;
        value          uniform (0 0 0);
        flowRate        table
                        (
                            (0 0)
                            (100 0)
                            (100.01 0.008)
                            (200 0.008)
                            (200.01 0)
                            (300 0)
                            (300.01 0.008)
                            (400 0.008)
                            (400.01 0)
                            (500 0)
                            (500.01 0.008)
                            (600 0.008)
                            (600.01 0)
                            (700 0)
                            (700.01 0.008)
                            (800 0.008)
                            (800.01 0)
                            (900 0)
                            (900.01 0.008)
                            (1000 0.008)
                        );
    }

Please note I did not try to run it, you may have to adjust the syntax to make it work.

Cheers,
Yann


thank you very much!
when i ran the example using your modified code, the velocity of water filling looks like same perfectly!!
thank you!


if you don't mind, can you ask three more quesions?

first, could you tell me differences between variableHeightFlowRateInletVelocity used in your code and flowRateInletVelocity used in my code,,? i read the boundary condition manual, but i didn't understand the differences between them..

second, so, could you tell me reason why the speed of water filling becomes faster as time goes although i set the same flow rate "0.008" in my code using FlowRateInletVelocity boundary condition?

i think this second question will be solved if i get to know the differences between them (related first question..)


third, in your code, "the value (0 0 0)" is inserted. what is meaning of this?
i set the inlet value for table format. but, why we need to insert the additional value (0 0 0)? when i searched about that, it is mentioned as placeholder. i didn't understand the meaning of placeholder
if the value is placeholder, can you tell me reason why you insert that in your code?


thank you very much for long reading!!

Yann January 19, 2022 09:37

As stated in the variableHeightFlowRateInletVelocity documentation: the flow rate is made proportional to the phase fraction alpha at each face of the patch. This means you are prescribing the water flowrate. Combined with the variableHeightFlowRate boundary condition, this will allow to have a variable water height on the inlet, and adjust the velocity according to the water height to maintain the prescribed flowrate.

flowRateInletVelocity, on the other hand, will only compute a velocity corresponding to the prescribed flowrate on the whole inlet patch, irrelevantly to the phase fraction value. If you want to use this condition, you need to define a fixedValue boundary condition on the alpha.water variable to fix alpha.water=1 on the inlet patch. In this case, the whole inlet patch will be used for water injection, with a velocity corresponding to the flowrate specified by the flowRateInletVelocity BC in the U file. In you fix alpha.water=0 on the inlet patch, you will get an air inlet, with an inlet velocity corresponding to the specified flowrate.

About the placeholder, this is a recurrent topic so you should find answers on the forum, for instance here and here.

I hope this helps,
Yann

wjchoi January 19, 2022 20:43

water injection
 
Quote:

Originally Posted by Yann (Post 820539)
As stated in the variableHeightFlowRateInletVelocity documentation: the flow rate is made proportional to the phase fraction alpha at each face of the patch. This means you are prescribing the water flowrate. Combined with the variableHeightFlowRate boundary condition, this will allow to have a variable water height on the inlet, and adjust the velocity according to the water height to maintain the prescribed flowrate.

flowRateInletVelocity, on the other hand, will only compute a velocity corresponding to the prescribed flowrate on the whole inlet patch, irrelevantly to the phase fraction value. If you want to use this condition, you need to define a fixedValue boundary condition on the alpha.water variable to fix alpha.water=1 on the inlet patch. In this case, the whole inlet patch will be used for water injection, with a velocity corresponding to the flowrate specified by the flowRateInletVelocity BC in the U file. In you fix alpha.water=0 on the inlet patch, you will get an air inlet, with an inlet velocity corresponding to the specified flowrate.

About the placeholder, this is a recurrent topic so you should find answers on the forum, for instance here and here.

I hope this helps,
Yann



i got a lot of help thanks to your explanation
thank you very much !!


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