CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   sprayFoam hangs during parcel injection (https://www.cfd-online.com/Forums/openfoam-solving/206537-sprayfoam-hangs-during-parcel-injection.html)

sammy1 September 8, 2018 23:46

sprayFoam hangs during parcel injection
 
1 Attachment(s)
Hi all,

I've been running some cases in sprayFoam to simulate the breakup and dispersion of water droplets in different air flows. My first case was a liquid jet injected into a transverse crossflow that worked quite nicely, however, my second case is a nozzle spray into a vertical plume of air and is currently experiencing issues during parcel injection. All of my cases are 2D.

I have attached a zipped case file below. Ordinarily I would inject the parcels once the gaseous phase has been allowed to develop, however, due to the constraints of file-size for uploading the case, I've just got the injection starting from time 0. Once injection begins, the solver runs for a few iterations and then stops and hangs on the lines:

Code:

Solving 2-D cloud sprayCloud

Cloud: sprayCloud injector: model1
    Added 120 new parcels

The solver sits in this state until I ctrl+c to exit.

I've gone back to run my jet in crossflow solver, and it is still working. I have also copied the ./constant/sprayCloudProperties from the crossflow solver into the plume case and the issue comes up, so I believe this error could be arising due to my boundary conditions in ./0? I've printed my sprayCloudProperties below.

If anyone could take some time to look at the case it would be greatly appreciated. Apologies if I've missed anything with regards to forum rules/post content - this is my first post ever! Please let me know if I can provide any information that might help someone give me a hand.
Cheers,
Sam

Code:

/*--------------------------------*- 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      binary;
    class      dictionary;
    location    "constant";
    object      SprayCloudProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solution
{
    active          true;
    coupled        true;
    transient      yes;
    cellValueSourceCorrection on;
    maxCo          0.3;

    sourceTerms
    {
        schemes
        {
            rho            explicit 1;
            U              explicit 1;
            Yi              explicit 1;
            h              explicit 1;
            radiation      explicit 1;
        }
    }

    interpolationSchemes
    {
        rho            cell;
        U              cellPoint;
        thermo:mu      cell;
        T              cell;
        Cp              cell;
        kappa          cell;
        p              cell;
    }

    integrationSchemes
    {
        U              Euler;
        T              analytical;
    }
}


constantProperties
{
    T0              298;

    // place holders for rho0 and Cp0
    // - reset from liquid properties using T0
    rho0            1000;
    Cp0            4187;

    constantVolume  false;
}


subModels
{
    particleForces
    {
        sphereDrag;
                gravity;
    }

    injectionModels
    {
        model1
        {
            type            coneNozzleInjection;
            SOI            0.25000;
            massTotal      1.4e-4;
            parcelBasisType mass;
            injectionMethod disc;
            flowType        constantVelocity;
                        UMag                        18;
            outerDiameter  1.5e-4;
            innerDiameter  0;
            duration        0.1;
            position        (0.1 0.275 0);
            direction      (0 -1 0);
            parcelsPerSecond 20000000;
            flowRateProfile table
                                (
                                (0                                0)
                                (0.25                        1.4e-3)
                                (0.35                        0)
                                (0.36                        0)
                                );

            Cd              constant 0.9;

            thetaInner      constant 0.0;
            thetaOuter      constant 30.0;

            sizeDistribution
            {
                type        RosinRammler;

                RosinRammlerDistribution
                {
                    minValue        1e-06;
                    maxValue        0.00015;
                    d              0.00015;
                    n              3;
                }
            }
        }
    }

    dispersionModel none;

    patchInteractionModel standardWallInteraction;

    heatTransferModel RanzMarshall;

    compositionModel singlePhaseMixture;

    phaseChangeModel liquidEvaporationBoil;

    surfaceFilmModel none;

    atomizationModel none;

    breakupModel    ReitzDiwakar; // ReitzKHRT;

    stochasticCollisionModel none;

    radiation      off;

    standardWallInteractionCoeffs
    {
        type            escape;
    }

    RanzMarshallCoeffs
    {
        BirdCorrection  true;
    }

    singlePhaseMixtureCoeffs
    {
        phases
        (
            liquid
            {
                H2O              1;
            }
        );
    }

    liquidEvaporationBoilCoeffs
    {
        enthalpyTransfer enthalpyDifference;

        activeLiquids    ( H2O );
    }

    ReitzDiwakarCoeffs
    {
        solveOscillationEq yes;
        Cbag            6;
        Cb              0.785;
        Cstrip          0.5;
        Cs              10;
    }

/*
    ReitzKHRTCoeffs
    {
        solveOscillationEq yes;
        B0              0.61;
        B1              40;
        Ctau            1;
        CRT            0.1;
        msLimit        0.2;
        WeberLimit      6;
    }
*/
    TABCoeffs
    {
        y0              0;
        yDot0          0;
        Cmu            10;
        Comega          8;
        WeCrit          12;
    }
}


cloudFunctions
{}


// ************************************************************************* //


sammy1 September 9, 2018 07:13

Further to the above, I found this thread outlining a very similar problem, which was solved by ensuring the parcels weren't becoming 'stuck' at the boundary of the domain. I don't believe mine is caused by the same issue but would be grateful if someone could confirm.
https://bugs.openfoam.org/view.php?id=1132#bugnotes
Cheers,
Sam

sammy1 September 9, 2018 22:30

Possible fix
 
2 Attachment(s)
Hi all,
Not sure how many people will ever come across a similar problem but I believe I've solved it so hopefully this helps someone, somewhere, someday.

After changing virtually every part of my code one by one, it appeared that my blockMesh was the culprit in this case. I fully rebuilt my blockMeshDict from the ground up (not that it was very complex in the first place, but since I'm new it took some time!) and I've attached my OLD and NEW blockMeshDict as .txt files to this post.

It appears that the particle injection is now happening without hanging, fingers crossed that it stays that way!

Cheers,
Sam

senthilathiban September 10, 2018 10:21

Hi, I am facing the same issue. could you just explain, what changes have you made in your blockMesh..?

sammy1 September 10, 2018 21:09

Hi senthilathiban,
I believe the only major changes between my old and new blockMeshDict files are the way I have defined the vertices and the blocks. I am not an expert and have no idea why this decided to work, but as you can see below in the OLD file I define them as:

Code:

vertices
(
        (0                0                  0.5) //0
        (64                0                  0.5)
        (64                0                -0.5)
            (0                0                -0.5)
        (0                300                  0.5) //4
        (64                300                  0.5)
        (64                300                -0.5)
        (0                300                -0.5)
        (136                0                  0.5) //8
        (136                0                -0.5)
        (136                300                  0.5)
        (136                300                -0.5)
        (200                0                  0.5) //12
            (200                0                -0.5)
        (200                300                  0.5)
        (200                300        -        0.5) //15
);
blocks
(
        hex (0 1 2 3 4 5 6 7) (50 1 300) simpleGrading (1 1 ((0.3 0.1 1) (0.4 0.4 1) (0.3 0.6 1))) //block 0
        hex (1 8 9 2 5 10 11 6) (100 1 300) simpleGrading (1 1 ((0.3 0.1 1) (0.4 0.4 1) (0.3 0.6 1))) //block 1
        hex (8 12 13 9 10 14 15 11) (50 1 300) simpleGrading (1 1 ((0.3 0.1 1) (0.4 0.4 1) (0.3 0.6 1))) //block 2
);

Whereas in the NEW FILE they are defined as:
Code:

vertices
(
    (0                        0                0) //0
    (0                        0                  1)
    (64                0                  1)
    (64                0                0)
    (0                        300                0) //4
    (0                        300                1)
    (64                300                1)
    (64                300                0) //7
    (136                0                0)
    (136                0                1)
    (136                300                0)
    (136                300                1) //11
    (200                0                0)
    (200                0                1)
    (200                300                0)
    (200                300                1) //15



);

blocks
(
    hex (0 1 2 3 4 5 6 7) (1 64 300) simpleGrading (1 1 ((0.3 0.1 1) (0.4 0.4 1) (0.3 0.6 1)))
        hex (3 2 9 8 7 6 11 10) (1 144 300) simpleGrading (1 1 ((0.3 0.1 1) (0.4 0.4 1) (0.3 0.6 1)))
        hex (8 9 13 12 10 11 15 14) (1 64 300) simpleGrading (1 1 ((0.3 0.1 1) (0.4 0.4 1) (0.3 0.6 1)))
);

The difference here is that the number of cells in each direction after the "hex (0 1 2...)" section are changed, which I think is a result of the vertices that you define as a part of that hex section. On my second attempt I followed this page as closely as possible:
https://www.openfoam.com/documentati.../blockMesh.php
Good luck!

john myce November 15, 2018 11:47

Hi Sammy,


When you did your blockMesh modification, did you change also the coordinate of the coneNozzleInjector or you just kept the initial one



Cheers

kk415 May 29, 2023 08:02

Hello Foamers,


I am developing a coupled solver of interFoam and SprayFoam, i.e. particles are injected from the VOF fluid. I am getting this similar issue as mentioned in the topic for my parallel run. I guess I need some modification in my code for the parallel run. But I have no idea where and which way to do the modification. How such kind of modifications are done!! Anyone can help me with any reference material. I deeply appreciate.


Krishna Kant


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