From 227badf2b8b8e0abf58677db0d2538b06c8920c1 Mon Sep 17 00:00:00 2001 From: Kissinger Date: Tue, 2 Feb 2016 13:38:45 +0100 Subject: [PATCH 1/8] [Move FluidFramework] FS-289 Moved Sec. 5.5 from - Moved all general descriptions to doxygen. - General descriptions were included in modules.txt - New groups had to be added in modules.txt: -ConstraintSolver -EOS -ParameterCache --- doc/doxygen/modules.txt | 96 ++++++++++++++++++- .../constraintsolvers/compositionalflash.hh | 1 + .../compositionfromfugacities.hh | 1 + .../compositionfromfugacities2pncmin.hh | 1 + .../computefromreferencephase.hh | 1 + .../computefromreferencephase2pnc.hh | 1 + .../computefromreferencephase2pncmin.hh | 1 + .../fluidsystemcomputefromreferencephase.hh | 1 + .../fluidsystemconstraintsolver.hh | 1 + .../constraintsolvers/immiscibleflash.hh | 1 + .../miscible2pnccomposition.hh | 1 + .../misciblemultiphasecomposition.hh | 1 + dumux/material/constraintsolvers/ncpflash.hh | 1 + dumux/material/eos/pengrobinson.hh | 1 + dumux/material/eos/pengrobinsonmixture.hh | 1 + dumux/material/eos/pengrobinsonparams.hh | 1 + .../material/eos/pengrobinsonparamsmixture.hh | 1 + .../fluidsystems/parametercachebase.hh | 1 + .../fluidsystems/spe5parametercache.hh | 1 + 19 files changed, 111 insertions(+), 3 deletions(-) diff --git a/doc/doxygen/modules.txt b/doc/doxygen/modules.txt index 4a90a1e389..59598d983a 100644 --- a/doc/doxygen/modules.txt +++ b/doc/doxygen/modules.txt @@ -56,7 +56,67 @@ /* ***************** Material ******************/ /*! - * \defgroup Material Material Properties and Laws + * \defgroup Material Material and Fluid Framework + * Short description of the most important concepts of the material and fluid framework: + * + * - _Binary coefficient:_ Binary coefficients describe the relations + * of a mixture of two components. Typical binary coefficients are + * Henry coefficients or binary molecular diffusion + * coefficients. So far, the programming interface for accessing binary + * coefficients has not been standardized in Dumux. + * + * - _Component:_ Components are fluid systems which provide the + * thermodynamic relations for the liquid and gas phase of a single + * chemical species or a fixed mixture of species. Their main purpose + * is to provide a convenient way to access these quantities from + * full-fledged fluid systems. Components are not supposed to be used + * by models directly. + * + * - _Constraint solver:_ Constraint solvers are auxiliary tools to + * make sure that a fluid state is consistent with some thermodynamic + * constraints. All constraint solvers specify a well defined set of + * input variables and make sure that the resulting fluid state is + * consistent with a given set of thermodynamic equations. + * + * - _Equation of state:_ Equations of state (EOS) are auxiliary + * classes which provide relations between a fluid phase's temperature, + * pressure, composition and density. Since these classes are only used + * internally in fluid systems, their programming interface is + * currently ad-hoc. + * + * - _Fluid state:_ Fluid states are responsible for representing the + * complete thermodynamic configuration of a system at a given spatial + * and temporal position. A fluid state always provides access methods + * to __all__ thermodynamic quantities, but the concept of a fluid state does not + * mandate what assumptions are made to store these thermodynamic + * quantities. What fluid states also do __not__ do is to make sure + * that the thermodynamic state which they represent is physically + * possible. + * + * - _Fluid system:_ Fluid systems express the thermodynamic relations + * Strictly speaking, these relations are + * functions, mathematically.} between quantities. Since functions do + * not exhibit any internal state, fluid systems are stateless classes, + * i.e. all member functions are static. This is a conscious + * decision since the thermodynamic state of the system is expressed by + * a fluid state! + * + * - _Fluid-Matrix Interactions:_ Some parameters are functions of the fluid state as well as parameters of + * the matrix. For example the capillary pressure is a function of the phase saturation + * and the shape parameter \f$\lambda\f$ which is dependent on the material. All such relations + * are gathered in this module. + * + * - _Parameter cache:_ Fluid systems sometimes require + * computationally expensive parameters for multiple relations. Such + * parameters can be cached using a so-called parameter + * cache. Parameter cache objects are specific for each fluid system + * but they must provide a common interface to update the internal + * parameters depending on the quantities which changed since the last + * update. + * + * - _Spatial Parameters:_ All parameters which depend on the matrix and + * therefore on the position within the model domain are defined as spatial + * parameters. For example permeability, porosity etc. */ /*! * \ingroup Material @@ -72,11 +132,27 @@ */ /*! * \ingroup Material - * \defgroup Fluidsystems Fluid Systems + * \defgroup ConstraintSolver Constraint Solver + * Constraint solvers connect the thermodynamic relations expressed by + * fluid systems with the thermodynamic quantities stored by fluid + * states. Using them is not mandatory for models, but given the fact + * that some thermodynamic constraints can be quite complex to solve, + * sharing this code between models makes sense. + */ + /*! + * \ingroup Material + * \defgroup EOS Equation of State */ /*! * \ingroup Material * \defgroup FluidStates Fluid States + * Fluid state objects express the complete thermodynamic state of a system at a given spatial and + * temporal position. + */ + /*! + * \ingroup Material + * \defgroup Fluidsystems Fluid Systems + * Fluid systems express the thermodynamic relations between the quantities of a fluid state. */ /*! * \ingroup Material @@ -89,7 +165,21 @@ /*! * \ingroup fluidmatrixinteractions * \defgroup fluidmatrixinteractionsparams Parameters for Fluid-Matrix Interactions - */ + */ + /*! + * \ingroup Material + * \defgroup ParameterCache Parameter Cache + * All fluid systems must export a type for their __ParameterCache__ + * objects. Parameter caches can be used to cache parameter that are + * expensive to compute and are required in multiple thermodynamic + * relations. For fluid systems which do need to cache parameters, + * Dumux provides a __NullParameterCache__ class. + * The actual quantities stored by parameter cache objects are specific + * to the fluid system and no assumptions on what they provide should be + * made outside of their fluid system. Parameter cache objects provide a + * well-defined set of methods to make them coherent with a given fluid + *state, though. + */ /*! * \ingroup Material * \defgroup SpatialParameters Spatial Parameters diff --git a/dumux/material/constraintsolvers/compositionalflash.hh b/dumux/material/constraintsolvers/compositionalflash.hh index 5cf393102e..a7d548b662 100644 --- a/dumux/material/constraintsolvers/compositionalflash.hh +++ b/dumux/material/constraintsolvers/compositionalflash.hh @@ -37,6 +37,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Flash calculation routines for compositional decoupled models * * Routines for isothermal and isobaric 2p2c and 1p2c flash. diff --git a/dumux/material/constraintsolvers/compositionfromfugacities.hh b/dumux/material/constraintsolvers/compositionfromfugacities.hh index 8c256fafbb..9fe0c9811d 100644 --- a/dumux/material/constraintsolvers/compositionfromfugacities.hh +++ b/dumux/material/constraintsolvers/compositionfromfugacities.hh @@ -34,6 +34,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Calculates the chemical equilibrium from the component * fugacities in a phase. */ diff --git a/dumux/material/constraintsolvers/compositionfromfugacities2pncmin.hh b/dumux/material/constraintsolvers/compositionfromfugacities2pncmin.hh index b956790529..1d17f538ff 100644 --- a/dumux/material/constraintsolvers/compositionfromfugacities2pncmin.hh +++ b/dumux/material/constraintsolvers/compositionfromfugacities2pncmin.hh @@ -34,6 +34,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Calculates the chemical equilibrium from the component * fugacities in a phase. */ diff --git a/dumux/material/constraintsolvers/computefromreferencephase.hh b/dumux/material/constraintsolvers/computefromreferencephase.hh index f6b54b68d6..2f4430e6b2 100644 --- a/dumux/material/constraintsolvers/computefromreferencephase.hh +++ b/dumux/material/constraintsolvers/computefromreferencephase.hh @@ -40,6 +40,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Computes all quantities of a generic fluid state if a * reference phase has been specified. * diff --git a/dumux/material/constraintsolvers/computefromreferencephase2pnc.hh b/dumux/material/constraintsolvers/computefromreferencephase2pnc.hh index ad11b5d320..52def91eef 100644 --- a/dumux/material/constraintsolvers/computefromreferencephase2pnc.hh +++ b/dumux/material/constraintsolvers/computefromreferencephase2pnc.hh @@ -40,6 +40,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Computes all quantities of a generic fluid state if a * reference phase has been specified. * diff --git a/dumux/material/constraintsolvers/computefromreferencephase2pncmin.hh b/dumux/material/constraintsolvers/computefromreferencephase2pncmin.hh index ffb6b6de61..2164109dbd 100644 --- a/dumux/material/constraintsolvers/computefromreferencephase2pncmin.hh +++ b/dumux/material/constraintsolvers/computefromreferencephase2pncmin.hh @@ -40,6 +40,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Computes all quantities of a generic fluid state if a * reference phase has been specified. * diff --git a/dumux/material/constraintsolvers/fluidsystemcomputefromreferencephase.hh b/dumux/material/constraintsolvers/fluidsystemcomputefromreferencephase.hh index 599e9bd72b..7b99662196 100644 --- a/dumux/material/constraintsolvers/fluidsystemcomputefromreferencephase.hh +++ b/dumux/material/constraintsolvers/fluidsystemcomputefromreferencephase.hh @@ -35,6 +35,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Computes the composition of all phases from a function in the fluidsystem. * * This is basically an interface in order to use ConstraintSolver with fluidsystems, diff --git a/dumux/material/constraintsolvers/fluidsystemconstraintsolver.hh b/dumux/material/constraintsolvers/fluidsystemconstraintsolver.hh index f516aeff5e..52dce277ad 100644 --- a/dumux/material/constraintsolvers/fluidsystemconstraintsolver.hh +++ b/dumux/material/constraintsolvers/fluidsystemconstraintsolver.hh @@ -35,6 +35,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Computes the composition of all phases from a function in the fluidsystem. * * This is basically an interface in order to use ConstraintSolver with fluidsystems, diff --git a/dumux/material/constraintsolvers/immiscibleflash.hh b/dumux/material/constraintsolvers/immiscibleflash.hh index d6047f9e89..cd42baff8f 100644 --- a/dumux/material/constraintsolvers/immiscibleflash.hh +++ b/dumux/material/constraintsolvers/immiscibleflash.hh @@ -34,6 +34,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Determines the pressures and saturations of all fluid phases * given the total mass of all components. * diff --git a/dumux/material/constraintsolvers/miscible2pnccomposition.hh b/dumux/material/constraintsolvers/miscible2pnccomposition.hh index 7a85670684..fb561f7e04 100644 --- a/dumux/material/constraintsolvers/miscible2pnccomposition.hh +++ b/dumux/material/constraintsolvers/miscible2pnccomposition.hh @@ -34,6 +34,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Computes the composition of all phases of a N-phase, * N-component fluid system assuming that all N phases are * present diff --git a/dumux/material/constraintsolvers/misciblemultiphasecomposition.hh b/dumux/material/constraintsolvers/misciblemultiphasecomposition.hh index 9a23a0f5a5..a28c87caa7 100644 --- a/dumux/material/constraintsolvers/misciblemultiphasecomposition.hh +++ b/dumux/material/constraintsolvers/misciblemultiphasecomposition.hh @@ -34,6 +34,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Computes the composition of all phases of a N-phase, * N-component fluid system assuming that all N phases are * present diff --git a/dumux/material/constraintsolvers/ncpflash.hh b/dumux/material/constraintsolvers/ncpflash.hh index ae9148d96a..c13fd38274 100644 --- a/dumux/material/constraintsolvers/ncpflash.hh +++ b/dumux/material/constraintsolvers/ncpflash.hh @@ -34,6 +34,7 @@ namespace Dumux { /*! + * \ingroup ConstraintSolver * \brief Determines the phase compositions, pressures and saturations * given the total mass of all components. * diff --git a/dumux/material/eos/pengrobinson.hh b/dumux/material/eos/pengrobinson.hh index c45a7be5d2..cc4278f932 100644 --- a/dumux/material/eos/pengrobinson.hh +++ b/dumux/material/eos/pengrobinson.hh @@ -43,6 +43,7 @@ namespace Dumux { /*! + * \ingroup EOS * \brief Implements the Peng-Robinson equation of state for liquids * and gases. * diff --git a/dumux/material/eos/pengrobinsonmixture.hh b/dumux/material/eos/pengrobinsonmixture.hh index d327668e7a..18f98b5b67 100644 --- a/dumux/material/eos/pengrobinsonmixture.hh +++ b/dumux/material/eos/pengrobinsonmixture.hh @@ -33,6 +33,7 @@ namespace Dumux { /*! + * \ingroup EOS * \brief Implements the Peng-Robinson equation of state for a * mixture. */ diff --git a/dumux/material/eos/pengrobinsonparams.hh b/dumux/material/eos/pengrobinsonparams.hh index 203f0215ad..4b582cf9d6 100644 --- a/dumux/material/eos/pengrobinsonparams.hh +++ b/dumux/material/eos/pengrobinsonparams.hh @@ -34,6 +34,7 @@ namespace Dumux { /*! + * \ingroup EOS * \brief Stores and provides access to the Peng-Robinson parameters * * See: diff --git a/dumux/material/eos/pengrobinsonparamsmixture.hh b/dumux/material/eos/pengrobinsonparamsmixture.hh index e8371b2e7a..6134240f43 100644 --- a/dumux/material/eos/pengrobinsonparamsmixture.hh +++ b/dumux/material/eos/pengrobinsonparamsmixture.hh @@ -44,6 +44,7 @@ namespace Dumux { /*! + * \ingroup EOS * \brief The mixing rule for the oil and the gas phases of the SPE5 problem. * * This problem comprises \f$H_2O\f$, \f$C_1\f$, \f$C_3\f$, \f$C_6\f$, diff --git a/dumux/material/fluidsystems/parametercachebase.hh b/dumux/material/fluidsystems/parametercachebase.hh index 4d7018f993..d4efca8511 100644 --- a/dumux/material/fluidsystems/parametercachebase.hh +++ b/dumux/material/fluidsystems/parametercachebase.hh @@ -27,6 +27,7 @@ namespace Dumux { /*! + * \ingroup ParameterCache * \brief The base class of the parameter cache classes for fluid systems */ template diff --git a/dumux/material/fluidsystems/spe5parametercache.hh b/dumux/material/fluidsystems/spe5parametercache.hh index 16fab91feb..92c7a3ce27 100644 --- a/dumux/material/fluidsystems/spe5parametercache.hh +++ b/dumux/material/fluidsystems/spe5parametercache.hh @@ -37,6 +37,7 @@ namespace Dumux { /*! * \ingroup Fluidsystems + * \ingroup ParameterCache * \brief Specifies the parameters required by the SPE5 problem which * are dependend on the thermodynamic state. */ -- GitLab From 82016289fae1922c8aa53a3011e61039b2a312bd Mon Sep 17 00:00:00 2001 From: Kissinger Date: Tue, 2 Feb 2016 15:04:13 +0100 Subject: [PATCH 2/8] [fluidframework] Use copydoc to copy group descriptions --- doc/doxygen/modules.txt | 124 +++++++++++++++++++++++----------------- 1 file changed, 70 insertions(+), 54 deletions(-) diff --git a/doc/doxygen/modules.txt b/doc/doxygen/modules.txt index 59598d983a..a0c634a90d 100644 --- a/doc/doxygen/modules.txt +++ b/doc/doxygen/modules.txt @@ -59,72 +59,51 @@ * \defgroup Material Material and Fluid Framework * Short description of the most important concepts of the material and fluid framework: * - * - _Binary coefficient:_ Binary coefficients describe the relations - * of a mixture of two components. Typical binary coefficients are - * Henry coefficients or binary molecular diffusion - * coefficients. So far, the programming interface for accessing binary - * coefficients has not been standardized in Dumux. + * - __Binary coefficient:__ @copydoc Binarycoefficients * - * - _Component:_ Components are fluid systems which provide the - * thermodynamic relations for the liquid and gas phase of a single - * chemical species or a fixed mixture of species. Their main purpose - * is to provide a convenient way to access these quantities from - * full-fledged fluid systems. Components are not supposed to be used - * by models directly. * - * - _Constraint solver:_ Constraint solvers are auxiliary tools to - * make sure that a fluid state is consistent with some thermodynamic - * constraints. All constraint solvers specify a well defined set of - * input variables and make sure that the resulting fluid state is - * consistent with a given set of thermodynamic equations. + * - __Component:__ @copydoc Components * - * - _Equation of state:_ Equations of state (EOS) are auxiliary - * classes which provide relations between a fluid phase's temperature, - * pressure, composition and density. Since these classes are only used - * internally in fluid systems, their programming interface is - * currently ad-hoc. * - * - _Fluid state:_ Fluid states are responsible for representing the - * complete thermodynamic configuration of a system at a given spatial - * and temporal position. A fluid state always provides access methods - * to __all__ thermodynamic quantities, but the concept of a fluid state does not - * mandate what assumptions are made to store these thermodynamic - * quantities. What fluid states also do __not__ do is to make sure - * that the thermodynamic state which they represent is physically - * possible. + * - __Constraint solver:__ @copydoc ConstraintSolver + * + * + * - __Equation of state:__ @copydoc EOS + * + * + * - __Fluid state:__ @copydoc FluidStates + * + * + * - __Fluid system:__ @copydoc Fluidsystems * - * - _Fluid system:_ Fluid systems express the thermodynamic relations - * Strictly speaking, these relations are - * functions, mathematically.} between quantities. Since functions do - * not exhibit any internal state, fluid systems are stateless classes, - * i.e. all member functions are static. This is a conscious - * decision since the thermodynamic state of the system is expressed by - * a fluid state! * - * - _Fluid-Matrix Interactions:_ Some parameters are functions of the fluid state as well as parameters of - * the matrix. For example the capillary pressure is a function of the phase saturation - * and the shape parameter \f$\lambda\f$ which is dependent on the material. All such relations - * are gathered in this module. + * - __Fluid-Matrix Interactions:__ @copydoc fluidmatrixinteractions + * + * + * - __Parameter cache:__ @copydoc ParameterCache * - * - _Parameter cache:_ Fluid systems sometimes require - * computationally expensive parameters for multiple relations. Such - * parameters can be cached using a so-called parameter - * cache. Parameter cache objects are specific for each fluid system - * but they must provide a common interface to update the internal - * parameters depending on the quantities which changed since the last - * update. * - * - _Spatial Parameters:_ All parameters which depend on the matrix and - * therefore on the position within the model domain are defined as spatial - * parameters. For example permeability, porosity etc. + * - __Spatial Parameters:__ @copydoc SpatialParameters */ /*! * \ingroup Material * \defgroup Binarycoefficients Binary Coefficients + * Binary coefficients describe the relations + * of a mixture of two components. Typical binary coefficients are + * Henry coefficients or binary molecular diffusion + * coefficients. So far, the programming interface for accessing binary + * coefficients has not been standardized in Dumux. */ /*! * \ingroup Material * \defgroup Components Components + * Components are fluid systems which provide the + * thermodynamic relations for the liquid and gas phase of a single + * chemical species or a fixed mixture of species. Their main purpose + * is to provide a convenient way to access these quantities from + * full-fledged fluid systems. Components are not supposed to be used + * by models directly. + * */ /*! * \ingroup Components @@ -133,6 +112,11 @@ /*! * \ingroup Material * \defgroup ConstraintSolver Constraint Solver + * Constraint solvers are auxiliary tools to + * make sure that a fluid state is consistent with some thermodynamic + * constraints. All constraint solvers specify a well defined set of + * input variables and make sure that the resulting fluid state is + * consistent with a given set of thermodynamic equations. * Constraint solvers connect the thermodynamic relations expressed by * fluid systems with the thermodynamic quantities stored by fluid * states. Using them is not mandatory for models, but given the fact @@ -142,21 +126,43 @@ /*! * \ingroup Material * \defgroup EOS Equation of State + * + * Equations of state (EOS) are auxiliary + * classes which provide relations between a fluid phase's temperature, + * pressure, composition and density. Since these classes are only used + * internally in fluid systems, their programming interface is + * currently ad-hoc. */ /*! * \ingroup Material * \defgroup FluidStates Fluid States - * Fluid state objects express the complete thermodynamic state of a system at a given spatial and - * temporal position. + * Fluid states are responsible for representing the + * complete thermodynamic configuration of a system at a given spatial + * and temporal position. A fluid state always provides access methods + * to __all__ thermodynamic quantities, but the concept of a fluid state does not + * mandate what assumptions are made to store these thermodynamic + * quantities. What fluid states also do __not__ do is to make sure + * that the thermodynamic state which they represent is physically + * possible. */ /*! * \ingroup Material * \defgroup Fluidsystems Fluid Systems - * Fluid systems express the thermodynamic relations between the quantities of a fluid state. + * Fluid systems express the thermodynamic relations + * Strictly speaking, these relations are + * functions, mathematically.} between quantities. Since functions do + * not exhibit any internal state, fluid systems are stateless classes, + * i.e. all member functions are static. This is a conscious + * decision since the thermodynamic state of the system is expressed by + * a fluid state! */ /*! * \ingroup Material * \defgroup fluidmatrixinteractions Fluid-Matrix Interactions + * Some parameters are functions of the fluid state as well as parameters of + * the matrix. For example the capillary pressure is a function of the phase saturation + * and the shape parameter \f$\lambda\f$ which is dependent on the material. All such relations + * are gathered in this module. */ /*! * \ingroup fluidmatrixinteractions @@ -169,6 +175,13 @@ /*! * \ingroup Material * \defgroup ParameterCache Parameter Cache + * Fluid systems sometimes require + * computationally expensive parameters for multiple relations. Such + * parameters can be cached using a so-called parameter + * cache. Parameter cache objects are specific for each fluid system + * but they must provide a common interface to update the internal + * parameters depending on the quantities which changed since the last + * update. * All fluid systems must export a type for their __ParameterCache__ * objects. Parameter caches can be used to cache parameter that are * expensive to compute and are required in multiple thermodynamic @@ -178,11 +191,14 @@ * to the fluid system and no assumptions on what they provide should be * made outside of their fluid system. Parameter cache objects provide a * well-defined set of methods to make them coherent with a given fluid - *state, though. + * state, though. */ /*! * \ingroup Material * \defgroup SpatialParameters Spatial Parameters + * All parameters which depend on the matrix and + * therefore on the position within the model domain are defined as spatial + * parameters. For example permeability, porosity etc. */ /* ***************** Fully Implicit ******************/ -- GitLab From eee76b6038ed39d15a3d4335a2a5b5002f772e00 Mon Sep 17 00:00:00 2001 From: Martin Beck Date: Wed, 24 Feb 2016 11:19:02 +0100 Subject: [PATCH 3/8] [doxygen/handbook] Transfer of FLuidSystem description in handbook into doxygen All relevant description were taken from the Handbook and added to/merged with existing doxygen descriptions --- doc/doxygen/modules.txt | 15 ++++++++++- .../compositionfromfugacities.hh | 13 +++++++++- .../computefromreferencephase.hh | 25 +++++++++++++------ dumux/material/fluidsystems/2pimmiscible.hh | 14 ++++++----- dumux/material/fluidsystems/base.hh | 21 ++++++++++++++-- dumux/material/fluidsystems/brineair.hh | 5 ++-- dumux/material/fluidsystems/h2oair.hh | 9 ++++--- .../material/fluidsystems/h2oairmesitylene.hh | 8 +++--- dumux/material/fluidsystems/h2oairxylene.hh | 9 ++++--- dumux/material/fluidsystems/h2on2.hh | 6 +++-- dumux/material/fluidsystems/h2on2kinetic.hh | 5 ++-- .../fluidsystems/parametercachebase.hh | 19 +++++++++++++- dumux/material/fluidsystems/spe5.hh | 21 +++++++--------- 13 files changed, 121 insertions(+), 49 deletions(-) diff --git a/doc/doxygen/modules.txt b/doc/doxygen/modules.txt index a0c634a90d..deb1e09b52 100644 --- a/doc/doxygen/modules.txt +++ b/doc/doxygen/modules.txt @@ -182,6 +182,7 @@ * but they must provide a common interface to update the internal * parameters depending on the quantities which changed since the last * update. + * * All fluid systems must export a type for their __ParameterCache__ * objects. Parameter caches can be used to cache parameter that are * expensive to compute and are required in multiple thermodynamic @@ -192,7 +193,19 @@ * made outside of their fluid system. Parameter cache objects provide a * well-defined set of methods to make them coherent with a given fluid * state, though. - */ + * + * Note, that the parameter cache interface only guarantees that if a + * more specialized update() method is called, it is not slower + * than the next more-general method (e.g. calling updateSingleMoleFraction() + * may be as expensive as updateAll()}. It is thus advisable to + * rather use a more general update() method once than multiple + * calls to specialized update() methods. + * + * To make usage of parameter caches easier for the case where all cached + * quantities ought to be re-calculated if a quantity of a phase was changed, + * it is possible to only define the updatePhase() method and + * derive the parameter cache from Dumux::ParameterCacheBase. + */ /*! * \ingroup Material * \defgroup SpatialParameters Spatial Parameters diff --git a/dumux/material/constraintsolvers/compositionfromfugacities.hh b/dumux/material/constraintsolvers/compositionfromfugacities.hh index 9fe0c9811d..03200efa40 100644 --- a/dumux/material/constraintsolvers/compositionfromfugacities.hh +++ b/dumux/material/constraintsolvers/compositionfromfugacities.hh @@ -36,7 +36,18 @@ namespace Dumux { /*! * \ingroup ConstraintSolver * \brief Calculates the chemical equilibrium from the component - * fugacities in a phase. + * fugacities \f$ f^\kappa \f$ in the phase \f$ \alpha \f$. + * + * This constraint solver takes the component fugacity \f$f^\kappa\f$ of + * of component \f$\kappa\f$, the temperature \f$ T_\alpha \f$, the pressure + * \f$p_\alpha\f$ and the composition \f$x^\lambda_\alpha\f$ of a phase + * \f$\alpha\f$ as input and calculates the mole fraction of component + * \f$\kappa\f$ in that fluid phase \f$x^\kappa_\alpha\f$. This means + * that the thermodynamic constraints used by this solver are + * + * \f$ f^\kappa = \Phi^\kappa_\alpha(\{x^\lambda_\alpha \}, T_\alpha, p_\alpha) p_\alpha x^\kappa_\alpha\; \f$, + * + * where \f${f^\kappa}\f$, \f$ T_\alpha \f$ and \f$ p_\alpha \f$ are fixed values. */ template class CompositionFromFugacities diff --git a/dumux/material/constraintsolvers/computefromreferencephase.hh b/dumux/material/constraintsolvers/computefromreferencephase.hh index 2f4430e6b2..f12d4aab94 100644 --- a/dumux/material/constraintsolvers/computefromreferencephase.hh +++ b/dumux/material/constraintsolvers/computefromreferencephase.hh @@ -49,21 +49,32 @@ namespace Dumux { * constraint solver assumes thermodynamic equilibrium. It assumes the * following quantities to be set: * - * - composition (mole+mass fractions) of the *reference* phase - * - temperature of the *reference* phase - * - saturations of *all* phases - * - pressures of *all* phases + * - composition (mole+mass fractions) of the *reference* phase \f$x^\kappa_\beta\f$ + * - temperature of the *reference* phase \f$T_\beta\f$ + * - saturations of *all* phases \f$S_\alpha\f$, \f$S_\beta\f$ + * - pressures of *all* phases \f$p_\alpha\f$, \f$p_\beta\f$ + * + * \f$ f^\kappa_\beta = f^\kappa_\alpha = \Phi^\kappa_\alpha(\{x^\lambda_\alpha \}, T_\alpha, p_\alpha) p_\alpha x^\kappa_\alpha\; \f$, + * + * \f$ p_\alpha = p_\beta + p_{c\beta\alpha}\; \f$, * * after calling the solve() method the following quantities are * calculated in addition: * - * - temperature of *all* phases + * - temperature of *all* phases \f$T_\alpha\f$, \f$T_\beta\f$ * - density, molar density, molar volume of *all* phases - * - composition in mole and mass fractions and molaries of *all* phases - * - mean molar masses of *all* phases + * \f$\rho_\alpha\f$, \f$\rho_\beta\f$, \f$\rho_{mol, \alpha}\f$, \f$\rho_{mol, \beta}\f$, + * \f$V_{mol, \alpha}\f$, \f$V_{mol, \beta}\f$ + * - composition in mole and mass fractions and molarities of *all* phases + * \f$x^\kappa_\alpha\f$, \f$x^\kappa_\beta\f$, \f$X^\kappa_\alpha\f$, \f$X^\kappa_\beta\f$, + * \f$c^\kappa_\alpha\f$, \f$c^\kappa_\beta\f$ + * - mean molar masses of *all* phases \f$M_\alpha\f$, \f$M_\beta\f$ * - fugacity coefficients of *all* components in *all* phases + * \f$\Phi^\kappa_\alpha\f$, \f$\Phi^\kappa_\beta\f$ * - if the setViscosity parameter is true, also dynamic viscosities of *all* phases + * \f$\mu_\alpha\f$, \f$\mu_\beta\f$ * - if the setEnthalpy parameter is true, also specific enthalpies and internal energies of *all* phases + * \f$h_\alpha\f$, \f$h_\beta\f$, \f$u_\alpha\f$, \f$u_\beta\f$ */ template class ComputeFromReferencePhase diff --git a/dumux/material/fluidsystems/2pimmiscible.hh b/dumux/material/fluidsystems/2pimmiscible.hh index dc0e751e2a..1416272208 100644 --- a/dumux/material/fluidsystems/2pimmiscible.hh +++ b/dumux/material/fluidsystems/2pimmiscible.hh @@ -19,11 +19,7 @@ /*! * \file * - * \brief A fluid system for two-phase models assuming immiscibility and - * thermodynamic equilibrium - * - * The wetting and the non-wetting phase can be defined via their - * individual components. + * \brief @copybrief Dumux::FluidSystems::TwoPImmiscible */ #ifndef DUMUX_2P_IMMISCIBLE_FLUID_SYSTEM_HH #define DUMUX_2P_IMMISCIBLE_FLUID_SYSTEM_HH @@ -48,6 +44,8 @@ namespace FluidSystems { * \brief A fluid system for two-phase models assuming immiscibility and * thermodynamic equilibrium * + * The fluid phases are completely specified by means of their + * constituting components. * The wetting and the non-wetting phase can be defined individually * via Dumux::LiquidPhase and * Dumux::GasPhase. These phases consist of one pure @@ -421,7 +419,11 @@ public: } /*! - * \brief Specific isobaric heat capacity of a fluid phase. + * @copybrief Base::thermalConductivity + * + * Additional comments: + * + * Specific isobaric heat capacity of a fluid phase. * \f$\mathrm{[J/(kg*K)]}\f$. * * \param fluidState The fluid state of the two-phase model diff --git a/dumux/material/fluidsystems/base.hh b/dumux/material/fluidsystems/base.hh index 0d9f42397c..1877b34595 100644 --- a/dumux/material/fluidsystems/base.hh +++ b/dumux/material/fluidsystems/base.hh @@ -163,11 +163,20 @@ public: } /*! - * \brief Thermal conductivity of a fluid phase \f$\mathrm{[W/(m K)]}\f$. + * \brief Thermal conductivity \f$\lambda_\alpha \f$ of a fluid phase \f$\mathrm{[W/(m K)]}\f$. * \param fluidState The fluid state * \param phaseIdx Index of the fluid phase * \param paramCache mutable parameters * + * Given a fluid state, an up-to-date parameter cache and a phase index, + * this method returns the thermal conductivity \f$\lambda_\alpha \f$ of the fluid + * phase. The thermal conductivity is defined by means of the relation + * + * \f$ q = \lambda_\alpha \mathbf{grad}\;T_\alpha \; \f$, + * + * where \f$ q\f$ is the local heat flux density caused by the temperature gradient + * \f$\mathbf{grad}\;T_\alpha\f$. + * * Use the conductivity of air and water as a first approximation. * Source: * http://en.wikipedia.org/wiki/List_of_thermal_conductivities @@ -181,11 +190,19 @@ public: } /*! - * \brief Specific isobaric heat capacity of a fluid phase \f$\mathrm{[J/(kg*K)]}\f$. + * \brief Specific isobaric heat capacity \f$c_{p,\alpha}\f$ of a fluid phase \f$\mathrm{[J/(kg*K)]}\f$. * * \param paramCache mutable parameters * \param phaseIdx for which phase to give back the heat capacity * \param fluidState represents all relevant thermodynamic quantities of a fluid system + * + * Given a fluid state, an up-to-date parameter cache and a phase index, this method + * computes the isobaric heat capacity \f$c_{p,\alpha}\f$ of the fluid phase. The isobaric + * heat capacity is defined as the partial derivative of the specific enthalpy \f$h_\alpha\f$ + * to the fluid pressure \f$p_\alpha\f$: + * + * \f$ c_{p,\alpha} = \frac{\partial h_\alpha}{\partial p_\alpha} \f$ + * */ template static Scalar heatCapacity(const FluidState &fluidState, diff --git a/dumux/material/fluidsystems/brineair.hh b/dumux/material/fluidsystems/brineair.hh index 922eba52d3..3147ab86e0 100644 --- a/dumux/material/fluidsystems/brineair.hh +++ b/dumux/material/fluidsystems/brineair.hh @@ -543,15 +543,14 @@ public: * \param phaseIdx The index of the phase * * See: - * Class Class 2000 + * Class 2000 * Theorie und numerische Modellierung nichtisothermer Mehrphasenprozesse in NAPL-kontaminierten porösen Medien * Chapter 2.1.13 Innere Energie, Wäremekapazität, Enthalpie \cite A3:class:2001
* * Formula (2.42): * the specific enthalpy of a gas phase result from the sum of (enthalpies*mass fraction) of the components * For the calculation of enthalpy of brine we refer to (Michaelides 1981) - */ - /*! + * * \todo This system neglects the contribution of gas-molecules in the liquid phase. * This contribution is probably not big. Somebody would have to find out the enthalpy of solution for this system. ... */ diff --git a/dumux/material/fluidsystems/h2oair.hh b/dumux/material/fluidsystems/h2oair.hh index 19ccdcc0bd..2bb209029e 100644 --- a/dumux/material/fluidsystems/h2oair.hh +++ b/dumux/material/fluidsystems/h2oair.hh @@ -20,8 +20,7 @@ /*! * \file * - * \brief A fluid system with a liquid and a gaseous phase and \f$\mathrm{H_2O}\f$ and \f$\mathrm{Air}\f$ - * as components. + * \brief @copybrief Dumux::FluidSystems::H2OAir */ #ifndef DUMUX_H2O_AIR_SYSTEM_HH #define DUMUX_H2O_AIR_SYSTEM_HH @@ -55,8 +54,10 @@ namespace FluidSystems * \brief A compositional twophase fluid system with water and air as * components in both, the liquid and the gas phase. * - * This fluidsystem is applied by default with the tabulated version of - * water of the IAPWS-formulation. + * This fluidsystem features gas and liquid phases of distilled water + * \f$(\mathrm{H_2O})\f$) and air (Pseudo component composed of \f$\mathrm{79\%\;N_2}\f$, + * \f$\mathrm{20\%\;O_2}\f$ and \f$\mathrm{1\%\;Ar}\f$) as components. It is applied by + * default with the tabulated version of water of the IAPWS-formulation. * * To change the component formulation (i.e. to use nontabulated or * incompressible water), or to switch on verbosity of tabulation, diff --git a/dumux/material/fluidsystems/h2oairmesitylene.hh b/dumux/material/fluidsystems/h2oairmesitylene.hh index 66aedb8ab0..5a59ad19f3 100644 --- a/dumux/material/fluidsystems/h2oairmesitylene.hh +++ b/dumux/material/fluidsystems/h2oairmesitylene.hh @@ -19,8 +19,7 @@ /*! * \file * - * \brief A fluid system with water, gas and NAPL as phases and - * \f$\mathrm{H_2O}\f$ and \f$\mathrm{Air}\f$ and \f$\mathrm{NAPL (contaminant)}\f$ as components. + * \brief @copybrief Dumux::FluidSystems::H2OAirMesitylene */ #ifndef DUMUX_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HH #define DUMUX_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HH @@ -46,8 +45,9 @@ namespace FluidSystems /*! * \ingroup Fluidsystems - * \brief A compositional fluid with water and molecular nitrogen as - * components in both, the liquid and the gas phase. + * \brief A three-phase fluid system featuring gas, NAPL and water as phases and + * distilled water \f$(\mathrm{H_2O})\f$ and air (Pseudo component composed of + * \f$\mathrm{79\%\;N_2}\f$, \f$\mathrm{20\%\;O_2}\f$ and Mesitylene \f$(\mathrm{C_6H_3(CH_3)_3})\f$ as components. It assumes all phases to be ideal mixtures. */ template > > diff --git a/dumux/material/fluidsystems/h2oairxylene.hh b/dumux/material/fluidsystems/h2oairxylene.hh index c597bd0f88..847b6e43e5 100644 --- a/dumux/material/fluidsystems/h2oairxylene.hh +++ b/dumux/material/fluidsystems/h2oairxylene.hh @@ -19,8 +19,7 @@ /*! * \file * - * \brief A fluid system with water, gas and NAPL as phases and - * \f$\mathrm{H_2O}\f$ and \f$\mathrm{Air}\f$ and \f$\mathrm{NAPL (contaminant)}\f$ as components. + * \brief @copybrief Dumux::FluidSystems::H2OAirXylene */ #ifndef DUMUX_H2O_AIR_XYLENE_FLUID_SYSTEM_HH #define DUMUX_H2O_AIR_XYLENE_FLUID_SYSTEM_HH @@ -44,8 +43,10 @@ namespace FluidSystems /*! * \ingroup Fluidsystems - * \brief A compositional fluid with water and molecular nitrogen as - * components in both, the liquid and the gas phase. + * \brief A three-phase fluid system featuring gas, NAPL and water as phases and + * distilled water \f$(\mathrm{H_2O})\f$ and air (Pseudo component composed of + * \f$\mathrm{79\%\;N_2}\f$, \f$\mathrm{20\%\;O_2}\f$ and Mesitylene \f$(\mathrm{C_8H_{10}})\f$ as components. It assumes all phases to be ideal mixtures. + */ */ template > > diff --git a/dumux/material/fluidsystems/h2on2.hh b/dumux/material/fluidsystems/h2on2.hh index 113cba34d1..e369b8ae97 100644 --- a/dumux/material/fluidsystems/h2on2.hh +++ b/dumux/material/fluidsystems/h2on2.hh @@ -19,7 +19,7 @@ /*! * \file * - * \brief A twophase fluid system with water and nitrogen as components. + * \brief @copybrief Dumux::FluidSystems::H2ON2 */ #ifndef DUMUX_H2O_N2_FLUID_SYSTEM_HH #define DUMUX_H2O_N2_FLUID_SYSTEM_HH @@ -52,7 +52,9 @@ namespace FluidSystems /*! * \ingroup Fluidsystems * - * \brief A twophase fluid system with water and nitrogen as components. + * \brief A two-phase fluid system featuring gas and liquid phases and destilled + * water \f$(\mathrm{H_2O})\f$ and pure molecular Nitrogen \f$(\mathrm{N_2})\f$ as + * components. * * This FluidSystem can be used without the PropertySystem that is applied in Dumux, * as all Parameters are defined via template parameters. Hence it is in an diff --git a/dumux/material/fluidsystems/h2on2kinetic.hh b/dumux/material/fluidsystems/h2on2kinetic.hh index ba486da3e1..47cf819016 100644 --- a/dumux/material/fluidsystems/h2on2kinetic.hh +++ b/dumux/material/fluidsystems/h2on2kinetic.hh @@ -19,7 +19,7 @@ /*! * \file * - * \brief A twophase fluid system with water and nitrogen as components. + * \brief @copybrief Dumux::FluidSystems::H2ON2Kinetic */ #ifndef DUMUX_H2O_N2_FLUID_SYSTEM_KINETIC_HH #define DUMUX_H2O_N2_FLUID_SYSTEM_KINETIC_HH @@ -43,7 +43,8 @@ namespace FluidSystems { /*! * \ingroup Fluidsystems - * \brief A twophase fluid system with water and nitrogen as components. + * \brief A two-phase fluid system featuring gas and liquid phases and destilled + * water \f$(\mathrm{H_2O})\f$ and pure molecular Nitrogen \f$(\mathrm{N_2})\f$ as components. */ template class H2ON2Kinetic : diff --git a/dumux/material/fluidsystems/parametercachebase.hh b/dumux/material/fluidsystems/parametercachebase.hh index d4efca8511..95940e6707 100644 --- a/dumux/material/fluidsystems/parametercachebase.hh +++ b/dumux/material/fluidsystems/parametercachebase.hh @@ -44,6 +44,13 @@ public: ParameterCacheBase() {} + /*! + * \brief Update all cached quantities for all phases. + * + * The except argument contains a bit field of the quantities + * which have not been modified since the last call to an update() + * method. + */ template void updateAll(const FluidState &fs, int exceptQuantities = None) { @@ -51,7 +58,10 @@ public: asImp_().updatePhase(fs, phaseIdx); } - + /*! + * \brief Update all cached quantities which depend on the pressure of any + * fluid phase. + */ template void updateAllPressures(const FluidState &fs) { @@ -59,6 +69,10 @@ public: asImp_().updatePhase(fs, phaseIdx); } + /*! + * \brief Update all cached quantities which depend on the temperature of any + * fluid phase. + */ template void updateAllTemperatures(const FluidState &fs) { @@ -69,6 +83,9 @@ public: /*! * \brief Update all cached parameters of a specific fluid phase + * + * The quantities specified by the except bit field have not been + * modified since since the last call to an update() method. */ template void updatePhase(const FluidState &fs, int phaseIdx, int exceptQuantities = None) diff --git a/dumux/material/fluidsystems/spe5.hh b/dumux/material/fluidsystems/spe5.hh index a140755898..5d17a0c179 100644 --- a/dumux/material/fluidsystems/spe5.hh +++ b/dumux/material/fluidsystems/spe5.hh @@ -19,16 +19,7 @@ /*! * \file * - * \brief The mixing rule for the oil and the gas phases of the SPE5 problem. - * - * This problem comprises \f$\mathrm{H_2O}\f$, \f$\mathrm{C_1}\f$, \f$\mathrm{C_3}\f$, \f$\mathrm{C_6}\f$, - * \f$\mathrm{C_10}\f$, \f$\mathrm{C_15}\f$ and \f$\mathrm{C_20}\f$ as components. - * - * See: - * - * J.E. Killough, et al.: Fifth Comparative Solution Project: - * Evaluation of Miscible Flood Simulators, Ninth SPE Symposium on - * Reservoir Simulation, 1987 \cite SPE5 + * \brief @copybrief Dumux::FluidSystems::Spe5 */ #ifndef DUMUX_SPE5_FLUID_SYSTEM_HH #define DUMUX_SPE5_FLUID_SYSTEM_HH @@ -46,8 +37,14 @@ namespace FluidSystems * \ingroup Fluidsystems * \brief The fluid system for the SPE-5 benchmark problem. * - * This problem comprises \f$\mathrm{H_2O}\f$, \f$\mathrm{C_1}\f$, \f$\mathrm{C_3}\f$, \f$\mathrm{C_6}\f$, - * \f$\mathrm{C_10}\f$, \f$\mathrm{C_15}\f$ and \f$\mathrm{C_20}\f$ as components. + * A three-phase fluid system featuring gas, oil and water as phases and the seven + * components distilled water, Methane \f$(\mathrm{C_1})\f$, Propane \f$(\mathrm{C_3})\f$, + * Pentane \f$(\mathrm{C_5})\f$, Heptane \f$(\mathrm{C_7})\f$, Decane + * \f$(\mathrm{C_{10}})\f$, Pentadecane \f$(\mathrm{C_{15}})\f$ and Icosane + * \f$(\mathrm{C_{20}})\f$. For the water phase the IAPWS-97 formulation is used as + * equation of state, while for the gas and oil phases a Peng-Robinson + * equation of state with slightly modified parameters is used. This fluid system is highly + * non-linear, and the gas and oil phases also cannot be considered ideal. * * See: * -- GitLab From 431cc0a83dde1968ca53e1785cdeef3dc32da504 Mon Sep 17 00:00:00 2001 From: Kissinger Date: Wed, 24 Feb 2016 16:25:42 +0100 Subject: [PATCH 4/8] [FluidState] Add all relevant doc for FluidState functions from handbook - Moved function doc from handbook to compositional FluidState - Use copydoc for 2p2c FS functions from compositional FS --- dumux/material/fluidstates/2p2c.hh | 60 +++------------ dumux/material/fluidstates/compositional.hh | 81 +++++++++++++++++---- 2 files changed, 75 insertions(+), 66 deletions(-) diff --git a/dumux/material/fluidstates/2p2c.hh b/dumux/material/fluidstates/2p2c.hh index 24ec641163..cc716a98ba 100644 --- a/dumux/material/fluidstates/2p2c.hh +++ b/dumux/material/fluidstates/2p2c.hh @@ -65,10 +65,7 @@ public: * \name acess functions */ //@{ - /*! - * \brief Returns the saturation of a phase. - * - * \param phaseIdx the index of the phase + /*! @copydoc CompositionalFluidState::saturation() */ Scalar saturation(int phaseIdx) const { @@ -78,62 +75,38 @@ public: return Scalar(1.0) - sw_; } - /*! - * \brief Returns the mass fraction of a component in a phase. - * - * \param phaseIdx the index of the phase - * \param compIdx the index of the component + /*! @copydoc CompositionalFluidState::massFraction() */ Scalar massFraction(int phaseIdx, int compIdx) const { return massFraction_[phaseIdx][compIdx]; } - /*! - * \brief Returns the molar fraction of a component in a fluid phase. - * - * \param phaseIdx the index of the phase - * \param compIdx the index of the component + /*! @copydoc CompositionalFluidState::moleFraction() */ Scalar moleFraction(int phaseIdx, int compIdx) const { return moleFraction_[phaseIdx][compIdx]; } - /*! - * \brief Returns the density of a phase \f$\mathrm{[kg/m^3]}\f$. - * - * \param phaseIdx the index of the phase + /*! @copydoc CompositionalFluidState::density() */ Scalar density(int phaseIdx) const { return density_[phaseIdx]; } - /*! - * \brief Returns the viscosity of a phase \f$\mathrm{[Pa*s]}\f$. - * - * \param phaseIdx the index of the phase + /*! @copydoc CompositionalFluidState::viscosity(int ) */ Scalar viscosity(int phaseIdx) const { return viscosity_[phaseIdx]; } - /*! - * \brief Return the partial pressure of a component in the gas phase. - * - * For an ideal gas, this means \f$ R*T*c \f$. - * Unit: \f$\mathrm{[Pa] = [N/m^2]}\f$ - * - * \param compIdx the index of the component + /*! @copydoc CompositionalFluidState::partialPressure(int) */ Scalar partialPressure(int compIdx) const { return partialPressure(nPhaseIdx, compIdx); } - /*! - * \brief Return the partial pressure of a component in a phase. - * - * \param phaseIdx the index of the phase - * \param compIdx the index of the component + /*! @copydoc CompositionalFluidState::partialPressure(int) */ Scalar partialPressure(int phaseIdx, int compIdx) const { @@ -141,10 +114,7 @@ public: return pressure(phaseIdx)*moleFraction(phaseIdx, compIdx); } - /*! - * \brief Returns the pressure of a fluid phase \f$\mathrm{[Pa]}\f$. - * - * \param phaseIdx the index of the phase + /*! @copydoc CompositionalFluidState::pressure() */ Scalar pressure(int phaseIdx) const { return phasePressure_[phaseIdx]; } @@ -155,22 +125,12 @@ public: Scalar capillaryPressure() const { return phasePressure_[nPhaseIdx] - phasePressure_[wPhaseIdx]; } - /*! - * \brief Returns the temperature of the fluids \f$\mathrm{[K]}\f$. - * - * Note that we assume thermodynamic equilibrium, so all fluids - * and the rock matrix exhibit the same temperature. + /*! @copydoc CompositionalFluidState::temperature() */ Scalar temperature(int phaseIdx = 0) const { return temperature_; } - /*! - * \brief Return the average molar mass of a phase. - * - * This is the sum of all molar masses times their respective mole - * fractions in the phase. - * - * Unit: \f$\mathrm{[kg/m^3]}\f$ + /*! @copydoc CompositionalFluidState::averageMolarMass() */ Scalar averageMolarMass(int phaseIdx) const { diff --git a/dumux/material/fluidstates/compositional.hh b/dumux/material/fluidstates/compositional.hh index 1ac12f3fdd..f4fd76f4b8 100644 --- a/dumux/material/fluidstates/compositional.hh +++ b/dumux/material/fluidstates/compositional.hh @@ -75,19 +75,42 @@ public: * on thermodynamic equilibrium required) *****************************************************/ /*! - * \brief Returns the saturation of a phase \f$\mathrm{[-]}\f$ + * \brief Returns the saturation \f$S_\alpha\f$ of a fluid phase \f$\alpha\f$ in \f$\mathrm{[-]}\f$. + * + * The saturation is defined as the pore space occupied by the fluid divided by the total pore space: + * \f[S_\alpha := \frac{\phi \mathcal{V}_\alpha}{\phi \mathcal{V}}\f] + * + * \param phaseIdx the index of the phase */ Scalar saturation(int phaseIdx) const { return saturation_[phaseIdx]; } /*! - * \brief The mole fraction of a component in a phase \f$\mathrm{[-]}\f$ + * \brief Returns the molar fraction \f$x^\kappa_\alpha\f$ of the component \f$\kappa\f$ in fluid phase \f$\alpha\f$ in \f$\mathrm{[-]}\f$. + * + * The molar fraction \f$x^\kappa_\alpha\f$ is defined as the ratio of the number of molecules + * of component \f$\kappa\f$ and the total number of molecules of the phase \f$\alpha\f$. + * + * \param phaseIdx the index of the phase + * \param compIdx the index of the component */ Scalar moleFraction(int phaseIdx, int compIdx) const { return moleFraction_[phaseIdx][compIdx]; } /*! - * \brief The mass fraction of a component in a phase \f$\mathrm{[-]}\f$ + * \brief Returns the mass fraction \f$X^\kappa_\alpha\f$ of component \f$\kappa\f$ in fluid phase \f$\alpha\f$ in \f$\mathrm{[-]}\f$. + * + * The mass fraction \f$X^\kappa_\alpha\f$ is defined as the weight of all molecules of a + * component divided by the total mass of the fluid phase. It is related with the component's mole fraction by means of the relation + * + * \f[X^\kappa_\alpha = x^\kappa_\alpha \frac{M^\kappa}{\overline M_\alpha}\;,\f] + * + * where \f$M^\kappa\f$ is the molar mass of component \f$\kappa\f$ and + * \f$\overline M_\alpha\f$ is the mean molar mass of a molecule of phase + * \f$\alpha\f$. + * + * \param phaseIdx the index of the phase + * \param compIdx the index of the component */ Scalar massFraction(int phaseIdx, int compIdx) const { @@ -100,18 +123,18 @@ public: } /*! - * \brief The average molar mass of a fluid phase \f$\mathrm{[kg/mol]}\f$ + * \brief The average molar mass \f$\overline M_\alpha\f$ of phase \f$\alpha\f$ in \f$\mathrm{[kg/mol]}\f$ * * The average molar mass is the mean mass of a mole of the * fluid at current composition. It is defined as the sum of the * component's molar masses weighted by the current mole fraction: - * \f$\mathrm{ \bar M_\alpha = \sum_\kappa M^\kappa x_\alpha^\kappa}\f$ + * \f[\mathrm{ \bar M_\alpha = \sum_\kappa M^\kappa x_\alpha^\kappa}\f] */ Scalar averageMolarMass(int phaseIdx) const { return averageMolarMass_[phaseIdx]; } /*! - * \brief The molar concentration of a component in a phase \f$\mathrm{[mol/m^3]}\f$ + * \brief The molar concentration \f$c^\kappa_\alpha\f$ of component \f$\kappa\f$ in fluid phase \f$\alpha\f$ in \f$\mathrm{[mol/m^3]}\f$ * * This quantity is usually called "molar concentration" or just * "concentration", but there are many other (though less common) @@ -123,43 +146,65 @@ public: { return molarDensity(phaseIdx)*moleFraction(phaseIdx, compIdx); } /*! - * \brief The fugacity of a component in a phase \f$\mathrm{[Pa]}\f$ + * \brief The fugacity \f$f^\kappa_\alpha\f$ of component \f$\kappa\f$ + * in fluid phase \f$\alpha\f$ in \f$\mathrm{[Pa]}\f$ + * + * The fugacity is defined as: + * \f$f_\alpha^\kappa := \Phi^\kappa_\alpha x^\kappa_\alpha p_\alpha \;,\f$ + * where \f$\Phi^\kappa_\alpha\f$ is the fugacity coefficient \cite reid1987 . + * The physical meaning of fugacity becomes clear from the equation: + * \f[f_\alpha^\kappa = p_\alpha \exp\left\{\frac{\zeta^\kappa_\alpha}{R T_\alpha} \right\} \;,\f] + * where \f$\zeta^\kappa_\alpha\f$ represents the \f$\kappa\f$'s chemical + * potential in phase \f$\alpha\f$, \f$R\f$ stands for the ideal gas constant, + * and \f$T_\alpha\f$ for the absolute temperature of phase \f$\alpha\f$. Assuming thermal equilibrium, + * there is a one-to-one mapping between a component's chemical potential + * \f$\zeta^\kappa_\alpha\f$ and its fugacity \f$f^\kappa_\alpha\f$. In this + * case chemical equilibrium can thus be expressed by: + * \f[f^\kappa := f^\kappa_\alpha = f^\kappa_\beta\quad\forall \alpha, \beta\f] */ Scalar fugacity(int phaseIdx, int compIdx) const { return fugacityCoefficient(phaseIdx, compIdx)*moleFraction(phaseIdx, compIdx)*pressure(phaseIdx); } /*! - * \brief The fugacity coefficient of a component in a phase \f$\mathrm{[-]}\f$ + * \brief The fugacity coefficient \f$\Phi^\kappa_\alpha\f$ of component \f$\kappa\f$ in fluid phase \f$\alpha\f$ in \f$\mathrm{[-]}\f$ */ Scalar fugacityCoefficient(int phaseIdx, int compIdx) const { return fugacityCoefficient_[phaseIdx][compIdx]; } /*! - * \brief The molar volume of a fluid phase \f$\mathrm{[m^3/mol]}\f$ + * \brief The molar volume \f$v_{mol,\alpha}\f$ of a fluid phase \f$\alpha\f$ in \f$\mathrm{[m^3/mol]}\f$ + * + * This quantity is the inverse of the molar density. */ Scalar molarVolume(int phaseIdx) const { return 1/molarDensity(phaseIdx); } /*! - * \brief The mass density of a fluid phase \f$\mathrm{[kg/m^3]}\f$ + * \brief The mass density \f$\rho_\alpha\f$ of the fluid phase + * \f$\alpha\f$ in \f$\mathrm{[kg/m^3]}\f$ */ Scalar density(int phaseIdx) const { return density_[phaseIdx]; } /*! - * \brief The molar density of a fluid phase \f$\mathrm{[mol/m^3]}\f$ + * \brief The molar density \f$\rho_{mol,\alpha}\f$ + * of a fluid phase \f$\alpha\f$ in \f$\mathrm{[mol/m^3]}\f$ + * + * The molar density is defined by the mass density \f$\rho_\alpha\f$ and the mean molar mass \f$\overline M_\alpha\f$: + * + * \f[\rho_{mol,\alpha} = \frac{\rho_\alpha}{\overline M_\alpha} \;.\f] */ Scalar molarDensity(int phaseIdx) const { return density_[phaseIdx]/averageMolarMass(phaseIdx); } /*! - * \brief The temperature of a fluid phase \f$\mathrm{[K]}\f$ + * \brief The absolute temperature\f$T_\alpha\f$ of a fluid phase \f$\alpha\f$ in \f$\mathrm{[K]}\f$ */ Scalar temperature(int phaseIdx) const { return temperature_; } /*! - * \brief The pressure of a fluid phase \f$\mathrm{[Pa]}\f$ + * \brief The pressure \f$p_\alpha\f$ of a fluid phase \f$\alpha\f$ in \f$\mathrm{[Pa]}\f$ */ Scalar pressure(int phaseIdx) const { return pressure_[phaseIdx]; } @@ -174,19 +219,23 @@ public: } /*! - * \brief The specific enthalpy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * \brief The specific enthalpy \f$h_\alpha\f$ of a fluid phase \f$\alpha\f$ in \f$\mathrm{[J/kg]}\f$ */ Scalar enthalpy(int phaseIdx) const { return enthalpy_[phaseIdx]; } /*! - * \brief The specific internal energy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * \brief The specific internal energy \f$u_\alpha\f$ of a fluid phase \f$\alpha\f$ in \f$\mathrm{[J/kg]}\f$ + * + * The specific internal energy is defined by the relation: + * + * \f[u_\alpha = h_\alpha - \frac{p_\alpha}{\rho_\alpha}\f] */ Scalar internalEnergy(int phaseIdx) const { return enthalpy_[phaseIdx] - pressure(phaseIdx)/density(phaseIdx); } /*! - * \brief The dynamic viscosity of a fluid phase \f$\mathrm{[Pa s]}\f$ + * \brief The dynamic viscosity \f$\mu_\alpha\f$ of fluid phase \f$\alpha\f$ in \f$\mathrm{[Pa s]}\f$ */ Scalar viscosity(int phaseIdx) const { return viscosity_[phaseIdx]; } -- GitLab From 4414a72874a806a425934cd2e2d05226dfc933e6 Mon Sep 17 00:00:00 2001 From: Kissinger Date: Mon, 7 Mar 2016 11:21:13 +0100 Subject: [PATCH 5/8] [FluidState][Documentation] Use copydoc to generalize fs doc - Documentation for all general FluidState get-functions derived from compositional.hh - Documentation in compositional.hh take from handbook --- dumux/material/fluidstates/2p2c.hh | 6 +-- dumux/material/fluidstates/compositional.hh | 2 +- dumux/material/fluidstates/immiscible.hh | 40 +++++++---------- .../fluidstates/isothermalimmiscible.hh | 45 ++++++------------- dumux/material/fluidstates/nonequilibrium.hh | 41 +++++++---------- .../fluidstates/nonequilibriumenergy.hh | 2 +- dumux/material/fluidstates/pressureoverlay.hh | 41 +++++++---------- dumux/material/fluidstates/pseudo1p2c.hh | 40 +++++------------ .../material/fluidstates/saturationoverlay.hh | 41 +++++++---------- .../fluidstates/temperatureoverlay.hh | 39 ++++++---------- 10 files changed, 105 insertions(+), 192 deletions(-) diff --git a/dumux/material/fluidstates/2p2c.hh b/dumux/material/fluidstates/2p2c.hh index cc716a98ba..89dc426948 100644 --- a/dumux/material/fluidstates/2p2c.hh +++ b/dumux/material/fluidstates/2p2c.hh @@ -94,19 +94,19 @@ public: Scalar density(int phaseIdx) const { return density_[phaseIdx]; } - /*! @copydoc CompositionalFluidState::viscosity(int ) + /*! @copydoc CompositionalFluidState::viscosity() */ Scalar viscosity(int phaseIdx) const { return viscosity_[phaseIdx]; } - /*! @copydoc CompositionalFluidState::partialPressure(int) + /*! @copydoc CompositionalFluidState::partialPressure() */ Scalar partialPressure(int compIdx) const { return partialPressure(nPhaseIdx, compIdx); } - /*! @copydoc CompositionalFluidState::partialPressure(int) + /*! @copydoc CompositionalFluidState::partialPressure() */ Scalar partialPressure(int phaseIdx, int compIdx) const { diff --git a/dumux/material/fluidstates/compositional.hh b/dumux/material/fluidstates/compositional.hh index f4fd76f4b8..14d49625ad 100644 --- a/dumux/material/fluidstates/compositional.hh +++ b/dumux/material/fluidstates/compositional.hh @@ -128,7 +128,7 @@ public: * The average molar mass is the mean mass of a mole of the * fluid at current composition. It is defined as the sum of the * component's molar masses weighted by the current mole fraction: - * \f[\mathrm{ \bar M_\alpha = \sum_\kappa M^\kappa x_\alpha^\kappa}\f] + * \f[\mathrm{ \overline M_\alpha = \sum_\kappa M^\kappa x_\alpha^\kappa}\f] */ Scalar averageMolarMass(int phaseIdx) const { return averageMolarMass_[phaseIdx]; } diff --git a/dumux/material/fluidstates/immiscible.hh b/dumux/material/fluidstates/immiscible.hh index f4105240e9..694ce45907 100644 --- a/dumux/material/fluidstates/immiscible.hh +++ b/dumux/material/fluidstates/immiscible.hh @@ -60,43 +60,37 @@ public: * on thermodynamic equilibrium required) *****************************************************/ /*! - * \brief Returns the saturation of a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::saturation() */ Scalar saturation(int phaseIdx) const { return saturation_[phaseIdx]; } /*! - * \brief The mole fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::moleFraction() */ Scalar moleFraction(int phaseIdx, int compIdx) const { return (phaseIdx == compIdx)?1.0:0.0; } /*! - * \brief The mass fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::massFraction() */ Scalar massFraction(int phaseIdx, int compIdx) const { return (phaseIdx == compIdx)?1.0:0.0; } /*! - * \brief The average molar mass of a fluid phase \f$\mathrm{[kg/mol]}\f$ + * @copydoc CompositionalFluidState::averageMolarMass() */ Scalar averageMolarMass(int phaseIdx) const { return FluidSystem::molarMass(/*compIdx=*/phaseIdx); } /*! - * \brief The concentration of a component in a phase \f$\mathrm{[mol/m^3]}\f$ - * - * This quantity is often called "molar concentration" or just - * "concentration", but there are many other (though less common) - * measures for concentration. - * - * http://en.wikipedia.org/wiki/Concentration + * @copydoc CompositionalFluidState::molarity() */ Scalar molarity(int phaseIdx, int compIdx) const { return molarDensity(phaseIdx)*moleFraction(phaseIdx, compIdx); } /*! - * \brief The fugacity of a component in a phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::fugacity() * * To avoid numerical issues with code that assumes miscibility, * we return a fugacity of 0 for components which do not mix with @@ -113,7 +107,7 @@ public: } /*! - * \brief The fugacity coefficient of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::fugacityCoefficient() * * Since we assume immiscibility, the fugacity coefficients for * the components which are not miscible with the phase is @@ -129,7 +123,7 @@ public: } /*! - * \brief The partial pressure of a component in a phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::partialPressure() * * To avoid numerical issues with code that assumes miscibility, * we return a partial pressure of 0 for components which do not mix with @@ -144,50 +138,50 @@ public: } /*! - * \brief The molar volume of a fluid phase \f$\mathrm{[m^3/mol]}\f$ + * @copydoc CompositionalFluidState::molarVolume() * */ Scalar molarVolume(int phaseIdx) const { return 1/molarDensity(phaseIdx); } /*! - * \brief The mass density of a fluid phase \f$\mathrm{[kg/m^3]}\f$ + * @copydoc CompositionalFluidState::density() */ Scalar density(int phaseIdx) const { return density_[phaseIdx]; } /*! - * \brief The molar density of a fluid phase \f$\mathrm{[mol/m^3]}\f$ + * @copydoc CompositionalFluidState::molarDensity() */ Scalar molarDensity(int phaseIdx) const { return density_[phaseIdx]/averageMolarMass(phaseIdx); } /*! - * \brief The temperature of a fluid phase \f$\mathrm{[K]}\f$ + * @copydoc CompositionalFluidState::temperature() */ Scalar temperature(int phaseIdx) const { return temperature_; } /*! - * \brief The pressure of a fluid phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::pressure() */ Scalar pressure(int phaseIdx) const { return pressure_[phaseIdx]; } /*! - * \brief The specific enthalpy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::enthalpy() */ Scalar enthalpy(int phaseIdx) const { return enthalpy_[phaseIdx]; } /*! - * \brief The specific internal energy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::internalEnergy() */ Scalar internalEnergy(int phaseIdx) const { return enthalpy_[phaseIdx] - pressure(phaseIdx)/density(phaseIdx); } /*! - * \brief The dynamic viscosity of a fluid phase \f$\mathrm{[Pa s]}\f$ + * @copydoc CompositionalFluidState::viscosity() */ Scalar viscosity(int phaseIdx) const { return viscosity_[phaseIdx]; } @@ -204,7 +198,7 @@ public: { return temperature_; } /*! - * \brief The fugacity of a component + * \brief The fugacity of a component \f$\mathrm{[Pa]}\f$ * * This assumes chemical equilibrium. */ diff --git a/dumux/material/fluidstates/isothermalimmiscible.hh b/dumux/material/fluidstates/isothermalimmiscible.hh index ac5414bc93..a028111d3d 100644 --- a/dumux/material/fluidstates/isothermalimmiscible.hh +++ b/dumux/material/fluidstates/isothermalimmiscible.hh @@ -56,49 +56,37 @@ public: * Generic access to fluid properties *****************************************************/ /*! - * \brief Returns the saturation of a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::saturation() */ Scalar saturation(int phaseIdx) const { return saturation_[phaseIdx]; } /*! - * \brief The mole fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::moleFraction() */ Scalar moleFraction(int phaseIdx, int compIdx) const { return (phaseIdx == compIdx)?1.0:0.0; } /*! - * \brief The mass fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::massFraction() */ Scalar massFraction(int phaseIdx, int compIdx) const { return (phaseIdx == compIdx)?1.0:0.0; } /*! - * \brief The average molar mass of a fluid phase \f$\mathrm{[kg/mol]}\f$ + * @copydoc CompositionalFluidState::averageMolarMass() */ Scalar averageMolarMass(int phaseIdx) const { return FluidSystem::molarMass(/*compIdx=*/phaseIdx); } /*! - * \brief The concentration of a component in a phase \f$\mathrm{[mol/m^3]]}\f$ - * - * This quantity is often called "molar concentration" or just - * "concentration", but there are many other (though less common) - * measures for concentration. - * - * http://en.wikipedia.org/wiki/Concentration + * @copydoc CompositionalFluidState::molarity() */ Scalar molarity(int phaseIdx, int compIdx) const { return molarDensity(phaseIdx)*moleFraction(phaseIdx, compIdx); } /*! - * \brief The fugacity of a component in a phase \f$\mathrm{[Pa]}\f$ - * - * To avoid numerical issues with code that assumes miscibility, - * we return a fugacity of 0 for components which do not mix with - * the specified phase. (Actually it undefined, but for finite - * fugacity coefficients, the only way to get components - * completely out of a phase is 0 to feed it zero fugacity.) + * @copydoc ImmiscibleFluidState::fugacity() */ Scalar fugacity(int phaseIdx, int compIdx) const { @@ -109,12 +97,7 @@ public: } /*! - * \brief The fugacity coefficient of a component in a phase \f$\mathrm{[-]]}\f$ - * - * Since we assume immiscibility, the fugacity coefficients for - * the components which are not miscible with the phase is - * infinite. Beware that this will very likely break your code if - * you don't keep that in mind. + * @copydoc ImmiscibleFluidState::fugacityCoefficient() */ Scalar fugacityCoefficient(int phaseIdx, int compIdx) const { @@ -125,19 +108,19 @@ public: } /*! - * \brief The molar volume of a fluid phase \f$\mathrm{[m^3/mol]}\f$ + * @copydoc CompositionalFluidState::molarVolume() */ Scalar molarVolume(int phaseIdx) const { return 1/molarDensity(phaseIdx); } /*! - * \brief The mass density of a fluid phase \f$\mathrm{[kg/m^3]}\f$ + * @copydoc CompositionalFluidState::density() */ Scalar density(int phaseIdx) const { return density_[phaseIdx]; } /*! - * \brief The molar density of a fluid phase \f$\mathrm{[mol/m^3]}\f$ + * @copydoc CompositionalFluidState::molarDensity() */ Scalar molarDensity(int phaseIdx) const { return density_[phaseIdx]/averageMolarMass(phaseIdx); } @@ -155,25 +138,25 @@ public: { return temperature_; } /*! - * \brief The pressure of a fluid phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::pressure() */ Scalar pressure(int phaseIdx) const { return pressure_[phaseIdx]; } /*! - * \brief The specific enthalpy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::enthalpy() */ Scalar enthalpy(int phaseIdx) const { DUNE_THROW(Dune::NotImplemented,"No enthalpy() function defined for isothermal systems!"); } /*! - * \brief The specific internal energy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::internalEnergy() */ Scalar internalEnergy(int phaseIdx) const { DUNE_THROW(Dune::NotImplemented,"No internalEnergy() function defined for isothermal systems!"); } /*! - * \brief The dynamic viscosity of a fluid phase \f$\mathrm{[Pa s]}\f$ + * @copydoc CompositionalFluidState::viscosity() */ Scalar viscosity(int phaseIdx) const { return viscosity_[phaseIdx]; } diff --git a/dumux/material/fluidstates/nonequilibrium.hh b/dumux/material/fluidstates/nonequilibrium.hh index 227732c77f..5289869f80 100644 --- a/dumux/material/fluidstates/nonequilibrium.hh +++ b/dumux/material/fluidstates/nonequilibrium.hh @@ -68,20 +68,20 @@ public: * on thermodynamic equilibrium required) *****************************************************/ /*! - * \brief Returns the saturation of a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::saturation() */ Scalar saturation(int phaseIdx) const { return saturation_[phaseIdx]; } /*! - * \brief The mole fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::moleFraction() */ Scalar moleFraction(int phaseIdx, int compIdx) const { return moleFraction_[phaseIdx][compIdx]; } /*! - * \brief The mass fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::massFraction() */ Scalar massFraction(int phaseIdx, int compIdx) const { @@ -93,78 +93,67 @@ public: } /*! - * \brief The mean molar mass of a fluid phase \f$\mathrm{[kg/mol]}\f$ - * - * The average mass is the mean molar mass of a molecule of the - * fluid at current composition. It is defined as the sum of the - * component's molar masses weighted by the current mole fraction: - * \f[ \bar M_\alpha = \sum_\kappa M^\kappa x_\alpha^\kappa \f] + * @copydoc CompositionalFluidState::averageMolarMass() */ Scalar averageMolarMass(int phaseIdx) const { return averageMolarMass_[phaseIdx]; } /*! - * \brief The concentration of a component in a phase \f$\mathrm{[mol/m^3]}\f$ - * - * This quantity is often called "molar concentration" or just - * "concentration", but there are many other (though less common) - * measures for concentration. - * - * http://en.wikipedia.org/wiki/Concentration + * @copydoc CompositionalFluidState::molarity() */ Scalar molarity(int phaseIdx, int compIdx) const { return molarDensity(phaseIdx)*moleFraction(phaseIdx, compIdx); } /*! - * \brief The fugacity coefficient of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::fugacityCoefficient() */ Scalar fugacityCoefficient(int phaseIdx, int compIdx) const { return fugacityCoefficient_[phaseIdx][compIdx]; } /*! - * \brief The fugacity of a component in a phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::fugacity() */ Scalar fugacity(int phaseIdx, int compIdx) const { return pressure_[phaseIdx]*fugacityCoefficient_[phaseIdx][compIdx]*moleFraction_[phaseIdx][compIdx]; } /*! - * \brief The molar volume of a fluid phase \f$\mathrm{[m^3/mol]}\f$ + * @copydoc CompositionalFluidState::molarVolume() */ Scalar molarVolume(int phaseIdx) const { return 1/molarDensity(phaseIdx); } /*! - * \brief The mass density of a fluid phase \f$\mathrm{[kg/m^3]}\f$ + * @copydoc CompositionalFluidState::density() */ Scalar density(int phaseIdx) const { return density_[phaseIdx]; } /*! - * \brief The molar density of a fluid phase \f$\mathrm{[mol/m^3]}\f$ + * @copydoc CompositionalFluidState::molarDensity() */ Scalar molarDensity(int phaseIdx) const { return density_[phaseIdx]/averageMolarMass(phaseIdx); } /*! - * \brief The temperature of a fluid phase \f$\mathrm{[K]}\f$ + * @copydoc CompositionalFluidState::temperature() */ Scalar temperature(int phaseIdx) const { return temperature_[phaseIdx]; } /*! - * \brief The pressure of a fluid phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::pressure() */ Scalar pressure(int phaseIdx) const { return pressure_[phaseIdx]; } /*! - * \brief The specific enthalpy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::enthalpy() */ Scalar enthalpy(int phaseIdx) const { return enthalpy_[phaseIdx]; } /*! - * \brief The specific internal energy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::internalEnergy() */ Scalar internalEnergy(int phaseIdx) const { @@ -173,7 +162,7 @@ public: } /*! - * \brief The dynamic viscosity of a fluid phase \f$\mathrm{[Pa s]}\f$ + * @copydoc CompositionalFluidState::viscosity() */ Scalar viscosity(int phaseIdx) const { return viscosity_[phaseIdx]; } diff --git a/dumux/material/fluidstates/nonequilibriumenergy.hh b/dumux/material/fluidstates/nonequilibriumenergy.hh index 7203cc071a..3bcbc1d2ff 100644 --- a/dumux/material/fluidstates/nonequilibriumenergy.hh +++ b/dumux/material/fluidstates/nonequilibriumenergy.hh @@ -79,7 +79,7 @@ public: { return fugacity(0, compIdx); } /*! - * \brief The fugacity of a component in a phase \f$\mathrm{[Pa]}\f$ + * @copydoc NonEquilibriumFluidState::fugacity() */ Scalar fugacity(int phaseIdx, int compIdx) const { diff --git a/dumux/material/fluidstates/pressureoverlay.hh b/dumux/material/fluidstates/pressureoverlay.hh index 2a29b3ad5b..18309fab90 100644 --- a/dumux/material/fluidstates/pressureoverlay.hh +++ b/dumux/material/fluidstates/pressureoverlay.hh @@ -80,102 +80,91 @@ public: * on thermodynamic equilibrium required) *****************************************************/ /*! - * \brief Returns the saturation of a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::saturation() */ Scalar saturation(int phaseIdx) const { return fs_->saturation(phaseIdx); } /*! - * \brief The mole fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::moleFraction() */ Scalar moleFraction(int phaseIdx, int compIdx) const { return fs_->moleFraction(phaseIdx, compIdx); } /*! - * \brief The mass fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::massFraction() */ Scalar massFraction(int phaseIdx, int compIdx) const { return fs_->massFraction(phaseIdx, compIdx); } /*! - * \brief The average molar mass of a fluid phase \f$\mathrm{[kg/mol]}\f$ - * - * The average mass is the mean molar mass of a molecule of the - * fluid at current composition. It is defined as the sum of the - * component's molar masses weighted by the current mole fraction: - * \f[ \bar M_\alpha = \sum_\kappa M^\kappa x_\alpha^\kappa \f] + * @copydoc CompositionalFluidState::averageMolarMass() */ Scalar averageMolarMass(int phaseIdx) const { return fs_->averageMolarMass(phaseIdx); } /*! - * \brief The molar concentration of a component in a phase \f$\mathrm{[mol/m^3]}\f$ - * - * This quantity is usually called "molar concentration" or just - * "concentration", but there are many other (though less common) - * measures for concentration. - * - * http://en.wikipedia.org/wiki/Concentration + * @copydoc CompositionalFluidState::molarity() */ Scalar molarity(int phaseIdx, int compIdx) const { return fs_->molarity(phaseIdx, compIdx); } /*! - * \brief The fugacity of a component in a phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::fugacity() */ Scalar fugacity(int phaseIdx, int compIdx) const { return fs_->fugacity(phaseIdx, compIdx); } /*! - * \brief The fugacity coefficient of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::fugacityCoefficient() */ Scalar fugacityCoefficient(int phaseIdx, int compIdx) const { return fs_->fugacityCoefficient(phaseIdx, compIdx); } /*! - * \brief The molar volume of a fluid phase \f$\mathrm{[m^3/mol]}\f$ + * @copydoc CompositionalFluidState::molarVolume() */ Scalar molarVolume(int phaseIdx) const { return fs_->molarVolume(phaseIdx); } /*! - * \brief The mass density of a fluid phase \f$\mathrm{[kg/m^3]}\f$ + * @copydoc CompositionalFluidState::density() */ Scalar density(int phaseIdx) const { return fs_->density(phaseIdx); } /*! - * \brief The molar density of a fluid phase \f$\mathrm{[mol/m^3]}\f$ + *@copydoc CompositionalFluidState::molarDensity() */ Scalar molarDensity(int phaseIdx) const { return fs_->molarDensity(phaseIdx); } /*! - * \brief The temperature of a fluid phase \f$\mathrm{[K]}\f$ + * @copydoc CompositionalFluidState::temperature() */ Scalar temperature(int phaseIdx) const { return fs_->temperature(phaseIdx); } /*! - * \brief The pressure of a fluid phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::pressure() */ Scalar pressure(int phaseIdx) const { return pressure_[phaseIdx]; } /*! - * \brief The specific enthalpy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::enthalpy() */ Scalar enthalpy(int phaseIdx) const { return fs_->enthalpy(phaseIdx); } /*! - * \brief The specific internal energy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::internalEnergy() */ Scalar internalEnergy(int phaseIdx) const { return fs_->internalEnergy(phaseIdx); } /*! - * \brief The dynamic viscosity of a fluid phase \f$\mathrm{[Pa s]}\f$ + * @copydoc CompositionalFluidState::viscosity() */ Scalar viscosity(int phaseIdx) const { return fs_->viscosity(phaseIdx); } diff --git a/dumux/material/fluidstates/pseudo1p2c.hh b/dumux/material/fluidstates/pseudo1p2c.hh index e6874ebd01..9f7afd26e3 100644 --- a/dumux/material/fluidstates/pseudo1p2c.hh +++ b/dumux/material/fluidstates/pseudo1p2c.hh @@ -61,8 +61,7 @@ public: public: /*! \name Acess functions */ //@{ - /*! \brief Returns the saturation of a phase. - * \param phaseIdx Index of the phase + /*! @copydoc CompositionalFluidState::saturation() */ Scalar saturation(int phaseIdx) const { @@ -92,10 +91,7 @@ public: } /*! - * \brief Return the partial pressure of a component in a phase. - * - * \param phaseIdx the index of the phase - * \param compIdx the index of the component + * @copydoc CompositionalFluidState::partialPressure() */ Scalar partialPressure(int phaseIdx, int compIdx) const { @@ -103,16 +99,13 @@ public: return pressure(phaseIdx)*moleFraction(phaseIdx, compIdx); } - /*! \brief Returns the pressure of a fluid phase \f$\mathrm{[Pa]}\f$. - * \param phaseIdx Index of the phase + /*! @copydoc CompositionalFluidState::pressure() */ Scalar pressure(int phaseIdx) const { return pressure_[phaseIdx]; } /*! - * \brief Returns the density of a phase \f$\mathrm{[kg/m^3]}\f$. - * - * \param phaseIdx the index of the phase + * @copydoc CompositionalFluidState::density() */ Scalar density(int phaseIdx) const { @@ -124,9 +117,7 @@ public: } /*! - * \brief Returns the mass fraction of a component in a phase. - * \param phaseIdx Index of the phase - * \param compIdx Index of the component + * @copydoc CompositionalFluidState::massFraction() */ Scalar massFraction(int phaseIdx, int compIdx) const { @@ -147,9 +138,7 @@ public: } /*! - * \brief Returns the molar fraction of a component in a fluid phase. - * \param phaseIdx Index of the phase - * \param compIdx Index of the component + * @copydoc CompositionalFluidState::moleFraction() */ Scalar moleFraction(int phaseIdx, int compIdx) const { @@ -168,9 +157,7 @@ public: } /*! - * \brief Returns the viscosity of a phase \f$\mathrm{[Pa s]}\f$. - * - * \param phaseIdx the index of the phase + * @copydoc CompositionalFluidState::viscosity() */ Scalar viscosity(int phaseIdx) const { @@ -179,12 +166,7 @@ public: } /*! - * \brief The average molar mass of a fluid phase [kg/mol] - * - * The average molar mass is the mean mass of a mole of the - * fluid at current composition. It is defined as the sum of the - * component's molar masses weighted by the current mole fraction: - * \f[ \bar M_\alpha = \sum_\kappa M^\kappa x_\alpha^\kappa \f] + * @copydoc CompositionalFluidState::averageMolarMass() */ Scalar averageMolarMass(int phaseIdx) const { @@ -192,9 +174,7 @@ public: } /*! - * \brief Returns the enthalpy of a phase. - * - * \param phaseIdx the index of the phase + * @copydoc CompositionalFluidState::enthalpy() */ Scalar enthalpy(int phaseIdx) const { @@ -205,7 +185,7 @@ public: } /*! - * \brief The specific internal energy of a fluid phase [J/kg] + * @copydoc CompositionalFluidState::internalEnergy() */ Scalar internalEnergy(int phaseIdx) const { diff --git a/dumux/material/fluidstates/saturationoverlay.hh b/dumux/material/fluidstates/saturationoverlay.hh index 29d58fd671..3294b4a955 100644 --- a/dumux/material/fluidstates/saturationoverlay.hh +++ b/dumux/material/fluidstates/saturationoverlay.hh @@ -78,102 +78,91 @@ public: * on thermodynamic equilibrium required) *****************************************************/ /*! - * \brief Returns the saturation of a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::saturation() */ Scalar saturation(int phaseIdx) const { return saturation_[phaseIdx]; } /*! - * \brief The mole fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::moleFraction() */ Scalar moleFraction(int phaseIdx, int compIdx) const { return fs_->moleFraction(phaseIdx, compIdx); } /*! - * \brief The mass fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::massFraction() */ Scalar massFraction(int phaseIdx, int compIdx) const { return fs_->massFraction(phaseIdx, compIdx); } /*! - * \brief The average molar mass of a fluid phase \f$\mathrm{[kg/mol]}\f$ - * - * The average mass is the mean molar mass of a molecule of the - * fluid at current composition. It is defined as the sum of the - * component's molar masses weighted by the current mole fraction: - * \f[ \bar M_\alpha = \sum_\kappa M^\kappa x_\alpha^\kappa \f] + * @copydoc CompositionalFluidState::averageMolarMass() */ Scalar averageMolarMass(int phaseIdx) const { return fs_->averageMolarMass(phaseIdx); } /*! - * \brief The molar concentration of a component in a phase \f$\mathrm{[mol/m^3]}\f$ - * - * This quantity is usually called "molar concentration" or just - * "concentration", but there are many other (though less common) - * measures for concentration. - * - * http://en.wikipedia.org/wiki/Concentration + * @copydoc CompositionalFluidState::molarity() */ Scalar molarity(int phaseIdx, int compIdx) const { return fs_->molarity(phaseIdx, compIdx); } /*! - * \brief The fugacity of a component in a phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::fugacity() */ Scalar fugacity(int phaseIdx, int compIdx) const { return fs_->fugacity(phaseIdx, compIdx); } /*! - * \brief The fugacity coefficient of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::fugacityCoefficient() */ Scalar fugacityCoefficient(int phaseIdx, int compIdx) const { return fs_->fugacityCoefficient(phaseIdx, compIdx); } /*! - * \brief The molar volume of a fluid phase \f$\mathrm{[m^3/mol]}\f$ + * @copydoc CompositionalFluidState::molarVolume() */ Scalar molarVolume(int phaseIdx) const { return fs_->molarVolume(phaseIdx); } /*! - * \brief The mass density of a fluid phase \f$\mathrm{[kg/m^3]}\f$ + * @copydoc CompositionalFluidState::density() */ Scalar density(int phaseIdx) const { return fs_->density(phaseIdx); } /*! - * \brief The molar density of a fluid phase \f$\mathrm{[mol/m^3]}\f$ + * @copydoc CompositionalFluidState::molarDensity() */ Scalar molarDensity(int phaseIdx) const { return fs_->molarDensity(phaseIdx); } /*! - * \brief The temperature of a fluid phase \f$\mathrm{[K]}\f$ + * @copydoc CompositionalFluidState::temperature() */ Scalar temperature(int phaseIdx) const { return fs_->temperature(phaseIdx); } /*! - * \brief The pressure of a fluid phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::pressure() */ Scalar pressure(int phaseIdx) const { return fs_->pressure(phaseIdx); } /*! - * \brief The specific enthalpy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::enthalpy() */ Scalar enthalpy(int phaseIdx) const { return fs_->enthalpy(phaseIdx); } /*! - * \brief The specific internal energy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::internalEnergy() */ Scalar internalEnergy(int phaseIdx) const { return fs_->internalEnergy(phaseIdx); } /*! - * \brief The dynamic viscosity of a fluid phase \f$\mathrm{[Pa s]}\f$ + * @copydoc CompositionalFluidState::viscosity() */ Scalar viscosity(int phaseIdx) const { return fs_->viscosity(phaseIdx); } diff --git a/dumux/material/fluidstates/temperatureoverlay.hh b/dumux/material/fluidstates/temperatureoverlay.hh index 796af39329..576d0b8aee 100644 --- a/dumux/material/fluidstates/temperatureoverlay.hh +++ b/dumux/material/fluidstates/temperatureoverlay.hh @@ -80,72 +80,61 @@ public: * on thermodynamic equilibrium required) *****************************************************/ /*! - * \brief Returns the saturation of a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::saturation() */ Scalar saturation(int phaseIdx) const { return fs_->saturation(phaseIdx); } /*! - * \brief The mole fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::moleFraction() */ Scalar moleFraction(int phaseIdx, int compIdx) const { return fs_->moleFraction(phaseIdx, compIdx); } /*! - * \brief The mass fraction of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::massFraction() */ Scalar massFraction(int phaseIdx, int compIdx) const { return fs_->massFraction(phaseIdx, compIdx); } /*! - * \brief The average molar mass of a fluid phase \f$\mathrm{[kg/mol]}\f$ - * - * The average mass is the mean molar mass of a molecule of the - * fluid at current composition. It is defined as the sum of the - * component's molar masses weighted by the current mole fraction: - * \f[ \bar M_\alpha = \sum_\kappa M^\kappa x_\alpha^\kappa \f] + * @copydoc CompositionalFluidState::averageMolarMass() */ Scalar averageMolarMass(int phaseIdx) const { return fs_->averageMolarMass(phaseIdx); } /*! - * \brief The molar concentration of a component in a phase \f$\mathrm{[mol/m^3]}\f$ - * - * This quantity is usually called "molar concentration" or just - * "concentration", but there are many other (though less common) - * measures for concentration. - * - * http://en.wikipedia.org/wiki/Concentration + * @copydoc CompositionalFluidState::molarity() */ Scalar molarity(int phaseIdx, int compIdx) const { return fs_->molarity(phaseIdx, compIdx); } /*! - * \brief The fugacity of a component in a phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::fugacity() */ Scalar fugacity(int phaseIdx, int compIdx) const { return fs_->fugacity(phaseIdx, compIdx); } /*! - * \brief The fugacity coefficient of a component in a phase \f$\mathrm{[-]}\f$ + * @copydoc CompositionalFluidState::fugacityCoefficient() */ Scalar fugacityCoefficient(int phaseIdx, int compIdx) const { return fs_->fugacityCoefficient(phaseIdx, compIdx); } /*! - * \brief The molar volume of a fluid phase \f$\mathrm{[m^3/mol]}\f$ + * @copydoc CompositionalFluidState::molarVolume() */ Scalar molarVolume(int phaseIdx) const { return fs_->molarVolume(phaseIdx); } /*! - * \brief The mass density of a fluid phase \f$\mathrm{[kg/m^3]}\f$ + * @copydoc CompositionalFluidState::density() */ Scalar density(int phaseIdx) const { return fs_->density(phaseIdx); } /*! - * \brief The molar density of a fluid phase \f$\mathrm{[mol/m^3]}\f$ + * @copydoc CompositionalFluidState::molarDensity() */ Scalar molarDensity(int phaseIdx) const { return fs_->molarDensity(phaseIdx); } @@ -157,25 +146,25 @@ public: { return temperature_; } /*! - * \brief The pressure of a fluid phase \f$\mathrm{[Pa]}\f$ + * @copydoc CompositionalFluidState::pressure() */ Scalar pressure(int phaseIdx) const { return fs_->pressure(phaseIdx); } /*! - * \brief The specific enthalpy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::enthalpy() */ Scalar enthalpy(int phaseIdx) const { return fs_->enthalpy(phaseIdx); } /*! - * \brief The specific internal energy of a fluid phase \f$\mathrm{[J/kg]}\f$ + * @copydoc CompositionalFluidState::internalEnergy() */ Scalar internalEnergy(int phaseIdx) const { return fs_->internalEnergy(phaseIdx); } /*! - * \brief The dynamic viscosity of a fluid phase \f$\mathrm{[[Pa s]}\f$ + * @copydoc CompositionalFluidState::viscosity() */ Scalar viscosity(int phaseIdx) const { return fs_->viscosity(phaseIdx); } -- GitLab From b59a2c22dd2fea500a9fb7040dea4c2e54d7afda Mon Sep 17 00:00:00 2001 From: Kissinger Date: Mon, 7 Mar 2016 11:56:14 +0100 Subject: [PATCH 6/8] [Handbook] Changes in 5.5 Fluid Framework - Rename Fluid Framework to Material and Fluid Framework - Removed content by reference to Doxygen documentation --- doc/handbook/5_fluidframework.tex | 464 +----------------------------- 1 file changed, 2 insertions(+), 462 deletions(-) diff --git a/doc/handbook/5_fluidframework.tex b/doc/handbook/5_fluidframework.tex index 21ffb593b9..2a242f22e8 100644 --- a/doc/handbook/5_fluidframework.tex +++ b/doc/handbook/5_fluidframework.tex @@ -1,466 +1,6 @@ -\section{Fluid Framework} +\section{Material and Fluid Framework} \label{sec:fluidframework} -This chapter discusses the \Dumux fluid framework. \Dumux users who -do not want to write new models and who do not need new fluid -configurations may skip this chapter. +Detailed explanations for the \Dumux material and fluid framework can be found in the Doxygen documentation via \texttt{Modules -> Material and Fluid Framework}. -In the chapter, a high level overview over the the principle concepts -is provided first, then some implementation details follow. -\subsection{Overview} - -The \Dumux fluid framework currently features the following concepts -(listed roughly in their order of importance): - -\begin{description} -\item[Fluid state:] Fluid states are responsible for representing the - complete thermodynamic configuration of a system at a given spatial - and temporal position. A fluid state always provides access methods - to {\bf all} thermodynamic quantities, but the concept of a fluid state does not - mandate what assumptions are made to store these thermodynamic - quantities. What fluid states also do {\bf not} do is to make sure - that the thermodynamic state which they represent is physically - possible. -\item[Fluid system:] Fluid systems express the thermodynamic {\bf - relations}\footnote{Strictly speaking, these relations are - functions, mathematically.} between quantities. Since functions do - not exhibit any internal state, fluid systems are stateless classes, - i.e. all member functions are \texttt{static}. This is a conscious - decision since the thermodynamic state of the system is expressed by - a fluid state! -\item[Parameter cache:] Fluid systems sometimes require - computationally expensive parameters for multiple relations. Such - parameters can be cached using a so-called parameter - cache. Parameter cache objects are specific for each fluid system - but they must provide a common interface to update the internal - parameters depending on the quantities which changed since the last - update. -\item[Constraint solver:] Constraint solvers are auxiliary tools to - make sure that a fluid state is consistent with some thermodynamic - constraints. All constraint solvers specify a well defined set of - input variables and make sure that the resulting fluid state is - consistent with a given set of thermodynamic equations. See section - \ref{sec:constraint_solvers} for a detailed description of the - constraint solvers which are currently available in \Dumux. -\item[Equation of state:] Equations of state (EOS) are auxiliary - classes which provide relations between a fluid phase's temperature, - pressure, composition and density. Since these classes are only used - internally in fluid systems, their programming interface is - currently ad-hoc. -\item[Component:] Components are fluid systems which provide the - thermodynamic relations for the liquid and gas phase of a single - chemical species or a fixed mixture of species. Their main purpose - is to provide a convenient way to access these quantities from - full-fledged fluid systems. Components are not supposed to be used - by models directly. -\item[Binary coefficient:] Binary coefficients describe the relations - of a mixture of two components. Typical binary coefficients are - \textsc{Henry} coefficients or binary molecular diffusion - coefficients. So far, the programming interface for accessing binary - coefficients has not been standardized in \Dumux. -\end{description} - -\subsection{Fluid States} -Fluid state objects express the complete thermodynamic state of a -system at a given spatial and temporal position. - -\subsubsection{Exported Constants} -All fluid states must export the following constants: -\begin{description} -\item[numPhases:] The number of fluid phases considered. -\item[numComponents:] The number of considered chemical species or pseudo-species. -\end{description} - -\subsubsection{Accessible Thermodynamic Quantities} -Also, all fluid states must provide the following methods: -\begin{description} -\item[temperature():] The absolute temperature $T_\alpha$ of - a fluid phase $\alpha$. -\item[pressure():] The absolute pressure $p_\alpha$ of a - fluid phase $\alpha$. -\item[saturation():] The saturation $S_\alpha$ of a fluid phase - $\alpha$. The saturation is defined as the pore space occupied by - the fluid divided by the total pore space: - \[ - \saturation_\alpha := \frac{\porosity \mathcal{V}_\alpha}{\porosity \mathcal{V}} - \] -\item[moleFraction():] Returns the molar fraction $x^\kappa_\alpha$ of - the component $\kappa$ in fluid phase $\alpha$. The molar fraction - $x^\kappa_\alpha$ is defined as the ratio of the number of molecules - of component $\kappa$ and the total number of molecules of the phase - $\alpha$. -\item[massFraction():] Returns the mass fraction $X^\kappa_\alpha$ of - component $\kappa$ in fluid phase $\alpha$. The mass fraction - $X^\kappa_\alpha$ is defined as the weight of all molecules of a - component divided by the total mass of the fluid phase. It is - related with the component's mole fraction by means of the relation - \[ - X^\kappa_\alpha = x^\kappa_\alpha \frac{M^\kappa}{\overline M_\alpha}\;, - \] - where $M^\kappa$ is the molar mass of component $\kappa$ and - $\overline M_\alpha$ is the mean molar mass of a molecule of phase - $\alpha$. -\item[averageMolarMass():] Returns $\overline M_\alpha$, the mean - molar mass of a molecule of phase $\alpha$. For a mixture of $N > 0$ - components, $\overline M_\alpha$ is defined as - \[ - \overline M_\alpha = \sum_{\kappa=1}^{N} x^\kappa_\alpha M^\kappa - \] -\item[density():] Returns the density $\rho_\alpha$ of the fluid phase - $\alpha$. -\item[molarDensity():] Returns the molar density $\rho_{mol,\alpha}$ - of a fluid phase $\alpha$. The molar density is defined by the mass - density $\rho_\alpha$ and the mean molar mass $\overline M_\alpha$: - \[ - \rho_{mol,\alpha} = \frac{\rho_\alpha}{\overline M_\alpha} \;. - \] -\item[molarVolume():] Returns the molar volume $v_{mol,\alpha}$ of a - fluid phase $\alpha$. This quantity is the inverse of the molar - density. -\item[molarity():] Returns the molar concentration $c^\kappa_\alpha$ - of component $\kappa$ in fluid phase $\alpha$. -\item[fugacity():] Returns the fugacity $f^\kappa_\alpha$ of component - $\kappa$ in fluid phase $\alpha$. The fugacity is defined as - \[ - f_\alpha^\kappa := \Phi^\kappa_\alpha x^\kappa_\alpha p_\alpha \;, - \] - where $\Phi^\kappa_\alpha$ is the {\em fugacity - coefficient}~\cite{reid1987}. The physical meaning of fugacity - becomes clear from the equation - \[ - f_\alpha^\kappa = p_\alpha \exp\left\{\frac{\zeta^\kappa_\alpha}{R T_\alpha} \right\} \;, - \] - where $\zeta^\kappa_\alpha$ represents the $\kappa$'s chemical - potential in phase $\alpha$, $R$ stands for the ideal gas constant, - and $T_\alpha$ for the absolute temperature of phase - $\alpha$. Assuming thermal equilibrium, there is a one-to-one - mapping between a component's chemical potential - $\zeta^\kappa_\alpha$ and its fugacity $f^\kappa_\alpha$. In this - case chemical equilibrium can thus be expressed by - \[ - f^\kappa := f^\kappa_\alpha = f^\kappa_\beta\quad\forall \alpha, \beta - \] -\item[fugacityCoefficient():] Returns the fugacity coefficient - $\Phi^\kappa_\alpha$ of component $\kappa$ in fluid phase $\alpha$. -\item[enthalpy():] Returns specific enthalpy $h_\alpha$ of a fluid - phase $\alpha$. -\item[internalEnergy():] Returns specific internal energy $u_\alpha$ - of a fluid phase $\alpha$. The specific internal energy is defined - by the relation - \[ - u_\alpha = h_\alpha - \frac{p_\alpha}{\rho_\alpha} - \] -\item[viscosity():] Returns the dynamic viscosity - $\mu_\alpha$ of fluid phase $\alpha$. -\end{description} - -\subsubsection{Available Fluid States} -Currently, the following fluid states are provided by \Dumux: -\begin{description} -\item[NonEquilibriumFluidState:] This is the most general fluid state - supplied. It does not assume thermodynamic equilibrium and thus - stores all phase compositions (using mole fractions), fugacity - coefficients, phase temperatures, phase pressures, saturations and - specific enthalpies. -\item[CompositionalFluidState:] This fluid state is very similar to - the \texttt{Non\-Equilibrium\-Fluid\-State} with the difference that - the \texttt{Compositional\-Fluid\-State} assumes thermodynamic - equilibrium. In the context of multi-phase flow in porous media, - this means that only a single temperature needs to be stored. -\item[ImmisicibleFluidState:] This fluid state assumes that the fluid - phases are immiscible, which implies that the phase compositions and - the fugacity coefficients do not need to be stored explicitly. -\item[PressureOverlayFluidState:] This is a so-called {\em overlay} - fluid state. It allows to set the pressure of all fluid phases but - forwards everything else to another fluid state. -\item[SaturationOverlayFluidState:] This fluid state is like the - \texttt{PressureOverlayFluidState}, except that the phase - saturations are settable instead of the phase pressures. -\item[TempeatureOverlayFluidState:] This fluid state is like the - \texttt{PressureOverlayFluidState}, except that the temperature is - settable instead of the phase pressures. Note that this overlay - state assumes thermal equilibrium regardless of underlying fluid - state. -\item[CompositionOverlayFluidState:] This fluid state is like the - \texttt{PressureOverlayFluidState}, except that the phase - composition is settable (in terms of mole fractions) instead of the - phase pressures. -\end{description} - -\subsection{Fluid Systems} - -Fluid systems express the thermodynamic relations between the -quantities of a fluid state. - -\subsubsection{Parameter Caches} - -All fluid systems must export a type for their \texttt{ParameterCache} -objects. Parameter caches can be used to cache parameter that are -expensive to compute and are required in multiple thermodynamic -relations. For fluid systems which do need to cache parameters, -\Dumux provides a \texttt{NullParameterCache} class. - -The actual quantities stored by parameter cache objects are specific -to the fluid system and no assumptions on what they provide should be -made outside of their fluid system. Parameter cache objects provide a -well-defined set of methods to make them coherent with a given fluid -state, though. These update are: -\begin{description} -\item[updateAll(fluidState, except):] Update all cached quantities for - all phases. The \texttt{except} argument contains a bit field of the - quantities which have not been modified since the last call to a - \texttt{update()} method. -\item[updateAllPresures(fluidState):] Update all cached quantities - which depend on the pressure of any fluid phase. -\item[updateAllTemperatures(fluidState):] Update all cached quantities - which depend on temperature of any fluid phase. -\item[updatePhase(fluidState, phaseIdx, except):] Update all cached - quantities for a given phase. The quantities specified by the - \texttt{except} bit field have not been modified since the last call - to an \texttt{update()} method. -\item[updateTemperature(fluidState, phaseIdx):] Update all cached - quantities which depend on the temperature of a given phase. -\item[updatePressure(fluidState, phaseIdx):] Update all cached - quantities which depend on the pressure of a given phase. -\item[updateComposition(fluidState, phaseIdx):] Update all cached - quantities which depend on the composition of a given phase. -\item[updateSingleMoleFraction(fluidState, phaseIdx, compIdx):] Update - all cached quantities which depend on the value of the mole fraction - of a component in a phase. -\end{description} -Note, that the parameter cache interface only guarantees that if a -more specialized \texttt{update()} method is called, it is not slower -than the next more-general method (e.g. calling -\texttt{updateSingleMoleFraction()} may be as expensive as -\texttt{updateAll()}). It is thus advisable to rather use a more -general \texttt{update()} method once than multiple calls to -specialized \texttt{update()} methods. - -To make usage of parameter caches easier for the case where all cached -quantities ought to be re-calculated if a quantity of a phase was -changed, it is possible to only define the \texttt{updatePhase()} -method and derive the parameter cache from -\texttt{Dumux::ParameterCacheBase}. - -\subsubsection{Exported Constants and Capabilities} - -Besides providing the type of their \texttt{ParameterCache} objects, -fluid systems need to export the following constants and auxiliary -methods: -\begin{description} -\item[numPhases:] The number of considered fluid phases. -\item[numComponents:] The number of considered chemical (pseudo-) - species. -\item[init():] Initialize the fluid system. This is usually used to - tabulate some quantities -\item[phaseName():] Given the index of a fluid phase, return its name - as human-readable string. -\item[componentName():] Given the index of a component, return its - name as human-readable string. -\item[isLiquid():] Return whether the phase is a liquid, given the - index of a phase. -\item[isIdealMixture():] Return whether the phase is an ideal mixture, - given the phase index. In the context of the \Dumux fluid - framework a phase $\alpha$ is an ideal mixture if, and only if, all - its fugacity coefficients $\Phi^\kappa_\alpha$ do not depend on the - phase composition. (Although they might very well depend on - temperature and pressure.) -\item[isIdealGas():] Return whether a phase $\alpha$ is an ideal gas, - i.e. it adheres to the relation - \[ - p_\alpha v_{mol,\alpha} = R T_\alpha \;, - \] - with $R$ being the ideal gas constant. -\item[isCompressible():] Return whether a phase $\alpha$ is - compressible, i.e. its density depends on pressure $p_\alpha$. -\item[molarMass():] Given a component index, return the molar mass of - the corresponding component. -\end{description} - -\subsubsection{Thermodynamic Relations} - -Fluid systems have been explicitly designed to provide as few -thermodynamic relations as possible. A full-fledged fluid system thus -only needs to provide the following thermodynamic relations: -\begin{description} -\item[density():] Given a fluid state, an up-to-date parameter cache - and a phase index, return the mass density $\rho_\alpha$ of the - phase. -\item[fugacityCoefficient():] Given a fluid state, an up-to-date - parameter cache as well as a phase and a component index, return the - fugacity coefficient $\Phi^\kappa_\alpha$ of a the component for the - phase. -\item[viscosity():] Given a fluid state, an up-to-date parameter cache - and a phase index, return the dynamic viscosity $\mu_\alpha$ of the - phase. -\item[diffusionCoefficient():] Given a fluid state, an up-to-date - parameter cache, a phase and a component index, return the calculate - the molecular diffusion coefficient for the component in the fluid - phase. - - Molecular diffusion of a component $\kappa$ in phase $\alpha$ is - caused by a gradient of the chemical potential and follows the law - \[ - J^\kappa_\alpha = - D^\kappa_\alpha\ \mathbf{grad} \zeta^\kappa_\alpha\;, - \] - where $\zeta^\kappa_\alpha$ is the component's chemical potential, - $D^\kappa_\alpha$ is the diffusion coefficient and $J^\kappa_\alpha$ - is the diffusive flux. $\zeta^\kappa_\alpha$ is connected to the - component's fugacity $f^\kappa_\alpha$ by the relation - \[ - \zeta^\kappa_\alpha = - R T_\alpha \mathrm{ln} \frac{f^\kappa_\alpha}{p_\alpha} \;. - \] -\item[binaryDiffusionCoefficient():] Given a fluid state, an - up-to-date parameter cache, a phase index and two component indices, - return the binary diffusion coefficient for the binary mixture. This - method is less general than \texttt{diffusionCoefficient} method, - but relations can only be found for binary diffusion coefficients in - the literature. -\item[enthalpy():] Given a fluid state, an up-to-date parameter cache - and a phase index, this method calulates the specific enthalpy - $h_\alpha$ of the phase. -\item[thermalConductivity:] Given a fluid state, an up-to-date - parameter cache and a phase index, this method returns the thermal - conductivity $\lambda_\alpha$ of the fluid phase. The thermal - conductivity is defined by means of the relation - \[ - \dot Q = \lambda_\alpha \mathbf{grad}\;T_\alpha \;, - \] - where $\dot Q$ is the heat flux caused by the temperature gradient - $\mathbf{grad}\;T_\alpha$. -\item[heatCapacity():] Given a fluid state, an up-to-date parameter - cache and a phase index, this method computes the isobaric heat - capacity $c_{p,\alpha}$ of the fluid phase. The isobaric heat - capacity is defined as the partial derivative of the specific - enthalpy $h_\alpha$ to the fluid pressure: - \[ - c_{p,\alpha} = \frac{\partial h_\alpha}{\partial p_\alpha} - \] - % TODO: remove the heatCapacity() method?? -\end{description} - -Fluid systems may chose not to implement some of these methods and -throw an exception of type \lstinline{Dune::NotImplemented} instead. Obviously, -such fluid systems cannot be used for models that depend on those -methods. - -\subsubsection{Available Fluid Systems} -Currently, the following fluid systems are available in \Dumux: -\begin{description} -\item[Dumux::FluidSystems::TwoPImmiscible:] A two-phase fluid system - which assumes immiscibility of the fluid phases. The fluid phases - are thus completely specified by means of their constituting - components. This fluid system is intended to be used with models - that assume immiscibility. -\item[Dumux::FluidSystems::H2ON2:] A two-phase fluid system featuring - gas and liquid phases and distilled water ($H_2O$) and pure - molecular Nitrogen ($N_2$) as components. -\item[Dumux::FluidSystems::H2OAir:] A two-phase fluid system - featuring gas and liquid phases and distilled water ($H_2O$) and - air (Pseudo component composed of $79\%\;N_2$, $20\%\;O_2$ and - $1\%\;Ar$) as components. -\item[Dumux::FluidSystems::H2OAirMesitylene:] A three-phase fluid - system featuring gas, NAPL and water phases and distilled water, air - and Mesitylene ($C_6H_3(CH_3)_3$) as components. This fluid system - assumes all phases to be ideal mixtures. -\item[Dumux::FluidSystems::H2OAirXylene:] A three-phase fluid system - featuring gas, NAPL and water as phases and distilled water, air and - Xylene ($C_8H_{10}$) as components. This fluid system assumes all - phases to be ideal mixtures. -\item[Dumux::FluidSystems::Spe5:] A three-phase fluid system featuring - gas, oil and water as phases and the seven components distilled - water, Methane ($C_1$), Propane ($C_3$), Pentane ($C_5$), Heptane - ($C_7$), Decane ($C_{10}$), Pentadecane ($C_{15}$) and Icosane - ($C_{20}$). For the water phase the IAPWS-97 formulation is used as - equation of state, while for the gas and oil phases a - \textsc{Peng}-\textsc{Robinson} equation of state with slightly - modified parameters is used. This fluid system is highly non-linear, - and the gas and oil phases also cannot be considered ideal - mixtures\cite{SPE5}. -\end{description} - -\subsection{Constraint Solvers} -\label{sec:constraint_solvers} - -Constraint solvers connect the thermodynamic relations expressed by -fluid systems with the thermodynamic quantities stored by fluid -states. Using them is not mandatory for models, but given the fact -that some thermodynamic constraints can be quite complex to solve, -sharing this code between models makes sense. Currently, \Dumux -provides the following constraint solvers: -\begin{description} -\item[CompositionFromFugacities:] This constraint solver takes all - component fugacities, the temperature and pressure of a phase as - input and calculates the composition of the fluid phase. This means - that the thermodynamic constraints used by this solver are - \[ - f^\kappa = \Phi^\kappa_\alpha(\{x^\beta_\alpha \}, T_\alpha, p_\alpha) p_\alpha x^\kappa_\alpha\;, - \] - where ${f^\kappa}$, $T_\alpha$ and $p_\alpha$ are fixed values. -\item[ComputeFromReferencePhase:] This solver brings all - fluid phases into thermodynamic equilibrium with a reference phase - $\beta$, assuming that all phase temperatures and saturations have - already been set. The constraints used by this solver are thus - \begin{eqnarray*} - f^\kappa_\beta = f^\kappa_\alpha = \Phi^\kappa_\alpha(\{x^\beta_\alpha \}, T_\alpha, p_\alpha) p_\alpha x^\kappa_\alpha\;, \\ - p_\alpha = p_\beta + p_{c\beta\alpha} \;, - \end{eqnarray*} - where $p_{c\beta\alpha}$ is the capillary pressure between the - fluid phases $\beta$ and $\alpha$. -\item[CompositionalFlash:] A compositional 2p2c flash solver for the -sequential models in \Dumux. Input is temperature, phase pressures -and feed mass fraction, the solver computes the compositional variables and -saturations. -\item[NcpFlash:] This is a so-called flash solver. A flash solver - takes the total mass of all components per volume unit and the phase - temperatures as input and calculates all phase pressures, - saturations and compositions. This flash solver works for an - arbitrary number of phases $M > 0$ and components $N \geq M - 1$. In - this case, the unknown quantities are the following: - \begin{itemize} - \item $M$ pressures $p_\alpha$ - \item $M$ saturations $\saturation_\alpha$ - \item $M\cdot N$ mole fractions $x^\kappa_\alpha$ - \end{itemize} - This sums up to $M\cdot(N + 2)$. The equations side of things - provides: - \begin{itemize} - \item $(M - 1)\cdot N$ equations stemming from the fact that the - fugacity of any component is the same in all phases, i.e. - \[ - f^\kappa_\alpha = f^\kappa_\beta - \] - holds for all phases $\alpha, \beta$ and all components $\kappa$. - \item $1$ equation comes from the fact that the whole pore space is - filled by some fluid, i.e. - \[ - \sum_{\alpha=1}^M \saturation_\alpha = 1 - \] - \item $M - 1$ constraints are given by the capillary pressures: - \[ - p_\beta = p_\alpha + p_{c\beta\alpha} \;, - \] - for all phases $\alpha$, $\beta$ - \item $N$ constraints come the fact that the total mass of each - component is given: - \[ - c^\kappa_{tot} = \sum_{\alpha=1}^M x_\alpha^\kappa\;\rho_{mol,\alpha} = const - \] - \item And finally $M$ model assumptions are used. This solver uses - the NCP constraints proposed in~\cite{LHHW2011}: - \[ - 0 = \mathrm{min}\{\saturation_\alpha, 1 - \sum_{\kappa=1}^N x_\alpha^\kappa\} - \] -\end{itemize} -The number of equations also sums up to $M\cdot(N + 2)$. Thus, the -system of equations is closed. -\item[ImmiscibleFlash:] This is a flash solver assuming immiscibility - of the phases. It is similar to the \texttt{NcpFlash} solver but a - lot simpler. -\item[MiscibleMultiphaseComposition:] This solver calculates the - composition of all phases provided that each of the phases is - potentially present. Currently, this solver does not support - non-ideal mixtures. -\end{description} -- GitLab From 5a611705fdf0bf29d91f0b7b9b649633a43362b7 Mon Sep 17 00:00:00 2001 From: Kissinger Date: Mon, 7 Mar 2016 13:59:31 +0100 Subject: [PATCH 7/8] [Doxygen] Description of ParameterCache Modified formatting of descriptive text. --- doc/doxygen/modules.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/doxygen/modules.txt b/doc/doxygen/modules.txt index deb1e09b52..796cb32b1a 100644 --- a/doc/doxygen/modules.txt +++ b/doc/doxygen/modules.txt @@ -182,7 +182,6 @@ * but they must provide a common interface to update the internal * parameters depending on the quantities which changed since the last * update. - * * All fluid systems must export a type for their __ParameterCache__ * objects. Parameter caches can be used to cache parameter that are * expensive to compute and are required in multiple thermodynamic @@ -193,14 +192,12 @@ * made outside of their fluid system. Parameter cache objects provide a * well-defined set of methods to make them coherent with a given fluid * state, though. - * * Note, that the parameter cache interface only guarantees that if a * more specialized update() method is called, it is not slower * than the next more-general method (e.g. calling updateSingleMoleFraction() * may be as expensive as updateAll()}. It is thus advisable to * rather use a more general update() method once than multiple * calls to specialized update() methods. - * * To make usage of parameter caches easier for the case where all cached * quantities ought to be re-calculated if a quantity of a phase was changed, * it is possible to only define the updatePhase() method and -- GitLab From 93320d08d5640508315acdbb127fa29931579b3d Mon Sep 17 00:00:00 2001 From: Johannes Hommel Date: Tue, 8 Mar 2016 08:51:47 +0100 Subject: [PATCH 8/8] [fluidframework-doxygen] corrected the documentation for setFugacityCoefficient in the compositional fluidstate. --- dumux/material/fluidstates/compositional.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dumux/material/fluidstates/compositional.hh b/dumux/material/fluidstates/compositional.hh index 14d49625ad..f979fb0a1c 100644 --- a/dumux/material/fluidstates/compositional.hh +++ b/dumux/material/fluidstates/compositional.hh @@ -404,7 +404,8 @@ public: } /*! - * \brief Set the fugacity of a component in a phase \f$\mathrm{[Pa]}\f$ + * \brief Set the fugacity coefficient \f$\Phi^\kappa_\alpha\f$ of component \f$\kappa\f$ + * in fluid phase \f$\alpha\f$ in \f$\mathrm{[-]}\f$ */ void setFugacityCoefficient(int phaseIdx, int compIdx, Scalar value) { fugacityCoefficient_[phaseIdx][compIdx] = value; } -- GitLab