SEGMENTATION fault while using DEFINE_PROPERTY macro
Dear all,
I am relatively new to programming in c, and completely new in writing UDF's for Fluent. Now, I want to write an UDF that defines the thermal conductivity for the primary phase and the secondary phase. I am using the DEFINE_PROPERTY macro to do this. I have tried this in the following way: Code:
/********************************************************************* I would be very happy if someone could help me. Also, feel free to give any tips on programming if you like. Cheers! |
This UDF needs some data to work, specifically the temperature and the VOF.
If you attach this UDF before initializing data, and Fluent wants to calculate the conductivity, Fluent will try to get the temperature/VOF, and fail, and give an error. The simplest solution: initialize your data first (with a constant conductivity), and attach the UDF after that. |
I tried this, but this didn't work. I still receive the segmentation error. Any other suggestions?
|
After doing some tests, I found out that C_VOF(c,t), returns the volume fraction of the secondary phase (seems counter-intuitive). Then I could fix the problem in the following way.
Code:
/********************************************************************* |
Eliminate the possible problems...
Does it work if you remove temperature? Code:
DEFINE_PROPERTY(cell_conductivity,cell,thread) Knowing which part of the code is really given problems, makes it much easier to find the solution. |
The problem lies in C_VOF(cell, liq) or C_VOF(cell, gas). Now I have tried to fix this the following way.
Code:
#include "udf.h" After doing some other tests, I found out that C_VOF(c,pt[1])) always returns '1', and C_VOF(c,pt[0]) always returns '0'. But why? It should return the volume fraction right? Any other suggestions to obtain the volume fraction of a cell? |
All times are GMT -4. The time now is 10:14. |