Commit 3a0981dd authored by Felix Weinhardt's avatar Felix Weinhardt Committed by Ned Coltman
Browse files

[1p][1pnc][1pncmin] Adapt all 1p models and volvars for diffusion access

parent fabb8f1b
......@@ -98,30 +98,6 @@ struct OnePVolumeVariablesTraits
using ModelTraits = MT;
};
/*!
* \ingroup OnePModel
* \brief Traits class for the volume variables of the single-phase model.
*
* \tparam PV The type used for primary variables
* \tparam FSY The fluid system type
* \tparam FST The fluid state type
* \tparam PT The type used for permeabilities
* \tparam MT The model traits
* \tparam ETCM The effective thermal conductivity model
*/
template<class PV, class FSY, class FST, class SSY, class SST, class PT, class MT, class ETCM>
struct OnePNIVolumeVariablesTraits
{
using PrimaryVariables = PV;
using FluidSystem = FSY;
using FluidState = FST;
using SolidSystem = SSY;
using SolidState = SST;
using PermeabilityType = PT;
using ModelTraits = MT;
using EffectiveThermalConductivityModel = ETCM;
};
namespace Properties {
// Create new type tags
namespace TTag {
......@@ -154,8 +130,8 @@ private:
using FST = GetPropType<TypeTag, Properties::FluidState>;
using SSY = GetPropType<TypeTag, Properties::SolidSystem>;
using SST = GetPropType<TypeTag, Properties::SolidState>;
using MT = GetPropType<TypeTag, Properties::ModelTraits>;
using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType;
using MT = GetPropType<TypeTag, Properties::ModelTraits>;
using Traits = OnePVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>;
public:
......@@ -201,13 +177,16 @@ private:
using FST = GetPropType<TypeTag, Properties::FluidState>;
using SSY = GetPropType<TypeTag, Properties::SolidSystem>;
using SST = GetPropType<TypeTag, Properties::SolidState>;
using MT = GetPropType<TypeTag, Properties::ModelTraits>;
using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType;
using ETCM = GetPropType< TypeTag, Properties:: ThermalConductivityModel>;
using MT = GetPropType<TypeTag, Properties::ModelTraits>;
using BaseTraits = OnePVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>;
using ETCM = GetPropType<TypeTag, Properties::ThermalConductivityModel>;
template<class BaseTraits, class ETCM>
struct NITraits : public BaseTraits { using EffectiveThermalConductivityModel = ETCM; };
using Traits = OnePNIVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT, ETCM>;
public:
using type = OnePVolumeVariables<Traits>;
using type = OnePVolumeVariables<NITraits<BaseTraits, ETCM>>;
};
//! Use the average for effective conductivities
......
......@@ -101,50 +101,6 @@ struct OnePNCModelTraits
static constexpr bool enableEnergyBalance() { return false; }
};
/*!
* \ingroup OnePNCModel
* \brief Traits class for the volume variables of the single-phase model.
*
* \tparam PV The type used for primary variables
* \tparam FSY The fluid system type
* \tparam FST The fluid state type
* \tparam PT The type used for permeabilities
* \tparam MT The model traits
* \tparam EDM The effective diffusivity model
*/
template<class PV, class FSY, class FST, class SSY, class SST, class PT, class MT, class DT, class EDM>
struct OnePNCVolumeVariablesTraits
{
using PrimaryVariables = PV;
using FluidSystem = FSY;
using FluidState = FST;
using SolidSystem = SSY;
using SolidState = SST;
using PermeabilityType = PT;
using ModelTraits = MT;
using DiffusionType = DT;
using EffectiveDiffusivityModel = EDM;
};
/*!
* \ingroup OnePNCModel
* \brief Traits class for the volume variables of the single-phase model.
*
* \tparam PV The type used for primary variables
* \tparam FSY The fluid system type
* \tparam FST The fluid state type
* \tparam PT The type used for permeabilities
* \tparam MT The model traits
* \tparam EDM The effective diffusivity model
* \tparam ETCM The effective thermal conductivity model
*/
template<class PV, class FSY, class FST, class SSY, class SST, class PT, class MT, class DT, class EDM, class ETCM>
struct OnePNCNIVolumeVariablesTraits : public OnePNCVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT, DT, EDM>
{
using EffectiveThermalConductivityModel = ETCM;
};
namespace Properties {
//////////////////////////////////////////////////////////////////
......@@ -219,17 +175,25 @@ private:
using FST = GetPropType<TypeTag, Properties::FluidState>;
using SSY = GetPropType<TypeTag, Properties::SolidSystem>;
using SST = GetPropType<TypeTag, Properties::SolidState>;
using MT = GetPropType<TypeTag, Properties::ModelTraits>;
using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType;
using MT = GetPropType<TypeTag, Properties::ModelTraits>;
static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system");
static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state");
static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
using BaseTraits = OnePVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>;
using DT = GetPropType<TypeTag, Properties::MolecularDiffusionType>;
using EDM = GetPropType<TypeTag, Properties::EffectiveDiffusivityModel>;
using Traits = OnePNCVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT, DT, EDM>;
template<class BaseTraits, class DT, class EDM>
struct NCTraits : public BaseTraits
{
using DiffusionType = DT;
using EffectiveDiffusivityModel = EDM;
};
public:
using type = OnePNCVolumeVariables<Traits>;
using type = OnePNCVolumeVariables<NCTraits<BaseTraits, DT, EDM>>;
};
//! Set the vtk output fields specific to this model
......@@ -274,12 +238,21 @@ private:
static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state");
static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
using BaseTraits = OnePVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>;
using DT = GetPropType<TypeTag, Properties::MolecularDiffusionType>;
using EDM = GetPropType<TypeTag, Properties::EffectiveDiffusivityModel>;
using ETCM = GetPropType< TypeTag, Properties:: ThermalConductivityModel>;
using Traits = OnePNCNIVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT, DT, EDM, ETCM>;
template<class BaseTraits, class DT, class EDM, class ETCM>
struct NCNITraits : public BaseTraits
{
using DiffusionType = DT;
using EffectiveDiffusivityModel = EDM;
using EffectiveThermalConductivityModel = ETCM;
};
public:
using type = OnePNCVolumeVariables<Traits>;
using type = OnePNCVolumeVariables<NCNITraits<BaseTraits, DT, EDM, ETCM>>;
};
} // end namespace Properties
......@@ -364,14 +337,22 @@ private:
using SST = GetPropType<TypeTag, Properties::SolidState>;
using MT = GetPropType<TypeTag, Properties::ModelTraits>;
using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType;
using BaseTraits = OnePVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>;
using DT = GetPropType<TypeTag, Properties::MolecularDiffusionType>;
using EDM = GetPropType<TypeTag, Properties::EffectiveDiffusivityModel>;
using ETCM = GetPropType< TypeTag, Properties:: ThermalConductivityModel>;
using Traits = OnePNCNIVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT, DT, EDM, ETCM>;
using EquilibriumVolVars = OnePNCVolumeVariables<Traits>;
template<class BaseTraits, class DT, class EDM, class ETCM>
struct NCNITraits : public BaseTraits
{
using DiffusionType = DT;
using EffectiveDiffusivityModel = EDM;
using EffectiveThermalConductivityModel = ETCM;
};
using EquilibriumVolVars = OnePNCVolumeVariables<NCNITraits<BaseTraits, DT, EDM, ETCM>>;
public:
using type = NonEquilibriumVolumeVariables<Traits, EquilibriumVolVars>;
using type = NonEquilibriumVolumeVariables<NCNITraits<BaseTraits, DT, EDM, ETCM>, EquilibriumVolVars>;
};
} // end namespace Properties
......
......@@ -110,7 +110,7 @@ public:
paramCache.updatePhase(fluidState_, 0);
auto mylambda = [&](int phaseIdx, int compIIdx, int compJIdx)
auto getDiffusionCoefficient = [&](int phaseIdx, int compIIdx, int compJIdx)
{
return FluidSystem::binaryDiffusionCoefficient(this->fluidState_,
paramCache,
......@@ -119,13 +119,13 @@ public:
compJIdx);
};
auto myEfflambda = [&](int phaseIdx, int compIIdx, int compJIdx)
auto getEffectiveDiffusionCoefficient = [&](int phaseIdx, int compIIdx, int compJIdx)
{
return EffDiffModel::effectiveDiffusivity(*this, phaseIdx, compIIdx, compJIdx);
return EffDiffModel::effectiveDiffusionCoefficient(*this, phaseIdx, compIIdx, compJIdx);
};
diffCoeff_.update(mylambda);
effectiveDiffCoeff_.update(myEfflambda);
diffCoeff_.update(getDiffusionCoefficient);
effectiveDiffCoeff_.update(getEffectiveDiffusionCoefficient);
}
/*!
......@@ -333,7 +333,7 @@ public:
*/
[[deprecated("Signature deprecated. Use diffusionCoefficient(phaseIdx, compIIdx, compJIdx)!")]]
Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
{ return diffCoeff_(phaseIdx, 0, 0); }
{ return diffCoeff_(phaseIdx, FluidSystem::getMainComponent(phaseIdx), compIdx); }
/*!
* \brief Returns the binary diffusion coefficients for a phase in \f$[m^2/s]\f$.
......@@ -344,14 +344,7 @@ public:
/*!
* \brief Returns the effective diffusion coefficients for a phase in \f$[m^2/s]\f$.
*/
[[deprecated("Signature deprecated. Use effectiveDiffusivity(phaseIdx, compIIdx, compJIdx)!")]]
Scalar effectiveDiffusivity(int phaseIdx, int compI) const
{ return effectiveDiffCoeff_(phaseIdx, 0, 0); }
/*!
* \brief Returns the effective diffusion coefficients for a phase in \f$[m^2/s]\f$.
*/
Scalar effectiveDiffusivity(int phaseIdx, int compIIdx, int compJIdx) const
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
{ return effectiveDiffCoeff_(phaseIdx, compIIdx, compJIdx); }
/*!
......
......@@ -109,16 +109,24 @@ private:
using SST = GetPropType<TypeTag, Properties::SolidState>;
using MT = GetPropType<TypeTag, Properties::ModelTraits>;
using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType;
static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system");
static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state");
static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
using BaseTraits = OnePVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>;
using DT = GetPropType<TypeTag, Properties::MolecularDiffusionType>;
using EDM = GetPropType<TypeTag, Properties::EffectiveDiffusivityModel>;
using Traits = OnePNCVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT, EDM>;
using NonMinVolVars = OnePNCVolumeVariables<Traits>;
template<class BaseTraits, class DT, class EDM>
struct NCTraits : public BaseTraits
{
using DiffusionType = DT;
using EffectiveDiffusivityModel = EDM;
};
using NonMinVolVars = OnePNCVolumeVariables<NCTraits<BaseTraits, DT, EDM>>;
public:
using type = MineralizationVolumeVariables<Traits, NonMinVolVars>;
using type = MineralizationVolumeVariables<NCTraits<BaseTraits, DT, EDM>, NonMinVolVars>;
};
// Use the mineralization local residual
......@@ -187,17 +195,25 @@ private:
using SST = GetPropType<TypeTag, Properties::SolidState>;
using MT = GetPropType<TypeTag, Properties::ModelTraits>;
using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType;
static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system");
static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state");
static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system");
static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state");
using BaseTraits = OnePVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>;
using DT = GetPropType<TypeTag, Properties::MolecularDiffusionType>;
using EDM = GetPropType<TypeTag, Properties::EffectiveDiffusivityModel>;
using ETCM = GetPropType< TypeTag, Properties:: ThermalConductivityModel>;
using Traits = OnePNCNIVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT, EDM, ETCM>;
using NonMinVolVars = OnePNCVolumeVariables<Traits>;
template<class BaseTraits, class DT, class EDM, class ETCM>
struct NCNITraits : public BaseTraits
{
using DiffusionType = DT;
using EffectiveDiffusivityModel = EDM;
using EffectiveThermalConductivityModel = ETCM;
};
using NonMinVolVars = OnePNCVolumeVariables<NCNITraits<BaseTraits, DT, EDM, ETCM>>;
public:
using type = MineralizationVolumeVariables<Traits, NonMinVolVars>;
using type = MineralizationVolumeVariables<NCNITraits<BaseTraits, DT, EDM, ETCM>, NonMinVolVars>;
};
//! Use the average for effective conductivities
template<class TypeTag>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment