Simualtion is getting error

Dear @jeff.dietiker
I am simulating three-dimensional TFM using a custom kg model but the simulation is not starting and an error is coming: I also want to add BC_JJ boundary condition for solid Specularity coefficient 0.6 but the simulation is not starting.
Error from time_step.f:196
“DT < DT_MIN. Recovery not possible!
Fatal error reported on one or more processes. The .LOG file
may contain additional information about the failure.”

could you tell me how can i resolve this type of problem while the same case is solved without UDF function (kg)?

“Could you please review the debug file for me?”

tfm3dwithenergy_2024-03-24T105020.388166.zip (85.7 MB)

When you debug your code, you should build it with debug flags. This will tell you there is a FPE on line 525 of usr_properties.f.

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0  0x7fc3bb7aa26f in ???
#1  0x407ede in usr_prop_ks_
	at /nfs/home/MFiX/23.3/tfm_energy/usr_properties.f:525

Then you see there are divisions by a, b and a log(a/b) on line 525 (denominator is already taken care of). So either a or b go to zero or a/b is negative. You can put a print or write statement before line 525 to inspect a and b, or just look at the definition of a and. Here b is zero when the void fraction (EP_G) is one. So you need to do something different when EP_G is one.

 520         a = K_S0 / K_F0
 521         b = 1.25 * ((1.0 - EP_G(IJK)) / EP_G(IJK)) ** (10.0 / 9.0)
 522          
 523        denominator = 1.0 - b / a
 524         if (abs(denominator) > 0.0) then                                   
 525             t1 = (a - 1.0) / (denominator ** 2.0) * (b / a) * log(a / b)
 526         else
 527             t1 = 0.0

Dear @jeff.dietiker
Thank you for your response. I have been trying to solve an error in my code but I am struggling. The problem arises when I try to divide by zero. I want to prevent B from being zero or add a special treatment to avoid division by zero. The issue occurs when I evaluate A/B and B is set to zero when ep_g is one. how can I avoid taking ep_g as one so the code is working,
Would you be able to take a look at the file and help me resolve this issue? I would be very grateful for your assistance.

tfm3dwithenergy_2024-03-26T191613.600468.zip (214.3 KB)

Sorry I don’t personally have resources to further assist you with this matter. I don’t know where your conductivity model comes from so you either need to go to the source of that model or derive the limiting case when the void fraction is one. Others on the forum may be able to help you. Good luck!

Dear @jeff.dietiker
I am taking that equation from mfix Technical report documents MFIX documentation theory guide (Technical Report) | OSTI.GOV,
Also, this equation given in cal.ks.f ( for the solid case. I am just missing one line. Could you tel me what i am doing wrong.

I don’t understand why are you writing a UDF if it is already implemented in MFiX. Please take a look at model/calc_k_s.f to see how this is done. If you need more assistance form others, please wait for their reply. Thanks.

Dear @jeff.dietiker
I don’t know this, it is in inbuilt with mfix. Then how can i use it, Just copy both model.calc_k_g.f and calc_k_s.f in the same folder and apply in the model fluid and solids thermal conductivity as indicate udf or just constant initial value define. I tried same things but it doesn’t work.

Dear Expert,
Now I debug the code and compile the code successfully, but the simulation is stopped and an error is coming:
image
please can you suggest to me what I am doing wrong? for that I am using usr.f drag for kg and ks
3f_2024-03-28T094442.372886.zip (85.6 MB)

Dear @jeff.dietiker
Can you suggest me how can i used mfix kg, ks thermal conductivity model or how can remove this error by using usr.f properties function? I stuck in this section.

Can any one help me to solving the custom thermal conductivity model for kg, ks or default mfix model ( calc_ks, calc_kc for 3 D case.

Dear @jeff.dietiker @cgw
Could you please help me for solving the 3D case using KTGF and bb_jj boundary conditions, with ks and kg?
I tried many times but I am stuck using both things at the same time and k_s is not solving.