|
[Sponsors] |
How to calculate integral and derivative in udf |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 25, 2021, 12:48 |
How to calculate integral and derivative in udf
|
#1 |
Member
Amirreza Niazmehr
Join Date: Nov 2018
Posts: 40
Rep Power: 8 |
Hey guys,
I'm stuck in calculating Derivative and integral in UDF. We have our own discrete Data for our gas properties (like Cp,rho ,...) and by measn of a interpolation (interpolation function) we will have a continuous function for these properties like Cp That means we have our own formulation for these properties. Now my question is: If I have my own function for Cp (for example) then How I can caculate the Enthalpy by means of this integral: Int.PNG and also if I want to compute this derivative (the derivative of specific volume with respect to pressure for constant temperature): Der.PNG In our Udf code by means of our data for CP, rho and s on, then what should I do? Does anybody have any clue how to write the code in udf to calculate derivative and integral? Thanks in advance All the bests |
|
March 25, 2021, 12:57 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
You don't calculate derivatives and integrals in UDFs. You open your thermodynamics book, and try to write these integrals and derivatives in a way that you can use in a UDF, in a way that does not involve integrals or derivatives.
__________________
"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". |
|
March 25, 2021, 13:09 |
|
#3 | |
Member
Amirreza Niazmehr
Join Date: Nov 2018
Posts: 40
Rep Power: 8 |
Quote:
You are right my question was alittle vague. Actually we have our discrete Data for our gas properties (like Cp,rho ,...) and by measn of a interpolation we will have a continuous function for these properties like Cp That means we have our own formulation for these properties. Now my question is: If I have my own function for Cp (for example) then How I can caculate the Enthalpy by means of this integral: Int.PNG And also the same for the derivative. |
||
March 25, 2021, 15:23 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Using any software you want (excel works), and write the result in a UDF. You don't need to do the integration in a UDF...
__________________
"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". |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Integral condition on a face | Cedric | FLUENT | 0 | February 18, 2004 06:18 |