|
[Sponsors] |
June 30, 2016, 13:37 |
how can I get rid of segmentation fault
|
#1 |
New Member
|
I am a newbie in ANSYS FLUENT. So, a lot of things still make no sense to me. I have been browsing various sources for past 3/4 days for the issue but to no avail.
I have a very simple 3D geometry of a rectangular channel and I am trying to use a temperature dependent density function and use a udf. The geometry has only inlet, outlet and wall. The code: #include "udf.h" DEFINE_PROPERTY(density,c,t) { real rho_w, rho_f, rho_p; real ci=0.01; real temp = C_T(c,t); rho_w = 838.466+1.4*temp-.003*temp*temp; rho_p = 750./(0.001*(temp-319.15)+1.); rho_f = ci*rho_p+(1-ci)*rho_w; return rho_f; } Now although I can interpret this code, I keep getting 'segmentation fault' error. Some questions have raised in my mind: 1) Is my code correct? does this thread pointer (t) represent the whole fluid domain? 2) Why do I keep getting this error? 3) If I replace those temperature dependent functions with some constants, the simulation runs and does not show the error message. Someone please help me with the code. Last edited by sabuj; July 1, 2016 at 13:29. |
|
July 1, 2016, 07:34 |
|
#2 | |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
Quote:
|
||
July 1, 2016, 13:30 |
|
#3 |
New Member
|
Yes, Mr. Bruno. I enabled the energy equation. I am using FLUENT 15.0
|
|
July 2, 2016, 09:53 |
|
#4 | |
Member
amirhossein
Join Date: Jul 2014
Location: Canada
Posts: 81
Rep Power: 12 |
Quote:
use another name for temperature instead of "temp" , like "z" or any thing else the path that you save your udf , should not have space in directory address . for example //c:new folder is wrong //c:newfolder is right and other thing is that why you use "." in this line : rho_p = 750./(0.001*(temp-319.15)+1.); after 750 and after 1 ? |
||
July 3, 2016, 06:46 |
|
#5 |
Member
Davoud Malekian
Join Date: Jan 2016
Posts: 53
Rep Power: 10 |
Hi Sabuj,
i just checked your UDF and both interpret and compile worked well with it and nothing appeard as an error. (my geometry was just a fluid zone) if u got fluid and solid in your geometry i think u should some how specify your fluid zone in your udf (i mean specify t) like: if (FLUID_THREAD_P(t)) { .... } |
|
Tags |
udf density |
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |
ABL use of fixed shear stress leads to segmentation fault 11 | cristopf | OpenFOAM Running, Solving & CFD | 1 | December 23, 2016 17:57 |
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 |