View Issue Details

IDProjectCategoryView StatusLast Update
0000407OpenFOAMBugpublic2012-02-27 15:35
Reporteruser331Assigned Touser2 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSOpenSuseOS Version11.4
Summary0000407: spray classes incompatible with engine time and setNumberOfParticles FPE
DescriptionIn adapting an old case that ran under the dieselEngineFoam solver, there is no injection from a spray specified to occur near top dead center. Comparing dieselSpray with the new Lagrangian spray class, it seems there used to be a mapping of UserTimeToTime. Without this, we are required to input the SOI and duration in seconds as opposed to crank angle, which is not terribly difficult but not intuitive either.

Also, when specifying the injection profile in seconds consistent with the crank angle, there is a floating point error that occurs when setNumberofParticles(const label parcels, const scalar volume, const scalar diameter, const scalar rho) is called. I'm using mass as the parcelBasisType and believe it has something to do with division by a zero somewhere. The profile works under sprayFoam, not sure what is occurring here.
Steps To ReproduceWhen adapting any case that ran under dieselEngineFoam, injection fails to occur at the time specified in crank angle. When the time is specified in seconds injection begins successfully.

At the start of injection, the solver crashes when the Lagrangian library InjectorModel calls setNumberOfParticles.
TagsNo tags attached.

Activities

user2

2012-02-02 18:09

  ~0001000

Thanks for the report. I've pushed a fix under commit id 21430d6 - can you test this for your case and report back?

user331

2012-02-02 19:19

  ~0001001

I will test both the timing spec and crash and get back to you as soon as possible.

user331

2012-02-03 00:44

  ~0001002

Last edited: 2012-02-03 00:55

The fix didn't work. I thought the libraries had complied properly, but when executing Allwmake in lagrangian I get errors like the following:

fatal error: TimeDataEntry.H: No such file or directory

I looked at Make/files and I don't see TimeDataEntry being included in libOpenFoam. That will probably fix the issue.

user2

2012-02-03 08:31

  ~0001003

You will need to regenerate the OpnenFOAM/lnInclude folder

    wmakeLnInclude -f $FOAM_SRC/OpenFOAM

- all should then compile properly

user331

2012-02-03 22:01

  ~0001025

Apologies for the false alarm, that has never happened to me before. Do I need to regenerate after every git update, or just when new files are added?

Running the case now and injection is successful, and all time quantities are specified in crank angles. Thanks much for the quick fix!

user331

2012-02-07 21:46

  ~0001029

Last edited: 2012-02-07 22:17

The issue brought up has been resolved, but now I'm finding a new one: the injected mass isn't the same as the one specified in the file. With the change to lagrangian spray, I realize this may be due to an improperly specified input file. Let me know if you want to keep this under the same bug or to file a new one.

I'm including the old sprayProperties/injectorProperties files and the new sprayCloudProperties file. The ambient pressure at injection is roughly 40 bar. Thanks!

user331

2012-02-07 21:47

 

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

interpolationSchemes
{
    U               cellPointFace;
    rho             cell;
    p               cell;
    T               cell;
}

subCycles       2;

atomizationModel off;

includeOscillation yes;

breakupModel    ReitzKHRT;

injectorModel   hollowConeInjector;

collisionModel  off;

evaporationModel standardEvaporationModel;

heatTransferModel RanzMarshall;

dispersionModel off;

dragModel       standardDragModel;

wallModel       reflect;

specConstAtomizationCoeffs
{
    dropletNozzleDiameterRatio ( 0.4 );
    sprayAngle      ( 10 );
}

TABCoeffs
{
    y0              0;
    yDot0           0;
    Cmu             10;
    Comega          8;
    WeCrit          12;
}

ETABCoeffs
{
    Cmu             10;
    Comega          8;
    WeCrit          12;
    k1              0.2;
    k2              0.2;
    WeTransition    100;
}

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

ReitzKHRTCoeffs
{
    B0              0.61;
    B1              40;
    Ctau            1;
    CRT             0.1;
    msLimit         0.2;
    WeberLimit      6;
}

trajectoryCoeffs
{
    cSpace          1;
    cTime           0.3;
}

standardDragModelCoeffs
{
    preReFactor     0.166667;
    ReExponent      0.666667;
    ReLimiter       1000;
    CdLimiter       0.44;
    Cdistort        2.632;
}

standardEvaporationModelCoeffs
{
    evaporationScheme explicit;
    preReScFactor   0.6;
    ReExponent      0.5;
    ScExponent      0.333333;
}

RanzMarshallCoeffs
{
    preRePrFactor   0.6;
    ReExponent      0.5;
    PrExponent      0.333333;
}

hollowConeInjectorCoeffs
{
    sizeDistribution0
    {
        type        RosinRammler;
        RosinRammlerDistribution
        {
            minValue        1e-06;
            maxValue        0.00015;
            d               0.00015;
            n               3;
        }

        exponentialDistribution
        {
            minValue        0.0001;
            maxValue        0.001;
            lambda          ( 10000 );
        }
    }

    innerConeAngle  ( 0 );
    outerConeAngle  ( 20 );
}

reflectCoeffs
{
    elasticity      0.9;
}


// ************************************************************************* //
sprayProperties (3,052 bytes)   

user331

2012-02-07 21:48

 

injectorProperties (1,782 bytes)   
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.3                                   |
|   \\  /    A nd           | Web:      http://www.openfoam.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version         2.0;
    format          ascii;

    root            "";
    case            "";
    instance        "";
    local           "";

    class           dictionary;
    object          injectorProperties;
}

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

(

//	Injector 1
    {
        injectorType        commonRailInjector;

        commonRailInjectorProps
        {
            position            (0.001200 0.000000 0.105);
            direction           (1.0 0.0 -0.32492);
            diameter            0.00013;
            mass                1.14e-06;
            injectionPressure   300.0e+5;
            temperature         320;
            nParcels            1500;

            X
            (
                1.0
            );

            massFlowRateProfile 
            (                       
                (344 0.5)
                (345 1)
                (348 1)
                (349 0.5) 
            );


            injectionPressureProfile
            (
                (344    1.0)
                (349    1.0)
            );
        }
    } 

)


// ************************************************************************* //
injectorProperties (1,782 bytes)   

user331

2012-02-07 21:49

 

sprayCloud0Properties (4,445 bytes)   
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.x                                 |
|   \\  /    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;

    sourceTerms
    {
        schemes
        {
            rho             explicit 1;
            U               explicit 1;
            Yi              explicit 1;
            hs              explicit 1;
        }
    }

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

    integrationSchemes
    {
        U               Euler;
        T               analytical;
    }
}


constantProperties
{
    parcelTypeId    1;

    rhoMin          1e-15;
    TMin            200;
    pMin            1000;
    minParticleMass 1e-15;

    rho0            1000;
    T0              320;
    Cp0             4187;

    youngsModulus   1e9;
    poissonsRatio   0.35;

    epsilon0        1;
    f0              0.5;
    Pr              0.7;
    Tvap            273;
    Tbp             373;

    constantVolume  false;
}


subModels
{
    particleForces
    {
        sphereDrag;
    }

    injectionModel  coneNozzleInjection;

    dispersionModel none;

    patchInteractionModel standardWallInteraction;

    heatTransferModel RanzMarshall;

    compositionModel singlePhaseMixture;

    phaseChangeModel liquidEvaporationBoil;

    surfaceFilmModel none;

    atomizationModel none;

    breakupModel    ReitzKHRT;

    stochasticCollisionModel none;

    radiation       off;

    coneNozzleInjectionCoeffs
    {
        SOI             344;
        massTotal       1.14e-6;
        parcelBasisType mass;
        injectionMethod disc;
        flowType        pressureDrivenVelocity;
	Pinj		350e5;
        outerDiameter   0.00013;
        innerDiameter   0;
        duration        5;
        position        ( 0.001200 0.0 0.105 );
        direction       ( 1.0 0.0 -0.32492 );
        parcelsPerSecond 5400000;
        flowRateProfile table
	(
	    (0 0.5)
	    (1 1)
	    (4 1)
	    (5 0.5)
        );

        Cd              constant 0.9;

        thetaInner      constant 0.0;
        thetaOuter      constant 20.0;

        sizeDistribution
        {
            type        RosinRammler;

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

    standardWallInteractionCoeffs
    {
        type            rebound;
    }

    RanzMarshallCoeffs
    {
        BirdCorrection  true;
    }

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

    liquidEvaporationBoilCoeffs
    {
        enthalpyTransfer enthalpyDifference;

        activeLiquids    ( C7H16 );
    }

    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
{}


// ************************************************************************* //
sprayCloud0Properties (4,445 bytes)   

user2

2012-02-27 15:34

  ~0001069

Please can you put a small test case together and attach it to a new report?

Thanks,

Andy

user2

2012-02-27 15:35

  ~0001070

engine time code fixed by commit id 21430d6

Issue History

Date Modified Username Field Change
2012-02-01 21:03 user331 New Issue
2012-02-02 18:09 user2 Note Added: 0001000
2012-02-02 19:19 user331 Note Added: 0001001
2012-02-03 00:44 user331 Note Added: 0001002
2012-02-03 00:45 user331 Note Edited: 0001002
2012-02-03 00:55 user331 Note Edited: 0001002
2012-02-03 08:31 user2 Note Added: 0001003
2012-02-03 22:01 user331 Note Added: 0001025
2012-02-07 21:46 user331 Note Added: 0001029
2012-02-07 21:47 user331 File Added: sprayProperties
2012-02-07 21:48 user331 File Added: injectorProperties
2012-02-07 21:49 user331 File Added: sprayCloud0Properties
2012-02-07 22:17 user331 Note Edited: 0001029
2012-02-27 15:34 user2 Note Added: 0001069
2012-02-27 15:35 user2 Note Added: 0001070
2012-02-27 15:35 user2 Status new => resolved
2012-02-27 15:35 user2 Resolution open => fixed
2012-02-27 15:35 user2 Assigned To => user2