From e63c31994f73445f2f1e9ffa3a2f9e235859760f Mon Sep 17 00:00:00 2001 From: Yeongdo Park Date: Wed, 31 Oct 2018 00:16:51 -0400 Subject: [PATCH] cantera read gri and viscosity calculation --- testApp/Make/options | 5 ++++- testApp/chemFoam.C | 26 +++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/testApp/Make/options b/testApp/Make/options index d08ab34..d57f8a5 100644 --- a/testApp/Make/options +++ b/testApp/Make/options @@ -12,4 +12,7 @@ EXE_LIBS = \ -lchemistryModel \ -lfiniteVolume \ -lmeshTools \ - -lcantera + -pthread \ + -lcantera \ + -lsundials_cvodes -lsundials_ida -lsundials_nvecserial \ + -llapack -lblas diff --git a/testApp/chemFoam.C b/testApp/chemFoam.C index a61d3a3..bd6efe7 100644 --- a/testApp/chemFoam.C +++ b/testApp/chemFoam.C @@ -59,12 +59,36 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "createFieldRefs.H" #include "readInitialConditions.H" - #include "createControls.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; + Cantera::IdealGasMix gas_ ("gri30.xml", "gri30_mix"); + Cantera::Transport *tr_ = Cantera::newTransportMgr("Mix", &gas_); + label nCanteraSp_ = gas_.nSpecies(); + + scalarField XY(nCanteraSp_, 0.0); + + scalar Tl = 300; + scalar Tu = 3000; + scalarField T01(100, 0.0); + forAll (T01, i) + { + T01[i] = i * (Tu - Tl) / 100. + Tl; + } + + forAll(thermo.composition().species(), i) + { + XY[i] = Y[i][0]; + } + + forAll(T01, i) + { + gas_.setState_TPY(T01[i], p0, XY.data()); + Info << tr_->viscosity() << endl; + } + Info << "Number of steps = " << runTime.timeIndex() << endl; Info << "End" << nl << endl;