|
[Sponsors] |
May 14, 2018, 18:04 |
Segmentation error with DEFINE_SOURCE
|
#1 |
New Member
Masoud Mo
Join Date: May 2018
Posts: 6
Rep Power: 8 |
Hi fellows,
I am simulating a 2phase problem (liquid and air) that liquid phase comes from inlet and depositing on wall substrate. I am using heat source to apply and make it molten. I defined the code as below, to select only second phase cells and apply on them but after starting Ive got the segmentation error. Would you please guide me on this regard. Thanks #include "udf.h" DEFINE_SOURCE(heatsource, c, thsec, dS, eqn) { real x[ND_ND], source, current_time; real xc; /* xc - x coordinate */ real yc; /* yc - y coordinate */ Thread *thmix; thsec = THREAD_SUB_THREAD(thmix,3); C_CENTROID(x,c,thsec); xc=x[0]; /* the x coordinate of the cell - 0th component of vector x */ yc=x[1]; /* the y coordinate of the cell - 1st component of vector x */ if (xc>=0.0045 & xc<=0.0077 & yc>=-0.001 & yc<=0.0029) { source=10e11;} else { source=0;} dS[eqn] = 0.0; /* the source does not depend on temperature so dS = 0 */ return source; } |
|
|
|
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 21:59 |
Segmentation fault in SU2 V5.0 | ygd | SU2 | 2 | March 1, 2017 04:38 |
Segmentation fault when running in parallel | Pj. | OpenFOAM Running, Solving & CFD | 3 | April 8, 2015 08:12 |
Segmentation Fault w/ compiled OF 2.2.0 - motorBike example | sudo | OpenFOAM Running, Solving & CFD | 3 | April 2, 2013 17:27 |
segmentation fault when installing OF-2.1.1 on a cluster | Rebecca513 | OpenFOAM Installation | 9 | July 31, 2012 15:06 |