diff --git a/test/multidomain/dualnetwork/constant.hh b/test/multidomain/dualnetwork/constant.hh deleted file mode 100644 index 40ee2acc3aaaa9e0f7e8ba46ebbcdf501f26e1da..0000000000000000000000000000000000000000 --- a/test/multidomain/dualnetwork/constant.hh +++ /dev/null @@ -1,272 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * 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 3 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 - * \ingroup Components - * \brief Setting constant fluid properties via the input file. - */ -#ifndef DUMUX_TEST_MULTIDOMAIN_DUALNETWORK_COMPONENTS_NEW_CONSTANT_HH -#define DUMUX_TEST_MULTIDOMAIN_DUALNETWORK_COMPONENTS_NEW_CONSTANT_HH - -#include <dumux/common/parameters.hh> - -#include <dumux/material/components/base.hh> -#include <dumux/material/components/liquid.hh> -#include <dumux/material/components/gas.hh> -#include <dumux/material/components/solid.hh> - -namespace Dumux { -namespace Components { - -/*! - * \ingroup Components - * \brief A component which returns run time specified values - * for all fluid properties. - * - * \tparam id The id used to read from the input file / parametertree - * \tparam Scalar The type used for scalar values - * - * \note For the constant component with id=1 you would specify the parameters in the input file as follows - * \code{.ini} - * [1.Component] - * MolarMass = 0.018 # kg/mol - * \endcode - * \note If you only have one component you can also omit the "1.". - */ -template<int id, class Scalar> -class NewConstant -: public Components::Base<Scalar, NewConstant<id, Scalar> > -, public Components::Liquid<Scalar, NewConstant<id, Scalar> > -, public Components::Gas<Scalar, NewConstant<id, Scalar> > -, public Components::Solid<Scalar, NewConstant<id, Scalar> > -{ - -public: - /*! - * \brief Returns true if the gas phase is assumed to be compressible - */ - static constexpr bool gasIsCompressible() - { return false; } - - /*! - * \brief Returns true if the gas phase viscosity is constant - */ - static constexpr bool gasViscosityIsConstant() - { return true; } - - /*! - * \brief Returns true if the gas phase is assumed to be ideal - */ - static constexpr bool gasIsIdeal() - { return true; } - - /*! - * \brief Returns true if the liquid phase is assumed to be compressible - */ - static constexpr bool liquidIsCompressible() - { return false; } - - /*! - * \brief Returns true if the liquid phase viscosity is constant - */ - static constexpr bool liquidViscosityIsConstant() - { return true; } - - /*! - * \brief A human readable name for the component. - */ - static const std::string& name() - { - static const std::string name = getParamFromGroup<std::string>(std::to_string(id), "Component.Name", "component"); - return name; - } - - /*! - * \brief The mass in \f$\mathrm{[kg]}\f$ of one mole of the component. - */ - static Scalar molarMass() - { - static const Scalar molarMass = getParamFromGroup<Scalar>(std::to_string(id), "Component.MolarMass"); - return molarMass; - } - - /*! - * \brief Sets the liquid density in \f$\mathrm{[kg/m^3]}\f$. - * - * \param temperature phase temperature in \f$\mathrm{[K]}\f$ - * \param pressure phase pressure in \f$\mathrm{[Pa]}\f$ - */ - static Scalar liquidDensity(Scalar temperature, Scalar pressure) - { - static const Scalar density = getParamFromGroup<Scalar>(std::to_string(id), "Component.LiquidDensity"); - return density; - } - - /*! - * \brief The molar density in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. - * - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ - * - */ - static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure) - { return liquidDensity(temperature, pressure)/molarMass(); } - - /*! - * \brief Sets the liquid dynamic viscosity in \f$\mathrm{[Pa*s]}\f$. - * - * Although the dynamic viscosity \f$\mathrm{[Pa*s]}\f$ is returned, - * the kinematic viscosity \f$\mathrm{[m^2/s]}\f$ is requested from run time input. - * - * \param temperature phase temperature in \f$\mathrm{[K]}\f$ - * \param pressure phase pressure in \f$\mathrm{[Pa]}\f$ - */ - static Scalar liquidViscosity(Scalar temperature, Scalar pressure) - { - static const Scalar kinematicViscosity = getParamFromGroup<Scalar>(std::to_string(id), "Component.LiquidKinematicViscosity"); - return kinematicViscosity * liquidDensity(temperature, pressure); - } - - /*! - * \brief Thermal conductivity of the component \f$\mathrm{[W/(m*K)]}\f$ as a liquid. - * \param temperature temperature of phase in \f$\mathrm{[K]}\f$ - * \param pressure pressure of phase in \f$\mathrm{[Pa]}\f$ - */ - static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure) - { - static const Scalar thermalConductivity = getParamFromGroup<Scalar>(std::to_string(id), "Component.LiquidThermalConductivity"); - return thermalConductivity; - } - - /*! - * \brief Specific internal energy of the component \f$\mathrm{[J/kg]}\f$ as a liquid. - * \param temperature temperature of phase in \f$\mathrm{[K]}\f$ - * \param pressure pressure of phase in \f$\mathrm{[Pa]}\f$ - */ - static Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure) - { - // u = c * dT for incompressible fluids - const Scalar heatCapacity = liquidHeatCapacity(temperature, pressure); - static const Scalar tRef = getParamFromGroup<Scalar>(std::to_string(id), "Component.ReferenceTemperature", 293.15); - return heatCapacity * (temperature - tRef); - } - - /*! - * \brief Specific enthalpy of the component \f$\mathrm{[J/kg]}\f$ as a liquid. - * - * \param temperature temperature of phase in \f$\mathrm{[K]}\f$ - * \param pressure pressure of phase in \f$\mathrm{[Pa]}\f$ - */ - static Scalar liquidEnthalpy(Scalar temperature, Scalar pressure) - { - const Scalar u = liquidInternalEnergy(temperature, pressure); - return u; - // Do not include volume change work - // const Scalar rho = liquidDensity(temperature, pressure); - // return u + pressure / rho; - } - - /*! - * \brief Specific isobaric heat capacity of the component \f$\mathrm{[J/(kg*K)]}\f$ as a liquid. - * - * \param temperature temperature of phase in \f$\mathrm{[K]}\f$ - * \param pressure pressure of phase in \f$\mathrm{[Pa]}\f$ - */ - static Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure) - { - static const Scalar heatCapacity = getParamFromGroup<Scalar>(std::to_string(id), "Component.LiquidHeatCapacity"); - return heatCapacity; - } - - /*! - * \brief Sets the gas density in \f$\mathrm{[kg/m^3]}\f$. - * - * \param temperature phase temperature in \f$\mathrm{[K]}\f$ - * \param pressure phase pressure in \f$\mathrm{[Pa]}\f$ - */ - static Scalar gasDensity(Scalar temperature, Scalar pressure) - { - static const Scalar density = getParamFromGroup<Scalar>(std::to_string(id), "Component.GasDensity"); - return density; - } - - /*! - * \brief The molar density in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. - * - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ - * - */ - static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) - { return gasDensity(temperature, pressure)/molarMass(); } - - - /*! - * \brief Sets the gas dynamic viscosity in \f$\mathrm{[Pa*s]}\f$. - * - * Although the dynamic viscosity \f$\mathrm{[Pa*s]}\f$ is returned, - * the kinematic viscosity \f$\mathrm{[m^2/s]}\f$ is requested from run time input. - * - * \param temperature phase temperature in \f$\mathrm{[K]}\f$ - * \param pressure phase pressure in \f$\mathrm{[Pa]}\f$ - */ - static Scalar gasViscosity(Scalar temperature, Scalar pressure) - { - static const Scalar kinematicViscosity = getParamFromGroup<Scalar>(std::to_string(id), "Component.GasKinematicViscosity"); - return kinematicViscosity * gasDensity(temperature, pressure); - } - - /*! - * \brief The density in \f$\mathrm{[kg/m^3]}\f$ of the component at a given pressure in - * \f$\mathrm{[Pa]}\f$ and temperature in \f$\mathrm{[K]}\f$. - * - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - */ - static Scalar solidDensity(Scalar temperature) - { - static const Scalar density = getParamFromGroup<Scalar>(std::to_string(id), "Component.SolidDensity"); - return density; - } - - /*! - * \brief Thermal conductivity of the component \f$\mathrm{[W/(m*K)]}\f$ as a solid. - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - */ - static Scalar solidThermalConductivity(Scalar temperature) - { - static const Scalar solidThermalConductivity = getParamFromGroup<Scalar>(std::to_string(id), "Component.SolidThermalConductivity"); - return solidThermalConductivity; - } - - /*! - * \brief Specific isobaric heat capacity of the component \f$\mathrm{[J/(kg*K)]}\f$ as a solid. - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - */ - static Scalar solidHeatCapacity(Scalar temperature) - { - static const Scalar solidHeatCapacity = getParamFromGroup<Scalar>(std::to_string(id), "Component.SolidHeatCapacity"); - return solidHeatCapacity; - } -}; - -} // end namespace Components - -} // end namespace Dumux - -#endif diff --git a/test/multidomain/dualnetwork/properties.hh b/test/multidomain/dualnetwork/properties.hh index b593f4fdc689892143eb6ebeaf9b50c901be8884..d35a1718d5f1063b9b18e1f6beb6f23a252b167d 100644 --- a/test/multidomain/dualnetwork/properties.hh +++ b/test/multidomain/dualnetwork/properties.hh @@ -27,11 +27,11 @@ #include <dumux/io/grid/gridmanager_sub.hh> #include <dumux/porenetwork/solidenergy/model.hh> +#include <dumux/material/components/constant.hh> #include "problem_solid.hh" #include "spatialparams.hh" #include "fourierslaw.hh" -#include "constant.hh" namespace Dumux::Properties { @@ -66,7 +66,7 @@ template<class TypeTag> struct SolidSystem<TypeTag, TTag::PNMSolidModel> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using InertComponent = Components::NewConstant<1, Scalar>; + using InertComponent = Components::Constant<1, Scalar>; using type = SolidSystems::InertSolidPhase<Scalar, InertComponent>; }; @@ -74,12 +74,12 @@ template<class TypeTag> struct HeatConductionType<TypeTag, TTag::PNMSolidModel> { using type = PoreNetwork::FlexibleFouriersLaw<false>; }; - } // end namespace Dumux::Properties #include <dumux/porenetwork/1p/model.hh> #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/porousmediumflow/1p/incompressiblelocalresidual.hh> +#include <dumux/porousmediumflow/nonisothermal/localresidual_incompressible.hh> //local residual for incompressible nonisothermal flow #include "problem_void.hh" @@ -100,7 +100,7 @@ template<class TypeTag> struct FluidSystem<TypeTag, TTag::PNMVoidModel> { using Scalar = GetPropType<TypeTag, Scalar>; - using type = FluidSystems::OnePLiquid<Scalar, Dumux::Components::NewConstant<2, Scalar>> ; + using type = FluidSystems::OnePLiquid<Scalar, Dumux::Components::Constant<2, Scalar>> ; }; // Set the grid type @@ -128,6 +128,12 @@ template<class TypeTag> struct LocalResidual<TypeTag, TTag::PNMVoidModel> { using type = OnePIncompressibleLocalResidual<TypeTag>; }; +template<class TypeTag> +struct EnergyLocalResidual<TypeTag, TTag::PNMVoidModel> +{ + using type = Dumux::EnergyLocalResidualIncompressible<TypeTag> ; //use local residual for incompressible nonisothermal flow as in Dumux term of pressure work gets neglected +}; + //! The spatial parameters to be employed. //! Use PNMOnePSpatialParams by default. template<class TypeTag>