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

Adding of a new thermotype

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 8, 2016, 07:05
Default Adding of a new thermotype
  #1
Member
 
Fabien Salmon
Join Date: Sep 2016
Posts: 36
Rep Power: 2
FlyingCat is on a distinguished road
Hi everybody,

I hope ereything is good for you.

I am struggling to add a new thermotype. I would like to use perfectfluid for my problem :

thermoType
{
type hePsiThermo;
mixture singleStepReactingMixture;
transport sutherland;
thermo janaf;
energy sensibleEnthalpy;
equationOfState perfectFluid;
specie specie;
}

I think I add all that openfoam needs:

1) In psiReactionThermos.C,

makeReactionThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
singleStepReactingMixture,
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
perfectFluid,
specie
);

2) In thermoPhysicsTypes.H,

typedef
sutherlandTransport
<
species::thermo
<
janafThermo
<
perfectFluid<specie>
>,
sensibleEnthalpy
>
> perfectFluidPhysics;

3) In reactionsTypes.H,

typedef Reaction<perfectFluidPhysics> perfectFluidReaction;

4) In makeReactions.C,

makeReactions(perfectFluidPhysics, perfectFluidReaction)

5) I even add something pointless for me (I think) in makeChemistryReaders.C:

makeChemistryReader(perfectFluidPhysics);
makeChemistryReaderType(foamChemistryReader, perfectFluidPhysics);


I compiled all of this and all OpenFOAM-dev. It works until I want to use the solver. I am using fireFoam but it is the same for an other solver, it stops at the beginning of the solver. I do not know if the case is important, I do not think so because it runs when I use perfectGas. I do not understand the error, the thermotype is added, I am sure of that it does not work. The message is:

Code:
Create time

Create mesh for time = 0


PIMPLE: Operating solver in PISO mode

Creating combustion model

Selecting combustion model infinitelyFastChemistry<psiThermoCombustion,gasHThermoPhysics>
Selecting thermodynamics package 
{
    type            hePsiThermo;
    mixture         singleStepReactingMixture;
    transport       sutherland;
    thermo          janaf;
    energy          sensibleEnthalpy;
    equationOfState perfectFluid;
    specie          specie;
}

Selecting chemistryReader foamChemistryReader
    elements not defined in "/mnt/homesalmon/OpenFOAM/salmon-3.0.1/run/test2/constant/reactions"
Fuel heat of combustion :1.44058e+07
stoichiometric air-fuel ratio :5.7373
stoichiometric oxygen-fuel ratio :1.33583
Maximum products mass concentrations:
    H2O: 0.0869927
    CO2: 0.2598
    N2: 0.653207
[3] #0  Foam::error::printStack(Foam::Ostream&)[0] #0  Foam::error::printStack(Foam::Ostream&) at ??:?
[3] #1  Foam::sigFpe::sigHandler(int) at ??:?
[0] #1  Foam::sigFpe::sigHandler(int) at ??:?
[3] #2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
[3] #3  Foam::multiComponentMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectFluid<Foam::specie> >, Foam::sensibleEnthalpy> > >::patchFaceMixture(int, int) const at ??:?
[0] #2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
[0] #3  Foam::multiComponentMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectFluid<Foam::specie> >, Foam::sensibleEnthalpy> > >::patchFaceMixture(int, int) const at ??:?
[3] #4  Foam::heThermo<Foam::psiReactionThermo, Foam::SpecieMixture<Foam::singleStepReactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectFluid<Foam::specie> >, Foam::sensibleEnthalpy> > > > >::he(Foam::Field<double> const&, Foam::Field<double> const&, int) const at ??:?
[3] #5  Foam::heThermo<Foam::psiReactionThermo, Foam::SpecieMixture<Foam::singleStepReactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectFluid<Foam::specie> >, Foam::sensibleEnthalpy> > > > >::heThermo(Foam::fvMesh const&, Foam::word const&) at ??:?
[0] #4  Foam::heThermo<Foam::psiReactionThermo, Foam::SpecieMixture<Foam::singleStepReactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectFluid<Foam::specie> >, Foam::sensibleEnthalpy> > > > >::he(Foam::Field<double> const&, Foam::Field<double> const&, int) const at ??:?
[0] #5  Foam::heThermo<Foam::psiReactionThermo, Foam::SpecieMixture<Foam::singleStepReactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectFluid<Foam::specie> >, Foam::sensibleEnthalpy> > > > >::heThermo(Foam::fvMesh const&, Foam::word const&) at ??:?
[3] #6  Foam::psiReactionThermo::addfvMeshConstructorToTable<Foam::hePsiThermo<Foam::psiReactionThermo, Foam::SpecieMixture<Foam::singleStepReactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectFluid<Foam::specie> >, Foam::sensibleEnthalpy> > > > > >::New(Foam::fvMesh const&, Foam::word const&) at ??:?
[3] #7  Foam::autoPtr<Foam::psiReactionThermo> Foam::basicThermo::New<Foam::psiReactionThermo>(Foam::fvMesh const&, Foam::word const&) at ??:?
[0] #6  Foam::psiReactionThermo::addfvMeshConstructorToTable<Foam::hePsiThermo<Foam::psiReactionThermo, Foam::SpecieMixture<Foam::singleStepReactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectFluid<Foam::specie> >, Foam::sensibleEnthalpy> > > > > >::New(Foam::fvMesh const&, Foam::word const&) at ??:?
[3] #8  Foam::psiReactionThermo::New(Foam::fvMesh const&, Foam::word const&) at ??:?
[0] #7  Foam::autoPtr<Foam::psiReactionThermo> Foam::basicThermo::New<Foam::psiReactionThermo>(Foam::fvMesh const&, Foam::word const&) at ??:?
[0] #8  Foam::psiReactionThermo::New(Foam::fvMesh const&, Foam::word const&) at ??:?
[3] #9  Foam::combustionModels::psiThermoCombustion::psiThermoCombustion(Foam::word const&, Foam::fvMesh const&, Foam::word const&) at ??:?
[3] #10  Foam::combustionModels::singleStepCombustion<Foam::combustionModels::psiThermoCombustion, Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::singleStepCombustion(Foam::word const&, Foam::fvMesh const&, Foam::word const&) at ??:?
[3] #11  Foam::combustionModels::psiCombustionModel::adddictionaryConstructorToTable<Foam::combustionModels::infinitelyFastChemistry<Foam::combustionModels::psiThermoCombustion, Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > >::New(Foam::word const&, Foam::fvMesh const&, Foam::word const&) at ??:?
[0] #9  Foam::combustionModels::psiThermoCombustion::psiThermoCombustion(Foam::word const&, Foam::fvMesh const&, Foam::word const&) at ??:?
[3] #12  Foam::combustionModels::psiCombustionModel::New(Foam::fvMesh const&, Foam::word const&) at ??:?
[0] #10  Foam::combustionModels::singleStepCombustion<Foam::combustionModels::psiThermoCombustion, Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::singleStepCombustion(Foam::word const&, Foam::fvMesh const&, Foam::word const&) at ??:?
[3] #13   at ??:?
[0] #11  Foam::combustionModels::psiCombustionModel::adddictionaryConstructorToTable<Foam::combustionModels::infinitelyFastChemistry<Foam::combustionModels::psiThermoCombustion, Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > >::New(Foam::word const&, Foam::fvMesh const&, Foam::word const&)? at ??:?
[0] #12  Foam::combustionModels::psiCombustionModel::New(Foam::fvMesh const&, Foam::word const&) at ??:?
[3] #14  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
[3] #15   at ??:?
[0] #13  ?? at ??:?
[pouillot:28627] *** Process received signal ***
[pouillot:28627] Signal: Floating point exception (8)
[pouillot:28627] Signal code:  (-6)
[pouillot:28627] Failing at address: 0x71c300006fd3
[pouillot:28627] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x36d40)[0x7fe31bc22d40]
[pouillot:28627] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39)[0x7fe31bc22cc9]
[pouillot:28627] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x36d40)[0x7fe31bc22d40]
[pouillot:28627] [ 3] /mnt/homesalmon/OpenFOAMdev/OpenFOAM-dev/platforms/linux64Gcc48DPInt32Opt/lib/libreactionThermophysicalModels.so(_ZNK4Foam21multiComponentMixtureINS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_12perfectFluidINS_6specieEEEEENS_16sensibleEnthalpyEEEEEE16patchFaceMixtureEii+0xb71)[0x7fe3208f1831]
[pouillot:28627] [ 4] /mnt/homesalmon/OpenFOAMdev/OpenFOAM-dev/platforms/linux64Gcc48DPInt32Opt/lib/libreactionThermophysicalModels.so(_ZNK4Foam8heThermoINS_17psiReactionThermoENS_13SpecieMixtureINS_25singleStepReactingMixtureINS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_12perfectFluidINS_6specieEEEEENS_16sensibleEnthalpyEEEEEEEEEE2heERKNS_5FieldIdEESL_i+0x9e)[0x7fe3208f1f7e]
[pouillot:28627] [ 5] /mnt/homesalmon/OpenFOAMdev/OpenFOAM-dev/platforms/linux64Gcc48DPInt32Opt/lib/libreactionThermophysicalModels.so(_ZN4Foam8heThermoINS_17psiReactionThermoENS_13SpecieMixtureINS_25singleStepReactingMixtureINS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_12perfectFluidINS_6specieEEEEENS_16sensibleEnthalpyEEEEEEEEEEC2ERKNS_6fvMeshERKNS_4wordE+0x3c3)[0x7fe320947133]
[pouillot:28627] [ 6] /mnt/homesalmon/OpenFOAMdev/OpenFOAM-dev/platforms/linux64Gcc48DPInt32Opt/lib/libreactionThermophysicalModels.so(_ZN4Foam17psiReactionThermo27addfvMeshConstructorToTableINS_11hePsiThermoIS0_NS_13SpecieMixtureINS_25singleStepReactingMixtureINS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_12perfectFluidINS_6specieEEEEENS_16sensibleEnthalpyEEEEEEEEEEEE3NewERKNS_6fvMeshERKNS_4wordE+0x2e)[0x7fe32094729e]
[pouillot:28627] [ 7] /mnt/homesalmon/OpenFOAMdev/OpenFOAM-dev/platforms/linux64Gcc48DPInt32Opt/lib/libreactionThermophysicalModels.so(_ZN4Foam11basicThermo3NewINS_17psiReactionThermoEEENS_7autoPtrIT_EERKNS_6fvMeshERKNS_4wordE+0x1b0)[0x7fe3208d15d0]
[pouillot:28627] [ 8] /mnt/homesalmon/OpenFOAMdev/OpenFOAM-dev/platforms/linux64Gcc48DPInt32Opt/lib/libreactionThermophysicalModels.so(_ZN4Foam17psiReactionThermo3NewERKNS_6fvMeshERKNS_4wordE+0x9)[0x7fe3208cf739]
[pouillot:28627] [ 9] /mnt/homesalmon/OpenFOAMdev/OpenFOAM-dev/platforms/linux64Gcc48DPInt32Opt/lib/libcombustionModels.so(_ZN4Foam16combustionModels19psiThermoCombustionC1ERKNS_4wordERKNS_6fvMeshES4_+0x3c)[0x7fe31f36de3c]
[pouillot:28627] [10] /mnt/homesalmon/OpenFOAMdev/OpenFOAM-dev/platforms/linux64Gcc48DPInt32Opt/lib/libcombustionModels.so(_ZN4Foam16combustionModels20singleStepCombustionINS0_19psiThermoCombustionENS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_10perfectGasINS_6specieEEEEENS_16sensibleEnthalpyEEEEEEC1ERKNS_4wordERKNS_6fvMeshESH_+0x1c)[0x7fe31f394c8c]
[pouillot:28627] [11] /mnt/homesalmon/OpenFOAMdev/OpenFOAM-dev/platforms/linux64Gcc48DPInt32Opt/lib/libcombustionModels.so(_ZN4Foam16combustionModels18psiCombustionModel31adddictionaryConstructorToTableINS0_23infinitelyFastChemistryINS0_19psiThermoCombustionENS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_10perfectGasINS_6specieEEEEENS_16sensibleEnthalpyEEEEEEEE3NewERKNS_4wordERKNS_6fvMeshESK_+0x38)[0x7fe31f39f6c8]
[pouillot:28627] [12] /mnt/homesalmon/OpenFOAMdev/OpenFOAM-dev/platforms/linux64Gcc48DPInt32Opt/lib/libcombustionModels.so(_ZN4Foam16combustionModels18psiCombustionModel3NewERKNS_6fvMeshERKNS_4wordE+0x347)[0x7fe31f36d6b7]
[pouillot:28627] [13] fireFoam[0x43ca21]
[pouillot:28627] [14] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fe31bc0dec5]
[pouillot:28627] [15] fireFoam[0x443246]
[pouillot:28627] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 3 with PID 28627 on node pouillot exited on signal 8 (Floating point exception).
--------------------------------------------------------------------------
Thanks for your help if you can.
FlyingCat is offline   Reply With Quote

Old   November 18, 2016, 04:45
Default No help ?
  #2
Member
 
Fabien Salmon
Join Date: Sep 2016
Posts: 36
Rep Power: 2
FlyingCat is on a distinguished road
Hello,

nobody has suggestion ? If someone could tell me what can be wrong in the steps.

Have a good day.
FlyingCat is offline   Reply With Quote

Old   May 19, 2017, 08:57
Default New equation of state
  #3
New Member
 
cecile
Join Date: Oct 2015
Posts: 3
Rep Power: 3
cecile is on a distinguished road
Hello Fabien,

I am trying to do the same thing as you, but i have difficulties so i was wondering if you managed to do what you wanted...
I created a new thermophysical model in order to implement a new equation of state with a custom solver derived from reactingFoam.
It works when i am in a non reacting case, but when i add combustion, my solver don't recognize my new equation of state any more.

If you succeeded in your task, you maybe have some advices for me to make it work ...?

Thanks in advance,

Have a nice day,

CÚcile
cecile is offline   Reply With Quote

Old   May 19, 2017, 09:19
Default
  #4
Member
 
Fabien Salmon
Join Date: Sep 2016
Posts: 36
Rep Power: 2
FlyingCat is on a distinguished road
Hello,

I gave up (sorry) concerning this implementation because actually, it was not usefull for me.

However, I think you should put the error message that you have because it can help me (perhaps).

An other possibility is to use an eos that is recognized by reactingFoam and modify within the eos file (do not do that for perfect gas because it is linked with janaf and I think you cannot).

Moreover, have you done all the steps that I had done ?

Have a good day (if you can)
FlyingCat is offline   Reply With Quote

Old   May 19, 2017, 10:19
Default
  #5
New Member
 
cecile
Join Date: Oct 2015
Posts: 3
Rep Power: 3
cecile is on a distinguished road
Thank you so much for answering me !

Yes i have done all the steps that you have done.

I have created new libspecie.so and libreactionThermophysicalModels.so libraries with my eos. But when i run a reacting case it doesn't see the new libraries, execution fails because of the wrong thermo model while it runs well in a cold case.

You gave me a clue because my custom eos is derived from parfectGas and i use janaf thermo tables, i am going to look this point further...

Thanks again!
CÚcile
cecile is offline   Reply With Quote

Old   May 19, 2017, 10:32
Default
  #6
Member
 
Fabien Salmon
Join Date: Sep 2016
Posts: 36
Rep Power: 2
FlyingCat is on a distinguished road
Ok keep me up to date, I am still interested.
FlyingCat is offline   Reply With Quote

Old   May 20, 2017, 08:00
Post
  #7
Member
 
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 34
Rep Power: 3
Swagga5aur is on a distinguished road
Hello you two, I don't know if this is of any help, but I implemented a new thermo type with a new janaf model(note that this janaf model is equal to the one implemetented in openFOAM) and transport model, which I used with the multiRegionSimpleReactingFoam solver, link: https://github.com/TonkomoLLC/multiRegionReactingFoam.

I have linked a dropbox link to the developed thermotype ready to be build as well as a case with the solver and thermotype implemented.
The mentioned solver is also included in the dropbox link.

Hope its to any help.

https://www.dropbox.com/s/7igba23zvj...er.tar.gz?dl=0
Please note if you wan't to run my example, run the AllMesh, then copy the content of the .org folders to the respective directories and then run the Allrun.
Swagga5aur is offline   Reply With Quote

Old   May 22, 2017, 10:00
Default
  #8
New Member
 
cecile
Join Date: Oct 2015
Posts: 3
Rep Power: 3
cecile is on a distinguished road
Thank you for your files!
I'm gonna have a look and try to understand how it works.
cecile is offline   Reply With Quote

Old   May 22, 2017, 10:11
Post
  #9
Member
 
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 34
Rep Power: 3
Swagga5aur is on a distinguished road
Let me know if there is any issues with running the example case.
Swagga5aur 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
conjugateHeatFoam + interFoam farhagim OpenFOAM Programming & Development 15 July 19, 2016 07:55
How I can introduce my power heat (W) in chtMultiRegionFoam? aminem OpenFOAM Pre-Processing 28 July 15, 2016 08:57
chtMultiRegionSimpleFoam 3D problem Lucie OpenFOAM Pre-Processing 2 June 21, 2016 05:23
chtMultiRegionSimpleFoam samiam1000 OpenFOAM Running, Solving & CFD 39 March 31, 2016 08:43
Help with chtMultiRegionFoam jbvw96 OpenFOAM Running, Solving & CFD 2 December 26, 2010 18:16


All times are GMT -4. The time now is 02:37.