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.
PS. The problem I am solving is the following:
This is the differential equation...
∂α/∂t = Z0e(.Ea/RT)αm(1 - α)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; α is the degree of conversion; and m & n are the reaction order constants. The conversion parameter, α, ranges between zero and one. When there is no reaction α = 0, while α = 1 indicates a complete reaction. The energy balance equation for a 1-D axisymmetric model is given in cylindrical coordinates by
ρC(∂T/∂t)= k (∂2T/∂r2) +(1/r)(∂T/∂r) + ρcq(∂α/∂t) (2)
The last term of equation (2) is the one that I am solving using the UDF since I need the values of α for each cell (since α requires temperature to be solved, see Eq. 1). This value of α 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 α. I do not know how to assign the sourcer term for each cell.
|All times are GMT -4. The time now is 06:21.|