Skip to content
Snippets Groups Projects

[test] Port the 1p point source tests to new problem interface

Merged Timo Koch requested to merge feauture/port-1d-pointsource-tests into next
3 files
+ 48
76
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -25,6 +25,7 @@
#ifndef DUMUX_1P_SINGULARITY_PROBLEM_HH
#define DUMUX_1P_SINGULARITY_PROBLEM_HH
#include <dumux/implicit/cellcentered/tpfa/properties.hh>
#include <dumux/porousmediumflow/1p/implicit/model.hh>
#include <dumux/porousmediumflow/implicit/problem.hh>
#include <dumux/material/components/simpleh2o.hh>
@@ -41,7 +42,7 @@ namespace Properties
{
NEW_TYPE_TAG(OnePSingularityProblem, INHERITS_FROM(OneP));
NEW_TYPE_TAG(OnePSingularityBoxProblem, INHERITS_FROM(BoxModel, OnePSingularityProblem));
NEW_TYPE_TAG(OnePSingularityCCProblem, INHERITS_FROM(CCModel, OnePSingularityProblem));
NEW_TYPE_TAG(OnePSingularityCCProblem, INHERITS_FROM(CCTpfaModel, OnePSingularityProblem));
SET_PROP(OnePSingularityProblem, Fluid)
{
@@ -85,13 +86,12 @@ SET_BOOL_PROP(OnePSingularityProblem, ProblemEnableGravity, false);
template <class TypeTag>
class OnePSingularityProblem : public ImplicitPorousMediaProblem<TypeTag>
{
typedef ImplicitPorousMediaProblem<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
using ParentType = ImplicitPorousMediaProblem<TypeTag>;
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
// copy some indices for convenience
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
enum {
// Grid and world dimension
dim = GridView::dimension,
@@ -103,17 +103,11 @@ class OnePSingularityProblem : public ImplicitPorousMediaProblem<TypeTag>
pressureIdx = Indices::pressureIdx
};
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager;
typedef typename GET_PROP_TYPE(TypeTag, PointSource) PointSource;
typedef typename GridView::template Codim<0>::Entity Element;
typedef typename GridView::Intersection Intersection;
typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry;
typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition;
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 PointSource = typename GET_PROP_TYPE(TypeTag, PointSource);
using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
public:
OnePSingularityProblem(TimeManager &timeManager, const GridView &gridView)
@@ -132,7 +126,7 @@ public:
*
* This is used as a prefix for files generated by the simulation.
*/
const std::string name() const
const std::string& name() const
{
return name_;
}
@@ -158,10 +152,11 @@ public:
* \param values The boundary types for the conservation equations
* \param globalPos The position of the center of the finite volume
*/
void boundaryTypesAtPos(BoundaryTypes &values,
const GlobalPosition &globalPos) const
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
{
values.setAllDirichlet();
BoundaryTypes bcTypes;
bcTypes.setAllDirichlet();
return bcTypes;
}
/*!
@@ -173,10 +168,9 @@ public:
*
* For this method, the \a values parameter stores primary variables.
*/
void dirichletAtPos(PrimaryVariables &values,
const GlobalPosition &globalPos) const
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
{
values[pressureIdx] = 1.0e5;
return initialAtPos(globalPos);
}
/*!
@@ -187,15 +181,9 @@ public:
* in normal direction of each component. Negative values mean
* influx.
*/
using ParentType::neumann;
void neumann(PrimaryVariables &priVars,
const Element &element,
const FVElementGeometry &fvGeometry,
const Intersection &intersection,
const int scvIdx,
const int boundaryFaceIdx) const
PrimaryVariables neumannAtPos(const GlobalPosition& globalPos) const
{
priVars[conti0EqIdx] = 0;
return PrimaryVariables(0.0);
}
// \}
@@ -211,10 +199,9 @@ public:
* \param values Stores the source values, acts as return value
* \param globalPos The global position
*/
void sourceAtPos(PrimaryVariables &values,
const GlobalPosition &globalPos) const
PrimaryVariables sourceAtPos(const GlobalPosition &globalPos) const
{
values = 0;
return PrimaryVariables(0.0);
}
/*!
@@ -241,12 +228,11 @@ public:
* For this method, the \a priVars parameter stores primary
* variables.
*/
void initial(PrimaryVariables &priVars,
const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
{
PrimaryVariables priVars(0.0);
priVars[pressureIdx] = 1.0e5;
return priVars;
}
// \}
Loading