DEFINE_SOURCE error
Hello, I am solving the diffusion equation with the concentration formulation. I would like to add a source term via UDF that includes the gradient of concentration but I get an Access Violation error when I try to use the C_UDSI_G(c,t,i) macro. Can I use this macro with the concentration formulation?
my code is: DEFINE_SOURCE(MySource,c,t,dS,eqn) { real Rw,Dc,De,Q; #define Rw 4.0e-4 #define Dc 0.0001 #define De 4.0e-5 #define Q 2.14e10 real x[ND_ND],XX, Source; C_CENTROID(x,c,t); XX=De*C_UDSI_G(c,t,C0)[2]; Source=XX-(Rw+Dc)*C_UDSI(c,t,C0)+Q; C_UDSI(c,t,C1)=C_UDSI_G(c,t,C0)[2]; dS[eqn]=XX*C_UDSI_G(c,t,C1)[2]-Rw-Dc; return Source; } I have used the first derivative and second derivative. Best Regards, thank you romans |
Re: DEFINE_SOURCE error
HI, I have used the first derivative and second derivative for the user defined scalars,when i initialize source terms, i get this error,just like: 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: ()
would you help me? Thank you in advance. romans |
Re: DEFINE_SOURCE error
in the C_UDSI_G(c,t,i) macro, you use i = C0. Is C0 an integer?
|
Re: DEFINE_SOURCE error
Hi, in the C_UDSI_G(c,t,C0) macro, C0 is an integer. the code is compiled without error. now, i want to get the second derivative for C_UDSI_G(x,t,i),how to do?
Thanks. romans |
Quote:
hope that can help you. |
The last argument in the DEFINE_SOURCE is an index. In your case it is eqn. C0 and C1 are not defined in your code.
|
All times are GMT -4. The time now is 04:47. |