From 407309d946c1a9cac94292fadbea410373548faf Mon Sep 17 00:00:00 2001
From: Andreas Lauser <and@poware.org>
Date: Mon, 26 Sep 2011 15:19:37 +0000
Subject: [PATCH] MpNc box model: remove unnecessary fluid systems

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@6665 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 .../MpNc/diffusion/volumevariables.hh         |  18 +-
 .../basicmutableparameters.hh                 |  97 ---
 .../new_fluidsystems/h2oh2n2o2fluidsystem.hh  | 557 ------------------
 .../new_fluidsystems/h2on2fluidsystem.hh      | 105 +++-
 .../new_fluidsystems/spe5fluidsystem.hh       | 347 -----------
 5 files changed, 83 insertions(+), 1041 deletions(-)
 delete mode 100644 dumux/material/new_fluidsystems/basicmutableparameters.hh
 delete mode 100644 dumux/material/new_fluidsystems/h2oh2n2o2fluidsystem.hh
 delete mode 100644 dumux/material/new_fluidsystems/spe5fluidsystem.hh

diff --git a/dumux/boxmodels/MpNc/diffusion/volumevariables.hh b/dumux/boxmodels/MpNc/diffusion/volumevariables.hh
index 2056a66a34..096724bc9b 100644
--- a/dumux/boxmodels/MpNc/diffusion/volumevariables.hh
+++ b/dumux/boxmodels/MpNc/diffusion/volumevariables.hh
@@ -62,10 +62,10 @@ public:
         diffCoeffL_[0] = 0.0;
         for (int compIdx = 1; compIdx < numComponents; ++compIdx) {
             diffCoeffL_[compIdx] =
-                FluidSystem::binaryDiffCoeff(mutParams,
-                                             lPhaseIdx,
-                                             0,
-                                             compIdx);
+                FluidSystem::computeBinaryDiffCoeff(mutParams,
+                                                    lPhaseIdx,
+                                                    0,
+                                                    compIdx);
         }
         Valgrind::CheckDefined(diffCoeffL_);
 
@@ -74,11 +74,11 @@ public:
             diffCoeffG_[compIIdx][compIIdx] = 0;
             for (int compJIdx = compIIdx + 1; compJIdx < numComponents; ++compJIdx) {
                 diffCoeffG_[compIIdx][compJIdx] =
-                    FluidSystem::binaryDiffCoeff(mutParams,
-                                                 gPhaseIdx,
-                                                 compIIdx,
-                                                 compJIdx);
-
+                    FluidSystem::computeBinaryDiffCoeff(mutParams,
+                                                        gPhaseIdx,
+                                                        compIIdx,
+                                                        compJIdx);
+                
                 // fill the symmetric part of the diffusion coefficent
                 // matrix
                 diffCoeffG_[compJIdx][compIIdx] = diffCoeffG_[compIIdx][compJIdx];
diff --git a/dumux/material/new_fluidsystems/basicmutableparameters.hh b/dumux/material/new_fluidsystems/basicmutableparameters.hh
deleted file mode 100644
index d2a6adb203..0000000000
--- a/dumux/material/new_fluidsystems/basicmutableparameters.hh
+++ /dev/null
@@ -1,97 +0,0 @@
-/*****************************************************************************
- *   Copyright (C) 2009-2010 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 Specifies the basic API for mutable parameter objects.
- *
- * Fluid systems which do not need any complicated mixture parameters
- * just need this class to be happy.
- */
-#ifndef BASIC_MUTABLE_PARAMETERS_HH
-#define BASIC_MUTABLE_PARAMETERS_HH
-
-#include <dumux/material/fluidstates/genericfluidstate.hh>
-#include <assert.h>
-
-namespace Dumux
-{
-/*!
- * \brief Specifies the basic API for mutable parameter objects.
- *
- * Fluid systems which do not need any complicated mixture parameters
- * just need this class to be happy.
- */
-template <class Scalar,
-          class StaticParams,
-          class FluidStateT = GenericFluidState<Scalar, StaticParams> >
-class BasicMutableParameters
-{
-    enum { numPhases = StaticParams::numPhases };
-    enum { numComponents = StaticParams::numComponents };
-
-public:
-    /*!
-     * \brief The type of fluid state objects.
-     */
-    typedef FluidStateT FluidState;
-
-    /*!
-     * \brief Returns the fluid state for which the parameter object
-     *        is valid.
-     */
-    FluidState &fluidState() 
-    { return fluidState_; }
-
-    /*!
-     * \brief Returns the fluid state for which the parameter object
-     *        is valid.
-     */
-    const FluidState &fluidState()  const
-    { return fluidState_; }
-
-    /*!
-     * \brief Update all parameters of a phase which only depend on 
-     *        temperature and/or pressure.
-     *
-     * This usually means the parameters for the pure components.
-     */
-    void updatePure(int phaseIdx)
-    { }
-
-    /*!
-     * \brief Update all parameters of a phase which depend on the
-     *        fluid composition. It is assumed that updatePure() has
-     *        been called before this method.
-     *
-     * Here, the mixing rule kicks in.
-     */
-    void updateMix(int phaseIdx)
-    {
-        fluidState_.updateMeanMolarMass(phaseIdx);
-    };
-  
-private:
-    FluidState fluidState_;
-};
-
-} // end namespace Dumux
-
-#endif
diff --git a/dumux/material/new_fluidsystems/h2oh2n2o2fluidsystem.hh b/dumux/material/new_fluidsystems/h2oh2n2o2fluidsystem.hh
deleted file mode 100644
index 8439512952..0000000000
--- a/dumux/material/new_fluidsystems/h2oh2n2o2fluidsystem.hh
+++ /dev/null
@@ -1,557 +0,0 @@
-/*****************************************************************************
- *   Copyright (C) 2009-2010 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 A twophase fluid system with water and nitrogen as components.
- */
-#ifndef DUMUX_H2O_H2_N2_O2_FLUID_SYSTEM_HH
-#define DUMUX_H2O_H2_N2_O2_FLUID_SYSTEM_HH
-
-#include <dumux/material/fluidstates/genericfluidstate.hh>
-
-#include <dumux/material/components/simpleh2o.hh>
-#include <dumux/material/components/h2o.hh>
-#include <dumux/material/components/h2.hh>
-#include <dumux/material/components/n2.hh>
-#include <dumux/material/components/o2.hh>
-#include <dumux/material/components/tabulatedcomponent.hh>
-#include <dumux/material/idealgas.hh>
-
-#include <dumux/material/binarycoefficients/h2o_h2.hh>
-#include <dumux/material/binarycoefficients/h2o_n2.hh>
-#include <dumux/material/binarycoefficients/h2o_o2.hh>
-#include <dumux/material/binarycoefficients/h2_n2.hh>
-#include <dumux/material/binarycoefficients/h2_o2.hh>
-#include <dumux/material/binarycoefficients/n2_o2.hh>
-
-#include <dumux/material/fluidstates/genericfluidstate.hh>
-
-#include <dumux/common/exceptions.hh>
-
-namespace Dumux
-{
-
-
-template <class Scalar>
-struct H2OH2N2O2StaticParameters {
-    /****************************************
-     * Fluid phase parameters
-     ****************************************/
-
-    //! Number of phases in the fluid system
-    static const int numPhases = 2;
-
-    //! Index of the liquid phase
-    static const int lPhaseIdx = 0;
-    //! Index of the gas phase
-    static const int gPhaseIdx = 1;
-    
-    //! The component for pure water 
-    typedef Dumux::SimpleH2O<Scalar> SimpleH2O;
-    typedef Dumux::H2O<Scalar> IapwsH2O;
-    typedef Dumux::TabulatedComponent<Scalar, IapwsH2O> TabulatedH2O;
-    
-    //! The component for pure water
-    //typedef IapwsH2O H2O;
-    //typedef TabulatedH2O H2O;
-    typedef SimpleH2O H2O;
-    
-    //! The component for pure hydrogen
-    typedef Dumux::H2<Scalar> H2;
-
-    //! The component for pure nitrogen
-    typedef Dumux::N2<Scalar> N2;
-
-    //! The component for pure oxygen
-    typedef Dumux::O2<Scalar> O2;
-
-    /*!
-     * \brief Initialize the static parameters.
-     */
-    static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp,
-                     Scalar pressMin, Scalar pressMax, unsigned nPress)
-    {
-        if (H2O::isTabulated) {
-            std::cout << "Initializing tables for the H2O fluid properties ("
-                      << nTemp*nPress
-                      << " entries).\n";
-            
-            TabulatedH2O::init(tempMin, tempMax, nTemp,
-                               pressMin, pressMax, nPress);
-        }
-
-    }
-   
-    /*!
-     * \brief Return the human readable name of a fluid phase
-     */
-    static const char *phaseName(int phaseIdx)
-    {
-        static const char *name[] = {
-            "l",
-            "g"
-        };
-
-        assert(0 <= phaseIdx && phaseIdx < numPhases);
-        return name[phaseIdx];
-    }
-
-    /****************************************
-     * Component related parameters
-     ****************************************/
-
-    //! Number of components in the fluid system
-    static const int numComponents = 4;
-    
-    static const int H2OIdx = 0;
-    static const int H2Idx = 1;
-    static const int N2Idx = 2;
-    static const int O2Idx = 3;
-
-    /*!
-     * \brief Return the human readable name of a component
-     */
-    static const char *componentName(int compIdx)
-    {
-        static const char *name[] = {
-            H2O::name(),
-            H2::name(),
-            N2::name(),
-            O2::name(),
-        };
-
-        assert(0 <= compIdx && compIdx < numComponents);
-        return name[compIdx];
-    }
-    
-    /*!
-     * \brief Return the molar mass of a component in [kg/mol].
-     */
-    static Scalar molarMass(int compIdx)
-    {
-        static const Scalar M[] = {
-            H2O::molarMass(),
-            H2::molarMass(),
-            N2::molarMass(),
-            O2::molarMass(),
-        };
-
-        assert(0 <= compIdx && compIdx < numComponents);
-        return M[compIdx];
-    }
-
-    /*!
-     * \brief Critical temperature of a component [K].
-     */
-    static Scalar criticalTemperature(int compIdx)
-    {
-        static const Scalar Tcrit[] = {
-            H2O::criticalTemperature(), // H2O
-            H2::criticalTemperature(), // H2O
-            N2::criticalTemperature(), // H2O
-            O2::criticalTemperature(), // H2O
-        };
-
-        assert(0 <= compIdx && compIdx < numComponents);
-        return Tcrit[compIdx];
-    };
-
-    /*!
-     * \brief Critical pressure of a component [Pa].
-     */
-    static Scalar criticalPressure(int compIdx)
-    {
-        static const Scalar pcrit[] = {
-            H2O::criticalPressure(),
-            H2::criticalPressure(),
-            N2::criticalPressure(),
-            O2::criticalPressure(),
-        };
-
-        assert(0 <= compIdx && compIdx < numComponents);
-        return pcrit[compIdx];
-    };
-
-    /*!
-     * \brief Molar volume of a component at the critical point [m^3/mol].
-     */
-    static Scalar criticalMolarVolume(int compIdx)
-    {
-        DUNE_THROW(Dune::NotImplemented,
-                   "H2OH2N2O2StaticParams::criticalMolarVolume()");
-    };
-
-    /*!
-     * \brief The acentric factor of a component [].
-     */
-    static Scalar acentricFactor(int compIdx)
-    {
-        static const Scalar accFac[] = {
-            H2O::acentricFactor(), // H2O (from Reid, et al.)
-            H2::acentricFactor(),
-            N2::acentricFactor(),
-            O2::acentricFactor(),
-        };
-
-        assert(0 <= compIdx && compIdx < numComponents);
-        return accFac[compIdx];
-    };
-};
-
-/*!
- * \brief A twophase fluid system with water, hydrogen, nitrogen and oxygen as components.
- */
-template <class Scalar>
-class H2OH2N2O2FluidSystem : public H2OH2N2O2StaticParameters<Scalar>
-{
-public:
-    typedef Dumux::H2OH2N2O2StaticParameters<Scalar> StaticParameters;
-    typedef Dumux::GenericFluidState<Scalar, StaticParameters> MutableParameters;
-
-private:
-    // convenience typedefs
-    typedef StaticParameters SP;
-    typedef Dumux::IdealGas<Scalar> IdealGas;
-
-public:
-
-    /*!
-     * \brief Initialize the fluid system's static parameters
-     */
-    static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp,
-                     Scalar pressMin, Scalar pressMax, unsigned nPress)
-    {
-        SP::init(tempMin, tempMax, nTemp,
-                 pressMin, pressMax, nPress);
-    }
-    /*!
-     * \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 Henry's law and Rault's law apply. 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.
-     */
-    static bool isIdealMixture(int phaseIdx)
-    {
-        // we assume Henry's and Rault's laws for the water phase and
-        // and no interaction between gas molecules of different
-        // components, so all phases are ideal mixtures!
-        return true;
-    }
-
-    /*!
-     * \brief Calculate the molar volume [m^3/mol] of a fluid phase
-     */
-    static Scalar computeMolarVolume(MutableParameters &params, 
-                                     int phaseIdx)
-    {
-        assert(0 <= phaseIdx  && phaseIdx <= SP::numPhases);
-
-        params.updateMeanMolarMass(phaseIdx);
-        Scalar T = params.temperature(phaseIdx);
-        Scalar p = params.pressure(phaseIdx);
-
-        switch (phaseIdx) {
-        case SP::lPhaseIdx:
-            // assume pure water where one water molecule gets
-            // replaced by one nitrogen molecule
-            return SP::H2O::molarMass()/SP::H2O::liquidDensity(T, p);
-        case SP::gPhaseIdx:
-            // assume ideal gas
-            return 1.0 / IdealGas::concentration(T, p);
-        }
-        
-        DUNE_THROW(Dune::InvalidStateException, "Unhandled phase index " << phaseIdx);
-    };
-
-    /*!
-     * \brief Calculate the fugacity of a component in a fluid phase
-     *        [Pa]
-     *
-     * The components chemical \f$mu_\kappa\f$ potential is connected
-     * to the component's fugacity \f$f_\kappa\f$ by the relation
-     *
-     * \f[ \mu_\kappa = R T_\alpha \mathrm{ln} \frac{f_\kappa}{p_\alpha} \f]
-     *
-     * where \f$p_\alpha\f$ and \f$T_\alpha\f$ are the fluid phase'
-     * pressure and temperature.
-     */
-    static Scalar computeFugacity(MutableParameters &params,
-                                  int phaseIdx, 
-                                  int compIdx)
-    {
-        Scalar x = params.moleFrac(phaseIdx,compIdx);
-        Scalar p = params.pressure(phaseIdx);
-        return x*p*computeFugacityCoeff(params, phaseIdx, compIdx);
-    };
-
-    /*!
-     * \brief Calculate the fugacity coefficient [Pa] of an individual
-     *        component in a fluid phase
-     *
-     * The fugacity coefficient \f$\phi_\kappa\f$ is connected to the
-     * fugacity \f$f_\kappa\f$ and the component's molarity
-     * \f$x_\kappa\f$ by means of the relation
-     *
-     * \f[ f_\kappa = \phi_\kappa * x_{\kappa} \f]
-     */
-    static Scalar computeFugacityCoeff(MutableParameters &params,
-                                       int phaseIdx, 
-                                       int compIdx)
-    {
-        assert(0 <= phaseIdx  && phaseIdx <= SP::numPhases);
-        assert(0 <= compIdx  && compIdx <= SP::numComponents);
-
-        params.updateMeanMolarMass(phaseIdx);
-        Scalar T = params.temperature(phaseIdx);
-        Scalar p = params.pressure(phaseIdx);
-        switch (phaseIdx) {
-        case SP::lPhaseIdx: 
-            switch (compIdx) {
-            case SP::H2OIdx: return SP::H2O::vaporPressure(T)/p;
-            case SP::H2Idx: return BinaryCoeff::H2O_H2::henry(T)/p;
-            case SP::N2Idx: return BinaryCoeff::H2O_N2::henry(T)/p;
-            case SP::O2Idx: return BinaryCoeff::H2O_O2::henry(T)/p;
-            };
-        case SP::gPhaseIdx:
-            return 1.0; // ideal gas
-        };
-
-        DUNE_THROW(Dune::InvalidStateException, "Unhandled phase or component index");
-    }
-    
-    /*!
-     * \brief Calculate the dynamic viscosity of a fluid phase [Pa*s]
-     */
-    static Scalar computeViscosity(MutableParameters &params,
-                                   int phaseIdx)
-    {
-        assert(0 <= phaseIdx  && phaseIdx <= SP::numPhases);
-
-        params.updateMeanMolarMass(phaseIdx);
-        Scalar T = params.temperature(phaseIdx);
-        Scalar p = params.pressure(phaseIdx);
-        switch (phaseIdx) {
-        case SP::lPhaseIdx:
-            // assume pure water for the liquid phase
-            return SP::H2O::liquidViscosity(T, p);
-        case SP::gPhaseIdx:
-            // assume pure nitrogen for the gas phase
-            return SP::N2::gasViscosity(T, p);
-        }
-        
-        DUNE_THROW(Dune::InvalidStateException, "Unhandled phase index " << phaseIdx);
-    };
-
-    /*!
-     * \brief Calculate the binary molecular diffusion coefficient for
-     *        a component in a fluid phase [mol^2 * s / (kg*m^3)]
-     *
-     * Molecular diffusion of a compoent $\kappa$ is caused by a
-     * gradient of the chemical potential and follows the law
-     *
-     * \f[ J = - D \grad mu_\kappa \f] 
-     *
-     * where \f$\mu_\kappa\$ is the component's chemical potential,
-     * \f$D\f$ is the diffusion coefficient and \f$J\f$ is the
-     * diffusive flux. \f$mu_\kappa\f$ is connected to the component's
-     * fugacity \f$f_\kappa\f$ by the relation
-     *
-     * \f[ \mu_\kappa = R T_\alpha \mathrm{ln} \frac{f_\kappa}{p_\alpha} \f]
-     *
-     * where \f$p_\alpha\f$ and \f$T_\alpha\f$ are the fluid phase'
-     * pressure and temperature.
-     */
-    static Scalar computeDiffusionCoeff(MutableParameters &params, 
-                                        int phaseIdx,
-                                        int compIdx)
-    {
-        // TODO!
-        DUNE_THROW(Dune::NotImplemented, "Diffusion coefficients");
-    };
-
-    /*!
-     * \brief Given a phase's composition, temperature and pressure,
-     *        return the binary diffusion coefficient for components
-     *        \f$i\f$ and \f$j\f$ in this phase.
-     */
-    static Scalar binaryDiffCoeff(MutableParameters &params, 
-                                  int phaseIdx,
-                                  int compIIdx,
-                                  int compJIdx)
-                                  
-    {
-        params.updateMeanMolarMass(phaseIdx);
-        if (compIIdx > compJIdx)
-            std::swap(compIIdx, compJIdx);
-
-#ifndef NDEBUG
-        if (compIIdx == compJIdx ||
-            phaseIdx > SP::numPhases - 1 ||
-            compJIdx > SP::numComponents - 1)
-        {
-            DUNE_THROW(Dune::InvalidStateException,
-                       "Binary diffusion coefficient of components "
-                       << compIIdx << " and " << compJIdx
-                       << " in phase " << phaseIdx << " is undefined!\n");
-        }
-#endif
-
-        Scalar T = params.temperature(phaseIdx);
-        Scalar p = params.pressure(phaseIdx);       
-
-        switch (phaseIdx) {
-        case SP::lPhaseIdx:
-            switch (compIIdx) {
-            case SP::H2OIdx:
-                switch (compJIdx) {
-                case SP::H2Idx: return BinaryCoeff::H2O_H2::liquidDiffCoeff(T, p);
-                case SP::N2Idx: return BinaryCoeff::H2O_N2::liquidDiffCoeff(T, p);
-                case SP::O2Idx: return BinaryCoeff::H2O_O2::liquidDiffCoeff(T, p);
-                }
-            default:
-                DUNE_THROW(Dune::InvalidStateException,
-                           "Binary diffusion coefficients of trace "
-                           "substances in liquid phase is undefined!\n");
-            }
-        case SP::gPhaseIdx:
-            switch (compIIdx) {
-            case SP::H2OIdx:
-                switch (compJIdx) {
-                case SP::H2Idx: return BinaryCoeff::H2O_H2::gasDiffCoeff(T, p);
-                case SP::N2Idx: return BinaryCoeff::H2O_N2::gasDiffCoeff(T, p);
-                case SP::O2Idx: return BinaryCoeff::H2O_O2::gasDiffCoeff(T, p);
-                }
-            
-            case SP::H2Idx:
-                switch (compJIdx) {
-                case SP::N2Idx: return BinaryCoeff::H2_N2::gasDiffCoeff(T, p);
-                case SP::O2Idx: return BinaryCoeff::H2_O2::gasDiffCoeff(T, p);
-                }
-                
-            case SP::N2Idx:
-                switch (compJIdx) {
-                case SP::O2Idx: return BinaryCoeff::N2_O2::gasDiffCoeff(T, p);
-                }
-            }
-        }
-    
-        DUNE_THROW(Dune::InvalidStateException,
-                   "Binary diffusion coefficient of components "
-                   << compIIdx << " and " << compJIdx
-                   << " in phase " << phaseIdx << " is undefined!\n");
-    };
-
-    /*!
-     * \brief Given a phase's composition, temperature, pressure and
-     *        density, calculate its specific enthalpy [J/kg].
-     */
-    static Scalar computeEnthalpy(MutableParameters &params, 
-                                  int phaseIdx)
-    {
-        params.updateMeanMolarMass(phaseIdx);
-        Scalar T = params.temperature(phaseIdx);
-        Scalar p = params.pressure(phaseIdx);
-        Valgrind::CheckDefined(T);
-        Valgrind::CheckDefined(p);
-        if (phaseIdx == SP::lPhaseIdx) {
-            Scalar cH2 = params.molarity(SP::lPhaseIdx, SP::H2Idx);
-            Scalar cN2 = params.molarity(SP::lPhaseIdx, SP::N2Idx);
-            Scalar cO2 = params.molarity(SP::lPhaseIdx, SP::O2Idx);
-            Scalar pH2 = SP::H2::gasPressure(T, cN2*SP::H2::molarMass());
-            Scalar pN2 = SP::N2::gasPressure(T, cN2*SP::N2::molarMass());
-            Scalar pO2 = SP::O2::gasPressure(T, cN2*SP::O2::molarMass());
-
-            Scalar XH2O = params.massFrac(SP::lPhaseIdx, SP::H2OIdx);
-            Scalar XH2 = params.massFrac(SP::lPhaseIdx, SP::H2Idx);
-            Scalar XN2 = params.massFrac(SP::lPhaseIdx, SP::N2Idx);
-            Scalar XO2 = params.massFrac(SP::lPhaseIdx, SP::O2Idx);
-            
-            // TODO: correct way to deal with the solutes???
-            return 
-                (XH2O*SP::H2O::liquidEnthalpy(T, p) +
-                 XH2*SP::N2::gasEnthalpy(T, pH2) + 
-                 XN2*SP::N2::gasEnthalpy(T, pN2) + 
-                 XO2*SP::N2::gasEnthalpy(T, pO2))
-                /
-                (XH2O + XN2);
-        }
-        else {
-            Scalar cH2O = params.molarity(SP::gPhaseIdx, SP::H2OIdx);
-            Scalar cH2 = params.molarity(SP::gPhaseIdx, SP::H2Idx);
-            Scalar cN2 = params.molarity(SP::gPhaseIdx, SP::N2Idx);
-            Scalar cO2 = params.molarity(SP::gPhaseIdx, SP::O2Idx);
-            
-            // assume ideal mixture for gas
-            Scalar pH2O = SP::H2O::gasPressure(T, cH2O*SP::H2O::molarMass());
-            Scalar pH2 = SP::H2::gasPressure(T, cH2*SP::H2::molarMass());
-            Scalar pN2 = SP::N2::gasPressure(T, cN2*SP::N2::molarMass());
-            Scalar pO2 = SP::O2::gasPressure(T, cO2*SP::O2::molarMass());
-
-            Scalar XH2O = params.massFrac(SP::gPhaseIdx, SP::H2OIdx);
-            Scalar XH2 = params.massFrac(SP::gPhaseIdx, SP::H2Idx);
-            Scalar XN2 = params.massFrac(SP::gPhaseIdx, SP::N2Idx);
-            Scalar XO2 = params.massFrac(SP::gPhaseIdx, SP::O2Idx);
-
-            // add up all the "partial enthalpies"
-            Scalar result = 0;
-            result += SP::H2O::gasEnthalpy(T, pH2O);
-            result += SP::H2::gasEnthalpy(T, pH2);
-            result += SP::N2::gasEnthalpy(T, pN2);
-            result += SP::O2::gasEnthalpy(T, pO2);
-
-            // normalize the result to 100%
-            result /= XH2O + XH2 + XN2 + XO2;
-
-            return result;
-        }
-    };
-
-    /*!
-     * \brief Thermal conductivity of phases [W m / (m^2 K)]
-     * 		Use the cunductivity of air and water as a first approximation.
-     * 		Source: http://en.wikipedia.org/wiki/List_of_thermal_conductivities
-     */
-    static Scalar thermalConductivity(const MutableParameters &params,
-    								  const int phaseIdx)
-    {
-//    	TODO thermal conductivity is a function of:
-//        Scalar p = params.pressure(phaseIdx);
-//        Scalar T = params.temperature(phaseIdx);
-//        Scalar x = params.moleFrac(phaseIdx,compIdx);
-        switch (phaseIdx) {
-        case SP::lPhaseIdx: // use conductivity of pure water
-            return  0.6;   // conductivity of water[W / (m K ) ]
-        case SP::gPhaseIdx:// use conductivity of pure air
-            return  0.025; // conductivity of air [W / (m K ) ]
-        }
-        DUNE_THROW(Dune::InvalidStateException, "Unhandled phase index " << phaseIdx);
-    }
-};
-
-} // end namepace
-
-#endif
diff --git a/dumux/material/new_fluidsystems/h2on2fluidsystem.hh b/dumux/material/new_fluidsystems/h2on2fluidsystem.hh
index 4d86c5ac5e..d60b7e33cc 100644
--- a/dumux/material/new_fluidsystems/h2on2fluidsystem.hh
+++ b/dumux/material/new_fluidsystems/h2on2fluidsystem.hh
@@ -111,6 +111,27 @@ struct H2ON2StaticParameters {
         return phaseIdx != gPhaseIdx;
     }
 
+    /*!
+     * \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 Henry's law and Rault's law apply. 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.
+     */
+    static bool isIdealMixture(int phaseIdx)
+    {
+        assert(0 <= phaseIdx && phaseIdx < numPhases);
+        // we assume Henry's and Rault's laws for the water phase and
+        // and no interaction between gas molecules of different
+        // components, so all phases are ideal mixtures!
+        return true;
+    }
+
     /****************************************
      * Component related parameters
      ****************************************/
@@ -227,25 +248,6 @@ public:
         SP::init(tempMin, tempMax, nTemp,
                  pressMin, pressMax, nPress);
     }
-    /*!
-     * \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 Henry's law and Rault's law apply. 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.
-     */
-    static bool isIdealMixture(int phaseIdx)
-    {
-        // we assume Henry's and Rault's laws for the water phase and
-        // and no interaction between gas molecules of different
-        // components, so all phases are ideal mixtures!
-        return true;
-    }
 
     /*!
      * \brief Calculate the molar volume [m^3/mol] of a fluid phase
@@ -433,18 +435,6 @@ public:
                    << " in phase " << phaseIdx << " is undefined!\n");
     };
 
-    static Scalar binaryDiffCoeff(MutableParameters &params, 
-                                  int phaseIdx,
-                                  int compIIdx,
-                                  int compJIdx)
-        DUNE_DEPRECATED // use computeBinaryDiffCoeff()
-    {
-        return computeBinaryDiffCoeff(params, 
-                                      phaseIdx,
-                                      compIIdx,
-                                      compJIdx);
-    }
-
     /*!
      * \brief Given a phase's composition, temperature, pressure and
      *        density, calculate its specific enthalpy [J/kg].
@@ -505,6 +495,59 @@ public:
             computeEnthalpy(params, phaseIdx) -
             p/rho;
     }
+
+    /*!
+     * \brief Thermal conductivity of phases.
+     *
+     * Use the conductivity of air and water as a first approximation.
+     * Source:
+     * http://en.wikipedia.org/wiki/List_of_thermal_conductivities
+     */
+    static Scalar computeThermalConductivity(const MutableParameters &params,
+                                             int phaseIdx)
+    {
+//    	TODO thermal conductivity is a function of:
+//        Scalar p = params.pressure(phaseIdx);
+//        Scalar T = params.temperature(phaseIdx);
+//        Scalar x = params.moleFrac(phaseIdx,compIdx);
+#warning: so far rough estimates from wikipedia
+        switch (phaseIdx) {
+        case SP::lPhaseIdx: // use conductivity of pure water
+            return  0.6;   // conductivity of water[W / (m K ) ]
+        case SP::gPhaseIdx:// use conductivity of pure air
+            return  0.025; // conductivity of air [W / (m K ) ]
+        }
+        DUNE_THROW(Dune::InvalidStateException, "Unhandled phase index " << phaseIdx);
+    }
+    
+    /*!
+     * \brief Specific isobaric heat capacity of liquid water / air
+     *        \f$\mathrm{[J/kg]}\f$.
+     *
+     * \param params    mutable parameters
+     * \param phaseIdx  for which phase to give back the heat capacity
+     */
+    static Scalar computeHeatCapacity(const MutableParameters &params,
+                                      int phaseIdx)
+    {
+//        http://en.wikipedia.org/wiki/Heat_capacity
+#warning: so far rough estimates from wikipedia
+//      TODO heatCapacity is a function of composition.
+//        Scalar p = params.pressure(phaseIdx);
+//        Scalar T = params.temperature(phaseIdx);
+//        Scalar x = params.moleFrac(phaseIdx,compIdx);
+        switch (phaseIdx) {
+        case SP::lPhaseIdx: // use heat capacity of pure liquid water
+            return  4181.3;  // @(25°C) !!!
+            /* [J/(kg K)]*/ /* not working because ddgamma_ddtau is not defined*/ /* Dumux::H2O<Scalar>::liquidHeatCap_p(T,
+                                             p); */
+        case SP::gPhaseIdx:
+            return  1003.5 ; // @ (0°C) !!!
+            /* [J/(kg K)]*/ /* not working because ddgamma_ddtau is not defined*/ /*Dumux::H2O<Scalar>::gasHeatCap_p(T,
+                                          p) ;*/
+        }
+        DUNE_THROW(Dune::InvalidStateException, "Unhandled phase index " << phaseIdx);
+    }
 };
 
 } // end namepace
diff --git a/dumux/material/new_fluidsystems/spe5fluidsystem.hh b/dumux/material/new_fluidsystems/spe5fluidsystem.hh
deleted file mode 100644
index 57ffcf5c70..0000000000
--- a/dumux/material/new_fluidsystems/spe5fluidsystem.hh
+++ /dev/null
@@ -1,347 +0,0 @@
-/*****************************************************************************
- *   Copyright (C) 2009-2010 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 The mixing rule for the oil and the gas phases of the SPE5 problem.
- *
- * This problem comprises \f$H_2O\f$, \f$C_1\f$, \f$C_3\f$, \f$C_6\f$,
- * \f$C_10\f$, \f$C_15\f$ and \f$C_20\f$ as components.
- *
- * See:
- *
- * J.E. Killough, et al.: Fifth Comparative Solution Project:
- * Evaluation of Miscible Flood Simulators, Ninth SPE Symposium on
- * Reservoir Simulation, 1987
- */
-#ifndef DUMUX_SPE5_FLUID_SYSTEM_HH
-#define DUMUX_SPE5_FLUID_SYSTEM_HH
-
-#include "dumux/common/spline.hh"
-#include "spe5/spe5staticparameters.hh"
-#include "spe5/spe5mutableparameters.hh"
-#include "spe5/spe5pengrobinsonparams.hh"
-#include "../eos/pengrobinsonmixture.hh"
-
-namespace Dumux
-{
-/*!
- * \brief The fluid system for the SPE-5 benchmark problem.
- *
- * This problem comprises \f$H_2O\f$, \f$C_1\f$, \f$C_3\f$, \f$C_6\f$,
- * \f$C_10\f$, \f$C_15\f$ and \f$C_20\f$ as components.
- *
- * See:
- *
- * J.E. Killough, et al.: Fifth Comparative Solution Project:
- * Evaluation of Miscible Flood Simulators, Ninth SPE Symposium on
- * Reservoir Simulation, 1987
- */
-template <class Scalar>
-class Spe5FluidSystem
-{
-public:
-    typedef Dumux::Spe5StaticParameters<Scalar> StaticParameters;
-    typedef Dumux::Spe5MutableParameters<Scalar> MutableParameters;
-
-private:
-    typedef typename Dumux::PengRobinsonMixture<Scalar, StaticParameters> PengRobinsonMixture;
-    typedef typename Dumux::PengRobinson<Scalar> PengRobinson;
-
-public:
-    // copy number of phases and components from the static parameters
-    enum { numPhases = StaticParameters::numPhases };
-    enum { numComponents = StaticParameters::numComponents };
-
-    // copy phase indices from the static parameters
-    enum {
-        wPhaseIdx = StaticParameters::wPhaseIdx,
-        oPhaseIdx = StaticParameters::oPhaseIdx,
-        gPhaseIdx = StaticParameters::gPhaseIdx
-    };
-
-    // copy component indices from the static parameters
-    enum {
-        H2OIdx = StaticParameters::H2OIdx,
-        C1Idx = StaticParameters::C1Idx,
-        C3Idx = StaticParameters::C3Idx,
-        C6Idx = StaticParameters::C6Idx,
-        C10Idx = StaticParameters::C10Idx,
-        C15Idx = StaticParameters::C15Idx,
-        C20Idx = StaticParameters::C20Idx,
-    };
-
-    // copy the component types from the static parameters
-    typedef typename StaticParameters::H2O H2O;
-
-    /*!
-     * \brief Initialize the fluid system's static parameters
-     */
-    static void init()
-    {
-    }
-
-    /*!
-     * \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 Henry's law and Rault's law apply. 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.
-     */
-    static bool isIdealMixture(int phaseIdx)
-    {
-        // always use the reference oil for the fugacity coefficents,
-        // so they cannot be dependent on composition and they the
-        // phases thus always an ideal mixture
-        return phaseIdx == wPhaseIdx;
-    }
-
-    /*!
-     * \brief Return the human readable name of a component
-     */
-    static const char *componentName(int compIdx)
-    {
-        assert(0 <= compIdx  && compIdx <= numComponents);
-        return StaticParameters::componentName(compIdx);
-    }
-
-    /*!
-     * \brief Return the human readable name of a phase
-     */
-    static const char *phaseName(int phaseIdx)
-    {
-        assert(0 <= phaseIdx  && phaseIdx <= numPhases);
-        return StaticParameters::phaseName(phaseIdx);
-    }
-
-    /*!
-     * \brief Return the molar mass [kg/mol] of a component
-     */
-    static Scalar molarMass(int compIdx)
-    {
-        assert(0 <= compIdx  && compIdx <= numComponents);
-        return StaticParameters::molarMass(compIdx);
-    }
-    
-    /*!
-     * \brief Calculate the molar volume [m^3/mol] of a fluid phase
-     */
-    static Scalar computeMolarVolume(MutableParameters &params, 
-                                     int phaseIdx)
-    {
-        assert(0 <= phaseIdx  && phaseIdx <= numPhases);
-
-        params.update(phaseIdx);
-        return params.molarVolume(phaseIdx);
-    };
-
-    /*!
-     * \brief Calculate the fugacity of a component in a fluid phase
-     *        [Pa]
-     *
-     * The components chemical \f$mu_\kappa\f$ potential is connected
-     * to the component's fugacity \f$f_\kappa\f$ by the relation
-     *
-     * \f[ \mu_\kappa = R T_\alpha \mathrm{ln} \frac{f_\kappa}{p_\alpha} \f]
-     *
-     * where \f$p_\alpha\f$ and \f$T_\alpha\f$ are the fluid phase'
-     * pressure and temperature.
-     */
-    static Scalar computeFugacity(MutableParameters &params,
-                                  int phaseIdx, 
-                                  int compIdx)
-    {
-        params.update(phaseIdx);
-        return 
-            params.moleFrac(phaseIdx, compIdx) *
-            params.pressure(phaseIdx) *
-            computeFugacityCoeff(params, phaseIdx, compIdx);
-    };
-
-    /*!
-     * \brief Calculate the fugacity coefficient [Pa] of an individual
-     *        component in a fluid phase
-     *
-     * The fugacity coefficient \f$\phi_\kappa\f$ is connected to the
-     * fugacity \f$f_\kappa\f$ and the component's molarity
-     * \f$x_\kappa\f$ by means of the relation
-     *
-     * \f[ f_\kappa = \phi_\kappa * x_{\kappa} \f]
-     */
-    static Scalar computeFugacityCoeff(MutableParameters &params,
-                                       int phaseIdx, 
-                                       int compIdx)
-    {
-//        const Scalar phi_g[numComponents] = {0.315214, 0.86048, 0.378601, 0.12922, 0.0320002, 0.00813658, 0.00174178 };
-//        const Scalar phi_o[numComponents] = {0.0633375, 1.73469, 0.19746, 0.0147604, 0.000630321, 2.48063e-05, 7.74427e-07 };
-//        const Scalar pRefOil = 1.5e+07;
-
-        assert(0 <= phaseIdx  && phaseIdx <= numPhases);
-        assert(0 <= compIdx  && compIdx <= numComponents);
-
-        params.update(phaseIdx);
-        switch (phaseIdx) {
-        case gPhaseIdx:
-        case oPhaseIdx: {
-            params.update(phaseIdx);             
-            Scalar phi = PengRobinsonMixture::computeFugacityCoeff(params,
-                                                                   phaseIdx, 
-                                                                   compIdx);
-            return phi;
-        }
-        case wPhaseIdx:
-            return 
-                henryCoeffWater_(compIdx, params.temperature(wPhaseIdx))
-                /
-                params.pressure(wPhaseIdx);
-        default: DUNE_THROW(Dune::InvalidStateException, "Unhandled phase index " << phaseIdx);
-        }
-    }
-    
-    /*
-    static Scalar evalTable_(const Scalar *y, Scalar p)
-    {
-        Scalar tmp = pIdx_(p);
-        int pIdx = static_cast<int>(tmp);
-
-        Scalar p1 = (pIdx + 0) * (pMax_ - pMin_)/Scalar(numEntries_) + pMin_;
-        Scalar p2 = (pIdx + 1) * (pMax_ - pMin_)/Scalar(numEntries_) + pMin_;
-        
-#if 0
-        Scalar alpha = tmp - pIdx;
-        return y[pIdx]*(1 - alpha) + y[pIdx + 1]*alpha; 
-#else
-        Scalar pPrimeLeft =  (y[pIdx + 1] - y[pIdx - 1])/( 2*(pMax_ - pMin_)/numEntries_ );
-        Scalar pPrimeRight =  (y[pIdx + 2] - y[pIdx]    )/( 2*(pMax_ - pMin_)/numEntries_ );
-        Spline<Scalar> sp(p1, p2,
-                          y[pIdx], y[pIdx + 1],
-                          pPrimeLeft, pPrimeRight);
-        return sp.eval(p);
-#endif
-    }
-    */
-
-    /*!
-     * \brief Calculate the dynamic viscosity of a fluid phase [Pa*s]
-     */
-    static Scalar computeViscosity(MutableParameters &params,
-                                   int phaseIdx)
-    {
-        assert(0 <= phaseIdx  && phaseIdx <= numPhases);
-        params.update(phaseIdx);
-        
-        switch (phaseIdx) {
-        case gPhaseIdx: {
-            // given by SPE-5 in table on page 64. we use a constant
-            // viscosity, though...
-            return 0.0170e-2 * 0.1; 
-        }
-        case wPhaseIdx: 
-            // given by SPE-5: 0.7 centi-Poise  = 0.0007 Pa s
-            return 0.7e-2 * 0.1;
-        case oPhaseIdx: {
-            // given by SPE-5 in table on page 64. we use a constant
-            // viscosity, though...
-            return 0.208e-2 * 0.1; 
-        }
-        default: DUNE_THROW(Dune::InvalidStateException, "Unhandled phase index " << phaseIdx);
-        }
-    };
-
-    /*!
-     * \brief Calculate the binary molecular diffusion coefficient for
-     *        a component in a fluid phase [mol^2 * s / (kg*m^3)]
-     *
-     * Molecular diffusion of a compoent $\kappa$ is caused by a
-     * gradient of the chemical potential and follows the law
-     *
-     * \f[ J = - D \grad mu_\kappa \f] 
-     *
-     * where \f$\mu_\kappa\$ is the component's chemical potential,
-     * \f$D\f$ is the diffusion coefficient and \f$J\f$ is the
-     * diffusive flux. \f$mu_\kappa\f$ is connected to the component's
-     * fugacity \f$f_\kappa\f$ by the relation
-     *
-     * \f[ \mu_\kappa = R T_\alpha \mathrm{ln} \frac{f_\kappa}{p_\alpha} \f]
-     *
-     * where \f$p_\alpha\f$ and \f$T_\alpha\f$ are the fluid phase'
-     * pressure and temperature.
-     */
-    static Scalar computeDiffusionCoeff(MutableParameters &params, 
-                                        int phaseIdx,
-                                        int compIdx)
-    {
-        // TODO!
-        DUNE_THROW(Dune::NotImplemented, "Diffusion coefficients");
-    };
-
-    /*!
-     * \brief Given a phase's composition, temperature and pressure,
-     *        calculate its specific enthalpy [J/kg].
-     */
-    static Scalar computeEnthalpy(MutableParameters &params, 
-                                  int phaseIdx)
-    {
-        // TODO!
-        DUNE_THROW(Dune::NotImplemented, "Enthalpies");
-    };
-
-    /*!
-     * \brief Given a phase's composition, temperature and pressure,
-     *        calculate its specific internal energy [J/kg].
-     */
-    static Scalar internalEnergy(MutableParameters &params, 
-                                 int phaseIdx)
-    {
-        // TODO!
-        DUNE_THROW(Dune::NotImplemented, "Enthalpies");
-    };
-
-private:   
-    static Scalar henryCoeffWater_(int compIdx, Scalar temperature)
-    {
-        // use henry's law for the solutes and the vapor pressure for
-        // the solvent.
-        switch (compIdx) {
-        case H2OIdx: return H2O::vaporPressure(temperature);
-            
-            // the values of the Henry constant for the solutes have
-            // been computed using the Peng-Robinson equation of state
-            // (-> slope of the component's fugacity function at
-            // almost 100% water content)
-        case C1Idx: return 5.57601e+09;
-        case C3Idx: return 1.89465e+10;
-        case C6Idx: return 5.58969e+12;
-        case C10Idx: return 4.31947e+17;
-        case C15Idx: return 4.27283e+28;
-        case C20Idx: return 3.39438e+36;
-        default: DUNE_THROW(Dune::InvalidStateException, "Unknown component index " << compIdx);
-        }
-    };
-};
-
-} // end namepace
-
-#endif
-- 
GitLab