diff --git a/src/lagrangian/dieselSpray/parcel/parcel.C b/src/lagrangian/dieselSpray/parcel/parcel.C index fb4349fec0..6a560dcd47 100644 --- a/src/lagrangian/dieselSpray/parcel/parcel.C +++ b/src/lagrangian/dieselSpray/parcel/parcel.C @@ -38,21 +38,20 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - defineParticleTypeNameAndDebug(parcel, 0); defineTemplateTypeNameAndDebug(Cloud, 0); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -parcel::parcel +Foam::parcel::parcel ( const Cloud& cloud, const vector& position, - const label celli, + const label cellI, const vector& n, const scalar d, const scalar T, @@ -67,14 +66,13 @@ parcel::parcel const vector& U, const vector& Uturb, const scalarField& X, - const List& fuelNames + const List& liquidNames ) : - Particle(cloud, position, celli), - - fuelNames_ + Particle(cloud, position, cellI), + liquidComponents_ ( - fuelNames + liquidNames ), d_(d), T_(T), @@ -96,7 +94,7 @@ parcel::parcel // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool parcel::move(spray& sDB) +bool Foam::parcel::move(spray& sDB) { const polyMesh& mesh = cloud().pMesh(); const polyBoundaryMesh& pbMesh = mesh.boundaryMesh(); @@ -329,7 +327,7 @@ bool parcel::move(spray& sDB) } -void parcel::updateParcelProperties +void Foam::parcel::updateParcelProperties ( const scalar dt, spray& sDB, @@ -638,18 +636,16 @@ void parcel::updateParcelProperties } -void parcel::transformProperties(const tensor& T) +void Foam::parcel::transformProperties(const tensor& T) { U_ = transform(T, U_); } -void parcel::transformProperties(const vector&) +void Foam::parcel::transformProperties(const vector&) {} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/parcel/parcel.H b/src/lagrangian/dieselSpray/parcel/parcel.H index ab5a1f3684..9a6603e765 100644 --- a/src/lagrangian/dieselSpray/parcel/parcel.H +++ b/src/lagrangian/dieselSpray/parcel/parcel.H @@ -54,7 +54,7 @@ class parcel // Private member data // Reference to the names of the liquid components - List fuelNames_; + List liquidComponents_; // Defining data (read and written to field files) @@ -85,7 +85,7 @@ class parcel //- Part of liquid core (1-fully liquid, 0-droplet) scalar liquidCore_; - //- injected from injector + //- injected from injector // Should really be a label, but is scalar due to // post-processing reasons scalar injector_; @@ -100,7 +100,7 @@ class parcel // in which the particle moves vector n_; - //- Liquid fuel molar fractions + //- Liquid components molar fractions scalarField X_; // Derived state information (not read or written) @@ -166,7 +166,7 @@ public: const vector& U, const vector& Uturb, const scalarField& X, - const List& fuelNames + const List& liquidNames ); //- Construct from Istream reading field values if required @@ -182,7 +182,10 @@ public: // Access - //- Return the names of the liquid fuel components + //- Return the names of the liquid components + inline const List& liquidNames() const; + + //- Return the names of the liquid fuel components - identical with liquidNames inline const List& fuelNames() const; //- Return diameter of droplets in parcel @@ -265,10 +268,10 @@ public: //- Return the normal used for 2D purposes inline vector& n(); - //- Return the liquid fuel molar fractions + //- Return the liquid components molar fractions inline const scalarField& X() const; - //- Return the liquid fuel molar fractions + //- Return the liquid components molar fractions inline scalarField& X(); //- Return the momentum relaxation time of droplets in parcel @@ -355,7 +358,7 @@ public: void transformProperties(const vector& separation); //- fix the 2D plane normal, - // when particle hits a face it is slightly perturbed + // when particle hits a face it is slightly perturbed // towards the face centre and n_ will no longer be valid inline void correctNormal(const vector& sym); diff --git a/src/lagrangian/dieselSpray/parcel/parcelI.H b/src/lagrangian/dieselSpray/parcel/parcelI.H index a51e452b3c..8aaf418a30 100644 --- a/src/lagrangian/dieselSpray/parcel/parcelI.H +++ b/src/lagrangian/dieselSpray/parcel/parcelI.H @@ -31,9 +31,14 @@ namespace Foam // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +inline const List& parcel::liquidNames() const +{ + return liquidComponents_; +} + inline const List& parcel::fuelNames() const { - return fuelNames_; + return liquidComponents_; } inline scalar parcel::d() const @@ -115,7 +120,7 @@ inline scalar parcel::tTurb() const { return tTurb_; } - + inline scalar& parcel::liquidCore() { return liquidCore_; @@ -135,7 +140,7 @@ inline scalar parcel::injector() const { return injector_; } - + inline const vector& parcel::U() const { return U_; diff --git a/src/lagrangian/dieselSpray/parcel/parcelIO.C b/src/lagrangian/dieselSpray/parcel/parcelIO.C index 8334d9ca0d..301fc5b928 100644 --- a/src/lagrangian/dieselSpray/parcel/parcelIO.C +++ b/src/lagrangian/dieselSpray/parcel/parcelIO.C @@ -38,17 +38,17 @@ Foam::parcel::parcel : Particle(cloud, is), - fuelNames_ + liquidComponents_ ( (cloud.pMesh().lookupObject("thermophysicalProperties")) - .lookup("liquidFuelComponents") + .lookup("liquidComponents") ), - X_(fuelNames_.size(), 0.0), + X_(liquidComponents_.size(), 0.0), tMom_(GREAT) { - label nX = fuelNames_.size(); + label nX = X_.size(); if (readFields) { @@ -67,7 +67,7 @@ Foam::parcel::parcel is >> U_; is >> Uturb_; is >> n_; - for(label j=0; j(&d_), sizeof(d_) + sizeof(T_) + sizeof(m_) + sizeof(y_) + sizeof(yDot_) + sizeof(ct_) + sizeof(ms_) + sizeof(tTurb_) - + sizeof(liquidCore_) + sizeof(injector_) + + sizeof(liquidCore_) + sizeof(injector_) + sizeof(U_) + sizeof(Uturb_) + sizeof(n_) ); @@ -175,11 +175,10 @@ void Foam::parcel::readFields const parcel& p0 = iter(); label nX = p0.X().size(); - List names(p0.fuelNames()); + const List& names = p0.liquidNames(); for (label j=0; j X(c.fieldIOobject(names[j])); label i = 0; @@ -262,8 +261,7 @@ void Foam::parcel::writeFields const parcel& p0 = iter(); label nX = p0.X().size(); - - List names(p0.fuelNames()); + const List& names = p0.liquidNames(); for (label j=0; j(&p.d_), sizeof(p.d_) + sizeof(p.T_) + sizeof(p.m_) + sizeof(p.y_) - + sizeof(p.yDot_) + sizeof(p.ct_) + sizeof(p.ms_) + sizeof(p.tTurb_) + + sizeof(p.yDot_) + sizeof(p.ct_) + sizeof(p.ms_) + sizeof(p.tTurb_) + sizeof(p.liquidCore_) + sizeof(p.injector_) + sizeof(p.U_) + sizeof(p.Uturb_) + sizeof(p.n_) ); diff --git a/src/lagrangian/dieselSpray/spray/spray.C b/src/lagrangian/dieselSpray/spray/spray.C index 5f36578bee..bb51c0d299 100644 --- a/src/lagrangian/dieselSpray/spray/spray.C +++ b/src/lagrangian/dieselSpray/spray/spray.C @@ -63,7 +63,7 @@ Foam::spray::spray const dictionary& environmentalProperties ) : - Cloud(U.mesh()), + Cloud(U.mesh(), false), // suppress className checking on positions runTime_(U.time()), time0_(runTime_.value()), mesh_(U.mesh()), diff --git a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C b/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C index e738b16533..7705c401b6 100644 --- a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C +++ b/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C @@ -29,10 +29,8 @@ License #include "specie.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -namespace Foam -{ - const scalar liquidMixture::TrMax = 0.999; -} + +const Foam::scalar Foam::liquidMixture::TrMax = 0.999; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -42,17 +40,35 @@ Foam::liquidMixture::liquidMixture const dictionary& thermophysicalProperties ) : - components_(thermophysicalProperties.lookup("liquidFuelComponents")), + components_(thermophysicalProperties.lookup("liquidComponents")), properties_(components_.size()) { - + // use sub-dictionary "liquidProperties" if possible to avoid + // collisions with identically named gas-phase entries + // (eg, H2O liquid vs. gas) forAll(components_, i) { - properties_.set + const dictionary* subDictPtr = thermophysicalProperties.subDictPtr ( - i, - liquid::New(thermophysicalProperties.lookup(components_[i])) + "liquidProperties" ); + + if (subDictPtr) + { + properties_.set + ( + i, + liquid::New(subDictPtr->lookup(components_[i])) + ); + } + else + { + properties_.set + ( + i, + liquid::New(thermophysicalProperties.lookup(components_[i])) + ); + } } } @@ -347,7 +363,7 @@ Foam::scalar Foam::liquidMixture::mu mu += x[i]*log(properties_[i].mu(p, Ti)); } } - + return exp(mu); } @@ -390,7 +406,7 @@ Foam::scalar Foam::liquidMixture::K K += phii[i]*phii[j]*Kij; } } - + return K; } @@ -412,7 +428,7 @@ Foam::scalar Foam::liquidMixture::D Dinv += x[i]/properties_[i].D(p, Ti); } } - + return 1.0/Dinv; } diff --git a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.H b/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.H index 227197cca7..4b03c2efc3 100644 --- a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.H +++ b/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.H @@ -34,6 +34,48 @@ Description For now it does not do much, since the perfect gas equation is used. + The dictionary constructor searches for the entry @c liquidComponents, + which is a wordList. The liquid properties of each component can either + be contained within a @c liquidProperties sub-dictionary or (for legacy + purposes) can be found directly in the dictionary. + The @c liquidProperties sub-dictionary entry should be used when possible + to avoid conflicts with identically named gas-phase entries. + + A simple example of a single-component liquidMixture: + @verbatim + liquidComponents + ( + H2O + ); + + // the gas-phase species + species + ( + AIR H2O + ); + + // thermo values from BurcatCpData + AIR + AIR 1 28.96518 // specie: name/nMoles/MolWt + 200 6000 1000 // low/high/common temperature + 3.0879272 0.0012459718 -4.2371895e-07 6.7477479e-11 -3.9707697e-15 -995.26275 5.9596093 // 7 upper Temp. coeffs + 3.5683962 -0.00067872943 1.5537148e-06 -3.2993706e-12 -4.6639539e-13 -1062.3466 3.7158296 // 7 lower Temp. coeffs + 1.4792e-06 116 // sutherlandTransport for AIR (STAR-CD) + ; + H2O + H2O 1 18.01528 // specie: name/nMoles/MolWt + 200 6000 1000 // low/high/common temperature + 2.6770389 0.0029731816 -7.7376889e-07 9.4433514e-11 -4.2689991e-15 -29885.894 6.88255 // 7 upper Temp. coeffs + 4.1986352 -0.0020364017 6.5203416e-06 -5.4879269e-09 1.771968e-12 -30293.726 -0.84900901 // 7 lower Temp. coeffs + 1.4792e-06 116 // sutherlandTransport for AIR (STAR-CD) + ; + + liquidProperties + { + H2O H2O defaultCoeffs; + } + @endverbatim + \*---------------------------------------------------------------------------*/ #ifndef liquidMixture_H @@ -51,7 +93,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class liquidMixture Declaration + Class liquidMixture Declaration \*---------------------------------------------------------------------------*/ class liquidMixture diff --git a/tutorials/dieselFoam/aachenBomb/constant/chemistryProperties b/tutorials/dieselFoam/aachenBomb/constant/chemistryProperties index 3996112f54..06093fea0a 100644 --- a/tutorials/dieselFoam/aachenBomb/constant/chemistryProperties +++ b/tutorials/dieselFoam/aachenBomb/constant/chemistryProperties @@ -1,23 +1,17 @@ -/*---------------------------------------------------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.4 | +| \\ / O peration | Version: 1.4.2 | | \\ / A nd | Web: http://www.openfoam.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { - version 2.0; - format ascii; - - root ""; - case ""; - instance ""; - local ""; - - class dictionary; - object chemistryProperties; + version 2.0; + format ascii; + class dictionary; + object chemistryProperties; + location "constant"; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/dieselFoam/aachenBomb/constant/combustionProperties b/tutorials/dieselFoam/aachenBomb/constant/combustionProperties index 73082b6d72..43bef0bdd7 100644 --- a/tutorials/dieselFoam/aachenBomb/constant/combustionProperties +++ b/tutorials/dieselFoam/aachenBomb/constant/combustionProperties @@ -1,23 +1,17 @@ -/*---------------------------------------------------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.4 | +| \\ / O peration | Version: 1.4.2 | | \\ / A nd | Web: http://www.openfoam.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { - version 2.0; - format ascii; - - root ""; - case ""; - instance ""; - local ""; - - class dictionary; - object combustionProperties; + version 2.0; + format ascii; + class dictionary; + object combustionProperties; + location "constant"; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -27,11 +21,8 @@ Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0 ; ignitionProperties1 { ignite off; - ignitionPoint ignitionPoint [ 0 1 0 0 0 0 0 ] ( 0.2 0 0.02 ) ; - timing timing [ 0 0 1 0 0 0 0 ] 0.0e-1 ; - duration duration [ 0 0 1 0 0 0 0 ] 1.0e-0 ; } diff --git a/tutorials/dieselFoam/aachenBomb/constant/environmentalProperties b/tutorials/dieselFoam/aachenBomb/constant/environmentalProperties index 5fc1e5744b..7cdfff6c15 100644 --- a/tutorials/dieselFoam/aachenBomb/constant/environmentalProperties +++ b/tutorials/dieselFoam/aachenBomb/constant/environmentalProperties @@ -1,23 +1,17 @@ -/*---------------------------------------------------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.4 | +| \\ / O peration | Version: 1.4.2 | | \\ / A nd | Web: http://www.openfoam.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { - version 2.0; - format ascii; - - root ""; - case ""; - instance ""; - local ""; - - class dictionary; - object environmentalProperties; + version 2.0; + format ascii; + class dictionary; + object environmentalProperties; + location "constant"; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/dieselFoam/aachenBomb/constant/injectorProperties b/tutorials/dieselFoam/aachenBomb/constant/injectorProperties index 6ea83c8b2e..3cf9ca8b17 100644 --- a/tutorials/dieselFoam/aachenBomb/constant/injectorProperties +++ b/tutorials/dieselFoam/aachenBomb/constant/injectorProperties @@ -1,23 +1,17 @@ -/*---------------------------------------------------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.4 | +| \\ / O peration | Version: 1.4.2 | | \\ / A nd | Web: http://www.openfoam.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { - version 2.0; - format ascii; - - root ""; - case ""; - instance ""; - local ""; - - class dictionary; - object injectorProperties; + version 2.0; + format ascii; + class dictionary; + object injectorProperties; + location "constant"; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/dieselFoam/aachenBomb/constant/sprayProperties b/tutorials/dieselFoam/aachenBomb/constant/sprayProperties index 6a2da5efee..1da8277176 100644 --- a/tutorials/dieselFoam/aachenBomb/constant/sprayProperties +++ b/tutorials/dieselFoam/aachenBomb/constant/sprayProperties @@ -1,23 +1,17 @@ -/*---------------------------------------------------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.4 | +| \\ / O peration | Version: 1.4.2 | | \\ / A nd | Web: http://www.openfoam.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { - version 2.0; - format ascii; - - root ""; - case ""; - instance ""; - local ""; - - class dictionary; - object sprayProperties; + version 2.0; + format ascii; + class dictionary; + object sprayProperties; + location "constant"; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -61,11 +55,11 @@ wallModel reflect; specConstAtomizationCoeffs { - dropletNozzleDiameterRatio + dropletNozzleDiameterRatio ( 0.4 ); - sprayAngle + sprayAngle ( 10 ); @@ -142,9 +136,9 @@ hollowConeInjectorCoeffs { dropletPDF { - //pdfType exponential; + //pdfType exponential; pdfType RosinRammler; - + RosinRammlerPDF { minValue 1.00e-6; @@ -154,7 +148,7 @@ hollowConeInjectorCoeffs ( 1.5e-4 ); - + n ( 3 diff --git a/tutorials/dieselFoam/aachenBomb/constant/thermophysicalProperties b/tutorials/dieselFoam/aachenBomb/constant/thermophysicalProperties index 7bd9332284..f3643830b8 100644 --- a/tutorials/dieselFoam/aachenBomb/constant/thermophysicalProperties +++ b/tutorials/dieselFoam/aachenBomb/constant/thermophysicalProperties @@ -1,39 +1,38 @@ -/*---------------------------------------------------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.4 | +| \\ / O peration | Version: 1.4.2 | | \\ / A nd | Web: http://www.openfoam.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { - version 2.0; - format ascii; - - root ""; - case ""; - instance ""; - local ""; - - class dictionary; - object thermodynamicProperties; + version 2.0; + format ascii; + class dictionary; + object thermodynamicProperties; + location "constant"; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ thermoType hMixtureThermo; -CHEMKINFile "$FOAM_ROOT/$FOAM_CASE/chemkin/chem.inp"; -CHEMKINThermoFile "$FOAM_ROOT/$FOAM_CASE/chemkin/therm.dat"; +CHEMKINFile "$FOAM_CASE/chemkin/chem.inp"; +// We use the central thermo data: +CHEMKINThermoFile "~OpenFOAM/thermoData/therm.dat"; -inertSpecie N2; +inertSpecie N2; -liquidFuelComponents +liquidComponents ( C7H16 ); -C7H16 C7H16 defaultCoeffs; +liquidProperties +{ + C7H16 C7H16 defaultCoeffs; + C7H16 +} /*********************************************************************/ diff --git a/tutorials/dieselFoam/aachenBomb/constant/turbulenceProperties b/tutorials/dieselFoam/aachenBomb/constant/turbulenceProperties index 55dc7293e0..80f2b97b30 100644 --- a/tutorials/dieselFoam/aachenBomb/constant/turbulenceProperties +++ b/tutorials/dieselFoam/aachenBomb/constant/turbulenceProperties @@ -1,23 +1,17 @@ -/*---------------------------------------------------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.4 | +| \\ / O peration | Version: 1.4.2 | | \\ / A nd | Web: http://www.openfoam.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { - version 2.0; - format ascii; - - root ""; - case ""; - instance ""; - local ""; - - class dictionary; - object turbulenceProperties; + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; + location "constant"; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //