diff --git a/dumux/material/components/tabulatedcomponent.hh b/dumux/material/components/tabulatedcomponent.hh index 36f828245d10dd1a4ad946e979c94dd6d7e71cd7..497ca323642865fb188f8037af3ab465229a0400 100644 --- a/dumux/material/components/tabulatedcomponent.hh +++ b/dumux/material/components/tabulatedcomponent.hh @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -96,8 +97,8 @@ public: * \param pressMax The maximum of the pressure range in \f$\mathrm{[Pa]}\f$ * \param nPress The number of entries/steps within the pressure range */ - static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, - Scalar pressMin, Scalar pressMax, unsigned nPress) + static void init(Scalar tempMin, Scalar tempMax, std::size_t nTemp, + Scalar pressMin, Scalar pressMax, std::size_t nPress) { #ifndef NDEBUG initialized_ = true; @@ -111,6 +112,15 @@ public: nPress_ = nPress; nDensity_ = nPress_; + std::cout << "-------------------------------------------------------------------------\n" + << "Initializing tables for the " << RawComponent::name() + << " fluid properties (" << nTemp*nPress << " entries).\n" + << "Temperature -> min: " << std::scientific << std::setprecision(3) + << tempMin << ", max: " << tempMax << ", n: " << nTemp << '\n' + << "Pressure -> min: " << std::scientific << std::setprecision(3) + << pressMin << ", max: " << pressMax << ", n: " << nPress << '\n' + << "-------------------------------------------------------------------------" << std::endl; + // resize & initilialize the arrays with NaN assert(std::numeric_limits::has_quiet_NaN); const auto NaN = std::numeric_limits::quiet_NaN(); diff --git a/dumux/material/fluidsystems/2p1c.hh b/dumux/material/fluidsystems/2p1c.hh index 33d19365212ba3fab5f4e8cfd0cd70b7ab0a142c..06f369f5d3418cb6c426f7022164ae7362ff38e3 100644 --- a/dumux/material/fluidsystems/2p1c.hh +++ b/dumux/material/fluidsystems/2p1c.hh @@ -256,11 +256,8 @@ public: static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress) { - if (Component::isTabulated) { - std::cout << "Initializing tables for the fluid properties (" - << nTemp*nPress - << " entries).\n"; - + if (Component::isTabulated) + { Component::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress); } diff --git a/dumux/material/fluidsystems/2pimmiscible.hh b/dumux/material/fluidsystems/2pimmiscible.hh index de49c4011c8c615f63cb387297c6419deeb6cce8..e65823f8d8300c007665a5db556d8e676b17c9cd 100644 --- a/dumux/material/fluidsystems/2pimmiscible.hh +++ b/dumux/material/fluidsystems/2pimmiscible.hh @@ -274,7 +274,32 @@ public: * \brief Initialize the fluid system's static parameters */ static void init() - {} + { + // initialize with some default values + init(/*tempMin=*/273.15, /*tempMax=*/623.15, /*numTemp=*/100, + /*pMin=*/-10.0, /*pMax=*/20e6, /*numP=*/200); + } + + /*! + * \brief Initialize the fluid system's static parameters using + * problem specific temperature and pressure ranges + * + * \param tempMin The minimum temperature used for tabulation of water \f$\mathrm{[K]}\f$ + * \param tempMax The maximum temperature used for tabulation of water\f$\mathrm{[K]}\f$ + * \param nTemp The number of ticks on the temperature axis of the table of water + * \param pressMin The minimum pressure used for tabulation of water \f$\mathrm{[Pa]}\f$ + * \param pressMax The maximum pressure used for tabulation of water \f$\mathrm{[Pa]}\f$ + * \param nPress The number of ticks on the pressure axis of the table of water + */ + static void init(Scalar tempMin, Scalar tempMax, std::size_t nTemp, + Scalar pressMin, Scalar pressMax, std::size_t nPress) + { + if (Fluid0::Component::isTabulated) + Fluid0::Component::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress); + + if (Fluid1::Component::isTabulated) + Fluid1::Component::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress); + } using Base::density; /*! diff --git a/dumux/material/fluidsystems/brineair.hh b/dumux/material/fluidsystems/brineair.hh index e1b1db39ff23aa565f94e3dc2eedf9e966a6e2f9..490d037a08f4c5e49457a76bf93850ea75ce432e 100644 --- a/dumux/material/fluidsystems/brineair.hh +++ b/dumux/material/fluidsystems/brineair.hh @@ -279,11 +279,8 @@ public: else std::cout << "Using fast Brine-Air fluid system\n"; - if (H2O::isTabulated) { - std::cout << "Initializing tables for the H2O fluid properties (" - << nTemp*nPress - << " entries).\n"; - + if (H2O::isTabulated) + { H2O::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress); } diff --git a/dumux/material/fluidsystems/h2oair.hh b/dumux/material/fluidsystems/h2oair.hh index 7edace0ec291789480a44814a32cc73b5edfd90b..18346200a9d74a356fe5c847fb007a9ff2033bc2 100644 --- a/dumux/material/fluidsystems/h2oair.hh +++ b/dumux/material/fluidsystems/h2oair.hh @@ -345,11 +345,8 @@ public: else std::cout << "Using fast H2O-Air fluid system\n"; - if (H2O::isTabulated) { - std::cout << "Initializing tables for the H2O fluid properties (" - << nTemp*nPress - << " entries).\n"; - + if (H2O::isTabulated) + { H2O::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress); } diff --git a/dumux/material/fluidsystems/h2oairmesitylene.hh b/dumux/material/fluidsystems/h2oairmesitylene.hh index e44dcad3c89f98456060251795fbcf10ebf6850c..e725bc6fe9f40be38a00c81e858a6e23cb89b6e0 100644 --- a/dumux/material/fluidsystems/h2oairmesitylene.hh +++ b/dumux/material/fluidsystems/h2oairmesitylene.hh @@ -110,11 +110,8 @@ public: 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"; - + if (H2O::isTabulated) + { H2O::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress); } diff --git a/dumux/material/fluidsystems/h2oairxylene.hh b/dumux/material/fluidsystems/h2oairxylene.hh index 1805ef2dcd9741bea738f9f722603a068c6d7564..bd48994c5fcb7656e4470867e0ee7e7526f1ae4d 100644 --- a/dumux/material/fluidsystems/h2oairxylene.hh +++ b/dumux/material/fluidsystems/h2oairxylene.hh @@ -110,11 +110,8 @@ public: 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"; - + if (H2O::isTabulated) + { H2O::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress); } diff --git a/dumux/material/fluidsystems/h2oheavyoil.hh b/dumux/material/fluidsystems/h2oheavyoil.hh index 14f959b814558b7cc05b34b14fde3c8f5331c98c..bae72fd9c7b3d9b0f48bcfe745b126408f3a68aa 100644 --- a/dumux/material/fluidsystems/h2oheavyoil.hh +++ b/dumux/material/fluidsystems/h2oheavyoil.hh @@ -99,11 +99,8 @@ public: 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"; - + if (H2O::isTabulated) + { H2O::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress); } diff --git a/dumux/material/fluidsystems/h2on2.hh b/dumux/material/fluidsystems/h2on2.hh index 1d2b2cb2e136894754c6224b7760586107072d0a..118a8128cfb1f9e6f26d6605bc249f6171c1e566 100644 --- a/dumux/material/fluidsystems/h2on2.hh +++ b/dumux/material/fluidsystems/h2on2.hh @@ -337,11 +337,8 @@ public: else std::cout << "Using fast H2O-N2 fluid system\n"; - if (H2O::isTabulated) { - std::cout << "Initializing tables for the H2O fluid properties (" - << nTemp*nPress - << " entries).\n"; - + if (H2O::isTabulated) + { TabulatedH2O::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress); } diff --git a/dumux/material/fluidsystems/h2on2o2.hh b/dumux/material/fluidsystems/h2on2o2.hh index c2767b3bd440bb7f595dd216fcf2677993c3bac9..11bf5b76183d23fb905ed33699b567d1f77b127d 100644 --- a/dumux/material/fluidsystems/h2on2o2.hh +++ b/dumux/material/fluidsystems/h2on2o2.hh @@ -409,11 +409,8 @@ public: else std::cout << "Using fast H2O-N2-O2 fluid system\n"; - if (H2O::isTabulated) { - std::cout << "Initializing tables for the H2O fluid properties (" - << nTemp*nPress - << " entries).\n"; - + if (H2O::isTabulated) + { TabulatedH2O::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress); }