CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   OpenFoam-dev waveAlpha for multiple phases (https://www.cfd-online.com/Forums/openfoam/194480-openfoam-dev-wavealpha-multiple-phases.html)

MattS October 16, 2017 18:04

OpenFoam-dev waveAlpha for multiple phases
 
Hello,

I am currently trying to use the new wave toolbox in OpenFoam-dev with compressibleMultiphaseInterFoam. (I have previously used waves2Foam with OF2.1)

I am using compressibleMultiphaseInterFoam to be able to solve for the temperature field in addition to the velocity field available in interFoam/waves2Foam.

I want to simulate a simple channel flow with a water and an overlying air phase, think numerical wave tank.

After setting the waves in the velocity field with setWaves, I am using setFields with fieldToCell based on alpha.water to initialize the alpha.air and rho and that appears to work fine. However, I am struggling with the inlet boundary condition for the air phase. The inlet boundary in alpha.water is straightforward

Code:

inlet
    {
        type            waveAlpha;
        U                U;
        inletOutlet    true;

    }

but how do I set the alpha.air boundary condition at the inlet?
I tried zeroGradient and the code runs but with non-physical results in alpha.air near the inlet.

I would essentially need to get the faceValue at the inlet for alpha.water at a given level and then do a "1-value(alpha.water)" and set that as condition for alpha.air. Is there an easy (or not so easy) way to achieve this?

Any comments are much appreciated.
(I would hate to have to go back to waves2Foam and just add temperature as a scalar, especially since waves2Foam did not work in any version past OF2.1 for my setup.)

Thank you!

MattS October 17, 2017 11:27

Quote:

Originally Posted by MattS (Post 668130)
I would essentially need to get the value at the inlet for alpha.water at a given level and time and then do a "1-value(alpha.water)" and set that as condition for alpha.air.

Can someone help me do this?
Is the way to achieve this by making changes to waveAlphaFvPatchScalarField.C?

Thank you!

MattS October 17, 2017 11:59

I guess this can be achieved by the following

Code:

inlet
    {
        type            waveAlpha;
        U                U;
        inletOutlet    true;
      liquid          no;

    }

I should have looked at usage in waveAlphaFvPatchScalarField.H
Thank you.

MattS October 18, 2017 10:44

This is still not working though.

The BC as above with "liquid no" for my light phase (alpha.air) is initializing the phase correctly and everything appears to be ok at time t = 0, then the inlet switches back to the water phase (instead of air) as the simulation goes on.

So my alpha.air and my alpha.water at the inlet have the same value at t > 0 with the above inlet boundary conditions for alpha.water and alpha.air, respectively.
I am initializing the waves by running
setWaves -alpha alpha.water
then
setWaves -alpha alpha.air

Is this where I am going wrong? Or is there maybe a bug in this brandnew waveAlpha BC?

Can anybody shed any light, any comment on where I should start to look to troubleshoot this?

TYIA

PS: I would attach an image but I am not allowed to do that at my job.


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