diff --git a/test/decoupled/2p/test_impes_problem.hh b/test/decoupled/2p/test_impes_problem.hh index 7b4071688c5127ced7db73fe7edf696a657f2420..888d45440818e170542f9934f3db363cf8529b98 100644 --- a/test/decoupled/2p/test_impes_problem.hh +++ b/test/decoupled/2p/test_impes_problem.hh @@ -133,11 +133,13 @@ class TestIMPESProblem: public IMPESProblem2P<TypeTag> typedef IMPESProblem2P<TypeTag> ParentType; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; -typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; +typedef typename GET_PROP_TYPE(TypeTag, PTAG(Indices)) Indices; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidState)) FluidState; +typedef typename GET_PROP_TYPE(TypeTag, PTAG(WettingPhase)) WettingPhase; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(TimeManager)) TimeManager; enum @@ -195,7 +197,7 @@ bool shouldWriteRestartFile() const * * This problem assumes a temperature of 10 degrees Celsius. */ -Scalar temperature(const Element& element) const +Scalar temperatureAtPos(const GlobalPosition& globalPos) const { return 273.15 + 10; // -> 10°C } @@ -203,7 +205,7 @@ Scalar temperature(const Element& element) const // \} //! Returns the reference pressure for evaluation of constitutive relations -Scalar referencePressure(const Element& element) const +Scalar referencePressureAtPos(const GlobalPosition& globalPos) const { return 1e5; // -> 10°C } @@ -248,11 +250,8 @@ void dirichletAtPos(PrimaryVariables &values, const GlobalPosition& globalPos) c { Scalar pRef = referencePressureAtPos(globalPos); Scalar temp = temperatureAtPos(globalPos); - Scalar sat = 1; - FluidState fluidState; - fluidState.update(sat, pRef, pRef, temp); - values[pWIdx] = (2e5 + (this->bboxMax()[dim-1] - globalPos[dim-1]) * FluidSystem::phaseDensity(wPhaseIdx, temp, pRef, fluidState) * this->gravity().two_norm()); + values[pWIdx] = (2e5 + (this->bboxMax()[dim-1] - globalPos[dim-1]) * WettingPhase::density(temp, pRef) * this->gravity().two_norm()); } else { diff --git a/test/decoupled/2p/test_impes_spatialparams.hh b/test/decoupled/2p/test_impes_spatialparams.hh index f488395d1865aeab3b30611c700aaad3997cd9f4..fa17ffa70f3d96c219bd7d485499ed740b40ce26 100644 --- a/test/decoupled/2p/test_impes_spatialparams.hh +++ b/test/decoupled/2p/test_impes_spatialparams.hh @@ -112,7 +112,7 @@ public: // // parameters for the Brooks-Corey Law // // entry pressures - materialLawParams_.setPe(0); + materialLawParams_.setPe(100); // // Brooks-Corey shape parameters materialLawParams_.setLambda(2); diff --git a/test/decoupled/2p/test_transport_problem.hh b/test/decoupled/2p/test_transport_problem.hh index 5461f666fd3b427326e61c49605704f6e05706ec..35861dd6431cd5f04d13d34c8a6dc8e38aa9eecc 100644 --- a/test/decoupled/2p/test_transport_problem.hh +++ b/test/decoupled/2p/test_transport_problem.hh @@ -122,7 +122,7 @@ class TestTransportProblem: public TransportProblem2P<TypeTag> typedef TransportProblem2P<TypeTag> ParentType; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Indices)) Indices; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidState)) FluidState; @@ -132,6 +132,10 @@ class TestTransportProblem: public TransportProblem2P<TypeTag> typedef typename GET_PROP(TypeTag, PTAG(SolutionTypes)) SolutionTypes; typedef typename SolutionTypes::PrimaryVariables PrimaryVariables; + typedef typename GridView::template Codim<0>::Iterator ElementIterator; + typedef typename GridView::IntersectionIterator IntersectionIterator; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(CellData)) CellData; + enum { dim = GridView::dimension, dimWorld = GridView::dimensionworld @@ -155,8 +159,33 @@ public: { GlobalPosition vel(0); vel[0] = 1e-5; - this->variables().velocity() = vel; - this->variables().initializePotentials(vel); + + // compute update vector + ElementIterator eItEnd = gridView.template end<0> (); + for (ElementIterator eIt = gridView.template begin<0> (); eIt != eItEnd; ++eIt) + { + // cell index + int globalIdx = this->elementMapper().map(*eIt); + + CellData& cellData = this->variables().cellData(globalIdx); + + cellData.fluxData().velocity(wPhaseIdx) = vel; + + // run through all intersections with neighbors and boundary + IntersectionIterator isItEnd = gridView.iend(*eIt); + for (IntersectionIterator isIt = gridView.ibegin(*eIt); isIt != isItEnd; ++isIt) + { + // local number of facet + int indexInInside = isIt->indexInInside(); + + const GlobalPosition& unitOuterNormal = isIt->centerUnitOuterNormal(); + + Scalar pot = vel * unitOuterNormal; + + cellData.fluxData().setPotential(wPhaseIdx, indexInInside, pot); + cellData.fluxData().setPotential(nPhaseIdx, indexInInside, pot); + } + } } /*!