From a99dd9177b63b01229658fcd7b45b665df894b65 Mon Sep 17 00:00:00 2001
From: Andreas Lauser <and@poware.org>
Date: Fri, 16 Dec 2011 13:24:20 +0000
Subject: [PATCH] add test to check the API of all fluid systems

if new fluid systems become available, the test should be
extended. also, there the same test should be used for all fluid
systems in dumux-devel.

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7097 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 CMakeLists.txt                                |   4 +-
 .../1p2cvs2p/watercontaminantfluidsystem.hh   |   2 +
 configure.ac                                  |   1 +
 .../binarycoefficients/fullermethod.hh        |   2 +
 dumux/material/components/iapws/region1.hh    |  29 +++
 dumux/material/components/iapws/region2.hh    |  40 ++++
 .../fluidstates/immisciblefluidstate.hh       |   3 +
 dumux/material/fluidsystems/1pfluidsystem.hh  |   4 +
 .../fluidsystems/2pimmisciblefluidsystem.hh   |   4 +
 .../material/fluidsystems/h2on2fluidsystem.hh |   2 +
 .../fluidsystems/parametercachebase.hh        |   2 +-
 test/CMakeLists.txt                           |   1 +
 .../1p2c/interstitialfluidtrailfluidsystem.hh |   2 +
 test/material/CMakeLists.txt                  |   7 +
 test/material/Makefile.am                     |   2 +-
 test/material/fluidsystems/CMakeLists.txt     |   8 +
 test/material/fluidsystems/Makefile.am        |   5 +
 .../material/fluidsystems/checkfluidsystem.hh | 202 ++++++++++++++++++
 .../fluidsystems/test_fluidsystems.cc         |  79 +++++++
 test/material/ncpflash/CMakeLists.txt         |   8 +
 test/material/tabulation/CMakeLists.txt       |   8 +
 21 files changed, 412 insertions(+), 3 deletions(-)
 create mode 100644 test/material/CMakeLists.txt
 create mode 100644 test/material/fluidsystems/CMakeLists.txt
 create mode 100644 test/material/fluidsystems/Makefile.am
 create mode 100644 test/material/fluidsystems/checkfluidsystem.hh
 create mode 100644 test/material/fluidsystems/test_fluidsystems.cc
 create mode 100644 test/material/ncpflash/CMakeLists.txt
 create mode 100644 test/material/tabulation/CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8336ed6743..54c62782bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -279,7 +279,9 @@ add_test(test_dec2p2c \
          test/decoupled/2p/test_dec2p2c-reference.vtu \
          test/decoupled/2p/test_dec2p2c-00021.vtu \
          test/decoupled/2p2c/test_dec2p2c)
-add_test(test_multiphysics2p2c test/decoupled/2p2c/test_multiphysics2p2c)
+add_test(test_fluidsystems test/material/fluidsystems/test_fluidsystems)
+add_test(test_fluidsystems test/material/ncpflash/test_ncpflash)
+add_test(tutorial_coupled tutorial/tutorial_coupled 1 1)
 add_test(tutorial_coupled tutorial/tutorial_coupled 1 1)
 add_test(tutorial_decoupled tutorial/tutorial_decoupled 1)
 
diff --git a/appl/lecture/msm/1p2cvs2p/watercontaminantfluidsystem.hh b/appl/lecture/msm/1p2cvs2p/watercontaminantfluidsystem.hh
index 016c339a84..12ec2d71d8 100644
--- a/appl/lecture/msm/1p2cvs2p/watercontaminantfluidsystem.hh
+++ b/appl/lecture/msm/1p2cvs2p/watercontaminantfluidsystem.hh
@@ -40,6 +40,8 @@
 
 #include <dumux/material/fluidsystems/basefluidsystem.hh>
 
+#include <assert.h>
+
 namespace Dumux
 {
 namespace FluidSystems
diff --git a/configure.ac b/configure.ac
index e51cf9114c..b279cb2973 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,6 +85,7 @@ AC_CONFIG_FILES([dumux.pc
     test/material/Makefile
     test/material/tabulation/Makefile
     test/material/ncpflash/Makefile
+    test/material/fluidsystems/Makefile
     tutorial/Makefile
 ])
 
diff --git a/dumux/material/binarycoefficients/fullermethod.hh b/dumux/material/binarycoefficients/fullermethod.hh
index 60ea5d25ac..f2b85442ea 100644
--- a/dumux/material/binarycoefficients/fullermethod.hh
+++ b/dumux/material/binarycoefficients/fullermethod.hh
@@ -24,6 +24,8 @@
 #ifndef DUMUX_FULLERMETHOD_HH
 #define DUMUX_FULLERMETHOD_HH
 
+#include <dumux/common/math.hh>
+
 namespace Dumux
 {
 namespace BinaryCoeff
diff --git a/dumux/material/components/iapws/region1.hh b/dumux/material/components/iapws/region1.hh
index 461e58cd2a..edc9dfc72e 100644
--- a/dumux/material/components/iapws/region1.hh
+++ b/dumux/material/components/iapws/region1.hh
@@ -266,6 +266,35 @@ public:
         return result;
     }
 
+    /*!
+     * \brief The second partial derivative of the Gibbs free energy to the
+     *        normalized temperature for IAPWS region 1 (i.e. liquid) (dimensionless).
+     *
+     * \param temperature temperature of component in \f$\mathrm{[K]}\f$
+     * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
+     *
+     * IAPWS: "Revised Release on the IAPWS Industrial Formulation
+     * 1997 for the Thermodynamic Properties of Water and Steam",
+     * http://www.iapws.org/relguide/IF97-Rev.pdf
+     */
+    static Scalar ddgamma_ddtau(Scalar temperature, Scalar pressure)
+    {
+        Scalar tau_ = tau(temperature);   /* reduced temperature */
+        Scalar pi_ = pi(pressure);    /* reduced pressure */
+
+        Scalar result = 0.0;
+        for (int i = 0; i < 34; i++) {
+            result +=
+                n(i) *
+                std::pow(7.1 - pi_, I(i)) *
+                J(i) * 
+                (J(i) - 1) *
+                std::pow(tau_ - 1.222,  J(i) - 2);
+        }
+
+        return result;
+    }
+
 private:
     static Scalar n(int i)
     {
diff --git a/dumux/material/components/iapws/region2.hh b/dumux/material/components/iapws/region2.hh
index fc2f0c311e..b5bb9444cb 100644
--- a/dumux/material/components/iapws/region2.hh
+++ b/dumux/material/components/iapws/region2.hh
@@ -291,6 +291,46 @@ public:
         return result;
     }
 
+    /*!
+     * \brief The second partial derivative of the Gibbs free energy to the
+     *        normalized temperature for IAPWS region 2 (i.e. sub-critical
+     *        steam) dimensionless).
+     *
+     * \param temperature temperature of component in \f$\mathrm{[K]}\f$
+     * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
+     *
+     * IAPWS: "Revised Release on the IAPWS Industrial Formulation
+     * 1997 for the Thermodynamic Properties of Water and Steam",
+     * http://www.iapws.org/relguide/IF97-Rev.pdf
+     */
+    static Scalar ddgamma_ddtau(Scalar temperature, Scalar pressure)
+    {
+        Scalar tau_ = tau(temperature);   /* reduced temperature */
+        Scalar pi_ = pi(pressure);    /* reduced pressure */
+
+        // ideal gas part
+        Scalar result = 0;
+        for (int i = 0; i < 9; i++) {
+            result +=
+                n_g(i) *
+                J_g(i) *
+                (J_g(i) - 1) *
+                std::pow(tau_, J_g(i) - 2);
+        }
+
+        // residual part
+        for (int i = 0; i < 43; i++) {
+            result +=
+                n_r(i) *
+                std::pow(pi_,  I_r(i)) *
+                J_r(i) *
+                (J_g(i) - 1) *
+                std::pow(tau_ - 0.5, J_r(i) - 2);
+        }
+
+        return result;
+    }
+
 
 private:
     static Scalar n_g(int i)
diff --git a/dumux/material/fluidstates/immisciblefluidstate.hh b/dumux/material/fluidstates/immisciblefluidstate.hh
index eb087e6e70..852430ba9a 100644
--- a/dumux/material/fluidstates/immisciblefluidstate.hh
+++ b/dumux/material/fluidstates/immisciblefluidstate.hh
@@ -26,8 +26,11 @@
  */
 #ifndef DUMUX_IMMISCIBLE_FLUID_STATE_HH
 #define DUMUX_IMMISCIBLE_FLUID_STATE_HH
+
 #include <dumux/common/valgrind.hh>
 
+#include <limits>
+
 namespace Dumux
 {
 /*!
diff --git a/dumux/material/fluidsystems/1pfluidsystem.hh b/dumux/material/fluidsystems/1pfluidsystem.hh
index b2305564ae..f098a5947e 100644
--- a/dumux/material/fluidsystems/1pfluidsystem.hh
+++ b/dumux/material/fluidsystems/1pfluidsystem.hh
@@ -32,6 +32,10 @@
 
 #include "basefluidsystem.hh"
 
+#include <limits>
+
+#include <assert.h>
+
 namespace Dumux {
 namespace FluidSystems {
 
diff --git a/dumux/material/fluidsystems/2pimmisciblefluidsystem.hh b/dumux/material/fluidsystems/2pimmisciblefluidsystem.hh
index 823ab30e77..2214d74e64 100644
--- a/dumux/material/fluidsystems/2pimmisciblefluidsystem.hh
+++ b/dumux/material/fluidsystems/2pimmisciblefluidsystem.hh
@@ -38,6 +38,10 @@
 
 #include "basefluidsystem.hh"
 
+#include <limits>
+
+#include <assert.h>
+
 namespace Dumux {
 namespace FluidSystems {
 
diff --git a/dumux/material/fluidsystems/h2on2fluidsystem.hh b/dumux/material/fluidsystems/h2on2fluidsystem.hh
index 0feca298dd..473a216138 100644
--- a/dumux/material/fluidsystems/h2on2fluidsystem.hh
+++ b/dumux/material/fluidsystems/h2on2fluidsystem.hh
@@ -38,6 +38,8 @@
 
 #include "basefluidsystem.hh"
 
+#include <assert.h>
+
 namespace Dumux
 {
 namespace FluidSystems
diff --git a/dumux/material/fluidsystems/parametercachebase.hh b/dumux/material/fluidsystems/parametercachebase.hh
index 2914ade4e1..2c6e493dd7 100644
--- a/dumux/material/fluidsystems/parametercachebase.hh
+++ b/dumux/material/fluidsystems/parametercachebase.hh
@@ -38,7 +38,7 @@ public:
         None = 0,
         Temperature = 1, 
         Pressure = 2,
-        Composition = 2,       
+        Composition = 4,    
     };
     
     ParameterCacheBase()
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index d6c03847e8..712ae30a1a 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -2,6 +2,7 @@
 # (they also don't compile if using the old build system)!
 
 add_subdirectory("boxmodels")
+add_subdirectory("material")
 add_subdirectory("common")
 add_subdirectory("decoupled")
 
diff --git a/test/boxmodels/1p2c/interstitialfluidtrailfluidsystem.hh b/test/boxmodels/1p2c/interstitialfluidtrailfluidsystem.hh
index 17a3073c4a..878f2ceb84 100644
--- a/test/boxmodels/1p2c/interstitialfluidtrailfluidsystem.hh
+++ b/test/boxmodels/1p2c/interstitialfluidtrailfluidsystem.hh
@@ -32,6 +32,8 @@
 
 #include <dumux/material/fluidsystems/basefluidsystem.hh>
 
+#include <assert.h>
+
 namespace Dumux
 {
 namespace FluidSystems
diff --git a/test/material/CMakeLists.txt b/test/material/CMakeLists.txt
new file mode 100644
index 0000000000..bfe874093d
--- /dev/null
+++ b/test/material/CMakeLists.txt
@@ -0,0 +1,7 @@
+# directories which are commented out do not compile at the moment
+# (they also don't compile if using the old build system)!
+
+add_subdirectory("fluidsystems")
+add_subdirectory("ncpflash")
+add_subdirectory("tabulation")
+
diff --git a/test/material/Makefile.am b/test/material/Makefile.am
index 17f3316dcc..9e4e2db118 100644
--- a/test/material/Makefile.am
+++ b/test/material/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = tabulation ncpflash
+SUBDIRS = fluidsystems tabulation ncpflash
 
 include $(top_srcdir)/am/global-rules
 
diff --git a/test/material/fluidsystems/CMakeLists.txt b/test/material/fluidsystems/CMakeLists.txt
new file mode 100644
index 0000000000..054fc68cad
--- /dev/null
+++ b/test/material/fluidsystems/CMakeLists.txt
@@ -0,0 +1,8 @@
+# build target for the simple twophase lens problem
+ADD_EXECUTABLE("test_fluidsystems" test_fluidsystems.cc)
+TARGET_LINK_LIBRARIES("test_fluidsystems" ${DumuxLinkLibraries})
+
+# add required libraries and includes to the build flags 
+LINK_DIRECTORIES(${DumuxLinkDirectories})
+INCLUDE_DIRECTORIES(${DumuxIncludeDirectories})
+
diff --git a/test/material/fluidsystems/Makefile.am b/test/material/fluidsystems/Makefile.am
new file mode 100644
index 0000000000..3978ca9eac
--- /dev/null
+++ b/test/material/fluidsystems/Makefile.am
@@ -0,0 +1,5 @@
+check_PROGRAMS = test_fluidsystems
+
+test_fluidsystems_SOURCES = test_fluidsystems.cc
+
+include $(top_srcdir)/am/global-rules
diff --git a/test/material/fluidsystems/checkfluidsystem.hh b/test/material/fluidsystems/checkfluidsystem.hh
new file mode 100644
index 0000000000..43beddfea3
--- /dev/null
+++ b/test/material/fluidsystems/checkfluidsystem.hh
@@ -0,0 +1,202 @@
+/*****************************************************************************
+ *   Copyright (C) 2011 by Andreas Lauser                                    *
+ *   Institute of Hydraulic Engineering                                      *
+ *   University of Stuttgart, Germany                                        *
+ *   email: <givenname>.<name>@iws.uni-stuttgart.de                          *
+ *                                                                           *
+ *   This program is free software: you can redistribute it and/or modify    *
+ *   it under the terms of the GNU General Public License as published by    *
+ *   the Free Software Foundation, either version 2 of the License, or       *
+ *   (at your option) any later version.                                     *
+ *                                                                           *
+ *   This program is distributed in the hope that it will be useful,         *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
+ *   GNU General Public License for more details.                            *
+ *                                                                           *
+ *   You should have received a copy of the GNU General Public License       *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
+ *****************************************************************************/
+/*!
+ * \file
+ *
+ * \brief This file provides the actual code for the fluid systems
+ *        test. 
+ *
+ * It is not directly in test_fluidsystems.cc so that external modules
+ * like dumux-devel can use it easily
+ */
+#ifndef DUMUX_CHECK_FLUIDSYSTEM_HH
+#define DUMUX_CHECK_FLUIDSYSTEM_HH
+
+// include all fluid systems in dumux-stable
+#include <test/boxmodels/1p2c/interstitialfluidtrailfluidsystem.hh>
+#include <dumux/material/fluidsystems/1pfluidsystem.hh>
+#include <dumux/material/fluidsystems/2pimmisciblefluidsystem.hh>
+#include <dumux/material/fluidsystems/h2on2fluidsystem.hh>
+#include <appl/lecture/msm/1p2cvs2p/watercontaminantfluidsystem.hh>
+
+// include the compositional fluid state
+#include <dumux/material/fluidstates/compositionalfluidstate.hh>
+
+#include <dune/common/classname.hh>
+
+// this is a fluid state which makes sure that only the quantities
+// allowed are accessed
+template <class Scalar, class FluidSystem>
+class HairSplittingFluidState 
+    : protected Dumux::CompositionalFluidState<Scalar, FluidSystem>
+{
+    typedef Dumux::CompositionalFluidState<Scalar, FluidSystem> ParentType;
+
+public:
+    enum { numPhases = FluidSystem::numPhases };
+    enum { numComponents = FluidSystem::numComponents };
+
+    HairSplittingFluidState()
+    {
+        // set some fake values
+        ParentType::setTemperature(293.15);
+        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
+            ParentType::setSaturation(phaseIdx, 1.0 / numPhases);
+            ParentType::setDensity(phaseIdx, 1.0);
+
+            for (int compIdx = 0; compIdx < numComponents; ++compIdx) {
+                ParentType::setMoleFraction(phaseIdx, compIdx, 1.0 / numComponents);
+                
+            }
+        }
+        
+        // initially, do not allow anything
+        allowSaturation(false);
+        allowTemperature(false);
+        allowPressure(false);
+        allowComposition(false);
+        allowDensity(false);
+    }
+
+    void allowSaturation(bool yesno)
+    { allowSaturation_ = yesno; }
+
+    void allowPressure(bool yesno)
+    { allowPressure_ = yesno; }
+
+    void allowComposition(bool yesno)
+    { allowComposition_ = yesno; }
+    
+    void allowDensity(bool yesno) 
+    { allowDensity_ = yesno; }
+
+    Scalar saturation(int phaseIdx) const
+    { assert(allowSaturation_); return ParentType::saturation(phaseIdx); }
+
+    Scalar temperature(int phaseIdx) const
+    { assert(allowTemperature_); return ParentType::temperature(phaseIdx); }
+
+    void allowTemperature(bool yesno)
+    { allowTemperature_ = yesno; }
+    
+    Scalar pressure(int phaseIdx) const
+    { assert(allowPressure_); return ParentType::pressure(phaseIdx); }
+
+    Scalar moleFraction(int phaseIdx, int compIdx) const
+    { assert(allowComposition_); return ParentType::moleFraction(phaseIdx, compIdx); }
+
+    Scalar massFraction(int phaseIdx, int compIdx) const
+    { assert(allowComposition_); return ParentType::massFraction(phaseIdx, compIdx); }
+
+    Scalar averageMolarMass(int phaseIdx) const
+    { assert(allowComposition_); return ParentType::averageMolarMass(phaseIdx); }
+
+    Scalar molarity(int phaseIdx, int compIdx) const
+    { assert(allowDensity_ && allowComposition_); return ParentType::molarity(phaseIdx, compIdx); }
+
+    Scalar molarDensity(int phaseIdx) const
+    { assert(allowDensity_); return ParentType::molarDensity(phaseIdx); }
+
+    Scalar molarVolume(int phaseIdx) const
+    { assert(allowDensity_); return ParentType::molarVolume(phaseIdx); }
+
+    Scalar density(int phaseIdx) const
+    { assert(allowDensity_); return ParentType::density(phaseIdx); }
+
+private:
+    bool allowSaturation_;
+    bool allowTemperature_;
+    bool allowPressure_;
+    bool allowComposition_;
+    bool allowDensity_;
+};
+
+template <class Scalar, class FluidSystem>
+void checkFluidSystem()
+{
+    std::cout << "Testing fluid system '" << Dune::className<FluidSystem>() << "'\n";
+
+    HairSplittingFluidState<Scalar, FluidSystem> fs;
+
+    fs.allowTemperature(true);
+    fs.allowPressure(true);
+    fs.allowComposition(true);
+
+    // check whether the parameter cache adheres to the API
+    typedef typename FluidSystem::ParameterCache PC;
+    PC paramCache;
+    try { paramCache.updateAll(fs); } catch (...) {};
+    try { paramCache.updateAll(fs, /*except=*/PC::None); } catch (...) {};
+    try { paramCache.updateAll(fs, /*except=*/PC::Temperature | PC::Pressure | PC::Composition); } catch (...) {};
+    try { paramCache.updatePhase(fs, /*phaseIdx=*/0); } catch (...) {};
+    try { paramCache.updatePhase(fs, /*phaseIdx=*/0, /*except=*/PC::None); } catch (...) {};
+    try { paramCache.updatePhase(fs, /*phaseIdx=*/0, /*except=*/PC::Temperature | PC::Pressure | PC::Composition); } catch (...) {};
+    try { paramCache.updateTemperature(fs, /*phaseIdx=*/0); } catch (...) {};
+    try { paramCache.updateAllPressures(fs); } catch (...) {};
+    try { paramCache.updateSinglePressure(fs, /*phaseIdx=*/0); } catch (...) {};
+    try { paramCache.updateComposition(fs, /*phaseIdx=*/0); } catch (...) {};
+    try { paramCache.updateSingleMoleFraction(fs, /*phaseIdx=*/0, /*compIdx=*/0); } catch (...) {};
+
+    // some value to make sure the return values of the fluid system
+    // are convertible to scalars
+    Scalar __attribute__((unused)) val;
+
+    enum { numPhases = FluidSystem::numPhases };
+    enum { numComponents = FluidSystem::numComponents };
+
+    // actually check the fluid system API
+    FluidSystem::init();
+    for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
+        fs.allowPressure(FluidSystem::isCompressible(phaseIdx));
+        fs.allowComposition(true);
+        fs.allowDensity(false);
+        try { val = FluidSystem::density(fs, paramCache, phaseIdx); } catch (...) {};
+
+        fs.allowPressure(true);
+        fs.allowDensity(true);
+        try { val = FluidSystem::viscosity(fs, paramCache, phaseIdx); } catch (...) {};
+        try { val = FluidSystem::enthalpy(fs, paramCache, phaseIdx); } catch (...) {};
+        try { val = FluidSystem::heatCapacity(fs, paramCache, phaseIdx); } catch (...) {};
+        try { val = FluidSystem::thermalConductivity(fs, paramCache, phaseIdx); } catch (...) {};
+                
+        fs.allowComposition(!FluidSystem::isIdealMixture(phaseIdx));
+        for (int compIdx = 0; compIdx < numComponents; ++ compIdx) {
+            try { val = FluidSystem::fugacityCoefficient(fs, paramCache, phaseIdx, compIdx); } catch (...) {};
+            try { val = FluidSystem::diffusionCoefficient(fs, paramCache, phaseIdx, compIdx); } catch (...) {};
+            for (int comp2Idx = 0; comp2Idx < numComponents; ++ comp2Idx) {
+                try { val = FluidSystem::binaryDiffusionCoefficient(fs, paramCache, phaseIdx, compIdx, comp2Idx); } catch (...) {};
+            }
+        }
+    }
+
+    for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
+        std::string __attribute__((unused)) name = FluidSystem::phaseName(phaseIdx);
+        bool __attribute__((unused)) bVal = FluidSystem::isLiquid(phaseIdx);
+    }
+    
+    for (int compIdx = 0; compIdx < numComponents; ++ compIdx) {
+        val = FluidSystem::molarMass(compIdx);
+        std::string __attribute__((unused)) name = FluidSystem::componentName(compIdx);
+    }
+
+    std::cout << "----------------------------------\n";
+};
+
+#endif
diff --git a/test/material/fluidsystems/test_fluidsystems.cc b/test/material/fluidsystems/test_fluidsystems.cc
new file mode 100644
index 0000000000..e562cee95e
--- /dev/null
+++ b/test/material/fluidsystems/test_fluidsystems.cc
@@ -0,0 +1,79 @@
+/*****************************************************************************
+ *   Copyright (C) 2011 by Andreas Lauser                                    *
+ *   Institute of Hydraulic Engineering                                      *
+ *   University of Stuttgart, Germany                                        *
+ *   email: <givenname>.<name>@iws.uni-stuttgart.de                          *
+ *                                                                           *
+ *   This program is free software: you can redistribute it and/or modify    *
+ *   it under the terms of the GNU General Public License as published by    *
+ *   the Free Software Foundation, either version 2 of the License, or       *
+ *   (at your option) any later version.                                     *
+ *                                                                           *
+ *   This program is distributed in the hope that it will be useful,         *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
+ *   GNU General Public License for more details.                            *
+ *                                                                           *
+ *   You should have received a copy of the GNU General Public License       *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
+ *****************************************************************************/
+/*!
+ * \file
+ *
+ * \brief This test makes sure that the programming interface is
+ *        observed by all fluid systems
+ */
+#include "config.h"
+
+#include "checkfluidsystem.hh"
+
+// include all fluid systems in dumux-stable
+#include <test/boxmodels/1p2c/interstitialfluidtrailfluidsystem.hh>
+#include <dumux/material/fluidsystems/1pfluidsystem.hh>
+#include <dumux/material/fluidsystems/2pimmisciblefluidsystem.hh>
+#include <dumux/material/fluidsystems/h2on2fluidsystem.hh>
+#include <appl/lecture/msm/1p2cvs2p/watercontaminantfluidsystem.hh>
+
+int main()
+{
+    typedef double Scalar;
+    typedef Dumux::H2O<Scalar> H2O;
+    typedef Dumux::N2<Scalar> N2;
+
+    typedef Dumux::LiquidPhase<Scalar, H2O> Liquid;
+    typedef Dumux::GasPhase<Scalar, N2> Gas;
+
+    // H2O -- N2
+    {   typedef Dumux::FluidSystems::H2ON2<Scalar, /*enableComplexRelations=*/false> FluidSystem;
+        checkFluidSystem<Scalar, FluidSystem>(); }
+
+    {   typedef Dumux::FluidSystems::H2ON2<Scalar, /*enableComplexRelations=*/true> FluidSystem;
+        checkFluidSystem<Scalar, FluidSystem>(); }
+
+    // 2p-immiscible
+    {   typedef Dumux::FluidSystems::TwoPImmiscible<Scalar, Liquid, Liquid> FluidSystem;
+        checkFluidSystem<Scalar, FluidSystem>(); }
+
+    {   typedef Dumux::FluidSystems::TwoPImmiscible<Scalar, Liquid, Gas> FluidSystem;
+        checkFluidSystem<Scalar, FluidSystem>(); }
+
+    {  typedef Dumux::FluidSystems::TwoPImmiscible<Scalar, Gas, Liquid> FluidSystem;
+        checkFluidSystem<Scalar, FluidSystem>(); }
+
+    // 1p
+    {   typedef Dumux::FluidSystems::OneP<Scalar, Liquid> FluidSystem;
+        checkFluidSystem<Scalar, FluidSystem>(); }
+
+    {   typedef Dumux::FluidSystems::OneP<Scalar, Gas> FluidSystem;
+        checkFluidSystem<Scalar, FluidSystem>(); }
+
+    // water -- contaminant
+    {   typedef Dumux::FluidSystems::WaterContaminant<Scalar> FluidSystem;
+        checkFluidSystem<Scalar, FluidSystem>(); }
+
+    // interstitial fluid -- TRAIL
+    {   typedef Dumux::FluidSystems::WaterContaminant<Scalar> FluidSystem;
+        checkFluidSystem<Scalar, FluidSystem>(); }
+
+    return 0;
+}
diff --git a/test/material/ncpflash/CMakeLists.txt b/test/material/ncpflash/CMakeLists.txt
new file mode 100644
index 0000000000..6df5a763b3
--- /dev/null
+++ b/test/material/ncpflash/CMakeLists.txt
@@ -0,0 +1,8 @@
+# build target for the simple twophase lens problem
+ADD_EXECUTABLE("test_ncpflash" test_ncpflash.cc)
+TARGET_LINK_LIBRARIES("test_ncpflash" ${DumuxLinkLibraries})
+
+# add required libraries and includes to the build flags 
+LINK_DIRECTORIES(${DumuxLinkDirectories})
+INCLUDE_DIRECTORIES(${DumuxIncludeDirectories})
+
diff --git a/test/material/tabulation/CMakeLists.txt b/test/material/tabulation/CMakeLists.txt
new file mode 100644
index 0000000000..e4a35783b1
--- /dev/null
+++ b/test/material/tabulation/CMakeLists.txt
@@ -0,0 +1,8 @@
+# build target for the simple twophase lens problem
+ADD_EXECUTABLE("test_tabulation" test_tabulation.cc)
+TARGET_LINK_LIBRARIES("test_tabulation" ${DumuxLinkLibraries})
+
+# add required libraries and includes to the build flags 
+LINK_DIRECTORIES(${DumuxLinkDirectories})
+INCLUDE_DIRECTORIES(${DumuxIncludeDirectories})
+
-- 
GitLab