|
[Sponsors] |
May 26, 2017, 15:38 |
Segmentation fault
|
#1 |
Member
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9 |
I wrote this simple UDF for defining separate solid and liquid properties.
#include "udf.h" DEFINE_PROPERTY(mass_wtd_k,c,t) { real sum = 0; int i; real solid; real liquid; solid = 59; liquid = 32; sum = C_LIQF(c,t)*liquid+(1-C_LIQF(c,t))*solid; return sum; } #include "udf.h" DEFINE_PROPERTY(mass_wtd_cp,c,t) { real cp = 0; int i; real solid; real liquid; solid = 200; liquid = 231; cp = C_LIQF(c,t)*liquid+(1-C_LIQF(c,t))*solid; return cp; } It is getting interpreted. I hooked it to Conductivity and Specific heat. It is getting hooked also. But i am getting a segmentation fault while initialization. What could be the reason. Segmentation faults arise when solver tries to access an undefined memory location. but I cant decode which undefined location i am trying while initialization. Please help. |
|
May 29, 2017, 16:22 |
|
#2 |
New Member
Denir Paganini Nascimento
Join Date: Dec 2016
Posts: 4
Rep Power: 9 |
Are you using interpreted or compiled UDF´s?
|
|
June 1, 2017, 10:46 |
|
#3 |
Senior Member
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9 |
#include "udf.h" is mentioned twice. Could that cause some problems?
You can also remove "int i" |
|
June 1, 2017, 17:13 |
|
#4 |
Member
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9 |
i am using interpreted udf.
|
|
June 1, 2017, 17:19 |
|
#5 |
New Member
Denir Paganini Nascimento
Join Date: Dec 2016
Posts: 4
Rep Power: 9 |
I believe that the problem is that UDF´s for Cp can only be compiled. As far as for FLUENT 13.0
Check the manual: Important: If you would like to use a UDF to define specific heat properties, you must use the DEFINE_SPECIFIC_HEAT, as described in DEFINE_SPECIFIC_HEAT. 2.3.25.1.*Description The DEFINE_SPECIFIC_HEAT macro can be used to define temperature dependent functions for specific heat and sensible enthalpy for fluid, solid and mixture materials (this does not include DPM particles). These functions must be defined in a consistent manner, that is, the enthalpy function should be the temperature integral of the specific heat function. Important: This option is not available with the premixed, non-premixed and partially premixed models, and should be used as a compiled UDF only. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel | francesco | OpenFOAM Bugs | 4 | May 2, 2017 22:59 |
Segmentation fault in SU2 V5.0 | ygd | SU2 | 2 | March 1, 2017 05:38 |
Segmentation fault when running in parallel | Pj. | OpenFOAM Running, Solving & CFD | 3 | April 8, 2015 09:12 |
Segmentation Fault w/ compiled OF 2.2.0 - motorBike example | sudo | OpenFOAM Running, Solving & CFD | 3 | April 2, 2013 18:27 |
segmentation fault when installing OF-2.1.1 on a cluster | Rebecca513 | OpenFOAM Installation | 9 | July 31, 2012 16:06 |