Equation: \rho \frac{Dh}{Dt} = \frac{Dp}{Dt} -\nabla \cdot \vec{q} + Q + \Phi + \rho\sum_{k=1}^{K}Y_kf_{k,i}V_{k,i}
Poinsot's heat flux vector looks like the following.
Equation: q_i = -\lambda \nabla T + \rho\sum_{k=1}^{K} h_k Y_k V_{k,i}
Equation: Kee \rightarrow \sum_{k=1}^{K} h_k \vec{j}_i ....... Poinsot \rightarrow \sum_{k=1}^{K} h_k \rho Y_k \vec{V_{k}}
--
You received this message because you are subscribed to the Google Groups "Cantera Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.
To post to this group, send email to canter...@googlegroups.com.
Visit this group at https://groups.google.com/group/cantera-users.
For more options, visit https://groups.google.com/d/optout.
Chris,
One question that arises for me, even from the first equation, is what is the definition of ?. In a non-ideal mixture, it is not necessarily true that with being the pure species enthalpies. However, it looks at first glance that this idea is essentially built into this equation where the term first appears (Eq. 3.159 of Kee). Perhaps there is a definition for for which this holds, but I’m not sure what it is.
Regards,
Ray
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-users+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.
"The thermodynamic properties of the mixture that appear in the energy equation are given as mass-weighted averages of the individual species properties. Specifically of interest here is the enthalpy"
You received this message because you are subscribed to a topic in the Google Groups "Cantera Users' Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cantera-users/96myuNgXN-o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cantera-users+unsubscribe@googlegroups.com.
Steven,
Perhaps it’s better to think of this in the reverse direction. That version of the energy equation requires a definition of the individual species enthalpies for which . However, if you only have an equation of state which defines , then you’re in a bit of trouble. This is in fact how the Redlich-Kwong method in Cantera appears to be implemented (i.e. see the definitions of enthalpy_mole and hresid). However, based on a quick test it seems that the definition of partialMolarEnthalpies does apportion the enthalpy of mixing to the individual species in the desired way, even though this is not obvious from looking at the code. So as long as you’re working an equation of state where this is implemented this way, it should be fine, but I do think it is something that needs to be kept in mind.
Regards,
Ray
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-users+unsubscribe@googlegroups.com.
Assuming I can set aside the issue of the definition of h_k. Would it be impractical/impossible to use an enthalpy-form of an energy equation? I imagine that this would complicate the boundary condition specifications. It seems like both Poinsot and Kee resort to making a perfect gas assumption when writing the total derivative of enthalpy in terms of temperature.
Equation: \rho \frac{Dh_s}{Dt} = \sum_{k=1}^{K}h_{s,k} \rho \frac{DY_k}{Dt} + \rho C_p \frac{DT}{Dt}
Where the following definition is used to expand the total derivative.
Equation: h_s = \sum_{k=1}^{K}h_{s,k} Y_k
On Mar 22, 2018, at 3:21 PM, Chris Neal <chri...@snumerics.com> wrote:
Assuming I can set aside the issue of the definition of h_k. Would it be impractical/impossible to use an enthalpy-form of an energy equation? I imagine that this would complicate the boundary condition specifications. It seems like both Poinsot and Kee resort to making a perfect gas assumption when writing the total derivative of enthalpy in terms of temperature.
I'm just trying to wrap my head around this enthalpy issue. For a real fluid, the thermodynamic property of enthalpy can be split into an ideal component and a departure from that ideal value, which together give the correct real-fluid enthalpy.
Equation: h_k = h^{ig}_{k} + h_{k, departure}
Equation: h_{mixture} = \sum_{k = 1}^{K} x_k h_k + \Delta h_{mixing}
Equation: \rho \frac{Dh_s}{Dt} = \rho \frac{D}{Dt}\left (\sum_{k=1}^{K}h_{s,k}Y_k \right ) = \rho \sum_{k=1}^{K}\left (h_{s,k} \frac{DY_k}{Dt} + Y_k \frac{Dh_{s,k}}{Dt} \right )
Steven,
I think that equation does make a perfect gas assumption, but the problem is in the second term, not the first. If we have a definition for , which I think we’ve settled is a requirement for the equation of state, then using the product rule to write
is perfectly fine, no matter what depends on. However, in order to make the temperature appear, the route that is taken is use the chain rule to write
But this assumes that is a function of temperature only. If is also a function of , then there should be a bunch of additional terms involving those partial derivatives of the enthalpy as well.
Regards,
Ray
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-users+unsubscribe@googlegroups.com.
how you decide to handle the constraint on the sum of mass fractions.
# find the last species
n2_ind = gas.species_index('N2')
# update the gas
specs = gas.species()[:]
gas = ct.Solution(thermo='IdealGas', kinetics='GasKinetics',
species=[specs[x] for x in range(gas.n_species) if x != n2_ind] + [specs[n2_ind]],
reactions=gas.reactions())
Thanks Gandhali. I'm trying to tie all of these conversations back down to the energy equation. What your results suggest is that we should avoid performing an analytical substitution in the energy equation of the form:
Because doing so would neglect the behavior of the EOS object(which includes the mixing enthalpy). When you say 'residual' enthalpy, is that the mixing enthalpy? Am I interpreting your results correctly?
(To everyone) I know that all models are incorrect, so for this derivation I suppose the goal is to reduce the ideal gas assumption error as much as possible in the energy equation. Do we have any consensus about how to analytically proceed from the following equation:
Equation: \left ( \frac{dQ}{dt} \right )_{species} = - \sum_{k=1}^{K} \int_{cs} h_k \vec{j}_k \cdot \vec{n} dA
Hi all,
At least in the case of the Redlich-Kwong equation of state, I think Cantera does already calculate the needed values for such that , and these is what is returned as the “partial molar enthalpies”. For example, using the test input file for the R-K EOS, we can calculate (a) the weighted sum of the partial molar enthalpies, (b) the molar enthalpy, and (c), the weighted sum of the pure species enthalpies. At low pressures, where the non-ideal effects are small, these all give essentially the same values:
def h_pure(g):
h = 0.0
save = g.state
for species,Xk in g.mole_fraction_dict().items():
g.TPX = g.T, g.P, {species: 1.0}
h += g.enthalpy_mole * Xk
g.state = save
return h
g.TPX = 500, 1e5, 'CO2:0.3, H2O:0.6, H2:0.1'
print('(a1)', sum(g.partial_molar_enthalpies * g.X))
print('(b1)', g.enthalpy_mole)
print('(c1)', h_pure(g))
(a1) -255933851.418
(b1) -255933851.41823298
(c1) -255938514.87131906
Closer to the critical point, the first two calculations agree, while the third diverges, as expected:
g.TPX = 480, 1e7, 'CO2:0.3, H2O:0.6, H2:0.1'
print('(a2)', sum(g.partial_molar_enthalpies * g.X))
print('(b2)', g.enthalpy_mole)
print('(c2)', h_pure(g))
(a2) -259392417.488
(b2) -259392417.48808572
(c2) -273891076.90921915
Gandhali, I’d be interested in seeing the tests that you did where you found that this summation does not work.
Steven, do you think the above is consistent with the definition of h_k_partial_molar that you mentioned above? How does the above definition of h_k avoid path dependencies?
Also, Steven, I thought j_k were usually defined to be only the diffusive mass fluxes, such that sum(j_k) = 0, which would fit with the net convective flux of enthalpy being captured in the total derivative on the LHS of the equation. Whether it makes sense to necessarily define a diffusion velocity or just directly relate the diffusive mass flux to the relevant gradients is I think independent of the questions about the enthalpy.
Regards,
Ray
On Monday, March 26, 2018 at 7:32:05 PM UTC-4, S. DeCaluwe wrote:
Hi Chris,
Going to take a shot at deriving the energy equation in temperature form without assuming ideal gas relationships for enthalpy.
Starting with Kee's general energy equation.
Substituting the following definition into the total derivative for enthalpy,
Equation: h = \sum_{k=1}^{K} Y_k h_k
using the product rule to expand the enthalpy total derivative gives,
Equation: \rho \frac{Dh}{Dt} = \rho \frac{D}{Dt}\left (\sum_{k=1}^{K}h_{k}Y_k \right ) = \rho \sum_{k=1}^{K}\left (h_{k} \frac{DY_k}{Dt} + Y_k \frac{Dh_{k}}{Dt} \right )
The total derivative of the enthalpy of species k can be expanded using the chain rule under the assumption that for an individual species, h_k(T,P).
Equation: \frac{Dh_k}{Dt} = \frac{Dh_k}{DT} \frac{DT}{Dt} + \frac{Dh_k}{DP} \frac{DP}{Dt}
Equation: \frac{Dh_k}{Dt} = \frac{D}{Dt} \left [ c_{p,k} DT + \frac{1}{\rho_k}(1-T\beta_k)DP \right ] = c_{p,k} \frac{DT}{Dt} + \frac{1}{\rho_k}(1-T\beta_k) \frac{DP}{Dt}
Equation: \rho \sum_{k=1}^{K}\left (h_{k} \frac{DY_k}{Dt} + Y_k c_{p,k} \frac{DT}{Dt} + \frac{Y_k}{\rho_k}(1-T\beta_k) \frac{DP}{Dt} \right )
If I pull out total derivatives of P and T from the summation and distribute the summation across the terms, the following expression is obtained.
Equation: \rho \sum_{k=1}^{K} h_{k} \frac{DY_k}{Dt} + \rho \frac{DT}{Dt} \sum_{k=1}^{K} Y_k c_{p,k} + \rho \frac{DP}{Dt} \sum_{k=1}^{K} \frac{Y_k}{\rho_k} - \rho \frac{DP}{Dt} T \sum_{k=1}^{K} Y_k \frac{\beta_k}{\rho_k}
Substituting 3.124(species continuity) in for the total derivative of the species mass fraction, distributing the summation over the resulting expression, and re-introducing the right-hand-side of the equation gives,
Equation: \sum_{k=1}^{K} h_{k} \dot{\omega}W_k - \sum_{k=1}^{K} h_{k} \nabla \cdot \vec{j}_k + \rho \frac{DT}{Dt} \sum_{k=1}^{K} Y_k c_{p,k} + \rho \frac{DP}{Dt} \sum_{k=1}^{K} \frac{Y_k}{\rho_k} - \rho \frac{DP}{Dt} T \sum_{k=1}^{K} Y_k \frac{\beta_k}{\rho_k} = \frac{Dp}{Dt} + \nabla \cdot (\lambda \nabla T) - \sum_{k=1}^{K}\nabla \cdot h_k \vec{j}_k + \Phi
Use the following identity to expand the enthalpy flux on the right-hand-side of the above equation,
Equation: \nabla \cdot h_k \vec{j}_k = h_{k} \nabla \cdot \vec{j}_k + \vec{j}_k \cdot \nabla h_{k}
Ha - I think our emails crossed paths in the ethernet cables.
Interesting/disconcerting. This is a good catch, and a significant error. We’ll get this fixed, in short order.
The Matlab toolbox: the gift that keeps on giving! :)
——————————————————————————————————Steven DeCaluwe, PhDAssistant Professor of Mechanical EngineeringColorado School of MinesBrown Building W410BGolden, CO 80401
On Mar 29, 2018, at 3:54 PM, Chris Neal <chri...@snumerics.com> wrote:
Going to take a shot at deriving the energy equation in temperature form without assuming ideal gas relationships for enthalpy.
Starting with Kee's general energy equation.
Equation: \rho \frac{Dh}{Dt} = \frac{Dp}{Dt} + \nabla \cdot (\lambda \nabla T) - \sum_{k=1}^{K}\nabla \cdot h_k \vec{j}_k + \Phi
Substituting the following definition into the total derivative for enthalpy,
Equation: h = \sum_{k=1}^{K} Y_k h_k
using the product rule to expand the enthalpy total derivative gives,
Equation: \rho \frac{Dh}{Dt} = \rho \frac{D}{Dt}\left (\sum_{k=1}^{K}h_{k}Y_k \right ) = \rho \sum_{k=1}^{K}\left (h_{k} \frac{DY_k}{Dt} + Y_k \frac{Dh_{k}}{Dt} \right )
The total derivative of the enthalpy of species k can be expanded using the chain rule under the assumption that for an individual species, h_k(T,P).
Equation: \frac{Dh_k}{Dt} = \frac{Dh_k}{DT} \frac{DT}{Dt} + \frac{Dh_k}{DP} \frac{DP}{Dt}
The above is essentially eq.3.217, and using equation 3.221, we can write the above relation as follows.
Equation: \frac{Dh_k}{Dt} = \frac{D}{Dt} \left [ c_{p,k} DT + \frac{1}{\rho_k}(1-T\beta_k)DP \right ] = c_{p,k} \frac{DT}{Dt} + \frac{1}{\rho_k}(1-T\beta_k) \frac{DP}{Dt}
If I take the above relation and substitute it into that product rule expansion for the total enthalpy derivative, the expression becomes,
Equation: \rho \sum_{k=1}^{K}\left (h_{k} \frac{DY_k}{Dt} + Y_k c_{p,k} \frac{DT}{Dt} + \frac{Y_k}{\rho_k}(1-T\beta_k) \frac{DP}{Dt} \right )
If I pull out total derivatives of P and T from the summation and distribute the summation across the terms, the following expression is obtained.
Equation: \rho \sum_{k=1}^{K} h_{k} \frac{DY_k}{Dt} + \rho \frac{DT}{Dt} \sum_{k=1}^{K} Y_k c_{p,k} + \rho \frac{DP}{Dt} \sum_{k=1}^{K} \frac{Y_k}{\rho_k} - \rho \frac{DP}{Dt} T \sum_{k=1}^{K} Y_k \frac{\beta_k}{\rho_k}
Substituting 3.124(species continuity) in for the total derivative of the species mass fraction, distributing the summation over the resulting expression, and re-introducing the right-hand-side of the equation gives,
Equation: \sum_{k=1}^{K} h_{k} \dot{\omega}W_k - \sum_{k=1}^{K} h_{k} \nabla \cdot \vec{j}_k + \rho \frac{DT}{Dt} \sum_{k=1}^{K} Y_k c_{p,k} + \rho \frac{DP}{Dt} \sum_{k=1}^{K} \frac{Y_k}{\rho_k} - \rho \frac{DP}{Dt} T \sum_{k=1}^{K} Y_k \frac{\beta_k}{\rho_k} = \frac{Dp}{Dt} + \nabla \cdot (\lambda \nabla T) - \sum_{k=1}^{K}\nabla \cdot h_k \vec{j}_k + \Phi
Use the following identity to expand the enthalpy flux on the right-hand-side of the above equation,
Equation: \nabla \cdot h_k \vec{j}_k = h_{k} \nabla \cdot \vec{j}_k + \vec{j}_k \cdot \nabla h_{k}
Performing the substitution and cancelling the common terms on the right and left sides gives,
Steven,
I agree that the first issue is with the expansion of (Eq. 4), and it’s the same problem that I previously mentioned with the application of the chain rule to the total enthalpy. I believe that the correct expansion, accounting for the fact that (with K species) would be
(noting that the total derivative only makes sense for the D/Dt terms — the rest are just regular partial derivatives). I think the term multiplying DT/Dt is in fact . The second term can be neglected if we make the usual zero Mach number assumption. The final term is the one that’s a mess — I’m pretty sure that Cantera doesn’t currently calculate these partial derivatives. And in fact, you get the fun case of having those partial derivatives depend on your choice of how the condition is enforced.
In the case of a phase change, I think you’re going to run into problems either way. If you try to write the equations in terms of temperature, you have the problem of infinite cp, and if you try to keep using enthalpy, you have to allow for it to be discontinuous at the phase boundary. I would imagine that you would have to do explicitly model the phase boundary, in the absence of some really clever tricks.
I’m pretty convinced that keeping enthalpy as the state variable is the way to go.
Regards,
Ray
On Thursday, March 29, 2018 at 6:40:13 PM UTC-4, S. DeCaluwe wrote:
Hi Chris,
Hi Chris,
Thanks - I think this comprehensive approach is a much more useful way to go about this conversation - have all equations in one monster thread so we can keep track of it all!
So my current thoughts:1. It would be helpful if we could also have our own numbering for these equations. I’ve added some, below, in red.
2. I currently only get to equations 4 and 5 before I hit issues (partially issues with the equations, partially limitations in my own knowledge/understanding):a. For equation 4, h_k is also a function of the composition. If I understand correctly, that means there should be a third term on this sum, correct?
b. Can you either include eq. 3.221 or explain the variable beta_k for me? I don’t know what it represents.
c. I feel like the substitution Dh_k/DT = Cp_k makes an ideal gas assumption:Strictly speaking, c_p = \frac{\partial{h}}{\partial{T}}\right)_{const. P}. For an ideal gas, h is a function of T only, the ‘constant P’ condition becomesirrelevant, and c_p = Dh/DT. For our purposes, h_k is going to be a function of P, T, and composition, so we cannot make this substitution.
d. Moreover, using c_p is wholly unsuitable if we will ever hit saturation / phase change. Since h changes discontinuously during phase change, c_p is undefined, here. That said, I’m not sure if this is something we want/need to account for, or whether we just stipulate that the model assumes a single phase throughoutthe simulation, and slap a big “CAVEAT EMPTOR” on the whole thing...
e. It seems like there is something not equivalent in going from eq. 4 to eq. 5: should the preceding term in the middle equation be 1/Dt, rather than D/Dt?
3. General thought for the overall derivation: many of the real-gas equations of state will be writing in terms of molar volume v and mole fractions X_k, rather than P and Y_k. I’m not sure if this will complicate calculation of the necessary terms in the equations below (which are in terms of P and Y_k), but it is something on my mind.
Thanks for all your work, here - glad to be moving this derivation forward.
Steven
——————————————————————————————————Steven DeCaluwe, PhDAssistant Professor of Mechanical EngineeringColorado School of MinesBrown Building W410BGolden, CO 80401
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;wo
<span style="
<span style="text-align
<span styl
<span style="white-sp
--
Equation: \rho \frac{Dh}{Dt} = \frac{Dp}{Dt} - \frac{\partial q_i}{\partial x_i} + \tau_{ij} \frac{\partial u_i}{\partial x_j}
<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;bor
<blockquote class="gmail_quote" style
<blockquote class="gmail_quote" style