diff --git a/dumux/boxmodels/1p2c/1p2cboxmodel.hh b/dumux/boxmodels/1p2c/1p2cboxmodel.hh deleted file mode 100644 index a71a5f7d1b8c5e09e8b0c3071048911c485a0807..0000000000000000000000000000000000000000 --- a/dumux/boxmodels/1p2c/1p2cboxmodel.hh +++ /dev/null @@ -1,106 +0,0 @@ -// $Id: 1p2cboxmodel.hh 3738 2010-06-15 14:01:09Z lauser $ -/***************************************************************************** - * Copyright (C) 2009 by Karin Erbertseder * - * Copyright (C) 2009 by Andreas Lauser * - * Copyright (C) 2008 by Bernd Flemisch * - * Institute of Hydraulic Engineering * - * University of Stuttgart, Germany * - * email: <givenname>.<name>@iws.uni-stuttgart.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version, as long as this copyright notice * - * is included in its original form. * - * * - * This program is distributed WITHOUT ANY WARRANTY. * - *****************************************************************************/ -#ifndef DUMUX_ONEP_TWOC_BOX_MODEL_HH -#define DUMUX_ONEP_TWOC_BOX_MODEL_HH - -#include "1p2cboxjacobian.hh" -#include "1p2cboxproblem.hh" - -namespace Dumux -{ - -/*! - * \ingroup BoxProblems - * \defgroup OnePTwoCBoxProblems One-phase Two-component box problems - */ - -/*! - * \ingroup BoxModels - * \defgroup OnePTwoCBoxModel One-phase Two-component box model - */ - -/*! - * \ingroup OnePTwoCBoxModel - * \brief Adaption of the BOX scheme to the one-phase two-component flow model. - * - * This model implements an one-phase flow of an incompressible fluid, that consists of two components, - * using a standard Darcy - * approach (neglecting gravitation) as the equation for the conservation of momentum: - \f[ - v_{D} = - \frac{K}{\mu} - \left(\text{grad} p - \varrho g \right) - \f] - * - * By inserting this into the continuity equation, one gets - \f[ - - \text{div} \left\{ - \varrho \frac{K}{\mu} \left(\text{grad} p - \varrho g \right) - \right\} = q \;, - \f] - * - * The transport of the components is described by the following equation: - \f[ - \Phi \varrho \frac{ \partial x}{\partial t} - \text{div} \left( \varrho \frac{K x}{\mu} \left( \text{grad} p - - \varrho g \right) + \varrho \tau \Phi D \text{grad} x \right) = q. - \f] - * - * All equations are discretized using a fully-coupled vertex - * centered finite volume (box) scheme as spatial and - * the implicit Euler method as time discretization. - * - * The primary variables are the pressure \f$p\f$ and the mole fraction of dissolved component \f$x\f$. - */ - -template<class TypeTag > -class OnePTwoCBoxModel : public BoxScheme<TypeTag, OnePTwoCBoxModel<TypeTag> > -{ - typedef OnePTwoCBoxModel<TypeTag> ThisType; - typedef BoxScheme<TypeTag, ThisType> ParentType; - - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(LocalJacobian)) LocalJacobian; - -public: - OnePTwoCBoxModel(Problem &prob) - : ParentType(prob) - { - } - - /*! - * \brief Add the mass fraction of air in water to VTK output of - * the current timestep. - */ - template <class MultiWriter> - void addOutputVtkFields(MultiWriter &writer) - { - this->localJacobian().addOutputVtkFields(writer, this->curSol()); - } - - /*! - * \brief Calculate the masses in the system for - * the current timestep. - */ - void calculateMass(Dune::FieldVector<Scalar, 2> &mass) - { - this->localJacobian().calculateMass(this->curSol(), mass); - } -}; -} - -#endif diff --git a/dumux/boxmodels/1p2c/1p2celementdata.hh b/dumux/boxmodels/1p2c/1p2celementdata.hh deleted file mode 100644 index f4e6f70f4b17d3fc9ab72dda52f51f7317b19f4e..0000000000000000000000000000000000000000 --- a/dumux/boxmodels/1p2c/1p2celementdata.hh +++ /dev/null @@ -1,46 +0,0 @@ -// $Id: 1p2celementdata.hh 3736 2010-06-15 09:52:10Z lauser $ -/***************************************************************************** - * Copyright (C) 2009 by Karin Erbertseder * - * Copyright (C) 2009 by Andreas Lauser * - * Copyright (C) 2008 by Bernd Flemisch * - * Institute of Hydraulic Engineering * - * University of Stuttgart, Germany * - * email: <givenname>.<name>@iws.uni-stuttgart.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version, as long as this copyright notice * - * is included in its original form. * - * * - * This program is distributed WITHOUT ANY WARRANTY. * - *****************************************************************************/ -/*! - * \file - * - * \brief Contains the quantities which are are constant within a - * finite element in the two-phase model. - * - * For the plain twophase model everything is given on the finite - * volumes, so this class is empty. - */ -#ifndef DUMUX_1P2C_ELEMENT_DATA_HH -#define DUMUX_1P2C_ELEMENT_DATA_HH - -namespace Dumux -{ -/*! - * \brief This template class contains the quantities which are are - * constant within a finite element in the two-phase model. - * - * For the plain two-phase model everything is given on the finite - * volumes, so this class is empty. - */ -template <class TypeTag> -class OnePTwoCElementData -{ -}; - -} // end namepace - -#endif diff --git a/dumux/boxmodels/1p2c/1p2cfluidstate.hh b/dumux/boxmodels/1p2c/1p2cfluidstate.hh index 8f690c80f9443ec3faea0fc1b087f76660165aa7..1974dba0a145339aaf15678338b093a04115bc5e 100644 --- a/dumux/boxmodels/1p2c/1p2cfluidstate.hh +++ b/dumux/boxmodels/1p2c/1p2cfluidstate.hh @@ -36,10 +36,10 @@ template <class TypeTag> class OnePTwoCFluidState : public FluidState<typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)), OnePTwoCFluidState<TypeTag> > { - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename GET_PROP(TypeTag, PTAG(SolutionTypes)) SolutionTypes; - typedef typename SolutionTypes::PrimaryVarVector PrimaryVarVector; + + typedef typename GET_PROP_TYPE(TypeTag, PTAG(PrimaryVarVector)) PrimaryVarVector; typedef typename GET_PROP_TYPE(TypeTag, PTAG(OnePTwoCIndices)) Indices; diff --git a/dumux/boxmodels/1p2c/1p2cfluxdata.hh b/dumux/boxmodels/1p2c/1p2cfluxvars.hh similarity index 88% rename from dumux/boxmodels/1p2c/1p2cfluxdata.hh rename to dumux/boxmodels/1p2c/1p2cfluxvars.hh index 070a4610ea7b0ba3410fbeb7bd10435cc1b8cb43..d9f9e8388027833daf30c96222ee7995a9af8eb2 100644 --- a/dumux/boxmodels/1p2c/1p2cfluxdata.hh +++ b/dumux/boxmodels/1p2c/1p2cfluxvars.hh @@ -1,4 +1,4 @@ -// $Id: 1p2cfluxdata.hh 3838 2010-07-15 08:31:53Z bernd $ +// $Id: 1p2cfluxvars.hh 3838 2010-07-15 08:31:53Z bernd $ /***************************************************************************** * Copyright (C) 2009 by Karin Erbertseder * * Copyright (C) 2009 by Andreas Lauser * @@ -41,16 +41,16 @@ namespace Dumux * the intergration point, etc. */ template <class TypeTag> -class OnePTwoCFluxData +class OnePTwoCFluxVars { - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(VertexData)) VertexData; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(SecondaryVars)) SecondaryVars; typedef typename GridView::template Codim<0>::Entity Element; - typedef std::vector<VertexData> VertexDataArray; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementSecondaryVars)) ElementSecondaryVars; enum { dim = GridView::dimension, @@ -58,24 +58,24 @@ class OnePTwoCFluxData numPhases = GET_PROP_VALUE(TypeTag, PTAG(NumPhases)) }; - typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; - typedef Dune::FieldVector<Scalar, dim> LocalPosition; + typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; + typedef Dune::FieldVector<Scalar, dim> LocalPosition; typedef Dune::FieldMatrix<Scalar, dim, dim> Tensor; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; - typedef typename FVElementGeometry::SubControlVolume SCV; - typedef typename FVElementGeometry::SubControlVolumeFace SCVFace; + typedef typename FVElementGeometry::SubControlVolume SCV; + typedef typename FVElementGeometry::SubControlVolumeFace SCVFace; typedef Dune::FieldVector<Scalar, numPhases> PhasesVector; typedef typename GET_PROP_TYPE(TypeTag, PTAG(OnePTwoCIndices)) Indices; public: - OnePTwoCFluxData(const Problem &problem, + OnePTwoCFluxVars(const Problem &problem, const Element &element, const FVElementGeometry &elemGeom, int faceIdx, - const VertexDataArray &elemDat) + const ElementSecondaryVars &elemDat) : fvElemGeom(elemGeom) { face = &fvElemGeom.subContVolFace[faceIdx]; @@ -101,7 +101,7 @@ public: private: void calculateGradients_(const Problem &problem, const Element &element, - const VertexDataArray &elemDat) + const ElementSecondaryVars &elemDat) { GlobalPosition tmp; if (!problem.spatialParameters().useTwoPointGradient(element, face->i, face->j)) { @@ -166,7 +166,7 @@ private: void calculateVelocities_(const Problem &problem, const Element &element, - const VertexDataArray &elemDat) + const ElementSecondaryVars &elemDat) { Tensor K; problem.spatialParameters().meanK(K, @@ -190,10 +190,10 @@ private: void calculateDiffCoeffPM_(const Problem &problem, const Element &element, - const VertexDataArray &elemDat) + const ElementSecondaryVars &elemDat) { - const VertexData &vDat_i = elemDat[face->i]; - const VertexData &vDat_j = elemDat[face->j]; + const SecondaryVars &vDat_i = elemDat[face->i]; + const SecondaryVars &vDat_j = elemDat[face->j]; // Diffusion coefficient in the porous medium diffCoeffPM @@ -203,10 +203,10 @@ private: void calculateDispersionTensor_(const Problem &problem, const Element &element, - const VertexDataArray &elemDat) + const ElementSecondaryVars &elemDat) { - const VertexData &vDat_i = elemDat[face->i]; - const VertexData &vDat_j = elemDat[face->j]; + const SecondaryVars &vDat_i = elemDat[face->i]; + const SecondaryVars &vDat_j = elemDat[face->j]; //calculate dispersivity at the interface: [0]: alphaL = longitudinal disp. [m], [1] alphaT = transverse disp. [m] Dune::FieldVector<Scalar, 2> dispersivity(0); diff --git a/dumux/boxmodels/1p2c/1p2cboxjacobian.hh b/dumux/boxmodels/1p2c/1p2clocalresidual.hh similarity index 58% rename from dumux/boxmodels/1p2c/1p2cboxjacobian.hh rename to dumux/boxmodels/1p2c/1p2clocalresidual.hh index f9187ba7a36d0ec8bd8a4215bce8e3f6a37f8033..5848f483ba3786cf9892fda91e0f3468de0074ba 100644 --- a/dumux/boxmodels/1p2c/1p2cboxjacobian.hh +++ b/dumux/boxmodels/1p2c/1p2clocalresidual.hh @@ -1,4 +1,4 @@ -// $Id: 1p2cboxjacobian.hh 3784 2010-06-24 13:43:57Z bernd $ +// $Id: 1p2clocalresidual.hh 3784 2010-06-24 13:43:57Z bernd $ /***************************************************************************** * Copyright (C) 2009 by Karin Erbertseder * * Copyright (C) 2009 by Andreas Lauser * @@ -18,13 +18,13 @@ #ifndef DUMUX_ONEP_TWOC_BOX_JACOBIAN_HH #define DUMUX_ONEP_TWOC_BOX_JACOBIAN_HH -#include <dumux/boxmodels/boxscheme/boxscheme.hh> +#include <dumux/boxmodels/common/boxmodel.hh> #include <dumux/boxmodels/1p2c/1p2cproperties.hh> -#include <dumux/boxmodels/1p2c/1p2cvertexdata.hh> -#include <dumux/boxmodels/1p2c/1p2celementdata.hh> -#include <dumux/boxmodels/1p2c/1p2cfluxdata.hh> +#include <dumux/boxmodels/1p2c/1p2csecondaryvars.hh> + +#include <dumux/boxmodels/1p2c/1p2cfluxvars.hh> #include <dune/common/collectivecommunication.hh> #include <vector> @@ -37,11 +37,11 @@ namespace Dumux * two-component model in the BOX scheme. */ template<class TypeTag> -class OnePTwoCBoxJacobian : public BoxJacobian<TypeTag> +class OnePTwoCLocalResidual : public BoxLocalResidual<TypeTag> { protected: - typedef OnePTwoCBoxJacobian<TypeTag> ThisType; - typedef BoxJacobian<TypeTag> ParentType; + typedef OnePTwoCLocalResidual<TypeTag> ThisType; + typedef BoxLocalResidual<TypeTag> ParentType; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(OnePTwoCIndices)) Indices; @@ -68,28 +68,23 @@ protected: typedef Dune::FieldVector<Scalar, dim> LocalPosition; typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; - typedef typename GET_PROP(TypeTag, PTAG(SolutionTypes)) SolutionTypes; - typedef typename SolutionTypes::PrimaryVarVector PrimaryVarVector; - typedef typename SolutionTypes::SolutionVector SolutionVector; - typedef typename SolutionTypes::SolutionOnElement SolutionOnElement; + + typedef typename GET_PROP_TYPE(TypeTag, PTAG(PrimaryVarVector)) PrimaryVarVector; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(SolutionVector)) SolutionVector; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementSolutionVector)) ElementSolutionVector; typedef Dune::FieldVector<Scalar, numPhases> PhasesVector; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(VertexData)) VertexData; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementData)) ElementData; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluxData)) FluxData; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(SecondaryVars)) SecondaryVars; + + typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluxVars)) FluxVars; - typedef std::vector<VertexData> VertexDataArray; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementSecondaryVars)) ElementSecondaryVars; typedef Dune::FieldMatrix<Scalar, dim, dim> Tensor; static const Scalar upwindAlpha = GET_PROP_VALUE(TypeTag, PTAG(UpwindAlpha)); public: - OnePTwoCBoxJacobian(Problem &problem) - : ParentType(problem) - { - }; - /*! * \brief Evaluate the amount all conservation quantites * (e.g. phase mass) within a finite volume. @@ -101,8 +96,8 @@ public: // used. The secondary variables are used accordingly. This // is required to compute the derivative of the storage term // using the implicit euler method. - const VertexDataArray &elemDat = usePrevSol ? this->prevElemDat_ : this->curElemDat_; - const VertexData &vertDat = elemDat[scvIdx]; + const ElementSecondaryVars &elemDat = usePrevSol ? this->prevSecVars_() : this->curSecVars_(); + const SecondaryVars &vertDat = elemDat[scvIdx]; // storage term of continuity equation result[konti] = 0; @@ -117,17 +112,17 @@ public: */ void computeFlux(PrimaryVarVector &flux, int faceId) const { - FluxData vars(this->problem_, - this->curElement_(), - this->curElementGeom_, - faceId, - this->curElemDat_); + FluxVars vars(this->problem_(), + this->elem_(), + this->fvElemGeom_(), + faceId, + this->curSecVars_()); flux = 0; // data attached to upstream and the downstream vertices // of the current phase - const VertexData &up = this->curElemDat_[vars.upstreamIdx]; - const VertexData &dn = this->curElemDat_[vars.downstreamIdx]; + const SecondaryVars &up = this->curSecVars_(vars.upstreamIdx); + const SecondaryVars &dn = this->curSecVars_(vars.downstreamIdx); flux[konti] = vars.vDarcyNormal / vars.viscosityAtIP; @@ -162,61 +157,10 @@ public: */ void computeSource(PrimaryVarVector &q, int localVertexIdx) { - this->problem_.source(q, - this->curElement_(), - this->curElementGeom_, - localVertexIdx); - } - - /*! - * \brief Add the mass fraction of air in water to VTK output of - * the current timestep. - */ - template <class MultiWriter> - void addOutputVtkFields(MultiWriter &writer, const SolutionVector &globalSol) - { - typedef Dune::BlockVector<Dune::FieldVector<Scalar, 1> > ScalarField; - - // create the required scalar fields - unsigned numVertices = this->gridView_.size(dim); - - ScalarField *pressure = writer.template createField<Scalar, 1>(numVertices); - ScalarField *molefraction = writer.template createField<Scalar, 1>(numVertices); - - unsigned numElements = this->gridView_.size(0); - ScalarField *rank = writer.template createField<Scalar, 1>(numElements); - - SolutionOnElement tmpSol; - VertexDataArray elemDat; - - ElementIterator elementIt = this->gridView_.template begin<0>(); - const ElementIterator &endit = this->gridView_.template end<0>(); - for (; elementIt != endit; ++elementIt) - { - int idx = this->problem_.model().elementMapper().map(*elementIt); - (*rank)[idx] = this->gridView_.comm().rank(); - - int numLocalVerts = elementIt->template count<dim>(); - tmpSol.resize(numLocalVerts); - - setCurrentElement(*elementIt); - this->restrictToElement(tmpSol, globalSol); - updateElementData_(elemDat, tmpSol, false); - - for (int i = 0; i < numLocalVerts; ++i) - { - int globalIdx = this->problem_.model().vertexMapper().map(*elementIt, i, dim); - - (*pressure)[globalIdx] = elemDat[i].pressure; - (*molefraction)[globalIdx] = elemDat[i].molefraction; - - }; - } - - writer.addVertexData(pressure, "pressure"); - writer.addVertexData(molefraction, "molefraction"); - writer.addCellData(rank, "process rank"); - + this->problem_().source(q, + this->elem_(), + this->fvElemGeom_(), + localVertexIdx); } }; diff --git a/dumux/boxmodels/1p2c/1p2cmodel.hh b/dumux/boxmodels/1p2c/1p2cmodel.hh new file mode 100644 index 0000000000000000000000000000000000000000..bd8afd7a1192256a8fe56cca47344fa8965b09b4 --- /dev/null +++ b/dumux/boxmodels/1p2c/1p2cmodel.hh @@ -0,0 +1,153 @@ +// $Id: 1p2cboxmodel.hh 3738 2010-06-15 14:01:09Z lauser $ +/***************************************************************************** + * Copyright (C) 2009 by Karin Erbertseder * + * Copyright (C) 2009 by Andreas Lauser * + * Copyright (C) 2008 by Bernd Flemisch * + * Institute of Hydraulic Engineering * + * University of Stuttgart, Germany * + * email: <givenname>.<name>@iws.uni-stuttgart.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version, as long as this copyright notice * + * is included in its original form. * + * * + * This program is distributed WITHOUT ANY WARRANTY. * + *****************************************************************************/ +#ifndef DUMUX_ONEP_TWOC_MODEL_HH +#define DUMUX_ONEP_TWOC_MODEL_HH + +#include "1p2clocalresidual.hh" +#include "1p2cproblem.hh" + +namespace Dumux +{ + +/*! + * \ingroup BoxProblems + * \defgroup OnePTwoCBoxProblems One-phase Two-component box problems + */ + +/*! + * \ingroup BoxModels + * \defgroup OnePTwoCBoxModel One-phase Two-component box model + */ + +/*! + * \ingroup OnePTwoCBoxModel + * \brief Adaption of the BOX scheme to the one-phase two-component flow model. + * + * This model implements an one-phase flow of an incompressible fluid, that consists of two components, + * using a standard Darcy + * approach (neglecting gravitation) as the equation for the conservation of momentum: + \f[ + v_{D} = - \frac{K}{\mu} + \left(\text{grad} p - \varrho g \right) + \f] + * + * By inserting this into the continuity equation, one gets + \f[ + - \text{div} \left\{ + \varrho \frac{K}{\mu} \left(\text{grad} p - \varrho g \right) + \right\} = q \;, + \f] + * + * The transport of the components is described by the following equation: + \f[ + \Phi \varrho \frac{ \partial x}{\partial t} - \text{div} \left( \varrho \frac{K x}{\mu} \left( \text{grad} p - + \varrho g \right) + \varrho \tau \Phi D \text{grad} x \right) = q. + \f] + * + * All equations are discretized using a fully-coupled vertex + * centered finite volume (box) scheme as spatial and + * the implicit Euler method as time discretization. + * + * The primary variables are the pressure \f$p\f$ and the mole fraction of dissolved component \f$x\f$. + */ + +template<class TypeTag > +class OnePTwoCBoxModel : public BoxModel<TypeTag> +{ + typedef OnePTwoCBoxModel<TypeTag> ThisType; + typedef BoxModel<TypeTag> ParentType; + + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; + typedef typename GridView::template Codim<0>::Entity Element; + typedef typename GridView::template Codim<0>::Iterator ElementIterator; + + typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(SecondaryVars)) SecondaryVars; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementSecondaryVars)) ElementSecondaryVars; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementBoundaryTypes)) ElementBoundaryTypes; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(VertexMapper)) VertexMapper; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementMapper)) ElementMapper; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(SolutionVector)) SolutionVector; + + enum { + dim = GridView::dimension, + }; + +public: + /*! + * \brief Append all quantities of interest which can be derived + * from the solution of the current time step to the VTK + * writer. + */ + template<class MultiWriter> + void addOutputVtkFields(const SolutionVector &sol, + MultiWriter &writer) + { + typedef Dune::BlockVector<Dune::FieldVector<Scalar, 1> > ScalarField; + + // create the required scalar fields + unsigned numVertices = this->problem_().gridView().size(dim); + ScalarField *pressure = writer.template createField<Scalar, 1>(numVertices); + ScalarField *molefraction = writer.template createField<Scalar, 1>(numVertices); + + unsigned numElements = this->gridView_().size(0); + ScalarField *rank = + writer.template createField<Scalar, 1> (numElements); + + FVElementGeometry fvElemGeom; + SecondaryVars secVars; + ElementBoundaryTypes elemBcTypes; + + ElementIterator elemIt = this->gridView_().template begin<0>(); + ElementIterator elemEndIt = this->gridView_().template end<0>(); + for (; elemIt != elemEndIt; ++elemIt) + { + int idx = this->problem_().model().elementMapper().map(*elemIt); + (*rank)[idx] = this->gridView_().comm().rank(); + + fvElemGeom.update(this->gridView_(), *elemIt); + elemBcTypes.update(this->problem_(), *elemIt, fvElemGeom); + + int numVerts = elemIt->template count<dim> (); + for (int i = 0; i < numVerts; ++i) + { + int globalIdx = this->vertexMapper().map(*elemIt, i, dim); + secVars.update(sol[globalIdx], + this->problem_(), + *elemIt, + fvElemGeom, + i, + false); + + + (*pressure)[globalIdx] = secVars.pressure; + (*molefraction)[globalIdx] = secVars.molefraction; + }; + } + + writer.addVertexData(pressure, "pressure"); + writer.addVertexData(molefraction, "molefraction"); + writer.addCellData(rank, "process rank"); + } + +}; +} + +#endif diff --git a/dumux/boxmodels/1p2c/1p2cboxproblem.hh b/dumux/boxmodels/1p2c/1p2cproblem.hh similarity index 79% rename from dumux/boxmodels/1p2c/1p2cboxproblem.hh rename to dumux/boxmodels/1p2c/1p2cproblem.hh index bcb81e2bfee96158eb991476c18971f9bd2dc3e3..45f67f9d381bb87fba7804d8364ac50f90a48dfb 100644 --- a/dumux/boxmodels/1p2c/1p2cboxproblem.hh +++ b/dumux/boxmodels/1p2c/1p2cproblem.hh @@ -19,27 +19,29 @@ * \brief Base class for all problems which use the single-phase, * two-component box model */ -#ifndef DUMUX_1P2C_BOX_PROBLEM_HH -#define DUMUX_1P2C_BOX_PROBLEM_HH +#ifndef DUMUX_1P2C_PROBLEM_HH +#define DUMUX_1P2C_PROBLEM_HH -#include <dumux/boxmodels/boxscheme/boxproblem.hh> +#include <dumux/boxmodels/common/boxproblem.hh> namespace Dumux { /*! * \ingroup OnePTwoCProblems - * \brief Base class for all problems which use the single-phase, two-component box model + * \brief Base class for all problems which use the single-phase, two-component box model * * \todo Please doc me more! */ -template<class TypeTag, class Implementation> -class OnePTwoCBoxProblem : public BoxProblem<TypeTag, Implementation> +template<class TypeTag> +class OnePTwoCBoxProblem : public BoxProblem<TypeTag> { - typedef BoxProblem<TypeTag, Implementation> ParentType; + typedef BoxProblem<TypeTag> ParentType; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Model)) Implementation; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; - typedef typename GridView::Grid Grid; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; + typedef typename GridView::Grid Grid; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(TimeManager)) TimeManager; // material properties typedef typename GET_PROP_TYPE(TypeTag, PTAG(SpatialParameters)) SpatialParameters; @@ -49,11 +51,11 @@ class OnePTwoCBoxProblem : public BoxProblem<TypeTag, Implementation> dimWorld = Grid::dimensionworld }; - typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; + typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; public: - OnePTwoCBoxProblem(const GridView &gridView) - : ParentType(gridView), + OnePTwoCBoxProblem(TimeManager &timeManager, const GridView &gridView) + : ParentType(timeManager, gridView), gravity_(0), spatialParams_(gridView) { @@ -106,7 +108,7 @@ private: const Implementation *asImp_() const { return static_cast<const Implementation *>(this); } - GlobalPosition gravity_; + GlobalPosition gravity_; // soil properties SpatialParameters spatialParams_; diff --git a/dumux/boxmodels/1p2c/1p2cproperties.hh b/dumux/boxmodels/1p2c/1p2cproperties.hh index b8035fc360c572bd571ec676d9ed2a06943d34b4..1255e102493358bea5cce5e57c12d729f52324b8 100644 --- a/dumux/boxmodels/1p2c/1p2cproperties.hh +++ b/dumux/boxmodels/1p2c/1p2cproperties.hh @@ -25,7 +25,7 @@ #ifndef DUMUX_1P2C_PROPERTIES_HH #define DUMUX_1P2C_PROPERTIES_HH -#include<dumux/boxmodels/boxscheme/boxproperties.hh> +#include<dumux/boxmodels/common/boxproperties.hh> namespace Dumux { @@ -36,16 +36,13 @@ template<class TypeTag> class OnePTwoCBoxModel; template<class TypeTag> -class OnePTwoCBoxJacobian; +class OnePTwoCLocalResidual; template <class TypeTag> -class OnePTwoCVertexData; +class OnePTwoCSecondaryVars; template <class TypeTag> -class OnePTwoCElementData; - -template <class TypeTag> -class OnePTwoCFluxData; +class OnePTwoCFluxVars; /*! * \brief The indices for the isothermal single-phase, two-component model. @@ -65,7 +62,7 @@ namespace Properties ////////////////////////////////////////////////////////////////// //! The type tag for the isothermal single-phase, two-component problems -NEW_TYPE_TAG(BoxOnePTwoC, INHERITS_FROM(BoxScheme)); +NEW_TYPE_TAG(BoxOnePTwoC, INHERITS_FROM(BoxModel)); ////////////////////////////////////////////////////////////////// // Property tags @@ -89,20 +86,20 @@ SET_INT_PROP(BoxOnePTwoC, NumComponents, 2); //!< The number of components in th //! Use the 1p2c local jacobian operator for the 1p2c model SET_TYPE_PROP(BoxOnePTwoC, - LocalJacobian, - OnePTwoCBoxJacobian<TypeTag>); + LocalResidual, + OnePTwoCLocalResidual<TypeTag>); //! the Model property SET_TYPE_PROP(BoxOnePTwoC, Model, OnePTwoCBoxModel<TypeTag>); -//! the VertexData property -SET_TYPE_PROP(BoxOnePTwoC, VertexData, OnePTwoCVertexData<TypeTag>); +//! the SecondaryVars property +SET_TYPE_PROP(BoxOnePTwoC, SecondaryVars, OnePTwoCSecondaryVars<TypeTag>); + + -//! the ElementData property -SET_TYPE_PROP(BoxOnePTwoC, ElementData, OnePTwoCElementData<TypeTag>); -//! the FluxData property -SET_TYPE_PROP(BoxOnePTwoC, FluxData, OnePTwoCFluxData<TypeTag>); +//! the FluxVars property +SET_TYPE_PROP(BoxOnePTwoC, FluxVars, OnePTwoCFluxVars<TypeTag>); //! the default upwind factor. Default 1.0, i.e. fully upwind... SET_SCALAR_PROP(BoxOnePTwoC, UpwindAlpha, 1.0); diff --git a/dumux/boxmodels/1p2c/1p2cvertexdata.hh b/dumux/boxmodels/1p2c/1p2csecondaryvars.hh similarity index 75% rename from dumux/boxmodels/1p2c/1p2cvertexdata.hh rename to dumux/boxmodels/1p2c/1p2csecondaryvars.hh index a7d57dc18eb3ac34533dfb246e9dab42fb4150c3..6ac3d9ccab0ac9c7557348c5a6f5e81d7fcc534b 100644 --- a/dumux/boxmodels/1p2c/1p2cvertexdata.hh +++ b/dumux/boxmodels/1p2c/1p2csecondaryvars.hh @@ -1,4 +1,4 @@ -// $Id: 1p2cvertexdata.hh 3838 2010-07-15 08:31:53Z bernd $ +// $Id: 1p2csecondaryvars.hh 3838 2010-07-15 08:31:53Z bernd $ /***************************************************************************** * Copyright (C) 2009 by Karin Erbertseder * * Copyright (C) 2009 by Andreas Lauser * @@ -21,8 +21,8 @@ * \brief Quantities required by the single-phase, two-component box * model defined on a vertex. */ -#ifndef DUMUX_1P2C_VERTEX_DATA_HH -#define DUMUX_1P2C_VERTEX_DATA_HH +#ifndef DUMUX_1P2C_SECONDARY_VARS_HH +#define DUMUX_1P2C_SECONDARY_VARS_HH #include "1p2cfluidstate.hh" @@ -34,12 +34,13 @@ namespace Dumux * finite volume in the single-phase, two-component model. */ template <class TypeTag> -class OnePTwoCVertexData +class OnePTwoCSecondaryVars { - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(OnePTwoCIndices)) Indices; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(SecondaryVars)) Implementation; typedef OnePTwoCFluidState<TypeTag> FluidState; typedef typename GridView::template Codim<0>::Entity Element; @@ -56,35 +57,37 @@ class OnePTwoCVertexData transport = Indices::transport }; - typedef typename GET_PROP(TypeTag, PTAG(SolutionTypes)) SolutionTypes; + typedef typename GET_PROP(TypeTag, PTAG(ReferenceElements)) RefElemProp; - typedef typename RefElemProp::Container ReferenceElements; + typedef typename RefElemProp::Container ReferenceElements; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; - typedef typename SolutionTypes::PrimaryVarVector PrimaryVarVector; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(PrimaryVarVector)) PrimaryVarVector; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; - typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; - typedef Dune::FieldVector<Scalar, dim> LocalPosition; + typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; + typedef Dune::FieldVector<Scalar, dim> LocalPosition; public: /*! * \brief Update all quantities for a given control volume. */ - void update(const PrimaryVarVector &sol, + void update(const PrimaryVarVector &priVars, + const Problem &problem, const Element &element, const FVElementGeometry &elemGeom, - int vertIdx, - const Problem &problem, + int scvIdx, bool isOldSol) { - porosity = problem.spatialParameters().porosity(element, elemGeom, vertIdx); - tortuosity = problem.spatialParameters().tortuosity(element, elemGeom, vertIdx); - dispersivity = problem.spatialParameters().dispersivity(element, elemGeom, vertIdx); + primaryVars_ = priVars; - Scalar temperature = problem.temperature(element, elemGeom, vertIdx); - fluidState_.update(sol, temperature); + porosity = problem.spatialParameters().porosity(element, elemGeom, scvIdx); + tortuosity = problem.spatialParameters().tortuosity(element, elemGeom, scvIdx); + dispersivity = problem.spatialParameters().dispersivity(element, elemGeom, scvIdx); + + Scalar temperature = problem.temperature(element, elemGeom, scvIdx); + fluidState_.update(priVars, temperature); pressure = fluidState_.phasePressure(konti); molefraction = fluidState_.moleFrac(konti, transport); @@ -94,6 +97,18 @@ public: diffCoeff = FluidSystem::diffCoeff(konti, transport, konti, temperature, pressure, fluidState_); } + /*! + * \brief Sets the evaluation point used in the by the local jacobian. + */ + void setEvalPoint(const Implementation *ep) + { } + + /*! + * \brief Return the vector of primary variables + */ + const PrimaryVarVector &primaryVars() const + { return primaryVars_; } + Scalar porosity; Scalar density; Scalar viscosity; @@ -105,6 +120,8 @@ public: Scalar molarDensity; FluidState fluidState_; +protected: + PrimaryVarVector primaryVars_; }; } diff --git a/test/boxmodels/1p/1ptestproblem.hh b/test/boxmodels/1p/1ptestproblem.hh index 24e70583e2f0fe3eb804966c88a4287928915a1e..d241b48dfa7588fbfe5d77852b3bfafd36e1bfad 100644 --- a/test/boxmodels/1p/1ptestproblem.hh +++ b/test/boxmodels/1p/1ptestproblem.hh @@ -53,7 +53,6 @@ SET_PROP(OnePTestProblem, Grid) { typedef Dune::UGGrid<3> type; }; SET_TYPE_PROP(OnePTestProblem, Grid, Dune::YaspGrid<3>); #endif -#ifdef HAVE_DUNE_PDELAB SET_PROP(OnePTestProblem, LocalFEMSpace) { typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; @@ -64,7 +63,6 @@ public: typedef Dune::PDELab::Q1LocalFiniteElementMap<Scalar,Scalar,dim> type; // for cubes // typedef Dune::PDELab::P1LocalFiniteElementMap<Scalar,Scalar,dim> type; // for simplices }; -#endif SET_PROP(OnePTestProblem, NewtonLinearSolverVerbosity) {public: diff --git a/test/boxmodels/1p2c/test_1p2c.cc b/test/boxmodels/1p2c/test_1p2c.cc index 431f9f1bec16bf4b17d909fd43a541401e804890..4c050aa9495425d59cceb9084d816b0b66a257b0 100644 --- a/test/boxmodels/1p2c/test_1p2c.cc +++ b/test/boxmodels/1p2c/test_1p2c.cc @@ -19,77 +19,9 @@ #include "tissue_tumor_problem.hh" -#include <dune/common/exceptions.hh> -#include <dune/grid/common/gridinfo.hh> - -#include <dune/common/mpihelper.hh> - -#include <iostream> -#include <boost/format.hpp> - -void usage(const char *progname) -{ - std::cout << boost::format("usage: %s [--restart restartTime] gridFile.dgf tEnd dt\n")%progname; - exit(1); -}; +#include <dumux/common/start.hh> int main(int argc, char** argv) { - try { - typedef TTAG(TissueTumorProblem) TypeTag; - typedef GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef GET_PROP_TYPE(TypeTag, PTAG(Grid)) Grid; - typedef GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; - typedef Dune::FieldVector<Scalar, Grid::dimensionworld> GlobalPosition; - typedef Dune::GridPtr<Grid> GridPointer; - - // initialize MPI, finalize is done automatically on exit - Dune::MPIHelper::instance(argc, argv); - - // parse the command line arguments for the program - if (argc < 4) - usage(argv[0]); - - // deal with the restart stuff - int argPos = 1; - bool restart = false; - double restartTime = 0; - if (std::string("--restart") == argv[argPos]) { - restart = true; - ++argPos; - - std::istringstream(argv[argPos++]) >> restartTime; - } - - if (argc - argPos != 3) { - usage(argv[0]); - } - - double tEnd, dt; - const char *dgfFileName = argv[argPos++]; - std::istringstream(argv[argPos++]) >> tEnd; - std::istringstream(argv[argPos++]) >> dt; - - // create grid - - // -> load the grid from file - GridPointer gridPtr = GridPointer(dgfFileName); - (*gridPtr).loadBalance(); - Dune::gridinfo(*gridPtr); - - // instantiate and run the concrete problem - Problem problem(gridPtr->leafView()); - if (!problem.simulate(dt, tEnd)) - return 2; - - return 0; - } - catch (Dune::Exception &e) { - std::cerr << "Dune reported error: " << e << std::endl; - } - catch (...) { - std::cerr << "Unknown exception thrown!\n"; - } - - return 3; + return Dumux::startFromDGF<TTAG(TissueTumorProblem)>(argc, argv); } diff --git a/test/boxmodels/1p2c/tissue_tumor_problem.hh b/test/boxmodels/1p2c/tissue_tumor_problem.hh index be97ef5bec4c4a898954bad0adb5c692a167aa1e..738bcb768ef86de003f3646b2db9203dd1a612a9 100644 --- a/test/boxmodels/1p2c/tissue_tumor_problem.hh +++ b/test/boxmodels/1p2c/tissue_tumor_problem.hh @@ -17,7 +17,7 @@ *****************************************************************************/ /** * \file - * \brief Definition of a problem, where the distribution of a therapeutic agent + * \brief Definition of a problem, where the distribution of a therapeutic agent * within pulmonary tissue is described * \author Karin Erbertseder, Bernd Flemisch */ @@ -29,7 +29,7 @@ #include <dune/grid/io/file/dgfparser/dgfyasp.hh> #include <dumux/material/fluidsystems/isfluid_trail_system.hh> -#include <dumux/boxmodels/1p2c/1p2cboxmodel.hh> +#include <dumux/boxmodels/1p2c/1p2cmodel.hh> #include "tissue_tumor_spatialparameters.hh" @@ -54,7 +54,6 @@ SET_PROP(TissueTumorProblem, Grid) #endif }; -#ifdef HAVE_DUNE_PDELAB SET_PROP(TissueTumorProblem, LocalFEMSpace) { typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; @@ -62,11 +61,9 @@ SET_PROP(TissueTumorProblem, LocalFEMSpace) enum{dim = GridView::dimension}; public: - typedef Dune::PDELab::Q1LocalFiniteElementMap<Scalar,Scalar,dim> type; // for cubes -// typedef Dune::PDELab::P1LocalFiniteElementMap<Scalar,Scalar,dim> type; // for simplices + typedef Dune::PDELab::Q1LocalFiniteElementMap<Scalar,Scalar,dim> type; // for cubes +// typedef Dune::PDELab::P1LocalFiniteElementMap<Scalar,Scalar,dim> type; // for simplices }; -#endif - // Set the problem property SET_PROP(TissueTumorProblem, Problem) @@ -92,7 +89,7 @@ SET_BOOL_PROP(TissueTumorProblem, EnableGravity, false); /** - * \brief Definition of a problem, where the distribution of a therapeutic agent + * \brief Definition of a problem, where the distribution of a therapeutic agent * within pulmonary tissue is described * * The model domain is 22 mm long in x-direction and in y-direction with a discretization length of 0.1 @@ -117,13 +114,13 @@ SET_BOOL_PROP(TissueTumorProblem, EnableGravity, false); */ template <class TypeTag = TTAG(TissueTumorProblem) > -class TissueTumorProblem : public OnePTwoCBoxProblem<TypeTag, TissueTumorProblem<TypeTag> > +class TissueTumorProblem : public OnePTwoCBoxProblem<TypeTag> { - typedef TissueTumorProblem<TypeTag> ThisType; - typedef OnePTwoCBoxProblem<TypeTag, ThisType> ParentType; + typedef TissueTumorProblem<TypeTag> ThisType; + typedef OnePTwoCBoxProblem<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(GridView)) GridView; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; // copy some indices for convenience typedef typename GET_PROP_TYPE(TypeTag, PTAG(OnePTwoCIndices)) Indices; @@ -137,22 +134,23 @@ class TissueTumorProblem : public OnePTwoCBoxProblem<TypeTag, TissueTumorProblem transport = Indices::transport, }; - typedef typename GET_PROP(TypeTag, PTAG(SolutionTypes)) SolutionTypes; - typedef typename SolutionTypes::PrimaryVarVector PrimaryVarVector; - typedef typename SolutionTypes::BoundaryTypeVector BoundaryTypeVector; - typedef typename GridView::template Codim<0>::Entity Element; - typedef typename GridView::template Codim<dim>::Entity Vertex; - typedef typename GridView::Intersection Intersection; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(PrimaryVarVector)) PrimaryVarVector; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(BoundaryTypes)) BoundaryTypes; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(TimeManager)) TimeManager; + + typedef typename GridView::template Codim<0>::Entity Element; + typedef typename GridView::template Codim<dim>::Entity Vertex; + typedef typename GridView::Intersection Intersection; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; - typedef Dune::FieldVector<Scalar, dim> LocalPosition; - typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; + typedef Dune::FieldVector<Scalar, dim> LocalPosition; + typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; public: - TissueTumorProblem(const GridView &gridView) - : ParentType(gridView) + TissueTumorProblem(TimeManager &timeManager, const GridView &gridView) + : ParentType(timeManager, gridView) { } @@ -176,7 +174,7 @@ public: */ Scalar temperature(const Element &element, const FVElementGeometry &fvElemGeom, - int scvIdx) const + int scvIdx) const { return 273.15 + 36; // in [K] }; @@ -192,12 +190,12 @@ public: * \brief Specifies which kind of boundary condition should be * used for which equation on a given boundary segment. */ - void boundaryTypes(BoundaryTypeVector &values, + void boundaryTypes(BoundaryTypes &values, const Element &element, const FVElementGeometry &fvElemGeom, const Intersection &is, - int scvIdx, - int boundaryFaceIdx) const + int scvIdx, + int boundaryFaceIdx) const { values.setAllDirichlet(); } @@ -212,8 +210,8 @@ public: const Element &element, const FVElementGeometry &fvElemGeom, const Intersection &is, - int scvIdx, - int boundaryFaceIdx) const + int scvIdx, + int boundaryFaceIdx) const { const GlobalPosition &globalPos = element.geometry().corner(scvIdx); @@ -233,8 +231,8 @@ public: const Element &element, const FVElementGeometry &fvElemGeom, const Intersection &is, - int scvIdx, - int boundaryFaceIdx) const + int scvIdx, + int boundaryFaceIdx) const { const GlobalPosition &globalPos = element.geometry().corner(scvIdx); @@ -270,7 +268,7 @@ public: void source(PrimaryVarVector &values, const Element &element, const FVElementGeometry &fvElemGeom, - int scvIdx) const + int scvIdx) const { const GlobalPosition &globalPos = element.geometry().corner(scvIdx); @@ -290,7 +288,7 @@ public: void initial(PrimaryVarVector &values, const Element &element, const FVElementGeometry &fvElemGeom, - int scvIdx) const + int scvIdx) const { const GlobalPosition &globalPos = element.geometry().corner(scvIdx); diff --git a/test/boxmodels/1p2c/tissue_tumor_spatialparameters.hh b/test/boxmodels/1p2c/tissue_tumor_spatialparameters.hh index 58fe6ccb8b33a793927d8ba35c8c00786ac8b939..c5c4289bd4007a674f307b49cff7e2a38503baa7 100644 --- a/test/boxmodels/1p2c/tissue_tumor_spatialparameters.hh +++ b/test/boxmodels/1p2c/tissue_tumor_spatialparameters.hh @@ -32,29 +32,29 @@ namespace Dumux template<class TypeTag> class TissueTumorSpatialParameters : public BoxSpatialParameters<TypeTag> { - typedef BoxSpatialParameters<TypeTag> ParentType; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Grid)) Grid; + typedef BoxSpatialParameters<TypeTag> ParentType; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Grid)) Grid; typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename Grid::ctype CoordScalar; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; + typedef typename Grid::ctype CoordScalar; enum { dim=GridView::dimension, dimWorld=GridView::dimensionworld, }; - typedef Dune::FieldVector<CoordScalar,dim> LocalPosition; + typedef Dune::FieldVector<CoordScalar,dim> LocalPosition; typedef Dune::FieldVector<CoordScalar,dimWorld> GlobalPosition; typedef Dune::FieldVector<CoordScalar,dimWorld> Vector; - typedef typename GET_PROP(TypeTag, PTAG(SolutionTypes)) SolutionTypes; - typedef typename SolutionTypes::SolutionVector SolutionVector; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(VertexData)) VertexData; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluxData)) FluxData; - typedef std::vector<VertexData> VertexDataArray; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(SolutionVector)) SolutionVector; + + typedef typename GET_PROP_TYPE(TypeTag, PTAG(SecondaryVars)) SecondaryVars; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluxVars)) FluxVars; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementSecondaryVars)) ElementSecondaryVars; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; - typedef typename GridView::template Codim<0>::Entity Element; + typedef typename GridView::template Codim<0>::Entity Element; typedef RegularizedBrooksCorey<Scalar> EffMaterialLaw; //typedef LinearMaterial<Scalar> EffMaterialLaw; @@ -87,13 +87,13 @@ public: /*! * \brief Define the intrinsic permeability \f$[m^2]\f$. * - * \param element The current finite element - * \param fvElemGeom The current finite volume geometry of the element - * \param scvfIdx The index sub-control volume face where the + * \param element The current finite element + * \param fvElemGeom The current finite volume geometry of the element + * \param scvfIdx The index sub-control volume face where the */ const Scalar intrinsicPermeability(const Element &element, const FVElementGeometry &fvElemGeom, - int scvIdx) const + int scvIdx) const { const GlobalPosition &pos = fvElemGeom.subContVol[scvIdx].global; if (isTumor_(pos)) @@ -105,13 +105,13 @@ public: /*! * \brief Define the porosity \f$[-]\f$. * - * \param element The finite element - * \param fvElemGeom The finite volume geometry - * \param scvIdx The local index of the sub-control volume where + * \param element The finite element + * \param fvElemGeom The finite volume geometry + * \param scvIdx The local index of the sub-control volume where */ double porosity(const Element &element, const FVElementGeometry &fvElemGeom, - int scvIdx) const + int scvIdx) const { const GlobalPosition &pos = fvElemGeom.subContVol[scvIdx].global; if (isTumor_(pos)) @@ -123,13 +123,13 @@ public: /*! * \brief Define the tortuosity \f$[?]\f$. * - * \param element The finite element - * \param fvElemGeom The finite volume geometry - * \param scvIdx The local index of the sub-control volume where + * \param element The finite element + * \param fvElemGeom The finite volume geometry + * \param scvIdx The local index of the sub-control volume where */ double tortuosity(const Element &element, const FVElementGeometry &fvElemGeom, - int scvIdx) const + int scvIdx) const { const GlobalPosition &pos = fvElemGeom.subContVol[scvIdx].global; if (isTumor_(pos)) @@ -141,13 +141,13 @@ public: /*! * \brief Define the dispersivity \f$[?]\f$. * - * \param element The finite element - * \param fvElemGeom The finite volume geometry - * \param scvIdx The local index of the sub-control volume where + * \param element The finite element + * \param fvElemGeom The finite volume geometry + * \param scvIdx The local index of the sub-control volume where */ double dispersivity(const Element &element, const FVElementGeometry &fvElemGeom, - int scvIdx) const + int scvIdx) const { return 0; }