diff --git a/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh b/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh index 592f560df80ee65a99ca08cdc65796e899e145e6..a279ff90d34efffdcf5ae7a9519ff73718e863a2 100644 --- a/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh +++ b/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh @@ -143,7 +143,6 @@ public: void initialize(bool solveTwice = true) { - updateMaterialLaws(); assemble(true); @@ -188,6 +187,15 @@ public: return; } + void update() + { + updateMaterialLaws(); + + pressure(false); + + return; + } + // serialization methods template<class Restarter> void serialize(Restarter &res) @@ -246,6 +254,12 @@ public: *viscosityNonwetting = problem_.variables().viscosityNonwetting(); writer.addCellData(viscosityNonwetting, "nonwetting viscosity"); +// typename Variables::ScalarSolutionType *saturation = writer.template createField<Scalar, 1> (problem_.gridView().size(0)); +// +// *saturation = problem_.variables().saturation(); +// +// writer.addCellData(saturation, "wetting saturation"); + return; } diff --git a/dumux/decoupled/2p/diffusion/fv/fvvelocity2p.hh b/dumux/decoupled/2p/diffusion/fv/fvvelocity2p.hh index 941d18134bd0cb0ca6fdbe0814d096f62edd3721..da9d0cd9c909967ff052e2a982ef7098d12d73ce 100644 --- a/dumux/decoupled/2p/diffusion/fv/fvvelocity2p.hh +++ b/dumux/decoupled/2p/diffusion/fv/fvvelocity2p.hh @@ -50,6 +50,7 @@ template<class TypeTag> class FVVelocity2P: public FVPressure2P<TypeTag> { typedef FVVelocity2P<TypeTag> ThisType; + typedef FVPressure2P<TypeTag> ParentType; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; @@ -151,6 +152,15 @@ public: */ void calculateVelocity(); + void update() + { + ParentType::update(); + + calculateVelocity(); + + return; + } + private: static const int velocityType_ = GET_PROP_VALUE(TypeTag, PTAG(VelocityFormulation)); //!< gives kind of velocity used (\f$ 0 = v_w\f$, \f$ 1 = v_n\f$, \f$ 2 = v_t\f$) }; diff --git a/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh b/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh index 66a97cbe58dc1071f5edebeb0d4e1a2f595134fc..a895bf952ba067a01c248906c1d8b6a81d40418d 100644 --- a/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh +++ b/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh @@ -57,12 +57,13 @@ namespace Dumux template<class TypeTag> class FVSaturation2P { - typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; - typedef typename GET_PROP(TypeTag, PTAG(ReferenceElements)) ReferenceElements; - typedef typename ReferenceElements::Container ReferenceElementContainer; - typedef typename ReferenceElements::ContainerFaces ReferenceElementFaceContainer; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Variables)) Variables; + typedef typename GET_PROP(TypeTag, PTAG(ReferenceElements)) ReferenceElements; + typedef typename ReferenceElements::Container ReferenceElementContainer; + typedef typename ReferenceElements::ContainerFaces ReferenceElementFaceContainer; typedef typename GET_PROP_TYPE(TypeTag, PTAG(DiffusivePart)) DiffusivePart; typedef typename GET_PROP_TYPE(TypeTag, PTAG(ConvectivePart)) ConvectivePart; @@ -164,12 +165,26 @@ public: */ void updateMaterialLaws(RepresentationType& saturation, bool iterate); - template<class MultiWriter> - void addOutputVtkFields(MultiWriter &writer) - { - problem_.variables().addOutputVtkFields(writer); - return; - } + //! \brief Write data files + /* \param name file name */ + template<class MultiWriter> + void addOutputVtkFields(MultiWriter &writer) + { + typename Variables::ScalarSolutionType *saturation = writer.template createField<Scalar, 1> (problem_.gridView().size(0)); + + *saturation = problem_.variables().saturation(); + + if (saturationType_ == Sw) + { + writer.addCellData(saturation, "wetting saturation"); + } + if (saturationType_ == Sn) + { + writer.addCellData(saturation, "nonwetting saturation"); + } + + return; + } // serialization methods template<class Restarter>