Commit 2995ce66 authored by Dennis Gläser's avatar Dennis Gläser Committed by Timo Koch
Browse files

[1p] port 1ptest to new param interface

Unfortunately, the box 1p test does not pass. It remains to check why and
if it didn't do so before as well.
parent ab0e6160
......@@ -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); }
......
......@@ -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; }
/*!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment