From 8204f4aaee9d204ff28cd1c935ded12cdf78ead5 Mon Sep 17 00:00:00 2001 From: Markus Wolff <markus.wolff@twt-gmbh.de> Date: Fri, 23 Dec 2011 10:39:00 +0000 Subject: [PATCH] make decoupled 2p-tests compile after model changes git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7250 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- test/decoupled/2p/test_impes_problem.hh | 13 ++++--- test/decoupled/2p/test_impes_spatialparams.hh | 2 +- test/decoupled/2p/test_transport_problem.hh | 35 +++++++++++++++++-- 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/test/decoupled/2p/test_impes_problem.hh b/test/decoupled/2p/test_impes_problem.hh index 7b4071688c..888d454408 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 f488395d18..fa17ffa70f 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 5461f666fd..35861dd643 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); + } + } } /*! -- GitLab