Skip to content
Snippets Groups Projects
Commit 65e05e93 authored by Mathis Kelm's avatar Mathis Kelm Committed by Timo Koch
Browse files

[test][mpnc] Separate properties into their own header

parent d26a2d5d
No related branches found
No related tags found
1 merge request!2540[test][mpnc] Separate properties into their own header
Showing
with 423 additions and 466 deletions
...@@ -23,15 +23,10 @@ ...@@ -23,15 +23,10 @@
*/ */
#include <config.h> #include <config.h>
#include <ctime>
#include <iostream> #include <iostream>
#include <dune/common/parallel/mpihelper.hh> #include <dune/common/parallel/mpihelper.hh>
#include <dune/common/timer.hh> #include <dune/common/timer.hh>
#include <dune/grid/io/file/vtk.hh>
#include <dune/istl/io.hh>
#include "problem.hh"
#include <dumux/common/properties.hh> #include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh> #include <dumux/common/parameters.hh>
...@@ -47,39 +42,9 @@ ...@@ -47,39 +42,9 @@
#include <dumux/discretization/method.hh> #include <dumux/discretization/method.hh>
#include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/gridmanager.hh> #include <dumux/io/grid/gridmanager_yasp.hh>
/*! #include "properties.hh"
* \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 arguments for this program is:\n"
"\t-TimeManager.TEnd End of the simulation [s] \n"
"\t-TimeManager.DtInitial Initial timestep size [s] \n"
"\t-Grid.LowerLeft Lower left corner coordinates\n"
"\t-Grid.UpperRight Upper right corner coordinates\n"
"\t-Grid.Cells Number of cells in respective coordinate directions\n"
"\t definition in DGF format\n"
"\t-SpatialParams.LensLowerLeft coordinates of the lower left corner of the lens [m] \n"
"\t-SpatialParams.LensUpperRight coordinates of the upper right corner of the lens [m] \n"
"\t-SpatialParams.Permeability Permeability of the domain [m^2] \n"
"\t-SpatialParams.PermeabilityLens Permeability of the lens [m^2] \n";
std::cout << errorMessageOut
<< "\n";
}
}
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
...@@ -96,7 +61,7 @@ int main(int argc, char** argv) ...@@ -96,7 +61,7 @@ int main(int argc, char** argv)
DumuxMessage::print(/*firstCall=*/true); DumuxMessage::print(/*firstCall=*/true);
// parse command line arguments and input file // parse command line arguments and input file
Parameters::init(argc, argv, usage); Parameters::init(argc, argv);
// try to create a grid (from the given grid file or the input file) // try to create a grid (from the given grid file or the input file)
GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager;
......
...@@ -26,77 +26,15 @@ ...@@ -26,77 +26,15 @@
#ifndef DUMUX_MPNC_TWOPTWOC_COMPARISON_OBSTACLEPROBLEM_HH #ifndef DUMUX_MPNC_TWOPTWOC_COMPARISON_OBSTACLEPROBLEM_HH
#define DUMUX_MPNC_TWOPTWOC_COMPARISON_OBSTACLEPROBLEM_HH #define DUMUX_MPNC_TWOPTWOC_COMPARISON_OBSTACLEPROBLEM_HH
#include <dune/common/parametertreeparser.hh> #include <dumux/common/properties.hh>
#include <dune/grid/yaspgrid.hh> #include <dumux/common/parameters.hh>
#include <dumux/common/boundarytypes.hh> #include <dumux/common/boundarytypes.hh>
#include <dumux/discretization/box.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/porousmediumflow/mpnc/model.hh>
#include <dumux/porousmediumflow/problem.hh> #include <dumux/porousmediumflow/problem.hh>
#include <test/porousmediumflow/2p2c/mpnccomparison/iofields.hh>
#include <dumux/material/fluidsystems/h2on2.hh>
#include <dumux/material/fluidstates/compositional.hh>
#include <dumux/material/constraintsolvers/misciblemultiphasecomposition.hh> #include <dumux/material/constraintsolvers/misciblemultiphasecomposition.hh>
#include "spatialparams.hh"
namespace Dumux { namespace Dumux {
/*!
* \ingroup MPNCTests
* \brief Problem where air is injected in a unsaturated porous medium.
*
* This test compares a mpnc problem with a 2p2c problem.
*/
template <class TypeTag>
class MPNCComparisonProblem;
namespace Properties {
// Create new type tags
namespace TTag {
struct MPNCComparison { using InheritsFrom = std::tuple<MPNC>; };
struct MPNCComparisonBox { using InheritsFrom = std::tuple<MPNCComparison, BoxModel>; };
struct MPNCComparisonCC { using InheritsFrom = std::tuple<MPNCComparison, CCTpfaModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::MPNCComparison> { using type = Dune::YaspGrid<2>; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::MPNCComparison> { using type = MPNCComparisonProblem<TypeTag>; };
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::MPNCComparison>
{
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = MPNCComparisonSpatialParams<GridGeometry, Scalar>;
};
// Set fluid configuration
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::MPNCComparison>
{
using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>,
FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>;
};
// decide which type to use for floating values (double / quad)
template<class TypeTag>
struct Scalar<TypeTag, TTag::MPNCComparison> { using type = double; };
template<class TypeTag>
struct UseMoles<TypeTag, TTag::MPNCComparison> { static constexpr bool value = true; };
template<class TypeTag>
struct IOFields<TypeTag, TTag::MPNCComparison> { using type = TwoPTwoCMPNCIOFields; };
} // end namespace Dumux
/*! /*!
* \ingroup MPNCTests * \ingroup MPNCTests
* \brief Problem where air is injected in a unsaturated porous medium. * \brief Problem where air is injected in a unsaturated porous medium.
...@@ -310,6 +248,6 @@ private: ...@@ -310,6 +248,6 @@ private:
static constexpr Scalar eps_ = 1e-6; static constexpr Scalar eps_ = 1e-6;
std::string name_; std::string name_;
}; };
} // end namespace } // end namespace Dumux
#endif #endif
// -*- 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 MPNCTests
* \brief The properties of the problem where air is injected in a unsaturated porous medium.
*/
#ifndef DUMUX_MPNC_TWOPTWOC_COMPARISON_OBSTACLE_PROPERTIES_HH
#define DUMUX_MPNC_TWOPTWOC_COMPARISON_OBSTACLE_PROPERTIES_HH
#include <dune/grid/yaspgrid.hh>
#include <dumux/discretization/box.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/porousmediumflow/mpnc/model.hh>
#include <dumux/material/fluidsystems/h2on2.hh>
#include <dumux/material/fluidstates/compositional.hh>
#include <test/porousmediumflow/2p2c/mpnccomparison/iofields.hh>
#include "spatialparams.hh"
#include "problem.hh"
namespace Dumux::Properties {
// Create new type tags
namespace TTag {
struct MPNCComparison { using InheritsFrom = std::tuple<MPNC>; };
struct MPNCComparisonBox { using InheritsFrom = std::tuple<MPNCComparison, BoxModel>; };
struct MPNCComparisonCC { using InheritsFrom = std::tuple<MPNCComparison, CCTpfaModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::MPNCComparison> { using type = Dune::YaspGrid<2>; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::MPNCComparison> { using type = MPNCComparisonProblem<TypeTag>; };
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::MPNCComparison>
{
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = MPNCComparisonSpatialParams<GridGeometry, Scalar>;
};
// Set fluid configuration
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::MPNCComparison>
{
using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>,
FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>;
};
template<class TypeTag>
struct UseMoles<TypeTag, TTag::MPNCComparison> { static constexpr bool value = true; };
template<class TypeTag>
struct IOFields<TypeTag, TTag::MPNCComparison> { using type = TwoPTwoCMPNCIOFields; };
} // end namespace Dumux::Properties
#endif
...@@ -127,6 +127,6 @@ private: ...@@ -127,6 +127,6 @@ private:
static constexpr Scalar eps_ = 1e-6; static constexpr Scalar eps_ = 1e-6;
}; };
} } // end namespace Dumux
#endif #endif
...@@ -22,15 +22,11 @@ ...@@ -22,15 +22,11 @@
* \brief Test for the three-phase box model. * \brief Test for the three-phase box model.
*/ */
#include <config.h> #include <config.h>
#include "problem.hh"
#include <ctime>
#include <iostream> #include <iostream>
#include <dune/common/parallel/mpihelper.hh> #include <dune/common/parallel/mpihelper.hh>
#include <dune/common/timer.hh> #include <dune/common/timer.hh>
#include <dune/grid/io/file/vtk.hh>
#include <dune/istl/io.hh>
#include <dumux/common/properties.hh> #include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh> #include <dumux/common/parameters.hh>
...@@ -46,33 +42,9 @@ ...@@ -46,33 +42,9 @@
#include <dumux/discretization/method.hh> #include <dumux/discretization/method.hh>
#include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/gridmanager.hh> #include <dumux/io/grid/gridmanager_yasp.hh>
/*! #include "properties.hh"
* \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) int main(int argc, char** argv)
{ {
...@@ -93,7 +65,7 @@ int main(int argc, char** argv) ...@@ -93,7 +65,7 @@ int main(int argc, char** argv)
DumuxMessage::print(/*firstCall=*/true); DumuxMessage::print(/*firstCall=*/true);
// parse command line arguments and input file // parse command line arguments and input file
Parameters::init(argc, argv, usage); Parameters::init(argc, argv);
// try to create a grid (from the given grid file or the input file) // try to create a grid (from the given grid file or the input file)
GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager;
......
...@@ -35,83 +35,14 @@ ...@@ -35,83 +35,14 @@
#ifndef DUMUX_EVAPORATION_ATMOSPHERE_PROBLEM_HH #ifndef DUMUX_EVAPORATION_ATMOSPHERE_PROBLEM_HH
#define DUMUX_EVAPORATION_ATMOSPHERE_PROBLEM_HH #define DUMUX_EVAPORATION_ATMOSPHERE_PROBLEM_HH
#include <dune/grid/yaspgrid.hh>
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/properties.hh> #include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/boundarytypes.hh>
#include <dumux/discretization/box.hh>
#include <dumux/porousmediumflow/mpnc/model.hh>
#include <dumux/porousmediumflow/mpnc/pressureformulation.hh>
#include <dumux/porousmediumflow/problem.hh> #include <dumux/porousmediumflow/problem.hh>
#include <dumux/material/constraintsolvers/misciblemultiphasecomposition.hh>
#include <dumux/material/fluidsystems/h2on2kinetic.hh>
#include <dumux/material/components/constant.hh>
#include "spatialparams.hh"
namespace Dumux { namespace Dumux {
/*!
* \ingroup MPNCTests
* \brief Problem showcasing the capabilities of the kinetic model.
*/
template <class TypeTag>
class EvaporationAtmosphereProblem;
namespace Properties {
// Create new type tags
namespace TTag {
struct EvaporationAtmosphere { using InheritsFrom = std::tuple<MPNCNonequil>; };
struct EvaporationAtmosphereBox { using InheritsFrom = std::tuple<EvaporationAtmosphere, BoxModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::EvaporationAtmosphere> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::EvaporationAtmosphere> { using type = EvaporationAtmosphereProblem<TypeTag>; };
// Set fluid configuration
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::EvaporationAtmosphere>
{
using type = FluidSystems::H2ON2Kinetic<GetPropType<TypeTag, Properties::Scalar>,
FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>;
};
//! Set the default pressure formulation: either pw first or pn first
template<class TypeTag>
struct PressureFormulation<TypeTag, TTag::EvaporationAtmosphere>
{
public:
static const MpNcPressureFormulation value = MpNcPressureFormulation::leastWettingFirst;
};
// Set the type used for scalar values
template<class TypeTag>
struct Scalar<TypeTag, TTag::EvaporationAtmosphere> { using type = double; };
// Set the fluid system
template<class TypeTag>
struct SolidSystem<TypeTag, TTag::EvaporationAtmosphere>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using InertComponent = Components::Constant<1, Scalar>;
using type = SolidSystems::InertSolidPhase<Scalar, InertComponent>;
};
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::EvaporationAtmosphere>
{
using GridGeometry = GetPropType<TypeTag, GridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = EvaporationAtmosphereSpatialParams<GridGeometry, Scalar>;
};
} // end namespace Properties
/*! /*!
* \ingroup MPNCTests * \ingroup MPNCTests
......
// -*- 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 MPNCTests
* \brief The properties of the problem showcasing the capabilities of the kinetic model.
*/
#ifndef DUMUX_EVAPORATION_ATMOSPHERE_PROPERTIES_HH
#define DUMUX_EVAPORATION_ATMOSPHERE_PROPERTIES_HH
#include <dune/grid/yaspgrid.hh>
#include <dumux/discretization/box.hh>
#include <dumux/porousmediumflow/mpnc/model.hh>
#include <dumux/material/components/constant.hh>
#include <dumux/material/fluidsystems/h2on2kinetic.hh>
#include <dumux/porousmediumflow/mpnc/pressureformulation.hh>
#include "spatialparams.hh"
#include "problem.hh"
namespace Dumux::Properties {
// Create new type tags
namespace TTag {
struct EvaporationAtmosphere { using InheritsFrom = std::tuple<MPNCNonequil>; };
struct EvaporationAtmosphereBox { using InheritsFrom = std::tuple<EvaporationAtmosphere, BoxModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::EvaporationAtmosphere>
{ using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::EvaporationAtmosphere>
{ using type = EvaporationAtmosphereProblem<TypeTag>; };
// Set fluid configuration
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::EvaporationAtmosphere>
{
using type = FluidSystems::H2ON2Kinetic<GetPropType<TypeTag, Properties::Scalar>,
FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>;
};
//! Set the default pressure formulation: either pw first or pn first
template<class TypeTag>
struct PressureFormulation<TypeTag, TTag::EvaporationAtmosphere>
{
public:
static const MpNcPressureFormulation value = MpNcPressureFormulation::leastWettingFirst;
};
// Set the fluid system
template<class TypeTag>
struct SolidSystem<TypeTag, TTag::EvaporationAtmosphere>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using InertComponent = Components::Constant<1, Scalar>;
using type = SolidSystems::InertSolidPhase<Scalar, InertComponent>;
};
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::EvaporationAtmosphere>
{
using GridGeometry = GetPropType<TypeTag, GridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = EvaporationAtmosphereSpatialParams<GridGeometry, Scalar>;
};
} // end namespace Dumux::Properties
#endif
...@@ -23,15 +23,10 @@ ...@@ -23,15 +23,10 @@
*/ */
#include <config.h> #include <config.h>
#include <ctime>
#include <iostream> #include <iostream>
#include <dune/common/parallel/mpihelper.hh> #include <dune/common/parallel/mpihelper.hh>
#include <dune/common/timer.hh> #include <dune/common/timer.hh>
#include <dune/grid/io/file/vtk.hh>
#include <dune/istl/io.hh>
#include "problem.hh"
#include <dumux/common/properties.hh> #include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh> #include <dumux/common/parameters.hh>
...@@ -47,39 +42,9 @@ ...@@ -47,39 +42,9 @@
#include <dumux/discretization/method.hh> #include <dumux/discretization/method.hh>
#include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/gridmanager.hh> #include <dumux/io/grid/gridmanager_yasp.hh>
/*! #include "properties.hh"
* \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 arguments for this program is:\n"
"\t-TimeManager.TEnd End of the simulation [s] \n"
"\t-TimeManager.DtInitial Initial timestep size [s] \n"
"\t-Grid.LowerLeft Lower left corner coordinates\n"
"\t-Grid.UpperRight Upper right corner coordinates\n"
"\t-Grid.Cells Number of cells in respective coordinate directions\n"
"\t definition in DGF format\n"
"\t-SpatialParams.LensLowerLeft coordinates of the lower left corner of the lens [m] \n"
"\t-SpatialParams.LensUpperRight coordinates of the upper right corner of the lens [m] \n"
"\t-SpatialParams.Permeability Permeability of the domain [m^2] \n"
"\t-SpatialParams.PermeabilityLens Permeability of the lens [m^2] \n";
std::cout << errorMessageOut
<< "\n";
}
}
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
...@@ -96,7 +61,7 @@ int main(int argc, char** argv) ...@@ -96,7 +61,7 @@ int main(int argc, char** argv)
DumuxMessage::print(/*firstCall=*/true); DumuxMessage::print(/*firstCall=*/true);
// parse command line arguments and input file // parse command line arguments and input file
Parameters::init(argc, argv, usage); Parameters::init(argc, argv);
// try to create a grid (from the given grid file or the input file) // try to create a grid (from the given grid file or the input file)
GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager;
......
...@@ -28,75 +28,15 @@ ...@@ -28,75 +28,15 @@
#ifndef DUMUX_OBSTACLEPROBLEM_HH #ifndef DUMUX_OBSTACLEPROBLEM_HH
#define DUMUX_OBSTACLEPROBLEM_HH #define DUMUX_OBSTACLEPROBLEM_HH
#include <dune/common/parametertreeparser.hh> #include <dumux/common/properties.hh>
#include <dune/grid/yaspgrid.hh> #include <dumux/common/parameters.hh>
#include <dumux/common/boundarytypes.hh> #include <dumux/common/boundarytypes.hh>
#include <dumux/discretization/box.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/porousmediumflow/mpnc/model.hh>
#include <dumux/porousmediumflow/problem.hh> #include <dumux/porousmediumflow/problem.hh>
#include <dumux/material/fluidsystems/h2on2.hh>
#include <dumux/material/fluidstates/compositional.hh>
#include <dumux/material/constraintsolvers/computefromreferencephase.hh> #include <dumux/material/constraintsolvers/computefromreferencephase.hh>
#include "spatialparams.hh"
namespace Dumux { namespace Dumux {
/*!
* \ingroup MPNCTests
* \brief Problem where liquid water is injected which has to go
* around an obstacle with \f$10^3\f$ lower permeability.
*
* The water is injected by means of a Dirichlet condition on the lower
* right of the domain.
*/
template <class TypeTag>
class ObstacleProblem;
namespace Properties {
// Create new type tags
namespace TTag {
struct Obstacle { using InheritsFrom = std::tuple<MPNC>; };
struct ObstacleBox { using InheritsFrom = std::tuple<Obstacle, BoxModel>; };
struct ObstacleCC { using InheritsFrom = std::tuple<Obstacle, CCTpfaModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::Obstacle> { using type = Dune::YaspGrid<2>; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::Obstacle> { using type = ObstacleProblem<TypeTag>; };
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::Obstacle>
{
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = ObstacleSpatialParams<GridGeometry, Scalar>;
};
// Set fluid configuration
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::Obstacle>
{
using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>,
FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>;
};
// decide which type to use for floating values (double / quad)
template<class TypeTag>
struct Scalar<TypeTag, TTag::Obstacle> { using type = double; };
}
/*! /*!
* \ingroup MPNCTests * \ingroup MPNCTests
* \brief Problem where liquid water is injected which has to go * \brief Problem where liquid water is injected which has to go
......
// -*- 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 MPNCTests
* \brief The properties of the problem where liquid water is injected which has to go around an
* obstacle with \f$10^3\f$ lower permeability.
*/
#ifndef DUMUX_TEST_MPNC_OBSTACLE_PROPERTIES_HH
#define DUMUX_TEST_MPNC_OBSTACLE_PROPERTIES_HH
#include <dune/grid/yaspgrid.hh>
#include <dumux/discretization/box.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/porousmediumflow/mpnc/model.hh>
#include <dumux/material/fluidsystems/h2on2.hh>
#include <dumux/material/fluidstates/compositional.hh>
#include "spatialparams.hh"
#include "problem.hh"
namespace Dumux::Properties {
// Create new type tags
namespace TTag {
struct Obstacle { using InheritsFrom = std::tuple<MPNC>; };
struct ObstacleBox { using InheritsFrom = std::tuple<Obstacle, BoxModel>; };
struct ObstacleCC { using InheritsFrom = std::tuple<Obstacle, CCTpfaModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::Obstacle> { using type = Dune::YaspGrid<2>; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::Obstacle> { using type = ObstacleProblem<TypeTag>; };
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::Obstacle>
{
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = ObstacleSpatialParams<GridGeometry, Scalar>;
};
// Set fluid configuration
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::Obstacle>
{
using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>,
FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>;
};
} // end namespace Dumux::Properties
#endif
...@@ -22,15 +22,11 @@ ...@@ -22,15 +22,11 @@
* \brief Test for the three-phase box model. * \brief Test for the three-phase box model.
*/ */
#include <config.h> #include <config.h>
#include "problem.hh"
#include <ctime>
#include <iostream> #include <iostream>
#include <dune/common/parallel/mpihelper.hh> #include <dune/common/parallel/mpihelper.hh>
#include <dune/common/timer.hh> #include <dune/common/timer.hh>
#include <dune/grid/io/file/vtk.hh>
#include <dune/istl/io.hh>
#include <dumux/common/properties.hh> #include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh> #include <dumux/common/parameters.hh>
...@@ -46,33 +42,9 @@ ...@@ -46,33 +42,9 @@
#include <dumux/discretization/method.hh> #include <dumux/discretization/method.hh>
#include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/gridmanager.hh> #include <dumux/io/grid/gridmanager_oned.hh>
/*! #include "properties.hh"
* \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) int main(int argc, char** argv)
{ {
...@@ -93,7 +65,7 @@ int main(int argc, char** argv) ...@@ -93,7 +65,7 @@ int main(int argc, char** argv)
DumuxMessage::print(/*firstCall=*/true); DumuxMessage::print(/*firstCall=*/true);
// parse command line arguments and input file // parse command line arguments and input file
Parameters::init(argc, argv, usage); Parameters::init(argc, argv);
// try to create a grid (from the given grid file or the input file) // try to create a grid (from the given grid file or the input file)
GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager;
......
...@@ -30,140 +30,15 @@ ...@@ -30,140 +30,15 @@
#ifndef DUMUX_COMBUSTION_PROBLEM_ONE_COMPONENT_HH #ifndef DUMUX_COMBUSTION_PROBLEM_ONE_COMPONENT_HH
#define DUMUX_COMBUSTION_PROBLEM_ONE_COMPONENT_HH #define DUMUX_COMBUSTION_PROBLEM_ONE_COMPONENT_HH
#include <dune/grid/onedgrid.hh> #include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/boundarytypes.hh> #include <dumux/common/boundarytypes.hh>
#include <dumux/discretization/box.hh>
#include <dumux/porousmediumflow/problem.hh> #include <dumux/porousmediumflow/problem.hh>
#include <dumux/porousmediumflow/mpnc/model.hh>
#include <dumux/porousmediumflow/mpnc/pressureformulation.hh>
#include <dumux/material/solidstates/compositionalsolidstate.hh>
#include <dumux/material/solidsystems/compositionalsolidphase.hh>
#include <dumux/material/components/constant.hh>
#include <dumux/material/fluidmatrixinteractions/2p/thermalconductivity/simplefluidlumping.hh>
#include <dumux/material/constraintsolvers/computefromreferencephase.hh> #include <dumux/material/constraintsolvers/computefromreferencephase.hh>
#include "spatialparams.hh"
#include "combustionfluidsystem.hh"
#include "combustionlocalresidual.hh"
namespace Dumux { namespace Dumux {
template<class TypeTag>
class CombustionProblemOneComponent;
//! Custom model traits to deactivate diffusion for this test
template<int numP, int numC, MpNcPressureFormulation formulation, bool useM>
struct CombustionModelTraits : public MPNCModelTraits<numP, numC, formulation, useM>
{
static constexpr bool enableMolecularDiffusion() { return false; }
};
namespace Properties {
// Create new type tags
namespace TTag {
struct CombustionOneComponent { using InheritsFrom = std::tuple<MPNCNonequil>; };
struct CombustionOneComponentBox { using InheritsFrom = std::tuple<CombustionOneComponent, BoxModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::CombustionOneComponent> { using type = Dune::OneDGrid; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::CombustionOneComponent>
{ using type = CombustionProblemOneComponent<TypeTag>; };
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::CombustionOneComponent>
{
using GridGeometry = GetPropType<TypeTag, GridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = CombustionSpatialParams<GridGeometry, Scalar>;
};
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::CombustionOneComponent>
{ using type = FluidSystems::CombustionFluidsystem<GetPropType<TypeTag, Properties::Scalar>>; };
//! Set the default pressure formulation: either pw first or pn first
template<class TypeTag>
struct PressureFormulation<TypeTag, TTag::CombustionOneComponent>
{
public:
static const MpNcPressureFormulation value = MpNcPressureFormulation::mostWettingFirst;
};
// Set the type used for scalar values
template<class TypeTag>
struct Scalar<TypeTag, TTag::CombustionOneComponent> { using type = double ; };
// quad / double
// We use different model traits for the equilibrium part because we want to deactivate diffusion
template<class TypeTag>
struct EquilibriumModelTraits<TypeTag, TTag::CombustionOneComponent>
{
private:
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
public:
using type = CombustionModelTraits< FluidSystem::numPhases,
FluidSystem::numComponents,
getPropValue<TypeTag, Properties::PressureFormulation>(),
getPropValue<TypeTag, Properties::UseMoles>() >;
};
template<class TypeTag>
struct FluidState<TypeTag, TTag::CombustionOneComponent>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
public:
using type = CompositionalFluidState<Scalar, FluidSystem>;
};
//#################
//changes from the default settings which also assume chemical non-equilibrium
//set the number of energyequations we want to use
template<class TypeTag>
struct NumEnergyEqFluid<TypeTag, TTag::CombustionOneComponent> { static constexpr int value = 1; };
template<class TypeTag>
struct NumEnergyEqSolid<TypeTag, TTag::CombustionOneComponent> { static constexpr int value = 1; };
// by default chemical non equilibrium is enabled in the nonequil model, switch that off here
template<class TypeTag>
struct EnableChemicalNonEquilibrium<TypeTag, TTag::CombustionOneComponent> { static constexpr bool value = false; };
//#################
template<class TypeTag>
struct SolidSystem<TypeTag, TTag::CombustionOneComponent>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using ComponentOne = Dumux::Components::Constant<1, Scalar>;
using ComponentTwo = Dumux::Components::Constant<2, Scalar>;
static constexpr int numInertComponents = 2;
using type = SolidSystems::CompositionalSolidPhase<Scalar, ComponentOne, ComponentTwo, numInertComponents>;
};
template<class TypeTag>
struct SolidState<TypeTag, TTag::CombustionOneComponent>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>;
public:
using type = CompositionalSolidState<Scalar, SolidSystem>;
};
template<class TypeTag>
struct EnergyLocalResidual<TypeTag, TTag::CombustionOneComponent>
{ using type = CombustionEnergyLocalResidual<TypeTag>; };
}
/*! /*!
* \ingroup MPNCTests * \ingroup MPNCTests
* \brief Problem where water is injected from the left hand side into a porous media filled domain, * \brief Problem where water is injected from the left hand side into a porous media filled domain,
...@@ -566,6 +441,6 @@ private: ...@@ -566,6 +441,6 @@ private:
std::shared_ptr<GridVariables> gridVariables_; std::shared_ptr<GridVariables> gridVariables_;
}; };
} // end namespace } // end namespace Dumux
#endif #endif
// -*- 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 MPNCTests
* \brief The properties of the problem where hot, pure liquid water is injected from the left hand
* side into a initially isotherm domain.
*/
#ifndef DUMUX_COMBUSTION_PROPERTIES_ONE_COMPONENT_HH
#define DUMUX_COMBUSTION_PROPERTIES_ONE_COMPONENT_HH
#include <dune/grid/onedgrid.hh>
#include <dumux/discretization/box.hh>
#include <dumux/porousmediumflow/mpnc/model.hh>
#include <dumux/porousmediumflow/mpnc/pressureformulation.hh>
#include <dumux/material/solidstates/compositionalsolidstate.hh>
#include <dumux/material/solidsystems/compositionalsolidphase.hh>
#include <dumux/material/components/constant.hh>
#include <dumux/material/fluidmatrixinteractions/2p/thermalconductivity/simplefluidlumping.hh>
#include "spatialparams.hh"
#include "combustionfluidsystem.hh"
#include "combustionlocalresidual.hh"
#include "problem.hh"
namespace Dumux::Properties {
// Create new type tags
namespace TTag {
struct CombustionOneComponent { using InheritsFrom = std::tuple<MPNCNonequil>; };
struct CombustionOneComponentBox { using InheritsFrom = std::tuple<CombustionOneComponent, BoxModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::CombustionOneComponent> { using type = Dune::OneDGrid; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::CombustionOneComponent>
{ using type = CombustionProblemOneComponent<TypeTag>; };
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::CombustionOneComponent>
{
using GridGeometry = GetPropType<TypeTag, GridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = CombustionSpatialParams<GridGeometry, Scalar>;
};
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::CombustionOneComponent>
{ using type = FluidSystems::CombustionFluidsystem<GetPropType<TypeTag, Properties::Scalar>>; };
//! Set the default pressure formulation: either pw first or pn first
template<class TypeTag>
struct PressureFormulation<TypeTag, TTag::CombustionOneComponent>
{
public:
static const MpNcPressureFormulation value = MpNcPressureFormulation::mostWettingFirst;
};
//! Custom model traits to deactivate diffusion for this test
template<int numP, int numC, MpNcPressureFormulation formulation, bool useM>
struct CombustionModelTraits : public MPNCModelTraits<numP, numC, formulation, useM>
{
static constexpr bool enableMolecularDiffusion() { return false; }
};
// We use different model traits for the equilibrium part because we want to deactivate diffusion
template<class TypeTag>
struct EquilibriumModelTraits<TypeTag, TTag::CombustionOneComponent>
{
private:
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
public:
using type = CombustionModelTraits< FluidSystem::numPhases,
FluidSystem::numComponents,
getPropValue<TypeTag, Properties::PressureFormulation>(),
getPropValue<TypeTag, Properties::UseMoles>() >;
};
template<class TypeTag>
struct FluidState<TypeTag, TTag::CombustionOneComponent>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
public:
using type = CompositionalFluidState<Scalar, FluidSystem>;
};
//#################
//changes from the default settings which also assume chemical non-equilibrium
//set the number of energyequations we want to use
template<class TypeTag>
struct NumEnergyEqFluid<TypeTag, TTag::CombustionOneComponent> { static constexpr int value = 1; };
template<class TypeTag>
struct NumEnergyEqSolid<TypeTag, TTag::CombustionOneComponent> { static constexpr int value = 1; };
// by default chemical non equilibrium is enabled in the nonequil model, switch that off here
template<class TypeTag>
struct EnableChemicalNonEquilibrium<TypeTag, TTag::CombustionOneComponent> { static constexpr bool value = false; };
//#################
template<class TypeTag>
struct SolidSystem<TypeTag, TTag::CombustionOneComponent>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using ComponentOne = Dumux::Components::Constant<1, Scalar>;
using ComponentTwo = Dumux::Components::Constant<2, Scalar>;
static constexpr int numInertComponents = 2;
using type = SolidSystems::CompositionalSolidPhase<Scalar, ComponentOne, ComponentTwo, numInertComponents>;
};
template<class TypeTag>
struct SolidState<TypeTag, TTag::CombustionOneComponent>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>;
public:
using type = CompositionalSolidState<Scalar, SolidSystem>;
};
template<class TypeTag>
struct EnergyLocalResidual<TypeTag, TTag::CombustionOneComponent>
{ using type = CombustionEnergyLocalResidual<TypeTag>; };
} // end namespace Dumux::Properties
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment