CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   MPI Application rank 0 exited before MPI_Finalize() with status 2 in Crystallization (https://www.cfd-online.com/Forums/fluent-udf/227858-mpi-application-rank-0-exited-before-mpi_finalize-status-2-crystallization.html)

JohnE June 12, 2020 07:37

MPI Application rank 0 exited before MPI_Finalize() with status 2 in Crystallization
 
Hi, everyone.
i'm going to simulate crystallization with udf and I started with offical tutorial.
there was 2D stirred tank model in turorial.
udf's code as follows:

#include "udf.h"
#include "sg_mphase.h"
#include "sg_pb.h"

#define Mw_KCl 74.551
#define Mw_H2O 18.



/************************************************** ************************/
/* This function defines growth rate (m3/s) */
/************************************************** ************************/

DEFINE_PB_GROWTH_RATE(growth_rate, cell, thread, d_1)
{

real G, S;
real Kg = 2.8e-8;
real Ng = 1.;

Thread *tc = THREAD_SUPER_THREAD(thread);

S = C_UDMI(cell,tc,0);

if (S <= 1.)

{
G = 0.;


}
else
{

G = Kg*pow((S-1),Ng);


}
return G;
}


/************************************************** ************************/
/* This function defines nucleation rate (#/m3.s) */
/************************************************** ************************/

DEFINE_PB_NUCLEATION_RATE(nuc_rate,cell,thread)


{

real J, S ;
real Kn = 4.0e10;

real Nn = 2.77;

Thread *tc = THREAD_SUPER_THREAD(thread);

S = C_UDMI(cell,tc,0);

if (S <= 1.)

{
J = 0.;

}
else
{

J = Kn*pow((S-1),Nn);

}
return J;
}


DEFINE_ADJUST(adjust_func, domain)

{

Thread *tc;
real kcl, solub, S, T;
Thread **pt;



mp_thread_loop_c(tc, domain, pt)

{
cell_t cell;

Thread *tp = pt[P_PHASE];

begin_c_loop_int(cell,tc)

{

kcl = (C_YI(cell,tp,0)/Mw_KCl)/((C_YI(cell,tp,0)/Mw_KCl)+(1-(C_YI(cell,tp,0)))/Mw_H2O);


T = C_T(cell,tp);

solub = 0.0005*T-0.0794;

S = kcl/solub;

C_UDMI(cell,tc,0) = S;

} end_c_loop_int(cell,tc)

}

}


After I do the basic settings;The following error is seen in fluent console:

Updating solution at time level N... done.
iter continuity u-water u-crystal v-water v-crystal energy-p1 energy-p2 k epsilon h2o<l>-wat bf-0-cryst bf-1-cryst bf-2-cryst bf-3-cryst bf-4-cryst bf-5-cryst bf-6-cryst bf-7-cryst bf-8-cryst bf-9-cryst bf-10-crys bf-11-crys bf-12-crys bf-13-crys bf-14-crys bf-15-crys bf-16-crys bf-17-crys bf-18-crys bf-19-crys bf-20-crys bf-21-crys bf-22-crys bf-23-crys bf-24-crys bf-25-crys bf-26-crys bf-27-crys bf-28-crys bf-29-crys bf-30-crys vf-crystal time/iter

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

Node 0: Process 11408: Received signal SIGSEGV.

================================================== ============================
MPI Application rank 0 exited before MPI_Finalize() with status 2
The fl process could not be started.

But it was good in offical case, I only start to change the mesh documents to my.
what is the problem?
So could anyone can help to solve this?
Thank you very much~

vinerm June 15, 2020 03:44

Problem
 
The issue is most likely with UDM. The code uses one UDM. You need to assign a UDM using User-Defined > Memory and also need to initialize it either via Initialization or Patch.

JohnE June 21, 2020 17:04

Quote:

Originally Posted by vinerm (Post 774415)
The issue is most likely with UDM. The code uses one UDM. You need to assign a UDM using User-Defined > Memory and also need to initialize it either via Initialization or Patch.

Oh! That's what I didn't noticed!
Thank you for your help! Appreciate it!


All times are GMT -4. The time now is 08:36.