From d06c320b77dbf4a262a2980591b2a37f8ae35bd4 Mon Sep 17 00:00:00 2001
From: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
Date: Mon, 2 Aug 2021 12:02:53 +0100
Subject: [PATCH] ENH: makeSolidReaction: modify macros to allow new models

---
 .../reaction/reactions/makeSolidReaction.H    |  6 +---
 .../reaction/reactions/makeSolidReactions.C   | 33 ++++++++++++-------
 2 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReaction.H b/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReaction.H
index d776a07cbae..715da5018d0 100644
--- a/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReaction.H
+++ b/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReaction.H
@@ -6,6 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2017 OpenFOAM Foundation
+    Copyright (C) 2021 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -56,11 +57,6 @@ namespace Foam
     typedef ReactionType<solidReaction, Thermo, ReactionRate>                  \
         ReactionType##Thermo##ReactionRate;                                    \
                                                                                \
-    defineTemplateRunTimeSelectionTable(Reaction##Thermo, dictionary);         \
-                                                                               \
-    defineTemplateTypeNameAndDebug(solidReaction##Thermo, 0);                  \
-    defineTemplateTypeNameAndDebug(Reaction##Thermo, 0);                       \
-                                                                               \
     template<>                                                                 \
     const word ReactionType##Thermo##ReactionRate::typeName                    \
     (                                                                          \
diff --git a/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReactions.C b/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReactions.C
index 96a9ab08ffb..6262ab4ffcf 100644
--- a/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReactions.C
+++ b/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReactions.C
@@ -6,6 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2015 OpenFOAM Foundation
+    Copyright (C) 2021 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -26,9 +27,27 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "makeSolidReaction.H"
+
 #include "solidArrheniusReactionRate.H"
+
 #include "solidThermoPhysicsTypes.H"
 
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#define makeSolidReactions(Thermo)                                             \
+                                                                               \
+    typedef solidReaction<Thermo> solidReaction##Thermo;                       \
+                                                                               \
+    typedef Reaction<Thermo> Reaction##Thermo;                                 \
+                                                                               \
+    defineTemplateRunTimeSelectionTable(Reaction##Thermo, dictionary);         \
+                                                                               \
+    defineTemplateTypeNameAndDebug(solidReaction##Thermo, 0);                  \
+    defineTemplateTypeNameAndDebug(Reaction##Thermo, 0);                       \
+                                                                               \
+    makeSolidIRReactions(Thermo, solidArrheniusReactionRate)
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
@@ -36,19 +55,11 @@ namespace Foam
 
 // * * * * * * * * * * * * * Make Solid reactions  * * * * * * * * * * * * //
 
-makeSolidIRReactions(hConstSolidThermoPhysics, solidArrheniusReactionRate)
+makeSolidReactions(hConstSolidThermoPhysics)
 
-makeSolidIRReactions
-(
-    hPowerSolidThermoPhysics,
-    solidArrheniusReactionRate
-)
+makeSolidReactions(hPowerSolidThermoPhysics)
 
-makeSolidIRReactions
-(
-    hExpKappaConstSolidThermoPhysics,
-    solidArrheniusReactionRate
-)
+makeSolidReactions(hExpKappaConstSolidThermoPhysics)
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-- 
GitLab