|
[Sponsors] |
August 9, 2023, 11:24 |
TEqn in compressibleInterFoam
|
#1 |
New Member
S Abrahams
Join Date: Mar 2022
Location: UK
Posts: 15
Rep Power: 4 |
Hi everyone!
I wonder if anyone can help me to understand the formulation of the TEqn in compressibleInterFoam in OF9. The TEqn is: Code:
fvm::ddt(rho, T) + fvm::div(rhoPhi, T) - fvm::Sp(contErr, T) - fvm::laplacian(turbulence.alphaEff(), T) + ( fvc::div(fvc::absolute(phi, U), p)()() // - contErr/rho*p + (fvc::ddt(rho, K) + fvc::div(rhoPhi, K))()() - (U()&(fvModels.source(rho, U)&U)()) - contErr*K ) *( alpha1()/mixture.thermo1().Cv()() + alpha2()/mixture.thermo2().Cv()() ) == fvModels.source(rho, T) I believe the TEqn should be equivalent to but the formulation above seems to be equivalent to Can anyone help me to understand how has been taken out in this way? Many thanks, SAbrahams Last edited by sabrahams; August 9, 2023 at 14:09. Reason: typos |
|
August 15, 2023, 10:34 |
|
#2 |
New Member
S Abrahams
Join Date: Mar 2022
Location: UK
Posts: 15
Rep Power: 4 |
Does no-one know the answer to this?
|
|
August 15, 2023, 11:55 |
|
#3 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 742
Rep Power: 14 |
I think the problem lies with your first Teqn equation ... Start from basics - the underlying energy equation is stated in terms of the internal energy, i.e. in conservative form:
which we can expand out using continuity to the non-conservative form: Now using the definition of the specific heat, we write , so substitute and you have: or in terms of the material derivative: with the specific heat capacity on the outside. Hopefully that helps. |
|
August 15, 2023, 12:22 |
|
#4 |
New Member
S Abrahams
Join Date: Mar 2022
Location: UK
Posts: 15
Rep Power: 4 |
Hi Tobermory,
Thanks for your reply. However, since is not a constant in this case, I don't believe we can say . Instead, it should be . In a two phase system, as we have in compressibleInterFoam, is averaged over the two phases, that is While and may be constant, is not since and vary in time and space. Furthermore, TEqn in compressibleInterFoam (as shown in my original post) is not it seems to be (if you divide through by , which is multiplying the second term in TEqn) So I'm trying to understand how the energy equation has been rearranged to get the form in the TEqn as in my original post. Do you know how this is derived? Thanks again, SAbrahams Last edited by sabrahams; August 15, 2023 at 12:28. Reason: correcting mistake in equation |
|
August 16, 2023, 12:32 |
|
#5 | |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 742
Rep Power: 14 |
Okay - let me break this down. First up, the following is not correct I am afraid:
Quote:
etc. Now consider the single phase energy equation, which in OpenFOAM is (refer to buoyantPimpleFoam for example): expand out the first two terms into the nonconservative form using continuity, substitute for and convert back to conservative form and you get: NOW a minor approximation is made in the laplacian, where it assumed that local variations in Cv are small, so that the terms cancel leaving: and we are almost there. All that is left is to realise that the finite volume discretised form of the energy (or temperature) budget equation is the sum of alpha1 times the equation for phase 1 plus alpha2 times that for phase two, which results in: or on noting that , we have: noting that these should now not be differentials etc., but should instead be volume integrals of the differentials yielding volume average values or surface fluxes (I didn't have the time to tidy up the terminology). This is the form that appears in TEqn.h for compressibleInterFoam. There are clearly a bunch of other implicit assumptions here ... but this is my reverse engineering of the code. I couldn't find any explicit reference to the source of the model equations, and suspect it was authored by one of the OpenFOAM team. If you do find a reference - share it with the forum please. Last edited by Tobermory; August 16, 2023 at 13:36. |
||
August 17, 2023, 11:38 |
|
#6 |
New Member
S Abrahams
Join Date: Mar 2022
Location: UK
Posts: 15
Rep Power: 4 |
That makes perfect sense. Thank you for the clear explanation!
I haven't found any references for the equations used in compressibleInterFoam in OF9. If I find anything I'll certainly share. UEqn and alphaEqn appear to be in the same form as equations (7) and (25) of Shi et al.. Although, this paper was published later than OF9 so isn't a reference but just a useful resource to understand the equations (for anyone else reading this). Thanks again Tobermory. |
|
August 23, 2023, 11:36 |
|
#7 | |
New Member
S Abrahams
Join Date: Mar 2022
Location: UK
Posts: 15
Rep Power: 4 |
Hi again Tobermory,
I've just been working through this and I'm stuck on this step: Quote:
Am I missing a step or an assumption somewhere? |
||
August 24, 2023, 11:34 |
|
#8 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 742
Rep Power: 14 |
The way to think of it, I reckon, is as follows: we need to integrate the differential equations over the cell volume to get the finite volume expressions. Focus just on the first two terms, for simplicity:
integrate these to get: where it's assumed that the mesh is not moving or morphing, are the face fluxes, and the P subscript denotes a volume-averaged value, e.g. Note though that we are integrating over volume for phase 1, and for phase 2. This is the origin of the and coefficients in each of the terms. This is what I meant rather laconically in my earlier post by "noting that these should now not be differentials etc.". Hope this helps. |
|
Tags |
heat capacity, temperature, teqn |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Correction of T after TEqn in compressibleInterFoam | krikre | OpenFOAM Programming & Development | 3 | June 26, 2022 23:07 |
TEqn (passive scalar) diverges all of a sudden | backscatter | OpenFOAM Running, Solving & CFD | 11 | October 21, 2018 08:56 |
TEqn. in PorousSimpleFoam | svramana | Main CFD Forum | 0 | February 14, 2018 09:53 |
EEqn to TEqn | jishnuhari25 | OpenFOAM Programming & Development | 1 | June 4, 2015 12:06 |
Replace H equation with Teqn in chtMultiregionFoam OF 2.3 | Moncef | OpenFOAM Running, Solving & CFD | 0 | May 22, 2014 21:37 |