nonequilibriumenergy.hh 5.71 KB
 Bernd Flemisch committed Jan 22, 2016 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // vi: set et ts=4 sw=4 sts=4: /***************************************************************************** * See the file COPYING for full copying permissions. * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * *****************************************************************************/ /*! * \file  Simon Scholz committed Dec 20, 2017 21  * \ingroup FluidStates  Bernd Flemisch committed Jan 22, 2016 22 23 24 25 26 27 28 29 30  * \brief Represents all relevant thermodynamic quantities of a * multi-phase, multi-component fluid system without using * any assumptions. */ #ifndef DUMUX_NONEQUILIBRIUM_ENERGY_FLUID_STATE_HH #define DUMUX_NONEQUILIBRIUM_ENERGY_FLUID_STATE_HH #include #include  Timo Koch committed Dec 21, 2017 31 #include  Bernd Flemisch committed Jan 22, 2016 32   Timo Koch committed Dec 08, 2017 33 34 35 36 #include #include #include  Bernd Flemisch committed Jan 22, 2016 37 38 39 40 41 42 43 44 45 46 47 48 namespace Dumux { /*! * \ingroup FluidStates * \brief Represents all relevant thermodynamic quantities of a * multi-phase, multi-component fluid system * * This fluidstate ought to be used for the case of: * - local thermal non-equilibrium * - local chemical equilibrium */  Timo Koch committed Dec 08, 2017 49 50 51 52 template class NonEquilibriumEnergyFluidState : public NonEquilibriumFluidState {  Bernd Flemisch committed Jan 22, 2016 53 54 55 56 57 public: enum { numPhases = FluidSystem::numPhases }; enum { numComponents = FluidSystem::numComponents }; NonEquilibriumEnergyFluidState()  Timo Koch committed Dec 08, 2017 58 59  : NonEquilibriumFluidState() {}  Bernd Flemisch committed Jan 22, 2016 60 61 62 63 64 65 66 67 68 69 70 71 72 73  /***************************************************** * Access to fluid properties which only make sense * if assuming chemical equilibrium *****************************************************/ /*! * \brief The fugacity of a component * * This assumes chemical equilibrium. */ Scalar fugacity(int compIdx) const { return fugacity(0, compIdx); } /*!  Simon Scholz committed Dec 20, 2017 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89  * \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] */  Bernd Flemisch committed Jan 22, 2016 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133  Scalar fugacity(int phaseIdx, int compIdx) const { // Unfortunately throw does not work when triggered from a constructor std::cout <<"file: "<< __FILE__ << ", line: " << __LINE__ <<". This is a fluidstate for *thermal* non-equilibrium, not chemical! \n "; DUNE_THROW(Dune::NotImplemented, "This is a fluidstate for *thermal* non-equilibrium, not chemical!"); return 0.; } /***************************************************** * Setter methods. Note that these are not part of the * generic FluidState interface but specific for each * implementation... *****************************************************/ /*! * \brief Set the temperature \f$\mathrm{[K]}\f$ of a fluid phase * Both versions of the function need to be here. * Otherwise the compiler gets confused. * Thus, this is just forwarding to the Parent * (unclear why this is necessary). */ void setTemperature(int phaseIdx, Scalar value) { this->setTemperature(phaseIdx, value); } /*! * \brief Set the temperature \f$\mathrm{[K]}\f$ of a fluid phase * Both versions of the function need to be here. * Otherwise the compiler gets confused. * Thus, this is just presenting the signature to the compiler. */ void setTemperature(Scalar value) { // Unfortunately throw does not work when triggered from a constructor std::cout <<"file: "<< __FILE__ << ", line: " << __LINE__ <<". This is a fluidstate for *thermal* non-equilibrium, not chemical! \n "; DUNE_THROW(Dune::NotImplemented, "This is a fluidstate for *thermal* non-equilibrium, not chemical!"); } }; } // end namespace Dumux #endif