View Issue Details

IDProjectCategoryView StatusLast Update
0003612OpenFOAMBugpublic2021-01-19 10:28
ReportervirajbelekarAssigned Towill 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
PlatformGNU/LinuxOSUbuntuOS Version18.04.5 LTS
Product Version8 
Fixed in Version 
Summary0003612: Heat and Mass Transfer doesn't work correctly when stationaryPhaseModel is used in multiphaseEulerFoam solver
DescriptionI am trying to simulate heat transfer between solid, liquid, and gas phases and mass transfer between the liquid and the gas phases for a stationary case. When I try to define the solid and liquid phase as pureStationaryPhaseModel(s), the heat and mass transfer doesn't seem to work correctly. Even if I define just the solid phase as pureStationaryPhaseModel, it doesn't work and the individual phases don't heat up. If there are no stationary phases, i.e., if I define the solid and liquid phases as purePhaseModel and gas phase as multicomponentPhaseModel, the individual phases seem to heat up as expected. I think there is a bug while assigning a phase as stationary if we want to study the heat and mass transfer. A similar kind of bug seems to be reported here: https://bugs.openfoam.org/view.php?id=3132

Although my solver doesn't crash.
Steps To ReproduceI have attached the phaseProperties and the thermophysicalProperties files. Just change the purePhaseModel(s) to pureStationaryPhaseModel(s) or vice versa and you can see the issue.
TagsNo tags attached.

Activities

virajbelekar

2021-01-13 21:52

reporter  

phaseProperties (4,097 bytes)
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5                                     |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      phaseProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

type interfaceCompositionPhaseChangeMultiphaseSystem;

phases (solid liquid gas);

solid
{
    type          pureStationaryPhaseModel;
    diameterModel constant;
    constantCoeffs
    {
        d               1e-4;
    }

    alphaMax        0.65;
    residualAlpha   1e-6;
}


liquid
{
    type          pureStationaryPhaseModel;
    diameterModel constant;
    constantCoeffs
    {
        d               1e-4;
    }

    residualAlpha   1e-6;
}

gas
{
    type          multiComponentPhaseModel;
    diameterModel constant;
    constantCoeffs
    {
        d               1e-4;
    }

    residualAlpha   0;
}

blending
{
    default
    {
        type            none;
        continuousPhase gas;
    }


    heatTransfer
    {
        type            linear;
        minPartlyContinuousAlpha.gas 0.2;
        minFullyContinuousAlpha.gas 0.39;
        minPartlyContinuousAlpha.liquid 0.1;
        minFullyContinuousAlpha.liquid 0.2;
        minPartlyContinuousAlpha.solid 0.0;
        minFullyContinuousAlpha.solid 1.0;
    }

    diffusiveMassTransfer
    {
        type            none;
	continuousPhase gas;
    }
}

surfaceTension
(
);

aspectRatio
(
);

drag
(
);

virtualMass
(
);

interfaceComposition.solid
();

interfaceComposition.liquid
();

interfaceComposition.gas
(

    (gas and liquid)
    {
        type saturated;
        species ( H2O );
	Le 0.938;
        saturationPressure
        {
            type AntoineExtended;
	    A 29.8605;
	    B -3.1522e3;
	    C 0;
	    D -7.3037;
	    E 1.8090e-6;
	    F 2;
        }
    }
);

heatTransfer.solid
(
    (solid in gas)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }

    (solid in liquid)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }

    (gas in solid)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }


    (liquid in solid)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }
);

heatTransfer.liquid
(
    (liquid in gas)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }

    (liquid in solid)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }

    (gas in liquid)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }

    (solid in liquid)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }
);

heatTransfer.gas
(
    (solid in gas)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }

    (liquid in gas)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }


    (gas in liquid)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }


    (gas in solid)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }
);

diffusiveMassTransfer.liquid
(
    (liquid in gas)
    {
        type Frossling;
        Le 0.938;
    }
);

diffusiveMassTransfer.solid
(
);

diffusiveMassTransfer.gas
(
    (liquid in gas)
    {
        type Frossling;
        Le 0.938;
    }
);

phaseTransfer
(
);

lift
(
);

wallLubrication
(
);

turbulentDispersion
(
);

// Minimum allowable pressure
pMin            10000;


// ************************************************************************* //
phaseProperties (4,097 bytes)
thermophysicalProperties.gas (1,994 bytes)
thermophysicalProperties.liquid (1,063 bytes)
thermophysicalProperties.solid (1,400 bytes)
turbulenceProperties.gas (902 bytes)
turbulenceProperties.liquid (738 bytes)
turbulenceProperties.solid (1,899 bytes)
controlDict (2,125 bytes)
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5                                     |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     multiphaseEulerFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         1550;

deltaT          5e-6;

writeControl    adjustableRunTime;

writeInterval   50;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision   6;

runTimeModifiable on;

adjustTimeStep  yes;

maxCo           0.2;

maxDeltaT       1;

functions
{
    fieldAverage1
    {
        type            fieldAverage;
        libs            ("libfieldFunctionObjects.so");
        writeControl    writeTime;
        fields
        (
            U.particles
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }

            U.air
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }

            alpha.particles
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }

            p
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }
        );
    }
}



// ************************************************************************* //
controlDict (2,125 bytes)
fvSchemes (2,066 bytes)
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5                                     |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default     Euler;
}

gradSchemes
{
    default     Gauss linear;
}

divSchemes
{
    default                         none;

    "div\(phi,alpha.*\)"            Gauss vanLeer;
    "div\(phir,alpha.*\)"           Gauss vanLeer;

    "div\(alphaRhoPhi.*,U.*\)"      Gauss limitedLinearV 1;
    "div\(phi.*,U.*\)"              Gauss limitedLinearV 1;

    "div\(alphaRhoPhi.*,Yi\)"       Gauss limitedLinear 1;
    "div\(alphaRhoPhi.*,(h|e).*\)"  Gauss limitedLinear 1;
    "div\(alphaRhoPhi.*,K.*\)"      Gauss limitedLinear 1;
    "div\(alphaPhi.*,p\)"           Gauss limitedLinear 1;

    div((((alpha.gas*thermo:rho.gas)*nuEff.gas)*dev2(T(grad(U.gas))))) Gauss linear;
    div((((thermo:rho.solid*nut.solid)*dev2(T(grad(U.solid))))+(((thermo:rho.solid*lambda.solid)*div(phi.solid))*I))) Gauss linear;
    div(alphaRhoPhi.solid,Theta.solid) Gauss linear;
    div((((alpha.liquid*thermo:rho.liquid)*nuEff.liquid)*dev2(T(grad(U.liquid))))) Gauss linear;

}

laplacianSchemes
{
    default     Gauss linear uncorrected;
    bounded     Gauss linear uncorrected;
}

interpolationSchemes
{
    default     linear;
}

snGradSchemes
{
    default     uncorrected;
    bounded     uncorrected;
}

// ************************************************************************* //
fvSchemes (2,066 bytes)
fvSolution (2,541 bytes)
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5                                     |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    "alpha.*"
    {
        nAlphaCorr      2;
        nAlphaSubCycles 2;

        smoothLimiter   0.1;

        implicitPhasePressure yes;
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-9;
        relTol          0;
        minIter         1;
    }

    p_rgh
    {
        solver          GAMG;
        smoother        DIC;
        tolerance       1e-8;
        relTol          0;
    }

    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }

    "U.*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-5;
        relTol          0;
        minIter         1;
    }

    "(h|e).*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-8;
        relTol          0;
        minIter         1;
    }

    "Theta.*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-6;
        relTol          0;
        minIter         1;
    }

    "(k|epsilon).*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-5;
        relTol          0;
        maxIter         0;
    }


    "Yi.*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-8;
        relTol          0;
        minIter         1;
        residualAlpha   1e-8;
    }
}

PIMPLE
{
    nOuterCorrectors    5;
    nCorrectors         3;
    nNonOrthogonalCorrectors 0;
}

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


// ************************************************************************* //
fvSolution (2,541 bytes)

will

2021-01-14 10:42

manager   ~0011813

Mass transfer is not supported on stationary phases. These phases do not have a volume fraction solution so their volume and mass remain constant. I have added error messages to dev that make that clear.

https://github.com/OpenFOAM/OpenFOAM-dev/commit/4b8147c8abda9bd01099485d33d1ef05f55c6e6a

It may be possible to implement mass transfer to or from a solid phase, but nobody has thus far provided funding for such work. Can you do so?

If you select just solid as stationary then mass transfer should function between liquid and gas, and heat transfer should be possible between all three. If it is not working then there is either a problem with your setup or there is a bug. You have not demonstrated which is the case. See https://bugs.openfoam.org/rules.php. You must provide "Evidence that user error is not the cause of the issue", and "A clear set of instructions that reproduces the issue, including key files, if required". This means uploading an archive of the entire case in question so we can run it and giving a clear explanation about what is wrong about the results.

virajbelekar

2021-01-15 18:12

reporter   ~0011821

Hello Will,
Thanks for your reply. Also, thanks for letting me know that mass transfer is not supported on stationary phases.
In my simulations (attached HT_MT_RanzMarshall.zip), I only define the solid phase as stationary and I don't want mass transfer to or from a solid phase.
So, I have two non-stationary phases (liquid and gas) between which mass transfer should happen and heat transfer should happen between all three phases.
To reproduce this case, following set of commands needs to be used:

blockMesh
multiphaseEulerFoam

Now, if you change pureStationaryPhaseModel to purePhaseModel for the solid phase in phaseProperties file and use the above set of commands, the heating of phases is quicker and along the expected lines.
I ran the simulations for the case where the solid phase is stationary till t = 40 s, and I have also added an animation to show the lack of heating.

HT_MT_RanzMarshall.zip (73,073 bytes)

will

2021-01-19 10:28

manager   ~0011822

The case does not run. Your coded boundary conditions are looking up fields that do not exist.

I don't think your comparison would demonstrate a bug in OpenFOAM anyway. Switching the solid to a moving phase model completely changes the simulation. The solid accounts for 98-ish % of the total mass of the system. I'd expect the results to be completely different for a moving vs a stationary solid.

I think this is a matter of user support, which is not provided via this site. Closing.

Issue History

Date Modified Username Field Change
2021-01-13 21:52 virajbelekar New Issue
2021-01-13 21:52 virajbelekar File Added: phaseProperties
2021-01-13 21:52 virajbelekar File Added: thermophysicalProperties.gas
2021-01-13 21:52 virajbelekar File Added: thermophysicalProperties.liquid
2021-01-13 21:52 virajbelekar File Added: thermophysicalProperties.solid
2021-01-13 21:52 virajbelekar File Added: turbulenceProperties.gas
2021-01-13 21:52 virajbelekar File Added: turbulenceProperties.liquid
2021-01-13 21:52 virajbelekar File Added: turbulenceProperties.solid
2021-01-13 21:52 virajbelekar File Added: controlDict
2021-01-13 21:52 virajbelekar File Added: fvSchemes
2021-01-13 21:52 virajbelekar File Added: fvSolution
2021-01-14 10:42 will Note Added: 0011813
2021-01-15 18:12 virajbelekar File Added: HT_MT_RanzMarshall.zip
2021-01-15 18:12 virajbelekar Note Added: 0011821
2021-01-19 10:28 will Assigned To => will
2021-01-19 10:28 will Status new => closed
2021-01-19 10:28 will Resolution open => no change required
2021-01-19 10:28 will Note Added: 0011822