diff --git a/test/material/fluidmatrixinteractions/CMakeLists.txt b/test/material/fluidmatrixinteractions/CMakeLists.txt index 6b62f26a24d9cfad44ba66917dd0c7f4b29faa78..1b172d15a1e34b984b363461aba074d8bd8f7df3 100644 --- a/test/material/fluidmatrixinteractions/CMakeLists.txt +++ b/test/material/fluidmatrixinteractions/CMakeLists.txt @@ -1,34 +1,21 @@ add_subdirectory("2p") -add_input_file_links() +dune_add_test(SOURCES test_effectivediffusivitymillingtonquirk.cc + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzyData --delimiter " " + --files ${CMAKE_SOURCE_DIR}/test/references/effectivediffusivitymillingtonquirk-reference.dat + ${CMAKE_CURRENT_BINARY_DIR}/millingtonquirk_d_eff.dat + --command "${CMAKE_CURRENT_BINARY_DIR}/test_effectivediffusivitymillingtonquirk") -add_dumux_test(test_effectivediffusivitymillingtonquirk test_effectivediffusivitymillingtonquirk test_effectivediffusivitymillingtonquirk.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzyData --delimiter " " - --files ${CMAKE_SOURCE_DIR}/test/references/effectivediffusivitymillingtonquirk-reference.dat - ${CMAKE_CURRENT_BINARY_DIR}/millingtonquirk_d_eff.dat - --command "${CMAKE_CURRENT_BINARY_DIR}/test_effectivediffusivitymillingtonquirk") - -add_dumux_test(test_effectivediffusivityconstant test_effectivediffusivityconstant test_effectivediffusivityconstant.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzyData --delimiter " " - --files ${CMAKE_SOURCE_DIR}/test/references/effectivediffusivityconstanttau-reference.dat - ${CMAKE_CURRENT_BINARY_DIR}/constant_d_eff.dat - --command "${CMAKE_CURRENT_BINARY_DIR}/test_effectivediffusivityconstant") - -add_dumux_test(test_effectivediffusivityconstanttau test_effectivediffusivityconstanttau test_effectivediffusivityconstanttau.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzyData --delimiter " " - --files ${CMAKE_SOURCE_DIR}/test/references/effectivediffusivityconstanttau-reference.dat - ${CMAKE_CURRENT_BINARY_DIR}/constanttau_d_eff.dat - --command "${CMAKE_CURRENT_BINARY_DIR}/test_effectivediffusivityconstanttau") +dune_add_test(SOURCES test_effectivediffusivityconstanttortuosity.cc + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzyData --delimiter " " + --files ${CMAKE_SOURCE_DIR}/test/references/effectivediffusivityconstanttau-reference.dat + ${CMAKE_CURRENT_BINARY_DIR}/constant_d_eff.dat + --command "${CMAKE_CURRENT_BINARY_DIR}/test_effectivediffusivityconstanttortuosity -SpatialParams.Tortuosity 0.3") #install sources install(FILES -testproblem.hh -diffusivityspatialparams.hh -fluidmatrixinteractionsspatialparams.hh -test_effectivediffusivityconstant.cc -test_effectivediffusivityconstanttau.cc +test_effectivediffusivityconstanttortuosity.cc test_effectivediffusivitymillingtonquirk.cc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/material/fluidmatrixinteractions) diff --git a/test/material/fluidmatrixinteractions/fluidmatrixinteractionsspatialparams.hh b/test/material/fluidmatrixinteractions/fluidmatrixinteractionsspatialparams.hh deleted file mode 100644 index d3c0aaf66f615d0259bd9d0d79ca15a48d911308..0000000000000000000000000000000000000000 --- a/test/material/fluidmatrixinteractions/fluidmatrixinteractionsspatialparams.hh +++ /dev/null @@ -1,134 +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 2 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 - * - * \brief Definition of the spatial parameters for the effective diffusivity tests. - */ -#ifndef DUMUX_FLUIDMATRIXINTERACTION_TEST_SPATIAL_PARAMS_HH -#define DUMUX_FLUIDMATRIXINTERACTION_TEST_SPATIAL_PARAMS_HH - -#include <dumux/material/spatialparams/implicit.hh> -#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh> -#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh> - -#include <dumux/porousmediumflow/2p2c/implicit/model.hh> - -namespace Dumux -{ - -//forward declaration -template<class TypeTag> -class FluidMatrixInteractionTestSpatialParams; - -namespace Properties -{ -// The spatial parameters TypeTag -NEW_TYPE_TAG(FluidMatrixInteractionTestSpatialParams); - -// Set the material law parameterized by absolute saturations -SET_TYPE_PROP(FluidMatrixInteractionTestSpatialParams, - MaterialLaw, - EffToAbsLaw<RegularizedBrooksCorey<typename GET_PROP_TYPE(TypeTag, Scalar)> >); - -// Define whether to open a gnuplot window -NEW_PROP_TAG(OutputOpenPlotWindow); -SET_BOOL_PROP(FluidMatrixInteractionTestSpatialParams, OutputOpenPlotWindow, false); -} - -/*! - * \ingroup MaterialTestProblems - * \brief Definition of the spatial parameters for the effective diffusivity tests. - */ -template<class TypeTag> -class FluidMatrixInteractionTestSpatialParams : public ImplicitSpatialParams<TypeTag> -{ - using ParentType = ImplicitSpatialParams<TypeTag>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - enum { - dim=GridView::dimension, - dimWorld=GridView::dimensionworld - }; - using GlobalPosition = Dune::FieldVector<Scalar,dimWorld>; - using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw); - using MaterialLawParams = typename MaterialLaw::Params; - -public: - - //! exort permeability type - using PermeabilityType = Scalar; - - /*! - * \brief The constructor - * - * \param gridView The grid view - */ - FluidMatrixInteractionTestSpatialParams(const Problem& problem, const GridView &gridView) - : ParentType(problem, gridView) - { - porosity_ = 0.3; - rhoSolid_ = 2700.0; - lambdaSolid_ = 2.8; - - // residual saturations - materialParams_.setSwr(0.2); - materialParams_.setSnr(0.0); - - // parameters for the Brooks-Corey law - materialParams_.setPe(1e4); - materialParams_.setLambda(2.0); - } - - //! \copydoc ImplicitProblem::permeabilityAtPos() - PermeabilityType permeabilityAtPos(const GlobalPosition &globalPos) const - { return 1e-10; } - - //! \copydoc ImplicitProblem::porosityAtPos() - Scalar porosityAtPos(const GlobalPosition &globalPos) const - { return porosity_; } - - //! \copydoc ImplicitProblem::materialLawParamsAtPos() - const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition &globalPos) const - { return materialParams_; } - - //! \copydoc ImplicitProblem::solidHeatCapacityAtPos() - Scalar solidHeatCapacityAtPos(const GlobalPosition &globalPos) const - { return 790; /* specific heat capacity of granite [J / (kg K)] */ } - - //! \copydoc ImplicitProblem::solidDensityAtPos() - Scalar solidDensityAtPos(const GlobalPosition &globalPos) const - { return rhoSolid_; /* density of granite [kg/m^3] */ } - - //! \copydoc ImplicitProblem::solidThermalConductivityAtPos() - Scalar solidThermalConductivityAtPos(const GlobalPosition &globalPos) const - { return lambdaSolid_; /* [W/(m K) */ } - -protected: - Scalar porosity_; - Scalar lambdaSolid_; - Scalar rhoSolid_; - - MaterialLawParams materialParams_; -}; - -} // end namespace Dumux - -#endif diff --git a/test/material/fluidmatrixinteractions/test_effectivediffusivityconstant.cc b/test/material/fluidmatrixinteractions/test_effectivediffusivityconstant.cc deleted file mode 100644 index 2c0ff0d2ebe8339e33310f14e9abb734ddc1edab..0000000000000000000000000000000000000000 --- a/test/material/fluidmatrixinteractions/test_effectivediffusivityconstant.cc +++ /dev/null @@ -1,70 +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 2 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 - * - * \brief Test for the constant tau effective diffusivity model - */ -#include <config.h> - -#include "testproblem.hh" -#include "diffusivityspatialparams.hh" - -#include <dumux/common/start.hh> -#include <dumux/material/fluidmatrixinteractions/diffusivityconstant.hh> - -namespace Dumux -{ -namespace Properties -{ -// Set thermal conductivity law -SET_TYPE_PROP(FluidMatrixInteractionTestProblem, EffectiveDiffusivityModel, DiffusivityConstant<TypeTag>); -SET_TYPE_PROP(FluidMatrixInteractionTestProblem, SpatialParams, DiffusivityTestSpatialParams<TypeTag>); -} -} - -/*! - * \brief Provides an interface for customizing error messages associated with - * reading in parameters. - * - * \param progName The name of the program, that was tried to be started. - * \param errorMsg The error message that was issued by the start function. - * Comprises the thing that went wrong and a general help message. - */ -void usage(const char *progName, const std::string &errorMsg) -{ - if (errorMsg.size() > 0) { - std::string errorMessageOut = "\nUsage: "; - errorMessageOut += progName; - errorMessageOut += " [options]\n"; - errorMessageOut += errorMsg; - errorMessageOut += "\n\nThe list of mandatory options for this program is:\n" - "\t-TimeManager.TEnd End of the simulation [s] \n" - "\t-TimeManager.DtInitial Initial timestep size [s] \n" - "\t definition in DGF format\n"; - - std::cout << errorMessageOut - << "\n"; - } -} - -int main(int argc, char** argv) -{ - return Dumux::start<TTAG(FluidMatrixInteractionTestProblem)>(argc, argv, usage); -} diff --git a/test/material/fluidmatrixinteractions/test_effectivediffusivityconstant.input b/test/material/fluidmatrixinteractions/test_effectivediffusivityconstant.input deleted file mode 100644 index 58e8e377d238e05c4c20cf05dd7f9580b9660d9d..0000000000000000000000000000000000000000 --- a/test/material/fluidmatrixinteractions/test_effectivediffusivityconstant.input +++ /dev/null @@ -1,16 +0,0 @@ -[TimeManager] -DtInitial = 1 # [s] -TEnd = 2 # [s] - -[Problem] -Name = test_effectivediffusivity_const - -[Grid] -UpperRight = 6 4 -Cells = 48 32 - -[Output] -File = constant_d_eff - -[] -TauTortuosity = 0.3 diff --git a/test/material/fluidmatrixinteractions/test_effectivediffusivityconstanttau.cc b/test/material/fluidmatrixinteractions/test_effectivediffusivityconstanttau.cc deleted file mode 100644 index 820ecabf6f25cd46e5490e471c4f717a079059a1..0000000000000000000000000000000000000000 --- a/test/material/fluidmatrixinteractions/test_effectivediffusivityconstanttau.cc +++ /dev/null @@ -1,70 +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 2 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 - * - * \brief Test for the constant tau effective diffusivity model - */ -#include <config.h> -#include "testproblem.hh" -#include "diffusivityspatialparams.hh" - -#include <dumux/common/start.hh> -#include <dumux/material/fluidmatrixinteractions/diffusivityconstanttau.hh> - -namespace Dumux -{ -namespace Properties -{ -// Set thermal conductivity law -SET_TYPE_PROP(FluidMatrixInteractionTestProblem, EffectiveDiffusivityModel, DiffusivityConstantTau<TypeTag, double>); -SET_TYPE_PROP(FluidMatrixInteractionTestProblem, SpatialParams, DiffusivityTestSpatialParams<TypeTag>); -} -} - -/*! - * \brief Provides an interface for customizing error messages associated with - * reading in parameters. - * - * \param progName The name of the program, that was tried to be started. - * \param errorMsg The error message that was issued by the start function. - * Comprises the thing that went wrong and a general help message. - */ -void usage(const char *progName, const std::string &errorMsg) -{ - if (errorMsg.size() > 0) { - std::string errorMessageOut = "\nUsage: "; - errorMessageOut += progName; - errorMessageOut += " [options]\n"; - errorMessageOut += errorMsg; - errorMessageOut += "\n\nThe list of mandatory options for this program is:\n" - "\t-TimeManager.TEnd End of the simulation [s] \n" - "\t-TimeManager.DtInitial Initial timestep size [s] \n" - "\t-Grid.File Name of the file containing the grid \n" - "\t definition in DGF format\n"; - - std::cout << errorMessageOut - << "\n"; - } -} - -int main(int argc, char** argv) -{ - return Dumux::start<TTAG(FluidMatrixInteractionTestProblem)>(argc, argv, usage); -} diff --git a/test/material/fluidmatrixinteractions/test_effectivediffusivityconstanttau.input b/test/material/fluidmatrixinteractions/test_effectivediffusivityconstanttau.input deleted file mode 100644 index 99a8d9d3657cc317b7e8c94dd8a92c6addcd7733..0000000000000000000000000000000000000000 --- a/test/material/fluidmatrixinteractions/test_effectivediffusivityconstanttau.input +++ /dev/null @@ -1,16 +0,0 @@ -tau = 0.3 - -[TimeManager] -DtInitial = 1 # [s] -TEnd = 2 # [s] - -[Problem] -Name = test_effectivediffusivity_consttau - -[Grid] -LowerLeft = 0 0 -UpperRight = 6 4 -Cells = 48 32 - -[Output] -File = constanttau_d_eff diff --git a/test/material/fluidmatrixinteractions/diffusivityspatialparams.hh b/test/material/fluidmatrixinteractions/test_effectivediffusivityconstanttortuosity.cc similarity index 52% rename from test/material/fluidmatrixinteractions/diffusivityspatialparams.hh rename to test/material/fluidmatrixinteractions/test_effectivediffusivityconstanttortuosity.cc index 983a9e7b5150099ff89180541348839076e6bd1c..5d1e31e6294b21b88adbd21b6cba612d04ed678a 100644 --- a/test/material/fluidmatrixinteractions/diffusivityspatialparams.hh +++ b/test/material/fluidmatrixinteractions/test_effectivediffusivityconstanttortuosity.cc @@ -19,46 +19,40 @@ /*! * \file * - * \brief Definition of the spatial parameters for the effective diffusivity tests. + * \brief Test for the Millington and Quirk effective diffusivity model */ -#ifndef DUMUX_DIFFUSIVITY_SPATIAL_PARAMS_HH -#define DUMUX_DIFFUSIVITY_SPATIAL_PARAMS_HH +#include <config.h> +#include <dumux/common/parameters.hh> #include <dumux/io/gnuplotinterface.hh> #include <dumux/io/ploteffectivediffusivitymodel.hh> -#include "fluidmatrixinteractionsspatialparams.hh" +#include <dumux/material/fluidmatrixinteractions/diffusivityconstanttortuosity.hh> -namespace Dumux -{ +namespace Dumux { +namespace Properties { +NEW_TYPE_TAG(TestTypeTag); +SET_TYPE_PROP(TestTypeTag, Scalar, double); +SET_TYPE_PROP(TestTypeTag, EffectiveDiffusivityModel, DiffusivityConstantTortuosity<typename GET_PROP_TYPE(TypeTag, Scalar)>); +} // end namespace Properties +} // end namespace Dumux -template<class TypeTag> -class DiffusivityTestSpatialParams - : public FluidMatrixInteractionTestSpatialParams<TypeTag> +int main(int argc, char** argv) { - using ParentType = FluidMatrixInteractionTestSpatialParams<TypeTag>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); -public: - DiffusivityTestSpatialParams(const Problem& problem, const GridView &gridView) - : ParentType(problem, gridView) {} + using namespace Dumux; + using TypeTag = TTAG(TestTypeTag); - /*! - * \brief This is called from the problem and creates a gnuplot output - * of e.g the pc-Sw curve - */ - void plotMaterialLaw() - { - GnuplotInterface<Scalar> gnuplot; - gnuplot.setOpenPlotWindow(GET_PARAM_FROM_GROUP(TypeTag, bool, Output, OpenPlotWindow)); - PlotEffectiveDiffusivityModel<TypeTag> plotEffectiveDiffusivityModel; - std::string fileName = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Output, File); - plotEffectiveDiffusivityModel.adddeffcurve(gnuplot, this->porosity_, 0.0, 1.0, fileName); - gnuplot.plot("d_eff"); - } -}; + Parameters::parseCommandLineArguments(argc, argv); -} // end namespace Dumux + GnuplotInterface<double> gnuplot; + gnuplot.setOpenPlotWindow(false); + + PlotEffectiveDiffusivityModel<TypeTag> plotEffectiveDiffusivityModel; + const std::string fileName = "constant_d_eff.dat"; + const double porosity = 0.3; // [-] + plotEffectiveDiffusivityModel.adddeffcurve(gnuplot, porosity, 0.0, 1.0, fileName); + + gnuplot.plot("d_eff"); -#endif + return 0; +} diff --git a/test/material/fluidmatrixinteractions/test_effectivediffusivitymillingtonquirk.cc b/test/material/fluidmatrixinteractions/test_effectivediffusivitymillingtonquirk.cc index 8c83edc3c0e3142076eaaa91f998ae1958697f59..ff2503a502e1ed6c9d9be1a4a9783e5b6795c923 100644 --- a/test/material/fluidmatrixinteractions/test_effectivediffusivitymillingtonquirk.cc +++ b/test/material/fluidmatrixinteractions/test_effectivediffusivitymillingtonquirk.cc @@ -22,49 +22,34 @@ * \brief Test for the Millington and Quirk effective diffusivity model */ #include <config.h> -#include "testproblem.hh" -#include "diffusivityspatialparams.hh" -#include <dumux/common/start.hh> +#include <dumux/io/gnuplotinterface.hh> +#include <dumux/io/ploteffectivediffusivitymodel.hh> + #include <dumux/material/fluidmatrixinteractions/diffusivitymillingtonquirk.hh> -namespace Dumux -{ -namespace Properties -{ -// Set thermal conductivity law -SET_TYPE_PROP(FluidMatrixInteractionTestProblem, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<double>); -SET_TYPE_PROP(FluidMatrixInteractionTestProblem, SpatialParams, DiffusivityTestSpatialParams<TypeTag>); -} -} +namespace Dumux { +namespace Properties { +NEW_TYPE_TAG(TestTypeTag); +SET_TYPE_PROP(TestTypeTag, Scalar, double); +SET_TYPE_PROP(TestTypeTag, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>); +} // end namespace Properties +} // end namespace Dumux -/*! - * \brief Provides an interface for customizing error messages associated with - * reading in parameters. - * - * \param progName The name of the program, that was tried to be started. - * \param errorMsg The error message that was issued by the start function. - * Comprises the thing that went wrong and a general help message. - */ -void usage(const char *progName, const std::string &errorMsg) +int main(int argc, char** argv) { - if (errorMsg.size() > 0) { - std::string errorMessageOut = "\nUsage: "; - errorMessageOut += progName; - errorMessageOut += " [options]\n"; - errorMessageOut += errorMsg; - errorMessageOut += "\n\nThe list of mandatory options for this program is:\n" - "\t-TimeManager.TEnd End of the simulation [s] \n" - "\t-TimeManager.DtInitial Initial timestep size [s] \n" - "\t-Grid.File Name of the file containing the grid \n" - "\t definition in DGF format\n"; + using namespace Dumux; + using TypeTag = TTAG(TestTypeTag); - std::cout << errorMessageOut - << "\n"; - } -} + GnuplotInterface<double> gnuplot; + gnuplot.setOpenPlotWindow(false); -int main(int argc, char** argv) -{ - return Dumux::start<TTAG(FluidMatrixInteractionTestProblem)>(argc, argv, usage); + PlotEffectiveDiffusivityModel<TypeTag> plotEffectiveDiffusivityModel; + const std::string fileName = "millingtonquirk_d_eff.dat"; + const double porosity = 0.3; // [-] + plotEffectiveDiffusivityModel.adddeffcurve(gnuplot, porosity, 0.0, 1.0, fileName); + + gnuplot.plot("d_eff"); + + return 0; } diff --git a/test/material/fluidmatrixinteractions/test_effectivediffusivitymillingtonquirk.input b/test/material/fluidmatrixinteractions/test_effectivediffusivitymillingtonquirk.input deleted file mode 100644 index 73671cc6b6b3a63a1aad0937c30f707443e844ca..0000000000000000000000000000000000000000 --- a/test/material/fluidmatrixinteractions/test_effectivediffusivitymillingtonquirk.input +++ /dev/null @@ -1,14 +0,0 @@ -[TimeManager] -DtInitial = 1 # [s] -TEnd = 2 # [s] - -[Problem] -Name = test_effectivediffusivity_mq - -[Grid] -LowerLeft = 0 0 -UpperRight = 6 4 -Cells = 48 32 - -[Output] -File = millingtonquirk_d_eff diff --git a/test/material/fluidmatrixinteractions/testproblem.hh b/test/material/fluidmatrixinteractions/testproblem.hh deleted file mode 100644 index 1c935b82edd0b371f6e2566a4df4b89111f6f271..0000000000000000000000000000000000000000 --- a/test/material/fluidmatrixinteractions/testproblem.hh +++ /dev/null @@ -1,170 +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 2 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 - * - * \brief Test for the constant tau effective diffusivity model - */ -#ifndef DUMUX_FLUIDMATRIXINTERACTION_TEST_PROBLEM_HH -#define DUMUX_FLUIDMATRIXINTERACTION_TEST_PROBLEM_HH - -#include <dumux/material/fluidsystems/h2on2.hh> - -#include <dumux/porousmediumflow/2p2c/implicit/model.hh> -#include <dumux/porousmediumflow/implicit/problem.hh> - -#include "fluidmatrixinteractionsspatialparams.hh" - -#define ISOTHERMAL 0 - -namespace Dumux -{ -template <class TypeTag> -class FluidMatrixInteractionTestProblem; - -namespace Properties -{ -NEW_TYPE_TAG(FluidMatrixInteractionTestProblem, INHERITS_FROM(BoxModel, TwoPTwoCNI, FluidMatrixInteractionTestSpatialParams)); - -// Set the grid type -SET_TYPE_PROP(FluidMatrixInteractionTestProblem, Grid, Dune::YaspGrid<2>); - -// Set the problem property -SET_TYPE_PROP(FluidMatrixInteractionTestProblem, Problem, FluidMatrixInteractionTestProblem<TypeTag>); - -// Set the wetting phase -SET_TYPE_PROP(FluidMatrixInteractionTestProblem, FluidSystem, FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, Scalar), false>); -} - - -/*! - * \ingroup MaterialTestProblems - * \brief Test for the effective diffusivity models - */ -template <class TypeTag > -class FluidMatrixInteractionTestProblem : public ImplicitPorousMediaProblem<TypeTag> -{ - using ParentType = ImplicitPorousMediaProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - enum { - pressureIdx = Indices::pressureIdx, - switchIdx = Indices::switchIdx, - temperatureIdx = Indices::temperatureIdx, - - // Phase State - wPhaseOnly = Indices::wPhaseOnly, - - // Grid and world dimension - dim = GridView::dimension, - dimWorld = GridView::dimensionworld - }; - - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager); - using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); - using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; - -public: - /*! - * \brief The constructor. - * - * \param timeManager The time manager - * \param gridView The grid view - */ - FluidMatrixInteractionTestProblem(TimeManager &timeManager, const GridView &gridView) - : ParentType(timeManager, gridView) - { - FluidSystem::init(273.15, 298.15, 5, 9e4, 5e5, 5); - this->spatialParams().plotMaterialLaw(); - } - - /*! - * \name Problem parameters - */ - // \{ - - /*! - * \brief The problem name. - * - * This is used as a prefix for files generated by the simulation. - */ - std::string name() const - { return GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Problem, Name); } - - // \} - - /*! - * \name Boundary conditions - */ - // \{ - - //! \copydoc ImplicitProblem::boundaryTypesAtPos() - BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const - { - BoundaryTypes bcTypes; - bcTypes.setAllDirichlet(); - return bcTypes; - } - - //! \copydoc ImplicitProblem::dirichletAtPos() - PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const - { - return initial_(globalPos); - } - - // \} - - /*! - * \name Volume terms - */ - // \{ - - //! \copydoc ImplicitProblem::initialAtPos() - PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const - { - return initial_(globalPos); - } - - //! \copydoc ImplicitProblem::initialPhasePresence() - int initialPhasePresence(const SubControlVolume& scv) const - { return wPhaseOnly; } - - // \} - -private: - // internal method for the initial condition (reused for the - // dirichlet conditions!) - PrimaryVariables initial_(const GlobalPosition &globalPos) const - { - PrimaryVariables values(0.0); - Scalar densityW = 1000.0; - values[pressureIdx] = 1e5 + globalPos[1]*densityW*9.81; - values[switchIdx] = 0.0; - values[temperatureIdx] = 283.0 + globalPos[1]*0.03; - return values; - } -}; - -} //end namespace Dumux - -#endif