|
[Sponsors] |
August 12, 2023, 21:17 |
UDF in Fluent
|
#1 |
New Member
MB
Join Date: Sep 2022
Posts: 8
Rep Power: 4 |
Dears,
I'm trying to load a simple UDF to mimic ideal gas density in Fluent (2023R1). Fluent is crashing as soon as I run the simulation (floating point error). I'm using the below udf: #include <udf.h> #include <global.h> /* The variables below need to be set for a particular gas */ /* CO2 */ #define RGASU UNIVERSAL_GAS_CONSTANT #define MWT 44.01 /* REFERENCE STATE */ #define P_REF 101325 #define T_REF 288.15 DEFINE_PROPERTY(cell_density,c,t) { real rho; real p; real p_operating; real T; p_operating=RP_Get_Real("operating-pressure"); p=C_P(c,t); T=C_T(c,t); rho= (p+p_operating)/(RGASU*T/MWT); return rho; } If I replace p and T by constant values, the solver works fine. The issue occurs only when I let p or T to be unknown (i.e. to be calculated by fluent). Anything wrong in the UDF? Any thoughts on this would be appreciated. Thanks, |
|
August 14, 2023, 02:59 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
how to calculate pressure for your UDF if density is unknown for initial step?
__________________
best regards ****************************** press LIKE if this message was helpful |
|
August 14, 2023, 17:27 |
|
#3 |
New Member
MB
Join Date: Sep 2022
Posts: 8
Rep Power: 4 |
Hi Alexander, thanks for your message.
Looking at the udf again, I have already defined the pressure initially. The problem as it appears to me is that I am not able to call the updated values in the UDF. Best, Last edited by Mohamad.Baassiri; August 15, 2023 at 17:40. |
|
Tags |
fluent - udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
FLUENT UDF for parallelization | Cooper24 | FLUENT | 0 | August 27, 2021 12:55 |
Fluent UDF for moving laser heating of a solid block | Cooper24 | Fluent UDF and Scheme Programming | 7 | July 9, 2021 06:56 |
Problem running fluent with udf on batch | tobi b. | Fluent UDF and Scheme Programming | 3 | April 14, 2016 14:54 |
Running UDF with Supercomputer | roi247 | FLUENT | 4 | October 15, 2015 14:41 |
fluent UDF external library lapack problem | Rick | FLUENT | 0 | May 7, 2008 11:16 |