|
[Sponsors] |
October 21, 2024, 11:35 |
Implement a new thermo type: hePsiThermo?
|
#1 |
New Member
Chen Huang
Join Date: Jul 2009
Location: Gothenburg, Sweden
Posts: 14
Rep Power: 17 |
Being an old OpenFOAM user (almost 15 years), I still strugle with thermophysical library of OpenFOAM. The temperature calculation in OpenFOAM is quite messy and problematic. A very common error is temperature out of range when using Janaf polynonial equation for getting Temperatur from enthalpy.
Anyway, in order to figure out /debugg, where is the problem, I need to implement a new thermo type: hePsiThermo->myHePsiThermo. But my case cannot recognize this new thermo type: Note that I changed psiThermo -> myPsiThermo (class reference, abstract) and hePsiThermo->myHePsiThermo (class tempalate reference) Selecting thermodynamics package { type myHePsiThermo; mixture singleStepReactingMixture; transport sutherland; thermo janaf; energy sensibleEnthalpy; equationOfState perfectGas; specie specie; } --> FOAM FATAL IO ERROR: (openfoam-2406) Unknown psiReactionThermo type Valid psiReactionThermo types : 23 ( hePsiThermo<homogeneousMixture<const<hConst<perfec tGas<specie>>,sensibleEnthalpy>>> hePsiThermo<homogeneousMixture<sutherland<hConst<p erfectGas<specie>>,sensibleEnthalpy>>> hePsiThermo<homogeneousMixture<sutherland<janaf<pe rfectGas<specie>>,sensibleEnthalpy>>> hePsiThermo<inhomogeneousMixture<const<hConst<perf ectGas<specie>>,sensibleEnthalpy>>> hePsiThermo<inhomogeneousMixture<sutherland<hConst <perfectGas<specie>>,sensibleEnthalpy>>> hePsiThermo<inhomogeneousMixture<sutherland<janaf< perfectGas<specie>>,sensibleEnthalpy>>> hePsiThermo<multiComponentMixture<const<eConst<per fectGas<specie>>,sensibleInternalEnergy>>> hePsiThermo<multiComponentMixture<const<hConst<per fectGas<specie>>,sensibleEnthalpy>>> hePsiThermo<multiComponentMixture<sutherland<janaf <perfectGas<specie>>,sensibleEnthalpy>>> hePsiThermo<multiComponentMixture<sutherland<janaf <perfectGas<specie>>,sensibleInternalEnergy>>> hePsiThermo<pureMixture<const<eConst<perfectGas<sp ecie>>,sensibleInternalEnergy>>> hePsiThermo<pureMixture<const<hConst<perfectGas<sp ecie>>,sensibleEnthalpy>>> hePsiThermo<pureMixture<sutherland<janaf<perfectGa s<specie>>,sensibleEnthalpy>>> hePsiThermo<pureMixture<sutherland<janaf<perfectGa s<specie>>,sensibleInternalEnergy>>> hePsiThermo<reactingMixture<const<eConst<perfectGa s<specie>>,sensibleInternalEnergy>>> hePsiThermo<reactingMixture<const<hConst<perfectGa s<specie>>,sensibleEnthalpy>>> hePsiThermo<reactingMixture<sutherland<janaf<perfe ctGas<specie>>,sensibleEnthalpy>>> hePsiThermo<reactingMixture<sutherland<janaf<perfe ctGas<specie>>,sensibleInternalEnergy>>> hePsiThermo<singleStepReactingMixture<sutherland<j anaf<perfectGas<specie>>,sensibleEnthalpy>>> hePsiThermo<singleStepReactingMixture<sutherland<j anaf<perfectGas<specie>>,sensibleInternalEnergy>>> hePsiThermo<veryInhomogeneousMixture<const<hConst< perfectGas<specie>>,sensibleEnthalpy>>> hePsiThermo<veryInhomogeneousMixture<sutherland<hC onst<perfectGas<specie>>,sensibleEnthalpy>>> hePsiThermo<veryInhomogeneousMixture<sutherland<ja naf<perfectGas<specie>>,sensibleEnthalpy>>> ) type mixture transport thermo equationOfState specie energy |
|
October 23, 2024, 06:42 |
The problem is solved.
|
#2 |
New Member
Chen Huang
Join Date: Jul 2009
Location: Gothenburg, Sweden
Posts: 14
Rep Power: 17 |
The thermophysical library is probably one of the most complex or messy parts in OpenFOAM with 6 levels objects and spider net connections, I think.
The problem is solved by modifying the following classes, including src/combustionModels/CombustionModel/CombustionModel/CombustionModels.C src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C (I use this combustion model in my case) src/thermophysicalModels/basic/psiThermo/* src/thermophysicalModels/reactionThermo/psiReactionThermo/* Then I could call a new thermoType as follows: 18 thermoType 19 { 20 type myHePsiThermo; 21 mixture singleStepReactingMixture; 22 transport sutherland; 23 thermo janaf; 24 energy sensibleEnthalpy; 25 equationOfState perfectGas; 26 specie specie; 27 } Then I can start debugging the temperature calculation in the hePsiThermo.C file. |
|
October 28, 2024, 13:49 |
|
#3 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 737
Rep Power: 14 |
Haha - yes - agreed! It is the messiest part of OpenFOAM, and what's worse is that it keeps changing (in the Foundation version at least), so when you finally get your head around it, it's all out of date! Well done in figuring it out.
Incidentally, on the Janaf issue (usually T undershoot in my experience), you can use limitTemperature to keep it within bounds ... ofc that can still cause your code to blow up, but at least you don't end up with gigabytes of Janaf warning messages in your log file. |
|
October 29, 2024, 10:16 |
|
#4 |
Senior Member
|
Do collaboration diagrams as shown at e.g. https://www.openfoam.com/documentati...calModels.html help here?
|
|
October 30, 2024, 05:10 |
|
#5 | |
New Member
Chen Huang
Join Date: Jul 2009
Location: Gothenburg, Sweden
Posts: 14
Rep Power: 17 |
Quote:
|
||
November 12, 2024, 06:12 |
changes in transport properties
|
#6 |
New Member
Join Date: Mar 2022
Posts: 8
Rep Power: 4 |
Hi. I had a need to create a new viscosity calculation model for chemical components in OF. I have a little experience working with the source code OF 12, but I can't figure out how to add a new transport component. I found a couple of guides where this was discussed, but it was for very old versions OF. Could you help me, where should I start? As far as I understand, I have to copy a number of libraries and rename them, but which libraries should I copy? For example, if I want to change the simplest library where viscosity is constant, which parts OF IT should I copy?
Thanks! |
|
Tags |
hepsithermo, temperature out of range, thermophysical library |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Illegal cell label -1, fluent3DMeshToFoam | BenGher | OpenFOAM | 7 | October 10, 2023 01:02 |
rSF: p divergence in combustor (wt negative value) | zonda | OpenFOAM Pre-Processing | 4 | April 10, 2018 07:59 |
rhoPimpleFoam hardship | petrus | OpenFOAM Running, Solving & CFD | 0 | October 7, 2016 03:41 |
Time step continuity error | lpz_michele | OpenFOAM Running, Solving & CFD | 0 | October 12, 2015 07:05 |
Error during initialization of "rhoSimpleFoam" | kornickel | OpenFOAM Running, Solving & CFD | 8 | September 17, 2013 06:37 |