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

3 phase multiphaseInterFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 23, 2018, 05:28
Default 3 phase multiphaseInterFoam
  #1
Member
 
Join Date: Apr 2017
Posts: 68
Rep Power: 9
kaaja is on a distinguished road
Hi,

I am trying to simulate flow around a (boat like) object in stratified waters.
Fluids: air, fresh water and salt water.
Dimensionality: 2D.
Solver: multiphaseInterFoam.

The result does not look good:

For U I get some kind of wake infront of the object:
uAirSaltFresh.jpg

The phases look like
alphaAirFreshSalt.jpg

The above is not what I expected.
I have run two other scenarios.
The 2nd scenario is two phases with air and salt water.

For U I then get
uAirSalt.jpg

For alphas I get
alphasAirSalt.jpg

Comparing the two above scenarios, we see that the last scenario get a more reasonable velocity profile infront of the object.

Finally, I have run a 2-phase case between fresh water and salt water.

For alpha I then get
alphaSaltFresh.jpg

Comparing the last picture with the corresponding 3-phase picture, we see that there is a big difference in alpha distribution. In the last case we get a nice internal wave.

I cannot figure out why the 3-phase simulations give such bad results. It seems like openFoam and multiphaseInterFoam (which is used in all scenarios) can handle different combinations of two fluids well, but everything blows up when combing all fluids together in the 3-phase simulation.

In the next post I will add the BC-files for the 3-phase simulation.
kaaja is offline   Reply With Quote

Old   February 23, 2018, 05:42
Default
  #2
Member
 
Join Date: Apr 2017
Posts: 68
Rep Power: 9
kaaja is on a distinguished road
Continuation from previous post:

Some files:

alpha.air
Code:
dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;//1;

boundaryField
{
    //- Set patchGroups for constraint patches
    #includeEtc "caseDicts/setConstraintTypes"

    inlet
    {
        type            fixedValue;
        value           $internalField;//uniform 1;//
    }

    outlet
    {
        //type            zeroGradient;        
        type            variableHeightFlowRate;
        lowerBound      0;
        upperBound      1;
        value           $internalField;
    }

    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 1;//$internalField;
        value           uniform 1;//$internalField;
    }

    barge
    {
        type            zeroGradient;
    }
}
alpha.freshWater
Code:
dimensions      [0 0 0 0 0 0 0];

internalField   uniform 1;

boundaryField
{
    //- Set patchGroups for constraint patches
    #includeEtc "caseDicts/setConstraintTypes"

    inlet
    {
        type            fixedValue;
        value           $internalField;//uniform 0;//
    }

    outlet
    {
        type            variableHeightFlowRate;
        lowerBound      0;
        upperBound      1;
        value           $internalField;//uniform 1;
    }

    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 0;//$internalField;
        value           uniform 0;//$internalField;
    }

    barge
    {
        type            zeroGradient;
    }
}
alpha.saltWater
Code:
dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    //- Set patchGroups for constraint patches
    #includeEtc "caseDicts/setConstraintTypes"

    inlet
    {
        type            fixedValue;
        value           $internalField;
    }

    outlet
    {
        type            variableHeightFlowRate;
        lowerBound      0;
        upperBound      1;
        value           $internalField;
    }

    atmosphere
    {
        type            inletOutlet;
        inletValue      $internalField;//uniform 0;
        value           $internalField;//uniform 0;
    }

    barge
    {
        type            zeroGradient;
    }
}
U
Code:
Umean 0.24;
mUmean -0.24;

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform ($mUmean 0 0);

boundaryField
{
    //- Set patchGroups for constraint patches
    #includeEtc "caseDicts/setConstraintTypes"

    inlet
    {
        type            fixedValue;
        value           $internalField;
    }

    outlet
    {
        type            outletPhaseMeanVelocity;
        alpha           alpha.saltWater;
        Umean           $Umean;
        value           $internalField;
    }

    atmosphere
    {
        type                pressureInletOutletVelocity;
        tangentialVelocity     $internalField;
        value                 $internalField;//uniform (0 0 0);
        
    }

    barge
    {
        type            movingWallVelocity;
        value           uniform (0 0 0);
    }
}
prgh
Code:
dimensions      [1 -1 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    //- Set patchGroups for constraint patches
    #includeEtc "caseDicts/setConstraintTypes"

    inlet
    {
        type            fixedFluxPressure;
        value           $internalField;
    }

    outlet
    {
        type            zeroGradient;
        //type            fixedFluxPressure;
        //value           $internalField;
    }

    atmosphere
    {
        type            totalPressure;
        p0              uniform 0;
    }

    barge
    {
        type            fixedFluxPressure;
        value           $internalField;
    }
}
fvSolutions
Code:
solvers
{
    /*"alpha.*"
    {
        nAlphaSubCycles 4;
        cAlpha          1;
    }*/

    "alpha.*"
    {
        nAlphaCorr      1;
        nAlphaSubCycles 2;
        cAlpha          1;
        icAlpha         0; //from dtcHull


        MULESCorr       yes;
        nLimiterIter    10;
        alphaApplyPrevCorr  yes;

        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-8;
        relTol          0;
        minIter         1;
    }

    /*
    "pcorr.*"
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  GAMG;
            tolerance       1e-05;
            relTol          0;
            smoother        GaussSeidel;
        }
        tolerance       1e-05;
        relTol          0;
        maxIter         100;
    }

    p_rgh
    {
        solver          GAMG;
        tolerance       1e-07;
        relTol          0.05;
        smoother        GaussSeidel;
    }

    p_rghFinal
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  GAMG;
            tolerance       1e-07;
            relTol          0;
            nVcycles        2;
            smoother        GaussSeidel;
        }
        tolerance       1e-07;
        relTol          0;
        maxIter         20;
    }
*/

    "pcorr.*"
    {
        solver          PCG;
        //preconditioner  DIC;
        
        preconditioner
        {
            preconditioner  GAMG;

            smoother        GaussSeidel;

            tolerance       1e-5;
            relTol          0;
        };
        tolerance       1e-5;
        relTol          0;
    }

    p_rgh
    {
        //solver          PCG;
        solver          GAMG;
        smoother        DIC;
        //preconditioner  DIC;
        tolerance       1e-07;
        //relTol          0.05;
        relTol          0.01;
        //absTol 0;
    }

    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }
    /*
    "(U|k|omega).*"
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        tolerance       1e-08;
        relTol          0.1;
        nSweeps         1;
    }
    */
    "(U|k|omega).*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        nSweeps         1;

        tolerance       1e-06;
        relTol          0.1;
        minIter         1;
    }
    /*
    UFinal
    {
        $U;
        tolerance       1e-08;
        relTol          0;
    }
    */
}

/*
PIMPLE
{
    nCorrectors     2;
    nNonOrthogonalCorrectors 0;
}
*/

PIMPLE
{
    momentumPredictor   no;//yes;
    nOuterCorrectors    1;
    nCorrectors         3;
    nNonOrthogonalCorrectors 0;
}

/*
relaxationFactors
{
    equations
    {
        "U.*"           1;
    }
}
*/
relaxationFactors
{
    equations
    {
        //p_rgh 0.5;
        //U 0.5;
        ".*" 1;
    }
}

cache
{
    grad(U);
}
fvSchemes
Code:
ddtSchemes
{
    default         Euler;//localEuler;
}

gradSchemes
{
    default         Gauss linear;
    limitedGrad     cellLimited Gauss linear 1;
}

divSchemes
{
    div(rhoPhi,U)  Gauss linearUpwind grad(U);
    div(phi,alpha)  Gauss vanLeer;
    div(phirb,alpha) Gauss linear;
    div(phi,k)      Gauss upwind;
    div(phi,omega) Gauss upwind;
    //div(phi,k)      Gauss linearUpwind limitedGrad;
    //div(phi,epsilon)  Gauss linearUpwind limitedGrad;
    div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;

}

laplacianSchemes
{
    default         Gauss linear corrected;
    
    //laplacian(diffusivity,cellMotionU) Gauss linear uncorrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

wallDist
{
    method meshWave;
}
setFieldsDict
Code:
defaultFieldValues
(
    volScalarFieldValue alpha.air 0
    volScalarFieldValue alpha.freshWater 1
    volScalarFieldValue alpha.saltWater 0
);

regions
(
    boxToCell
    {
        box (-120 0 0) (20 40 200);
        fieldValues
        (
            volScalarFieldValue alpha.freshWater 0
            volScalarFieldValue alpha.saltWater 0
            volScalarFieldValue alpha.air 1
        );
    }
    boxToCell
    {
        box (-120 0 -100) (20 40 -0.2);
        fieldValues
        (
            volScalarFieldValue alpha.freshWater 0
            volScalarFieldValue alpha.saltWater 1
            volScalarFieldValue alpha.air 0
        );
    }

    boxToFace
    {
        box (-120 0 0) (20 40 200);
        fieldValues
        (
            volScalarFieldValue alpha.freshWater 0
            volScalarFieldValue alpha.saltWater 0
            volScalarFieldValue alpha.air 1
        );
    }
    boxToFace
    {
        box (-120 0 -100) (20 40 -0.2);
        fieldValues
        (
            volScalarFieldValue alpha.freshWater 0
            volScalarFieldValue alpha.saltWater 1
            volScalarFieldValue alpha.air 0
        );
    }
);
Among several other things, I have tried:
- Refining mesh
- Increase nAlphaSubsycles
- Increase alphaCorr
- Decrease deltaT
- Change maxCo and maxAlphaCo
- Change the phase used in the outlet BC for U (Results become even worse if alpha.fresh water is used here)
- Increase size of mesh

As a side note, the two-phase solutions, which I have simulated with multiphaseInterFoam, is also simulated with interFOam, giving similar results.

Any help will be very appreciated!
kaaja is offline   Reply With Quote

Old   March 1, 2018, 04:14
Default
  #3
Member
 
Paul Palladium
Join Date: Jan 2016
Posts: 94
Rep Power: 10
Fauster is on a distinguished road
I would model the salt water using a passive transport scalar and not a dedicated phase. When you use interfoam solver you assume that phases are non miscible. This not the case between salt water and fresh water.

For example if you want to model the dispersion of smoke in air from a chimney output you will use a passive scalar to track the smoke concentration.

Fauster
Fauster is offline   Reply With Quote

Old   March 23, 2018, 02:20
Default
  #4
Member
 
Join Date: Apr 2017
Posts: 68
Rep Power: 9
kaaja is on a distinguished road
Quote:
Originally Posted by Fauster View Post
I would model the salt water using a passive transport scalar and not a dedicated phase. When you use interfoam solver you assume that phases are non miscible. This not the case between salt water and fresh water.

For example if you want to model the dispersion of smoke in air from a chimney output you will use a passive scalar to track the smoke concentration.

Fauster
Thank you very much for responding to this, Fauster!
Is this what twoLiquidMixingFoam does?
kaaja is offline   Reply With Quote

Old   March 6, 2021, 13:33
Default
  #5
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 11
randolph is on a distinguished road
Here may be your solution

interFoam with scalar transport in single phase

Thanks,
Rdf
randolph 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
alphaEqn.H in twoPhaseEulerFoam cheng1988sjtu OpenFOAM Bugs 15 May 1, 2016 17:12
[swak4Foam] mass conservation of solid phase violated when using groovyBC with twoPhaseEulerFoam xpqiu OpenFOAM Community Contributions 8 June 17, 2015 03:08
iteration questions in discrete phase iknowjesus FLUENT 4 March 13, 2015 07:07
Phase segregation in multiphaseInterFoam Tracker OpenFOAM 3 May 7, 2010 05:10
compressible two phase flow in CFX4.4 youngan CFX 0 July 2, 2003 00:32


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