diff --git a/opm/material/Valgrind.hpp b/opm/material/Valgrind.hpp index d9af3c453..8b3fa62d7 100644 --- a/opm/material/Valgrind.hpp +++ b/opm/material/Valgrind.hpp @@ -72,7 +72,7 @@ template inline bool CheckDefined(const T &value) { #if !defined NDEBUG && HAVE_VALGRIND - unsigned int tmp = VALGRIND_CHECK_MEM_IS_DEFINED(&value, sizeof(T)); + auto tmp = VALGRIND_CHECK_MEM_IS_DEFINED(&value, sizeof(T)); return tmp == 0; #else return true; @@ -108,7 +108,7 @@ template inline bool CheckDefined(const T *value, int size) { #if !defined NDEBUG && HAVE_VALGRIND - unsigned int tmp = VALGRIND_CHECK_MEM_IS_DEFINED(value, size*sizeof(T)); + auto tmp = VALGRIND_CHECK_MEM_IS_DEFINED(value, size*sizeof(T)); return tmp == 0; #else return true; @@ -255,8 +255,6 @@ inline void SetNoAccess(const T &value) * * \param value Pointer to the first object of the array. * \param size The size of the array in number of objects - * - * \param value The object which's memory valgrind should complain if accessed */ template inline void SetNoAccess(const T *value, int size) diff --git a/opm/material/binarycoefficients/Air_Mesitylene.hpp b/opm/material/binarycoefficients/Air_Mesitylene.hpp index 3f5426749..8751d241a 100644 --- a/opm/material/binarycoefficients/Air_Mesitylene.hpp +++ b/opm/material/binarycoefficients/Air_Mesitylene.hpp @@ -88,8 +88,6 @@ public: /*! * \brief Diffusion coefficent [m^2/s] for molecular mesitylene in liquid water. - * - * \todo */ template static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure) diff --git a/opm/material/binarycoefficients/Brine_CO2.hpp b/opm/material/binarycoefficients/Brine_CO2.hpp index 7cdd9ff66..bbdf4d862 100644 --- a/opm/material/binarycoefficients/Brine_CO2.hpp +++ b/opm/material/binarycoefficients/Brine_CO2.hpp @@ -239,8 +239,8 @@ private: * \brief Returns the equilibrium molality of CO2 (mol CO2 / kg water) for a * CO2-water mixture at a given pressure and temperature * - * \param T the temperature [K] - * \param pg the gas phase pressure [Pa] + * \param temperature The temperature [K] + * \param pg The gas phase pressure [Pa] */ static Scalar molalityCO2inPureWater_(Scalar temperature, Scalar pg) { Scalar A = computeA_(temperature, pg); // according to Spycher, Pruess and Ennis-King (2003) diff --git a/opm/material/binarycoefficients/H2O_CO2.hpp b/opm/material/binarycoefficients/H2O_CO2.hpp index 37ce79f3c..59bb8cd3b 100644 --- a/opm/material/binarycoefficients/H2O_CO2.hpp +++ b/opm/material/binarycoefficients/H2O_CO2.hpp @@ -82,8 +82,6 @@ public: /*! * \brief Diffusion coefficent [m^2/s] for molecular CO2 in liquid water. - * - * \todo */ template static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure) diff --git a/opm/material/binarycoefficients/H2O_Mesitylene.hpp b/opm/material/binarycoefficients/H2O_Mesitylene.hpp index 2bf51581a..e6b770956 100644 --- a/opm/material/binarycoefficients/H2O_Mesitylene.hpp +++ b/opm/material/binarycoefficients/H2O_Mesitylene.hpp @@ -98,13 +98,13 @@ public: /*! * \brief Diffusion coefficent [m^2/s] for mesitylene in liquid water. - * - * \todo */ template static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure) { - return 1.e-9; // This is just an order of magnitude. Please improve it! + // This is just an order of magnitude estimate. Please + // improve! + return 1.e-9; } }; diff --git a/opm/material/components/CO2.hpp b/opm/material/components/CO2.hpp index c27362d35..b705b69b9 100644 --- a/opm/material/components/CO2.hpp +++ b/opm/material/components/CO2.hpp @@ -146,13 +146,13 @@ public: /*! * \brief Returns true iff the gas phase is assumed to be compressible */ - static const bool gasIsCompressible() + static bool gasIsCompressible() { return true; } /*! * \brief Returns true iff the gas phase is assumed to be ideal */ - static const bool gasIsIdeal() + static bool gasIsIdeal() { return false; } /*! @@ -241,7 +241,7 @@ public: visco_CO2 = (mu0 + dmu)/1.0E6; /* conversion to [Pa s] */ return visco_CO2; - }; + } /*! * \brief Specific isobaric heat capacity of the component [J/kg] diff --git a/opm/material/components/Dnapl.hpp b/opm/material/components/Dnapl.hpp index 5a5072a1a..ba9d4c726 100644 --- a/opm/material/components/Dnapl.hpp +++ b/opm/material/components/Dnapl.hpp @@ -52,7 +52,7 @@ public: * \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of TCE. */ static Scalar molarMass() - { return 131.39e-3; /* [kg/mol] */ }; + { return 131.39e-3; /* [kg/mol] */ } /*! * \brief The vapor pressure in \f$\mathrm{[Pa]}\f$ of pure TCE @@ -61,7 +61,7 @@ public: * \param T temperature of component in \f$\mathrm{[K]}\f$ */ static Scalar vaporPressure(Scalar T) - { return 3900; /* [Pa] (at 20C) */ }; + { return 3900; /* [Pa] (at 20C) */ } /*! * \brief Returns true iff the gas phase is assumed to be compressible @@ -86,7 +86,7 @@ public: return IdealGas::density(molarMass(), temperature, pressure); - }; + } /*! * \brief Returns true iff the gas phase is assumed to be ideal @@ -110,7 +110,7 @@ public: * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ static Scalar liquidViscosity(Scalar temperature, Scalar pressure) - { return 5.7e-4; /* [Pa s] */ }; + { return 5.7e-4; /* [Pa s] */ } /*! * \brief The enthalpy of pure TCE at a given pressure and temperature \f$\mathrm{[J/kg]}\f$. diff --git a/opm/material/components/H2O.hpp b/opm/material/components/H2O.hpp index fd278940d..41f3d6500 100644 --- a/opm/material/components/H2O.hpp +++ b/opm/material/components/H2O.hpp @@ -517,13 +517,13 @@ public: /*! * \brief Returns true iff the gas phase is assumed to be compressible */ - static const bool gasIsCompressible() + static bool gasIsCompressible() { return true; } /*! * \brief Returns true iff the liquid phase is assumed to be compressible */ - static const bool liquidIsCompressible() + static bool liquidIsCompressible() { return true; } /*! @@ -601,7 +601,7 @@ public: /*! * \brief Returns true iff the gas phase is assumed to be ideal */ - static const bool gasIsIdeal() + static bool gasIsIdeal() { return false; } /*! diff --git a/opm/material/components/Lnapl.hpp b/opm/material/components/Lnapl.hpp index d3e9099a7..e97add62b 100644 --- a/opm/material/components/Lnapl.hpp +++ b/opm/material/components/Lnapl.hpp @@ -67,7 +67,7 @@ public: * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ static Scalar liquidViscosity(Scalar temperature, Scalar pressure) - { return 8e-3; }; + { return 8e-3; } }; } // namespace Opm diff --git a/opm/material/components/Mesitylene.hpp b/opm/material/components/Mesitylene.hpp index d7df1ce76..129de7d94 100644 --- a/opm/material/components/Mesitylene.hpp +++ b/opm/material/components/Mesitylene.hpp @@ -173,7 +173,7 @@ public: } /*! - * \brief + * \brief The density of pure mesitylene vapor at a given pressure and temperature \f$\mathrm{[kg/m^3]}\f$. * * \param temperature temperature of component in \f$\mathrm{[K]}\f$ * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ diff --git a/opm/material/components/TabulatedComponent.hpp b/opm/material/components/TabulatedComponent.hpp index 6740970f0..90aa0c89a 100644 --- a/opm/material/components/TabulatedComponent.hpp +++ b/opm/material/components/TabulatedComponent.hpp @@ -44,10 +44,11 @@ namespace Opm * At the moment, this class can only handle the sub-critical fluids * since it tabulates along the vapor pressure curve. * - * \tparam Scalar The type used for scalar values - * \tparam Scalar The component which ought to be tabulated + * \tparam Scalar The type used for scalar values + * \tparam RawComponent The component which ought to be tabulated * \tparam useVaporPressure If true, tabulate all quantities along the - * vapor pressure curve, if false use the pressure range [p_min, p_max] + * vapor pressure curve, if false use the + * pressure range [p_min, p_max] */ template class TabulatedComponent diff --git a/opm/material/constraintsolvers/NcpFlash.hpp b/opm/material/constraintsolvers/NcpFlash.hpp index 12e8205dc..0038827b6 100644 --- a/opm/material/constraintsolvers/NcpFlash.hpp +++ b/opm/material/constraintsolvers/NcpFlash.hpp @@ -650,9 +650,9 @@ protected: // if the phase's fugacity coefficients are composition // dependent, update them as well. if (!FluidSystem::isIdealMixture(phaseIdx)) { - for (int compIdx = 0; compIdx < numComponents; ++compIdx) { - Scalar phi = FluidSystem::fugacityCoefficient(fluidState, paramCache, phaseIdx, compIdx); - fluidState.setFugacityCoefficient(phaseIdx, compIdx, phi); + for (int fugCompIdx = 0; fugCompIdx < numComponents; ++fugCompIdx) { + Scalar phi = FluidSystem::fugacityCoefficient(fluidState, paramCache, phaseIdx, fugCompIdx); + fluidState.setFugacityCoefficient(phaseIdx, fugCompIdx, phi); } } } diff --git a/opm/material/fluidmatrixinteractions/BrooksCorey.hpp b/opm/material/fluidmatrixinteractions/BrooksCorey.hpp index ef7c0cb15..7be55976f 100644 --- a/opm/material/fluidmatrixinteractions/BrooksCorey.hpp +++ b/opm/material/fluidmatrixinteractions/BrooksCorey.hpp @@ -260,7 +260,6 @@ public: * p_C = p_e\overline{S}_w^{-1/\lambda} * \f] * - * \param Sw Effective saturation of the wetting phase \f$[-]\f$ * \param params The parameters of the capillary pressure curve * (for Brooks-Corey: Entry pressure and shape factor) */ @@ -287,7 +286,6 @@ public: \overline{S}_w = (\frac{p_C}{p_e})^{-\lambda} \f] * - * \param pc Capillary pressure \f$[Pa]\f$ * \param params The parameters of the capillary pressure curve * (for Brooks-Corey: Entry pressure and shape factor) */ @@ -326,7 +324,6 @@ public: -\frac{p_e}{\lambda} \overline{S}_w^{-1/\lambda - 1} \f] * - * \param Sw Effective saturation of the wetting phase \f$[-]\f$ * \param params The parameters of the capillary pressure curve * (for Brooks-Corey: Entry pressure and shape factor) */ @@ -348,7 +345,6 @@ public: * regard to the capillary pressure according to Brooks and * Corey. * - * \param pcnw Capillary pressure \f$[Pa]\f$ * \param params The parameters of the capillary pressure curve * (for Brooks-Corey: Entry pressure and shape factor) */ @@ -370,7 +366,6 @@ public: * the medium implied by the Brooks-Corey * parameterization. * - * \param Sw Effective saturation of the wetting phase \f$[-]\f$ * \param params The parameters of the capillary pressure curve * (for Brooks-Corey: Entry pressure and shape factor) */ @@ -406,7 +401,6 @@ public: * the medium as implied by the Brooks-Corey * parameterization. * - * \param Sw Effective saturation of the wetting phase \f$[-]\f$ * \param params The parameters of the capillary pressure curve * (for Brooks-Corey: Entry pressure and shape factor) */ diff --git a/opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp b/opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp index e76ecabf2..2f10871ae 100644 --- a/opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp +++ b/opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp @@ -277,10 +277,6 @@ public: * \brief The capillary pressure-saturation curve. * * - * \param Sw Absolute saturation of the wetting phase - * \f$\overline{S}_w\f$. It is converted to effective - * saturation and then handed over to the material law - * actually used for calculation. * \param params A object that stores the appropriate coefficients * for the respective law. * @@ -411,8 +407,6 @@ public: /*! * \brief The relative permeability for the wetting phase. * - * \param Sw Absolute saturation of the wetting phase \f$\overline{S}_w\f$. It is converted to effective saturation - * and then handed over to the material law actually used for calculation. * \param params A container object that is populated with the appropriate coefficients for the respective law. * Therefore, in the (problem specific) spatialParameters first, the material law is chosen, and then the params container * is constructed accordingly. Afterwards the values are set there, too. diff --git a/opm/material/fluidstates/FluidStateTemperatureModules.hpp b/opm/material/fluidstates/FluidStateTemperatureModules.hpp index dd9b0e5a4..c6824e82a 100644 --- a/opm/material/fluidstates/FluidStateTemperatureModules.hpp +++ b/opm/material/fluidstates/FluidStateTemperatureModules.hpp @@ -127,9 +127,11 @@ public: { temperature_ = fs.temperature(/*phaseIdx=*/0); +#ifndef NDEBUG for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { - assert(fs.temperature(phaseIdx) == temperature_); + assert(std::abs(fs.temperature(phaseIdx) - temperature_) < 1e-30); } +#endif } /*! diff --git a/opm/material/fluidsystems/ParameterCacheBase.hpp b/opm/material/fluidsystems/ParameterCacheBase.hpp index bd40866e0..c79efc41b 100644 --- a/opm/material/fluidsystems/ParameterCacheBase.hpp +++ b/opm/material/fluidsystems/ParameterCacheBase.hpp @@ -38,10 +38,17 @@ public: * \brief Constants for ORing the quantities of the fluid state that have not changed since the last update. */ enum ExceptQuantities { - None = 0, //!< All quantities have been (potentially) modified. - Temperature = 1, //< The temperature has not been modified - Pressure = 2, //< The pressures have not been modified - Composition = 4 //< The compositions have not been modified + //! All quantities have been (potentially) modified. + None = 0, + + //! The temperature has not been modified + Temperature = 1, + + //! The pressures have not been modified + Pressure = 2, + + //! The compositions have not been modified + Composition = 4 }; ParameterCacheBase()