|
[Sponsors] |
July 28, 2023, 08:27 |
How fluent solver work inside the fluent?
|
#1 |
Member
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 3 |
I want to know, how Fluent Solver takes the variable and calculates the value when uploading the UDF function.
In a simple case, I upload only the DEFINE INIT function and initialized the problem, the value is not getting the true value. #include "udf.h" #define M 0.25 #define RHO 1600 #define E 0.4 #define Tref 300 #define Tin 300 int last_timestep = -1; DEFINE_INIT(initial_humidity, d) { real Tabs, w, a, b, C, Pvs, RH; Thread *t; cell_t c; thread_loop_c(t, d) { begin_c_loop(c, t) { C_T(c, t) = Tin; Tabs = C_T(c, t); Pvs = 0.1 * exp(27.0214 - (6887 / Tabs) - (5.31 * log(Tabs / 273.16))); /* Eq(25) */ b = 2.667e-7 * pow((1 - (Tabs / 641.7)), -23.438); C = 1 / (4e5 * pow(Tabs, -2.1166)); a = b * pow(1000 * M, 1 / C); RH = 1 - exp(-a / Tabs); /* Eq (15) */ if (RH > 0.99) { RH = 0.99; } w = (Pvs * RH * 0.62189) / (101.3 - Pvs * RH); /* Eq (26) */ } end_c_loop(c, t) Message ("realative humidity:%f\n", w); Message ("Pv:%f\n", Pvs); Message ("RH:%f\n", RH); } } ================================================== ============================ Error is coming, and the value getting Zero at the initial condition initial_humidity Done. realative humidity:0.000000 Pv:0.000000 RH:0.000000 ================================================== ============================ Node 10: Process 22992: Received signal SIGSEGV. |
|
July 30, 2023, 07:13 |
|
#2 |
Member
Thamilmani M
Join Date: Sep 2017
Location: IIT Bombay, Mumbai
Posts: 52
Rep Power: 9 |
Which variable are you trying to initialize here?
You are initializing temperature as Tin and calling C_T again to calculate some function. Why?
__________________
Always Thedal |
|
July 30, 2023, 07:20 |
|
#3 |
Member
Thamilmani M
Join Date: Sep 2017
Location: IIT Bombay, Mumbai
Posts: 52
Rep Power: 9 |
Also try
begin_c_loop_all(c, t) instead and check what happens. DEFINE_INIT is executed only once during initialization.
__________________
Always Thedal |
|
July 30, 2023, 07:32 |
|
#4 |
Member
Thamilmani M
Join Date: Sep 2017
Location: IIT Bombay, Mumbai
Posts: 52
Rep Power: 9 |
I think the formulation is correct. only problem could be with the begin_c_loop(c, t)
__________________
Always Thedal Last edited by thedal; July 30, 2023 at 07:38. Reason: mistaken |
|
July 30, 2023, 08:46 |
|
#5 |
Member
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 3 |
I want to initialize the relative humidity value here. I do the same thing to replace by begin_c_loop_all(c, t) but the same error is coming
relative humidity:0.000000 Pv:0.000000 RH:0.000000 ================================================== ============================ Node 5: Process 27536: Received signal SIGSEGV. = BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES = RANK 10 PID 21372 RUNNING AT DESKTOP-MGARH2C = EXIT STATUS: -1 (ffffffff) ================================================== ================================= The fl process could not be started. |
|
July 30, 2023, 09:19 |
|
#6 |
Member
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 3 |
This may occur by not defining the allocating memory. it might be right.
|
|
Tags |
alexanderz |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
foam-extend-4.1 release | hjasak | OpenFOAM Announcements from Other Sources | 19 | July 16, 2021 06:02 |
Selection of solver in ANSYS Fluent for given mach number | Ankit Patel | FLUENT | 9 | January 29, 2021 05:44 |
Fluent Adjoint Solver for compressible flow | b.shuvayan | FLUENT | 2 | January 30, 2015 08:27 |
simpleFoam parallel solver & Fluent polyhedral mesh | Zlatko | OpenFOAM Running, Solving & CFD | 3 | September 26, 2014 07:53 |
The fluent stopped and errors with "Emergency: received SIGHUP signal" | yuyuxuan | FLUENT | 0 | December 3, 2013 23:56 |