View Issue Details

IDProjectCategoryView StatusLast Update
0001684OpenFOAM[All Projects] Bugpublic2015-05-21 16:12
Reporteruser281Assigned Tohenry 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.10
Product Version 
Fixed in Version 
Summary0001684: Adding New basicChemistryModel Results in Crash at Compile
DescriptionYou 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 ReproduceInsert additional solid chemistry model for using constant gas thermophysics in basicSolidChemistryModels.C such that:

makeSolidChemistryModel
(
    solidChemistryModel,
    pyrolysisChemistryModel,
    basicSolidChemistryModel,
    hConstSolidThermoPhysics,
    constGasHThermoPhysics
);
TagsNo tags attached.

Activities

user281

2015-05-06 12:52

  ~0004722

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’

wyldckat

2015-05-17 20:32

updater  

basicSolidChemistryModels.C (3,215 bytes)

wyldckat

2015-05-17 20:33

updater  

makeSolidChemistryModel.H (3,442 bytes)

wyldckat

2015-05-17 20:43

updater   ~0004770

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


@Henry:
Attached are these two files:
  - src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModels.C
  - src/thermophysicalModels/solidChemistryModel/makeSolidChemistryModel.H

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:

    makeSolidGasChemistryModel
    (
        solidChemistryModel,
        pyrolysisChemistryModel,
        basicSolidChemistryModel,
        hConstSolidThermoPhysics,
        constGasHThermoPhysics
    );

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.

Best regards,
Bruno

henry

2015-05-17 22:10

manager   ~0004772

@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:
commit 4aed56e67da8a340473154e1525a28aec355d662

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.

user281

2015-05-21 15:35

  ~0004782

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.

Issue History

Date Modified Username Field Change
2015-05-06 12:52 user281 New Issue
2015-05-06 12:52 user281 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
2015-05-21 15:35 user281 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