CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Modifications necessary in my numerical solution of the heat conduction equation (https://www.cfd-online.com/Forums/openfoam-programming-development/239763-modifications-necessary-my-numerical-solution-heat-conduction-equation.html)

Kummi November 23, 2021 02:24

Modifications necessary in my numerical solution of the heat conduction equation
 
Hello Foamers,
Here is my explanation about the numerical solution followed by the query.
Consider a region of interest to be divided into n elements of width \Delta x. The midpoints of these elements are P_{1},....,P_{n}. The temperature at these points are T_{1},....,T_{n} at time t. At increment of time t +\Delta t, the temperature are notified as \theta_{1},....,\theta_{n}.
The 1D equation, unit W/m^{3}
Quote:

{\rho c\frac{\delta T}{\delta t}=\frac{\delta}{\delta x}\left ( K\frac{\delta T}{\delta x} \right )+Q\
}
The approximation in time for above equation,

\left [\rho c\frac{\delta T}{\delta t}  \right ]_{t+\frac{\Delta t}{2}}=\left [\frac{\delta}{\delta x}\left ( K\frac{\delta T}{\delta x} \right )  \right ]_{_{t+\Delta t}}+Q_{t}

For i=1 to n-1,

\rho_{i} c_{i}\frac{(\theta_{i}-T_{i})}{\Delta t}=\left ( K_{U,i}\frac{\left ( \theta _{i+1}-\theta _{i} \right )}{\Delta x} - K_{L,i}\frac{\left ( \theta _{i}-\theta _{i-1} \right )}{\Delta x}\right )/\Delta x+Q_{i}

where \rho _{i}, c_{i} and Q_{i} are the density (kg/m3), specific heat (J/kg K) and heat release rate (W/m3) of the i^{th} element at time t, and K_{U,i},K_{L,i} are the average conductivities (W/m K) from P_{i} to P_{i+1} and P_{i+1} to P_{i} respectively at time t.
After rearranging, the final form of the equation (for T>=500deg) is,
Quote:

l_{i}\theta _{i-1}+g_{i}\theta _{i}+u_{i}\theta _{i+1}=z_{i}
where,
l_{i} = -D_{L,i}/D_{0},
g_{i} = 1 + (D_{U,i}+D_{L,i})/D_{0},
u_{i} = -D_{U,i}/D_{0},
z_{i} = T_{i}+\Delta tQ_{i}/\rho _{i}c_{i} --> (1)
where, D_{U,i}, D_{L,i} and D_{0} are diffusivities defined by,
D_{U,i} = K_{U,i}/\rho _{i}c_{i}
D_{L,i} = K_{L,i}/\rho _{i}c_{i}
D_{0}=\Delta x^{2}/\Delta t
The above EQU.(1) initializes the temperature distribution for dry coal pyrolysis phenomenon.
In case of wet coal pyrolysis, moisture content should be included with the coal. And thereby, I need to modify the above linear equation (when T=100) slightly as,
Quote:

l_{i} =0
g_{i} = 1
u_{i} = 0
z_{i} = 100--> (2)
The modification implies the approximation that the moisture evaporation occurs at T = 100deg, where there is no effect of diffusion (l_{i} = u_{i} = 0).
In OpenFOAM, I have made my customized solver for dry coal pyrolysis based on EQU.(1) with default settings.
For wet coal pyrolysis, I don't know where and how to make changes for implementing EQU.(2).
Can someone share ideas here.
Thank you


All times are GMT -4. The time now is 12:48.