|
[Sponsors] | |||||
|
|
|
#1 |
|
Guest
Posts: n/a
|
Hi, I am doing some modeling work by Fluent, there is a problem for me to call the result from one subroutine to another for further calculation, could any one kindly tell me how to do it? Thanks. Here is part of my program, I need to call the result of F_UDSI from UDS_FLUX when doing the calculation of source in SOURCE.
DEFINE_UDS_FLUX(a,f,t,i) { face_t f; Thread *t=Look_Thread(domain,ID); Yo2=F_YI(f,t,0); Pc=F_P(f,t); Xo2=Yo2*Pc; F_UDSI(f,t,0)=Pc*Xo2; return F_UDSI(f,t,0); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEFINE_SOURCE(qq_source,c,thread,ds,eqn) { cell_t c; face_t f; Thread *t; real source,I0,w; w=F_UDSI(f,t,0); source=-w*2.5; ds[eqn]=-2.5; return source; } thanks |
|
|
||
|
|
|
#2 |
|
Guest
Posts: n/a
|
You should note that for each cell there are multiple faces - so generally your source term will require some integration over all these faces - see Gauss divergence theorem in math books, which is the normal way of doing this.
Alternatively, you can use adjacent cell information to interpolate to a face. You need to remeber that Fluent doesn't necessarily store face data - for many variables only cell data is stored. Look at the macro definitions in .h files and you'll see that the face definitions and cell definitions are often the same! Greg |
|
|
||
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| uds flux - drift velocity - udf | johnwinter | Fluent UDF and Scheme Programming | 3 | November 25, 2017 05:07 |
| error about uds in udf | a.maroofi | Fluent UDF and Scheme Programming | 0 | September 22, 2010 03:23 |
| connection between udf and uds | a.maroofi | Fluent UDF and Scheme Programming | 1 | September 19, 2010 09:46 |
| Associating profile files for the UDS though a UDF | Bharath | FLUENT | 0 | December 1, 2006 16:58 |
| UDS & UDF | geg | FLUENT | 0 | May 25, 2006 13:06 |