View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001684||OpenFOAM||[All Projects] Bug||public||2015-05-06 12:52||2015-05-21 16:12|
|Fixed in Version|
|Summary||0001684: Adding New basicChemistryModel Results in Crash at Compile|
|Description||You cannot add an additional basic solid chemistry model for using other gasThermoPhysics models. It seems that each solid thermophysics type can only be used once in the expansion macro for basicSolidChemistryModels.C.|
|Steps To Reproduce||Insert additional solid chemistry model for using constant gas thermophysics in basicSolidChemistryModels.C such that:|
|Tags||No tags attached.|
Error message at compile time:
OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/className.H:103:38: error: redefinition of ‘const Foam::word Foam::solidChemistryModel<Foam::basicSolidChemistryModel, Foam::constIsoSolidTransport<Foam::species::thermo<Foam::hConstThermo<Foam::rhoConst<Foam::specie> >, Foam::sensibleEnthalpy> > >::typeName’
basicSolidChemistryModels.C (3,215 bytes)
makeSolidChemistryModel.H (3,442 bytes)
@LWhitson2: You've diagnosed it right, the "core" solid typesets were being defined more than once, if we were to use the same solid model more than once.
Attached are these two files:
they have been tested with a recent commit of 2.3.x (fdfc1248489).
The modified files provided are almost identical to the original files, except that instead of using "makeSolidChemistryModel", it now uses "makeCoreSolidChemistryModel" and "makeSolidGasChemistryModel", where the first one only needs to be used once per solid model and the second one can be used for any and all gas models.
This piece of code:
is essentially what LWhitson2 wants to use, therefore I don't know if you want to add it in to OpenFOAM 2.3.x/dev yet.
In addition, due to the somewhat big change to how these macros are used (the original macro simply disappears), I think it's best to apply this only to OpenFOAM-dev.
If this is to be added to 2.3.x as well, then I suggest that instead of these specific files, only the macro "makeSolidGasChemistryModel" is appended to "makeSolidChemistryModel.H" in 2.3.x and then the additional piece of code can be used safely, since the first call to "makeSolidChemistryModel" already defines the current models.
@Bruno: Thanks for the patch
I agree with your change but I had to rework it quite a bit for OpenFOAM-dev in which I had already substantially changed the macro:
I have only instantiated the original set of solid-gas models but the macros should now allow the instantiation of other combinations as you demonstrated.
|Thanks for looking into this guys. I will simply utilize my modified file that doesn't utilize the variable properties until -dev becomes the new -2.X.X. I hope my bug report helped as well.|
||Note Added: 0004722|
|2015-05-17 20:32||wyldckat||File Added: basicSolidChemistryModels.C|
|2015-05-17 20:33||wyldckat||File Added: makeSolidChemistryModel.H|
|2015-05-17 20:43||wyldckat||Note Added: 0004770|
|2015-05-17 22:10||henry||Note Added: 0004772|
||Note Added: 0004782|
|2015-05-21 16:12||henry||Status||new => resolved|
|2015-05-21 16:12||henry||Resolution||open => fixed|
|2015-05-21 16:12||henry||Assigned To||=> henry|