View Issue Details

IDProjectCategoryView StatusLast Update
0000817OpenFOAMBugpublic2013-04-29 12:56
Reporterdhora Assigned Tohenry  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Summary0000817: interPhaseChangeFoam: bad results
DescriptioninterPhaseChangeFoam results are very bad, size of cavitation bubble is underestimated clearly in the cavitatingBullet tutorial. Other users reported similar problems with version 2.1.x:

http://www.cfd-online.com/Forums/openfoam-solving/98157-interphasechangefoam.html#post419091

Best regards
David
TagsNo tags attached.

Activities

dhora

2013-04-15 11:29

reporter  

cavBullet_OF-16x.png (31,242 bytes)   
cavBullet_OF-16x.png (31,242 bytes)   

dhora

2013-04-15 11:29

reporter  

cavBubble_OF-22x.png (20,689 bytes)   
cavBubble_OF-22x.png (20,689 bytes)   

dhora

2013-04-22 10:41

reporter   ~0002124

Last edited: 2013-04-25 06:49

The problem is that incompressibleTwoPhaseMixture::mu() doesn't use the correct alpha1 values. You can see it if you write out mu before and after the execution of alphaEqnSubCycle.H in the solver:

/////////////////////////////////////////////////

volScalarField mu
(
    IOobject
    (
        "mu",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
    ),
    twoPhaseProperties->mu()
);
mu.write();

# include "alphaEqnSubCycle.H"

volScalarField mu2
(
    IOobject
    (
        "mu2",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
    ),
    twoPhaseProperties->mu()
);
mu2.write();


/////////////////////////////////////////////////

In version 1.6 you get new alpha1 and mu values after alphaEqnSubCycle.H. In version 2.2.x you get the same alpha1 values as in version 1.6 (if you use nonOrthoDeltaCoeffs in MULES::implicitSolve and fvPatch::deltaCoeffs) but mu does not change and it has the same values as before alphaEqnSubCycle.H.

dhora

2013-04-22 22:32

reporter   ~0002125

Last edited: 2013-04-23 09:18

Interim solution until the bug is fixed:

        Info<< "Time = " << runTime.timeName() << nl << endl;

        #include "alphaEqnSubCycle.H"
        twoPhaseProperties().alpha1() = alpha1;

        if (pimple.nCorrPIMPLE() == 1) // is that correct??
        {
            interface.correct();
        }

feymark

2013-04-25 15:19

reporter   ~0002126

The solution would be to remove,

    Info<< "Reading field alpha1\n" << endl;
    volScalarField alpha1
    (
        IOobject
        (
            "alpha1",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );

and add the following for alpha1,


    Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
    autoPtr<phaseChangeTwoPhaseMixture> twoPhaseProperties =
        phaseChangeTwoPhaseMixture::New(U, phi);

    volScalarField& alpha1 = const_cast<volScalarField&>(twoPhaseProperties->alpha1());

    const dimensionedScalar& rho1 = twoPhaseProperties->rho1();
    const dimensionedScalar& rho2 = twoPhaseProperties->rho2();
    const dimensionedScalar& pSat = twoPhaseProperties->pSat();

Kind Regards,
Andreas FEYMARK

henry

2013-04-27 15:44

manager   ~0002129

Thanks for the bug-report and analysis. Sorry that resolving this had to be delayed until after our UGM.

I have updated interPhaseChangeFoam to be more consistent with interFoam which also resolves the issue reported here.

commit 27abff1c208e00ffaf62a06f3b231425dd4b2bd8

dhora

2013-04-28 16:26

reporter   ~0002130

What about the the 'if' condition of the interface correction?

Maybe it doesn't belong into this bug report but a further point is the usage of the deltaCoeffs in MULES::implicitSolve and fvPatch::deltaCoeffs. I think the nonOrthDeltaCoeffs would correspond to the implementation in older OpenFOAM versions. Do we really use the right deltaCoeffs everywhere?

henry

2013-04-28 16:53

manager   ~0002131

> What about the the 'if' condition of the interface correction?

Well, it is not clear if the interface properties (surface tension) should be used or not as it not necessarily known if the interface is captured (sheet/continuous cavitation) or bubbly. In the case of continuous resolved cavitation interface compression could/should be used but in the case of bubbly cavitation an Euler-Euler approach should be used with appropriate models for the size distribution, drag, etc. However thu current logic is not sensible and I will change it to be consistent with the current interFoam.

The deltaCoeffs in MULES::implicitSolve are only used to estimate an appropriate face Courant number for the limiter and the current coding is more appropriate than using nonOrthDeltaCoeffs.

I am not sure which fvPatch::deltaCoeffs usage you are referring to, could you clarify?

dhora

2013-04-29 08:58

reporter   ~0002132

const Foam::scalarField& Foam::fvPatch::deltaCoeffs() const
{
    return boundaryMesh().mesh().deltaCoeffs().boundaryField()[index()];
}

henry

2013-04-29 10:03

manager   ~0002133

What is your issue with this code with respect to interPhaseChangeFoam or in general?

dhora

2013-04-29 12:29

reporter   ~0002134

Just in general. I'm wondering if there is a special reason why it's done in a different way than in older versions and if it can have a negative influence in certain situations. So far, I didn't observe any significant difference but I didn't test with bad meshes.

henry

2013-04-29 12:56

manager   ~0002135

The new structure makes a formal distinction between the "real" deltaCoeffs and those used for non-orthogonal corrected schemes for many reasons in particular code transparency and to make it possible to support alternative non-orthogonal corrected snGrad schemes.

Issue History

Date Modified Username Field Change
2013-04-15 11:29 dhora New Issue
2013-04-15 11:29 dhora File Added: cavBullet_OF-16x.png
2013-04-15 11:29 dhora File Added: cavBubble_OF-22x.png
2013-04-22 10:41 dhora Note Added: 0002124
2013-04-22 10:42 dhora Note Edited: 0002124
2013-04-22 10:42 dhora Note Edited: 0002124
2013-04-22 11:43 dhora Note Edited: 0002124
2013-04-22 11:45 dhora Note Edited: 0002124
2013-04-22 22:32 dhora Note Added: 0002125
2013-04-23 08:57 dhora Note Edited: 0002125
2013-04-23 09:07 dhora Note Edited: 0002124
2013-04-23 09:18 dhora Note Edited: 0002125
2013-04-25 06:49 dhora Note Edited: 0002124
2013-04-25 15:19 feymark Note Added: 0002126
2013-04-27 15:44 henry Note Added: 0002129
2013-04-27 15:44 henry Status new => resolved
2013-04-27 15:44 henry Resolution open => fixed
2013-04-27 15:44 henry Assigned To => henry
2013-04-28 16:26 dhora Note Added: 0002130
2013-04-28 16:26 dhora Status resolved => feedback
2013-04-28 16:26 dhora Resolution fixed => reopened
2013-04-28 16:53 henry Note Added: 0002131
2013-04-29 08:58 dhora Note Added: 0002132
2013-04-29 08:58 dhora Status feedback => assigned
2013-04-29 10:03 henry Note Added: 0002133
2013-04-29 12:29 dhora Note Added: 0002134
2013-04-29 12:56 henry Note Added: 0002135
2013-04-29 12:56 henry Status assigned => closed
2013-04-29 12:56 henry Resolution reopened => no change required