Skip to content
Snippets Groups Projects
Commit 1212b4a1 authored by Katharina Heck's avatar Katharina Heck
Browse files

[fix] adapt to changes in next and use compositional localresidual instead of own

parent c75d9313
No related branches found
No related tags found
2 merge requests!617[WIP] Next,!508Feature/3p3c on next
......@@ -164,11 +164,15 @@ public:
vtkOutputModule.addSecondaryVariable("rhon", [](const VolumeVariables& v){ return v.density(nPhaseIdx); });
vtkOutputModule.addSecondaryVariable("rhog", [](const VolumeVariables& v){ return v.density(gPhaseIdx); });
for (int i = 0; i < numPhases; ++i)
for (int j = 0; j < numComponents; ++j)
vtkOutputModule.addSecondaryVariable("x^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i),
[i,j](const VolumeVariables& v){ return v.moleFraction(i,j); });
vtkOutputModule.addSecondaryVariable("porosity", [](const VolumeVariables& v){ return v.porosity(); });
vtkOutputModule.addSecondaryVariable("permeability",
[](const VolumeVariables& v){ return v.permeability(); });
vtkOutputModule.addSecondaryVariable("temperature", [](const VolumeVariables& v){ return v.temperature(); });
}
......
......@@ -73,6 +73,8 @@ NEW_PROP_TAG(ProblemEnableGravity); //!< Returns whether gravity is considered i
NEW_PROP_TAG(UseConstraintSolver); //!< Determines whether a constraint solver should be used explicitly
NEW_PROP_TAG(SpatialParamsForchCoeff); //!< Property for the forchheimer coefficient
NEW_PROP_TAG(TauTortuosity); //!< Tortuosity value (tau) used in macroscopic diffusion
NEW_PROP_TAG(UseMoles);//!< Defines whether mole (true) or mass (false) fractions are used
NEW_PROP_TAG(ReplaceCompEqIdx); //!< The index of the total mass balance equation, if one component balance is replaced (ReplaceCompEqIdx < NumComponents)
}
}
......
......@@ -34,10 +34,11 @@
#include "volumevariables.hh"
#include "properties.hh"
#include "newtoncontroller.hh"
#include "localresidual.hh"
#include "primaryvariableswitch.hh"
//#include "localresidual.hh"
#include <dumux/porousmediumflow/compositional/switchableprimaryvariables.hh>
#include <dumux/porousmediumflow/compositional/localresidual.hh>
#include <dumux/porousmediumflow/nonisothermal/implicit/propertydefaults.hh>
#include <dumux/material/fluidmatrixinteractions/diffusivitymillingtonquirk.hh>
#include <dumux/porousmediumflow/implicit/darcyfluxvariables.hh>
......@@ -87,6 +88,8 @@ SET_PROP(ThreePThreeC, NumPhases)
"Only fluid systems with 3 phases are supported by the 3p3c model!");
};
//! Set as default that no component mass balance is replaced by the total mass balance
SET_INT_PROP(ThreePThreeC, ReplaceCompEqIdx, 100);
/*!
* \brief The fluid state which is used by the volume variables to
* store the thermodynamic state. This should be chosen
......@@ -110,7 +113,7 @@ SET_INT_PROP(ThreePThreeC, NumEq, 3); //!< set the number of equations to 2
SET_TYPE_PROP(ThreePThreeC, MaterialLawParams, typename GET_PROP_TYPE(TypeTag, MaterialLaw)::Params);
//! The local residual function of the conservation equations
SET_TYPE_PROP(ThreePThreeC, LocalResidual, ThreePThreeCLocalResidual<TypeTag>);
SET_TYPE_PROP(ThreePThreeC, LocalResidual, CompositionalLocalResidual<TypeTag>);
//! Enable advection
SET_BOOL_PROP(ThreePThreeC, EnableAdvection, true);
......@@ -174,6 +177,9 @@ SET_SCALAR_PROP(BoxModel, SpatialParamsForchCoeff, 0.55);
*/
SET_SCALAR_PROP(ThreePThreeC, TauTortuosity, 0.5);
//! Use mole fractions in the balance equations by default
SET_BOOL_PROP(ThreePThreeC, UseMoles, true);
//! Somerton is used as default model to compute the effective thermal heat conductivity
SET_PROP(ThreePThreeCNI, ThermalConductivityModel)
{
......@@ -198,7 +204,7 @@ SET_TYPE_PROP(ThreePThreeCNI, IsothermalModel, ThreePThreeCModel<TypeTag>);
SET_TYPE_PROP(ThreePThreeCNI, IsothermalVolumeVariables, ThreePThreeCVolumeVariables<TypeTag>);
//set isothermal LocalResidual
SET_TYPE_PROP(ThreePThreeCNI, IsothermalLocalResidual, ThreePThreeCLocalResidual<TypeTag>);
SET_TYPE_PROP(ThreePThreeCNI, IsothermalLocalResidual, CompositionalLocalResidual<TypeTag>);
//set isothermal Indices
SET_PROP(ThreePThreeCNI, IsothermalIndices)
......
......@@ -49,6 +49,8 @@ class ThreePThreeCVolumeVariables : public ImplicitVolumeVariables<TypeTag>
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
using PermeabilityType = typename SpatialParams::PermeabilityType;
using Model = typename GET_PROP_TYPE(TypeTag, Model);
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry);
using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume);
......@@ -56,6 +58,7 @@ class ThreePThreeCVolumeVariables : public ImplicitVolumeVariables<TypeTag>
using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
using MaterialLawParams = typename GET_PROP_TYPE(TypeTag, MaterialLawParams);
using ElementSolutionVector = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector);
// constraint solvers
using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
......@@ -122,6 +125,7 @@ public:
const MaterialLawParams &materialParams =
problem.spatialParams().materialLawParams(element, scv, elemSol);
Scalar temp = ParentType::temperature(elemSol, problem, element, scv);
fluidState_.setTemperature(temp);
......@@ -664,6 +668,12 @@ public:
Scalar bulkDensTimesAdsorpCoeff() const
{ return bulkDensTimesAdsorpCoeff_; }
/*!
* \brief Returns the average permeability within the control volume in \f$[m^2]\f$.
*/
const PermeabilityType& permeability() const
{ return permeability_; }
/*!
* \brief Returns the average permeability within the control volume in \f$[m^2]\f$.
*/
......@@ -691,7 +701,7 @@ protected:
Scalar massFrac_[numPhases][numComponents];
Scalar porosity_; //!< Effective porosity within the control volume
PermeabilityType permeability_; //!< Effective permeability within the control volume
PermeabilityType permeability_; //!> Effective permeability within the control volume
Scalar mobility_[numPhases]; //!< Effective mobility within the control volume
Scalar bulkDensTimesAdsorpCoeff_; //!< the basis for calculating adsorbed NAPL
FluidState fluidState_;
......@@ -703,6 +713,8 @@ private:
diffCoefficient_[phaseIdx][compIdx] = std::move(d);
else if (compIdx > phaseIdx)
diffCoefficient_[phaseIdx][compIdx-1] = std::move(d);
else if (phaseIdx == nPhaseIdx)
diffCoefficient_[phaseIdx][compIdx-1] = 0;
else
DUNE_THROW(Dune::InvalidStateException, "Diffusion coeffiecient for phaseIdx = compIdx doesn't exist");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment