CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Node 0: Process 34348: Received signal SIGSEGV.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 23, 2024, 10:24
Question Node 0: Process 34348: Received signal SIGSEGV.
  #1
New Member
 
sunny
Join Date: Sep 2022
Posts: 9
Rep Power: 4
qwerty010 is on a distinguished road
hello.
I am currently writing a mass source term UDF to implement a mass transport model in a 3D model.

The model is to absorb oxygen from the air into water, and I need the VOF gradient to calculate the effective area in this process.
effective area * abs(liquid volume fraction gradient) = abs(liquid volume fraction gradient)
Therefore, the UDF is largely written in two parts: the VOF gradient calculation and the source term.

Initially, I used the C_VOF_G codec, but I encountered an error, so I used the code published on the Internet. (Source)

The UDF code I wrote is shown below.


PHP Code:


#include "udf.h"
#include "math.h"

#define MW_O2 0.03199 /* Oxygen molecular weight [kg/mol] */
#define MW_H2O 0.0180001 /* Water molecular weight [kg/mol] */
#define Henry_coeff 0.0013 /* Henry's constant for oxygen in mol/atm/L */
#define D_L 2.1e-9 /* Diffusion coefficient oxygen in water, D [m^2/s] */
#define PI 3.14159265359

#define OMEGA 104.72 /* Rotating speed [rad/s] */
#define H  0.005 /* Packing height [m] */
#define R_MEAN 0.0275 /* Mean radius of RPB [m] */
#define A_P  0.001591633448 /* Packing surface area [1/m] */

#define domain_ID 1

/* VOF gradient UDF */
DEFINE_ADJUST(adjust_gradientdomain)
  {
  

    
Thread *t;
    
cell_t c;
    
face_t f;


    
domain Get_Domain(domain_ID);

/* Fill UDS with the variable. */
    
thread_loop_c (t,domain)
      { 
        
begin_c_loop (c,t)
          { 
            
C_UDSI(c,t,0) = C_VOF(c,t);
            
C_UDSI(c,t,1) = 1-C_VOF(c,t); 
          }
        
end_c_loop (c,t
      }
      
    
thread_loop_f (t,domain)
      { 
        if (
THREAD_STORAGE(t,SV_UDS_I(0))!=NULL)
            
begin_f_loop (f,t)
          {
            
F_UDSI(f,t,0) = F_VOF(f,t); 
            
F_UDSI(f,t,1) = 1-F_VOF(f,t);
          }
        
end_f_loop (f,t
      }
  }

DEFINE_ON_DEMAND(store_gradient)
  {
     
Domain *domain;
     
cell_t c;
     
Thread *t;
     
domain=Get_Domain(1); 
  
    
thread_loop_c (t,domain)
      {
        
begin_c_loop (c,t)
          {
            
C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0));
            
C_UDMI(c,t,1) = NV_MAG(C_UDSI_G(c,t,1)); 
          }
        
end_c_loop (c,t)
      }
  }




DEFINE_SOURCE(oxygen_absorption_sourcectdSeqn)
  {
    
real source 0.0;
    
real aeklyl_saturationrho_L_O2Slgfilm_thicknessfilm_velocity
contact_time;    real rho_L 1011.7;  /* Liquid density */
    
real mu_L 0.00339;  /* Liquid viscosity */
    
real dp 0.00015;  /* Characteristic dimension of wire mesh*/
    
real Q_L 7.7254337e-7 1.5289/* volume flow rate [m^3/s] */


    
real xc[ND_ND];
    
C_CENTROID(xcct);  /* Get the coordinates of the cell's centroid */
    
real r_local sqrt(xc[0] * xc[0] + xc[1] * xc[1]);     
    
real g_centrifugal r_local OMEGA;

    
    
real vol_frac_O2 C_YI(ct0);  /* Oxygen volume fraction (species index 
0) */    
real vol_frac_N2 C_YI(ct1);  /* Nitrogen volume fraction (species 
index 1) */
    
    
real local_pressure C_P(ct);  /* Local cell pressure */
    
real O2_PARTIAL_PRESSURE vol_frac_O2 local_pressure;  /* Partial 
pressure of oxygen */

   
    
real liquid_gradient fabs(C_UDMI(ct0));  /* Liquid VOF gradient 
magnitude */    
real gas_gradient fabs(C_UDMI(ct1));  /* Gas VOF gradient magnitude */


    
if (liquid_gradient 0.0/* Effective area calculation */
     
{
        
ae gas_gradient liquid_gradient;  /* Effective area based on the 
relationship a_e * |grad_liquid| = |grad_gas| */      
}
    else
      {
        
ae 0.0;  /* Avoid division by zero */
      
}

    
C_UDMI(ct2) = ae;

    
    
yl_saturation = (MW_O2 O2_PARTIAL_PRESSURE) / Henry_coeff;
    
real tau Q_L / (PI R_MEAN A_P); /* specific flow rate */
    
film_thickness pow((mu_L tau) / (rho_L g_centrifugal), 1.0 3.0)
    
film_velocity = (rho_L g_centrifugal pow(film_thickness2)) / (
mu_L);        contact_time = (PI 2) * (dp film_velocity);
    
kl sqrt(D_L / (PI contact_time));

    
C_UDMI(ct3) = kl;
    
    
rho_L_O2 C_YI(ct0) * rho_L;  /* Dissolved O2 concentration in the 
liquid phase */    
Slg kl ae * (yl_saturation rho_L_O2);  /* Source term */
    
    /* Apply source term only when VOF is around 0.5 (at the gas-liquid 
interface) */    
if (C_VOF(ct) > 0.499999 && C_VOF(ct) < 0.500001)
     {
        
source Slg;
      }

    return 
source;
  } 
There are 3 fluid cell zones, and I used vof model and species model together.

However, this UDF file can be compiled, but when I hook define_demand to Execute on demand..., the following error occurs.


PHP Code:
==============================================================================

Node 0Process 34348Received signal SIGSEGV.

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

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

Node 3Process 2492Received signal SIGSEGV.

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

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

Node 2Process 10764Received signal SIGSEGV.

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

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

Node 1Process 28536Received signal SIGSEGV.

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

999999mpt_accepterroraccept failedNo such file or directory

999999
mpt_accepterroraccept failedNo such file or directory

999999
mpt_accepterroraccept failedNo such file or directory

999999
mpt_accepterroraccept failedNo such file or directory 

Judging from the error, it seems to be occurring in the adjust part and the demand part, what could be the problem?
I need your help.
Thank you.
qwerty010 is offline   Reply With Quote

Reply

Tags
hooking udf, source terms, udf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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
Node 3: Process 748: Received signal SIGSEGV. Nima Shah Main CFD Forum 0 June 7, 2022 20:27
How do I change the serial udf to parallel? dhdh89 Fluent UDF and Scheme Programming 14 June 4, 2020 10:04
Process 10300: Received signal SIGSEGV metaliat93 FLUENT 2 January 28, 2020 01:53
Foam::error::printStack(Foam::Ostream&) with pimpleFoam of OF1612 on Cluster shang OpenFOAM Running, Solving & CFD 7 January 24, 2018 09:30


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