Commit 3b0cf4d2 authored by Markus Wolff's avatar Markus Wolff
Browse files

improved doxygen documentation



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7834 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 68baab63
......@@ -32,17 +32,19 @@
*/
namespace Dumux
{
/*!\ingroup Saturation2p
* @brief Class for defining the diffusive capillary pressure term of a saturation equation
/*!\ingroup FVSaturation2p
* \brief Class for defining the diffusive capillary pressure term of a saturation equation
*
* Defines the diffusive capillary pressure term of the form
*
* \f[\bar \lambda \boldsymbol{K} \text{grad} \, p_c,\f]
* \f[
* \bar \lambda \boldsymbol K \text{grad} \, p_c,
* \f]
*
* where \f$\bar \lambda = \lambda_w f_n = \lambda_n f_w\f$ and \f$\lambda\f$ is a phase mobility and \f$f\f$ a phase fractional flow function,
* \f$\boldsymbol{K}\f$ is the intrinsic permeability and \f$p_c = p_c(S_w) \f$ the capillary pressure.
* where \f$ \bar \lambda = \lambda_w f_n = \lambda_n f_w \f$ and \f$ \lambda \f$ is a phase mobility and \f$ f \f$ a phase fractional flow function,
* \f$ \boldsymbol K \f$ is the intrinsic permeability and \f$ p_c = p_c(S_w) \f$ the capillary pressure.
*
* @tparam TypeTag The Type Tag
* \tparam TypeTag The Type Tag
*/
template<class TypeTag>
class CapillaryDiffusion: public DiffusivePart<TypeTag>
......@@ -81,12 +83,11 @@ private:
public:
//! Returns capillary diffusion term
/*! Returns capillary diffusion term for current element face
* @param[in] element entity of codim 0
* @param[in] indexInInside face index in reference element
* @param[in] satI saturation of current element
* @param[in] satJ saturation of neighbor element
* @param[in] pcGradient gradient of capillary pressure between element I and J
* \return capillary pressure term of the saturation equation
* \param flux Flux vector (gets the flux from the function)
* \param intersection Intersection of two grid elements/global boundary
* \param satI saturation of current element
* \param satJ saturation of neighbor element
* \param pcGradient gradient of capillary pressure between element I and J
*/
void getFlux (FieldVector& flux, const Intersection& intersection, Scalar satI, Scalar satJ, const FieldVector& pcGradient) const
{
......@@ -209,9 +210,9 @@ public:
flux *= mobBar;
}
/*! @brief Constructs a CapillaryDiffusion object
* @param problem an object of class Dumux::TransportProblem or derived
* @param preComput if preCompute = true previous calculated mobilities are taken, if preCompute = false new mobilities will be computed (for implicit Scheme)
/*! \brief Constructs a CapillaryDiffusion object
*
* \param problem A problem class object
*/
CapillaryDiffusion (Problem& problem)
: DiffusivePart<TypeTag>(problem), problem_(problem), preComput_(GET_PROP_VALUE(TypeTag, PrecomputedConstRels))
......
......@@ -25,20 +25,19 @@
#include <dumux/decoupled/2p/2pproperties.hh>
/**
* @file
* @brief Base class for defining a convective part of an advection-diffusion equation
* @author Markus Wolff
* \file
* \brief Base class for defining a convective part of the saturation transport equation
* \author Markus Wolff
*/
namespace Dumux
{
/*!\ingroup Saturation2p
* @brief Base class for defining the convective part of an advection-diffusion equation
/*!\ingroup FVSaturation2p
* \brief Base class for defining a convective part of the saturation transport equation
*
* @tparam TypeTag The Type Tag
* \tparam TypeTag The problem TypeTag
*/
template<class TypeTag>
class ConvectivePart
{
......@@ -53,38 +52,33 @@ private:
typedef Dune::FieldVector<Scalar, dimWorld> FieldVector;
public:
//! Returns convective term
/*! Returns convective term for current element face
* @param[in] element entity of codim 0
* @param[in] indexInInside face index in reference element
* @param[in] sat saturation of current element
* \return convective term of an advection-diffusion equation
/*! \brief Returns convective term for current element face
* \param intersection Intersection of two grid elements/global boundary
* \param sat Saturation of current element
* \return Convective flux
*/
Scalar getFlux(const Intersection& intersection, const Scalar sat) const
{
return 0.0;
}
//! Returns convective term
/*! Returns convective term for current element face
* @param[in] element entity of codim 0
* @param[in] indexInInside face index in reference element
* @param[in] satI saturation of current element
* @param[in] satJ saturation of neighbor element
* \return convective term of an advection-diffusion equation
/*! \brief Returns convective term for current intersection
*
* \param flux Flux vector (gets the flux from the function)
* \param intersection Intersection of two grid elements/global boundary
* \param satI Saturation of current element
* \param satJ Saturation of neighbor element
*/
void getFlux(FieldVector& flux, const Intersection& intersection, const Scalar satI, const Scalar satJ) const
{}
//! The constructor
//! Constructs a ConvectivePart object
/*
* \param problem object including the problem definition
* \param problem A problem class object
*/
ConvectivePart(Problem& problem)
{}
//! always define virtual destructor in abstract base class
virtual ~ConvectivePart()
{ }
};
}
......
......@@ -26,16 +26,16 @@
#include <dumux/decoupled/2p/transport/transportproperties2p.hh>
/**
* @file
* @brief Base class for defining the diffusive part of an advection-diffusion equation
* @author Bernd Flemisch, Markus Wolff
* \file
* \brief Base class for defining a diffusive part of the saturation transport equation
* \author Bernd Flemisch, Markus Wolff
*/
namespace Dumux
{
/*!\ingroup Saturation2p
* @brief Base class for defining the diffusive part of an advection-diffusion equation
/*!\ingroup FVSaturation2p
* \brief Base class for defining the diffusive part of the saturation transport equation
*
* @tparam TypeTag The Type Tag
* \tparam TypeTag The problem TypeTag
*/
template<class TypeTag>
class DiffusivePart
......@@ -51,41 +51,38 @@ private:
typedef Dune::FieldVector<Scalar, dim> FieldVector;
public:
//! Returns diffusive term
/*! Returns diffusive term for current element face
* @param[in] element entity of codim 0
* @param[in] indexInInside face index in reference element
* @param[in] satI saturation of current element
* @param[in] satJ saturation of neighbor element
* @param[in] pcGradient gradient of capillary pressure between element I and J
* \return diffusive term of an advection-diffusion equation
/*! \brief Returns diffusive term for current element face
*
* \param flux Flux vector (gets the flux from the function)
* \param intersection Intersection of two grid elements/global boundary
* \param satI saturation of current element
* \param satJ saturation of neighbor element
* \param pcGradient gradient of capillary pressure between element I and J
*/
void getFlux(FieldVector& flux, const Intersection& intersection, Scalar satI, Scalar satJ, const FieldVector& pcGradient) const
{}
//! Returns diffusive term
/*! Returns diffusive term for current element face
* @param[in] element entity of codim 0
* @param[in] indexInInside face index in reference element
* @param[in] satIntersection saturation at the face between element I and J
* @param[in] satGradient gradient of saturation between element I and J
* @param[in] time time
* \return diffusive term of an advection-diffusion equation
/*! \brief Returns diffusive term for current element face
*
* \param flux Flux vector (gets the flux from the function)
* \param intersection Intersection of two grid elements/global boundary
* \param satIntersection saturation at the face between element I and J
* \param satGradient gradient of saturation between element I and J
* \param time time
*/
void getFlux(FieldVector& flux, const Intersection& intersection,
const Scalar satIntersection, const FieldVector& satGradient, const Scalar time) const
{}
//! Returns diffusive term
/*! Returns diffusive term for current element face
* @param[in] element entity of codim 0
* @param[in] indexInInside face index in reference element
* @param[in] satIntersection saturation at the face between element I and J
* @param[in] satGradient gradient of saturation between element I and J
* @param[in] time time
* @param[in] satI saturation of current element
* @param[in] satJ saturation of neighbor element
* \return diffusive term of an advection-diffusion equation
/*! \brief Returns diffusive term for current element face
*
* \param flux Flux vector (gets the flux from the function)
* \param intersection Intersection of two grid elements/global boundary
* \param satIntersection saturation at the face between element I and J
* \param satGradient gradient of saturation between element I and J
* \param time time
* \param satI saturation of current element
* \param satJ saturation of neighbor element
*/
void getFlux(FieldVector& flux, const Intersection& intersection,
const Scalar satIntersection, const FieldVector& satGradient, const Scalar time,
......@@ -93,15 +90,13 @@ public:
{}
//! The constructor
//! Constructs a DiffusivePart object
/*
* \param problem object including the problem definition
* \param A problem class object
*/
DiffusivePart(Problem& problem)
{}
//! always define virtual destructor in abstract base class
~DiffusivePart()
{ }
};
}
......
......@@ -31,22 +31,25 @@
*/
namespace Dumux
{
/*!\ingroup Saturation2p
/*!\ingroup IMPES
* \ingroup Saturation2p
* @brief Base class for implementations of different kinds of fluxes to evaluate a CFL-Condition
*
* Base class for implementations of different kinds of fluxes to evaluate a CFL-Condition of the form
*
* \f[\frac{F_i \Delta t}{V_{p_i}} < 1\f]
* \f[
* \frac{F_i \Delta t}{V_{p_i}} < 1
* \f]
*
* where \f$ V_{p_i} \f$ is the pore volume of cell i and
*
* \f[F_i = \sum f_{ij}\f]
* \f[
* F_i = \sum f_{ij}
* \f]
*
* with \f$f_{ij}\f$ being the CFL-flux over edge \f$ij\f$.
* with \f$ f_{ij} \f$ being the CFL-flux over edge \f$ ij \f$.
*
* Template parameters are:
- TypeTag PropertyTag of the problem implementation
* \tparam TypeTag The problem TypeTag
*/
template<class TypeTag>
class EvalCflFlux
......@@ -65,8 +68,9 @@ private:
typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition;
public:
//! adds a flux to the cfl-criterion evaluation
/*!
/*! \brief adds a flux to the cfl-criterion evaluation
*
* \param lambdaW wetting phase mobility
* \param lambdaNW non-wetting phase mobility
* \param viscosityW wetting phase viscosity
......@@ -78,8 +82,8 @@ public:
void addFlux(Scalar& lambdaW, Scalar& lambdaNW, Scalar& viscosityW, Scalar& viscosityNW, Scalar flux, const Intersection& intersection, int phaseIdx)
{}
//! adds a flux to the cfl-criterion evaluation
/*!
/*! \brief adds a flux to the cfl-criterion evaluation
*
* \param lambdaW wetting phase mobility
* \param lambdaNW non-wetting phase mobility
* \param viscosityW wetting phase viscosity
......@@ -91,22 +95,20 @@ public:
void addFlux(Scalar& lambdaW, Scalar& lambdaNW, Scalar& viscosityW, Scalar& viscosityNW, Scalar flux, const Element& element, int phaseIdx)
{}
//! adds a flux to the cfl-criterion evaluation
/*!
* \param globalPos global position
/*! \brief Returns the CFL flux-function
*
* \param element element on which the CFL-criterion is evaluated
* \return fluxFunction for the calculation of the CFL-time step (\f$ 1/F_i\f$)
* \return fluxFunction for the calculation of the CFL time-step (\f$ 1/F_i \f$)
*/
Scalar getCFLFluxFunction(const Element& element)
{
return 0.0;
}
//! adds a flux to the cfl-criterion evaluation
/*!
* \param globalPos global position
/*! \brief Returns the CFL time-step
*
* \param element element on which the CFL-criterion is evaluated
* \return fluxFunction for the calculation of the CFL-time step (\f$ 1/F_i\f$)
* \return CFL time-step
*/
Scalar getDt(const Element& element)
{
......
......@@ -32,13 +32,10 @@
namespace Dumux
{
/*!\ingroup Saturation2p
/*!\ingroup IMPES
* @brief CFL-flux-function to evaluate a CFL-Condition after Coats 2003
*
*
* Template parameters are:
- TypeTag PropertyTag of the problem implementation
* tparam TypeTag The problem TypeTag
*/
template<class TypeTag>
class EvalCflFluxCoats: public EvalCflFluxDefault<TypeTag>
......@@ -92,6 +89,10 @@ private:
public:
/*! \brief adds a flux to the cfl-criterion evaluation
*
* \copydetails EvalCflFlux::addFlux(Scalar&,Scalar&,Scalar&,Scalar&,Scalar,const Element&,int)
*/
void addFlux(Scalar& lambdaW, Scalar& lambdaNW, Scalar& viscosityW, Scalar& viscosityNW, Scalar flux,
const Element& element, int phaseIdx = -1)
{
......@@ -103,6 +104,10 @@ public:
ParentType::addFlux(lambdaW, lambdaNW, viscosityW, viscosityNW, flux, element, phaseIdx);
}
/*! \brief adds a flux to the cfl-criterion evaluation
*
* \copydetails EvalCflFlux::addFlux(Scalar&,Scalar&,Scalar&,Scalar&,Scalar,const Intersection&,int)
*/
void addFlux(Scalar& lambdaW, Scalar& lambdaNW, Scalar& viscosityW, Scalar& viscosityNW, Scalar flux,
const Intersection& intersection, int phaseIdx = -1)
{
......@@ -426,9 +431,13 @@ public:
}
}
Scalar getCflFluxFunction(const Element& element)
/*! \brief Returns the CFL flux-function
*
* \copydetails EvalCflFlux::getCFLFluxFunction(const Element&)
*/
Scalar getCFLFluxFunction(const Element& element)
{
Scalar cflFluxDefault = 1 / ParentType::getCflFluxFunction(element);
Scalar cflFluxDefault = 1 / ParentType::getCFLFluxFunction(element);
if (std::isnan(cflFluxFunction_) || std::isinf(cflFluxFunction_) || cflFluxFunction_ > 100 * cflFluxDefault)
{
......@@ -452,11 +461,27 @@ public:
return 1e100;
}
/*! \brief Returns the CFL time-step
*
* \copydetails EvalCflFlux::getDt(const Element&)
*/
Scalar getDt(const Element& element)
{
return getCflFluxFunction(element) * problem_.spatialParameters().porosity(element) * element.geometry().volume();
return getCFLFluxFunction(element) * problem_.spatialParameters().porosity(element) * element.geometry().volume();
}
/*! \brief Constructs an EvalCflFluxDefault object
*
* \param problem A problem type object
*/
EvalCflFluxCoats(Problem& problem) :
ParentType(problem), problem_(problem), eps_(5e-3)
{
reset();
}
protected:
//! resets the accumulated CFL-fluxes to zero
void reset()
{
ParentType::reset();
......@@ -464,12 +489,6 @@ public:
hasHangingNode_ = false;
}
EvalCflFluxCoats(Problem& problem) :
ParentType(problem), problem_(problem), eps_(5e-3)
{
reset();
}
private:
......
......@@ -32,14 +32,12 @@
namespace Dumux
{
/*!\ingroup Saturation2p
/*!\ingroup IMPES
* @brief Default implementation of cfl-fluxes to evaluate a CFL-Condition
*
* Compares the maximum of inflow and outflow to the element volume weighted by relative permeability and viscosity ratios.
*
* Template parameters are:
- TypeTag PropertyTag of the problem implementation
* \tparam TypeTag The problem TypeTag
*/
template<class TypeTag>
class EvalCflFluxDefault: public EvalCflFlux<TypeTag>
......@@ -80,23 +78,43 @@ private:
public:
/*! \brief adds a flux to the cfl-criterion evaluation
*
* \copydetails EvalCflFlux::addFlux(Scalar&,Scalar&,Scalar&,Scalar&,Scalar,const Element&,int)
*/
void addFlux(Scalar& lambdaW, Scalar& lambdaNW, Scalar& viscosityW, Scalar& viscosityNW, Scalar flux, const Element& element, int phaseIdx = -1)
{
addFlux(lambdaW, lambdaNW, viscosityW, viscosityNW, flux, phaseIdx);
}
/*! \brief adds a flux to the cfl-criterion evaluation
*
* \copydetails EvalCflFlux::addFlux(Scalar&,Scalar&,Scalar&,Scalar&,Scalar,const Intersection&,int)
*/
void addFlux(Scalar& lambdaW, Scalar& lambdaNW, Scalar& viscosityW, Scalar& viscosityNW, Scalar flux, const Intersection& intersection, int phaseIdx = -1)
{
addFlux(lambdaW, lambdaNW, viscosityW, viscosityNW, flux, phaseIdx);
}
Scalar getCflFluxFunction(const Element& element);
/*! \brief Returns the CFL flux-function
*
* \copydetails EvalCflFlux::getCFLFluxFunction(const Element&)
*/
Scalar getCFLFluxFunction(const Element& element);
/*! \brief Returns the CFL time-step
*
* \copydetails EvalCflFlux::getDt(const Element&)
*/
Scalar getDt(const Element& element)
{
return (getCflFluxFunction(element) * problem_.spatialParameters().porosity(element) * element.geometry().volume());
return (getCFLFluxFunction(element) * problem_.spatialParameters().porosity(element) * element.geometry().volume());
}
/*! \brief Constructs an EvalCflFluxDefault object
*
* \param problem A problem type object
*/
EvalCflFluxDefault (Problem& problem)
: problem_(problem)
{
......@@ -213,8 +231,9 @@ private:
static const int saturationType_ = GET_PROP_VALUE(TypeTag, SaturationFormulation);
};
// Returns the CFL flux-function
template<class TypeTag>
typename EvalCflFluxDefault<TypeTag>::Scalar EvalCflFluxDefault<TypeTag>::getCflFluxFunction(const Element& element)
typename EvalCflFluxDefault<TypeTag>::Scalar EvalCflFluxDefault<TypeTag>::getCFLFluxFunction(const Element& element)
{
Scalar residualSatW = problem_.spatialParameters().materialLawParams(element).Swr();
Scalar residualSatNW = problem_.spatialParameters().materialLawParams(element).Snr();
......
......@@ -33,22 +33,35 @@
namespace Dumux
{
//! \ingroup Saturation2p
//! \ingroup FVSaturation2p
//! \brief The finite volume discretization of a saturation transport equation
/*! Provides a Finite Volume implementation for the evaluation
* of equations of the form
*
* \f[\frac{\partial S_\alpha}{\partial t} + \text{div}\, \boldsymbol{v_\alpha} = q_\alpha,\f]
* \f[
* \phi \frac{\partial (\rho_\alpha S_\alpha)}{\partial t} + \text{div}\, (\rho_\alpha \boldsymbol{v_\alpha}) = q_\alpha,
* \f]
*
* where \f$S_\alpha\f$ is the saturation of phase alpha (wetting (w), non-wetting (n)) and \f$\boldsymbol{v}_\alpha\f$ is the phase velocity calculated by the multi-phase Darcy equation,
* and of the form
* where \f$ S_\alpha \f$ is the saturation of phase alpha (wetting (\f$ w \f$), non-wetting (\f$ n \f$)) and \f$ \boldsymbol v_\alpha \f$ is the phase velocity defined by the multi-phase Darcy equation.
* If a phase velocity is reconstructed from the pressure solution it can be directly inserted in the previous equation. In the incompressible case the equation is further divided by the phase density \f$ \rho_\alpha \f$. If a total velocity is reconstructed the saturation equation is reformulated into:
*
* \f[\frac{\partial S_w}{\partial t} + f_w \text{div}\, \boldsymbol{v}_{t} + f_w \lambda_n \boldsymbol{K}\left(\text{grad}\, p_c + (\rho_n-\rho_w) g \text{grad} z \right)= q_\alpha,\f]
* \f[
* \phi \frac{\partial S_w}{\partial t} + f_w \text{div}\, \boldsymbol{v}_{t} + f_w \lambda_n \boldsymbol{K}\left(\text{grad}\, p_c + (\rho_n-\rho_w) g \text{grad} z \right)= q_\alpha,
* \f]
* to get a wetting phase saturation or
* \f[
* \phi \frac{\partial S_n}{\partial t} + f_n \text{div}\, \boldsymbol{v}_{t} - f_n \lambda_w \boldsymbol{K}\left(\text{grad}\, p_c + (\rho_n-\rho_w) g \text{grad} z \right)= q_\alpha,
* \f]
* if the non-wetting phase saturation is the primary transport variable.
*
* \f[\frac{\partial S_n}{\partial t} + f_n \text{div}\, \boldsymbol{v}_{t} - f_n \lambda_w \boldsymbol{K}\left(\text{grad}\, p_c + (\rho_n-\rho_w) g \text{grad} z \right)= q_\alpha,\f]
* The total velocity formulation is only implemented for incompressible fluids and \f$ f_\alpha \f$ is the fractional flow function, \f$ \lambda_\alpha \f$ is the mobility, \f$ \boldsymbol K \f$ the absolute permeability,
* \f$ p_c \f$ the capillary pressure, \f$ \rho \f$ the fluid density, \f$ g \f$ the gravity constant, and \f$ q \f$ the source term.
*
* where \f$f_\alpha\f$ is the fractional flow function, \f$\lambda_\alpha\f$ is the mobility, \f$\boldsymbol{K}\f$ the absolute permeability,
* \f$p_c\f$ the capillary pressure, \f$\rho\f$ the fluid density, \f$g\f$ the gravity constant, and \f$q\f$ the source term.
*
* In the IMPES models the default setting is:
*
* - formulation: \f$ p_w-S_w \f$ (Property: <tt>Formulation</tt> defined as <tt>DecoupledTwoPCommonIndices::pwSw</tt>)
* - compressibility: disabled (Property: <tt>EnableCompressibility</tt> set to <tt>false</tt>)
*
* \tparam TypeTag The Type Tag
*/
......@@ -150,22 +163,27 @@ class FVSaturation2P: public FVTransport<TypeTag>
}
public:
// Function which calculates the flux update
void getFlux(Scalar& update, const Intersection& intersection, CellData& cellDataI);
// Function which calculates the boundary flux update
void getFluxOnBoundary(Scalar& update, const Intersection& intersection, CellData& cellDataI);
// Function which calculates the source update
void getSource(Scalar& update, const Element& element, CellData& cellDataI);
//! Sets the initial solution \f$S_0\f$.
// Sets the initial solution
void initialize();
//! Update the values of the material laws and constitutive relations.
/*!
* Constitutive relations like capillary pressure-saturation relationships, mobility-saturation relationships... are updated and stored in the variable class
* of type Dumux::VariableClass2P. The update has to be done when new saturation are available.
*/
// Update the values of the material laws and constitutive relations.
void updateMaterialLaws();
/* \brief Writes the current values of the primary transport variable into the <tt>transportedQuantity</tt>-vector (comes as function argument)
*
* \copydetails FVTransport::getTransportedQuantity(TransportSolutionType&)
*
*/
void getTransportedQuantity(TransportSolutionType& transportedQuantity)
{
int size = problem_.gridView().size(0);
......@@ -188,6 +206,10 @@ public:
}
}
/*! \brief Updates the primary transport variable.
*
* \copydetails FVTransport::updateTransportedQuantity(TransportSolutionType&)
*/
void updateTransportedQuantity(TransportSolutionType& updateVec)
{
updateSaturationSolution(updateVec);
......@@ -195,6 +217,10 @@ public:
// std::cout<<"update = "<<updateVec<<"\n";
}
/*! \brief Globally updates the saturation solution
*
* \param updateVec Vector containing the global update.
*/
void updateSaturationSolution(TransportSolutionType& updateVec)
{
Scalar dt = problem_.timeManager().timeStepSize();
......@@ -205,6 +231,14 @@ public:
}
}
/*! \brief Updates the saturation solution of a cell
*
* Calculates secondary saturation variables and stores saturations.
*
* \param globalIdx Global cell index
* \param update Cell saturation update
* \param dt Current time step
*/
void updateSaturationSolution(int globalIdx, Scalar update, Scalar dt)
{
CellData& cellData = problem_.variables().cellData(globalIdx);
......@@ -230,8 +264,14 @@ public:
}
}
//! \brief Write data files