diff --git a/include/cantera/clib/ctonedim.h b/include/cantera/clib/ctonedim.h index e7c284f32..8ae5e5290 100644 --- a/include/cantera/clib/ctonedim.h +++ b/include/cantera/clib/ctonedim.h @@ -49,19 +49,8 @@ extern "C" { CANTERA_CAPI double bdry_massFraction(int i, int k); CANTERA_CAPI double bdry_mdot(int i); - CANTERA_CAPI int reactingsurf_setkineticsmgr(int i, int j); CANTERA_CAPI int reactingsurf_enableCoverageEqs(int i, int onoff); - CANTERA_CAPI int inlet_new(); - CANTERA_CAPI int outlet_new(); - CANTERA_CAPI int outletres_new(); - CANTERA_CAPI int symm_new(); - CANTERA_CAPI int surf_new(); - CANTERA_CAPI int reactingsurf_new(); - - CANTERA_CAPI int inlet_setSpreadRate(int i, double v); - - CANTERA_CAPI int flow1D_new(int iph, int ikin, int itr, int itype); CANTERA_CAPI int flow1D_setTransport(int i, int itr); CANTERA_CAPI int flow1D_enableSoret(int i, int iSoret); CANTERA_CAPI int flow1D_setPressure(int i, double p); diff --git a/interfaces/matlab_experimental/OneDim/ReactingSurface.m b/interfaces/matlab_experimental/OneDim/ReactingSurface.m index 9d361c580..32a3b5b0c 100644 --- a/interfaces/matlab_experimental/OneDim/ReactingSurface.m +++ b/interfaces/matlab_experimental/OneDim/ReactingSurface.m @@ -38,8 +38,6 @@ classdef ReactingSurface < Boundary1D end s@Boundary1D('reacting-surface', surface_mech, id); - - ctFunc('reactingsurf_setkineticsmgr', s.domainID, surface_mech.kinID); s.coverageEnabled = false; end diff --git a/src/clib/ctonedim.cpp b/src/clib/ctonedim.cpp index a751ef160..0038280aa 100644 --- a/src/clib/ctonedim.cpp +++ b/src/clib/ctonedim.cpp @@ -237,60 +237,6 @@ extern "C" { } } - int inlet_new() - { - try { - return DomainCabinet::add(make_shared()); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int surf_new() - { - try { - return DomainCabinet::add(make_shared()); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int reactingsurf_new() - { - try { - return DomainCabinet::add(make_shared()); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int symm_new() - { - try { - return DomainCabinet::add(make_shared()); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int outlet_new() - { - try { - return DomainCabinet::add(make_shared()); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int outletres_new() - { - try { - return DomainCabinet::add(make_shared()); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int bdry_setMdot(int i, double mdot) { try { @@ -367,17 +313,6 @@ extern "C" { } } - int reactingsurf_setkineticsmgr(int i, int j) - { - try { - auto k = KineticsCabinet::at(j); - DomainCabinet::get(i).setKinetics(k); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int reactingsurf_enableCoverageEqs(int i, int onoff) { try { diff --git a/test/clib/test_ctonedim.cpp b/test/clib/test_ctonedim.cpp index 5134d17da..6325835b9 100644 --- a/test/clib/test_ctonedim.cpp +++ b/test/clib/test_ctonedim.cpp @@ -23,7 +23,7 @@ TEST(ctonedim, freeflow) thermo_setTemperature(ph, T); thermo_setPressure(ph, P); - int flow = domain_new("free-flow", sol, "flow"); + int flow = domain_new("free-flow", sol, ""); ASSERT_GE(flow, 0); domain_setID(flow, "flow"); ASSERT_NEAR(flow1D_pressure(flow), P, 1e-5); @@ -31,75 +31,50 @@ TEST(ctonedim, freeflow) int buflen = domain_type(flow, 0, 0); char* buf = new char[buflen]; domain_type(flow, buflen, buf); - string domName = buf; - ASSERT_EQ(domName, "free-flow"); - delete[] buf; -} - -TEST(ctonedim, freeflow_from_parts) -{ - ct_resetStorage(); - - int sol = soln_newSolution("h2o2.yaml", "ohmech", "default"); - int ph = soln_thermo(sol); - ASSERT_GE(ph, 0); - int kin = soln_kinetics(sol); - ASSERT_GE(kin, 0); - int tr = soln_transport(sol); - ASSERT_GE(tr, 0); - - double T = 1050; - double P = 5 * 101325; - string X = "CH4:1.0, O2:2.0, N2:7.52"; - thermo_setMoleFractionsByName(ph, X.c_str()); - thermo_setTemperature(ph, T); - thermo_setPressure(ph, P); - - int itype = 2; // free flow - int flow = flow1D_new(ph, kin, tr, itype); - ASSERT_GE(flow, 0); - domain_setID(flow, "flow"); - ASSERT_NEAR(flow1D_pressure(flow), P, 1e-5); - - int buflen = domain_type(flow, 0, 0); - char* buf = new char[buflen]; - domain_type(flow, buflen, buf); - string domName = buf; - ASSERT_EQ(domName, "free-flow"); + string domType = buf; + ASSERT_EQ(domType, "free-flow"); delete[] buf; } TEST(ctonedim, inlet) { - int inlet = inlet_new(); + int sol = soln_newSolution("h2o2.yaml", "ohmech", "default"); + int inlet = domain_new("inlet", sol, ""); ASSERT_GE(inlet, 0); int buflen = domain_type(inlet, 0, 0); char* buf = new char[buflen]; domain_type(inlet, buflen, buf); - string domName = buf; - ASSERT_EQ(domName, "inlet"); + string domType = buf; + ASSERT_EQ(domType, "inlet"); delete[] buf; } TEST(ctonedim, outlet) { - int index = outlet_new(); - ASSERT_GE(index, 0); + int sol = soln_newSolution("h2o2.yaml", "ohmech", "default"); + int outlet = domain_new("outlet", sol, ""); + ASSERT_GE(outlet, 0); + + int buflen = domain_type(outlet, 0, 0); + char* buf = new char[buflen]; + domain_type(outlet, buflen, buf); + string domType = buf; + ASSERT_EQ(domType, "outlet"); + delete[] buf; } TEST(ctonedim, reacting_surface) { int interface = soln_newInterface("ptcombust.yaml", "Pt_surf", 0, 0); - int surf = domain_new("reacting-surface", interface, ""); ASSERT_GE(surf, 0); int buflen = domain_type(surf, 0, 0); char* buf = new char[buflen]; domain_type(surf, buflen, buf); - string domName = buf; - ASSERT_EQ(domName, "reacting-surface"); + string domType = buf; + ASSERT_EQ(domType, "reacting-surface"); delete[] buf; } @@ -125,15 +100,13 @@ TEST(ctonedim, catcomb) ASSERT_GE(dom, 0); } -TEST(ctonedim, freeflame_from_parts) +TEST(ctonedim, freeflame) { ct_resetStorage(); auto gas = newThermo("h2o2.yaml", "ohmech"); int sol = soln_newSolution("h2o2.yaml", "ohmech", "default"); int ph = soln_thermo(sol); - int kin = soln_kinetics(sol); - int tr = soln_transport(sol); size_t nsp = thermo_nSpecies(ph); // reactants @@ -157,9 +130,7 @@ TEST(ctonedim, freeflame_from_parts) thermo_getMassFractions(ph, nsp, yout.data()); // flow - int itype = 2; // free flow - int flow = flow1D_new(ph, kin, tr, itype); - domain_setID(flow, "flow"); + int flow = domain_new("free-flow", sol, "flow"); // grid int nz = 21; @@ -173,15 +144,13 @@ TEST(ctonedim, freeflame_from_parts) domain_setupGrid(flow, nz, z.data()); // inlet - int reac = inlet_new(); - domain_setID(reac, "inlet"); + int reac = domain_new("inlet", sol, "inlet"); bdry_setMoleFractions(reac, X.c_str()); bdry_setMdot(reac, uin * rho_in); bdry_setTemperature(reac, T); // outlet - int prod = outlet_new(); - domain_setID(prod, "outlet"); + int prod = domain_new("outlet", sol, "outlet"); double uout = bdry_mdot(reac) / rho_out; // set up stack