change variables' types, seperate Y and T SLFM lib

This commit is contained in:
ignis 2017-08-22 02:54:56 +09:00
parent b1d623fff5
commit aee22e8680
2 changed files with 63 additions and 20 deletions

View file

@ -295,8 +295,8 @@ IOdictionary SLFMdict //SLFM properties dictionary
)
);
label Ysize = Y.size();
wordList postSpecieNames(SLFMdict.lookup("postSpecieNames"));
const label Ysize = Y.size();
const wordList postSpecieNames(SLFMdict.lookup("postSpecieNames"));
labelList postSpecieIndices(postSpecieNames.size(),-1);
forAll(postSpecieNames, i)
{

View file

@ -30,6 +30,16 @@ scalarFieldArray2d W_SLFM //reaction rate [1/sec]
scalarField(etamax+1,0)
)
);
scalarFieldArray1d T_SLFM //Temperature [-]
(
NstList.size(),
scalarField(etamax+1,0)
);
scalarFieldArray1d Q_SLFM //Heat source [1/sec]
(
NstList.size(),
scalarField(etamax+1,0)
);
scalarFieldArray1d rho_SLFM //density [g/cm3]
(
NstList.size(),
@ -54,7 +64,7 @@ for(label n=0 ; n<NstList.size() ; n++)
IFstream fin(runTime.constant()/NstFolder/fname);
string gbg;
scalar etamax_SLFM, NoSpecies;
label etamax_SLFM, NoSpecies;
//INPUT FILE...
fin.getLine(gbg);
@ -64,7 +74,6 @@ for(label n=0 ; n<NstList.size() ; n++)
//Number of eta-point and species
fin>>etamax_SLFM>>NoSpecies;
etamax_SLFM = etamax_SLFM-1;
//blank line
fin.getLine(gbg);
@ -79,8 +88,8 @@ for(label n=0 ; n<NstList.size() ; n++)
fin.getLine(gbg);
//read eta space (from SLFM library)
scalarField etaValue_SLFM(etamax_SLFM+1, 0.0);
for(label j=0 ; j<=etamax_SLFM ; j++)
scalarField etaValue_SLFM(etamax_SLFM, 0.0);
for(label j=0 ; j<etamax_SLFM ; j++)
{
fin>>etaValue_SLFM[j];
}
@ -91,25 +100,32 @@ for(label n=0 ; n<NstList.size() ; n++)
//INITIAL...
fin.getLine(gbg);
//species and temperature loop
scalarField Y_temp(etamax_SLFM+1, 0.0);
scalarField W_temp(etamax_SLFM+1, 0.0);
for(label i=0 ; i<=NoSpecies ; i++)
//species loop
scalarField Y_temp(etamax_SLFM, 0.0);
scalarField W_temp(etamax_SLFM, 0.0);
for(label i=0 ; i<NoSpecies ; i++)
{
//H2... (species name)
fin.getLine(gbg);
string spLine;
fin.getLine(spLine);
IStringStream spStream(spLine);
word spName;
spStream >> spName;
const label spI (composition.species()[spName]);
// Info<<spI << spName << endl;
//read species mass fraction (from SLFM library)
for(label j=0 ; j<=etamax_SLFM ; j++)
for(label j=0 ; j<etamax_SLFM ; j++)
{
fin>>Y_temp[j];
scalar Yj = 0.0;
fin >> Yj;
Y_temp[j] = max(0.0, Yj);
}
Y_temp = max(0.0, Y_temp);
Y_SLFM[n][i] = interpolateXY(etaValue, etaValue_SLFM, Y_temp);
Y_SLFM[n][spI] = interpolateXY(etaValue, etaValue_SLFM, Y_temp);
//read reaction rate (from SLFM library)
for(label j=0 ; j<=etamax_SLFM ; j++)
for(label j=0 ; j<etamax_SLFM ; j++)
{
fin>>W_temp[j];
}
@ -120,12 +136,39 @@ for(label n=0 ; n<NstList.size() ; n++)
fin.getLine(gbg);
}
//read temperature
{
//H2... (species name)
fin.getLine(gbg);
//read temperature
for(label j=0 ; j<etamax_SLFM ; j++)
{
scalar Yj = 0.0;
fin >> Yj;
Y_temp[j] = max(0.0, Yj);
}
Y_SLFM[n].last() = interpolateXY(etaValue, etaValue_SLFM, Y_temp);
//read heat source
for(label j=0 ; j<etamax_SLFM ; j++)
{
fin>>W_temp[j];
}
W_SLFM[n].last() = interpolateXY(etaValue, etaValue_SLFM, W_temp);
//blank line
fin.getLine(gbg);
}
//DENSITY...
fin.getLine(gbg);
//read density (from SLFM library)
scalarField rho_temp(etamax_SLFM+1, 0.0);
for(label j=0 ; j<=etamax_SLFM ; j++)
scalarField rho_temp(etamax_SLFM, 0.0);
for(label j=0 ; j<etamax_SLFM ; j++)
{
fin>>rho_temp[j];
}
@ -140,8 +183,8 @@ for(label n=0 ; n<NstList.size() ; n++)
fin.getLine(gbg);
//read enthalpy (from SLFM library)
scalarField h_temp(etamax_SLFM+1, 0.0);
for(label j=0 ; j<=etamax_SLFM ; j++)
scalarField h_temp(etamax_SLFM, 0.0);
for(label j=0 ; j<etamax_SLFM ; j++)
{
fin>>h_temp[j];
}