
[Sponsors] 
July 23, 2017, 04:58 
Question about Energy Equation

#1 
Member
Ashish Vinayak
Join Date: Mar 2015
Location: Wuppertal, Germany
Posts: 50
Rep Power: 10 
Hi,
I am a beginner in OpenFOAM and would like to understand the source code for the reactingOneDim.C. You might possibly not be familiar with the solver, but I am certain this form of equation also appears elsewhere. Code:
fvScalarMatrix hEqn ( fvm::ddt(rho_, h_)  fvm::laplacian(alpha, h_) + fvc::laplacian(alpha, h_)  fvc::laplacian(kappa(), T()) == chemistrySh_  fvm::Sp(solidChemistry_>RRg(), h_) ); 

July 28, 2017, 04:50 

#2 
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,680
Blog Entries: 6
Rep Power: 49 
Hi,
I am not familiar with the pyrolysis models in OpenFOAM and with the equations that are solved here. If we would write the equations in vector form the two laplacian terms would look equal, right: I am not sure about the last Sp() term, I just removed it but I guess it is a source term of the chemistry too, which is either put to the matrix or source based on the sign (Sp()). The equation is equal to: Now, implementing both as fvm would not make any change (only more computational effort). If we change one to be an explicit one, and the other implicit, these terms get equal if the explicit terms are converged and then the implicit and explicit term should vanish. Why they do it? I have no idea but maybe it is based on the chemistry and it stabilizes it. For me and my colleague, this is the only explanation right now. But I am not an expert in that particular problem. Therefore I could be completely wrong.
__________________
Keep foaming, Tobias Holzmann 

July 28, 2017, 05:25 

#3 
Member
Ashish Vinayak
Join Date: Mar 2015
Location: Wuppertal, Germany
Posts: 50
Rep Power: 10 
This does clear out my understanding of those two terms.
For future reference: the Sp() term on the RHS is due to transport of gas through control volume of solid and acts as a source term. It is positive since pyrolysis is endothermic and uses Sp() for diagonal dominance. One last question: By implicit and explicit you mean time steps (n+1) and (n) respectively right? Unless I am missing something. Just want to be sure 

July 28, 2017, 08:54 

#4 
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,680
Blog Entries: 6
Rep Power: 49 
Hi,
thanks for explaining the Sp() term. As I said, based on the sign it should be pushed to the matrix (diagdominance) or source. Maybe I mix it with SuSp, which checks the signs and pushes either to the diagonal or source. The thing with explicit was referred to previous iteration. E.g. in Stress calculation (the one I am using) we use the DuhamelNeumann equation given as: Putting everything into the first one we get: Terms on the RHS: 1. fvm::laplacian() 2. fvc::div( of fvc::grad()) 3. tr ( fvc::grad()) So if term 2 and 3 would be from the old time step they are like constants, right? Therefore, we could solve the system directly within on outer loop. But in fact they are not constant and change with the outer loops because the fvc::grad(D) should use the values of the last iteration and not the one from the last time step. I was checking right now the fvm::laplacian and fvc::laplacian and went till the Gauss laplacian schemes. Here you will find the difference but I could not see anything related to old time steps. More likely that in fvc:: we calculate the values explicit with the fvc::div operator and in the fvm:: we make it implicit with a matrix, source etc... Unfortunately, I have no time to check it in more detail right now but if you would like to do it, I would be happy to get the information. Actually, I think the fvc:: will take the data of the last iteration. E.g. we update h and then put the new h into the fvc::laplacian() ... if you follow the way we calculate the laplacian using fvc, you will see that we use the values of h and not the previous time step. As far as I remember the old time steps are only included in the ddt:: terms. , I might be wrong here and it would be nice if someone can check it (no time). PS: If it would be old time step, then the terms only would vanish for the steadystate scenario.
__________________
Keep foaming, Tobias Holzmann Last edited by Tobi; July 28, 2017 at 10:40. 

September 12, 2019, 02:37 

#5  
Senior Member

Hello Ashish Vinayak,
In my work, I defined the reactions with sevaral gaseous species (H2O CH4 C2H6 CO H2 CO2) as follows, Quote:
Quote:
My question is, Will the inlcusion of source term " fvm::Sp(solidChemistry_>RRg(), h_)" help to plot the gaseous species ? Because as per your above quote, transport of gas is taken into account on the source term literally Quote:
Quote:
Kindly share your ideas please. Thank you 

Tags 
energy equation, pyrolysis, reactingonedim 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Source Term due to evaporation in energy transport equation  styleworker  OpenFOAM Programming & Development  3  September 7, 2022 04:09 
Energy equation in bouyant*Foam solvers  makaveli_lcf  OpenFOAM Running, Solving & CFD  0  December 21, 2009 05:09 
Viscosity and the Energy Equation  Rich  Main CFD Forum  0  December 16, 2009 15:01 
Energy equation convergence problem  Reza  Main CFD Forum  0  August 27, 2003 14:09 
Energy equation  Suresh Balasubramanian  FLUENT  1  April 6, 2003 03:54 