[Doc] Add code documentation for transport parameterization

parent 66d3bce6
......@@ -158,6 +158,9 @@ public:
};
}
/// Clone the plymorphic class
/** \return unique pointer to the cloned object
*/
std::unique_ptr<Richards<Traits>> clone () const override
{
using ThisType = MualemVanGenuchten<Traits>;
......
......@@ -11,6 +11,15 @@ namespace Dune {
namespace Dorie {
namespace Parameterization {
/*-------------------------------------------------------------------------*//**
* @brief Class for constant hydrodynamic dispersion.
*
* @ingroup TransportParam
* @author Santiago Ospina
* @date 2019
*
* @tparam Traits the base traits
*/
template <class Traits>
class ConstHydrodynamicDispersion :
public Transport<Traits>
......@@ -24,6 +33,7 @@ public:
using WaterFluxType = typename Base::WaterFluxType;
using WaterContentType = typename Base::WaterContentType;
/// Parameter defining the constant hydrodynamic dispersion tensor
struct ConstHydrodynamicDispersionType
{
Tensor value;
......@@ -35,10 +45,19 @@ public:
ConstHydrodynamicDispersionType _const_hydrodynamic_dispersion;
public:
/// Construct with default-initialized parameters
/** \param name The name associated with this soil layer
*/
ConstHydrodynamicDispersion (const std::string name) :
Transport<Traits>(name)
{ }
/// Construct from a tuple of parameters
/** \param name The name associated with this soil layer
* \param parameters Tuple of parameters to use in this parameterization
*/
template<typename... Args>
ConstHydrodynamicDispersion (
const std::string name,
......@@ -50,8 +69,9 @@ public:
/// Add default destructor to clarify override
~ConstHydrodynamicDispersion () override = default;
public:
/// Return the hydrodynamic dispersion
/** {WaterFlux,WaterContent} -> HydrodynamicDispersion
*/
std::function<HydrodynamicDispersionType(const WaterFluxType, const WaterContentType)>
hydrodynamic_dispersion_f () const override
{
......@@ -60,6 +80,9 @@ public:
};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::multimap<std::string, double&> parameters () override
{
using Map = std::multimap<std::string, double&>;
......@@ -99,6 +122,9 @@ public:
return compsite_map;
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::multimap<std::string, const double&> parameters () const override
{
using Map = std::multimap<std::string, const double&>;
......@@ -138,6 +164,9 @@ public:
return compsite_map;
}
/// Clone the plymorphic class
/** \return unique pointer to the cloned object
*/
std::unique_ptr<Transport<Traits>> clone () const override
{
using ThisType = ConstHydrodynamicDispersion<Traits>;
......
......@@ -11,6 +11,16 @@ namespace Dune {
namespace Dorie {
namespace Parameterization {
/*-------------------------------------------------------------------------*//**
* @brief Class for constant effective diffusion.
*
* @ingroup TransportParam
* @author Santiago Ospina
* @date 2019
*
* @tparam Traits the base traits
*/
template <class Traits>
class ConstEffectiveDiffusion
: public EffectiveDiffusion<Traits>
......@@ -24,6 +34,7 @@ public:
using WaterFluxType = typename Base::WaterFluxType;
using WaterContentType = typename Base::WaterContentType;
/// Parameter defining the constant effective diffusion
struct ConstEffectiveDiffusionType
{
RangeField value;
......@@ -35,11 +46,19 @@ public:
ConstEffectiveDiffusionType _const_eff_diff;
public:
/// Construct with default-initialized parameters
/** \param name The name associated with this soil layer
*/
ConstEffectiveDiffusion (const std::string name) :
EffectiveDiffusion<Traits>(name)
{ }
/// Construct from a tuple of parameters
/** \param name The name associated with this soil layer
* \param parameters Tuple of parameters to use in this parameterization
*/
template<typename... Args>
ConstEffectiveDiffusion (
const std::string name,
......@@ -53,6 +72,9 @@ public:
public:
/// Return the effective diffusion
/** {WaterFlux,WaterContent} -> EffectiveDiffusion
*/
std::function<EffectiveDiffusionType(const WaterFluxType, const WaterContentType)>
effective_diffusion_f () const override
{
......@@ -61,18 +83,27 @@ public:
};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::multimap<std::string, double&> parameters () override
{
const std::string _const_eff_diff_name = ConstEffectiveDiffusionType::name;
return {{_const_eff_diff_name, _const_eff_diff.value}};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::multimap<std::string, const double&> parameters () const override
{
const std::string _const_eff_diff_name = ConstEffectiveDiffusionType::name;
return {{_const_eff_diff_name, _const_eff_diff.value}};
}
/// Clone the plymorphic class
/** \return unique pointer to the cloned object
*/
std::unique_ptr<EffectiveDiffusion<Traits>> clone () const override
{
using ThisType = ConstEffectiveDiffusion<Traits>;
......
......@@ -11,6 +11,15 @@ namespace Dune {
namespace Dorie {
namespace Parameterization {
/*-------------------------------------------------------------------------*//**
* @brief Class for effective diffusion.
*
* @ingroup TransportParam
* @author Santiago Ospina
* @date 2019
*
* @tparam Traits the base traits
*/
template <class Traits>
class EffectiveDiffusion
{
......@@ -19,15 +28,8 @@ private:
using BaseP = Transport<Traits>;
public:
EffectiveDiffusion (const std::string name)
: _name(name)
{ }
virtual ~EffectiveDiffusion () = default;
const std::string& get_name() const { return _name; }
/// Type of the hydrodynamic dispersion
/// Type of the effective diffusion
struct EffectiveDiffusionType
{
RangeField value;
......@@ -36,20 +38,58 @@ public:
using WaterFluxType = typename BaseP::WaterFluxType;
using WaterContentType = typename BaseP::WaterContentType;
//! The name of this parameterization instance, associated with the layer.
const std::string _name;
public:
/// Construct with default-initialized parameters
/** \param name The name associated with this soil layer
*/
EffectiveDiffusion (const std::string name)
: _name(name)
{ }
/// Construct from a tuple of parameters
/** \param name The name associated with this soil layer
* \param parameters Tuple of parameters to use in this parameterization
*/
template<typename... Args>
EffectiveDiffusion (
const std::string name,
const std::tuple<Args...> parameters)
: _name(name)
{ }
/// Default constructor (virtual).
virtual ~EffectiveDiffusion () = default;
/// Return the name of this parameterization instance.
const std::string& get_name() const { return _name; }
/// Return a bound version of the effective diffusion
/** \return Function: {Water Flux, Water Content} -> Effective Diff.
*/
virtual std::function<
EffectiveDiffusionType(const WaterFluxType, const WaterContentType)>
effective_diffusion_f () const = 0;
/// Return a map referecing all parameters by their names.
/** \return Map. Key: Name of parameter (string).
* Value: Value of parameter (double&)
*/
virtual std::multimap<std::string, double&> parameters () = 0;
/// Return a map referecing all parameters by their names.
/** \return Map. Key: Name of parameter (string).
* Value: Value of parameter (const double&)
*/
virtual std::multimap<std::string, const double&> parameters () const = 0;
/// Return a clone of this object
/** \return a unique pointer with a copy of this object.
/// Clone the plymorphic class
/** \return unique pointer to the cloned object
*/
virtual std::unique_ptr<EffectiveDiffusion<Traits>> clone () const = 0;
private:
const std::string _name;
};
} // namespace Parameterization
......
......@@ -11,6 +11,20 @@ namespace Dune {
namespace Dorie {
namespace Parameterization {
/*-------------------------------------------------------------------------*//**
* @brief Class for effective diffusion with Milington Quirk I.
* @details Implements the relation @f$ \mathsf{D}^\mathsf{eff}
* =\frac{\theta_w^{7/3}\mathsf{D}_\mathsf{m}}{\phi^2} @f$
* where @f$ \theta_w @f$ is the water content,
* @f$ \mathsf{D}_\mathsf{m} @f$ the molecular diffusion, and
* @f$ \phi @f$ the porosity of the medium.
*
* @ingroup TransportParam
* @author Santiago Ospina
* @date 2019
*
* @tparam Traits the base traits
*/
template <class Traits>
class MillingtonQuirk1
: public EffectiveDiffusion<Traits>
......@@ -24,12 +38,14 @@ public:
using WaterFluxType = typename Base::WaterFluxType;
using WaterContentType = typename Base::WaterContentType;
/// Parameter defining molecular diffusion
struct ModelcularDiffusionType
{
RangeField value;
inline static const std::string name = "mol_diff";
};
/// Parameter defining porosity
struct PorosityType
{
RangeField value;
......@@ -42,11 +58,19 @@ public:
ModelcularDiffusionType _mol_diff;
PorosityType _porosity;
public:
/// Construct with default-initialized parameters
/** \param name The name associated with this soil layer
*/
MillingtonQuirk1 (const std::string name) :
Base(name)
{ }
/// Construct from a tuple of parameters
/** \param name The name associated with this soil layer
* \param parameters Tuple of parameters to use in this parameterization
*/
template<typename... Args>
MillingtonQuirk1 (
const std::string name,
......@@ -59,9 +83,9 @@ public:
/// Add default destructor to clarify override
~MillingtonQuirk1 () override = default;
public:
/// Return the effective diffusion
/** {WaterFlux,WaterContent} -> EffectiveDiffusion
*/
std::function<EffectiveDiffusionType(const WaterFluxType, const WaterContentType)>
effective_diffusion_f () const override
{
......@@ -71,6 +95,9 @@ public:
};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::multimap<std::string, double&> parameters () override
{
return {
......@@ -79,6 +106,9 @@ public:
};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::multimap<std::string, const double&> parameters () const override
{
return {
......@@ -87,6 +117,9 @@ public:
};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::unique_ptr<EffectiveDiffusion<Traits>> clone () const override
{
using ThisType = MillingtonQuirk1<Traits>;
......
......@@ -11,6 +11,20 @@ namespace Dune {
namespace Dorie {
namespace Parameterization {
/*-------------------------------------------------------------------------*//**
* @brief Class for effective diffusion with Milington Quirk II.
* @details Implements the relation @f$ \mathsf{D}^\mathsf{eff}
* =\frac{\theta_w\mathsf{D}_\mathsf{m}}{\phi^{2/3}} @f$
* where @f$ \theta_w @f$ is the water content,
* @f$ \mathsf{D}_\mathsf{m} @f$ the molecular diffusion, and
* @f$ \phi @f$ the porosity of the medium.
*
* @ingroup TransportParam
* @author Santiago Ospina
* @date 2019
*
* @tparam Traits the base traits
*/
template <class Traits>
class MillingtonQuirk2
: public EffectiveDiffusion<Traits>
......@@ -24,12 +38,14 @@ public:
using WaterFluxType = typename Base::WaterFluxType;
using WaterContentType = typename Base::WaterContentType;
/// Parameter defining molecular diffusion
struct ModelcularDiffusionType
{
RangeField value;
inline static const std::string name = "mol_diff";
};
/// Parameter defining porosity
struct PorosityType
{
RangeField value;
......@@ -42,11 +58,19 @@ public:
ModelcularDiffusionType _mol_diff;
PorosityType _porosity;
public:
/// Construct with default-initialized parameters
/** \param name The name associated with this soil layer
*/
MillingtonQuirk2 (const std::string name) :
Base(name)
{ }
/// Construct from a tuple of parameters
/** \param name The name associated with this soil layer
* \param parameters Tuple of parameters to use in this parameterization
*/
template<typename... Args>
MillingtonQuirk2 (
const std::string name,
......@@ -59,9 +83,9 @@ public:
/// Add default destructor to clarify override
~MillingtonQuirk2 () override = default;
public:
/// Return the effective diffusion
/** {WaterFlux,WaterContent} -> EffectiveDiffusion
*/
std::function<EffectiveDiffusionType(const WaterFluxType, const WaterContentType)>
effective_diffusion_f () const override
{
......@@ -71,6 +95,9 @@ public:
};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::multimap<std::string, double&> parameters () override
{
return {
......@@ -79,6 +106,9 @@ public:
};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::multimap<std::string, const double&> parameters () const override
{
return {
......@@ -87,6 +117,9 @@ public:
};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::unique_ptr<EffectiveDiffusion<Traits>> clone () const override
{
using ThisType = MillingtonQuirk2<Traits>;
......
#ifndef DUNE_DORIE_PARAM_CONST_EFFECTIVE_HYDROMECHANIC_DISPERSION_HH
#define DUNE_DORIE_PARAM_CONST_EFFECTIVE_HYDROMECHANIC_DISPERSION_HH
#ifndef DUNE_DORIE_PARAM_CONST_EFF_HM_DISP_HH
#define DUNE_DORIE_PARAM_CONST_EFF_HM_DISP_HH
#include <cmath>
#include <functional>
......@@ -11,6 +11,15 @@ namespace Dune {
namespace Dorie {
namespace Parameterization {
/*-------------------------------------------------------------------------*//**
* @brief Class for constant effective hydromechanic dispersion.
*
* @ingroup TransportParam
* @author Santiago Ospina
* @date 2019
*
* @tparam Traits the base traits
*/
template <class Traits>
class ConstEffectiveHydromechanicDispersion :
public EffectiveHydromechanicDispersion<Traits>
......@@ -24,6 +33,7 @@ public:
using WaterFluxType = typename Base::WaterFluxType;
using WaterContentType = typename Base::WaterContentType;
/// Parameter defining the constant hydromechanic dispersion tensor
struct ConstEffectiveHydromechanicDispersionType
{
Tensor value;
......@@ -35,11 +45,19 @@ public:
ConstEffectiveHydromechanicDispersionType _const_eff_hydromechanic_dispersion;
public:
/// Construct with default-initialized parameters
/** \param name The name associated with this soil layer
*/
ConstEffectiveHydromechanicDispersion (const std::string name) :
EffectiveHydromechanicDispersion<Traits>(name)
{ }
/// Construct from a tuple of parameters
/** \param name The name associated with this soil layer
* \param parameters Tuple of parameters to use in this parameterization
*/
template<typename... Args>
ConstEffectiveHydromechanicDispersion (
const std::string name,
......@@ -51,8 +69,9 @@ public:
/// Add default destructor to clarify override
~ConstEffectiveHydromechanicDispersion () override = default;
public:
/// Return the hydromechanic dispersion
/** {WaterFlux,WaterContent} -> EffectiveHydromechanicDispersion
*/
std::function<EffectiveHydromechanicDispersionType(const WaterFluxType, const WaterContentType)>
effective_hydromechanic_dispersion_f () const override
{
......@@ -61,7 +80,9 @@ public:
};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::multimap<std::string, double&> parameters () override
{
const std::string _const_eff_hydromechanic_dispersion_name = ConstEffectiveHydromechanicDispersionType::name;
......@@ -89,6 +110,9 @@ public:
"ConstEffectiveHydromechanicDispersion not available for this dimension");
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::multimap<std::string, const double&> parameters () const override
{
const std::string _const_eff_hydromechanic_dispersion_name = ConstEffectiveHydromechanicDispersionType::name;
......@@ -116,6 +140,9 @@ public:
"ConstEffectiveHydromechanicDispersion not available for this dimension");
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::unique_ptr<EffectiveHydromechanicDispersion<Traits>> clone () const override
{
using ThisType = ConstEffectiveHydromechanicDispersion<Traits>;
......@@ -125,6 +152,6 @@ public:
} // namespace Parameterization
} // namespace Dune
} // namespace Dorie
} // namespaie
#endif // DUNE_DORIE_PARAM_CONST_EFFECTIVE_HYDROMECHANIC_DISPERSION_HH
\ No newline at end of file
#endif // DUNE_DORIE_PARAM_CONST_EFF_HM_DISPERSION_HH
\ No newline at end of file
......@@ -11,6 +11,15 @@ namespace Dune {
namespace Dorie {
namespace Parameterization {
/*-------------------------------------------------------------------------*//**
* @brief Class for effective hydromechanic dispersion.
*
* @ingroup TransportParam
* @author Santiago Ospina
* @date 2019
*
* @tparam Traits the base traits
*/
template <class Traits>
class EffectiveHydromechanicDispersion
{
......@@ -29,31 +38,59 @@ public:
Tensor value;
};
using WaterFluxType = typename BaseP::WaterFluxType;
using WaterContentType = typename BaseP::WaterContentType;
//! The name of this parameterization instance, associated with the layer.
const std::string _name;
/// Construct with default-initialized parameters
/** \param name The name associated with this soil layer
*/
EffectiveHydromechanicDispersion (const std::string name)
: _name(name)
{ }
/// Construct from a tuple of parameters
/** \param name The name associated with this soil layer
* \param parameters Tuple of parameters to use in this parameterization
*/
template<typename... Args>
EffectiveHydromechanicDispersion (
const std::string name,
const std::tuple<Args...> parameters)
: _name(name)
{ }
/// Default constructor (virtual).
virtual ~EffectiveHydromechanicDispersion () = default;