diff --git a/dumux/porousmediumflow/1p/implicit/volumevariables.hh b/dumux/porousmediumflow/1p/implicit/volumevariables.hh index 81c65cb882e661755754353fd8ef1ab0447c38f4..035c1865ecfdaa1836bedf4940d63965af07adbd 100644 --- a/dumux/porousmediumflow/1p/implicit/volumevariables.hh +++ b/dumux/porousmediumflow/1p/implicit/volumevariables.hh @@ -47,44 +47,50 @@ class OnePVolumeVariables : public ImplicitVolumeVariables<TypeTag> using Problem = typename GET_PROP_TYPE(TypeTag, Problem); using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); + using ElementSolutionVector = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector); using Indices = typename GET_PROP_TYPE(TypeTag, Indices); using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using Element = typename GridView::template Codim<0>::Entity; + static const bool isBox = GET_PROP_VALUE(TypeTag, ImplicitIsBox); + public: using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); + using typename ParentType::PermeabilityType; /*! * \copydoc ImplicitVolumeVariables::update */ - void update(const PrimaryVariables &priVars, + void update(const ElementSolutionVector &elemSol, const Problem &problem, const Element &element, const SubControlVolume& scv) { - ParentType::update(priVars, problem, element, scv); + ParentType::update(elemSol, problem, element, scv); - completeFluidState(priVars, problem, element, scv, fluidState_); + completeFluidState(elemSol, problem, element, scv, fluidState_); // porosity - porosity_ = problem.spatialParams().porosity(scv); + porosity_ = problem.spatialParams().porosity(element, scv, elemSol); + permeability_ = problem.spatialParams().permeability(element, scv, elemSol); }; /*! * \copydoc ImplicitModel::completeFluidState */ - static void completeFluidState(const PrimaryVariables& priVars, + static void completeFluidState(const ElementSolutionVector &elemSol, const Problem& problem, const Element& element, const SubControlVolume& scv, FluidState& fluidState) { - Scalar t = ParentType::temperature(priVars, problem, element, scv); + Scalar t = ParentType::temperature(elemSol, problem, element, scv); + fluidState.setTemperature(t); fluidState.setSaturation(/*phaseIdx=*/0, 1.); + const auto& priVars = isBox ? elemSol[scv.index()] : elemSol[0]; fluidState.setPressure(/*phaseIdx=*/0, priVars[Indices::pressureIdx]); // saturation in a single phase is always 1 and thus redundant @@ -161,6 +167,9 @@ public: Scalar porosity() const { return porosity_; } + PermeabilityType permeability() const + { return permeability_; } + /*! * \brief Return the fluid state of the control volume. */ @@ -170,6 +179,7 @@ public: protected: FluidState fluidState_; Scalar porosity_; + PermeabilityType permeability_; Implementation &asImp_() { return *static_cast<Implementation*>(this); } diff --git a/test/porousmediumflow/1p/implicit/1ptestspatialparams.hh b/test/porousmediumflow/1p/implicit/1ptestspatialparams.hh index 9a9e29a207ef6286c936a70dcd224dd1d588cf1f..d1cd80331db68fdc3828f264e654b63cdc778920 100644 --- a/test/porousmediumflow/1p/implicit/1ptestspatialparams.hh +++ b/test/porousmediumflow/1p/implicit/1ptestspatialparams.hh @@ -59,6 +59,7 @@ class OnePTestSpatialParams : public ImplicitSpatialParamsOneP<TypeTag> using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using Problem = typename GET_PROP_TYPE(TypeTag, Problem); using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using ElementSolutionVector = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector); using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); @@ -98,8 +99,9 @@ public: * \param scvIdx The index sub-control volume face where the * intrinsic velocity ought to be calculated. */ - Scalar intrinsicPermeability(const SubControlVolume& scv, - const VolumeVariables& volVars) const + Scalar permeability(const Element& element, + const SubControlVolume& scv, + const ElementSolutionVector& elemSol) const { if (isInLens_(scv.dofPosition())) { @@ -118,7 +120,7 @@ public: * \param fvGeometry The finite volume geometry * \param scvIdx The local index of the sub-control volume where */ - Scalar porosity(const SubControlVolume &scv) const + Scalar porosityAtPos(const GlobalPosition& globalPos) const { return 0.4; } /*!