Commit 43935f7b authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'feature/1padapter-immiscible' into 'master'

[material][1padapter] Make usable for immiscible fluidsystems

See merge request !1129
parents b2efcabd 585cc54c
...@@ -36,7 +36,7 @@ namespace FluidSystems { ...@@ -36,7 +36,7 @@ namespace FluidSystems {
/*! /*!
* \ingroup Fluidsystems * \ingroup Fluidsystems
* \brief An adapter for multi-phase fluid systems to be used with compositional one-phase models * \brief An adapter for multi-phase fluid systems to be used with (compositional) one-phase models
* \tparam MPFluidSystem the multi-phase fluid system to be adapted * \tparam MPFluidSystem the multi-phase fluid system to be adapted
* \tparam phase the index of the phase we choose from the multi-phase fluid system * \tparam phase the index of the phase we choose from the multi-phase fluid system
*/ */
...@@ -87,8 +87,9 @@ public: ...@@ -87,8 +87,9 @@ public:
//! number of phases in the fluid system //! number of phases in the fluid system
static constexpr int numPhases = 1; static constexpr int numPhases = 1;
//! number of components has to be the same as in the multi-phase fluid system as the composition needs to be defined //! for compositional models, the number of components has to be the same as in the multi-phase fluid system as the composition needs to be defined,
static constexpr int numComponents = MultiPhaseFluidSystem::numComponents; //! while for non-compositional models, the number of components must equal the number of phases (1 in this case)
static constexpr int numComponents = MultiPhaseFluidSystem::isMiscible() ? MultiPhaseFluidSystem::numComponents : numPhases;
//! number of components has to be the same as in the multi-phase fluid system as the composition needs to be defined //! number of components has to be the same as in the multi-phase fluid system as the composition needs to be defined
static constexpr int phase0Idx = 0; //!< index of the only phase static constexpr int phase0Idx = 0; //!< index of the only phase
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#define DUMUX_BASE_FLUID_SYSTEM_HH #define DUMUX_BASE_FLUID_SYSTEM_HH
#include <string> #include <string>
#include <dumux/common/typetraits/typetraits.hh>
#include "nullparametercache.hh" #include "nullparametercache.hh"
namespace Dumux { namespace Dumux {
...@@ -84,8 +85,12 @@ public: ...@@ -84,8 +85,12 @@ public:
/*! /*!
* \brief Returns whether the fluids are miscible * \brief Returns whether the fluids are miscible
*/ */
template<class T = Implementation>
static constexpr bool isMiscible() static constexpr bool isMiscible()
{ return Implementation::isMiscible(); } {
static_assert(AlwaysFalse<T>::value, "Mandatory function not implemented: isMiscible()");
return true;
}
/*! /*!
* \brief Returns true if and only if a fluid phase is assumed to * \brief Returns true if and only if a fluid phase is assumed to
......
...@@ -209,6 +209,12 @@ public: ...@@ -209,6 +209,12 @@ public:
return false; // not a gas return false; // not a gas
} }
/*!
* \brief Returns whether the fluids are miscible
*/
static constexpr bool isMiscible()
{ return true; }
/**************************************** /****************************************
* Component related static parameters * Component related static parameters
****************************************/ ****************************************/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment