|
[Sponsors] |
August 24, 2021, 03:57 |
UDF for specific heat
|
#1 |
New Member
Gaurav Kumar
Join Date: Jan 2018
Location: Delhi
Posts: 17
Rep Power: 8 |
Hi all,
I am modelling the supercritical fluids and as the thermophysical properties changes abruptly, I need to write the UDF for the specific heat of the water. I have fitted the curve in a piecewise manner as follows 200 <= T < 385 C_p=(10.57678-0.02301T)/(1+0.00537T-2.05557×〖10〗^(-5) T^2 ) 385 <= T < 600 C_p=(0.83318-0.0033T)/(1-0.00319T-1.49076×〖10〗^(-6) T^2 ) Please help me to write the UDF for the same. Parallelize the code if needed as I am using 20 cores processor Thanks |
|
August 24, 2021, 04:39 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Of course we can help you to make this UDF!
Step 1: find a similar UDF in the Fluent Manual. Step 2: change it so that you think it does what you want. Step 3: compile it, check for errors. Step 4: fix errors until it compiles. Step 5: check if the UDF does what you want. Which step is giving you problems?
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
August 24, 2021, 04:39 |
|
#3 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
specific heat can be defined through material properties, you don;t need UDF for that
__________________
best regards ****************************** press LIKE if this message was helpful |
|
August 24, 2021, 08:55 |
|
#4 |
New Member
Gaurav Kumar
Join Date: Jan 2018
Location: Delhi
Posts: 17
Rep Power: 8 |
I have written the code as you suggested, here is my code:
#include "udf.h" DEFINE_SPECIFIC_HEAT(my_user_cp, T, Tref, h, yi) { real cp; if (200 <= T < 385) cp = 10.57678-0.02301*T/(1+0.00537*T-2.05557*pow(10,-5)*pow(T,2)); else cp = 0.83318-0.0033*T/(1-0.00319*T-1.49076*pow(10,-6)*pow(T,2)); *h = cp*(T-Tref); return cp; } But when I check the value of Cp after running the program in C, the value for 385 <= T <600 is not correct while it is correct for other ranges what is wrong please check it. Thanks and Regards. |
|
August 24, 2021, 15:30 |
|
#5 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Code:
if (200 <= T < 385) Code:
if ((200 <= T) && (T< 385))
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
August 25, 2021, 04:54 |
|
#6 |
New Member
Gaurav Kumar
Join Date: Jan 2018
Location: Delhi
Posts: 17
Rep Power: 8 |
Thanks, Pakk it works.
|
|
Tags |
fluent - udf, specific heats, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Surface Heat Transfer Coefficient driven by a UDF, using coupled wall | ryanbezz11 | CFD Freelancers | 1 | March 16, 2018 04:01 |
Doubt - Variable Heat Flux input - UDF | Neethu_N | FLUENT | 1 | December 19, 2017 12:48 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 08:00 |
UDF for heat convection coefficient with fixed surface temperature | Boo85 | Fluent UDF and Scheme Programming | 2 | July 10, 2012 19:43 |
heat flow UDF on coupled surface (wall-shadow wall) | Friedmann | Fluent UDF and Scheme Programming | 0 | August 5, 2010 11:25 |