|
[Sponsors] |
November 30, 2012, 18:02 |
Help with UDF
|
#1 |
Member
Abhijeet Shrawage
Join Date: Feb 2012
Posts: 31
Rep Power: 14 |
Hello everyone,
i have compiled the following UDF for density, thermal conductivity and viscosity. But i am getting the access violation error. Now I know what it is but i am not sure how to best deal with it. the UDF for density is given below as an example. It compiled without a hitch. but the minute i initialize i get that error. Do you guys see any flaws or can give any tips regarding this issue?? Sincere thanks #include "udf.h" /* Date: 11/15/2012 Density of supercritcal water at pressure line of 24MPa*/ DEFINE_PROPERTY(density, c, t) { real rho; int i; int N1 = 8; real aa[8]={9.057256850332234e+011, -1.004223127586313e+010, 4.771729301474036e+007, -1.259615031360143e+005, 1.994987699191794e+002, -0.189575891223812, 1.000789828768001e-004, -2.264203358260640e-008}; int N3 = 8; real cc[8]={1.213009600498309e+010, -1.184275708420463e+008, 4.952997273974567e+005, -1.150308037299205e+003, 1.602192564936295, -0.001338350280787, 6.208057950195209e-007, -1.233583438752835e-10}; real Temp = C_T(c, t); /* Inorder to prevent the solution to collapse in case the temperature of the system goes below the ranges provided the following steps were taken to limit the values to a constant quantity*/ if ( Temp < 618.0) rho = 640.0; else if (Temp > 773.0) rho = 84.0; /* curve fits are put together below */ /* ********************************************* */ if (Temp >= 618.0 && Temp <= 650.0) { rho = aa[7]; for ( i=N1-2; i >=0; i--) rho = rho*Temp + aa[i]; } else if ( Temp > 650.0 && Temp <= 654.0 ) rho = (-5.3517 * Temp + 6949.9 )* Temp -2.2559e+006; else if ( Temp > 654.0 && Temp <= 773.0 ) { rho = cc[7]; for ( i=N3-2; i >=0; i--) rho = rho*Temp + cc[i]; } /* return density calculated by the curve fits */ return rho; } |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Source Term UDF VS Porous Media Model | pchoopanya | Fluent UDF and Scheme Programming | 1 | August 28, 2013 07:12 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 22:38 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 05:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |