|
[Sponsors] |
September 25, 2014, 07:51 |
Using PengRobinsonGas EoS with sprayFoam
|
#1 |
New Member
James Guthrie
Join Date: Sep 2014
Posts: 16
Rep Power: 12 |
Hi guys,
My first post here. I'm modifying the existing aachenBomb tutorial, to simulate the experiments done by Mayer et. al. - "Raman Measurements of Cryogenic Injection at Supercritical Pressure" I need to be able to use the PengRobinsonGas equation of state. I've built OF 2.3.x from the GitHub source today. I modified my thermophysicalProperties as such: Code:
thermoType { type hePsiThermo; mixture pureMixture; transport sutherland; thermo hConst; energy sensibleEnthalpy; equationOfState PengRobinsonGas; specie specie; } Code:
combustionModel noCombustion<psiThermoCombustion>; active false; chemistryProperties is set as such: Code:
chemistryType { chemistrySolver noChemistrySolver; chemistryThermo psi; } chemistry off; So how do I go about making this work or is it a bug? |
|
September 27, 2014, 00:08 |
|
#2 |
New Member
James Guthrie
Join Date: Sep 2014
Posts: 16
Rep Power: 12 |
So I realised I had to build a new psiReactionThermo:
Code:
makeReactionThermo ( psiThermo, psiReactionThermo, hePsiThermo, reactingMixture, sutherlandTransport, sensibleEnthalpy, janafThermo, PengRobinsonGas, specie ); /home/james/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so: undefined reference to `Foam::chemistryReader<Foam::sutherlandTransport<F oam::species::thermo<Foam::janafThermo<Foam::PengR obinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::dictionaryConstructorTablePtr_' collect2: error: ld returned 1 exit status make: *** [/home/james/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/bin/sprayFoam] Error 1 I've tried cleaning and making the model and the solver. Please help! Last edited by Jabo; September 27, 2014 at 01:33. Reason: Updated |
|
September 27, 2014, 17:17 |
|
#3 |
New Member
James Guthrie
Join Date: Sep 2014
Posts: 16
Rep Power: 12 |
I think I'm not rebuilding everything that I should be or I'm just missing a step. I edited the thermo model, rebuilt it and rebuilt the solver.
What have I missed? |
|
September 29, 2014, 18:00 |
|
#4 |
New Member
James Guthrie
Join Date: Sep 2014
Posts: 16
Rep Power: 12 |
Ok, here's what I missed.
To run my simulations with: Code:
thermoType { type hePsiThermo; mixture reactingMixture; transport sutherland; thermo janaf; energy sensibleEnthalpy; equationOfState PengRobinsonGas; specie specie; } Code:
typedef sutherlandTransport < species::thermo < janafThermo < PengRobinsonGas<specie> >, sensibleEnthalpy > > PengRobinsonGasPhysics; and, Code:
typedef Reaction<PengRobinsonGasPhysics> PengRobinsonGasReaction; and, Code:
makeReactionMixtureThermo ( psiThermo, psiReactionThermo, hePsiThermo, reactingMixture, PengRobinsonGasPhysics ); Code:
makeChemistryReader(PengRobinsonGasPhysics); makeChemistryReaderType(foamChemistryReader, PengRobinsonGasPhysics); Code:
makeReactions(PengRobinsonGasPhysics, PengRobinsonGasReaction) I believe that's it. Allwmake the thermophysicalModels and the sprayFoam solver. Figured that all out by myself |
|
September 30, 2014, 15:23 |
|
#5 |
Member
|
Did you fix undefined reference error?
|
|
September 30, 2014, 15:27 |
|
#6 |
New Member
James Guthrie
Join Date: Sep 2014
Posts: 16
Rep Power: 12 |
Yeah, my modifications fixed that error.
|
|
September 30, 2014, 15:45 |
|
#7 |
Member
|
Which of the above code you added recently?
I have added variable and source term equation to icoflow.H and icoflow.C files.Should I add something else? |
|
September 30, 2014, 15:47 |
|
#8 |
New Member
James Guthrie
Join Date: Sep 2014
Posts: 16
Rep Power: 12 |
I don't know about that one. My solution is to add new equations of state to the existing psiReactionThermo model. I think ours problems are unrelated.
|
|
January 17, 2015, 07:34 |
|
#9 |
New Member
Peter Bishop
Join Date: Jan 2012
Posts: 20
Rep Power: 14 |
Hi Jabo,
I'm trying to modify the source code according to your suggestions but with no succes! Could you please share your files to let me understand where I'm wrong, thank you! |
|
October 12, 2018, 06:42 |
|
#10 |
Member
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 8 |
Hi everyone,
I am working on the same subject, did you succeed to set up the sprayFoam solver to visualise LN2 with the Janaf table ? Because the initial range of temperature is from 200 K to 6000 K. Cheers Last edited by john myce; October 16, 2018 at 07:42. |
|
October 17, 2018, 13:49 |
|
#11 |
Member
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 8 |
By the way the method written by James works for me.
I have attached my files in case someone has an error. Make for specie directory: Code:
atomicWeights/atomicWeights.C specie/specie.C reaction/reactions/makeReactions.C reaction/reactions/makeLangmuirHinshelwoodReactions.C LIB = $(FOAM_USER_LIBBIN)/libspecie Code:
chemistryReaders/chemkinReader/chemkinReader.C chemistryReaders/chemkinReader/chemkinLexer.L chemistryReaders/chemistryReader/makeChemistryReaders.C mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C mixtures/basicSpecieMixture/basicSpecieMixture.C mixtures/basicCombustionMixture/basicCombustionMixture.C psiReactionThermo/psiReactionThermo.C psiReactionThermo/psiReactionThermos.C psiuReactionThermo/psiuReactionThermo.C psiuReactionThermo/psiuReactionThermos.C rhoReactionThermo/rhoReactionThermo.C rhoReactionThermo/rhoReactionThermos.C derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C functionObjects/moleFractions/moleFractionsFunctionObjects.C LIB = $(FOAM_USER_LIBBIN)/libreactionThermophysicalModels Code:
EXE_INC = \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(WM_PROJECT_USER_DIR)/src/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ -L$(FOAM_USER_LIBBIN)/lspecie \ -lsolidSpecie \ -lfiniteVolume |
|
October 23, 2018, 19:37 |
|
#12 |
New Member
Join Date: Jul 2012
Posts: 10
Rep Power: 14 |
Hi John
I am trying to use your files, based on the method described by James. I compiled my thermophysicalModels library and also compiled a new reactingFoam with this library. Now, if I test the solver using PengRobinsonGas on the tutorial case counterFlowFlame2D, deactivating the combustion as above, I get stuck. The code does not give me errors, but it stops after "foamChemistryReader" Code:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 3.0.1-d8a290b55d28 Exec : myReactingFoam Date : Oct 24 2018 Time : 00:28:40 PID : 4838 nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 PIMPLE: Operating solver in PISO mode Reading g Creating reaction model Selecting combustion model noCombustion<psiThermoCombustion> Selecting thermodynamics package { type hePsiThermo; mixture reactingMixture; transport sutherland; thermo janaf; energy sensibleEnthalpy; equationOfState PengRobinsonGas; specie specie; } Selecting chemistryReader foamChemistryReader Any ideas why? I think the foamChemistryReader needs some modifications to work with PengRobinsonGas, but can't figure it out |
|
October 24, 2018, 15:14 |
|
#13 |
Member
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 8 |
Hi,
Strange.. since we have added the pengrobinson physics to the foamChemistryReader I don t think it needs something else. Maybe try to run the simulation with the basic solver and add in the controlDict file the modified reactionthermo and the specie libraries. Like: Code:
libs { "libname.so" "libname.so" } |
|
October 24, 2018, 18:04 |
|
#14 |
New Member
Join Date: Jul 2012
Posts: 10
Rep Power: 14 |
I put PengRobinson in the thermoType and adapted the test case setup, turning off combustion and providing necessary information for PR for each species.
I’ve tried with including libs in the controlDict and using the base solver, but same problem. I'm using of301. Can you tell me if you have tried with reactingFoam? Or just with sprayFoam? |
|
October 25, 2018, 06:35 |
|
#15 |
Member
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 8 |
Hello,
Just with sprayFoam. |
|
November 12, 2018, 06:50 |
|
#16 |
Member
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 8 |
Hi Mick
Did you solve your pb ? |
|
November 12, 2018, 16:50 |
|
#17 |
New Member
Join Date: Jul 2012
Posts: 10
Rep Power: 14 |
Hi John
yes, I solved moving to openfoam 6. Not sure if this was the only possibility, but now I am able to compile a custom reactingFoam with a mixture of PR fluids. |
|
March 8, 2019, 05:42 |
|
#18 |
New Member
Tiziano Maffei
Join Date: Jun 2013
Location: Milan (Italy)
Posts: 11
Rep Power: 13 |
Hi Mick,
I am trying to add PengRobinson EoS to reactingFoam in oF-6 following the tips provided by John. I have adopted the case accordingly, adding equationOfState parameters for each species. My domain is a 2D planar system in which occurs a single step reaction A->B. As happened to you, the simulation stops after "foamChemistryReader" with the following list of error: Code:
#0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::Reaction<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::setThermo(Foam::HashPtrTable<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> >, Foam::word, Foam::string::hash> const&) at ??:? #4 Foam::Reaction<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::Reaction(Foam::hashedWordList const&, Foam::HashPtrTable<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> >, Foam::word, Foam::string::hash> const&, Foam::dictionary const&) at ??:? #5 Foam::Reaction<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::adddictionaryConstructorToTable<Foam::IrreversibleReaction<Foam::Reaction, Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> >, Foam::ArrheniusReactionRate> >::New(Foam::hashedWordList const&, Foam::HashPtrTable<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> >, Foam::word, Foam::string::hash> const&, Foam::dictionary const&) at ??:? #6 Foam::Reaction<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::New(Foam::hashedWordList const&, Foam::HashPtrTable<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> >, Foam::word, Foam::string::hash> const&, Foam::dictionary const&) at ??:? #7 Foam::ReactionList<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::readReactionDict() at ??:? #8 Foam::foamChemistryReader<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::foamChemistryReader(Foam::dictionary const&, Foam::hashedWordList&) at ??:? #9 Foam::chemistryReader<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::adddictionaryConstructorToTable<Foam::foamChemistryReader<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > > >::New(Foam::dictionary const&, Foam::hashedWordList&) at ??:? #10 Foam::chemistryReader<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::New(Foam::dictionary const&, Foam::hashedWordList&) at ??:? #11 Foam::reactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::reactingMixture(Foam::dictionary const&, Foam::fvMesh const&, Foam::word const&) at ??:? #12 Foam::heThermo<Foam::psiReactionThermo, Foam::SpecieMixture<Foam::reactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > > > >::heThermo(Foam::fvMesh const&, Foam::word const&) at ??:? #13 Foam::psiReactionThermo::addfvMeshConstructorToTable<Foam::hePsiThermo<Foam::psiReactionThermo, Foam::SpecieMixture<Foam::reactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleEnthalpy> > > > > >::New(Foam::fvMesh const&, Foam::word const&) at ??:? #14 Foam::autoPtr<Foam::psiReactionThermo> Foam::basicThermo::New<Foam::psiReactionThermo>(Foam::fvMesh const&, Foam::word const&) at ??:? #15 Foam::psiReactionThermo::New(Foam::fvMesh const&, Foam::word const&) at ??:? #16 ? in "/opt/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt64Opt/bin/reactingFoam" #17 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #18 ? in "/opt/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt64Opt/bin/reactingFoam" Thanks in advance Tiziano |
|
March 10, 2019, 18:07 |
|
#19 |
New Member
Join Date: Jul 2012
Posts: 10
Rep Power: 14 |
Hi Tiziano,
my problem was with of301, then moving to of6 and recompiling again I didn't get the foamChemistryReader error anymore. My error was without messages, so somewhat different from yours. What type of thermoType are you using? Mine was: thermoType { type hePsiThermo; mixture reactingMixture; transport sutherland; thermo janaf; energy sensibleEnthalpy; equationOfState PengRobinsonGas; specie specie; } |
|
March 14, 2019, 05:33 |
|
#20 |
New Member
Tiziano Maffei
Join Date: Jun 2013
Location: Milan (Italy)
Posts: 11
Rep Power: 13 |
Hi Mick,
thanks for your answer. At the end I have found the error and now I can able to use PengRobinsonGas Eos with reactingFoam. Furthermore, I have modified the mixing rules applied to critical pressure, temperature and so on using molar fraction instead of mass fraction. In this way my results are more similar to ones obtained with other software like fluent or unisim. Thanks for your availability Tiziano |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error using kOmegaSST in sprayFoam | CFDUser_ | OpenFOAM Running, Solving & CFD | 17 | November 20, 2023 16:29 |
SprayFOAM with manualInjection | marcomacchi | OpenFOAM Running, Solving & CFD | 0 | June 16, 2014 12:25 |
sprayFoam crashes | lukasfischer | OpenFOAM Running, Solving & CFD | 3 | July 14, 2013 12:08 |
Fluent & Barotropic EOS | fivos | FLUENT | 0 | July 11, 2013 04:32 |
Solid EOS | adam | Main CFD Forum | 5 | March 18, 2008 14:12 |