CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Calculate net species/ UDS flux (http://www.cfd-online.com/Forums/fluent/34189-calculate-net-species-uds-flux.html)

 PK57 July 13, 2004 15:18

Calculate net species/ UDS flux

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!

 Peter Kottke July 21, 2004 09:58

Re: Calculate net species/ UDS flux

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;

face_t f;

cell_t c0;

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 D;/* scalar diffusion coefficient*/

real rho;/* mixture density*/

flux = 0.0;

{

scalar_c=C_UDSI(c0,tc0,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*/

}

flux=flux*2.*M_PI; /* for 2-D axisymetric calculation */

Message("Surface integral of boundary flux of normal gradient of scalar: %g\n", flux);

 Petere Kottke August 2, 2004 08:16

Re: Calculate net species/ UDS flux

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

 Sandeep August 4, 2004 09:59

Re: VOF

How can I calculate the Flux of Vof species at the cell face. Please let me know

 All times are GMT -4. The time now is 17:34.