CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Solving for absolute enthalpy in the 2.2.x psiReactionThermo

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 24, 2013, 10:22
Lightbulb Solving for absolute enthalpy in the 2.2.x psiReactionThermo
  #1
Member
 
sushant's Avatar
 
Join Date: Mar 2009
Location: Switzerland
Posts: 42
Rep Power: 7
sushant is on a distinguished road
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;
}
If I change sensibleEnthalpy to absoluteEnthalpy I get a list of possible combinations supported, which does not include the one I want. http://www.openfoam.org/version2.2.0/thermophysical.php has this to say:

Quote:
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).
If I look in src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C, it is straightforward to construct absoluteEnthalpy variants that will apply for homogeneousMixture, inhomogeneousMixture, etc., which is done by

Code:
makeReactionThermo
(
    psiThermo,
    psiReactionThermo,
    hePsiThermo,
    inhomogeneousMixture,
    sutherlandTransport,
    absoluteEnthalpy,
    janafThermo,
    perfectGas,
    specie
);
However the construction for the reaction mixtures is:

Code:
makeReactionMixtureThermo
(
    psiThermo,
    psiReactionThermo,
    hePsiThermo,
    reactingMixture,
    gasHThermoPhysics
);
How can I reformulate this to use the absolute enthalpy?

Regards,
Sushant
__________________
If you only have a hammer, you tend to see every problem as a nail.
sushant is offline   Reply With Quote

Old   September 16, 2013, 02:40
Default
  #2
Member
 
赵庆良
Join Date: Aug 2013
Posts: 56
Rep Power: 3
zqlhzx is on a distinguished road
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?
zqlhzx is offline   Reply With Quote

Old   September 16, 2013, 04:28
Default
  #3
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 100
Rep Power: 9
dkxls will become famous soon enough
Quote:
Originally Posted by sushant View Post
I am trying to change the energy equation variable in 2.2.x sprayFoam from sensible enthalpy to absolute enthalpy.
I would really recommend you to use the sensible enthalpy when using chemistry in OpenFOAM.
I gave some more explanations here:
Defining custom Cp library under 2.2.x

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).

Quote:
Originally Posted by sushant View Post
How can I reformulate this to use the absolute enthalpy?
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:
Defining custom Cp library under 2.2.x

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
dkxls is online now   Reply With Quote

Old   June 12, 2014, 03:15
Default
  #4
New Member
 
Likun
Join Date: Feb 2013
Posts: 26
Rep Power: 3
Likun is on a distinguished road
Send a message via Skype™ to Likun
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(FGM combustion model). But it was previous used in 1.7.x, and I have lot of troubles in compiling it into 2.3.

Quote:
lnInclude/SIJPDFthermo.H:196: error: there are no arguments to 'psi' that depend on a template parameter, so a declaration of 'psi' must be available
lnInclude/SIJPDFthermo.H:196: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from lnInclude/SIJPDFthermo.H:314,
from thermophysicalModels/compositionPdf/abstractProgressVariableThermo/abstractProgressVariableThermo.C:31:
lnInclude/SIJPDFthermo.C: In member function 'Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::SIJPDFthermo<IndexDriver>::normalizedFirstMo ment(Foam::label) const':
lnInclude/SIJPDFthermo.C:143: error: 'psi_' was not declared in this scope
lnInclude/SIJPDFthermo.C: In member function 'virtual void Foam::SIJPDFthermo<IndexDriver>::initialize()':
lnInclude/SIJPDFthermo.C:786: error: 'psi_' was not declared in this scope
lnInclude/SIJPDFthermo.C:793: error: there are no arguments to 'hBoundaryTypes' that depend on a template parameter, so a declaration of 'hBoundaryTypes' must be available
In file included from lnInclude/SIJPDFthermo.H:314,
from thermophysicalModels/compositionPdf/abstractProgressVariableThermo/abstractProgressVariableThermo.C:31:
lnInclude/SIJPDFthermo.C: In member function 'virtual void Foam::SIJPDFthermo<IndexDriver>::correct()':
lnInclude/SIJPDFthermo.C:1170: error: 'psi_' was not declared in this scope
lnInclude/SIJPDFthermo.C:1206: error: 'mu_' was not declared in this scope
lnInclude/SIJPDFthermo.C:1247: error: 'mu_' was not declared in this scope
lnInclude/SIJPDFthermo.C: In member function 'bool Foam::SIJPDFthermo<IndexDriver>::readPreIntegrated TableFromCache()':
lnInclude/SIJPDFthermo.C:1446: error: 'psi_' was not declared in this scope
lnInclude/SIJPDFthermo.C: In member function 'void Foam::SIJPDFthermo<IndexDriver>::writeCache() const':
lnInclude/SIJPDFthermo.C:1492: error: 'psi_' was not declared in this scope
thermophysicalModels/compositionPdf/abstractProgressVariableThermo/abstractProgressVariableThermo.C: In constructor 'Foam::abstractProgressVariableThermo::abstractPro gressVariableThermo(const Foam::fvMesh&)':
thermophysicalModels/compositionPdf/abstractProgressVariableThermo/abstractProgressVariableThermo.C:133: error: no matching function for call to 'Foam::basicThermo::basicThermo(const Foam::fvMesh&)'
/home6695/likun/OpenFOAM/OpenFOAM-2.3.0/src/thermophysicalModels/basic/lnInclude/basicThermo.H:128: note: candidates are: Foam::basicThermo::basicThermo(const Foam::fvMesh&, const Foam::dictionary&, const Foam::word&)
/home6695/likun/OpenFOAM/OpenFOAM-2.3.0/src/thermophysicalModels/basic/lnInclude/basicThermo.H:121: note: Foam::basicThermo::basicThermo(const Foam::fvMesh&, const Foam::word&)
/home6695/likun/OpenFOAM/OpenFOAM-2.3.0/src/thermophysicalModels/basic/lnInclude/basicThermo.H:84: note: Foam::basicThermo::basicThermo(const Foam::basicThermo&)
As I understand these errors are due to the difference of the thermophysical model in 1.7.x and 2.3. Can you please kindly share some experiences and give me some hints on what modification should I do to make it work in 2.3?

Many thanks in advance!

Best regards,
Likun
Likun is offline   Reply With Quote

Old   June 12, 2014, 05:20
Default
  #5
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 100
Rep Power: 9
dkxls will become famous soon enough
Hello Likun,
Quote:
Originally Posted by Likun View Post
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.
Yeah, the most crucial bugs are fixed in 2.2.x and 2.3.x. However, there are still some outstanding bugs concerning the breakup modeling and I would generally recommend you to use the 2.3.x git-version.

Quote:
Originally Posted by Likun View Post
As I understand these errors are due to the difference of the thermophysical model in 1.7.x and 2.3. Can you please kindly share some experiences and give me some hints on what modification should I do to make it work in 2.3?
I assume that you got the code from here: http://sourceforge.net/projects/ofca/
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
libOpenSMOKE
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
dkxls is online now   Reply With Quote

Old   June 12, 2014, 10:17
Default
  #6
New Member
 
Likun
Join Date: Feb 2013
Posts: 26
Rep Power: 3
Likun is on a distinguished road
Send a message via Skype™ to Likun
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
Likun is offline   Reply With Quote

Old   June 12, 2014, 10:40
Default
  #7
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 100
Rep Power: 9
dkxls will become famous soon enough
Quote:
Originally Posted by Likun View Post
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?
I'm still using per-integrated tables, I have python script for that. I had some plans at some point to do the integration during run-time, but I haven't implemented it yet in OpenFOAM (shouldn't be too hard, and there is the FSD model as a reference implementation).

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?
dkxls is online now   Reply With Quote

Old   June 12, 2014, 14:18
Default
  #8
New Member
 
Likun
Join Date: Feb 2013
Posts: 26
Rep Power: 3
Likun is on a distinguished road
Send a message via Skype™ to Likun
Quote:
Originally Posted by dkxls View Post
I'm still using per-integrated tables, I have python script for that. I had some plans at some point to do the integration during run-time, but I haven't implemented it yet in OpenFOAM (shouldn't be too hard, and there is the FSD model as a reference implementation).

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?
Thank you very much for the information. Btw what does FSD model refers to? I am sorry, but I am not aware of the FSD model.

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.
Likun is offline   Reply With Quote

Old   June 16, 2014, 09:27
Default
  #9
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 100
Rep Power: 9
dkxls will become famous soon enough
Quote:
Originally Posted by Likun View Post
Btw what does FSD model refers to? I am sorry, but I am not aware of the FSD model.
Flame Surface Dennsity (FDS) combustion model, see here:
Code:
src/combustionModels/FSD/FSD.H
Quote:
Originally Posted by Likun View Post
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.
As I said, there are pros and cons, e.g. CPU vs memory usage.

Quote:
Originally Posted by Likun View Post
I am in Delft, we have some collaboration with Prof. Jeroen van Oinen in Eindhoven.
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.
dkxls is online now   Reply With Quote

Old   June 16, 2014, 10:31
Default
  #10
New Member
 
Likun
Join Date: Feb 2013
Posts: 26
Rep Power: 3
Likun is on a distinguished road
Send a message via Skype™ to Likun
Thank you for the answer.

Are you doing LES or RANS with SprayFoam?
Likun is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06: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 11:16
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


All times are GMT -4. The time now is 08:16.