|
[Sponsors] |
December 5, 2023, 23:20 |
convert 2D udf to 3D udf/internal ballistic
|
#1 |
New Member
Cheng Lu
Join Date: Dec 2023
Posts: 6
Rep Power: 3 |
Hi,everyone.It's about the simulation of internal ballistic processes.A model of a porous region, the inlet is a mass flow inlet, set the energy source term and mass source term to characterise the combustion in the porous region, the 2D model can be operated, but the creation of a 3D model reported an error, space reasons to provide part of the udf, thank you very much for your help!if you need more udf programs, please contact me.
( DEFINE_PROFILE(pressure_inlet, t, i) { face_t f; int id = THREAD_ID(t); begin_f_loop(f, t) { F_PROFILE(f, t, i) = 0.564474 * pressure_static[id - inlet_id[0]]; } end_f_loop(f, t) } DEFINE_SOURCE(energy_source_term, c, t, ds, eqn) { double source = 0.0; double rho, v_mag, k, miu, re, hc, Tg, Tps, Asf, es, Qr; Tps = C_UDMI(c, t, id_tps); if (Tps < 453.0) { rho = C_R(c, t); v_mag = sqrt(C_VMAG2(c, t)); miu = C_MU_L(c, t); es = C_POR(c, t); re = get_Rep(rho, v_mag, miu, d_ep); // * es; k = C_K_L(c, t); hc = h_sf(k, re); Tg = C_T(c, t); Asf = 6.0 * (1.0 - es) / d_ep; source = hc * (Tps - Tg) * Asf + 0.8 * sigmap * (pow(Tps, 4) - pow(Tg, 4)) * Asf; ds[eqn] = -Asf * (hc + 0.8 * sigmap * 4.0 * pow(Tg, 3)); return source; } else { Qr = Q_v * rho_p * (1.0 - es0) * C_UDMI(c, t, id_dpsi); ds[eqn] = 0.0; return Qr; } } DEFINE_SOURCE(mass_source_term, c, t, ds, eqn) { double Tps, mr; Tps = C_UDMI(c, t, id_tps); if (Tps < 453.0) { ds[eqn] = 0.0; return 0.0; } else { mr = rho_p * (1.0 - es0) * C_UDMI(c, t, id_dpsi); ds[eqn] = 0.0; return mr; } } |
|
December 6, 2023, 06:35 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
check
Code:
C_VMAG2(c, t)
__________________
best regards ****************************** press LIKE if this message was helpful |
|
December 6, 2023, 22:31 |
|
#3 |
New Member
Cheng Lu
Join Date: Dec 2023
Posts: 6
Rep Power: 3 |
I changed v_mag = C_VMAG2(c,t) to v_mag = sqrt(C_U(c, t) * C_U(c, t) + C_V(c, t) * C_V(c, t) + C_W(c, t) * C_W(c, t)) and the problem still exists, the UDF can be loaded and initialised but running the calculation reports an error:Received signal SIGSEGV.Thanks for your answer, I will try to check the other parts.
|
|
Tags |
internal ballistic, mass-flow inlet, porous zone |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for vapor pressure | anuarun | Fluent UDF and Scheme Programming | 13 | June 23, 2024 14:12 |
Call defined property by UDF to another UDF | Selawe97 | FLUENT | 0 | December 27, 2022 09:57 |
Replicating Scalable Wall Function with a UDF | yousefaz | FLUENT | 0 | August 4, 2017 03:30 |
Fluent Radiation/porous media | Schmitt pierre-Louis | FLUENT | 26 | September 1, 2016 11:29 |
Source Term UDF VS Porous Media Model | pchoopanya | Fluent UDF and Scheme Programming | 1 | August 28, 2013 07:12 |