|
[Sponsors] |
October 7, 2011, 11:43 |
UDF Define_Source problem
|
#1 |
New Member
Luke Holsen
Join Date: Jun 2011
Posts: 12
Rep Power: 15 |
I have a Souce term which should be generating a constant value. However it appears that the value is only generating the value at one side of the cell zone. This is the first UDF and C++ code I have written so I probably missed something simple.
#include "udf.h" /************************************************** **************************************** This UDF calculates Source Terms for the Lumen, Endothelium, Vascular Wall, and Tissue Layer ************************************************** ******************************************/ /*** Species numbers ***/ #define Oxygen 0 #define NO 1 /************************************************** **************************************** Endothelium Source Terms: NO Generation and O2 Consumption ************************************************** ******************************************/ /*** Define Variables for Calculation ***/ #define RNOmax 0.000054 /*Maximum eNOS Production Rate (54 uM/s )->(M/s)*/ #define KmeNOS 4.7 /*Michaelis-Menten reaction kinetics term (4.7 Torr)*/ #define AlphaT .00000134 /*Solubility Coefficient (M/Torr)*/ DEFINE_SOURCE( Endothelium_NOGen, c, t, dS, eqn) { real con, concNO; concNO=(((RNOmax) *C_UDSI(c,t,Oxygen))/(C_UDSI(c,t,Oxygen)+(KmeNOS))); return concNO; } DEFINE_SOURCE( Endothelium_Oxygencons, c, t, dS, eqn) { real con, concOxy; concOxy=((-1)*((RNOmax)*C_UDSI(c,t,Oxygen))/(C_UDSI(c,t,Oxygen)+(KmeNOS)))/AlphaT; return concOxy; } Any help would be great. Thanks! |
|
October 7, 2011, 13:45 |
|
#2 |
Senior Member
|
Dear Luke,
Probably, you've hooked this UDF to one of your zones. You have to hook it to any fluid/solid zone which you want to be included in equations there. Otherwise check validity of your UDSs, maybe there aren't defined for some zones or aren't solved there. Bests,
__________________
Amir |
|
October 7, 2011, 13:50 |
|
#3 |
New Member
Luke Holsen
Join Date: Jun 2011
Posts: 12
Rep Power: 15 |
I guess it is linked to the Cell zone but thats the only zone I want it to run in. So when I opened the Cell zone conditions that is where I applied the source term. It should be using the Concentration of the UDS defined as C_UDSI(c,t,Oxygen). Isthat not what I was supposed to do?
It appears it does not continue to run throught the cell zone just the left side. |
|
October 7, 2011, 14:08 |
|
#4 | |
Senior Member
|
Quote:
__________________
Amir |
||
October 7, 2011, 14:15 |
|
#5 |
New Member
Luke Holsen
Join Date: Jun 2011
Posts: 12
Rep Power: 15 |
Ok, I want that equation to be solved for every cell in that specific cell zone. I am looking at thevariable macros and maybe instead of C_UDSI for cell field it should be F_UDSI for face field?
|
|
October 7, 2011, 14:20 |
|
#6 |
Senior Member
|
Ok, you want to solve that equation in a specific zone so you need source term for that specific zone and you have to be aware of boundary values of your variable near that zone which you can use fixed values in fluent or a UDF to set that in other zone.
__________________
Amir |
|
October 7, 2011, 14:27 |
|
#7 |
New Member
Luke Holsen
Join Date: Jun 2011
Posts: 12
Rep Power: 15 |
Right. I set this UDF as the Source term in the Cell Zone. I set a constant value for the C_UDSI(c,t,Oxygen). Even when I used the constant value it was giving me a declining value across the zone. the color contour plot of the UDS looks like the source term is only working on one side of the cell zone.
|
|
October 7, 2011, 14:31 |
|
#8 | |
Senior Member
|
Quote:
It seems that I couldn't clear my idea. You've hooked it just for one side where you want to solve your UDS, so why do you anticipate both side source?
__________________
Amir |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 07:05 |
what's the problem with my udf | zzyan | FLUENT | 0 | November 4, 2010 04:56 |
Problem with my udf | july | Fluent UDF and Scheme Programming | 3 | June 20, 2010 07:56 |
udf compiling problem | akr | FLUENT | 3 | August 22, 2007 08:14 |
UDF problem | chiseung | FLUENT | 4 | January 10, 2002 10:58 |