|
[Sponsors] |
July 13, 2004, 16:18 |
Calculate net species/ UDS flux
|
#1 |
Guest
Posts: n/a
|
I am new to Fluent. I am using the software to model electrochemical analyses with advective effects. I have found in Fluent the capability to solve for the net flux of energy through a surface which has a specified temperature. Is there an easily available analogous capability for calculating the net flux of an electroactive species to a solid surface? Or the surface integral of normal gradient of the species concentration at a surface? Thanks!
|
|
July 21, 2004, 10:58 |
Re: Calculate net species/ UDS flux
|
#2 |
Guest
Posts: n/a
|
Figured it out - a UDF to do this is based on Fluent 6.1 UDF Guide section 5.2.2 Connectivity Variables. Here's the UDF for UDS-0 : note that because Execute_at_end does not have threads available to be passed, the zone ID and index must be hard coded. Also, prior to linking to a case file, type "solve/set/expert" and then answer "yes" to the question "keep temporary solver memory from being freed? Finally, use as a compliled not interpreted UDF.
------------------------------------------------------ #include "udf.h" #include "sg.h" DEFINE_EXECUTE_AT_END(uds_flux) { Domain *dom= Get_Domain(1); int ID=5; int index=0; Thread *f_thread = Lookup_Thread(dom,ID); Thread *tc0; face_t f; cell_t c0; real grad[ND_ND]; real A[ND_ND]; real es[ND_ND]; real dr0[ND_ND]; real A_by_es; real ds; real flux; real scalar_c; real scalar_f; real grad_p; real grad_x; real D;/* scalar diffusion coefficient*/ real rho;/* mixture density*/ flux = 0.0; begin_f_loop(f, f_thread); { c0 = F_C0(f,f_thread); tc0 = THREAD_T0(f_thread); BOUNDARY_FACE_GEOMETRY(f,f_thread,A,ds,es,A_by_es, dr0) grad[0]=C_UDSI_G(c0,tc0,index)[0]; grad[1]=C_UDSI_G(c0,tc0,index)[1]; scalar_c=C_UDSI(c0,tc0,index); scalar_f=F_UDSI(f,f_thread,index); rho = C_R(c0,tc0); D=C_UDSI_DIFF(c0,tc0,index)/rho; /* for my applications expect D to be constant therefore OK, also, my D is FLUENTs gamma/rho*/ grad_p=(scalar_f-scalar_c)/ds*A_by_es; grad_x=NV_DOT(grad,A)-NV_DOT(grad,es)*A_by_es; flux+=D*(grad_p+grad_x); } end_f_loop(f, f_thread); flux=flux*2.*M_PI; /* for 2-D axisymetric calculation */ Message("Surface integral of boundary flux of normal gradient of scalar: %g\n", flux); |
|
August 2, 2004, 09:16 |
Re: Calculate net species/ UDS flux
|
#3 |
Guest
Posts: n/a
|
Slight correction to the above - for general 2 or 3 - D problem replace lines such as "grad[0]=C_UDSI_G(c0,tc0,index)[0];" with ND_SET commands
|
|
August 4, 2004, 10:59 |
Re: VOF
|
#4 |
Guest
Posts: n/a
|
How can I calculate the Flux of Vof species at the cell face. Please let me know
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to specify surface flux of a species? | ked | FLUENT | 18 | February 15, 2022 16:03 |
UDS Flux Function Choice | Yang Chung | FLUENT | 1 | November 17, 2015 02:14 |
setting UDS Flux | Andrew Garrard | FLUENT | 9 | February 10, 2015 14:26 |
Help! How to calculate the diffusion flux of a UDS | lzw | FLUENT | 0 | June 18, 2008 04:50 |
Help with UDS FLUX | Andrew Garrard | FLUENT | 2 | February 14, 2005 06:47 |