...
  View open merge request
Commits (4)
......@@ -123,8 +123,15 @@ public:
) const
{
return [this, &scale_por](const Saturation sat) {
if (scale_por >= _theta_s.value - _theta_r.value) {
DUNE_THROW(Dune::IOError, "Invalid porosity scaling "
"(negative water content).");
}else if(_theta_s.value - scale_por >1.){
DUNE_THROW(Dune::IOError, "Invalid porosity scaling "
"(water content exceeds 1).");
}
return WaterContent{
sat.value * (_theta_s.value - _theta_r.value + scale_por)
sat.value * (_theta_s.value - _theta_r.value - scale_por)
+ _theta_r.value
};
};
......
......@@ -200,6 +200,54 @@ public:
~MillerScalingAdapter () override = default;
};
/// A ScalingAdapter implementing Miller scaling with additional porosity scaling.
/** For the Description of Miller scaling, see MillerScalingAdapter.
* In addition the porosity is scaled through an additive scaling \f$ \xi_theta \f$:
* \f$ Saturation = (\theta - \theta_r) (\theta_s - \xi_\theta - \theta_r) \f$
* The MilPor scaling violates the geometric similarity assumption of Miller scaling.
* The choice of - \xi_\theta (instead of + \xi_\theta ) is,
* that a smaller Material (Miller scaling factor <1) has a larger porosity.
*
* \ingroup RichardsParam
* \author Hannes Bauser
* \date 2018
*/
template<typename Traits>
class MilPorScalingAdapter : public ScalingAdapter<Traits>
{
private:
using Base = ScalingAdapter<Traits>;
using Domain = typename Base::Domain;
using return_t = typename Base::return_t;
public:
/// Create this adapter and the internal interpolator.
explicit MilPorScalingAdapter (
const YAML::Node& scale_data_cfg,
//const YAML::Node& porosity_scale_data_cfg,
const std::shared_ptr<spdlog::logger> log
):
Base(scale_data_cfg, log)
{
this->add_interpolator(scale_data_cfg["scale_miller"], "scale_miller");
this->add_interpolator(scale_data_cfg["scale_porosity"], "scale_porosity");
}
/// Export type of this scaling adapter
static inline std::string type = "MilPor";
/// Evaluate this interpolator
return_t evaluate (const Domain& pos) const override
{
const auto miller_scaling_value = this->_interpolators[0]->evaluate(pos);
const auto porosity_scaling_value = this->_interpolators[1]->evaluate(pos);
return return_t{miller_scaling_value, miller_scaling_value, porosity_scaling_value};
}
/// Delete this adapter
~MilPorScalingAdapter () override = default;
};
/// A ScalingAdapter that does not implement any scaling.
/** This adapter returns a default-initialized instance of ScalingFactors
* when evaluated.
......@@ -273,6 +321,9 @@ public:
if (type == MillerScalingAdapter<Traits>::type) {
return std::make_shared<MillerScalingAdapter<Traits>>(config, log);
}
else if (type == MilPorScalingAdapter<Traits>::type) {
return std::make_shared<MilPorScalingAdapter<Traits>>(config, log);
}
else if (to_lower(type) == DummyScalingAdapter<Traits>::type) {
return std::make_shared<DummyScalingAdapter<Traits>>(config, log);
}
......