|
[Sponsors] |
August 28, 2008, 10:13 |
DEFINE_SOURCE error
|
#1 |
Guest
Posts: n/a
|
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 |
|
August 28, 2008, 22:09 |
Re: DEFINE_SOURCE error
|
#2 |
Guest
Posts: n/a
|
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 |
|
August 29, 2008, 00:34 |
Re: DEFINE_SOURCE error
|
#3 |
Guest
Posts: n/a
|
in the C_UDSI_G(c,t,i) macro, you use i = C0. Is C0 an integer?
|
|
August 29, 2008, 05:57 |
Re: DEFINE_SOURCE error
|
#4 |
Guest
Posts: n/a
|
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 |
|
April 30, 2012, 22:08 |
|
#5 | |
New Member
Pacheo
Join Date: Apr 2009
Posts: 7
Rep Power: 16 |
Quote:
hope that can help you. |
||
May 1, 2012, 20:00 |
|
#6 |
Member
Krishna
Join Date: Oct 2009
Posts: 34
Rep Power: 16 |
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.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DEFINE_SOURCE | PK | FLUENT | 0 | December 6, 2006 10:36 |
DEFINE_SOURCE | CN | FLUENT | 2 | August 5, 2005 11:29 |
DEFINE_SOURCE | saghir | FLUENT | 0 | May 12, 2005 03:53 |
DEFINE_SOURCE | Dolores | FLUENT | 2 | May 18, 2004 05:18 |
error message about using DEFINE_SOURCE | emma | FLUENT | 5 | April 2, 2004 04:18 |