int DLL_EXPORT stflow_new(int iph, int ikin, int itr, int itype) { try { IdealGasPhase* ph = (IdealGasPhase*)_thermo(iph); if (itype == 1) { AxiStagnFlow* x = new AxiStagnFlow(ph, ph->nSpecies(), 2); x->setKinetics(*_kinetics(ikin)); x->setTransport(*_transport(itr)); return Cabinet<Domain1D>::cabinet()->add(x); } else if (itype == 2) { FreeFlame* x = new FreeFlame(ph, ph->nSpecies(), 2); x->setKinetics(*_kinetics(ikin)); x->setTransport(*_transport(itr)); return Cabinet<Domain1D>::cabinet()->add(x); } else { return -2; } } catch (CanteraError) { return -1; } }
int stflow_new(int iph, int ikin, int itr, int itype) { try { IdealGasPhase& ph = ThermoCabinet::get<IdealGasPhase>(iph); if (itype == 1) { AxiStagnFlow* x = new AxiStagnFlow(&ph, ph.nSpecies(), 2); x->setKinetics(KineticsCabinet::item(ikin)); x->setTransport(TransportCabinet::item(itr)); return DomainCabinet::add(x); } else if (itype == 2) { FreeFlame* x = new FreeFlame(&ph, ph.nSpecies(), 2); x->setKinetics(KineticsCabinet::item(ikin)); x->setTransport(TransportCabinet::item(itr)); return DomainCabinet::add(x); } else { return -2; } } catch (...) { return handleAllExceptions(-1, ERR); } }