CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF for energy source (https://www.cfd-online.com/Forums/fluent/37755-udf-energy-source.html)

 mauricio sanchez August 30, 2005 15:56

UDF for energy source

Hello, I have been trying to solve a time-dependet single order differential equation inside FLUENT. The differential equation uses the temperature per each cell to obtain a numerical value that needs to be placed on the source term for each cell in the domain.

I do not know how to assign the sourcer term for each cell.

I have tried tiresly to work on this problem but I have not been able to get an answer. One method I have tried is creation of UDS in order to hold the answer for each cell but I am getting an "Access Violation Error".

I am trying to follow the UDF manual with respect to UDS but is does not describe in detail how to set it up. I have even tried to use its examples and still I get the same error message.

If somebody can help me out I would appreciate it (either set an answer to assign a source term for each cell or using UDS). Please take a look of the problem description.

THANKS Mauricio.

PS. The problem I am solving is the following:

This is the differential equation...

&part;&alpha;/&part;t = Z0e(.Ea/RT)&alpha;m(1 - &alpha;)n (1)

where Z0 (1/s) is a constant; Ea (J/mol) is the activation energy; R (8.31 J/mol-K) is the universal gas constant; T (K) is the absolute temperature; &alpha; is the degree of conversion; and m & n are the reaction order constants. The conversion parameter, &alpha;, ranges between zero and one. When there is no reaction &alpha; = 0, while &alpha; = 1 indicates a complete reaction. The energy balance equation for a 1-D axisymmetric model is given in cylindrical coordinates by

&rho;C(&part;T/&part;t)= k (&part;2T/&part;r2) +(1/r)(&part;T/&part;r) + &rho;cq(&part;&alpha;/&part;t) (2)

The last term of equation (2) is the one that I am solving using the UDF since I need the values of &alpha; for each cell (since &alpha; requires temperature to be solved, see Eq. 1). This value of &alpha; needs to be calculated for every cell using the current and previous temperature and time respectively after discretization of the equation.

As you might see the last term is not directly dependent on temperature so it can go as a constant in the source term. (It is to remember that is a constant source term but each cell will have a different value)

I am using Rungue-Kutta mehod to solve for &alpha;. I do not know how to assign the sourcer term for each cell.

 All times are GMT -4. The time now is 11:54.