Commit 0b6a74b2 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[propertysystem] replace macro SET_INT_PROP

parent 5eef5a75
......@@ -58,7 +58,8 @@ struct StaggeredFreeFlowModel { using InheritsFrom = std::tuple<StaggeredModel>;
* \brief Set the number of equations on the faces to 1. We only consider scalar values because the velocity vector
* is normal to the face.
*/
SET_INT_PROP(StaggeredFreeFlowModel, NumEqFace, 1);
template<class TypeTag>
struct NumEqFace<TypeTag, TTag::StaggeredFreeFlowModel> { static constexpr int value = 1; };
/*!
* \brief For free flow models, we take the number of "physical" equations
......
......@@ -143,7 +143,8 @@ public:
template<class TypeTag>
struct UseMoles<TypeTag, TTag::NavierStokesNC> { static constexpr bool value = false; }; //!< Defines whether molar (true) or mass (false) density is used
SET_INT_PROP(NavierStokesNC, ReplaceCompEqIdx, 0); //<! Set the ReplaceCompEqIdx to 0 by default
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::NavierStokesNC> { static constexpr int value = 0; }; //<! Set the ReplaceCompEqIdx to 0 by default
template<class TypeTag>
struct NormalizePressure<TypeTag, TTag::NavierStokesNC> { static constexpr bool value = true; }; //!< Normalize the pressure term in the momentum balance by default
......
......@@ -150,7 +150,8 @@ struct OnePNCNI { using InheritsFrom = std::tuple<OnePNC>; };
///////////////////////////////////////////////////////////////////////////
//! Set as default that no component mass balance is replaced by the total mass balance
SET_INT_PROP(OnePNC, ReplaceCompEqIdx, GetPropType<TypeTag, Properties::FluidSystem>::numComponents);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::OnePNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
//! The base model traits. Per default, we use the number of components of the fluid system.
SET_PROP(OnePNC, BaseModelTraits)
......
......@@ -256,7 +256,8 @@ SET_TYPE_PROP(TwoPNC, IOFields, TwoPNCIOFields);
SET_TYPE_PROP(TwoPNC, LocalResidual, CompositionalLocalResidual<TypeTag>); //!< Use the compositional local residual
SET_INT_PROP(TwoPNC, ReplaceCompEqIdx, GetPropType<TypeTag, Properties::FluidSystem>::numComponents); //!< Per default, no component mass balance is replaced
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::TwoPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; }; //!< Per default, no component mass balance is replaced
//! Default formulation is pw-Sn, overwrite if necessary
SET_PROP(TwoPNC, Formulation)
......
......@@ -225,7 +225,8 @@ template<class TypeTag>
struct UseConstraintSolver<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = false; };
//! Set as default that _no_ component mass balance is replaced by the total mass balance
SET_INT_PROP(ThreePThreeC, ReplaceCompEqIdx, GetPropType<TypeTag, Properties::ModelTraits>::numComponents());
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::ThreePThreeC> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(; });
/*!
* \brief The fluid state which is used by the volume variables to
* store the thermodynamic state. This should be chosen
......
......@@ -225,7 +225,8 @@ SET_PROP(ThreePWaterOilNI, FluidState){
SET_TYPE_PROP(ThreePWaterOilNI, LocalResidual, ThreePWaterOilLocalResidual<TypeTag>);
//! Set as default that no component mass balance is replaced by the total mass balance
SET_INT_PROP(ThreePWaterOilNI, ReplaceCompEqIdx, GetPropType<TypeTag, Properties::ModelTraits>::numComponents());
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::ThreePWaterOilNI> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(; });
//! The primary variable switch for the 3p3c model
SET_TYPE_PROP(ThreePWaterOilNI, PrimaryVariableSwitch, ThreePWaterOilPrimaryVariableSwitch<TypeTag>);
......
......@@ -289,7 +289,8 @@ public:
};
//! Per default, no component mass balance is replaced
SET_INT_PROP(MPNC, ReplaceCompEqIdx, GetPropType<TypeTag, Properties::FluidSystem>::numComponents);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::MPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
//! Use mole fractions in the balance equations by default
template<class TypeTag>
struct UseMoles<TypeTag, TTag::MPNC> { static constexpr bool value = true; };
......
......@@ -116,8 +116,10 @@ template<class TypeTag>
struct EnableChemicalNonEquilibrium<TypeTag, TTag::NonEquilibrium> { static constexpr bool value = true; };
//! Default values for the number of energy balance equations
SET_INT_PROP(NonEquilibrium, NumEnergyEqSolid, 1);
SET_INT_PROP(NonEquilibrium, NumEnergyEqFluid, GetPropType<TypeTag, Properties::EquilibriumModelTraits>::numPhases());
template<class TypeTag>
struct NumEnergyEqSolid<TypeTag, TTag::NonEquilibrium> { static constexpr int value = 1; };
template<class TypeTag>
struct NumEnergyEqFluid<TypeTag, TTag::NonEquilibrium> { static constexpr int value = GetPropType<TypeTag, Properties::EquilibriumModelTraits>::numPhases(; });
SET_TYPE_PROP(NonEquilibrium, EnergyLocalResidual, EnergyLocalResidualNonEquilibrium<TypeTag, getPropValue<TypeTag, Properties::NumEnergyEqFluid>()>);
SET_TYPE_PROP(NonEquilibrium, LocalResidual, NonEquilibriumLocalResidual<TypeTag>);
......
......@@ -165,7 +165,8 @@ SET_TYPE_PROP(RichardsNC, LocalResidual, CompositionalLocalResidual<TypeTag>);
//! We set the replaceCompIdx to 0, i.e. the first equation is substituted with
//! the total mass balance, i.e. the phase balance
SET_INT_PROP(RichardsNC, ReplaceCompEqIdx, 0);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::RichardsNC> { static constexpr int value = 0; };
//! Set the volume variables property
SET_PROP(RichardsNC, VolumeVariables)
......
......@@ -63,7 +63,8 @@ SET_PROP(ChannelNCTest, FluidSystem)
using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>;
};
SET_INT_PROP(ChannelNCTest, ReplaceCompEqIdx, 0);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::ChannelNCTest> { static constexpr int value = 0; };
// Set the grid type
SET_TYPE_PROP(ChannelNCTest, Grid, Dune::YaspGrid<2>);
......
......@@ -55,7 +55,8 @@ SET_PROP(DensityDrivenFlow, FluidSystem)
using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>;
};
SET_INT_PROP(DensityDrivenFlow, ReplaceCompEqIdx, 0);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::DensityDrivenFlow> { static constexpr int value = 0; };
// Set the grid type
SET_TYPE_PROP(DensityDrivenFlow, Grid, Dune::YaspGrid<2>);
......
......@@ -49,7 +49,8 @@ namespace TTag {
struct MaxwellStefanNCTest { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; };
} // end namespace TTag
SET_INT_PROP(MaxwellStefanNCTest, ReplaceCompEqIdx, 0);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr int value = 0; };
// Set the grid type
SET_TYPE_PROP(MaxwellStefanNCTest, Grid, Dune::YaspGrid<2>);
......
......@@ -94,7 +94,8 @@ SET_PROP(FlatPlateNCTest, FluidSystem)
};
// replace the main component balance eq with a total balance eq
SET_INT_PROP(FlatPlateNCTest, ReplaceCompEqIdx, 0);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::FlatPlateNCTest> { static constexpr int value = 0; };
// Set the grid type
SET_TYPE_PROP(FlatPlateNCTest, Grid,
......
......@@ -65,7 +65,8 @@ template<class TypeTag>
struct UseMoles<TypeTag, TTag::DarcyOnePTwoC> { static constexpr bool value = true; };
// Do not replace one equation with a total mass balance
SET_INT_PROP(DarcyOnePTwoC, ReplaceCompEqIdx, 3);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::DarcyOnePTwoC> { static constexpr int value = 3; };
//! Use a model with constant tortuosity for the effective diffusivity
SET_TYPE_PROP(DarcyOnePTwoC, EffectiveDiffusivityModel,
......
......@@ -71,7 +71,8 @@ template<class TypeTag>
struct UseMoles<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; };
// Do not replace one equation with a total mass balance
SET_INT_PROP(StokesOnePTwoC, ReplaceCompEqIdx, 3);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::StokesOnePTwoC> { static constexpr int value = 3; };
}
/*!
......
......@@ -65,7 +65,8 @@ template<class TypeTag>
struct UseMoles<TypeTag, TTag::DarcyOnePTwoC> { static constexpr bool value = true; };
// Do not replace one equation with a total mass balance
SET_INT_PROP(DarcyOnePTwoC, ReplaceCompEqIdx, 3);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::DarcyOnePTwoC> { static constexpr int value = 3; };
//! Use a model with constant tortuosity for the effective diffusivity
SET_TYPE_PROP(DarcyOnePTwoC, EffectiveDiffusivityModel,
......
......@@ -72,7 +72,8 @@ template<class TypeTag>
struct UseMoles<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; };
// Do not replace one equation with a total mass balance
SET_INT_PROP(StokesOnePTwoC, ReplaceCompEqIdx, 3);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::StokesOnePTwoC> { static constexpr int value = 3; };
}
/*!
......
......@@ -62,7 +62,8 @@ SET_PROP(DarcyTwoPTwoC, Formulation)
{ static constexpr auto value = TwoPFormulation::p1s0; };
//// The gas component balance (air) is replaced by the total mass balance
SET_INT_PROP(DarcyTwoPTwoC, ReplaceCompEqIdx, 3);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::DarcyTwoPTwoC> { static constexpr int value = 3; };
// Set the grid type
SET_TYPE_PROP(DarcyTwoPTwoC, Grid, Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >);
......
......@@ -61,7 +61,8 @@ SET_PROP(StokesOnePTwoC, FluidSystem)
using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>;
};
SET_INT_PROP(StokesOnePTwoC, ReplaceCompEqIdx, 3);
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::StokesOnePTwoC> { static constexpr int value = 3; };
// Use formulation based on mass fractions
template<class TypeTag>
......
......@@ -87,7 +87,8 @@ SET_PROP(Dissolution, SpatialParams)
};
//Set properties here to override the default property settings
SET_INT_PROP(Dissolution, ReplaceCompEqIdx, 1); //!< Replace gas balance by total mass balance
template<class TypeTag>
struct ReplaceCompEqIdx<TypeTag, TTag::Dissolution> { static constexpr int value = 1; }; //!< Replace gas balance by total mass balance
SET_PROP(Dissolution, Formulation)
{ static constexpr auto value = TwoPFormulation::p1s0; };
......
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