Problem, mixing and equilibrate

91 views
Skip to first unread message

Martin

unread,
Sep 22, 2021, 5:06:32 AM9/22/21
to Cantera Users' Group
Hello everyone,

I would like to understand why when I mix 3 solutions together, and balance them in 'HP' I do not get a logical result, see below:

o_f_ratio = 6

h2 = Solution('h2o2_react.yaml', 'liquid_hydrogen')
h2.TP = 20.27, 2.0684e+07

o2 = Solution('h2o2_react.yaml', 'liquid_oxygen')
o2.TP = 90.17, 2.0684e+07

molar_ratio = o_f_ratio / (o2.mean_molecular_weight / h2.mean_molecular_weight)
moles_ox = molar_ratio / (1 + molar_ratio)
moles_f = 1 - moles_ox

gas2 = Solution(thermo='IdealGas', species=Species.listFromFile('nasa_gas.yaml'))

# create a mixture of the liquid phases with the gas-phase model,
# with the number of moles for fuel and oxidizer based on
# the O/F ratio
mix = Mixture([(h2, moles_f), (o2, moles_ox), (gas2, 0)])

# Solve for the equilibrium state, at constant enthalpy and pressure
mix.equilibrate('HP')

# Print report
gas2()

This is the result :

       temperature   20.27 K
          pressure   2.0684e+07 Pa
           density   3192.7 kg/m^3
  mean mol. weight   26.015 kg/kmol
   phase of matter   gas

                          1 kg             1 kmol     
                     ---------------   ---------------
          enthalpy       -7.6509e+06       -1.9903e+08  J
   internal energy       -7.6574e+06        -1.992e+08  J
           entropy            3002.5             78110  J/K
    Gibbs function       -7.7118e+06       -2.0062e+08  J
 heat capacity c_p            1347.4             35053  J/K
 heat capacity c_v            1027.8             26738  J/K

                      mass frac. Y      mole frac. X     chem. pot. / RT
                     ---------------   ---------------   ---------------
          Electron        1.0226e-18        4.8493e-14           -55.409
               H2O           0.34625               0.5           -1497.5
              H2O2           0.65375               0.5           -883.29
     [ +745 minor]        1.1422e-13        3.4477e-14  


Process finished with exit code 0

it's totally incoherent.

But if I change the equilibrate line by:

mix.equilibrate('HP', solver='gibbs', max_iter=1000)

I get something right: 

       temperature   3603.4 K
          pressure   2.0684e+07 Pa
           density   9.4039 kg/m^3
  mean mol. weight   13.621 kg/kmol
   phase of matter   gas

                          1 kg             1 kmol     
                     ---------------   ---------------
          enthalpy       -9.8628e+05       -1.3435e+07  J
   internal energy       -3.1858e+06       -4.3395e+07  J
           entropy             17174        2.3394e+05  J/K
    Gibbs function       -6.2873e+07       -8.5642e+08  J
 heat capacity c_p            3800.1             51763  J/K
 heat capacity c_v            3189.7             43449  J/K

                      mass frac. Y      mole frac. X     chem. pot. / RT
                     ---------------   ---------------   ---------------
          Electron        1.4142e-12        3.5115e-08           -18.302
                 H         0.0019078           0.02578           -8.7974
                H+        6.5865e-15        8.9053e-14            9.5047
                H-        1.5006e-10        2.0267e-09             -27.1
               HO2        8.5057e-05        3.5103e-05           -40.594
                H2          0.036522           0.24676           -17.595
               H2+        4.4695e-15        3.0207e-14           0.70726
               H2-        1.4712e-12         9.938e-12           -35.897
               H2O           0.90999           0.68806           -33.493
              H2O+        3.6753e-10        2.7791e-10           -15.191
              H2O2        4.4012e-05        1.7625e-05           -49.391
              H3O+        1.1423e-07        8.1799e-08           -23.988
                 O         0.0024799         0.0021114           -15.898
                O-        2.5627e-09        2.1818e-09             -34.2
                OH          0.043674           0.03498           -24.695
               OH+        2.7431e-12        2.1971e-12           -6.3934
               OH-        5.2981e-08        4.2433e-08           -42.998
                O2         0.0052967         0.0022548           -31.796
               O2+        4.6046e-12        1.9602e-12           -13.494
               O2-        6.6189e-10        2.8176e-10           -50.098
                O3        2.3587e-08        6.6939e-09           -47.694
     [ +727 minor]        7.3705e-15        6.2754e-15 


But I still have about 5-6 K difference with the CEA tool.

Why do I need to specify "solver=gibbs" for my balance to work right ?
And why do I have a gap of 5-6K? 

- the file h2o2_react.yaml is the same 

And also, without wanting to abuse, how is it possible to represent a liquid as a gas as it is described on the site? I have trouble understanding.

Thank you in advance.

Martin
 


Martin

unread,
Sep 24, 2021, 6:09:00 AM9/24/21
to Cantera Users' Group
little up ? :)
Reply all
Reply to author
Forward
0 new messages