19.2.2 error: can't build solver

Hey guys,

Does anyone know what this error is about please? I was using 19.2 version to create a methane combustion model, but when I tried to build a solver, I got this following error.

Thanks,
Jack

/Users/jkz/opt/anaconda3/envs/mfix-19.2.2/share/mfix/src/model/ODEPACK.F:26074:72:

26074 | 2 RES, JAC, ADDA)
| 1
Error: Type mismatch in argument ‘iwk’ at (1); passed REAL(8) to INTEGER(4)
[ 12%] Building Fortran object model/CMakeFiles/mfixcore.dir/mms_mod.f.o
/Users/jackz/opt/anaconda3/envs/mfix-19.2.2/share/mfix/src/model/ODEPACK.F:17841:72:

17841 | 1 RWORK(LACOR), IA, JA, RWORK(LWM), RWORK(LWM), IPFLAG, F, JAC)
| 1
Error: Type mismatch in argument ‘iwk’ at (1); passed REAL(8) to INTEGER(4)
/Users/jackz/opt/anaconda3/envs/mfix-19.2.2/share/mfix/src/model/ODEPACK.F:3446:72:

3446 | 2 F, JAC, DPRJS, DSOLSS)
| 1
Error: Type mismatch in argument ‘iwm’ at (1); passed REAL(8) to INTEGER(4)
/Users/jackz/opt/anaconda3/envs/mfix-19.2.2/share/mfix/src/model/ODEPACK.F:12208:33:

12208 | CALL DAINVG( RES, ADDA, NEQ, T, Y, RWORK(LYD0), MITER,
| 1
Error: Rank mismatch in argument ‘neq’ at (1) (scalar and rank-1)
/Users/jackz/opt/anaconda3/envs/mfix-19.2.2/share/mfix/src/model/ODEPACK.F:16101:20:

16101 | CALL DAINVGS (NEQ, T, Y, RWORK(LWM), RWORK(LWM), RWORK(LACOR),
| 1
Error: Rank mismatch in argument ‘neq’ at (1) (scalar and rank-1)
/Users/jackz/opt/anaconda3/envs/mfix-19.2.2/share/mfix/src/model/ODEPACK.F:16250:72:

16250 | 2 RWORK(LWM), RES, ADDA, JAC, DPRJIS, DSOLSS )
| 1
Error: Type mismatch in argument ‘iwm’ at (1); passed REAL(8) to INTEGER(4)
make[2]: *** [model/CMakeFiles/mfixcore.dir/ODEPACK.F.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[1]: *** [model/CMakeFiles/mfixcore.dir/all] Error 2
make: *** [all] Error 2

                  BUILD UNSUCCESSFUL

==============================================================

Hi Jack. What’s the reason you are using 19.2 instead of 20.4? Have you tried with the current version?

  • Charles

Hi Charles, yeah the current version gave me an error saying that “ Heat of reaction is proportioned to a phase not referenced
by the chemical equation for reaction REACTION_1.” which I asked about several days ago. I’m not sure what went wrong with my .mfx file so I was thinking about using an older version of mfix to see if it runs.

Thanks,
Jack

Jack - I’m working on the “Heat of Reaction” issue right now. It’s interesting, when Jeff runs your methane.mfx he does not see any problem, but I am able to reproduce it, so I’m looking into it.

ODEPACK is very old code, I pulled in a slightly newer version to work around the issue you are reporting. If you are up for experimenting, you could try taking a copy of ODEPACK.f from the current release and overwriting the ODEPACK.f in the 19.2 installation with that. If you try this, let me know if it works!

I hope to have an update for you on the “Heat of reaction” error soon.

Thanks,

  • Charles

Ok thank you so much Charles! I’ll play around with the older version. :slight_smile:

Jack

If I build the 20.4 solver with 'Build Type" set to Debug, I can run the methane.mfx case without producing the “Heat of Reaction” error.

Thank you Charles! I was able to run it when the build type was set to debug. However, I did not see anything temperature change in the tube. Also there was no change in the CO2 or H2O mass fraction, so it seemed like the reaction was not happening. Were you able to see any reaction happening please? Or did I misunderstood how reaction happens in MFiX? Thanks!

Usually there are some messages in the console regarding chemical reactions, I’m not seeing any when I run this.
If I enable the stiff chemistry solver (in the Chemistry pane) I see messages like this:

Integrating stiff chemistry...
DONE.
 Minimum/Maximum number of steps over all cells: 5000/0
 Number of cells with Homogeneous/Heterogeneous reactions: 0/0
 Maximum number of integration attempts: 0
 CPU Time Used: 0.0003 sec

Number of cells with reactions = 0 and max integration attempts = 0 which does look like the reaction is not happening. I’m not sure why, I’m still looking into why this runs with Debug but not Release compiler flags (it fails as soon as any compiler optimization is enabled, even -O1). Some deep voodoo here. You’ve opened up a can of worms :snake: :snake: :snake: , but we appreciate it - it’s important to find and fix errors.

Defining the reaction equations is not sufficient. You also need to code the reaction rates in usr_rates.f an d build the custom solver. Without the reaction rates, no reaction will take place. Please see the silane pyrolysis tutorial for an example.

I see. Thanks Jeff! I tried copying the usr_rates.f usr_rates.f (744 Bytes) in 4.13.3.5 of the tutorial, and it gave me the following error while building the solver. I thought Fortran didn’t care about upper case or lower case so it was confusing to me that the error message said “Symbol ‘c_o2’ at (1) has no IMPLICIT type; did you mean ‘c_02’?” Also I was able to run the silane pyrolysis tutorial and saw the chemical reaction. I compared the structures of my usr_rate.f and the one in the silane pyrolysis. They seemed similar so I thought I defined all information needed for the chemical reaction rate? Or did I miss something?

By the way I just talked to my Ph.D. adviser Emily Ryan this afternoon. She said hi.

19 | ReactionRates(IJK, CH4_Combustion) = RATES(CH4_Combustion)
| 1
Error: Syntax error in IF-clause after (1)
/Users/jackz/Documents/methane/usr_rates.f:9:4:

9 | c_O2 = (RO_g(IJK) * X_g(IJK,O2))/MW_g(O2)
  |    1

Error: Symbol ‘c_o2’ at (1) has no IMPLICIT type; did you mean ‘c_02’?
/Users/jackz/Documents/methane/usr_rates.f:10:32:

10 | c_CH4 = (RO_g(IJK) * X_g(IJK,CH4))/MW_g(CH4)
| 1
Error: Symbol ‘ch4’ at (1) has no IMPLICIT type; did you mean ‘c_ch4’?
/Users/jackz/Documents/methane/usr_rates.f:14:20:

14 | RATES(CH4_Combustion) = 6.7d12 * exp(-2.4358d4/T_g(IJK)) * &
| 1
Error: Symbol ‘ch4_combustion’ at (1) has no IMPLICIT type
/Users/jackz/Documents/methane/usr_rates.f:9:30:

9 | c_O2 = (RO_g(IJK) * X_g(IJK,O2))/MW_g(O2)
  |                              1

Error: Symbol ‘o2’ at (1) has no IMPLICIT type

                  BUILD FAILED

========================================================

Firstly, this is 02 (zero-two) not a O2.
Normally c_CH4 and CH4_Combustion could be normal but I don’t know your main file. Did you define species and chemical equation of CH4_combustion in your mfix.dat?

Thank you Kececi! I defined my species and chemical equation in my .mfx file here. methane.mfx (12.5 KB)

I thought that .dat files are obsolete from this post. Mfix.dat files in 20.1.2 - #3 by gaoxi

1 Like

Traditionally the mfix input file was always called mfix.dat. We added the option to name your file anything.mfx but the mfix.dat name is still allowed.

1 Like

It seemed like a good idea to allow users to specify a different filename for the project definition, but since you can really only have one project file per directory, it’s not actually that helpful. And in some ways it’s worse having the project file called run_name.mfx because it’s then unsafe to do rm run_name.* to clean up output files.

1 Like

Here’s the fix for the problem building the solver with recent gfortran versions and optimization enabled. We’ll be issuing a bug-fix release but in the meanwhile you can edit parse_rxn.f and fix line 265 to declare the array uFDH to have intent INOUT.

diff --git a/model/parse_rxn.f b/model/parse_rxn.f
index a695fe473..b5cf743f9 100644
--- a/model/parse_rxn.f
+++ b/model/parse_rxn.f
@@ -262,7 +262,7 @@ CONTAINS
 ! User defined heat of reaction.
       DOUBLE PRECISION, INTENT(OUT) :: uDH
 ! User defined splitting of heat of reaction
-      DOUBLE PRECISION, INTENT(OUT) :: uFDH(0:DIM_M)
+      DOUBLE PRECISION, INTENT(INOUT) :: uFDH(0:DIM_M)
 
 ! The input line contains no additional data.
       IF(LEN_TRIM(ADJUSTL(IN)) == 0) RETURN
1 Like