Problem in simulating Heterogeneous Reactor

Discusses use of COCO, the process simulation and modelling software suite from AmsterCHEM, downloadable from http://www.cocosimulator.org

Moderator: jasper

Post Reply
antoinetonee
Posts: 7
Joined: 14 October 2020, 13:49

Problem in simulating Heterogeneous Reactor

Post by antoinetonee »

Hi all,

I'm currently facing a problem in simulating heterogeneous reactor with user-defined reaction kinetic expression. The reactor converts NO, CO, and H2O into NH3 and N2, hence it has two reactions (namely NTA_NH3 and NTA_N2, respectively). My intention is to parametrize the dimension and inlet flow rate of the reactor. Disclaimer: the pressure was expressed in kPa, hence it was divided by 1000.

As seen in the attached .fsd file, the simulation for the particular base case worked just fine. However, the parametrization didn't work at all. The main error is "NTA_N2: negative base in power", so I suppose there is something wrong with the rate expression of N2 formation, which I cannot find. What does this error message mean? And does anybody have an idea to solve this problem?

Thanks in advance.
Attachments
rx_NO_CO_H2O_PtRutile_adiab_T_F_dimPar1_rct010_a.fsd
(112.58 KiB) Downloaded 2400 times
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Problem in simulating Heterogeneous Reactor

Post by jasper »

If you apply the two conditions of the failed item to the actual case, 0.275 m diameter and 5.25 mol/s flow rate, you will see that the unit fails with the same message. At this point you can look at the profiles (appended), and you see that the Nitric oxide runs out. However your reaction rates do not appear to become zero at this point (there are additive terms in there, is that intended?); check your reaction. If this is as intended, you could perhaps attempt to continue using

Code: Select all

max(0,X("Nitric oxide"))
instead of

Code: Select all

X("Nitric oxide")

Code: Select all

Position	Nitric oxide flow	Carbon monoxide flow	Water flow	Ammonia flow	Nitrogen flow	Carbon dioxide flow	Temperature	Pressure	Total flow	Density	Viscosity	Superficial velocity	r[NTA_N2]	r[NTA_NH3]	Enthalpy
m	mol/s	mol/s	mol/s	mol/s	mol/s	mol/s	K	Pa	mol/s	mol/m³	Pa s	m/s	mol/s/kg.cat	mol/s/kg.cat	J/mol
0	0.0315	0.07875	0.04725	0	0	0	573	101300	5.24475	21.2597406681	3.72339279547e-05	4.1534746098	1.51923088213e-06	2.45798132647e-06	5797.19704863
0.02	0.0314684768101	0.0786857971077	0.0472173211454	2.17861856654e-05	4.86829018705e-06	6.42028923302e-05	572.901776744	101055.446875	5.24471245243	21.2120617904	3.72292681529e-05	4.16278067589	2.617402184e-06	7.27520565017e-06	5795.15384713
0.04	0.0313881438379	0.0785099185946	0.0471217762917	8.54829838651e-05	1.31862053698e-05	0.000240081405371	572.894717242	100810.340371	5.24460858932	21.1608811339	3.72288381636e-05	4.17276632742	4.47478777906e-06	2.1158920085e-05	5795.08651377
0.06	0.0311986690584	0.078076769068	0.0468781043813	0.000247931869683	2.6698443058e-05	0.000673230931961	573.092169908	100564.60791	5.24435140375	21.1020316055	3.72378930055e-05	4.18419817914	6.878840028e-06	4.94907340768e-05	5799.45521996
0.08	0.0308400639976	0.0772371625965	0.0463970995265	0.000568600624866	4.56674568847e-05	0.00151283740351	573.607194287	100318.13729	5.24385143161	21.031412762	3.72616656489e-05	4.19784755191	9.1920829151e-06	8.67062037532e-05	5810.71711766
0.1	0.0302958807129	0.075948319757	0.0456524338486	0.00106504236911	6.95397578678e-05	0.002801680243	574.470622449	100070.786667	5.24308289669	20.9480190231	3.73015648926e-05	4.21394143531	1.10759489055e-05	0.000122282799272	5829.54685824
0.12	0.0295879433172	0.0742624838546	0.0446745322721	0.00171697573015	9.7542542677e-05	0.00448751614536	575.640911827	99822.415836	5.24207699386	20.8535356336	3.73556363302e-05	4.23222187801	1.25592744632e-05	0.000151338321042	5855.04906161
0.14	0.0287504905347	0.0722628137134	0.0435123146288	0.00249178739753	0.000128863171341	0.00648718628664	577.053108422	99572.9072348	5.24088345573	20.7504928509	3.74208400779e-05	4.25226984724	1.37610137095e-05	0.000173562760882	5885.819923
0.16	0.0278156127511	0.0700275548623	0.0422119337681	0.00335870804027	0.000162841690052	0.00872244513774	578.646355922	99322.1663903	5.23954909625	20.6412345649	3.7494331265e-05	4.27368959986	1.47781260737e-05	0.000190064985064	5920.54347323
0.18	0.0268096890771	0.0676213614563	0.0408116640772	0.0042922211812	0.000199046946343	0.0111286385437	580.370598932	99070.1169411	5.23811262128	20.5276695066	3.75737725603e-05	4.29615474099	1.56737455969e-05	0.000202038085987	5958.13675703
0.2	0.0257517214182	0.06509111096	0.0393393812361	0.00527374307403	0.000237269830354	0.01365888904	582.189760014	98816.7057653	5.23660211556	20.411166972	3.76574801538e-05	4.31943031861	1.64882394969e-05	0.000210460155476	5997.8190792
0.22	0.0246570377025	0.0624746576195	0.0378176116082	0.00628825615825	0.000277355146798	0.0162753423805	584.074742402	98561.8906104	5.23504026062	20.2928138248	3.77440991706e-05	4.34332658233	1.72457814668e-05	0.000216048641368	6038.96023915
0.24	0.0235379583795	0.0598024563219	0.0362644896334	0.00732367080806	0.000319187483489	0.0189475436781	586.002170214	98305.6391981	5.2334453063	20.1734662138	3.78325444217e-05	4.36769089511	1.79609068385e-05	0.000219332522888	6081.05333586
0.26	0.0224047088757	0.0570997976593	0.034695080475	0.00836994358049	0.000362675849014	0.0216502023407	587.952657523	98047.9269293	5.23183240878	20.053816187	3.79219195981e-05	4.3923963787	1.86419683188e-05	0.000220708656823	6123.67728689
0.28	0.0212657956997	0.0543877214379	0.0331219174299	0.00941871894398	0.00040774475526	0.0243622785621	589.910098648	97788.7365681	5.23021417683	19.9344216926	3.80114836414e-05	4.41733730926	1.92933359895e-05	0.000220483900911	6166.48155348
0.3	0.0201283546141	0.0516838621046	0.031555499182	0.0104629977758	0.000454325882175	0.0270661378954	591.861006406	97528.0568094	5.22860117745	19.815733801	3.81006194418e-05	4.44242482988	1.99166402743e-05	0.000218902933749	6209.17189123
0.32	0.0189984016153	0.049003061902	0.0300046519777	0.0114968959119	0.000502353313636	0.029746938098	593.794035272	97265.8814402	5.22700230282	19.6981168429	3.8188811168e-05	4.46758385831	2.05115147887e-05	0.000216166913118	6251.5001042
0.34	0.0178812643764	0.0463584248601	0.0284771521743	0.012515229114	0.000551755332152	0.0323915751399	595.699162515	97002.208114	5.225425401	19.5818788747	3.82756061594e-05	4.49274762319	2.10758966699e-05	0.000212446766403	6293.24629168
0.36	0.0167812377642	0.043760470313	0.0269792242391	0.0135138477374	0.000602459326657	0.034989529687	597.568340623	96737.0388748	5.22387676907	19.467253053	3.83606440873e-05	4.51786219741	2.16065783226e-05	0.000207890360279	6334.23323177
0.38	0.015702075606	0.0412183304362	0.0255162465204	0.0144891662165	0.000654381166224	0.0375316695638	599.394562457	96470.3782909	5.22236186951	19.3544308808	3.84436137203e-05	4.5428802328	2.20991172587e-05	0.000202628734205	6374.30606826
0.4	0.0146470715759	0.0387399455438	0.0240928656581	0.0154380867913	0.000707422893861	0.0400100544562	601.171708509	96202.2334044	5.22088544692	19.2435690496	3.85242455596e-05	4.56775995425	2.25479058412e-05	0.000196780142551	6413.32905451
0.42	0.0136189500854	0.0363317929989	0.0227128346037	0.0163581074943	0.00076147328758	0.0424182070011	602.894753129	95932.6137362	5.21945136547	19.1347845608	3.86023208136e-05	4.59246662976	2.29462751577e-05	0.000190451471988	6451.19015672
0.44	0.0126200260521	0.0339992737812	0.0213792394194	0.0172471709505	0.000816403576127	0.0447507262188	604.559461032	95661.5306954	5.21806284	19.0281660158	3.86776572389e-05	4.61697054578	2.32863969803e-05	0.000183740029014	6487.7944909
0.46	0.0116522405212	0.0317467916307	0.0200945427998	0.0181036353636	0.000872064135037	0.0470032083693	606.16231954	95388.9972914	5.21672248282	18.9237770178	3.87501057655e-05	4.6412465861	2.35592227711e-05	0.000176734157751	6523.06290981
0.48	0.010717170734	0.0295777705141	0.0188605914704	0.0189262695831	0.00092828191885	0.0491722294859	607.700519322	95115.027893	5.21543231371	18.8216578866	3.88195493563e-05	4.66527414488	2.37544024312e-05	0.000169513185637	6556.93164676
0.5	0.00981605743301	0.0274947213524	0.0176786556096	0.0197142268237	0.000984859949092	0.0512552786476	609.171902923	94839.6382271	5.21419379982	18.721828296	3.88859004441e-05	4.68903680854	2.38601577969e-05	0.000162147230426	6589.35124261
0.52	0.0089499074383	0.0254994759882	0.0165495602402	0.02046695707	0.0010415698233	0.0532505240118	610.574770324	94562.8447539	5.21300799457	18.6242939899	3.89490919499e-05	4.71252105266	2.3863135467e-05	0.00015469725383	6620.28233259
0.54	0.0081195322822	0.0235932747906	0.0154737341986	0.021184174431	0.00109814872083	0.0551567252094	611.907806966	94284.6646648	5.21187558963	18.5290495734	3.90090738953e-05	4.73571576061	2.37482932105e-05	0.000147214630014	6649.6941035
0.56	0.00732561304993	0.0217769145945	0.0144512932348	0.0218658017402	0.00115429468236	0.0569730854055	613.169962303	94005.1157878	5.21079700271	18.4360826234	3.90658078212e-05	4.75861139013	2.34988328668e-05	0.000139740749388	6677.56165719
0.58	0.00656874427211	0.0200508489794	0.0134820963975	0.0225119329651	0.00120966345884	0.0586991510206	614.360367059	93724.2164127	5.20977243709	18.3453764325	3.91192629885e-05	4.78119940826	2.30962396452e-05	0.000132306290056	6703.86421478
0.6	0.00584931371831	0.018414916384	0.012565594356	0.0231229343261	0.00126387805522	0.060335083616	615.478559082	93441.9856816	5.20880172046	18.2569035771	3.91694264878e-05	4.8034738952	2.25203620363e-05	0.000124928702357	6728.5900945
0.62	0.00516820921815	0.0168699747502	0.0117017572223	0.0236988257485	0.00131648459408	0.0618800252498	616.523157229	93158.4426111	5.20788527678	18.1706652094	3.92162435683e-05	4.8254221448	2.1750441811e-05	0.000117617390573	6751.70756753
0.64	0.00452576905797	0.0154154740868	0.0108896967192	0.0242401994173	0.00136701783978	0.0633345259132	617.493830594	92873.607542	5.20702268303	18.0866327792	3.92597062031e-05	4.84703861326	2.07653674647e-05	0.000110361213126	6773.20815448
0.66	0.00392284501885	0.0140519743174	0.0101291209888	0.0247472499042	0.0014149546159	0.0646980256826	618.389298753	92587.5011852	5.20621417053	18.0048070489	3.92997632021e-05	4.86831071988	1.95463486142e-05	0.000103137470509	6793.06262545
0.68	0.00336064455676	0.0127807808621	0.00942012799558	0.0252199118997	0.0014597238492	0.0659692191379	619.207627948	92300.1448726	5.2054604083	17.9252087387	3.93363336181e-05	4.88922086949	1.80805386845e-05	9.59084280872e-05	6811.22749081
0.7	0.00284019980721	0.011602670682	0.00876246256504	0.0256583555201	0.00150072441379	0.067147329318	619.947231536	92011.5609087	5.20476174231	17.8478493037	3.93693516207e-05	4.90975356558	1.63649407241e-05	8.86118955829e-05	6827.66704471
0.72	0.00236324005086	0.0105204994389	0.00815725107828	0.0260618298446	0.00153746712971	0.0682295005611	620.605165088	91721.7734968	5.2041197881	17.7727803066	3.93986903307e-05	4.92988334743	1.4414872374e-05	8.11821141466e-05	6842.31551733
0.74	0.00193163330714	0.00953716419448	0.00760552257762	0.026429648845	0.00156936100136	0.0692128358055	621.178262369	91430.8072561	5.20353616573	17.7000598433	3.94242124035e-05	4.94958256915	1.22736126207e-05	7.35374391946e-05	6855.1024682
0.76	0.00154716947767	0.00865603605974	0.00710885827235	0.0267607583819	0.00159603814766	0.0700939639403	621.663423037	91138.6887127	5.20301282428	17.6297446985	3.94457833308e-05	4.96882388695	1.0018692477e-05	6.56090221323e-05	6865.95864938
0.78	0.00121113295842	0.00788022956115	0.00666908829302	0.0270539383681	0.00161746641418	0.0708697704388	622.0583777	90845.4464726	5.20255162603	17.5618690166	3.9463305729e-05	4.98758598292	7.76314640423e-06	5.73676160518e-05	6874.83274997
0.8	0.000925589991255	0.00721467411381	0.00628907581284	0.0273072800216	0.00163356707104	0.0715353258862	622.359399782	90551.1105098	5.2021555129	17.4965092013	3.94766163648e-05	5.00583640333	5.65935217979e-06	4.89000132029e-05	6881.64145369
0.82	0.000690308979803	0.00666023628956	0.00596991900004	0.0275200512301	0.0016448219725	0.0720897637104	622.566889422	90255.7115708	5.20182510118	17.4336267302	3.94857366069e-05	5.02357318762	3.85147744007e-06	4.04209443833e-05	6886.3919098
0.84	0.000503297079945	0.00621455050737	0.00571124511771	0.027692500485	0.00165210329498	0.0725354494926	622.684423706	89959.2808026	5.20155914598	17.3730969606	3.94908295453e-05	5.04081812943	2.43934325066e-06	3.22942560181e-05	6889.16106507
0.86	0.000359558615509	0.00586816985622	0.00550860293099	0.0278275952761	0.00165642513163	0.0728818301438	622.721187082	89661.8461383	5.20135218195	17.3146422683	3.94923082152e-05	5.05763481991	1.4393439073e-06	2.49067249006e-05	6890.14980247
0.88	0.000252742528597	0.00560842272533	0.00535567188701	0.0279295493054	0.00165885616042	0.0731415772747	622.688890884	89363.4320648	5.20119681988	17.2579195868	3.94906979417e-05	5.07410649812	7.97190993156e-07	1.85888652247e-05	6889.61498061
0.9	0.000175351430273	0.00541895675136	0.00524359701136	0.0280042658892	0.0016601934177	0.0733310432486	622.601494519	89064.056642	5.20108340775	17.2025279848	3.94866236361e-05	5.09033396513	4.18196292266e-07	1.34767170306e-05	6887.86374126
0.92	0.000120639940945	0.00528454889435	0.00516390064368	0.028057396801	0.00166098370648	0.0734654511056	622.471613023	88763.7323427	5.20100292109	17.148108098	3.94806495465e-05	5.10640922575	2.10608582623e-07	9.55350356707e-06	6885.17400582
0.94	8.2152894123e-05	0.00518979793091	0.00510763672706	0.0280949060787	0.00166147259101	0.0735602020691	622.311406116	88462.4650651	5.20094616829	17.0943164177	3.94733190962e-05	5.1224219649	1.0202557342e-07	6.62965996503e-06	6881.81416201
0.96	5.53671967321e-05	0.00512371849235	0.00506834298589	0.0281211019062	0.00166176752598	0.0736262815077	622.129420561	88160.2564086	5.20090657961	17.0409117003	3.94650141027e-05	5.1384360713	4.77440938119e-08	4.51438942546e-06	6877.97297063
0.98	3.60638669888e-05	0.00507599974409	0.00503992756738	0.0281400455185	0.00166194738468	0.0736740002559	621.93362793	87857.1047005	5.20087798434	16.9876705547	3.94560907517e-05	5.15451212987	2.06800629962e-08	2.95398366088e-06	6873.82652725
1	2.22318354157e-05	0.00504157369388	0.00501933354874	0.0281537748643	0.00166199872759	0.0737084263061	621.72785169	87553.0050186	5.20085733898	16.9344844651	3.94467197573e-05	5.1706803666	7.96901659589e-09	1.8213534967e-06	6869.45937848
1.02	1.36502415702e-05	0.0050200693742	0.00500641082292	0.0281623900149	0.00166198194924	0.0737299306258	621.512501087	87247.9518165	5.20084443303	16.8813387302	3.94369193295e-05	5.18694580178	3.02603823101e-09	1.11372643643e-06	6864.88048775
1.04	9.45759380735e-06	0.00500954138055	0.00500007547702	0.0281666135788	0.00166196649116	0.0737404586195	621.289190955	86941.9388815	5.20083811314	16.8281859809	3.94267616213e-05	5.20332273196	1.45483504129e-09	7.65725593975e-07	6860.12545208
1.06	7.18865260163e-06	0.00500389178023	0.00499669481791	0.0281688673515	0.00166197407539	0.0737461082198	621.062583404	86634.9592123	5.2008347249	16.7748968537	3.94164550833e-05	5.21984882354	8.39655764934e-10	5.76627521023e-07	6855.29728619
1.08	4.82368635672e-06	0.00499802405663	0.00499319206056	0.0281712025231	0.00166198897273	0.0737519759434	620.836506143	86327.0036938	5.20083120724	16.7213654639	3.94061708994e-05	5.23655598413	3.77712610848e-10	3.83340811111e-07	6850.48061158
1.1	2.46436356138e-06	0.00499214662135	0.00498967394807	0.0281735479314	0.00166199592996	0.0737578533786	620.610771184	86018.0613332	5.20082768217	16.6675946035	3.9395900643e-05	5.25344593006	9.84920562686e-11	1.94012748174e-07	6845.67129855
1.12	6.42342336405e-07	0.00498759441132	0.00498694375927	0.0281753680573	0.00166199687764	0.0737624055887	620.384371261	85708.1209691	5.20082495104	16.6136089171	3.93855992363e-05	5.27051416033	6.68039482845e-12	5.00711903698e-08	6840.84708742
1.14	-1.71808006266e-08	0.0049859498191	0.00498595869019	0.02817602477	0.00166199828285	0.0737640501809	620.156124375	85397.1722204	0	0	0	0	0	0	0

User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Problem in simulating Heterogeneous Reactor

Post by jasper »

Re-checking your expression, it does go to zero in case X[nitric oxide] goes to zero - it is the only term in the numerator.

The negative rate of nitric oxide however is within integration tolerance. Perhaps try the solution with max(0, ... ) to avoid the negative value.
antoinetonee
Posts: 7
Joined: 14 October 2020, 13:49

Re: Problem in simulating Heterogeneous Reactor

Post by antoinetonee »

jasper wrote:Re-checking your expression, it does go to zero in case X[nitric oxide] goes to zero - it is the only term in the numerator.

The negative rate of nitric oxide however is within integration tolerance. Perhaps try the solution with max(0, ... ) to avoid the negative value.
Thank you for the reply, Jasper. I tried with max(0, X[nitric oxide]) and max(0, X[carbon monoxide]), both being the terms in the numerator, it didn't work (the same negative rate error message). Heck I tried as far as making the entire rate equations with max(0, ...) and it still failed the same way, which is really strange and doesn't make sense.

I checked the NO value for D = 0.3 m, flow rate 6 mol/s, the value of NO does turn negative and hence the simulation failed to continue (see attached Excel spreadsheet). This is one hell of a weird code bug.
Attachments
Book2.xlsx
(11.8 KiB) Downloaded 2399 times
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Problem in simulating Heterogeneous Reactor

Post by jasper »

Works for me if I just change X("Nitric oxide") into max(0,X("Nitric oxide")) in both reaction terms (2x each).
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Problem in simulating Heterogeneous Reactor

Post by jasper »

that in fact makes all runs work:
Screenshot 2021-11-17 091411.png
Screenshot 2021-11-17 091411.png (166.89 KiB) Viewed 34335 times
antoinetonee
Posts: 7
Joined: 14 October 2020, 13:49

Re: Problem in simulating Heterogeneous Reactor

Post by antoinetonee »

jasper wrote:that in fact makes all runs work:
Screenshot 2021-11-17 091411.png
Yeah now it's working. Thanks a lot!
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Problem in simulating Heterogeneous Reactor

Post by jasper »

Glad to hear it.
Post Reply

Return to “COCO (AmsterCHEM)”