|
[Sponsors] |
Solving for absolute enthalpy in the 2.2.x psiReactionThermo |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 24, 2013, 11:22 |
Solving for absolute enthalpy in the 2.2.x psiReactionThermo
|
#1 | |
Member
Join Date: Mar 2009
Location: Switzerland
Posts: 40
Rep Power: 17 |
Dear all,
I am trying to change the energy equation variable in 2.2.x sprayFoam from sensible enthalpy to absolute enthalpy. This is my current thermophysical setup: Code:
thermoType { type hePsiThermo; mixture reactingMixture; transport sutherland; thermo janaf; energy sensibleEnthalpy; equationOfState perfectGas; specie specie; } Quote:
Code:
makeReactionThermo ( psiThermo, psiReactionThermo, hePsiThermo, inhomogeneousMixture, sutherlandTransport, absoluteEnthalpy, janafThermo, perfectGas, specie ); Code:
makeReactionMixtureThermo ( psiThermo, psiReactionThermo, hePsiThermo, reactingMixture, gasHThermoPhysics ); Regards, Sushant
__________________
If you only have a hammer, you tend to see every problem as a nail. |
||
September 16, 2013, 03:40 |
|
#2 |
Member
赵庆良
Join Date: Aug 2013
Posts: 56
Rep Power: 13 |
Hi,sushant:
I have some problem like you.I add codes: makeReactionThermo ( psiThermo, psiReactionThermo, hePsiThermo, inhomogeneousMixture, sutherlandTransport, absoluteEnthalpy, janafThermo, perfectGas, specie ); to psiReactionThermos.C,then save the file.But when I run my case using thermoType { type hePsiThermo; mixture inhomogeneousMixture; transport sutherland; thermo janaf; energy absoluteEnthalpy; equationOfState perfectGas; specie specie; },it still gave me the some error "Unknow psiReationThermo type"and showed me valid psiReactionThermo types.Do you can define your thermotype by add the above codes to psiReactionThermos.C?The thermo type I want to define as following: thermoType { type hePsiThermo; mixture singleStepReactingMixture; transport sutherland; thermo janaf; energy absoluteEnthalpy; equationOfState perfectGas; specie specie; }However,I really do not know how to do it.According to userguide "if the particular combination of models is not available in the list, that combination can be compiled into a library or the application (as always).",I have to build new library include my defined thermotype,can you success it?If you know something about it,could you give me some advises? |
|
September 16, 2013, 05:28 |
|
#3 | |
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
Quote:
I gave some more explanations here: http://www.cfd-online.com/Forums/ope...tml#post451802 Also, for spray simulation there are more changes required than just in the thermo class, as the spray also has source terms in the transport equations! I have a working sprayFoam solver that uses absolute enthalpy, but I cut out the whole chemistry part and replaced it by my own combustion model, i.e. Flamelet Generated Manifolds (FGM). If you really want to get into this business, I posted here a peace of code that should get you started, but still some way to: http://www.cfd-online.com/Forums/ope...tml#post451645 Maybe a last comment on the sprayFoam: It has been horribly broken until a couple of days ago. I fixed most of the issues concerning the thermodynamics together with the OpenFOAM developers, but there are still several issues, especially concerning the breakup models. For more infos, see the list of bugs I reported/fixed in the last couple of weeks (and there are still more to come...): http://www.openfoam.org/mantisbt/vie...hide_status=90 |
||
June 12, 2014, 04:15 |
|
#4 | |
Member
|
Dear Armin,
I also want to use the sprayFoam with FGM combustion model. As you mentioned there are lots of bugs in the sprayFoam under 2.2.x, so I want to use 2.3.0, hopefully some of the bugs have been fixed. For the FGM model, I have the Rostock extension(http://www.cfd-online.com/Forums/ope...ion-model.html). But it was previous used in 1.7.x, and I have lot of troubles in compiling it into 2.3. Quote:
Many thanks in advance! Best regards, Likun |
||
June 12, 2014, 06:20 |
|
#5 | ||
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
Hello Likun,
Quote:
Quote:
In this case, I cannot really help you, as I have actually never used that code. I implemented the FGM combustion model from scratch, as I use a different approach to couple the flamelet solutions to the flow solver, mainly due to the spray. Also, I use chem1d (http://www.tue.nl/en/university/depa...vities/chem1d/) to compute the flamelet solutions. There is btw also another implementation of a tabulated flamelet model: https://github.com/shor-ty/flameletModel-2.2.x http://www.cfd-online.com/Forums/ope...nsmoke-18.html But also this implementation is not really suited for spray combustion and requires you to use a specific flamelet-code. But you could probably extend this code for spray combustion, not quite sure though. Cheers, Armin |
|||
June 12, 2014, 11:17 |
|
#6 |
Member
|
Hi Armin,
Thank you so much for the quick answer. Yes, http://sourceforge.net/p/ofca/code/ref/master/ is the code that I tried to compile into OpenFoam-2.3. But there are a lot of problems for the compiling, probably it is impossible for me to do that, because I am quiet new with OpenFoam as well as C++. I am trying the steady flamelet model that you mentioned, I think I will try to extend it to FGM and for spray combustion, because as we know the flamelet model can not correctly predict the ignition process. For the FGM, I also use Chem1D for generating the FGM table. Then to use that in OpenFoam, we have to first integrate the table with presumed PDFs for the independent variables. Who do you do the integration? With your own code or there are some utilities available? Indeed, to make it work for spray combustion, there is still a long way to go. Do you added the FGM model in the sprayFoam or how do you deal with the spray part? Best regards, Likun |
|
June 12, 2014, 11:40 |
|
#7 | |
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
Quote:
Otherwise, I wrote a custom solver based on sprayFoam that links the FGM tables to the flow calculation. Who are you btw working with from the Eindhoven group? |
||
June 12, 2014, 15:18 |
|
#8 | |
Member
|
Quote:
In think integrate the table during run time is really time consuming and not really necessary if you are not doing transported PDF simulation. For the presumed PDF method, the pre-integrated FGM table should be fine. I am in Delft, we have some collaboration with Prof. Jeroen van Oinen in Eindhoven. |
||
June 16, 2014, 10:27 |
|
#9 | ||
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
Quote:
Code:
src/combustionModels/FSD/FSD.H Quote:
Ah, OK. Jeroen is mostly working on premixed combustion. I'm working with Prof. Bart Somers on the non-premixed combustion. Though both are combustion experts, especially when it comes to tabulated chemistry and FGM. |
|||
June 16, 2014, 11:31 |
|
#10 |
Member
|
Thank you for the answer.
Are you doing LES or RANS with SprayFoam? |
|
October 10, 2014, 20:01 |
|
#11 |
Member
Flavio Galeazzo
Join Date: Mar 2009
Location: Karlsruhe, Germany
Posts: 34
Rep Power: 18 |
Hello Armin,
Sorry for bumping this thread, but I am very interested in the discussion here. I am using a sort of FGM model developed by a colleague and implemented for OF 1.5.x, however it works with an absolute enthalpy formulation. Now I am working in the extension of the model to handle spray combustion. The problem I am facing is that the new lagrangian library (from OF 2.1 and ahead) has only support for sensible enthalpy. I understand from your threads that you have a sprayFoam solver that uses absolute enthalpy, which is exactly what I am also trying to develop. Do you mind sharing how you did that? Best regards, Flavio |
|
October 13, 2014, 06:31 |
|
#12 |
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
Have you had a look at the code I posted here?
http://www.cfd-online.com/Forums/ope...tml#post451645 I implemented there a multi-component mixture for absolute enthalpy. This should be enough for a FGM (i.e. tabulated chemistry) model, since you don't need the OpenFOAM chemistry part in that case. To be more specific, a reactingMixture is a multiComponentMixture plus chemistry reader/solver. All the species related stuff (Cp, viscosity, ...) is implemented in the multiComponentMixture. Hope this helps! -Armin |
|
October 13, 2014, 23:11 |
|
#13 |
Member
Flavio Galeazzo
Join Date: Mar 2009
Location: Karlsruhe, Germany
Posts: 34
Rep Power: 18 |
Thank you for the prompt reply, Armin.
Your code is very helpful! It is small and get the job done. My solution to get the solver to use absolute enthalpy and multiComponentMixture was a bit dirtier, but worked also. The real difficulty is in calculating the enthalpy source term of the spray. From the lagrangian library I got the sensible enthalpy (parcels.Sh(he) ). To have the absolute enthalpy my approach was to use the mass source term of each species multiplied by the standard heat of formation (here just an example with only one component) Code:
tmp<fvScalarMatrix>thSource(new fvScalarMatrix(h, dimEnergy/dimTime)); fvScalarMatrix& hSource = thSource(); forAll(Y, i) { // enthalpy of ethanol -5.0973E+006 J/kg (from cantera, f=1) hSource.source() += parcels.rhoTrans(i)*5.0973E+006/mesh.time().deltaTValue(); } Do you have a clue what I am missing here? Best regards, Flavio |
|
October 14, 2014, 04:34 |
|
#14 | ||
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
Quote:
I'm not quite sure if all signs and units are correct, but that should be easy to figure out. Otherwise your approach is generally correct. I don't have my code at hand right now, but I remember using the standard enthalpy of formation from the thermo classes, i.e. something like composition.Hc(i). Also, I typically create in such cases a dimensionedScalar and divide then by runTime.deltaT() instead of deltaTValue() Quote:
For sprayFoam you have two options: the latest 2.2.x git version or the latest 2.3.x git version. With older versions there were so many bugs that led to very weird temperatures (e.g. -200 or +8000), but that stuff is fixed in the latest git versions. |
|||
October 14, 2014, 19:57 |
|
#15 |
Member
Flavio Galeazzo
Join Date: Mar 2009
Location: Karlsruhe, Germany
Posts: 34
Rep Power: 18 |
Thank you very much for your comments, Armin, it helped a lot to know that I am not following a wrong path. The hint about the enthalpy of formation helped a lot also. You are probrably correct, and as I finish porting my stuff to OF 2.3.x a lot of the weird behavior should be gone. It appears I have a lot of work ahead of me, hehehe.
Cheers |
|
April 28, 2015, 04:49 |
which enthalpy to use
|
#16 |
New Member
|
Hi, Armin
@dkxls, I'm now doing a two compressible fluids mixing problem. One treats as perfect gas, and another a compressible liquid satisfy the equation of state rho = rho0 + psi * (p - p0). For each phase, I use a rhoThermo thermo type. But if I want to solve mixture energy equation, which energy type should I use? sensibleEnthalpy absoluteEnthalpy sensibleInternalEnergy absoluteInternalEnergy... Because under standard condition, the heat of formation of a perfect gas is zero, and that of liquid(oil) is a very huge negative value. The energy in a cell changes with its composition and temperature, which energy type do you think is suitable for this situation? Best Regards Francis Lee |
|
April 28, 2015, 05:15 |
|
#17 | |
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
Quote:
In some specific cases, like highly compressible (i.e. supersonic) flows or chemically reacting flows (i.e. combustion), one or another may be preferred, but even there all energy representations will give you correct results. |
||
April 28, 2015, 05:49 |
|
#18 |
New Member
|
Dear Armin,
Thank you for your quickly reply. Now I understand, all type of energy give the correct reuslt, but different energy type corresponds to different coding difficulty. Then, there is another question. I write a twoPhaseThermo class refered to that used in compressibleInterFoam but uses both mass fraction and volume fraction to calculate mixture properties. And I want to add energy (he_) in that class, so the energy boundary condition comes as a problem. I read heBoundaryBaseTypes() in basicThermo.C, cause I want to use zeroGradient for T, so then I read updateCoeffs() in gradientEnergyFvPatchScalarField.C, in there I found fvPatchScalarField& Tw = Tw.evaluate(); before calculate gradient of energy on that patch. But in my konwledge, all T (boundary and internal) are calculated based on the solved energy ty write thermo.correct(), why in correcting he boundary, Tw is a non-const variable? Thanks ahead. Best Regard |
|
July 10, 2015, 06:43 |
|
#19 |
Senior Member
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13 |
Dear Armin,
Now I want to simulate premixed flame using flamelet model. And i want to take FGM as a reference which had been released here. Unfortunately, I can not download it. Could you send them to me? Thank you in advance! My email address: 981588592@qq.com Best regards, Wen Xu |
|
July 16, 2015, 22:15 |
|
#20 |
Senior Member
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13 |
Why the reactionThermo is not based on the psiuRectionThermo but on psiRectionThermo for premixed combustion?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
pimpleFoam: turbulence->correct(); is not executed when using residualControl | hfs | OpenFOAM Running, Solving & CFD | 3 | October 29, 2013 09:35 |
calculation stops after few time steps | sivakumar | OpenFOAM Running, Solving & CFD | 7 | March 17, 2013 07:37 |
Differences between serial and parallel runs | carsten | OpenFOAM Bugs | 11 | September 12, 2008 12:16 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |