From ef58ca596691867a9a9dc12852c8a21a39c90a07 Mon Sep 17 00:00:00 2001 From: ignis Date: Fri, 4 Aug 2017 00:11:27 +0900 Subject: [PATCH] read wordList of specie names to postprocess --- examples/FlameD_SLFM/constant/SLFMdict | 2 +- solvers_post/SLFMFoam/SLFMFoam.C | 4 +++- solvers_post/SLFMFoam/createFields.H | 14 +++++++++++++- solvers_post/SLFMFoam/preIntegration.H | 9 +++++---- solvers_post/SLFMFoam/updateYi.H | 14 ++++++++------ 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/examples/FlameD_SLFM/constant/SLFMdict b/examples/FlameD_SLFM/constant/SLFMdict index 30e24d8..ef97d9f 100644 --- a/examples/FlameD_SLFM/constant/SLFMdict +++ b/examples/FlameD_SLFM/constant/SLFMdict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -postSpeciesN 2; //number of species for post-processing +postSpecieNames (CO OH); //names of species for post-processing stoiMF 0.351; //stoichiometric mixture fraction stretchFactor 1.05; lowerN 20; //number of eta-space under stoichiometric value diff --git a/solvers_post/SLFMFoam/SLFMFoam.C b/solvers_post/SLFMFoam/SLFMFoam.C index fa459d7..70e2244 100644 --- a/solvers_post/SLFMFoam/SLFMFoam.C +++ b/solvers_post/SLFMFoam/SLFMFoam.C @@ -90,12 +90,14 @@ int main(int argc, char *argv[]) turbulence->correct(); + #include "updateYi.H" //update species if(runTime.write() == true) { rho.write(); #include "updateYi.H" //update species - for(label y=0 ; y& Y = composition.Y(); +forAll (Y, i) +{ + Y[i].writeOpt() = IOobject::NO_WRITE; +} word inertSpecie(thermo.lookup("inertSpecie")); @@ -291,7 +295,15 @@ IOdictionary SLFMdict //SLFM properties dictionary ); label Ysize = Y.size(); -scalar postSpeciesN(readScalar(SLFMdict.lookup("postSpeciesN"))); +wordList postSpecieNames(SLFMdict.lookup("postSpecieNames")); +labelList postSpecieIndices(postSpecieNames.size(),-1); +forAll(postSpecieNames, i) +{ + const word &spName (postSpecieNames[i]); + const label spI (composition.species()[spName]); + postSpecieIndices[i] = spI; + Y[spI].writeOpt() = IOobject::AUTO_WRITE; +} scalar stoiMF(readScalar(SLFMdict.lookup("stoiMF"))); scalar stretchFac(readScalar(SLFMdict.lookup("stretchFactor"))); scalar lowerN(readScalar(SLFMdict.lookup("lowerN"))); diff --git a/solvers_post/SLFMFoam/preIntegration.H b/solvers_post/SLFMFoam/preIntegration.H index b0a60cb..a1b8d86 100644 --- a/solvers_post/SLFMFoam/preIntegration.H +++ b/solvers_post/SLFMFoam/preIntegration.H @@ -26,9 +26,9 @@ scalarFieldArray2d Rtable scalarFieldArray3d Ytable ( - postSpeciesN, + postSpecieNames.size(), scalarFieldArray2d - ( + ( etamax+1, scalarFieldArray1d ( @@ -55,9 +55,10 @@ for(label j=0 ; j<=etamax ; j++) { Ttable[j][v][n] = bpdf.evaluate(mf, mfVar, etaValue, Y_SLFM[n][Ysize]); Rtable[j][v][n] = bpdf.evaluate(mf, mfVar, etaValue, Rgas_SLFM[n]); - for(label y=0 ; y