From ad7f616d73c2a888ab070cc31c70c9176aad31f4 Mon Sep 17 00:00:00 2001
From: Thomas Fetzer <thomas.fetzer@iws.uni-stuttgart.de>
Date: Tue, 23 Feb 2016 16:49:32 +0100
Subject: [PATCH] [fluidsystems][fluidstates][test] Fix interface for
 liquidphase and gasphase fluidsystem

---
 dumux/material/fluidsystems/gasphase.hh       | 196 ++++++++++++++++-
 dumux/material/fluidsystems/liquidphase.hh    | 196 ++++++++++++++++-
 .../material/fluidsystems/checkfluidsystem.hh |  24 ++-
 .../fluidsystems/test_fluidsystems.cc         | 197 ++++++++++++------
 4 files changed, 529 insertions(+), 84 deletions(-)

diff --git a/dumux/material/fluidsystems/gasphase.hh b/dumux/material/fluidsystems/gasphase.hh
index 5ad6d25462..0741baf8a2 100644
--- a/dumux/material/fluidsystems/gasphase.hh
+++ b/dumux/material/fluidsystems/gasphase.hh
@@ -24,18 +24,60 @@
 #ifndef DUMUX_GAS_PHASE_HH
 #define DUMUX_GAS_PHASE_HH
 
+#include <dune/common/deprecated.hh>
+#include <dune/common/exceptions.hh>
+
+#include <dumux/material/fluidsystems/base.hh>
+
 namespace Dumux
 {
 
+namespace FluidSystems
+{
+
 /*!
  * \ingroup Fluidsystems
- * \brief gaseous phase consisting of a single component
+ * \brief A gaseous phase consisting of a single component
  */
 template <class Scalar, class ComponentT>
 class GasPhase
+: public BaseFluidSystem<Scalar, GasPhase<Scalar, ComponentT> >
 {
+    typedef GasPhase<Scalar, ComponentT> ThisType;
+    typedef BaseFluidSystem <Scalar, ThisType> Base;
+
 public:
     typedef ComponentT Component;
+    typedef Dumux::NullParameterCache ParameterCache;
+
+    /****************************************
+     * Fluid phase related static parameters
+     ****************************************/
+    static const int numPhases = 1;
+    static const int numComponents = 1;
+
+    /*!
+     * \brief Initialize the fluid system's static parameters generically
+     */
+    static void init()
+    { }
+
+    /*!
+     * \brief Return the human readable name of a fluid phase
+     *
+     * \param phaseIdx The index of the fluid phase to consider
+     */
+    static const char *phaseName(int phaseIdx = 0)
+    { return Component::name(); }
+
+    /*!
+     * \brief A human readable name for the component.
+     *
+     * \param compIdx The index of the component to consider
+     */
+    static const char *componentName(int compIdx = 0)
+    { return Component::name(); }
+
     /*!
      * \brief A human readable name for the component.
      */
@@ -43,27 +85,44 @@ public:
     { return Component::name(); }
 
     /*!
-     * \brief Returs whether the fluid is a liquid
+     * \brief Returns whether the fluid is a liquid
      */
-    static bool isLiquid()
+    static bool isLiquid(int phaseIdx = 0)
     { return false; }
 
     /*!
-     * \brief Returns true iff the fluid is assumed to be compressible
+     * \brief Returns true if and only if a fluid phase is assumed to
+     *        be an ideal mixture.
+     *
+     * We define an ideal mixture as a fluid phase where the fugacity
+     * coefficients of all components times the pressure of the phase
+     * are indepent on the fluid composition. This assumtion is true
+     * if only a single component is involved. If you are unsure what
+     * this function should return, it is safe to return false. The
+     * only damage done will be (slightly) increased computation times
+     * in some cases.
+     *
+     * \param phaseIdx The index of the fluid phase to consider
+     */
+    static bool isIdealMixture(int phaseIdx = 0)
+    { return true; }
+
+    /*!
+     * \brief Returns true if the fluid is assumed to be compressible
      */
-    static bool isCompressible()
+    static bool isCompressible(int phaseIdx = 0)
     { return Component::gasIsCompressible(); }
 
     /*!
-     * \brief Returns true iff the fluid is assumed to be an ideal gas
+     * \brief Returns true if the fluid is assumed to be an ideal gas
      */
-    static bool isIdealGas()
+    static bool isIdealGas(int phaseIdx = 0)
     { return Component::gasIsIdeal(); }
 
     /*!
      * \brief The mass in \f$\mathrm{[kg]}\f$ of one mole of the component.
      */
-    static Scalar molarMass()
+    static Scalar molarMass(int compIdx = 0)
     {  return Component::molarMass(); }
 
     /*!
@@ -106,6 +165,18 @@ public:
     static Scalar density(Scalar temperature, Scalar pressure)
     {  return Component::gasDensity(temperature, pressure); }
 
+    /*!
+     * \brief The density \f$\mathrm{[kg/m^3]}\f$ of the component at a given pressure and temperature.
+     */
+    using Base::density;
+    template <class FluidState>
+    static Scalar density(const FluidState &fluidState,
+                          const int phaseIdx)
+    {
+        return density(fluidState.temperature(phaseIdx),
+                       fluidState.pressure(phaseIdx));
+    }
+
     /*!
      * \brief The pressure \f$\mathrm{[Pa]}\f$ of the component at a given density and temperature.
      * \param temperature The given temperature \f$\mathrm{[K]}\f$
@@ -122,6 +193,18 @@ public:
     static const Scalar enthalpy(Scalar temperature, Scalar pressure)
     {  return Component::gasEnthalpy(temperature, pressure); }
 
+    /*!
+     * \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ the pure component as a liquid.
+     */
+    using Base::enthalpy;
+    template <class FluidState>
+    static Scalar enthalpy(const FluidState &fluidState,
+                           const int phaseIdx)
+    {
+        return enthalpy(fluidState.temperature(phaseIdx),
+                        fluidState.pressure(phaseIdx));
+    }
+
     /*!
      * \brief Specific internal energy \f$\mathrm{[J/kg]}\f$ of the pure component as a gas.
      * \param temperature The given temperature \f$\mathrm{[K]}\f$
@@ -138,6 +221,65 @@ public:
     static Scalar viscosity(Scalar temperature, Scalar pressure)
     {  return Component::gasViscosity(temperature, pressure); }
 
+    /*!
+     * \brief The dynamic liquid viscosity \f$\mathrm{[N/m^3*s]}\f$ of the pure component.
+     */
+    using Base::viscosity;
+    template <class FluidState>
+    static Scalar viscosity(const FluidState &fluidState,
+                            const int phaseIdx)
+    {
+        return viscosity(fluidState.temperature(phaseIdx),
+                         fluidState.pressure(phaseIdx));
+    }
+
+    /*!
+     * \copydoc Base::fugacityCoefficient
+     */
+    using Base::fugacityCoefficient;
+    template <class FluidState>
+    static Scalar fugacityCoefficient(const FluidState &fluidState,
+                                      int phaseIdx,
+                                      int compIdx)
+    {
+        assert(0 <= phaseIdx  && phaseIdx < numPhases);
+        assert(0 <= compIdx  && compIdx < numComponents);
+
+        if (phaseIdx == compIdx)
+            // We could calculate the real fugacity coefficient of
+            // the component in the fluid. Probably that's not worth
+            // the effort, since the fugacity coefficient of the other
+            // component is infinite anyway...
+            return 1.0;
+        return std::numeric_limits<Scalar>::infinity();
+    }
+
+    /*!
+     * \copydoc Base::diffusionCoefficient
+     */
+    using Base::diffusionCoefficient;
+    template <class FluidState>
+    static Scalar diffusionCoefficient(const FluidState &fluidState,
+                                       int phaseIdx,
+                                       int compIdx)
+    {
+        DUNE_THROW(Dune::InvalidStateException, "Not applicable: Diffusion coefficients");
+    }
+
+    /*!
+     * \copydoc Base::binaryDiffusionCoefficient
+     */
+    using Base::binaryDiffusionCoefficient;
+    template <class FluidState>
+    static Scalar binaryDiffusionCoefficient(const FluidState &fluidState,
+                                             int phaseIdx,
+                                             int compIIdx,
+                                             int compJIdx)
+
+    {
+        DUNE_THROW(Dune::InvalidStateException, "Not applicable: Binary diffusion coefficients");
+    }
+
     /*!
      * \brief Thermal conductivity of the fluid \f$\mathrm{[W/(m K)]}\f$.
      * \param temperature The given temperature \f$\mathrm{[K]}\f$
@@ -146,6 +288,18 @@ public:
     static Scalar thermalConductivity(Scalar temperature, Scalar pressure)
     { return Component::gasThermalConductivity(temperature, pressure); }
 
+    /*!
+     * \brief Thermal conductivity of the fluid \f$\mathrm{[W/(m K)]}\f$.
+     */
+    using Base::thermalConductivity;
+    template <class FluidState>
+    static Scalar thermalConductivity(const FluidState &fluidState,
+                                      const int phaseIdx)
+    {
+        return thermalConductivity(fluidState.temperature(phaseIdx),
+                                   fluidState.pressure(phaseIdx));
+    }
+
     /*!
      * \brief Specific isobaric heat capacity of the fluid \f$\mathrm{[J/(kg K)]}\f$.
      * \param temperature The given temperature \f$\mathrm{[K]}\f$
@@ -153,7 +307,33 @@ public:
      */
     static Scalar heatCapacity(Scalar temperature, Scalar pressure)
     { return Component::gasHeatCapacity(temperature, pressure); }
+
+    /*!
+     * \brief Specific isobaric heat capacity of the fluid \f$\mathrm{[J/(kg K)]}\f$.
+     */
+    using Base::heatCapacity;
+    template <class FluidState>
+    static Scalar heatCapacity(const FluidState &fluidState,
+                               const int phaseIdx)
+    {
+        return heatCapacity(fluidState.temperature(phaseIdx),
+                            fluidState.pressure(phaseIdx));
+    }
 };
+
+} // namespace FluidSystems
+
+/*!
+ * \ingroup Fluidsystems
+ * \brief A gaseous phase consisting of a single component
+ */
+template <class Scalar, class ComponentT>
+class
+DUNE_DEPRECATED_MSG("Class Dumux::GasPhase is deprecated. Use Dumux::FluidSystems::GasPhase instead.")
+GasPhase
+: public FluidSystems::GasPhase<Scalar, ComponentT>
+{ };
+
 } // namespace
 
 #endif
diff --git a/dumux/material/fluidsystems/liquidphase.hh b/dumux/material/fluidsystems/liquidphase.hh
index c80bb061b5..a8033a8b2e 100644
--- a/dumux/material/fluidsystems/liquidphase.hh
+++ b/dumux/material/fluidsystems/liquidphase.hh
@@ -24,47 +24,104 @@
 #ifndef DUMUX_LIQUID_PHASE_HH
 #define DUMUX_LIQUID_PHASE_HH
 
+#include <dune/common/deprecated.hh>
+#include <dune/common/exceptions.hh>
+
+#include <dumux/material/fluidsystems/base.hh>
+
 namespace Dumux
 {
+namespace FluidSystems
+{
 
 /*!
  * \ingroup Fluidsystems
- * \brief liquid phase consisting of a single component
+ * \brief A liquid phase consisting of a single component
  */
 template <class Scalar, class ComponentT>
 class LiquidPhase
+: public BaseFluidSystem<Scalar, LiquidPhase<Scalar, ComponentT> >
 {
+    typedef LiquidPhase<Scalar, ComponentT> ThisType;
+    typedef BaseFluidSystem <Scalar, ThisType> Base;
+
 public:
     typedef ComponentT Component;
+    typedef Dumux::NullParameterCache ParameterCache;
+
+    /****************************************
+     * Fluid phase related static parameters
+     ****************************************/
+    static const int numPhases = 1;
+    static const int numComponents = 1;
+
+    /*!
+     * \brief Initialize the fluid system's static parameters generically
+     */
+    static void init()
+    { }
 
     /*!
-     * \brief A human readable name for the compoent.
+     * \brief Return the human readable name of a fluid phase
+     *
+     * \param phaseIdx The index of the fluid phase to consider
+     */
+    static const char *phaseName(int phaseIdx = 0)
+    { return Component::name(); }
+
+    /*!
+     * \brief A human readable name for the component.
+     *
+     * \param compIdx The index of the component to consider
+     */
+    static const char *componentName(int compIdx = 0)
+    { return Component::name(); }
+
+    /*!
+     * \brief A human readable name for the component.
      */
     static const char *name()
     { return Component::name(); }
 
     /*!
-     * \brief Returs whether the fluid is a liquid
+     * \brief Returns whether the fluid is a liquid
      */
-    static bool isLiquid()
+    static bool isLiquid(int phaseIdx = 0)
     { return true; }
 
     /*!
-     * \brief Returns true iff the fluid is assumed to be compressible
+     * \brief Returns true if and only if a fluid phase is assumed to
+     *        be an ideal mixture.
+     *
+     * We define an ideal mixture as a fluid phase where the fugacity
+     * coefficients of all components times the pressure of the phase
+     * are indepent on the fluid composition. This assumtion is true
+     * if only a single component is involved. If you are unsure what
+     * this function should return, it is safe to return false. The
+     * only damage done will be (slightly) increased computation times
+     * in some cases.
+     *
+     * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isCompressible()
+    static bool isIdealMixture(int phaseIdx = 0)
+    { return true; }
+
+    /*!
+     * \brief Returns true if the fluid is assumed to be compressible
+     */
+    static bool isCompressible(int phaseIdx = 0)
     { return Component::liquidIsCompressible(); }
 
     /*!
-     * \brief Returns true iff the fluid is assumed to be an ideal gas
+     * \brief Returns true if the fluid is assumed to be an ideal gas
      */
-    static bool isIdealGas()
+    static bool isIdealGas(int phaseIdx = 0)
     { return false; /* we're a liquid! */ }
 
     /*!
      * \brief The mass in \f$\mathrm{[kg]}\f$ of one mole of the component.
      */
-    static Scalar molarMass()
+    static Scalar molarMass(int compIdx = 0)
     {  return Component::molarMass(); }
 
     /*!
@@ -104,6 +161,18 @@ public:
     static Scalar density(Scalar temperature, Scalar pressure)
     {  return Component::liquidDensity(temperature, pressure); }
 
+    /*!
+     * \brief The density \f$\mathrm{[kg/m^3]}\f$ of the component at a given pressure and temperature.
+     */
+    using Base::density;
+    template <class FluidState>
+    static Scalar density(const FluidState &fluidState,
+                          const int phaseIdx)
+    {
+        return density(fluidState.temperature(phaseIdx),
+                       fluidState.pressure(phaseIdx));
+    }
+
     /*!
      * \brief The pressure \f$\mathrm{[Pa]}\f$ of the component at a given density and temperature.
      */
@@ -116,6 +185,18 @@ public:
     static const Scalar enthalpy(Scalar temperature, Scalar pressure)
     {  return Component::liquidEnthalpy(temperature, pressure); }
 
+    /*!
+     * \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ the pure component as a liquid.
+     */
+    using Base::enthalpy;
+    template <class FluidState>
+    static Scalar enthalpy(const FluidState &fluidState,
+                           const int phaseIdx)
+    {
+        return enthalpy(fluidState.temperature(phaseIdx),
+                        fluidState.pressure(phaseIdx));
+    }
+
     /*!
      * \brief Specific internal energy \f$\mathrm{[J/kg]}\f$ the pure component as a liquid.
      */
@@ -128,18 +209,115 @@ public:
     static Scalar viscosity(Scalar temperature, Scalar pressure)
     {  return Component::liquidViscosity(temperature, pressure); }
 
+    /*!
+     * \brief The dynamic liquid viscosity \f$\mathrm{[N/m^3*s]}\f$ of the pure component.
+     */
+    using Base::viscosity;
+    template <class FluidState>
+    static Scalar viscosity(const FluidState &fluidState,
+                            const int phaseIdx)
+    {
+        return viscosity(fluidState.temperature(phaseIdx),
+                         fluidState.pressure(phaseIdx));
+    }
+
+    /*!
+     * \copydoc Base::fugacityCoefficient
+     */
+    using Base::fugacityCoefficient;
+    template <class FluidState>
+    static Scalar fugacityCoefficient(const FluidState &fluidState,
+                                      int phaseIdx,
+                                      int compIdx)
+    {
+        assert(0 <= phaseIdx  && phaseIdx < numPhases);
+        assert(0 <= compIdx  && compIdx < numComponents);
+
+        if (phaseIdx == compIdx)
+            // We could calculate the real fugacity coefficient of
+            // the component in the fluid. Probably that's not worth
+            // the effort, since the fugacity coefficient of the other
+            // component is infinite anyway...
+            return 1.0;
+        return std::numeric_limits<Scalar>::infinity();
+    }
+
+    /*!
+     * \copydoc Base::diffusionCoefficient
+     */
+    using Base::diffusionCoefficient;
+    template <class FluidState>
+    static Scalar diffusionCoefficient(const FluidState &fluidState,
+                                       int phaseIdx,
+                                       int compIdx)
+    {
+        DUNE_THROW(Dune::InvalidStateException, "Not applicable: Diffusion coefficients");
+    }
+
+    /*!
+     * \copydoc Base::binaryDiffusionCoefficient
+     */
+    using Base::binaryDiffusionCoefficient;
+    template <class FluidState>
+    static Scalar binaryDiffusionCoefficient(const FluidState &fluidState,
+                                             int phaseIdx,
+                                             int compIIdx,
+                                             int compJIdx)
+
+    {
+        DUNE_THROW(Dune::InvalidStateException, "Not applicable: Binary diffusion coefficients");
+    }
+
     /*!
      * \brief Thermal conductivity of the fluid \f$\mathrm{[W/(m K)]}\f$.
      */
     static Scalar thermalConductivity(Scalar temperature, Scalar pressure)
     { return Component::liquidThermalConductivity(temperature, pressure); }
 
+    /*!
+     * \brief Thermal conductivity of the fluid \f$\mathrm{[W/(m K)]}\f$.
+     */
+    using Base::thermalConductivity;
+    template <class FluidState>
+    static Scalar thermalConductivity(const FluidState &fluidState,
+                                      const int phaseIdx)
+    {
+        return thermalConductivity(fluidState.temperature(phaseIdx),
+                                   fluidState.pressure(phaseIdx));
+    }
+
     /*!
      * \brief Specific isobaric heat capacity of the fluid \f$\mathrm{[J/(kg K)]}\f$.
      */
     static Scalar heatCapacity(Scalar temperature, Scalar pressure)
     { return Component::liquidHeatCapacity(temperature, pressure); }
+
+    /*!
+     * \brief Specific isobaric heat capacity of the fluid \f$\mathrm{[J/(kg K)]}\f$.
+     */
+    using Base::heatCapacity;
+    template <class FluidState>
+    static Scalar heatCapacity(const FluidState &fluidState,
+                               const int phaseIdx)
+    {
+        return heatCapacity(fluidState.temperature(phaseIdx),
+                            fluidState.pressure(phaseIdx));
+    }
 };
+
+} // namespace FluidSystems
+
+/*!
+ * \ingroup Fluidsystems
+ * \brief A liquid phase consisting of a single component
+ */
+template <class Scalar, class ComponentT>
+class
+DUNE_DEPRECATED_MSG("Class Dumux::LiquidPhase is deprecated. Use Dumux::FluidSystems::LiquidPhase instead.")
+LiquidPhase
+: public FluidSystems::LiquidPhase<Scalar, ComponentT>
+{ };
+
 } // namespace
 
 #endif
diff --git a/test/material/fluidsystems/checkfluidsystem.hh b/test/material/fluidsystems/checkfluidsystem.hh
index 69eed49c8e..312428a2a0 100644
--- a/test/material/fluidsystems/checkfluidsystem.hh
+++ b/test/material/fluidsystems/checkfluidsystem.hh
@@ -33,21 +33,33 @@
 // include all fluid systems in dumux-stable
 #include <dumux/material/fluidsystems/1p.hh>
 #include <dumux/material/fluidsystems/2pimmiscible.hh>
-#include <dumux/material/fluidsystems/h2on2.hh>
-#include <dumux/material/fluidsystems/h2on2liquidphase.hh>
+#include <dumux/material/fluidsystems/base.hh>
+#include <dumux/material/fluidsystems/brineair.hh>
+#include <dumux/material/fluidsystems/brineco2.hh>
+#include <dumux/material/fluidsystems/gasphase.hh>
 #include <dumux/material/fluidsystems/h2oair.hh>
 #include <dumux/material/fluidsystems/h2oairmesitylene.hh>
 #include <dumux/material/fluidsystems/h2oairxylene.hh>
+#include <dumux/material/fluidsystems/h2on2.hh>
+#include <dumux/material/fluidsystems/h2on2kinetic.hh>
+#include <dumux/material/fluidsystems/h2on2liquidphase.hh>
+#include <dumux/material/fluidsystems/h2on2o2.hh>
+#include <dumux/material/fluidsystems/liquidphase.hh>
+#include <dumux/material/fluidsystems/purewatersimple.hh>
 #include <dumux/material/fluidsystems/spe5.hh>
 
 // include all fluid states
-#include <dumux/material/fluidstates/pressureoverlay.hh>
-#include <dumux/material/fluidstates/saturationoverlay.hh>
-#include <dumux/material/fluidstates/temperatureoverlay.hh>
+#include <dumux/material/fluidstates/2p2c.hh>
 #include <dumux/material/fluidstates/compositional.hh>
-#include <dumux/material/fluidstates/nonequilibrium.hh>
 #include <dumux/material/fluidstates/immiscible.hh>
 #include <dumux/material/fluidstates/isothermalimmiscible.hh>
+#include <dumux/material/fluidstates/nonequilibrium.hh>
+#include <dumux/material/fluidstates/nonequilibriumenergy.hh>
+#include <dumux/material/fluidstates/nonequilibriummass.hh>
+#include <dumux/material/fluidstates/pressureoverlay.hh>
+#include <dumux/material/fluidstates/pseudo1p2c.hh>
+#include <dumux/material/fluidstates/saturationoverlay.hh>
+#include <dumux/material/fluidstates/temperatureoverlay.hh>
 
 namespace Dumux
 {
diff --git a/test/material/fluidsystems/test_fluidsystems.cc b/test/material/fluidsystems/test_fluidsystems.cc
index 3f8641d91c..5c9acc6b09 100644
--- a/test/material/fluidsystems/test_fluidsystems.cc
+++ b/test/material/fluidsystems/test_fluidsystems.cc
@@ -33,19 +33,33 @@
 // include all fluid systems in dumux-stable
 #include <dumux/material/fluidsystems/1p.hh>
 #include <dumux/material/fluidsystems/2pimmiscible.hh>
-#include <dumux/material/fluidsystems/h2on2.hh>
-#include <dumux/material/fluidsystems/h2on2liquidphase.hh>
+#include <dumux/material/fluidsystems/base.hh>
+#include <dumux/material/fluidsystems/brineair.hh>
+#include <dumux/material/fluidsystems/brineco2.hh>
+#include <dumux/material/fluidsystems/gasphase.hh>
 #include <dumux/material/fluidsystems/h2oair.hh>
 #include <dumux/material/fluidsystems/h2oairmesitylene.hh>
 #include <dumux/material/fluidsystems/h2oairxylene.hh>
+#include <dumux/material/fluidsystems/h2on2.hh>
+#include <dumux/material/fluidsystems/h2on2kinetic.hh>
+#include <dumux/material/fluidsystems/h2on2liquidphase.hh>
+#include <dumux/material/fluidsystems/h2on2o2.hh>
+#include <dumux/material/fluidsystems/liquidphase.hh>
+#include <dumux/material/fluidsystems/purewatersimple.hh>
+#include <dumux/material/fluidsystems/spe5.hh>
 
 // include all fluid states
+#include <dumux/material/fluidstates/2p2c.hh>
+#include <dumux/material/fluidstates/compositional.hh>
+#include <dumux/material/fluidstates/immiscible.hh>
+#include <dumux/material/fluidstates/isothermalimmiscible.hh>
+#include <dumux/material/fluidstates/nonequilibrium.hh>
+#include <dumux/material/fluidstates/nonequilibriumenergy.hh>
+#include <dumux/material/fluidstates/nonequilibriummass.hh>
 #include <dumux/material/fluidstates/pressureoverlay.hh>
+#include <dumux/material/fluidstates/pseudo1p2c.hh>
 #include <dumux/material/fluidstates/saturationoverlay.hh>
 #include <dumux/material/fluidstates/temperatureoverlay.hh>
-#include <dumux/material/fluidstates/compositional.hh>
-#include <dumux/material/fluidstates/nonequilibrium.hh>
-#include <dumux/material/fluidstates/immiscible.hh>
 
 int main()
 {
@@ -56,98 +70,136 @@ int main()
     typedef Dumux::LiquidPhase<Scalar, H2O> Liquid;
     typedef Dumux::GasPhase<Scalar, N2> Gas;
 
+    std::string collectedExceptions;
+
+    /////////////////////////
     // check all fluid states
     {
         typedef Dumux::FluidSystems::H2ON2<Scalar, /*enableComplexRelations=*/false> FluidSystem;
+        typedef Dumux::CompositionalFluidState<Scalar, FluidSystem> BaseFluidState;
+        BaseFluidState baseFs;
+
+        // TwoPTwoCFluidState uses TypeTag
 
         // CompositionalFluidState
-        {   Dumux::CompositionalFluidState<Scalar, FluidSystem> fs;
-            std::string collectedExceptions = Dumux::checkFluidState<Scalar>(fs);
-            if (!collectedExceptions.empty()){
-                std::cout<<"Dumux::CompositionalFluidState: \n"<<collectedExceptions<<"\n";
-            }}
+        Dumux::CompositionalFluidState<Scalar, FluidSystem> compositionalFluidState;
+        collectedExceptions = Dumux::checkFluidState<Scalar>(compositionalFluidState);
+        if (!collectedExceptions.empty())
+        {
+            std::cout<<"Dumux::CompositionalFluidState: \n"<<collectedExceptions<<"\n";
+        }
 
-        // NonEquilibriumFluidState
-        {   Dumux::NonEquilibriumFluidState<Scalar, FluidSystem> fs;
-            std::string collectedExceptions = Dumux::checkFluidState<Scalar>(fs);
-            if (!collectedExceptions.empty()){
-                std::cout<<"Dumux::NonEquilibriumFluidState: \n"<<collectedExceptions<<"\n";
-            }}
 
         // ImmiscibleFluidState
-        {   Dumux::ImmiscibleFluidState<Scalar, FluidSystem> fs;
-            std::string collectedExceptions = Dumux::checkFluidState<Scalar>(fs);
-            if (!collectedExceptions.empty()){
-                std::cout<<"Dumux::ImmiscibleFluidState: \n"<<collectedExceptions<<"\n";
-            }}
+        Dumux::ImmiscibleFluidState<Scalar, FluidSystem> immiscibleFluidState;
+        collectedExceptions = Dumux::checkFluidState<Scalar>(immiscibleFluidState);
+        if (!collectedExceptions.empty())
+        {
+            std::cout<<"Dumux::ImmiscibleFluidState: \n"<<collectedExceptions<<"\n";
+        }
+
 
         // IsothermalImmiscibleFluidState
-        {   Dumux::IsothermalImmiscibleFluidState<Scalar, FluidSystem> fs;
-            std::string collectedExceptions = Dumux::checkFluidState<Scalar>(fs);
-            if (!collectedExceptions.empty()){
-                std::cout<<"Dumux::IsothermalImmiscibleFluidState: \n"<<collectedExceptions<<"\n";
-            }}
+        Dumux::IsothermalImmiscibleFluidState<Scalar, FluidSystem> isothermalImmiscibleFluidState;
+        collectedExceptions = Dumux::checkFluidState<Scalar>(isothermalImmiscibleFluidState);
+        if (!collectedExceptions.empty())
+        {
+              std::cout<<"Dumux::IsothermalImmiscibleFluidState: \n"<<collectedExceptions<<"\n";
+        }
 
-        typedef Dumux::CompositionalFluidState<Scalar, FluidSystem> BaseFluidState;
-        BaseFluidState baseFs;
+        // NonEquilibriumFluidState
+        Dumux::NonEquilibriumFluidState<Scalar, FluidSystem> nonEquilibriumFluidState;
+        collectedExceptions = Dumux::checkFluidState<Scalar>(nonEquilibriumFluidState);
+        if (!collectedExceptions.empty())
+        {
+            std::cout<<"Dumux::NonEquilibriumFluidState: \n"<<collectedExceptions<<"\n";
+        }
 
-        // TemperatureOverlayFluidState
-        {   Dumux::TemperatureOverlayFluidState<Scalar, BaseFluidState> fs(baseFs);
-            std::string collectedExceptions = Dumux::checkFluidState<Scalar>(fs);
-            if (!collectedExceptions.empty()){
-                std::cout<<"Dumux::TemperatureOverlayFluidState: \n"<<collectedExceptions<<"\n";
-            } }
+        // NonEquilibriumEnergyFluidState uses TypeTag
+
+        // NonEquilibriumMassFluidState uses TypeTag
 
         // PressureOverlayFluidState
-        {   Dumux::PressureOverlayFluidState<Scalar, BaseFluidState> fs(baseFs);
-            std::string collectedExceptions = Dumux::checkFluidState<Scalar>(fs);
-            if (!collectedExceptions.empty()){
-                std::cout<<"Dumux::PressureOverlayFluidState: \n"<<collectedExceptions<<"\n";
-            }}
+        Dumux::PressureOverlayFluidState<Scalar, BaseFluidState> pressureOverlayFluidState(baseFs);
+        collectedExceptions = Dumux::checkFluidState<Scalar>(pressureOverlayFluidState);
+        if (!collectedExceptions.empty())
+        {
+            std::cout<<"Dumux::PressureOverlayFluidState: \n"<<collectedExceptions<<"\n";
+        }
 
         // SaturationOverlayFluidState
-        {   Dumux::SaturationOverlayFluidState<Scalar, BaseFluidState> fs(baseFs);
-            std::string collectedExceptions = Dumux::checkFluidState<Scalar>(fs);
-            if (!collectedExceptions.empty()){
-                std::cout<<"Dumux::SaturationOverlayFluidState: \n"<<collectedExceptions<<"\n";
-            }}
+        Dumux::SaturationOverlayFluidState<Scalar, BaseFluidState> saturationOverlayFluidState(baseFs);
+        collectedExceptions = Dumux::checkFluidState<Scalar>(saturationOverlayFluidState);
+        if (!collectedExceptions.empty())
+        {
+            std::cout<<"Dumux::SaturationOverlayFluidState: \n"<<collectedExceptions<<"\n";
+        }
+
+        // TemperatureOverlayFluidState
+        Dumux::TemperatureOverlayFluidState<Scalar, BaseFluidState> temperatureOverlayFluidState(baseFs);
+        collectedExceptions = Dumux::checkFluidState<Scalar>(temperatureOverlayFluidState);
+        if (!collectedExceptions.empty())
+        {
+            std::cout<<"Dumux::TemperatureOverlayFluidState: \n"<<collectedExceptions<<"\n";
+        }
     }
 
-    // H2O -- N2
-    {   typedef Dumux::FluidSystems::H2ON2<Scalar, /*enableComplexRelations=*/false> FluidSystem;
+
+    //////////////////////////
+    // check all fluid systems
+
+    // 1p
+    {   typedef Dumux::FluidSystems::OneP<Scalar, Liquid> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    {   typedef Dumux::FluidSystems::OneP<Scalar, Gas> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
 
-    {   typedef Dumux::FluidSystems::H2ON2<Scalar, /*enableComplexRelations=*/true> FluidSystem;
+    // 2p-immiscible
+    {   typedef Dumux::FluidSystems::TwoPImmiscible<Scalar, Liquid, Liquid> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    {   typedef Dumux::FluidSystems::TwoPImmiscible<Scalar, Liquid, Gas> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    {  typedef Dumux::FluidSystems::TwoPImmiscible<Scalar, Gas, Liquid> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
 
-    // H2O -- N2 -- liquid phase
-    {   typedef Dumux::FluidSystems::H2ON2LiquidPhase<Scalar, /*enableComplexRelations=*/false> FluidSystem;
+    // base
+
+    // Brine -- Air
+    {   typedef Dumux::Brine<Scalar> Brine;
+        const bool enableComplexRelations=false;
+        typedef Dumux::FluidSystems::BrineAir<Scalar, H2O, enableComplexRelations> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    {   typedef Dumux::Brine<Scalar> Brine;
+        const bool enableComplexRelations=true;
+        typedef Dumux::FluidSystems::BrineAir<Scalar, H2O, enableComplexRelations> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
 
-    {   typedef Dumux::FluidSystems::H2ON2LiquidPhase<Scalar, /*enableComplexRelations=*/true> FluidSystem;
-         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    // Brine -- CO2
 
     // H2O -- Air
     {   typedef Dumux::SimpleH2O<Scalar> H2O;
         const bool enableComplexRelations=false;
         typedef Dumux::FluidSystems::H2OAir<Scalar, H2O, enableComplexRelations> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
-
     {   typedef Dumux::SimpleH2O<Scalar> H2O;
         const bool enableComplexRelations=true;
         typedef Dumux::FluidSystems::H2OAir<Scalar, H2O, enableComplexRelations> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
-
     {   typedef Dumux::H2O<Scalar> H2O;
         const bool enableComplexRelations=false;
         typedef Dumux::FluidSystems::H2OAir<Scalar, H2O, enableComplexRelations> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
-
     {   typedef Dumux::H2O<Scalar> H2O;
         const bool enableComplexRelations=true;
         typedef Dumux::FluidSystems::H2OAir<Scalar, H2O, enableComplexRelations> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
 
+    // gas phase
+    {   typedef Dumux::GasPhase<Scalar, H2O> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    {   typedef Dumux::FluidSystems::GasPhase<Scalar, H2O> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+
     // H2O -- Air -- Mesitylene
     {   typedef Dumux::FluidSystems::H2OAirMesitylene<Scalar> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
@@ -156,21 +208,44 @@ int main()
     {   typedef Dumux::FluidSystems::H2OAirXylene<Scalar> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
 
-    // 2p-immiscible
-    {   typedef Dumux::FluidSystems::TwoPImmiscible<Scalar, Liquid, Liquid> FluidSystem;
+    // H2O -- N2
+    {   typedef Dumux::FluidSystems::H2ON2<Scalar, /*enableComplexRelations=*/false> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    {   typedef Dumux::FluidSystems::H2ON2<Scalar, /*enableComplexRelations=*/true> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
 
-    {   typedef Dumux::FluidSystems::TwoPImmiscible<Scalar, Liquid, Gas> FluidSystem;
+    // H2O -- N2 -- kinetic
+    {   typedef Dumux::FluidSystems::H2ON2Kinetic<Scalar, /*enableComplexRelations=*/false> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    {   typedef Dumux::FluidSystems::H2ON2Kinetic<Scalar, /*enableComplexRelations=*/true> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
 
-    {  typedef Dumux::FluidSystems::TwoPImmiscible<Scalar, Gas, Liquid> FluidSystem;
+    // H2O -- N2 -- liquid phase
+    {   typedef Dumux::FluidSystems::H2ON2LiquidPhase<Scalar, /*enableComplexRelations=*/false> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    {   typedef Dumux::FluidSystems::H2ON2LiquidPhase<Scalar, /*enableComplexRelations=*/true> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
 
-    // 1p
-    {   typedef Dumux::FluidSystems::OneP<Scalar, Liquid> FluidSystem;
+    // H2O -- N2 -- o2
+    {   typedef Dumux::FluidSystems::H2ON2O2<Scalar, /*enableComplexRelations=*/false> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    {   typedef Dumux::FluidSystems::H2ON2O2<Scalar, /*enableComplexRelations=*/true> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
 
-    {   typedef Dumux::FluidSystems::OneP<Scalar, Gas> FluidSystem;
+    // liquid phase
+    {   typedef Dumux::LiquidPhase<Scalar, H2O> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    {   typedef Dumux::FluidSystems::LiquidPhase<Scalar, H2O> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+
+    // pure water simple
+    {   typedef Dumux::FluidSystems::PureWaterSimpleFluidSystem<Scalar, /*enableComplexRelations=*/false> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+    {   typedef Dumux::FluidSystems::PureWaterSimpleFluidSystem<Scalar, /*enableComplexRelations=*/true> FluidSystem;
+        Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
+
+    // spe5
+    {   typedef Dumux::FluidSystems::Spe5<Scalar> FluidSystem;
         Dumux::checkFluidSystem<Scalar, FluidSystem>(); }
 
     return 0;
-- 
GitLab