|
[Sponsors] |
January 25, 2023, 00:16 |
Node xx: Process: xx received signal SIGSEGV
|
#1 |
New Member
SD
Join Date: Apr 2017
Posts: 6
Rep Power: 9 |
Hello
am new to both UDF and Ansys and am currently using the following UDF code for my simulation. I wanted to create a heat transfer coefficient boundary condition at the liquid_inter_id1 boundary, using the define_adjust. The code compiles without any errors, however, when I try to initialize the model, I encounter an error and the simulation closes automatically. Node 6: process 13572: received signal sigsegv. Node 7: process 110688: received signal sigsegv. 99999: mpt_accept: error : accept failed: No error 99999: mpt_accept: error : accept failed: No error 99999: mpt_accept: error : accept failed: No error 99999: mpt_accept: error : accept failed: No error Bad termination of one of your application processes Rank 0 PID 99524 Running at xxx Exit status: -1 (ffffffff) --------------------------------------------- Here is the code I am using. #include "udf.h" #include "sg.h" real m_sum=0; real ar_sum=0; real m_max=0; /*mass flux at the corner of meniscus: used for thin film region*/ real h_ar_int=0; real h_avg=0; DEFINE_ADJUST(Get_q_V, d) { Thread *t; // thread pointer Domain *domain; // domain pointer cell_t c;//,c0; // define cell face_t f;//,f2,f_face_l; //define face Thread *tf;//, *tf2; //int n,n2; // define n and n2 real S=0.0; //int liquid_id=7; // the liquid zone's thread ID the domain ID /*real p, ps, Ts, hfg, M_bar, R_bar, M_air, p_l_sat;*/ //water properties real ps=3167.739; real Ts= 298; real hfg= 2270e3; real M_bar=18.01; real R_bar=8314.47; real p_l_sat=0; real cp = 4181.3; int liquid_inter_id1=12; // the liquid interface at the liquid/vapor real count=0; //real dr0[ND_ND]; // the vector that connects the centroid of cell c0 to the face centroid //real dr1[ND_ND]; // the vector that connects the centroid of cell c1 to the face centroid real A[ND_ND]; // the area normal vector //real es[ND_ND]; //the unit normal vector in the direction from cell c0 to c1 real T; // define the temperature real temp2; // define the mass flow rate //real cent1[3],cent2[3]; // the centroid of cell real ar; /* area of the face of the cell*/ //real q, temp; //real q_conv; real qd=0; //real ds, A_by_es; // the value A.A/A.es //real AA, B; m_sum=0; ar_sum=0; m_max=0; h_ar_int=0; domain = Get_Domain(1); // get the domain selected, put the tf= Lookup_Thread(domain, liquid_inter_id1); /* look up the face thread of the domain liquid_inter_id1 which is the liquid vapor interface */ begin_f_loop (f, tf) { c=F_C0(f,tf); // macros to identify adjacent faces t=F_C0_THREAD(f,tf); // macros to identify adjacent faces thread T=F_T(f,tf); //get the temperature at the face F_AREA(A,f,tf); // can be used to return the real face area vector ar=NV_MAG(A); // get the area p_l_sat=ps*exp((1/Ts-1/T)*hfg*M_bar/R_bar) ; temp2 = 0.03*sqrt(M_bar/(2*3.1415*R_bar))*(p_l_sat/sqrt(T) - ps/sqrt(Ts)); /*evap mass flux from the face */ qd = temp2*ar*hfg; F_UDMI(f,tf,1)= temp2; S=qd/C_VOLUME(c,t); /*S is like energy source term*/ if (S/hfg > m_max) { m_max=S/hfg; /*highest mass source term for any cell*/ } C_UDMI(c, t, 0) = S; // store or access the value of mass source C_UDMI(c, t, 1) = qd/(hfg*ar); F_UDMI(f,tf,2) = temp2*hfg/(T-298); C_UDMI(c,t,2) = temp2*hfg/(T-298); h_ar_int = h_ar_int + F_UDMI(f,tf,2)*ar; m_sum=m_sum+qd/hfg; /*total mass evaporated in Kg/s*/ ar_sum=ar_sum+ar; count=count+1; } end_f_loop(f,tf) h_avg = h_ar_int/ar_sum; Message ("Total area of interface: %g\n", ar_sum); Message ("Total mass evaporated (kg/s): %g\n", m_sum); Message ("h integral on interface: %g\n", h_ar_int); Message ("h Average on interface: %g\n", h_avg); Message ("Total faces on the interface: %g\n", count); Message("Highest mass source term for any cell: %g\n", m_max); } DEFINE_PROFILE(h_interface, thread, position) { face_t f; real T_room=298; real T; /*wall temperature*/ real dT;/*dT=T-T_room*/ real k=0.68; real h;//Nu,h; real hfg=2270e3; begin_f_loop (f, thread) { T=F_T(f,thread); dT=fabs(T-T_room); h = F_UDMI(f, thread, 1)*hfg/dT; F_PROFILE(f,thread,position)=h; } end_f_loop (f, thread) Message("dT: %g\n",dT); Message("T :%g\n", T); Message("h :%g\n", h); } |
|
February 4, 2023, 11:40 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
check if
Code:
dT=fabs(T-T_room); if thats not a problem show compilation log
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
#ansys#fluent, #define_adjust, #define_profile, #udf #liquid #thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
parallel run in foam extend | CRI_CFD | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 5 | March 28, 2024 09:36 |
use the message in macro DEFINE_PROFILE with parallel processor | alireza_T | Fluent UDF and Scheme Programming | 3 | May 11, 2022 03:08 |
fluent error | hobing | FLUENT | 0 | February 18, 2021 20:59 |
How do I change the serial udf to parallel? | dhdh89 | Fluent UDF and Scheme Programming | 14 | June 4, 2020 10:04 |
Foam::error::printStack(Foam::Ostream&) with pimpleFoam of OF1612 on Cluster | shang | OpenFOAM Running, Solving & CFD | 7 | January 24, 2018 09:30 |