I have been running into trouble with instability. Could someone help me take a look and let me know why it happens and how to get around it please? Thanks!
I’m simulating a 2D TFM with chemical reaction CO2+n ML–>PR, where n is a positive integer. I set the reaction rate as rate=k * c_CO2 * c_ML**n. Namely the reaction rate is linearly correlated to the concentration of CO2 concentration and ML concentration to the nth power.
The simulation ran just fine with n=1, but I started having problems after I set n=2 or higher. When n=2, MFiX finished the first 8 seconds of simulation and ran into the dt<dt_min problem, where dt_min is 1e-10. As I set n=3 and 4, it couldn’t start at all and I had errors like “Negative void fraction detected” and “Negative gas density detected” at the beginning of the simulation. Does anyone know why this happens? I was confused because although I changed the concentration of reactants in the IC, it shouldn’t have negative void fraction or gas density.
I attached my files here. To run the simulations I used this command line:
build_mfixsolver --batch --dmp
@jack7z I’m running the N=1 case in serial mode and am seeing this message:
mfix - WARNING - The sum of mass fractions is not equal to one.
mfix - WARNING - The sum of mass fractions is not equal to one.
If you can fix this, the negative void fraction problem may clear up.
Note, in the GUI this is being reported as a “Message” rather than a “Warning” (I will fix this), but if you don’t use GUI it’s easy to lose track of warnings and errors coming from the solver - the GUI tries to make these more visible by presenting a total error count and popup message dialog:
I think the first step is to try to get the job running cleanly in serial mode before attempting DMP, starting with N==1
Thank you Charles. I saw the message in the GUI now. I noticed that the error happened at time=0.1, and I did not see anything unbalanced in my IC or BC. Does it mean it started without any sum of mass fractions problem but as the simulation went on it there was an error?
INFO check_data_30.f:372
Time = 0.10303
Warning: The sum of mass fractions is not equal to one.
Sorry I’m still very confused about this error. My initial condition was correct so it seems there was something wrong with my reaction that caused the problem. I tried to figure out if it was the reaction or the diffusion that caused it so I set the reaction rate coefficient k to 0, which means there is effectively no reaction happening. However, I still got the error in the message although fewer cells were not in the 0.9999 - 1.0001 range. So do you have any suggestion on how to debug this please? Thanks!
Your reaction rate is very large with n=4. I put some print statements and got a value of c_ML=60, so a power or 1,2 and 4 will give rates that are orders of magnitude apart. Is k independent of n?
To debug this kind of simulation, I usually turn off reactions. If this runs fine, then I gradually add reactions (if there are more than one), to identify which one is the issue. It is usually necessary to simplify the model so it runs quickly in serial. If you don’t have access to a debugging tool, you can simply put print statements in the code to check the value of some variables.
@jack7z - write(*,*) in FORTRAN is always helpful, but of course it requires you to rebuild the solver.
Additionally, you could monitor_rrate keyword and plot the monitor value in the GUI, which doesn’t require recompilation and gives you a nice plot (or vtk_rrate for a VTK visualisation)
Hi jeff,
I want to know how to turn off the chemical reaction, because the chemical reaction rate needs to be set up solver, if you deselect the component transport equation, there will be an error. @jeff.dietiker