diff --git a/dumux/porousmediumflow/1p2c/implicit/model.hh b/dumux/porousmediumflow/1p2c/implicit/model.hh index d8c79746bff9e3c207162abd60b3eac2ae50d01b..bb18c28c3a17467e01242ac638e9d8196fed9e26 100644 --- a/dumux/porousmediumflow/1p2c/implicit/model.hh +++ b/dumux/porousmediumflow/1p2c/implicit/model.hh @@ -27,7 +27,8 @@ #ifndef DUMUX_ONEP_TWOC_MODEL_HH #define DUMUX_ONEP_TWOC_MODEL_HH -#include <dumux/porousmediumflow/implicit/velocityoutput.hh> +#include <dumux/porousmediumflow/nonisothermal/implicit/model.hh> + #include "properties.hh" namespace Dumux @@ -73,90 +74,43 @@ namespace Dumux template<class TypeTag > class OnePTwoCModel : public GET_PROP_TYPE(TypeTag, BaseModel) { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using ParentType = typename GET_PROP_TYPE(TypeTag, BaseModel); + using Problem = typename GET_PROP_TYPE(TypeTag, Problem); using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); + using NonIsothermalModel = Dumux::NonIsothermalModel<TypeTag>; - static const int dim = GridView::dimension; - static const int dimWorld = GridView::dimensionworld; static const int phaseIdx = Indices::phaseIdx; - static const bool isBox = GET_PROP_VALUE(TypeTag, ImplicitIsBox); public: + /*! - * \brief \copybrief ImplicitModel::addOutputVtkFields + * \brief Apply the initial conditions to the model. * - * Specialization for the OnePTwoCModel, adding pressure, - * mass and mole fractions, and the process rank to the VTK writer. + * \param problem The object representing the problem which needs to + * be simulated. */ - template<class MultiWriter> - void addOutputVtkFields(const SolutionVector &sol, MultiWriter &writer) + void init(Problem& problem) { - // create the required scalar fields - unsigned numDofs = this->numDofs(); - auto& pressure = *writer.allocateManagedBuffer(numDofs); - auto& delp = *writer.allocateManagedBuffer(numDofs); - auto& moleFraction0 = *writer.allocateManagedBuffer(numDofs); - auto& moleFraction1 = *writer.allocateManagedBuffer(numDofs); - auto& massFraction0 = *writer.allocateManagedBuffer(numDofs); - auto& massFraction1 = *writer.allocateManagedBuffer(numDofs); - auto& rho = *writer.allocateManagedBuffer(numDofs); - auto& mu = *writer.allocateManagedBuffer(numDofs); - - auto& velocity = *(writer.template allocateManagedBuffer<double, dimWorld>(numDofs)); - ImplicitVelocityOutput<TypeTag> velocityOutput(this->problem_()); - - if (velocityOutput.enableOutput()) - velocity = 0.0; - - unsigned numElements = this->gridView_().size(0); - auto& rank = *writer.allocateManagedBuffer(numElements); - - for (const auto& element : elements(this->gridView_(), Dune::Partitions::interior)) - { - int eIdx = this->problem_().model().elementMapper().index(element); - - rank[eIdx] = this->gridView_().comm().rank(); - - auto fvGeometry = localView(this->globalFvGeometry()); - fvGeometry.bind(element); - - auto elemVolVars = localView(this->curGlobalVolVars()); - elemVolVars.bind(element, fvGeometry, this->curSol()); - - for (auto&& scv : scvs(fvGeometry)) - { - const auto& volVars = elemVolVars[scv]; - const auto dofIdxGlobal = scv.dofIndex(); - - pressure[dofIdxGlobal] = volVars.pressure(phaseIdx); - delp[dofIdxGlobal] = volVars.pressure(phaseIdx) - 1e5; - moleFraction0[dofIdxGlobal] = volVars.moleFraction(phaseIdx, 0); - moleFraction1[dofIdxGlobal] = volVars.moleFraction(phaseIdx, 1); - massFraction0[dofIdxGlobal] = volVars.massFraction(phaseIdx, 0); - massFraction1[dofIdxGlobal] = volVars.massFraction(phaseIdx, 1); - rho[dofIdxGlobal] = volVars.density(phaseIdx); - mu[dofIdxGlobal] = volVars.viscosity(phaseIdx); - } - - velocityOutput.calculateVelocity(velocity, elemVolVars, fvGeometry, element, phaseIdx); - } - - writer.attachDofData(pressure, "P", isBox); - writer.attachDofData(delp, "delp", isBox); - if (velocityOutput.enableOutput()) - writer.attachDofData(velocity, "velocity", isBox, dim); - - writer.attachDofData(moleFraction0, "x_" + std::string(FluidSystem::componentName(0)), isBox); - writer.attachDofData(moleFraction1, "x_" + std::string(FluidSystem::componentName(1)), isBox); - writer.attachDofData(massFraction0, "X_" + std::string(FluidSystem::componentName(0)), isBox); - writer.attachDofData(massFraction1, "X_" + std::string(FluidSystem::componentName(1)), isBox); - - writer.attachDofData(rho, "rho", isBox); - writer.attachDofData(mu, "mu", isBox); - writer.attachCellData(rank, "process rank"); + ParentType::init(problem); + + // register standardized vtk output fields + auto& vtkOutputModule = problem.vtkOutputModule(); + vtkOutputModule.addSecondaryVariable("P", [](const VolumeVariables& v){ return v.pressure(phaseIdx); }); + vtkOutputModule.addSecondaryVariable("delp", [](const VolumeVariables& v){ return v.pressure(phaseIdx) - 1.0e5; }); + vtkOutputModule.addSecondaryVariable("rho", [](const VolumeVariables& v){ return v.density(phaseIdx); }); + vtkOutputModule.addSecondaryVariable("mu", [](const VolumeVariables& v){ return v.viscosity(phaseIdx); }); + vtkOutputModule.addSecondaryVariable("x_" + std::string(FluidSystem::componentName(0)), + [](const VolumeVariables& v){ return v.moleFraction(phaseIdx, 0); }); + vtkOutputModule.addSecondaryVariable("x_" + std::string(FluidSystem::componentName(1)), + [](const VolumeVariables& v){ return v.moleFraction(phaseIdx, 1); }); + vtkOutputModule.addSecondaryVariable("X_" + std::string(FluidSystem::componentName(0)), + [](const VolumeVariables& v){ return v.massFraction(phaseIdx, 0); }); + vtkOutputModule.addSecondaryVariable("X_" + std::string(FluidSystem::componentName(1)), + [](const VolumeVariables& v){ return v.massFraction(phaseIdx, 1); }); + + NonIsothermalModel::maybeAddTemperature(vtkOutputModule); } }; diff --git a/dumux/porousmediumflow/1p2c/implicit/volumevariables.hh b/dumux/porousmediumflow/1p2c/implicit/volumevariables.hh index 9eebf1c648d66de0f7f6ac360158cd0738b3baff..3fe9c8f0ad3c2e22a6b5c63300e17a8a78b1139d 100644 --- a/dumux/porousmediumflow/1p2c/implicit/volumevariables.hh +++ b/dumux/porousmediumflow/1p2c/implicit/volumevariables.hh @@ -55,6 +55,9 @@ class OnePTwoCVolumeVariables : public ImplicitVolumeVariables<TypeTag> using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables); 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 SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams); + using PermeabilityType = typename SpatialParams::PermeabilityType; using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); using Indices = typename GET_PROP_TYPE(TypeTag, Indices); @@ -78,23 +81,24 @@ class OnePTwoCVolumeVariables : public ImplicitVolumeVariables<TypeTag> public: - typedef typename GET_PROP_TYPE(TypeTag, FluidState) FluidState; + using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); /*! * \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); //calculate all secondary variables from the primary variables and store results in fluidstate - completeFluidState(priVars, problem, element, scv, fluidState_); + completeFluidState(elemSol, problem, element, scv, fluidState_); - porosity_ = problem.spatialParams().porosity(scv); - dispersivity_ = problem.spatialParams().dispersivity(element, scv); + porosity_ = problem.spatialParams().porosity(element, scv, elemSol); + dispersivity_ = problem.spatialParams().dispersivity(element, scv, elemSol); + permeability_ = problem.spatialParams().permeability(element, scv, elemSol); // Second instance of a parameter cache. // Could be avoided if diffusion coefficients also @@ -107,25 +111,22 @@ public: phaseIdx, phaseCompIdx, transportCompIdx); - - Valgrind::CheckDefined(porosity_); - Valgrind::CheckDefined(dispersivity_); - Valgrind::CheckDefined(diffCoeff_); } /*! * \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, 1.); + const auto& priVars = ParentType::extractDofPriVars(elemSol, scv); fluidState.setPressure(phaseIdx, priVars[pressureIdx]); if(useMoles) @@ -272,9 +273,16 @@ public: Scalar porosity() const { return porosity_; } + /*! + * \brief Returns the permeability within the control volume in \f$[m^2]\f$. + */ + PermeabilityType permeability() const + { return permeability_; } + protected: Scalar porosity_; //!< Effective porosity within the control volume GlobalPosition dispersivity_; + PermeabilityType permeability_; Scalar diffCoeff_; FluidState fluidState_; diff --git a/test/porousmediumflow/1p2c/implicit/1p2cniconductionproblem.hh b/test/porousmediumflow/1p2c/implicit/1p2cniconductionproblem.hh index eb97a421cfc17d3f6ff0eba2737bec5946f5f6ba..eb23b53223cf2a3ff009f0b74c36d206512352cc 100644 --- a/test/porousmediumflow/1p2c/implicit/1p2cniconductionproblem.hh +++ b/test/porousmediumflow/1p2c/implicit/1p2cniconductionproblem.hh @@ -132,7 +132,9 @@ class OnePTwoCNIConductionProblem : public ImplicitPorousMediaProblem<TypeTag> //! property that defines whether mole or mass fractions are used static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static const bool isBox = GET_PROP_VALUE(TypeTag, ImplicitIsBox); + static const int dofCodim = isBox ? dimWorld : 0; public: OnePTwoCNIConductionProblem(TimeManager &timeManager, const GridView &gridView) @@ -163,60 +165,49 @@ public: } /*! - * \brief Append all quantities of interest which can be derived - * from the solution of the current time step to the VTK - * writer. + * \brief Adds additional VTK output data to the VTKWriter. Function is called by the output module on every write. */ - void addOutputVtkFields() + void addVtkOutputFields(VtkOutputModule<TypeTag>& outputModule) const { - unsigned numDofs = this->model().numDofs(); - //create required scalar fields - auto& temperature = *(this->resultWriter().allocateManagedBuffer(numDofs)); - auto& temperatureExact = *(this->resultWriter().allocateManagedBuffer(numDofs)); + auto& temperatureExact = outputModule.createScalarField("temperatureExact", dofCodim); - // get the first element to initialize the constant volume variables const auto someElement = *(elements(this->gridView()).begin()); - const auto initialPriVars = initial_(GlobalPosition(0.0)); + const auto someElemSol = this->model().elementSolution(someElement, this->model().curSol()); + const auto someInitSol = initial_(someElement.geometry().center()); auto someFvGeometry = localView(this->model().globalFvGeometry()); someFvGeometry.bindElement(someElement); - const auto& someScv = *(scvs(someFvGeometry).begin()); + const auto someScv = *(scvs(someFvGeometry).begin()); VolumeVariables volVars; - volVars.update(initialPriVars, *this, someElement, someScv); - - Scalar porosity = this->spatialParams().porosity(someScv); - Scalar densityW = volVars.density(); - Scalar heatCapacityW = FluidSystem::heatCapacity(volVars.fluidState(), 0); - Scalar densityS = this->spatialParams().solidDensity(someElement, someScv); - Scalar heatCapacityS = this->spatialParams().solidHeatCapacity(someElement, someScv); - Scalar storage = densityW*heatCapacityW*porosity + densityS*heatCapacityS*(1 - porosity); - Scalar effectiveThermalConductivity = ThermalConductivityModel::effectiveThermalConductivity(volVars, - this->spatialParams(), - someElement, - someFvGeometry, - someScv); + volVars.update(someElemSol, *this, someElement, someScv); + + const auto porosity = this->spatialParams().porosity(someElement, someScv, someElemSol); + const auto densityW = volVars.density(); + const auto heatCapacityW = FluidSystem::heatCapacity(volVars.fluidState(), 0); + const auto densityS = this->spatialParams().solidDensity(someElement, someScv, someElemSol); + const auto heatCapacityS = this->spatialParams().solidHeatCapacity(someElement, someScv, someElemSol); + const auto storage = densityW*heatCapacityW*porosity + densityS*heatCapacityS*(1 - porosity); + const auto effectiveThermalConductivity = ThermalConductivityModel::effectiveThermalConductivity(volVars, this->spatialParams(), + someElement, someFvGeometry, someScv); Scalar time = std::max(this->timeManager().time() + this->timeManager().timeStepSize(), 1e-10); - for (const auto& element : elements(this->gridView())) { auto fvGeometry = localView(this->model().globalFvGeometry()); fvGeometry.bindElement(element); + for (auto&& scv : scvs(fvGeometry)) { - int dofIdxGlobal = scv.dofIndex(); - auto dofPosition = scv.dofPosition(); + auto globalIdx = scv.dofIndex(); + const auto& globalPos = scv.dofPosition(); - temperature[dofIdxGlobal] = this->model().curSol()[dofIdxGlobal][temperatureIdx]; - temperatureExact[dofIdxGlobal] = temperatureHigh_ - + (initialPriVars[temperatureIdx] - temperatureHigh_) - * std::erf(0.5*std::sqrt(dofPosition[0]*dofPosition[0]*storage/time/effectiveThermalConductivity)); + temperatureExact[globalIdx] = temperatureHigh_ + (someInitSol[temperatureIdx] - temperatureHigh_) + *std::erf(0.5*std::sqrt(globalPos[0]*globalPos[0]*storage/time/effectiveThermalConductivity)); } } - this->resultWriter().attachDofData(temperature, "temperature", isBox); - this->resultWriter().attachDofData(temperatureExact, "temperatureExact", isBox); } + /*! * \name Problem parameters */ diff --git a/test/porousmediumflow/1p2c/implicit/1p2cniconvectionproblem.hh b/test/porousmediumflow/1p2c/implicit/1p2cniconvectionproblem.hh index 90bd15c2c62200615e48e4712ab7f7ec4c6724b1..396c06e43e4721b31367c4885a9df4628f39512b 100644 --- a/test/porousmediumflow/1p2c/implicit/1p2cniconvectionproblem.hh +++ b/test/porousmediumflow/1p2c/implicit/1p2cniconvectionproblem.hh @@ -141,7 +141,9 @@ class OnePTwoCNIConvectionProblem : public ImplicitPorousMediaProblem<TypeTag> //! property that defines whether mole or mass fractions are used static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static const bool isBox = GET_PROP_VALUE(TypeTag, ImplicitIsBox); + static const int dofCodim = isBox ? dimWorld : 0; public: OnePTwoCNIConvectionProblem(TimeManager &timeManager, const GridView &gridView) @@ -171,57 +173,48 @@ public: } /*! - * \brief Append all quantities of interest which can be derived - * from the solution of the current time step to the VTK - * writer. + * \brief Adds additional VTK output data to the VTKWriter. Function is called by the output module on every write. */ - void addOutputVtkFields() + void addVtkOutputFields(VtkOutputModule<TypeTag>& outputModule) const { - unsigned numDofs = this->model().numDofs(); - //create required scalar fields - auto& temperature = *(this->resultWriter().allocateManagedBuffer(numDofs)); - auto& temperatureExact = *(this->resultWriter().allocateManagedBuffer(numDofs)); + auto& temperatureExact = outputModule.createScalarField("temperatureExact", dofCodim); - // get the first element to initialize the constant volume variables const auto someElement = *(elements(this->gridView()).begin()); - const auto initialPriVars = initial_(GlobalPosition(0.0)); + const auto someElemSol = this->model().elementSolution(someElement, this->model().curSol()); auto someFvGeometry = localView(this->model().globalFvGeometry()); someFvGeometry.bindElement(someElement); - const auto& someScv = *(scvs(someFvGeometry).begin()); + const auto someScv = *(scvs(someFvGeometry).begin()); VolumeVariables volVars; - volVars.update(initialPriVars, *this, someElement, someScv); + volVars.update(someElemSol, *this, someElement, someScv); - Scalar porosity = this->spatialParams().porosity(someScv); - Scalar densityW = volVars.density(); - Scalar heatCapacityW = FluidSystem::heatCapacity(volVars.fluidState(), 0); - Scalar storageW = densityW*heatCapacityW*porosity; - Scalar densityS = this->spatialParams().solidDensity(someElement, someScv); - Scalar heatCapacityS = this->spatialParams().solidHeatCapacity(someElement, someScv); - Scalar storageTotal = storageW + densityS*heatCapacityS*(1 - porosity); - std::cout<<"storage: "<<storageTotal<<std::endl; + const auto porosity = this->spatialParams().porosity(someElement, someScv, someElemSol); + const auto densityW = volVars.density(); + const auto heatCapacityW = FluidSystem::heatCapacity(volVars.fluidState(), 0); + const auto storageW = densityW*heatCapacityW*porosity; + const auto densityS = this->spatialParams().solidDensity(someElement, someScv, someElemSol); + const auto heatCapacityS = this->spatialParams().solidHeatCapacity(someElement, someScv, someElemSol); + const auto storageTotal = storageW + densityS*heatCapacityS*(1 - porosity); + std::cout << "storage: " << storageTotal << '\n'; - Scalar time = std::max(this->timeManager().time() + this->timeManager().timeStepSize(), 1e-10); - Scalar retardedFrontVelocity = darcyVelocity_*storageW/storageTotal/porosity; - std::cout<<"retarded velocity: "<<retardedFrontVelocity<<std::endl; + const Scalar time = std::max(this->timeManager().time() + this->timeManager().timeStepSize(), 1e-10); + const Scalar retardedFrontVelocity = darcyVelocity_*storageW/storageTotal/porosity; + std::cout << "retarded velocity: " << retardedFrontVelocity << '\n'; for (const auto& element : elements(this->gridView())) { - auto fvGeometry = localView(this->model().globalFvGeometry()); fvGeometry.bindElement(element); for (auto&& scv : scvs(fvGeometry)) { - int dofIdxGlobal = scv.dofIndex(); + auto dofIdxGlobal = scv.dofIndex(); auto dofPosition = scv.dofPosition(); - temperature[dofIdxGlobal] = this->model().curSol()[dofIdxGlobal][temperatureIdx]; temperatureExact[dofIdxGlobal] = (dofPosition[0] < retardedFrontVelocity*time) ? temperatureHigh_ : temperatureLow_; } } - this->resultWriter().attachDofData(temperature, "temperature", isBox); - this->resultWriter().attachDofData(temperatureExact, "temperatureExact", isBox); } + /*! * \name Problem parameters */ @@ -305,20 +298,6 @@ public: */ // \{ - /*! - * \brief Evaluate the source term for all phases within a given - * sub-control-volume. - * - * For this method, the \a priVars parameter stores the rate mass - * of a component is generated or annihilate per volume - * unit. Positive values mean that mass is created, negative ones - * mean that it vanishes. - * - * The units must be according to either using mole or mass fractions. (mole/(m^3*s) or kg/(m^3*s)) - */ - PrimaryVariables sourceAtPos(const GlobalPosition &globalPos) const - { return PrimaryVariables(0.0); } - /*! * \brief Evaluate the initial value for a control volume. * diff --git a/test/porousmediumflow/1p2c/implicit/1p2cnispatialparams.hh b/test/porousmediumflow/1p2c/implicit/1p2cnispatialparams.hh index ca62d7824e22a891ee0aee748cbdec1757be0034..3bfb82f77366f1501c327ccf374766aa7e733fcf 100644 --- a/test/porousmediumflow/1p2c/implicit/1p2cnispatialparams.hh +++ b/test/porousmediumflow/1p2c/implicit/1p2cnispatialparams.hh @@ -44,14 +44,16 @@ class OnePTwoCNISpatialParams : public ImplicitSpatialParamsOneP<TypeTag> using Problem = typename GET_PROP_TYPE(TypeTag, Problem); using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using Element = typename GridView::template Codim<0>::Entity; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); + using ElementSolutionVector = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector); static const int dimWorld = GridView::dimensionworld; using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; public: + // export permeability type + using PermeabilityType = Scalar; + OnePTwoCNISpatialParams(const Problem& problem, const GridView &gridView) : ParentType(problem, gridView) { @@ -67,7 +69,7 @@ public: * * \param globalPos The global Position */ - Scalar intrinsicPermeabilityAtPos(const GlobalPosition& globalPos) const + Scalar permeabilityAtPos(const GlobalPosition& globalPos) const { return permeability_; } /*! @@ -81,11 +83,13 @@ public: /*! * \brief Define the dispersivity. * - * \param element The current finite element - * \param scv The sub-control volume + * \param element The element + * \param scv The sub control volume + * \param elemSol The element solution vector */ Scalar dispersivity(const Element &element, - const SubControlVolume &scv) const + const SubControlVolume& scv, + const ElementSolutionVector& elemSol) const { return 0; } /*! @@ -93,11 +97,13 @@ public: * * This is only required for non-isothermal models. * - * \param element The current finite element - * \param scv The sub-control volume + * \param element The element + * \param scv The sub control volume + * \param elemSol The element solution vector */ Scalar solidHeatCapacity(const Element &element, - const SubControlVolume &scv) const + const SubControlVolume& scv, + const ElementSolutionVector& elemSol) const { return 790; /*specific heat capacity of granite [J / (kg K)]*/ } /*! @@ -105,21 +111,25 @@ public: * * This is only required for non-isothermal models. * - * \param element The current finite element - * \param scv The sub-control volume + * \param element The element + * \param scv The sub control volume + * \param elemSol The element solution vector */ Scalar solidDensity(const Element &element, - const SubControlVolume &scv) const + const SubControlVolume& scv, + const ElementSolutionVector& elemSol) const { return 2700; /*density of granite [kg/m^3]*/ } /*! * \brief Returns the thermal conductivity \f$\mathrm{[W/(m K)]}\f$ of the porous material. * - * \param element The current finite element - * \param scv The sub-control volume + * \param element The element + * \param scv The sub control volume + * \param elemSol The element solution vector */ Scalar solidThermalConductivity(const Element &element, - const SubControlVolume &scv) const + const SubControlVolume& scv, + const ElementSolutionVector& elemSol) const { return lambdaSolid_; } diff --git a/test/porousmediumflow/1p2c/implicit/1p2ctestspatialparams.hh b/test/porousmediumflow/1p2c/implicit/1p2ctestspatialparams.hh index 4680d3abd03d8ac278a1da487da2ac93a67d9d23..a99c8f314401ad79bd4377653f2752e40b0c70e7 100644 --- a/test/porousmediumflow/1p2c/implicit/1p2ctestspatialparams.hh +++ b/test/porousmediumflow/1p2c/implicit/1p2ctestspatialparams.hh @@ -46,11 +46,15 @@ class OnePTwoCTestSpatialParams : public ImplicitSpatialParamsOneP<TypeTag> using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using Element = typename GridView::template Codim<0>::Entity; using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); + using ElementSolutionVector = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector); static const int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Dune::FieldVector<Scalar, dimWorld>; public: + // export permeability type + using PermeabilityType = Scalar; + OnePTwoCTestSpatialParams(const Problem& problem, const GridView &gridView) : ParentType(problem, gridView) { @@ -66,7 +70,7 @@ public: * * \param globalPos The global position */ - Scalar intrinsicPermeabilityAtPos(const GlobalPosition& globalPos) const + PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const { return permeability_; } /*! @@ -82,9 +86,11 @@ public: * * \param element The finite element * \param scv The sub-control volume + * \param elemSol The solution for all dofs of the element */ Scalar dispersivity(const Element &element, - const SubControlVolume& scv) const + const SubControlVolume& scv, + const ElementSolutionVector& elemSol) const { return 0; } /*! @@ -92,11 +98,13 @@ public: * * This is only required for non-isothermal models. * - * \param element The finite element - * \param scv The sub-control volume + * \param element The element + * \param scv The sub control volume + * \param elemSol The element solution vector */ Scalar solidHeatCapacity(const Element &element, - const SubControlVolume& scv) const + const SubControlVolume& scv, + const ElementSolutionVector& elemSol) const { return 790; /*specific heat capacity of granite [J / (kg K)]*/ } /*! @@ -104,21 +112,25 @@ public: * * This is only required for non-isothermal models. * - * \param element The finite element - * \param scv The sub-control volume + * \param element The element + * \param scv The sub control volume + * \param elemSol The element solution vector */ Scalar solidDensity(const Element &element, - const SubControlVolume& scv) const + const SubControlVolume& scv, + const ElementSolutionVector& elemSol) const { return 2700; /*density of granite [kg/m^3]*/ } /*! * \brief Returns the thermal conductivity \f$\mathrm{[W/(m K)]}\f$ of the porous material. * - * \param element The finite element - * \param scv The sub-control volume + * \param element The element + * \param scv The sub control volume + * \param elemSol The element solution vector */ Scalar solidThermalConductivity(const Element &element, - const SubControlVolume& scv) const + const SubControlVolume& scv, + const ElementSolutionVector& elemSol) const { return lambdaSolid_; }