added thermal conductivity test and write test result log and save as artifact

This commit is contained in:
Yeongdo Park 2018-11-02 09:18:46 -04:00
parent 03cbca684f
commit 0a89513335
4 changed files with 40 additions and 5 deletions

View file

@ -37,5 +37,7 @@ canteraTest:
- wmake diffusivityModel
- wmake testApp
- ./testApp/canteraTest -case testApp/gri
artifacts:
paths:
- ./testApp/*/canteraTest.log
when: always

View file

@ -130,7 +130,6 @@ int main(int argc, char *argv[])
forAll(thermo.composition().species(), k)
{
// Info << thermo.composition().species()[k] << tab << 100. * (diff.D(k)[0] - Dc[k]) / Dc[k] << endl;
if (exceedTolerence(relError(diff.D(k)[0], Dc[k])))
{
Info << thermo.composition().species()[k] << ", T = " << T[i]
@ -138,15 +137,39 @@ int main(int argc, char *argv[])
errorCount++;
}
testCount++;
post<< thermo.T()[0] << token::TAB
<< thermo.composition().species()[k] << token::TAB
<< diff.D(k)[0] << token::TAB
<< Dc[k] << token::TAB
<< 100*(relError(diff.D(k)[0], Dc[k])) << endl;
}
// Info << "mu" << tab << 100.*(diff.mu()[0] - tr_->viscosity())/tr_->viscosity() << endl;
if (exceedTolerence(relError(diff.mu()[0], tr_->viscosity())))
{
Info << "T = " << T[i] << " relative error = " << (100. * relError(diff.mu()[0], tr_->viscosity())) << " %"<< endl;
Info << "mu, T = " << T[i] << " relative error = " << (100. * relError(diff.mu()[0], tr_->viscosity())) << " %"<< endl;
errorCount++;
}
testCount++;
post<< thermo.T()[0] << token::TAB
<< "mu" << token::TAB
<< diff.mu()[0] << token::TAB
<< tr_->viscosity() << token::TAB
<< 100*(relError(diff.mu()[0], tr_->viscosity())) << endl;
if (exceedTolerence(relError(diff.k()[0], tr_->thermalConductivity())))
{
Info << "k, T = " << T[i] << " relative error = " << (100. * relError(diff.k()[0], tr_->thermalConductivity())) << " %"<< endl;
errorCount++;
}
testCount++;
post<< thermo.T()[0] << token::TAB
<< "k" << token::TAB
<< diff.k()[0] << token::TAB
<< tr_->thermalConductivity() << token::TAB
<< 100*(relError(diff.k()[0], tr_->thermalConductivity())) << endl;
}
Info << errorCount << " / " << testCount << " End" << nl << endl;

View file

@ -64,3 +64,11 @@
);
diffusivityModel diff(thermo);
OFstream post(args.path()/"canteraTest.log");
post << "Temperature [K]" << token::TAB
<< "Property" << token::TAB
<< "OpenFOAM" << token::TAB
<< "Cantera" << token::TAB
<< "Relative Error" << endl;

View file

@ -106,3 +106,5 @@
<< " T = " << thermo.T()[0] << " [K] " << nl
<< " rho = " << rho[0] << " [kg/m3]" << nl
<< endl;
Info << "Mass Fractions" << Y0 << endl;