|
[Sponsors] |
April 7, 2015, 03:15 |
|
#61 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
After several iterations as well as on demand execution once again the error occurred.
Code:
FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: #f |
|
April 7, 2015, 04:05 |
|
#62 | |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
What's your latest version of the UDF, does my reply below still apply?
Quote:
|
||
April 7, 2015, 04:41 |
|
#63 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
Code:
#include "udf.h" #include "mem.h" #include "sg.h" #include "math.h" #define gamma 1.4 #define temp_infi 288.15 #define rho_infi 1.225064 #define pre_infi 101325 #define u_infi 248.0514708 #define R 287 #define M_infi 0.729 #define a 340.26 DEFINE_ON_DEMAND(shock_viscous) { Domain *d; Thread *t; cell_t c; real aa,bb,del_dot_F; real f_shock, f_viscous; real d_wave,d_viscous, d_spurious; d=Get_Domain(1); d_wave=0; d_viscous=0; d_spurious=0; thread_loop_c(t,d) { begin_c_loop(c,t) { C_P_G(c,t)[0]=1; aa=log((C_P(c,t)/pre_infi)*pow((rho_infi/C_R(c,t)),gamma)); bb=(C_R(c,t)*u_infi*aa)/(gamma*M_infi*M_infi*(gamma-1)); del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)+C_DWDZ(c,t)); f_shock=((C_U(c,t)*C_P_G(c,t)[0]) + (C_V(c,t)*C_P_G(c,t)[1]) + (C_W(c,t)*C_P_G(c,t)[2]))/(a*(NV_MAG(C_P_G(c,t)))); f_viscous= (C_MU_L(c,t)+C_MU_T(c,t))/C_MU_L(c,t); if(f_shock>=1) { d_wave+=del_dot_F; C_UDMI(c,t,1)=f_shock; } if(f_viscous>(1.1*f_viscous)) { d_viscous+=del_dot_F; C_UDMI(c,t,1)=f_viscous; } if(f_shock<1 && f_viscous<=(1.1*f_viscous)) { d_spurious+=del_dot_F; C_UDMI(c,t,1)=d_spurious; } } end_c_loop(c,t) } printf("The Viscous drag = %g\n",d_viscous); printf("The wave drag= %g\n", d_viscous); printf(" The spurious drag = %g\n",d_spurious); } It had run for 5000 iterations.. Finally the error.. I applied the same still getting the access_violation error. |
|
April 7, 2015, 07:37 |
|
#64 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Why have you included this line of code?
Code:
C_P_G(c,t)[0]=1; As for the "ACCESS_VIOLATION" error, you'll need to determine which line of code is causing this error. Insert print to screen commands such as Message0("Here is the beginning of the cell loop\n"); to debug your code. |
|
April 8, 2015, 01:52 |
|
#65 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
After inserting the Message in code.
Code:
#include "udf.h" #include "mem.h" #include "sg.h" #include "math.h" #define gamma 1.4 #define temp_infi 288.15 #define rho_infi 1.225064 #define pre_infi 101325 #define u_infi 248.0514708 #define R 287 #define M_infi 0.729 #define a 340.26 DEFINE_ON_DEMAND(shock_viscous) { Domain *d; Thread *t; cell_t c; real aa,bb,del_dot_F; real f_shock, f_viscous; real d_wave,d_viscous, d_spurious; d=Get_Domain(1); d_wave=0; d_viscous=0; d_spurious=0; Message("point a\n"); thread_loop_c(t,d) { begin_c_loop(c,t) { f_shock=((C_U(c,t)*C_P_G(c,t)[0]) + (C_V(c,t)*C_P_G(c,t)[1]) + (C_W(c,t)*C_P_G(c,t)[2]))/(a*(NV_MAG(C_P_G(c,t)))); Message(" point 1 \n"); f_viscous= (C_MU_L(c,t)+C_MU_T(c,t))/C_MU_L(c,t); Message(" point 2 \n"); if(f_shock>=1) { aa=log((C_P(c,t)/pre_infi)*pow((rho_infi/C_R(c,t)),gamma)); Message("point 3\n"); bb=(C_R(c,t)*u_infi*aa)/(gamma*M_infi*M_infi*(gamma-1)); Message("point 4\n"); del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)+C_DWDZ(c,t)); Message("point 5\n"); d_wave+=del_dot_F; Message("point 6\n"); C_UDMI(c,t,1)=f_shock; Message("point 7\n"); } if(f_viscous>(1.1*f_viscous)) Message("point 8\n"); { aa=log((C_P(c,t)/pre_infi)*pow((rho_infi/C_R(c,t)),gamma)); Message("point 9\n"); bb=(C_R(c,t)*u_infi*aa)/(gamma*M_infi*M_infi*(gamma-1)); Message("point 10\n"); del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)+C_DWDZ(c,t)); Message("point 11\n"); d_viscous+=del_dot_F; Message("point 12\n"); C_UDMI(c,t,1)=f_viscous; Message("point 13\n"); } if(f_shock<1 && f_viscous<=(1.1*f_viscous)) Message("point 14\n"); { aa=log((C_P(c,t)/pre_infi)*pow((rho_infi/C_R(c,t)),gamma)); Message("point 15\n"); bb=(C_R(c,t)*u_infi*aa)/(gamma*M_infi*M_infi*(gamma-1)); Message("point 16\n"); del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)+C_DWDZ(c,t)); Message("point 17\n"); d_spurious+=del_dot_F; Message("point 18\n"); C_UDMI(c,t,1)=d_spurious; Message("point 19\n"); } } end_c_loop(c,t) } printf("The Viscous drag = %g\n",d_viscous); printf("The wave drag= %g\n", d_viscous); printf(" The spurious drag = %g\n",d_spurious); } Code:
point a point 1 point 2 point 9 point 10 Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: #f |
|
April 8, 2015, 02:22 |
|
#66 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Firstly, be careful where you add lines of code for example:
Code:
if(f_viscous>(1.1*f_viscous)) Message("point 8\n"); // this line of code is executed only if the above condition is satisfied { // this section of code is always executed, regardless of the above if statement } Code:
del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)+C_DWDZ(c,t)); |
|
April 8, 2015, 02:55 |
|
#67 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
This is eqn of force obtained without multiplying velocity vector.
Code:
bb=(C_R(c,t)*u_infi*aa)/(gamma*M_infi*M_infi*(gamma-1)); when I multiplied bb with the velocity vector. I got (du/dx + dv/dx+ dw/dz)*bb.. This is what I was expecting from the below line. Code:
del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)+C_DWDZ(c,t)); |
|
April 8, 2015, 04:12 |
|
#68 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Check if Fluent can access the local cell velocity with the same cell number and thread pointer in the same area of code:
Code:
Message("C_U(c,t) = %e\n",C_U(c,t)); Message("C_DUDX(c,t) = %e\n",C_DUDX(c,t)); |
|
April 8, 2015, 04:59 |
|
#69 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
thanks for the reply.. It is accessing those values..
Here is the code Code:
#include "udf.h" #include "mem.h" #include "sg.h" #include "math.h" #define gamma 1.4 #define temp_infi 288.15 #define rho_infi 1.225064 #define pre_infi 101325 #define u_infi 248.0514708 #define R 287 #define M_infi 0.729 #define a 340.26 DEFINE_ON_DEMAND(shock_viscous) { Domain *d; Thread *t; cell_t c; real aa,bb,del_dot_F; real f_shock, f_viscous; real d_wave,d_viscous, d_spurious; d=Get_Domain(1); d_wave=0; d_viscous=0; d_spurious=0; Message("point a\n"); thread_loop_c(t,d) { begin_c_loop(c,t) { f_shock=((C_U(c,t)*C_P_G(c,t)[0]) + (C_V(c,t)*C_P_G(c,t)[1]) + (C_W(c,t)*C_P_G(c,t)[2]))/(a*(NV_MAG(C_P_G(c,t)))); Message(" point 1 \n"); f_viscous= (C_MU_L(c,t)+C_MU_T(c,t))/C_MU_L(c,t); Message(" point 2 \n"); if(f_shock>=1) { aa=log((C_P(c,t)/pre_infi)*pow((rho_infi/C_R(c,t)),gamma)); Message("point 3\n"); bb=(C_R(c,t)*u_infi*aa)/(gamma*M_infi*M_infi*(gamma-1)); Message("point 4\n"); del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)+C_DWDZ(c,t)); Message("point 5\n"); d_wave+=del_dot_F; Message("point 6\n"); C_UDMI(c,t,1)=f_shock; Message("point 7\n"); } if(f_viscous>(1.1*f_viscous)) Message("point 8\n"); { aa=log((C_P(c,t)/pre_infi)*pow((rho_infi/C_R(c,t)),gamma)); Message("point 9\n"); bb=(C_R(c,t)*u_infi*aa)/(gamma*M_infi*M_infi*(gamma-1)); Message("point 10\n"); Message("C_U(c,t) = %e\n",C_U(c,t)); Message("C_DUDX(c,t) = %e\n",C_DUDX(c,t)); del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)+C_DWDZ(c,t)); Message("point 11\n"); d_viscous+=del_dot_F; Message("point 12\n"); C_UDMI(c,t,1)=f_viscous; Message("point 13\n"); } if(f_shock<1 && f_viscous<=(1.1*f_viscous)) Message("point 14\n"); { aa=log((C_P(c,t)/pre_infi)*pow((rho_infi/C_R(c,t)),gamma)); Message("point 15\n"); bb=(C_R(c,t)*u_infi*aa)/(gamma*M_infi*M_infi*(gamma-1)); Message("point 16\n"); del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)+C_DWDZ(c,t)); Message("point 17\n"); d_spurious+=del_dot_F; Message("point 18\n"); C_UDMI(c,t,1)=d_spurious; Message("point 19\n"); } } end_c_loop(c,t) } printf("The Viscous drag = %g\n",d_viscous); printf("The wave drag= %g\n", d_viscous); printf(" The spurious drag = %g\n",d_spurious); } Error reads Code:
point a point 1 point 2 point 9 point 10 C_U(c,t) = 2.293790e+02 C_DUDX(c,t) = 3.646992e+02 Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: #f |
|
April 8, 2015, 05:07 |
|
#70 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
What about C_DWDZ(c,t)? If you're running 2-D then it'd make sense if that variable wasn't available because it's only available in 3-D.
|
|
April 8, 2015, 05:24 |
|
#71 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
Sorry I forgot to inform its 2D. I need the same in 3D as well.
I just changed the code now. Its running like anything, cannot stop the fluent. I just clicked execute on demand. Its not giving access_violation error. its executing. I dunno when it will stop. Can you check this code? Is it correct? Code:
#include "udf.h" #include "mem.h" #include "sg.h" #include "math.h" #define gamma 1.4 #define temp_infi 288.15 #define rho_infi 1.225064 #define pre_infi 101325 #define u_infi 248.0514708 #define R 287 #define M_infi 0.729 #define a 340.26 DEFINE_ON_DEMAND(shock_viscous) { Domain *d; Thread *t; cell_t c; real aa,bb,del_dot_F; real f_shock, f_viscous; real d_wave,d_viscous, d_spurious; d=Get_Domain(1); d_wave=0; d_viscous=0; d_spurious=0; Message("point a\n"); thread_loop_c(t,d) { begin_c_loop(c,t) { f_shock=((C_U(c,t)*C_P_G(c,t)[0]) + (C_V(c,t)*C_P_G(c,t)[1]))/(a*(NV_MAG(C_P_G(c,t)))); Message(" point 1 \n"); f_viscous= (C_MU_L(c,t)+C_MU_T(c,t))/C_MU_L(c,t); Message(" point 2 \n"); if(f_shock>=1) { aa=log((C_P(c,t)/pre_infi)*pow((rho_infi/C_R(c,t)),gamma)); Message("point 3\n"); bb=(C_R(c,t)*u_infi*aa)/(gamma*M_infi*M_infi*(gamma-1)); Message("point 4\n"); del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)); Message("point 5\n"); d_wave+=del_dot_F; Message("point 6\n"); C_UDMI(c,t,1)=f_shock; Message("point 7\n"); } if(f_viscous>(1.1*f_viscous)) Message("point 8\n"); { aa=log((C_P(c,t)/pre_infi)*pow((rho_infi/C_R(c,t)),gamma)); Message("point 9\n"); bb=(C_R(c,t)*u_infi*aa)/(gamma*M_infi*M_infi*(gamma-1)); Message("point 10\n"); Message("C_U(c,t) = %e\n",C_U(c,t)); Message("C_DUDX(c,t) = %e\n",C_DUDX(c,t)); del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)); Message("point 11\n"); d_viscous+=del_dot_F; Message("point 12\n"); C_UDMI(c,t,1)=f_viscous; Message("point 13\n"); } if(f_shock<1 && f_viscous<=(1.1*f_viscous)) Message("point 14\n"); { aa=log((C_P(c,t)/pre_infi)*pow((rho_infi/C_R(c,t)),gamma)); Message("point 15\n"); bb=(C_R(c,t)*u_infi*aa)/(gamma*M_infi*M_infi*(gamma-1)); Message("point 16\n"); del_dot_F=bb*(C_DUDX(c,t)+C_DVDY(c,t)); Message("point 17\n"); d_spurious+=del_dot_F; Message("point 18\n"); C_UDMI(c,t,1)=d_spurious; Message("point 19\n"); } } end_c_loop(c,t) } printf("The Viscous drag = %g\n",d_viscous); printf("The wave drag= %g\n", d_viscous); printf(" The spurious drag = %g\n",d_spurious); } |
|
April 8, 2015, 05:37 |
|
#72 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
Thank you so much 'e'...
Its executing each and every messages now.... |
|
April 8, 2015, 05:42 |
|
#73 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Great, so the issue was you were trying to access a gradient, dw/dz, which is only applicable in 3-D cases but you're running a 2-D case. Remember that you'll need to include these z-direction forces/gradients for your 3-D case.
|
|
April 8, 2015, 05:53 |
|
#74 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
Ok 'e'. I will keep in mind. thank you.
I just run the fluent for 60 iterations and it didnt give any access violation errors. Output looks like this. Code:
The Viscous drag = 0 The wave drag= 0 The spurious drag = -1.#IND |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF | acasas | CFD Freelancers | 1 | January 23, 2015 08:26 |
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 |