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

Generate waves in 4 phase with multiphaseInterFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 16, 2022, 08:46
Default Generate waves in 4 phase with multiphaseInterFoam
  #1
New Member
 
mill
Join Date: Feb 2021
Posts: 9
Rep Power: 5
mill is on a distinguished road
Hi,
I am trying to slimulate two kinds of wave in a tank.In the upper,willing to use waveModel to generate Airy waves form the boundary "Inlet".
2D multiphaseFoam.
The diffiulties are the alpha of air in the boundary cannot be setting correctly.waveModel will set the alpha of waterwa,Openfoam cannot set the alpha of air.There are two suitution ,the sum of alpha will >1 at part of intet,or no phase at part of inlet .

How can i set the inlet in the 0/alpha.air.orig.
In the next post I will add the BC-files for the 3-phase simulation.
mill is offline   Reply With Quote

Old   May 16, 2022, 08:58
Default
  #2
New Member
 
mill
Join Date: Feb 2021
Posts: 9
Rep Power: 5
mill is on a distinguished road
alpha.air.orig
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0";
    object      alpha.air;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"
    leftWall
    {
        type            alphaContactAngle;
        thetaProperties
        (
             ( waterup air ) 90 0 0 0
             ( waterlow air ) 90 0 0 0
             (waterup waterlow) 90 0 0 0
        );
        value           uniform 0;
    }
    rightWall
    {
        type            alphaContactAngle;
        thetaProperties
        (
             ( waterup air ) 90 0 0 0
             ( waterlow air ) 90 0 0 0
             (waterup waterlow) 90 0 0 0
        );
        value           uniform 1;
    }
    lowerWall
    {
        type            alphaContactAngle;
        thetaProperties
        (
             ( waterup air ) 90 0 0 0
             ( waterlow air ) 90 0 0 0
             (waterup waterlow) 90 0 0 0
        );
        value           uniform 0;
    }
    outlet
    {
        type            alphaContactAngle;
        thetaProperties
        (
             ( waterup air ) 90 0 0 0
             ( waterlow air ) 90 0 0 0
             (waterup waterlow) 90 0 0 0
        );
        value           uniform 0;
    }
    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
    inlet
    {
        //type            alphaContactAngle;
        //thetaProperties
        //(
        //     ( waterup air ) 90 0 0 0
        //    ( waterlow air ) 90 0 0 0
        //     (waterup waterlow) 90 0 0 0
        //);
        //value           uniform 0;
        type		fixedValue;
        value		uniform 0;
    }
    
    defaultFaces
    {
        type            empty;
    }
}


// ************************************************************************* //
alpha.waterwa
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0";
    object      alpha.waterup;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"
    leftWall
    {
        type            zeroGradient;
    }
    rightWall
    {
        type            zeroGradient;
    }
    lowerWall
    {
        type            zeroGradient;
    }
    outlet
    {
        type            zeroGradient;
    }
    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 1;
        value           uniform 1;
    }
    inlet
    {
        type            waveAlpha;
        U               U;
        inletOutlet     true;
        liquid          true;
        value           uniform 0;
    }
    
    defaultFaces
    {
        type            empty;
    }
}


// ************************************************************************* //
alpha.waterup.orig
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0";
    object      alpha.waterup;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"
    leftWall
    {
        type            zeroGradient;
    }
    rightWall
    {
        type            zeroGradient;
    }
    lowerWall
    {
        type            zeroGradient;
    }
    outlet
    {
        type            zeroGradient;
    }
    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 1;
        value           uniform 1;
    }
    inlet
    {
        //type            waveAlpha;
        type            zeroGradient;
        value           uniform 0;
    }
    
    defaultFaces
    {
        type            empty;
    }
}


// ************************************************************************* //
alpha.waterlow.orig
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0";
    object      alpha.waterlow;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"
    leftWall
    {
        type            zeroGradient;
    }
    rightWall
    {
        type            zeroGradient;
    }
    lowerWall
    {
        type            zeroGradient;
    }
    outlet
    {
        type            zeroGradient;
    }
    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
    inlet
    {
        //type            waveAlpha;
        type            zeroGradient;
        value           uniform 0;
    }
    
    defaultFaces
    {
        type            empty;
    }
}


// ************************************************************************* //
U.orig
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (0 0 0);

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"
    leftWall
    {
        type            noSlip;
    }
    rightWall
    {
        type            noSlip;
    }
    lowerWall
    {
        type            noSlip;
    }
    outlet
    {
        type            outletPhaseMeanVelocity;
        UnMean          0;
        alpha           alpha.waterup;
    }
    inlet
    {
        type            waveVelocity;
        //value           uniform 0;
    }
    atmosphere
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
    defaultFaces
    {
        type            empty;
    }
}


// ************************************************************************* //
p_rgh
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"
    leftWall
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }

    rightWall
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }

    lowerWall
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }
    outlet
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }
    inlet
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }
    atmosphere
    {
        type            totalPressure;
        p0              uniform 0;
    }

    defaultFaces
    {
        type            empty;
    }
}

// ************************************************************************* //
waveproperties
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      waveProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

origin          (0 0.55 0);

direction       (1 0 0);

waves
(
    Airy
    {
        length      0.9;
        amplitude   0.01;
        phase       0;
        angle       -45;
    }
);

UMean           (0 0 0);

//scale           table ((1200 1) (1800 0));

//crossScale      constant 1;


// ************************************************************************* //
setFieldDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

defaultFieldValues
(
    volScalarFieldValue alpha.air 1
    volScalarFieldValue alpha.waterwa 0
    volScalarFieldValue alpha.waterup 0
    volScalarFieldValue alpha.waterlow 0
    volVectorFieldValue U (0 0 0)
);

regions
(
    boxToCell
    {
        box (0 0 0) (5 0.2 0.1);//塌陷区,参数1
        fieldValues
        (
            volScalarFieldValue alpha.waterlow 1
   	    volScalarFieldValue alpha.waterup 0
            volScalarFieldValue alpha.air 0
            volScalarFieldValue alpha.waterwa 0
        );
    }
    boxToCell
    {
        box (0 0.2 0) (0.4 0.48 0.1);//塌陷区,参数2
        fieldValues
        (
            volScalarFieldValue alpha.waterlow 0
   	    volScalarFieldValue alpha.waterup 1
            volScalarFieldValue alpha.air 0
            volScalarFieldValue alpha.waterwa 0
        );
    }
    boxToCell
    {
        box (0.4 0 0) (5 0.4 0.1);
        fieldValues
        (
            volScalarFieldValue alpha.waterlow 1
   	    volScalarFieldValue alpha.waterup 0
            volScalarFieldValue alpha.air 0
            volScalarFieldValue alpha.waterwa 0
        );
    }
    boxToCell
    {
        box (0.4 0.4 0) (5 0.48 0.1);
        fieldValues
        (
            volScalarFieldValue alpha.waterlow 0
   	    volScalarFieldValue alpha.waterup 1
            volScalarFieldValue alpha.air 0
            volScalarFieldValue alpha.waterwa 0
        );
    }
        boxToCell
    {
        box (0 0.48 0) (5 0.55 0.1);
        fieldValues
        (
            volScalarFieldValue alpha.waterlow 0
   	    volScalarFieldValue alpha.waterup 0
            volScalarFieldValue alpha.air 0
            volScalarFieldValue alpha.waterwa 1
        );
    }
    
    
);


// ************************************************************************* //
setWaves
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    object      setWavesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

alpha   alpha.waterwa;

// ************************************************************************* //
fvSchems
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default CrankNicolson ocCoeff
    {
        type scale;
        scale linearRamp;
        duration 0.1;
        value 0.9;
    };
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    div(rhoPhi,U)   Gauss linear;
    div(phi,alpha)  Gauss vanLeer;
    div(phirb,alpha) Gauss linear;
    div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}


// ************************************************************************* //
fvSolution
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    "alpha.*"
    {
        nAlphaSubCycles 4;
        cAlpha          3;
        
        nAlphaCorr      3;
        nAlphaSubCycles 1;

        MULESCorr       yes;
        nLimiterIter    3;
        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;
    }

    U
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        tolerance       1e-08;
        relTol          0.01;
        nSweeps         4;
    }

    UFinal
    {
        $U;
        tolerance       1e-08;
        relTol          0;
    }
}

PIMPLE
{
    momentumPredictor   yes;
    nOuterCorrectors    1;
    nCorrectors         3;
    nNonOrthogonalCorrectors 2;
    //pRefCell 0;
    //pRefValue 0;
}

relaxationFactors
{
    equations
    {
        ".*"            1;
    }
}

// ************************************************************************* //
mill is offline   Reply With Quote

Old   September 14, 2023, 18:09
Default did you find a solution?
  #3
New Member
 
Sarah Aguiar
Join Date: Sep 2023
Posts: 10
Rep Power: 3
Sarah_Ag is on a distinguished road
Hey, did you find a solution? I'm having the same problem and don't know what to do.
Sarah_Ag is offline   Reply With Quote

Reply

Tags
waves multiphaseinterfoam


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
3 phase multiphaseInterFoam kaaja OpenFOAM Running, Solving & CFD 4 March 6, 2021 13:33
multiphaseInterFoam vs multiphaseEulerFoam rahulksoni OpenFOAM 0 August 11, 2017 03:14
How to generate second order stokes waves by interDyMFoam? shchao OpenFOAM Programming & Development 2 June 4, 2012 12:21
two Phase column simulation chemeng OpenFOAM 3 August 18, 2010 13:53
Phase segregation in multiphaseInterFoam Tracker OpenFOAM 3 May 7, 2010 05:10


All times are GMT -4. The time now is 13:40.