|
[Sponsors] |
UDF-Calculation regression rate_DEFINE_ADJUST error |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
EunChong Kim
Join Date: Jan 2024
Posts: 2
Rep Power: 0 ![]() |
Hello! I am currently trying to simulate the pyrolysis of solid fuel using UDF. The surface of the solid fuel is set as a wall, and the regression rate is calculated in the cell zone right above it. Afterward, the corresponding species is injected through the source term based on the regression rate.
When I initialize and press Calculate with the code below, the following error occurs. Process 35236: received signal sigsegv Could you suggest any solutions or provide your opinion on how to resolve this issue? real calculate_regression_rate(cell_t c, Thread* t) { real Ts = C_T(c, t); // Temperature of the cell real Cp = C_CP(c, t); // Specific heat of the cell real k = C_K_L(c, t); // Thermal conductivity of the cell real grad_T = C_T_G(c, t)[1]; // Temperature gradient of the cell[y] real Q_conv = -k * grad_T; // Convective heat flux real Hv, Told_s, Tnew_s, error, rdot; int iter; Told_s = Ts; iter = 0; error = 1.0; while (error > TOL && iter < MAX_ITER) { // Iterative loop Hv = Delta_H_f - Delta_H_H + Cp * (Told_s - Tref); // Calculate Hv rdot = Q_conv / (Hv + rho); // Calculate rdot Tnew_s = Ea / (Ru * (log(A) - log(rdot))); // Calculate Tnew_s error = fabs(Tnew_s - Told_s); // Calculate error Told_s = Tnew_s; // Update Told_s iter++; // Increase iteration count } Ts = Tnew_s + 0.1 * (Tnew_s - Ts); // Update Ts rdot = Q_conv / (Hv + rho); // Final rdot calculation return rdot; // Return rdot } // Calculate and store regression rate for all cells DEFINE_ADJUST(store_regression_rate, domain) { Thread* t; cell_t c; real rdot; int cell_zone_id = 6; // Specific cell zone ID t = Lookup_Thread(domain, cell_zone_id); // Find the specific cell zone begin_c_loop(c, t) { // Loop through all cells in the cell zone rdot = calculate_regression_rate(c, t); // Calculate regression rate C_UDMI(c, t, 0) = rdot; // Store regression rate in UDM } end_c_loop(c, t); } |
|
![]() |
![]() |
![]() |
Tags |
define_adjust, define_source udf, udf |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Gmsh reports an OpenCascade exception when opening a .geo file | algc | Main CFD Forum | 2 | October 24, 2022 05:59 |
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 00:21 |
long error when using make-install SU2_AD. | tomp1993 | SU2 Installation | 3 | March 17, 2018 06:25 |
Mesquite - Adaptive mesh refinement / coarsening? | philippose | OpenFOAM Running, Solving & CFD | 94 | January 27, 2016 09:40 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 02:32 |