How does MFiX utilize the molar mass information?

Hey guys,

I have been using the TFM of MFiX with chemical reactions. One thing that I have been curious about is why do we need the molar mass information? Can someone point me to some resources on how MFiX use the molar mass in chemical reactions? Also I have realized that sometimes when the molar mass of user defined solid is too large, I run into instability issues. When I lowered the molar mass the issue was gone. Did anyone have the same issue? Thanks!

Jack

@jack7z - there’s no keyword or control in MFiX with “molar” except for some monitors. So I’m not sure what “molar lass” you are asking about. Molecular weights are used in the Chemistry panel to make sure that reactions are balanced.

– Charles

Thanks Charles. What I’m asking is apart from making sure the reactions are balanced, does the molecular weights information play any other role in the computations? It’s the one that we input in the chemistry panel of the GUI.

Thanks,
Jack

@jack7z The input in the Chemistry pane is just the stoich coefficient. The molecular weight is entered in the Species popup, which appears when you add or edit species.

This does not set an MFIX keyword directly, but gets written to the THERMO_DATA section of the MFiX file:

THERMO DATA
AL2O3                   User Defined      0.S   200.000  1200.000  B 101.96128 1
 2.60994032E+00 3.76023553E-02-4.63474789E-05 2.73301680E-08-6.21672705E-12    2
-2.03702845E+05-1.83258490E+01-8.37648940E+00 1.09323686E-01-2.25731157E-04    3
 2.29482917E-07-9.22595951E-11-2.02316511E+05 2.94431298E+01-2.01539237E+05    4

there’s more information on this format and code that reads/writes it in the subdirectory thermochemical. Molecular weight sets a variable called MW:

      SUBROUTINE READ_Therm(data_str, Sp, Thigh, Tlow, Tcom, MW, Ahigh, &
         Alow, Hf298oR, IER)
      DOUBLE PRECISION, INTENT(OUT) :: Thigh, Tlow, Tcom, MW

grep -ir mw shows that MW is used in several places in the model, in particular
eos_mod.f (equation of state). flow_to_vel.f and set_outflow.f as well as the code that handles chemical reactions.

Remember, grep is your friend!

– Charles

1 Like

I see. Thank you Charles! I attached the files that I was running. It turned out I could not run the simulation if I set the mole weight too high. For example in the mfx file I set the reactant mole weight to be over 1,000. I did not use thermal information at all which means the mole weight information was not used. However, if I delete the first digit of mole weight for ML and RM, namely set them to be 150 and 194 respectively, I can run the program. Is it potentially a bug?

Thanks,
Jack
usr_rates.f (2.8 KB)
td_jelly_roll.mfx (26.0 KB)

Hi @jack7z - I see a few problems here -

  1. The file you sent me loads with two warnings:
    shot-2021-05-06_16-55-54

Load-time warnngs, as opposed to run-time warnings, do not trigger an error popup and are easy to miss. I think I’ll promote this to a popup in the next release.

  1. After loading, the densities and molecular weights for ML and RM are zero:

This results in unbalanced reaction, which the GUI won’t even let you save.

  1. Setting the molecular weights to 1150 and 1194 respectively balances the reactions. When I run the job I get a messy solver backtrace:
At line 57 of file /home/cgw/Work/NETL/mfix/model/thermochemical/get_values.f
Fortran runtime error: Bad value during floating point read

Again this should probably be a popup, but it isn’t. Since FORTRAN is complaining about a bad value, let’s inspect the data file:

ML                      User Defined      0.S   200.000  6000.000  B1150.00000 1
 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00    2
 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00    3
 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00    4

RM                      User Defined      0.S   200.000  6000.000  B1194.00000 1
 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00    2
 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00    3
 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00    4

Note the way in the definitions for ML and RM, the numbers 1150 and 1194 are right up against the preceeding field B. That looks bad and potentially troublesome.

As an experiment, in an external editor, let’s change these to have a space between the text and the number - I changed B1150.00000 to B 1150.0000 and the other
B1194.0000 to B 1194.000 - adding a space after the B and deleting a trailing 0 to keep the field width constant. (This format is a bit fussy).

Now, as long as I do not do a Save from the GUI, the job runs!

So there’s a bug in the GUI when molecular weights are greater than 1000, the THERMO DATA section is written incorrectly and the solver can’t read it. Additionally, the error messages are a bit hard to find.

We will address this in the next release, for now you can edit the MFiX file directly, just be careful when doing so. Note that every time you save from the GUI you are going to have to fix this again, sorry about that!

– Charles

2 Likes

@jack7z - here’s a patch you can apply if you like, this fix will be included MFiX 21.2
patch.txt (1.2 KB)

1 Like