|
[Sponsors] |
May 29, 2020, 12:44 |
Error with UDF for Cp in terms of LIQF
|
#1 |
Senior Member
Join Date: Jan 2011
Posts: 339
Rep Power: 16 |
Dear all
I tried to interpret the below UDF for specific heat Cp in terms of liquid fraction that used in Solidification/Melting model the UDF as below: #include "udf.h" DEFINE_SPECIFIC_HEAT(specificheat, T, Tref, h, yi) { #if !RP_HOST real cpm,dt; Tref=308; real cps = 1800.0; real cpl = 2400.0; real lat = 160000.0; real LIQF = C_T(cell, thread); dt=exp(-T*(T-Tref)*(T-Tref)/4.0)/sqrt(4.0*3.14); cpm =cps+(cpl-cps)*C_LIQF(c,t)+lat*dt; *h = cpm*(T-Tref); return cpm; #endif } The problem I got the following errors with unknown reason: Error: C:/Users/DELL/AppData/Local/Temp/cp.c.32836.11.c: line 7: parse error. Error: C:/Users/DELL/AppData/Local/Temp/cp.c.32836.11.c: line 8: parse error. Error: C:/Users/DELL/AppData/Local/Temp/cp.c.32836.11.c: line 9: parse error. Error: C:/Users/DELL/AppData/Local/Temp/cp.c.32836.11.c: line 10: parse error. Error: C:/Users/DELL/AppData/Local/Temp/cp.c.32836.11.c: line 12: cps: undeclared variable Any suggestions, please? Mariam |
|
May 29, 2020, 12:57 |
Specific Heat
|
#2 |
Senior Member
|
DEFINE_SPECIFIC_HEAT is not executed at cell level like DEFINE_PROPERTY. That's why it requires a separate function while most of the other properties can be modeled using DEFINE_PROPERTY. It executes at material level and does not have access to cell and thread. C_T returns temperature of a cell but that is already available in form of T. If you are solving for species transport, then their mass fractions are available as yi. But you cannot access C_LIQF because its arguments are not available.
Lastly, you cannot interpret it. It must be compiled.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 29, 2020, 13:01 |
|
#3 | |
Senior Member
Join Date: Jan 2011
Posts: 339
Rep Power: 16 |
Quote:
Do you mean I need to use compile to implement this UDF? regards |
||
May 29, 2020, 13:28 |
Udf
|
#4 |
Senior Member
|
You need to make changes to the UDF and then compile it. You cannot use C_T and C_LIQF. Those are not available within specific heat function.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 29, 2020, 14:40 |
|
#5 |
Senior Member
Join Date: Jan 2011
Posts: 339
Rep Power: 16 |
Actually I am not that familiar with UDF hence I have no idea what to do with C_T and LIQF? any suggestions are highly appreciated?
Regards |
|
May 29, 2020, 14:46 |
C_T and LIQF
|
#6 |
Senior Member
|
C_T and C_LIQF are macros that return temperature and liquid fraction in a cell. However, cell temperature is already available as T, in case you need it to define specific heat. But you cannot access C_LIQF even if you need it. It all depends on the equation you have for specific heat. Does the equation require value of liquid fraction or temperature or not?
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 29, 2020, 15:08 |
|
#7 | |
Senior Member
Join Date: Jan 2011
Posts: 339
Rep Power: 16 |
Quote:
|
||
May 29, 2020, 15:15 |
Equation
|
#8 |
Senior Member
|
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 29, 2020, 15:50 |
|
#9 |
Senior Member
Join Date: Jan 2011
Posts: 339
Rep Power: 16 |
f(T) is the liquid fraction
deltaT is constant as 2 C |
|
May 29, 2020, 16:12 |
Liquid Fraction
|
#10 |
Senior Member
|
That means = C_LIQF, however, you cannot access C_LIQF within DEFINE_SPECIFIC_HEAT. So, you have to define liquid fraction, somehow, in terms of T. Anyway, it is a function of T, that's why .
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
does Hyperthreading affect the application of UDF? | SJSW | Fluent UDF and Scheme Programming | 11 | October 10, 2018 22:28 |
Error code: 126 when loading parallel UDF | Coop | Fluent UDF and Scheme Programming | 0 | July 13, 2018 08:33 |
UDF source terms | Andrew Garrard | FLUENT | 1 | October 30, 2003 10:48 |
UDF for source terms | Tom | FLUENT | 1 | April 26, 2002 01:13 |
Convection Terms in UDF | Jon Thorpe | FLUENT | 1 | August 14, 2000 09:41 |