24#ifndef TEST_DIFFUSION_SPATIALPARAMS_HH
25#define TEST_DIFFUSION_SPATIALPARAMS_HH
36template<
class TypeTag>
48template<
class TypeTag>
63template<
class TypeTag>
70 using IndexSet =
typename GridView::IndexSet;
72 using CoordScalar =
typename Grid::ctype;
77 {dim=Grid::dimension, dimWorld=Grid::dimensionworld};
78 using Element =
typename Grid::Traits::template Codim<0>::Entity;
80 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
81 using FieldMatrix = Dune::FieldMatrix<Scalar, dim, dim>;
89 return permeability_[indexSet_.index(element)];
101 return materialLawParams_;
107 permeability_.resize(gridView_.size(0));
109 for(
const auto& element : elements(gridView_))
111 perm(permeability_[indexSet_.index(element)], element.geometry().center());
116 template<
class Writer>
119 ScalarSolution *permXX = writer.allocateManagedBuffer(gridView_.size(0));
120 ScalarSolution *permXY = writer.allocateManagedBuffer(gridView_.size(0));
121 ScalarSolution *permYY = writer.allocateManagedBuffer(gridView_.size(0));
123 for(
const auto& element : elements(gridView_))
125 int eIdxGlobal = indexSet_.index(element);
126 (*permXX)[eIdxGlobal][0] = permeability_[eIdxGlobal][0][0];
127 (*permXY)[eIdxGlobal][0] = permeability_[eIdxGlobal][0][1];
128 (*permYY)[eIdxGlobal][0] = permeability_[eIdxGlobal][1][1];
131 writer.attachCellData(*permXX,
"permeability-X");
132 writer.attachCellData(*permYY,
"permeability-Y");
133 writer.attachCellData(*permXY,
"permeability-Offdiagonal");
139 :
ParentType(problem),gridView_(problem.gridView()), indexSet_(problem.gridView().indexSet()), permeability_(0)
142 materialLawParams_.setSwr(0.0);
143 materialLawParams_.setSnr(0.0);
146 materialLawParams_.setEntryPc(0);
147 materialLawParams_.setMaxPc(0);
151 void perm (FieldMatrix& perm,
const GlobalPosition& globalPos)
const
153 double rt = globalPos[0]*globalPos[0]+globalPos[1]*globalPos[1];
154 perm[0][0] = (delta_*globalPos[0]*globalPos[0] + globalPos[1]*globalPos[1])/rt;
155 perm[0][1] = -(1.0 - delta_)*globalPos[0]*globalPos[1]/rt;
156 perm[1][0] = perm[0][1];
157 perm[1][1] = (globalPos[0]*globalPos[0] + delta_*globalPos[1]*globalPos[1])/rt;
160 const GridView gridView_;
161 const IndexSet& indexSet_;
163 std::vector<FieldMatrix> permeability_;
#define GET_PROP(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:281
#define GET_PROP_TYPE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:283
#define NEW_TYPE_TAG(...)
Definition: propertysystemmacros.hh:130
Linear capillary pressure and relative permeability <-> saturation relations.
The base class for spatial parameters of problems using the fv method.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
SET_TYPE_PROP(FVPressureOneP, Velocity, FVVelocity1P< TypeTag >)
Set velocity reconstruction implementation standard cell centered finite volume schemes as default.
Type tag TestDiffusionSpatialParams
Definition: test_diffusionspatialparams.hh:42
Property tag SolutionTypes
Definition: porousmediumflow/sequential/properties.hh:58
The type of the spatial parameters object.
Definition: common/properties.hh:221
This material law takes a material law defined for effective saturations and converts it to a materia...
Definition: 2p/efftoabslaw.hh:60
Linear capillary pressure and relative permeability <-> saturation relations.
Definition: linearmaterial.hh:48
Definition: sequentialfv.hh:34
The base class for spatial parameters of a multi-phase problem using the fv method.
Definition: sequentialfv.hh:43
spatial parameters for the test problem for diffusion models.
Definition: test_diffusionspatialparams.hh:65
typename MaterialLaw::Params MaterialLawParams
Definition: test_diffusionspatialparams.hh:85
TestDiffusionSpatialParams(const Problem &problem)
Definition: test_diffusionspatialparams.hh:138
const MaterialLawParams & materialLawParams(const Element &element) const
Definition: test_diffusionspatialparams.hh:99
const FieldMatrix & intrinsicPermeability(const Element &element) const
Definition: test_diffusionspatialparams.hh:87
void initialize(const double delta)
Definition: test_diffusionspatialparams.hh:104
void addOutputVtkFields(Writer &writer)
Definition: test_diffusionspatialparams.hh:117
double porosity(const Element &element) const
Definition: test_diffusionspatialparams.hh:92
typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw
Definition: test_diffusionspatialparams.hh:84
Base file for properties related to sequential models.
This material law takes a material law defined for effective saturations and converts it to a materia...