diff --git a/dumux/material/fluidsystems/base.hh b/dumux/material/fluidsystems/base.hh index 08311007d9b8ef52a0dd30f3df7d41a6967970bb..3da0a5c280cf51b331e4eb2943dd885ade357a94 100644 --- a/dumux/material/fluidsystems/base.hh +++ b/dumux/material/fluidsystems/base.hh @@ -79,8 +79,12 @@ public: * * \param phaseIdx The index of the fluid phase to consider */ + template<class T = Implementation> static constexpr bool isCompressible(int phaseIdx) - { return Implementation::isCompressible(phaseIdx); } + { + static_assert(AlwaysFalse<T>::value, "Mandatory function not implemented: isCompressible(phaseIdx)"); + return true; + } /*! * \brief Returns whether the fluids are miscible @@ -119,6 +123,19 @@ public: // \} + /*! + * \brief Calculate the density \f$\mathrm{[kg/m^3]}\f$ of a fluid phase + * \param fluidState The fluid state + * \param paramCache mutable parameters + * \param phaseIdx Index of the fluid phase + */ + template <class FluidState> + static Scalar density(const FluidState &fluidState, + int phaseIdx) + { + DUNE_THROW(Dune::NotImplemented, "density() method not implemented by the fluid system."); + } + /*! * \brief Calculate the density \f$\mathrm{[kg/m^3]}\f$ of a fluid phase * \param fluidState The fluid state @@ -133,6 +150,18 @@ public: return Implementation::density(fluidState, phaseIdx); } + /*! + * \brief Calculate the molar density \f$\mathrm{[mol/m^3]}\f$ of a fluid phase + * \param fluidState The fluid state + * \param phaseIdx Index of the fluid phase + */ + template <class FluidState> + static Scalar molarDensity(const FluidState &fluidState, + int phaseIdx) + { + DUNE_THROW(Dune::NotImplemented, "molarDensity() method not implemented by the fluid system."); + } + /*! * \brief Calculate the molar density \f$\mathrm{[mol/m^3]}\f$ of a fluid phase * \param fluidState The fluid state @@ -147,6 +176,30 @@ public: return Implementation::molarDensity(fluidState, phaseIdx); } + /*! + * \brief Calculate the fugacity coefficient \f$\mathrm{[Pa]}\f$ of an individual + * component in a fluid phase + * + * The fugacity coefficient \f$\mathrm{\phi^\kappa_\alpha}\f$ is connected to the + * fugacity \f$\mathrm{f^\kappa_\alpha}\f$ and the component's mole + * fraction \f$\mathrm{x^\kappa_\alpha}\f$ by means of the relation + * + * \f[ + f^\kappa_\alpha = \phi^\kappa_\alpha\;x^\kappa_\alpha\;p_\alpha + * \f] + * + * \param fluidState The fluid state + * \param phaseIdx Index of the fluid phase + * \param compIdx Index of the component + */ + template <class FluidState> + static Scalar fugacityCoefficient(const FluidState &fluidState, + int phaseIdx, + int compIdx) + { + DUNE_THROW(Dune::NotImplemented, "fugacityCoefficient() method not implemented by the fluid system."); + } + /*! * \brief Calculate the fugacity coefficient \f$\mathrm{[Pa]}\f$ of an individual * component in a fluid phase @@ -173,6 +226,18 @@ public: return Implementation::fugacityCoefficient(fluidState, phaseIdx, compIdx); } + /*! + * \brief Calculate the dynamic viscosity of a fluid phase \f$\mathrm{[Pa*s]}\f$ + * \param fluidState The fluid state + * \param phaseIdx Index of the fluid phase + */ + template <class FluidState> + static Scalar viscosity(const FluidState &fluidState, + int phaseIdx) + { + DUNE_THROW(Dune::NotImplemented, "viscosity() method not implemented by the fluid system."); + } + /*! * \brief Calculate the dynamic viscosity of a fluid phase \f$\mathrm{[Pa*s]}\f$ * \param fluidState The fluid state @@ -187,6 +252,35 @@ public: return Implementation::viscosity(fluidState, phaseIdx); } + /*! + * \brief Calculate the binary molecular diffusion coefficient for + * a component in a fluid phase \f$\mathrm{[mol^2 * s / (kg*m^3)]}\f$ + * \param fluidState The fluid state + * \param phaseIdx Index of the fluid phase + * \param compIdx Index of the component + * Molecular diffusion of a component \f$\mathrm{\kappa}\f$ is caused by a + * gradient of the chemical potential and follows the law + * + * \f[ J = - D \mathbf{grad} \mu_\kappa \f] + * + * where \f$\mathrm{\mu_\kappa}\f$ is the component's chemical potential, + * \f$\mathrm{D}\f$ is the diffusion coefficient and \f$\mathrm{J}\f$ is the + * diffusive flux. \f$\mathrm{\mu_\kappa}\f$ is connected to the component's + * fugacity \f$\mathrm{f_\kappa}\f$ by the relation + * + * \f[ \mu_\kappa = R T_\alpha \mathrm{ln} \frac{f_\kappa}{p_\alpha} \f] + * + * where \f$\mathrm{p_\alpha}\f$ and \f$\mathrm{T_\alpha}\f$ are the fluid phase' + * pressure and temperature. + */ + template <class FluidState> + static Scalar diffusionCoefficient(const FluidState &fluidState, + int phaseIdx, + int compIdx) + { + DUNE_THROW(Dune::NotImplemented, "diffusionCoefficient() method not implemented by the fluid system."); + } + /*! * \brief Calculate the binary molecular diffusion coefficient for * a component in a fluid phase \f$\mathrm{[mol^2 * s / (kg*m^3)]}\f$ @@ -218,6 +312,25 @@ public: return Implementation::diffusionCoefficient(fluidState, phaseIdx, compIdx); } + /*! + * \brief Given a phase's composition, temperature and pressure, + * return the binary diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for components + * \f$\mathrm{i}\f$ and \f$\mathrm{j}\f$ in this phase. + * \param fluidState The fluid state + * \param phaseIdx Index of the fluid phase + * \param compIIdx Index of the component i + * \param compJIdx Index of the component j + */ + template <class FluidState> + static Scalar binaryDiffusionCoefficient(const FluidState &fluidState, + int phaseIdx, + int compIIdx, + int compJIdx) + + { + DUNE_THROW(Dune::NotImplemented, "binaryDiffusionCoefficient() method not implemented by the fluid system."); + } + /*! * \brief Given a phase's composition, temperature and pressure, * return the binary diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for components @@ -239,6 +352,19 @@ public: return Implementation::binaryDiffusionCoefficient(fluidState, phaseIdx, compIIdx, compJIdx); } + /*! + * \brief Given a phase's composition, temperature, pressure and + * density, calculate its specific enthalpy \f$\mathrm{[J/kg]}\f$. + * \param fluidState The fluid state + * \param phaseIdx Index of the fluid phase + */ + template <class FluidState> + static Scalar enthalpy(const FluidState &fluidState, + int phaseIdx) + { + DUNE_THROW(Dune::NotImplemented, "enthalpy() method not implemented by the fluid system."); + } + /*! * \brief Given a phase's composition, temperature, pressure and * density, calculate its specific enthalpy \f$\mathrm{[J/kg]}\f$. @@ -254,6 +380,18 @@ public: return Implementation::enthalpy(fluidState, phaseIdx); } + /*! + * \brief Thermal conductivity \f$\lambda_\alpha \f$ of a fluid phase \f$\mathrm{[W/(m K)]}\f$. + * \param fluidState The fluid state + * \param phaseIdx Index of the fluid phase + */ + template <class FluidState> + static Scalar thermalConductivity(const FluidState &fluidState, + int phaseIdx) + { + DUNE_THROW(Dune::NotImplemented, "thermalConductivity() method not implemented by the fluid system."); + } + /*! * \brief Thermal conductivity \f$\lambda_\alpha \f$ of a fluid phase \f$\mathrm{[W/(m K)]}\f$. * \param fluidState The fluid state @@ -268,6 +406,26 @@ public: return Implementation::thermalConductivity(fluidState, phaseIdx); } + /*! + * \brief Specific isobaric heat capacity \f$c_{p,\alpha}\f$ of a fluid phase \f$\mathrm{[J/(kg*K)]}\f$. + * + * \param fluidState represents all relevant thermodynamic quantities of a fluid system + * \param phaseIdx Index of the fluid phase + * + * Given a fluid state, an up-to-date parameter cache and a phase index, this method + * computes the isobaric heat capacity \f$c_{p,\alpha}\f$ of the fluid phase. The isobaric + * heat capacity is defined as the partial derivative of the specific enthalpy \f$h_\alpha\f$ + * to the fluid pressure \f$p_\alpha\f$: + * + * \f$ c_{p,\alpha} = \frac{\partial h_\alpha}{\partial p_\alpha} \f$ + */ + template <class FluidState> + static Scalar heatCapacity(const FluidState &fluidState, + int phaseIdx) + { + DUNE_THROW(Dune::NotImplemented, "heatCapacity() method not implemented by the fluid system."); + } + /*! * \brief Specific isobaric heat capacity \f$c_{p,\alpha}\f$ of a fluid phase \f$\mathrm{[J/(kg*K)]}\f$. *